diff --git a/src/renderer/src/routes/pages/Wallets/ClaimGasBanner.tsx b/src/renderer/src/routes/pages/Wallets/ClaimGasBanner.tsx index e8e601a0..1578a4a6 100644 --- a/src/renderer/src/routes/pages/Wallets/ClaimGasBanner.tsx +++ b/src/renderer/src/routes/pages/Wallets/ClaimGasBanner.tsx @@ -40,14 +40,22 @@ const getUnclaimedInfos = async ( let fee = '0' if (isCalculableFee(blockchainService)) { + const isLedger = account.type === 'ledger' + + const serviceAccount = + isLedger && hasLedger(blockchainService) + ? blockchainService.generateAccountFromPublicKey(key) + : blockchainService.generateAccountFromKey(key) + fee = await blockchainService.calculateTransferFee({ - senderAccount: blockchainService.generateAccountFromKey(key), + senderAccount: serviceAccount, intent: { amount: '0', receiverAddress: account.address, tokenHash: blockchainService.burnToken.hash, tokenDecimals: blockchainService.burnToken.decimals, }, + isLedger, }) } @@ -138,58 +146,58 @@ export const ClaimGasBanner = ({ account, blockchainService }: TProps) => {
{unclaimed.isLoading || balances.isLoading ? ( + ) : !unclaimed.data ? ( + ) : ( - !!unclaimed.data && ( -
-
-
- - {blockchainService.claimToken.symbol} -
- - {feeIsLessThanUnclaimed === false ? ( - {t('unclaimedLessFee')} - ) : feeIsLessThanBalance === false ? ( - {t('balanceLessFee')} - ) : feeIsLessThanBalance === true ? ( -
- - {t('youHaveUnclaimed', { - symbol: blockchainService.claimToken.symbol, - })} - - - - {t('feeToClaim', { - fee: unclaimed.data?.fee, - symbol: blockchainService.claimToken.symbol, - })} - -
- ) : ( - - )} +
+
+
+ + {blockchainService.claimToken.symbol}
-
- - {t('claimAmount', { - amount: unclaimed.data.unclaimed, - symbol: blockchainService.claimToken.symbol, - })} - - -
+ {feeIsLessThanUnclaimed === false ? ( + {t('unclaimedLessFee')} + ) : feeIsLessThanBalance === false ? ( + {t('balanceLessFee')} + ) : feeIsLessThanBalance === true ? ( +
+ + {t('youHaveUnclaimed', { + symbol: blockchainService.claimToken.symbol, + })} + + + + {t('feeToClaim', { + fee: unclaimed.data?.fee, + symbol: blockchainService.claimToken.symbol, + })} + +
+ ) : ( + + )} +
+ +
+ + {t('claimAmount', { + amount: unclaimed.data.unclaimed, + symbol: blockchainService.claimToken.symbol, + })} + + +
- ) +
)}
)