Skip to content

Commit

Permalink
Merge pull request #2088 from Koniverse/webapp-issue-2079
Browse files Browse the repository at this point in the history
Update issue 2079 for web app
  • Loading branch information
saltict authored Oct 26, 2023
2 parents 580baec + 5d657dd commit 429053d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/extension-base/src/koni/api/dotsama/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -2018,7 +2022,7 @@ export default class KoniExtension {
to: address,
tokenInfo,
transferAll: true,
value: '0'
value: '1000000000000000000'
});

const paymentInfo = await mockTx?.paymentInfo(address);
Expand Down Expand Up @@ -4007,8 +4011,6 @@ export default class KoniExtension {
substrateApiMap: this.#koniState.getSubstrateApiMap()
};

return [];

return validateYieldProcess(
inputData.address,
params,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down

0 comments on commit 429053d

Please sign in to comment.