From 297e2b60d629d1ea43b2f70aeb0bd55d617b27c8 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Fri, 4 Jul 2025 13:42:56 +1200 Subject: [PATCH] [SDK] Show all tokens in payment selection regardless of balance --- .changeset/three-parts-rush.md | 5 +++++ .../thirdweb/src/react/core/hooks/usePaymentMethods.ts | 10 ---------- 2 files changed, 5 insertions(+), 10 deletions(-) create mode 100644 .changeset/three-parts-rush.md diff --git a/.changeset/three-parts-rush.md b/.changeset/three-parts-rush.md new file mode 100644 index 00000000000..8c328b4e58a --- /dev/null +++ b/.changeset/three-parts-rush.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Show all tokens in payment selection screen, even if not enough balance diff --git a/packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts b/packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts index ab56413430a..6b5a74b4865 100644 --- a/packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts +++ b/packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts @@ -122,9 +122,6 @@ export function usePaymentMethods(options: { page += 1; } - const requiredDollarAmount = - Number.parseFloat(destinationAmount) * destinationToken.priceUsd; - // sort by dollar balance descending owned.sort((a, b) => { const aDollarBalance = @@ -140,13 +137,6 @@ export function usePaymentMethods(options: { for (const b of owned) { if (b.originToken && b.balance > 0n) { - const dollarBalance = - Number.parseFloat(toTokens(b.balance, b.originToken.decimals)) * - b.originToken.priceUsd; - if (b.originToken.priceUsd && dollarBalance < requiredDollarAmount) { - continue; - } - if ( includeDestinationToken && b.originToken.address.toLowerCase() ===