diff --git a/package.json b/package.json index 071ee4262..affe77595 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@metamask/detect-provider": "^1.2.0", - "@soramitsu/soraneo-wallet-web": "1.6.37", + "@soramitsu/soraneo-wallet-web": "1.6.41", "@walletconnect/web3-provider": "^1.6.6", "core-js": "^3.6.4", "ethers": "^5.3.1", diff --git a/src/components/App/Header/AppHeader.vue b/src/components/App/Header/AppHeader.vue index eca63c8fc..a3c70cd2f 100644 --- a/src/components/App/Header/AppHeader.vue +++ b/src/components/App/Header/AppHeader.vue @@ -16,8 +16,8 @@
- - + + @@ -351,12 +355,15 @@ export default class AddLiquidity extends Mixins(mixins.NetworkFeeWarningMixin, return `${this.getFPNumberFromCodec(strategicBonusApy).mul(this.Hundred).toLocaleString()}%`; } + get removeLiquidityFormattedFee(): string { + return this.formatCodecNumber(this.networkFees.RemoveLiquidity); + } + get isXorSufficientForNextOperation(): boolean { return this.isXorSufficientForNextTx({ type: Operation.AddLiquidity, - amount: this.getFPNumber(this.firstTokenValue).toCodecString(), - xorBalance: this.getFPNumber(this.getTokenBalance(this.firstToken)).toCodecString(), - fee: this.networkFee, + amount: this.getFPNumber(this.firstTokenValue), + xorBalance: this.getFPNumberFromCodec(this.getTokenBalance(this.firstToken)), }); } @@ -373,8 +380,11 @@ export default class AddLiquidity extends Mixins(mixins.NetworkFeeWarningMixin, if (!this.isXorSufficientForNextOperation) { this.openWarningFeeDialog(); await this.waitOnNextTxFailureConfirmation(); + if (!this.isWarningFeeDialogConfirmed) { + return; + } + this.isWarningFeeDialogConfirmed = false; } - this.openConfirmDialog(); } diff --git a/src/views/Bridge.vue b/src/views/Bridge.vue index 8aef45811..24746109a 100644 --- a/src/views/Bridge.vue +++ b/src/views/Bridge.vue @@ -233,7 +233,11 @@ :sora-network-fee="soraNetworkFee" @confirm="confirmTransaction" /> - +
@@ -450,9 +454,8 @@ export default class Bridge extends Mixins( return this.isXorSufficientForNextTx({ type: this.isSoraToEvm ? Operation.EthBridgeOutgoing : Operation.EthBridgeIncoming, isXorAccountAsset: isXorAccountAsset(this.asset), - amount: this.getFPNumber(this.amount).toCodecString(), - xorBalance: getAssetBalance(this.tokenXOR), - fee: this.soraNetworkFee, + amount: this.getFPNumber(this.amount), + xorBalance: this.getFPNumberFromCodec(getAssetBalance(this.tokenXOR)), }); } @@ -520,6 +523,10 @@ export default class Bridge extends Mixins( if (!this.isXorSufficientForNextOperation) { this.openWarningFeeDialog(); await this.waitOnNextTxFailureConfirmation(); + if (!this.isWarningFeeDialogConfirmed) { + return; + } + this.isWarningFeeDialogConfirmed = false; } await this.checkConnectionToExternalAccount(() => { diff --git a/src/views/CreatePair.vue b/src/views/CreatePair.vue index cb8d351b4..09ed5330f 100644 --- a/src/views/CreatePair.vue +++ b/src/views/CreatePair.vue @@ -28,7 +28,7 @@ value-can-be-hidden with-left-shift value-class="input-value--primary" - :value="getTokenBalance(firstToken)" + :value="getFormattedTokenBalance(firstToken)" :fiat-value="getFiatBalance(firstToken)" /> @@ -80,7 +80,7 @@ value-can-be-hidden with-left-shift value-class="input-value--primary" - :value="getTokenBalance(secondToken)" + :value="getFormattedTokenBalance(secondToken)" :fiat-value="getFiatBalance(secondToken)" /> @@ -212,7 +212,11 @@ @confirm="confirmCreatePair" /> - + @@ -261,9 +265,8 @@ export default class CreatePair extends Mixins(mixins.NetworkFeeWarningMixin, To get isXorSufficientForNextOperation(): boolean { return this.isXorSufficientForNextTx({ type: Operation.CreatePair, - amount: this.getFPNumber(this.firstTokenValue).toCodecString(), - xorBalance: this.getFPNumber(this.getTokenBalance(this.firstToken)).toCodecString(), - fee: this.getFPNumber(this.formattedFee).toCodecString(), + amount: this.getFPNumber(this.firstTokenValue), + xorBalance: this.getFPNumberFromCodec(this.getTokenBalance(this.firstToken)), }); } @@ -277,8 +280,11 @@ export default class CreatePair extends Mixins(mixins.NetworkFeeWarningMixin, To if (!this.isXorSufficientForNextOperation) { this.openWarningFeeDialog(); await this.waitOnNextTxFailureConfirmation(); + if (!this.isWarningFeeDialogConfirmed) { + return; + } + this.isWarningFeeDialogConfirmed = false; } - this.openConfirmDialog(); } diff --git a/src/views/RemoveLiquidity.vue b/src/views/RemoveLiquidity.vue index e3cbc053b..dcff567b2 100644 --- a/src/views/RemoveLiquidity.vue +++ b/src/views/RemoveLiquidity.vue @@ -155,7 +155,11 @@ @confirm="handleConfirmRemoveLiquidity" /> - + @@ -205,8 +209,6 @@ export default class RemoveLiquidity extends Mixins( readonly KnownSymbols = KnownSymbols; readonly delimiters = FPNumber.DELIMITERS_CONFIG; - @Getter networkFees!: NetworkFeesObject; - @State((state) => state[namespace].liquidityAmount) liquidityAmount!: string; @State((state) => state[namespace].firstTokenAmount) firstTokenAmount!: string; @State((state) => state[namespace].secondTokenAmount) secondTokenAmount!: string; @@ -345,10 +347,10 @@ export default class RemoveLiquidity extends Mixins( } get isXorSufficientForNextOperation(): boolean { + const firstTokenAmount = this.getFPNumber(this.firstTokenAmount); return this.isXorSufficientForNextTx({ type: Operation.RemoveLiquidity, - xorBalance: getAssetBalance(this.tokenXOR), - fee: this.networkFee, + xorBalance: this.getFPNumberFromCodec(getAssetBalance(this.tokenXOR)).add(firstTokenAmount), }); } @@ -404,8 +406,11 @@ export default class RemoveLiquidity extends Mixins( if (!this.isXorSufficientForNextOperation) { this.openWarningFeeDialog(); await this.waitOnNextTxFailureConfirmation(); + if (!this.isWarningFeeDialogConfirmed) { + return; + } + this.isWarningFeeDialogConfirmed = false; } - this.openConfirmDialog(); } diff --git a/yarn.lock b/yarn.lock index 8304d5b6e..2504167a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2181,10 +2181,10 @@ vuex "^3.1.3" vuex-class "^0.3.2" -"@soramitsu/soraneo-wallet-web@1.6.37": - version "1.6.37" - resolved "https://nexus.iroha.tech/repository/npm-group/@soramitsu/soraneo-wallet-web/-/soraneo-wallet-web-1.6.37.tgz#43f6dce946fdecff523985ee8af16add8fe0c4b5" - integrity sha512-nX75AAx4CuL+84RB0ytVmBNczekiAZNusbQjfhKGfK9/huobVVtm5QR115KVPwuG4v0JqBZb1k/+jFzh/RAhJA== +"@soramitsu/soraneo-wallet-web@1.6.41": + version "1.6.41" + resolved "https://nexus.iroha.tech/repository/npm-group/@soramitsu/soraneo-wallet-web/-/soraneo-wallet-web-1.6.41.tgz#91a0548c629d637fd72d2b6539d50394138e04d1" + integrity sha512-1XGuKGGJkZg2DbjTdKttLHuTQgLMcVvGzIYXMAaVZQSGArmfIE9nsUrqjO9lbgSR7uFneQzwZa5kmAJqvYmXaA== dependencies: "@polkadot/extension-dapp" "^0.35.0-beta.35" "@polkadot/vue-identicon" "^0.72.1"