diff --git a/plugins/plugins/core/trade-bot/trade-bot-portal.src.js b/plugins/plugins/core/trade-bot/trade-bot-portal.src.js index e34f1b66..8de96dc2 100644 --- a/plugins/plugins/core/trade-bot/trade-bot-portal.src.js +++ b/plugins/plugins/core/trade-bot/trade-bot-portal.src.js @@ -2104,6 +2104,7 @@ class TradeBotPortal extends LitElement { this.changeTheme() this.changeLanguage() + this.tradeFee() this.autoHelperMessage = this.renderAutoHelperPass() @@ -3736,6 +3737,20 @@ class TradeBotPortal extends LitElement { } } + async tradeFee() { + const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node] + const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port + const url = `${nodeUrl}/transactions/unitfee?txType=DEPLOY_AT` + await fetch(url).then((response) => { + if (response.ok) { + return response.json() + } + return Promise.reject(response) + }).then((json) => { + this.listedCoins.get("QORTAL").tradeFee = (Number(json) / 1e8).toFixed(2) + }) + } + getApiKey() { const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]; let apiKey = myNode.apiKey; diff --git a/plugins/plugins/core/trade-portal/trade-portal.src.js b/plugins/plugins/core/trade-portal/trade-portal.src.js index e74a5392..da47de5e 100644 --- a/plugins/plugins/core/trade-portal/trade-portal.src.js +++ b/plugins/plugins/core/trade-portal/trade-portal.src.js @@ -1421,6 +1421,7 @@ class TradePortal extends LitElement { this.changeTheme() this.changeLanguage() + this.tradeFee() this.tradeHelperMessage = this.renderTradeHelperPass() @@ -2758,7 +2759,7 @@ class TradePortal extends LitElement { } } - if (this.round(parseFloat(fundingQortAmount) + parseFloat(0.002)) > parseFloat(this.listedCoins.get("QORTAL").balance)) { + if (this.round(parseFloat(fundingQortAmount) + parseFloat(this.listedCoins.get("QORTAL").tradeFee)) > parseFloat(this.listedCoins.get("QORTAL").balance)) { this.isSellLoading = false this.sellBtnDisable = false let snack4string = get("tradepage.tchange22") @@ -3021,6 +3022,20 @@ class TradePortal extends LitElement { } } + async tradeFee() { + const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node] + const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port + const url = `${nodeUrl}/transactions/unitfee?txType=DEPLOY_AT` + await fetch(url).then((response) => { + if (response.ok) { + return response.json() + } + return Promise.reject(response) + }).then((json) => { + this.listedCoins.get("QORTAL").tradeFee = (Number(json) / 1e8).toFixed(2) + }) + } + getApiKey() { const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]; let apiKey = myNode.apiKey;