Skip to content

Commit 341325f

Browse files
[SDK] Show all tokens in payment selection regardless of balance (#7523)
1 parent 7500d87 commit 341325f

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

.changeset/three-parts-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Show all tokens in payment selection screen, even if not enough balance

packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ export function usePaymentMethods(options: {
122122
page += 1;
123123
}
124124

125-
const requiredDollarAmount =
126-
Number.parseFloat(destinationAmount) * destinationToken.priceUsd;
127-
128125
// sort by dollar balance descending
129126
owned.sort((a, b) => {
130127
const aDollarBalance =
@@ -140,13 +137,6 @@ export function usePaymentMethods(options: {
140137

141138
for (const b of owned) {
142139
if (b.originToken && b.balance > 0n) {
143-
const dollarBalance =
144-
Number.parseFloat(toTokens(b.balance, b.originToken.decimals)) *
145-
b.originToken.priceUsd;
146-
if (b.originToken.priceUsd && dollarBalance < requiredDollarAmount) {
147-
continue;
148-
}
149-
150140
if (
151141
includeDestinationToken &&
152142
b.originToken.address.toLowerCase() ===

0 commit comments

Comments
 (0)