diff --git a/packages/extension-base/src/koni/api/dotsama/transfer.ts b/packages/extension-base/src/koni/api/dotsama/transfer.ts index 942e5c23c4..5f2145d9bf 100644 --- a/packages/extension-base/src/koni/api/dotsama/transfer.ts +++ b/packages/extension-base/src/koni/api/dotsama/transfer.ts @@ -196,7 +196,7 @@ export const createTransferExtrinsic = async ({ from, networkKey, substrateApi, if (transferAll) { transfer = api.tx.balances.transferAll(to, false); } else if (value) { - transfer = api.tx.balances.transfer(to, new BN(value)); + transfer = api.tx.balances.transferKeepAlive(to, new BN(value)); } } diff --git a/packages/extension-base/src/koni/background/handlers/Extension.ts b/packages/extension-base/src/koni/background/handlers/Extension.ts index 53a6dc54f2..6764538f24 100644 --- a/packages/extension-base/src/koni/background/handlers/Extension.ts +++ b/packages/extension-base/src/koni/background/handlers/Extension.ts @@ -1986,13 +1986,17 @@ export default class KoniExtension { destinationTokenInfo, originTokenInfo: tokenInfo, recipient: recipient, - sendingValue: '0', + sendingValue: '1000000000000000000', substrateApi }); - const paymentInfo = await mockTx.paymentInfo(address); + try { + const paymentInfo = await mockTx.paymentInfo(address); - estimatedFee = paymentInfo?.partialFee?.toString() || '0'; + estimatedFee = paymentInfo?.partialFee?.toString() || '0'; + } catch (e) { + estimatedFee = tokenInfo.minAmount || '0'; + } } } else { const chainInfo = this.#koniState.chainService.getChainInfoByKey(networkKey); @@ -2018,7 +2022,7 @@ export default class KoniExtension { to: address, tokenInfo, transferAll: true, - value: '0' + value: '1000000000000000000' }); const paymentInfo = await mockTx?.paymentInfo(address); @@ -4007,8 +4011,6 @@ export default class KoniExtension { substrateApiMap: this.#koniState.getSubstrateApiMap() }; - return []; - return validateYieldProcess( inputData.address, params, diff --git a/packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx b/packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx index edfe16773f..09b4fbb17d 100644 --- a/packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx +++ b/packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx @@ -368,6 +368,10 @@ const _SendFund = ({ className = '', modalContent }: Props): React.ReactElement< return Promise.reject(t('Amount is required')); } + if ((new BN(maxTransfer)).lte(BN_ZERO)) { + return Promise.reject(t('You don\'t have enough tokens to proceed')); + } + if ((new BigN(amount)).eq(new BigN(0))) { return Promise.reject(t('Amount must be greater than 0')); }