Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/checkout/src/contexts/SelectPaymentModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface SelectPaymentSettings {
customProviderCallback?: (onSuccess: (txHash: string) => void, onError: (error: Error) => void, onClose: () => void) => void
supplementaryAnalyticsInfo?: SupplementaryAnalyticsInfo
skipNativeBalanceCheck?: boolean
nativeTokenAddress?: string
}

type SelectPaymentModalContext = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const PayWithCrypto = ({
const [showMore, setShowMore] = useState(false)
const { enableSwapPayments = true, enableMainCurrencyPayment = true } = settings

const { chain, currencyAddress, price, skipNativeBalanceCheck } = settings
const { chain, currencyAddress, price, skipNativeBalanceCheck, nativeTokenAddress } = settings
const { address: userAddress } = useAccount()
const { clearCachedBalances } = useClearCachedBalances()
const network = findSupportedNetwork(chain)
Expand All @@ -47,7 +47,7 @@ export const PayWithCrypto = ({
accountAddresses: userAddress ? [userAddress] : [],
contractStatus: ContractVerificationStatus.ALL,
contractWhitelist: [currencyAddress],
omitNativeBalances: skipNativeBalanceCheck ?? false
omitNativeBalances: skipNativeBalanceCheck ? true : false
},
omitMetadata: true,
page: { pageSize: 40 }
Expand Down Expand Up @@ -145,7 +145,7 @@ export const PayWithCrypto = ({
<div className="flex flex-col justify-center items-center gap-2 w-full">
{coins.map(coin => {
if (compareAddress(coin.currencyAddress, currencyAddress)) {
const isNative = compareAddress(coin.currencyAddress, zeroAddress)
const isNative = compareAddress(coin.currencyAddress, nativeTokenAddress || zeroAddress)
const isNativeBalanceCheckSkipped = isNative && skipNativeBalanceCheck

return (
Expand Down