From 819365d7dc8836b8b278926e960d50f09a7f35d6 Mon Sep 17 00:00:00 2001 From: Douglas Daniel Date: Wed, 6 Nov 2024 14:15:09 -0600 Subject: [PATCH] fix(wallet): Insufficient Balance on Swap --- .../brave_wallet_ui/utils/asset-utils.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/components/brave_wallet_ui/utils/asset-utils.ts b/components/brave_wallet_ui/utils/asset-utils.ts index d06d438ec6e2..f7adada4792e 100644 --- a/components/brave_wallet_ui/utils/asset-utils.ts +++ b/components/brave_wallet_ui/utils/asset-utils.ts @@ -176,8 +176,13 @@ export const sortNativeAndAndBatAssetsToTop = ( export type GetBlockchainTokenIdArg = Pick< BraveWallet.BlockchainToken, - 'coin' | 'chainId' | 'contractAddress' | 'isErc721' | - 'tokenId' | 'isNft' | 'isShielded' + | 'coin' + | 'chainId' + | 'contractAddress' + | 'isErc721' + | 'tokenId' + | 'isNft' + | 'isShielded' > /** @@ -192,9 +197,13 @@ export const getAssetIdKey = ( ) => { return asset.tokenId ? `${asset.coin}-${asset.contractAddress.toLowerCase()}-${asset.tokenId}-${ - asset.chainId}-${asset.isShielded}` - : `${asset.coin}-${asset.contractAddress.toLowerCase()}-${asset.chainId}-${ - asset.isShielded}` + asset.chainId + }` + : asset.isShielded + ? `${asset.coin}-${asset.contractAddress.toLowerCase()}-${ + asset.chainId + }-shielded` + : `${asset.coin}-${asset.contractAddress.toLowerCase()}-${asset.chainId}` } export const findTokenByContractAddress = <