{{ $t("home.swappableAssets") }}
@@ -476,6 +498,14 @@
@click="copyToClipboard(account.ethAddress)"
>
mdi-content-copy
+
+
{{ $t("home.viewOnExplorer") }}
{{
$t("home.importETHWallet")
}}
- {{ $t("home.withYourKey") }}mdi-content-copy
+
+ {{ $t("home.viewOnExplorer") }}
mdi-content-copy
+
+ {{ $t("home.viewOnExplorer") }}
@@ -1169,7 +1212,8 @@
- {{ $t("home.burnConfirmation1") }} {{ burnAmount }} {{ burnSymbol }}.
+ {{ $t("home.burnConfirmation1") }} {{ burnAmount }}
+ {{ burnSymbol }}.
@@ -1177,7 +1221,11 @@
-
+
{{ $t("home.cancel") }}
@@ -2542,15 +2590,7 @@ export default class extends Vue {
) as number;
this.swapAmountDialog = true;
- const res = await fetch("https://gasprice.poa.network/");
-
- const resJson = await res.json();
-
- this.ethGasPrices[0] = resJson.slow;
- this.ethGasPrices[1] = resJson.standard;
- this.ethGasPrices[2] = parseFloat(
- ((resJson.fast + resJson.instant) / 2).toFixed(2)
- );
+ await this.fetchEthGasPrices();
}
async askSendEth(bal: ISymbolAmount) {
@@ -2571,15 +2611,7 @@ export default class extends Vue {
}
this.swapAmountDialog = true;
- const res = await fetch("https://gasprice.poa.network/");
-
- const resJson = await res.json();
-
- this.ethGasPrices[0] = resJson.slow;
- this.ethGasPrices[1] = resJson.standard;
- this.ethGasPrices[2] = parseFloat(
- ((resJson.fast + resJson.instant) / 2).toFixed(2)
- );
+ await this.fetchEthGasPrices();
}
askSwapFromNeo(bal: ISymbolAmount) {
@@ -2648,7 +2680,7 @@ export default class extends Vue {
console.log("hash from sendNeo", hash);
const neoApi = isMainnet
- ? "https://neoscan.io/transaction/"
+ ? "https://dora.coz.io/transaction/neo2/"
: "http://mankinighost.phantasma.io:4000/transaction/";
this.lastSwapTxUrl = neoApi + hash;
this.swapInProgressDialog = true;
@@ -3187,7 +3219,7 @@ export default class extends Vue {
async burnFT() {
if (!this.account) return;
- console.log("burning " + this.burnAmount + ' of ' + this.burnSymbol);
+ console.log("burning " + this.burnAmount + " of " + this.burnSymbol);
const address = this.account.address;
const gasPrice = 100000;
@@ -3197,7 +3229,11 @@ export default class extends Vue {
sb.beginScript();
sb.allowGas(address, sb.nullAddress, gasPrice, minGasLimit);
- sb.callInterop("Runtime.BurnTokens", [address, this.burnSymbol, Math.floor(this.burnAmount * 10 ** this.burnDecimals)]);
+ sb.callInterop("Runtime.BurnTokens", [
+ address,
+ this.burnSymbol,
+ Math.floor(this.burnAmount * 10 ** this.burnDecimals),
+ ]);
sb.spendGas(address);
const script = sb.endScript();
@@ -3407,15 +3443,7 @@ export default class extends Vue {
).replace(/ /gi, "")
);
- const res = await fetch("https://gasprice.poa.network/");
-
- const resJson = await res.json();
-
- this.ethGasPrices[0] = resJson.slow;
- this.ethGasPrices[1] = resJson.standard;
- this.ethGasPrices[2] = parseFloat(
- ((resJson.fast + resJson.instant) / 2).toFixed(2)
- );
+ await this.fetchEthGasPrices();
if (this.sendSymbol == "GAS") {
this.sendMaxAmount -= 0.1;
@@ -3451,15 +3479,54 @@ export default class extends Vue {
}
async onSwapsTab() {
- const res = await fetch("https://gasprice.poa.network/");
+ await this.fetchEthGasPrices();
+ }
- const resJson = await res.json();
+ async fetchEthGasPrices() {
+ const minPrices = [10, 30, 50];
+ const prices = [10, 30, 50];
+ let hasSetPrices = false;
- this.ethGasPrices[0] = resJson.slow;
- this.ethGasPrices[1] = resJson.standard;
- this.ethGasPrices[2] = parseFloat(
- ((resJson.fast + resJson.instant) / 2).toFixed(2)
- );
+ try {
+ const res = await fetch("https://gasprice.poa.network/");
+ const resJson = await res.json();
+
+ if (resJson) {
+ const slow = resJson.slow;
+ const standard = resJson.standard;
+ const fast = (resJson.fast + resJson.instant) / 2;
+ if (slow > minPrices[0]) prices[0] = slow;
+ if (standard > minPrices[1]) prices[1] = standard;
+ if (fast > minPrices[2]) prices[2] = fast;
+ hasSetPrices = true;
+ }
+ } catch {
+ console.log("Error fetching gas prices from gasprice.poa.network");
+ }
+
+ try {
+ const res = await fetch("https://www.etherchain.org/api/gasPriceOracle");
+ const resJson = await res.json();
+
+ if (resJson) {
+ const slow = resJson.safeLow;
+ const standard = resJson.standard;
+ const fast = (resJson.fast + resJson.fastest) / 2;
+ if (slow > minPrices[0])
+ prices[0] = hasSetPrices ? (prices[0] + slow) / 2 : slow;
+ if (standard > minPrices[1])
+ prices[1] = hasSetPrices ? (prices[1] + standard) / 2 : standard;
+ if (fast > minPrices[2]) {
+ prices[2] = hasSetPrices ? prices[2] + fast / 2 : fast;
+ }
+ }
+ } catch {
+ console.log("Error fetching gas prices from etherchain");
+ }
+
+ this.ethGasPrices[0] = parseFloat(prices[0].toFixed(1));
+ this.ethGasPrices[1] = parseFloat(prices[1].toFixed(1));
+ this.ethGasPrices[2] = parseFloat(prices[2].toFixed(1));
}
async loadMoreTxs() {