Skip to content

Commit 097510b

Browse files
authored
Merge pull request #85 from Loopring/v2
add gasPrice
2 parents e5d8584 + 8a7bb6d commit 097510b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/relay/rpc/account.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export default class Account{
4646
getPendingRawTxByHash(txHash){
4747
return getPendingRawTxByHash(this.host,txHash)
4848
}
49+
getGasPrice(){
50+
return getGasPrice(this.host)
51+
}
4952
}
5053

5154

@@ -273,11 +276,25 @@ export function getPendingRawTxByHash(host,txHash) {
273276
body.params = params;
274277
body.id = id();
275278
body.jsonrpc = '2.0';
276-
return request({
279+
return request(host,{
277280
method: 'post',
278281
body,
279282
})
280283
}
281284

285+
/**
286+
* Get network gasPrice that relay computes
287+
* @returns {Promise}
288+
*/
289+
export async function getGasPrice(host) {
290+
let body = {};
291+
body.method = 'loopring_getEstimateGasPrice';
292+
body.params = [{}];
293+
return request(host,{
294+
method:'post',
295+
headers,
296+
body,
297+
})
298+
}
282299

283300

0 commit comments

Comments
 (0)