Skip to content

Commit 3f611f9

Browse files
committed
setSafeLowGasPrice added
1 parent 62e40e1 commit 3f611f9

File tree

1 file changed

+21
-0
lines changed
  • amisforum/live/conference

1 file changed

+21
-0
lines changed

amisforum/live/conference/app.js

+21
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,27 @@ function fundEth(newAddress, amt) {
260260
});
261261
}
262262

263+
function setSafeLowGasPrice() {
264+
var HttpClient = function() {
265+
this.get = function(aUrl, aCallback) {
266+
var anHttpRequest = new XMLHttpRequest();
267+
anHttpRequest.onreadystatechange = function() {
268+
if (anHttpRequest.readyState == 4 && anHttpRequest.status == 200)
269+
aCallback(anHttpRequest.responseText);
270+
}
271+
anHttpRequest.open( "GET", aUrl, true );
272+
anHttpRequest.send( null );
273+
}
274+
}
275+
var theurl='https://www.etherchain.org/api/gasPriceOracle';
276+
var client = new HttpClient();
277+
client.get(theurl, function(response) {
278+
var response1 = JSON.parse(response);
279+
280+
safeLowGasPrice = response1.safeLow;
281+
});
282+
}
283+
263284
window.onload = function() {
264285

265286
web3.eth.getAccounts(function(err, accs) {

0 commit comments

Comments
 (0)