Skip to content

Commit 00d281c

Browse files
[SDK] Filter out zero-value token balances in swap UI
1 parent 9e63e63 commit 00d281c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ async function fetchBalancesForWallet({
154154
const matching = sourceSupportedTokens[b.chainId]?.find(
155155
(t) => t.address.toLowerCase() === b.tokenAddress.toLowerCase(),
156156
);
157-
if (matching) {
157+
if (matching && b.value > 0n) {
158158
balances.push({
159159
balance: b,
160160
chain: getCachedChain(b.chainId),

0 commit comments

Comments
 (0)