thirdweb 5.105.9 → 5.105.11-nightly-692cedf9211fb5a6c24406df69155b920f7d2557-20250709000414
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/chains/chain-definitions/t-rex-testnet.js +20 -0
- package/dist/cjs/chains/chain-definitions/t-rex-testnet.js.map +1 -0
- package/dist/cjs/exports/chains.js +3 -1
- package/dist/cjs/exports/chains.js.map +1 -1
- package/dist/cjs/insight/common.js +0 -5
- package/dist/cjs/insight/common.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/isSwapRequiredPostOnramp.js +0 -44
- package/dist/cjs/pay/buyWithFiat/isSwapRequiredPostOnramp.js.map +1 -1
- package/dist/cjs/pay/utils/commonTypes.js +1 -2
- package/dist/cjs/pay/utils/commonTypes.js.map +1 -1
- package/dist/cjs/react/core/hooks/useBridgeQuote.js +3 -1
- package/dist/cjs/react/core/hooks/useBridgeQuote.js.map +1 -1
- package/dist/cjs/react/core/hooks/usePaymentMethods.js +6 -1
- package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -1
- package/dist/cjs/react/core/utils/storage.js +1 -2
- package/dist/cjs/react/core/utils/storage.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +7 -2
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +3 -2
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js +4 -3
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +11 -5
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js +1 -5
- package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +0 -112
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js +0 -9
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +1 -30
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/components/Modal.js +3 -3
- package/dist/cjs/react/web/ui/components/Modal.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/chains/chain-definitions/t-rex-testnet.js +17 -0
- package/dist/esm/chains/chain-definitions/t-rex-testnet.js.map +1 -0
- package/dist/esm/exports/chains.js +1 -0
- package/dist/esm/exports/chains.js.map +1 -1
- package/dist/esm/insight/common.js +0 -4
- package/dist/esm/insight/common.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/isSwapRequiredPostOnramp.js +0 -43
- package/dist/esm/pay/buyWithFiat/isSwapRequiredPostOnramp.js.map +1 -1
- package/dist/esm/pay/utils/commonTypes.js +2 -1
- package/dist/esm/pay/utils/commonTypes.js.map +1 -1
- package/dist/esm/react/core/hooks/useBridgeQuote.js +3 -1
- package/dist/esm/react/core/hooks/useBridgeQuote.js.map +1 -1
- package/dist/esm/react/core/hooks/usePaymentMethods.js +6 -1
- package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -1
- package/dist/esm/react/core/utils/storage.js +0 -1
- package/dist/esm/react/core/utils/storage.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +7 -2
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +3 -2
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js +4 -3
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +12 -6
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js +1 -5
- package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +1 -110
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js +0 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +3 -32
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/components/Modal.js +1 -1
- package/dist/esm/react/web/ui/components/Modal.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/chains/chain-definitions/t-rex-testnet.d.ts +7 -0
- package/dist/types/chains/chain-definitions/t-rex-testnet.d.ts.map +1 -0
- package/dist/types/exports/chains.d.ts +1 -0
- package/dist/types/exports/chains.d.ts.map +1 -1
- package/dist/types/insight/common.d.ts +0 -1
- package/dist/types/insight/common.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts +0 -3
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/isSwapRequiredPostOnramp.d.ts +0 -7
- package/dist/types/pay/buyWithFiat/isSwapRequiredPostOnramp.d.ts.map +1 -1
- package/dist/types/pay/utils/commonTypes.d.ts +2 -1
- package/dist/types/pay/utils/commonTypes.d.ts.map +1 -1
- package/dist/types/react/core/hooks/useBridgeQuote.d.ts +2 -1
- package/dist/types/react/core/hooks/useBridgeQuote.d.ts.map +1 -1
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -1
- package/dist/types/react/core/utils/storage.d.ts +0 -1
- package/dist/types/react/core/utils/storage.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +5 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts +2 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +0 -29
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts +0 -6
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/Modal.d.ts +0 -4
- package/dist/types/react/web/ui/components/Modal.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/buttons.d.ts +2 -1
- package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/chains/chain-definitions/t-rex-testnet.ts +17 -0
- package/src/exports/chains.ts +1 -0
- package/src/insight/common.ts +0 -5
- package/src/pay/buyWithCrypto/getStatus.ts +0 -5
- package/src/pay/buyWithFiat/isSwapRequiredPostOnramp.ts +0 -56
- package/src/pay/utils/commonTypes.ts +1 -1
- package/src/react/core/hooks/useBridgeQuote.ts +4 -0
- package/src/react/core/hooks/usePaymentMethods.ts +8 -1
- package/src/react/core/utils/storage.ts +0 -1
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +9 -1
- package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +8 -0
- package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +6 -0
- package/src/react/web/ui/ConnectWallet/Details.tsx +52 -42
- package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +5 -7
- package/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +0 -39
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts +0 -160
- package/src/react/web/ui/ConnectWallet/screens/Buy/utils.ts +0 -9
- package/src/react/web/ui/PayEmbed.tsx +3 -66
- package/src/react/web/ui/components/Modal.tsx +1 -1
- package/src/react/web/ui/components/buttons.tsx +1 -1
- package/src/version.ts +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +0 -468
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +0 -116
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js +0 -29
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js +0 -11
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +0 -28
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +0 -26
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js +0 -58
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/Stepper.js +0 -59
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/Stepper.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +0 -118
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +0 -32
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +0 -108
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +0 -45
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +0 -532
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +0 -21
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +0 -39
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +0 -134
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js +0 -11
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +0 -106
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +0 -23
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -50
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +0 -68
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +0 -225
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js +0 -12
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +0 -39
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +0 -55
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +0 -49
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +0 -176
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +0 -69
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +0 -34
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +0 -194
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +0 -344
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +0 -15
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +0 -198
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +0 -15
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +0 -54
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +0 -1
- package/dist/cjs/react/web/ui/components/Drawer.js +0 -123
- package/dist/cjs/react/web/ui/components/Drawer.js.map +0 -1
- package/dist/cjs/react/web/ui/components/StepBar.js +0 -16
- package/dist/cjs/react/web/ui/components/StepBar.js.map +0 -1
- package/dist/cjs/react/web/ui/components/SwitchNetwork.js +0 -19
- package/dist/cjs/react/web/ui/components/SwitchNetwork.js.map +0 -1
- package/dist/cjs/react/web/ui/components/token/TokenRow.js +0 -43
- package/dist/cjs/react/web/ui/components/token/TokenRow.js.map +0 -1
- package/dist/cjs/react/web/utils/errors.js +0 -44
- package/dist/cjs/react/web/utils/errors.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +0 -465
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +0 -113
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js +0 -26
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js +0 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +0 -24
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +0 -23
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js +0 -55
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/Stepper.js +0 -55
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/Stepper.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +0 -115
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +0 -29
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +0 -105
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +0 -42
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +0 -529
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +0 -18
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +0 -36
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +0 -129
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js +0 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +0 -103
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +0 -20
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -47
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +0 -65
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +0 -221
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js +0 -9
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +0 -35
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +0 -52
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +0 -46
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +0 -173
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +0 -66
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +0 -31
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +0 -191
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +0 -341
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +0 -12
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +0 -195
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +0 -11
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +0 -51
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +0 -1
- package/dist/esm/react/web/ui/components/Drawer.js +0 -119
- package/dist/esm/react/web/ui/components/Drawer.js.map +0 -1
- package/dist/esm/react/web/ui/components/StepBar.js +0 -13
- package/dist/esm/react/web/ui/components/StepBar.js.map +0 -1
- package/dist/esm/react/web/ui/components/SwitchNetwork.js +0 -16
- package/dist/esm/react/web/ui/components/SwitchNetwork.js.map +0 -1
- package/dist/esm/react/web/ui/components/token/TokenRow.js +0 -40
- package/dist/esm/react/web/ui/components/token/TokenRow.js.map +0 -1
- package/dist/esm/react/web/utils/errors.js +0 -41
- package/dist/esm/react/web/utils/errors.js.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts +0 -18
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts +0 -6
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts +0 -3
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts +0 -12
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts +0 -16
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts +0 -18
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts +0 -6
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts +0 -8
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts +0 -20
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts +0 -15
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +0 -55
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.d.ts +0 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts +0 -16
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts +0 -18
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts +0 -32
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts +0 -5
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts +0 -15
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +0 -23
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts +0 -21
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts +0 -32
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts +0 -18
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts +0 -15
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts +0 -22
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts +0 -25
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.d.ts +0 -25
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts +0 -6
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts.map +0 -1
- package/dist/types/react/web/ui/components/Drawer.d.ts +0 -25
- package/dist/types/react/web/ui/components/Drawer.d.ts.map +0 -1
- package/dist/types/react/web/ui/components/StepBar.d.ts +0 -5
- package/dist/types/react/web/ui/components/StepBar.d.ts.map +0 -1
- package/dist/types/react/web/ui/components/SwitchNetwork.d.ts +0 -6
- package/dist/types/react/web/ui/components/SwitchNetwork.d.ts.map +0 -1
- package/dist/types/react/web/ui/components/token/TokenRow.d.ts +0 -14
- package/dist/types/react/web/ui/components/token/TokenRow.d.ts.map +0 -1
- package/dist/types/react/web/utils/errors.d.ts +0 -8
- package/dist/types/react/web/utils/errors.d.ts.map +0 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +0 -1075
- package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +0 -286
- package/src/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.tsx +0 -85
- package/src/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.tsx +0 -13
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.tsx +0 -68
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.tsx +0 -48
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.tsx +0 -104
- package/src/react/web/ui/ConnectWallet/screens/Buy/Stepper.tsx +0 -91
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +0 -395
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.tsx +0 -61
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +0 -263
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +0 -85
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +0 -775
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.tsx +0 -54
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.ts +0 -65
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +0 -193
- package/src/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.tsx +0 -12
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +0 -294
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.tsx +0 -56
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.test.ts +0 -80
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.ts +0 -77
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.tsx +0 -154
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +0 -377
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.tsx +0 -20
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.tsx +0 -109
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +0 -114
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx +0 -117
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.tsx +0 -359
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.tsx +0 -232
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.tsx +0 -111
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx +0 -448
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.tsx +0 -558
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.tsx +0 -56
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.tsx +0 -282
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts +0 -23
- package/src/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.tsx +0 -61
- package/src/react/web/ui/components/Drawer.tsx +0 -171
- package/src/react/web/ui/components/StepBar.tsx +0 -25
- package/src/react/web/ui/components/SwitchNetwork.tsx +0 -35
- package/src/react/web/ui/components/token/TokenRow.tsx +0 -135
- package/src/react/web/utils/errors.ts +0 -52
@@ -1,6 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
|
-
import { useEffect
|
3
|
+
import { useEffect } from "react";
|
4
4
|
import type { Chain } from "../../../chains/types.js";
|
5
5
|
import type { ThirdwebClient } from "../../../client/client.js";
|
6
6
|
import type { Address } from "../../../utils/address.js";
|
@@ -10,27 +10,18 @@ import type { AppMetadata } from "../../../wallets/types.js";
|
|
10
10
|
import type { WalletId } from "../../../wallets/wallet-types.js";
|
11
11
|
import { CustomThemeProvider } from "../../core/design-system/CustomThemeProvider.js";
|
12
12
|
import type { Theme } from "../../core/design-system/index.js";
|
13
|
-
import {
|
14
|
-
type SiweAuthOptions,
|
15
|
-
useSiweAuth,
|
16
|
-
} from "../../core/hooks/auth/useSiweAuth.js";
|
13
|
+
import type { SiweAuthOptions } from "../../core/hooks/auth/useSiweAuth.js";
|
17
14
|
import type {
|
18
15
|
ConnectButton_connectModalOptions,
|
19
16
|
PayUIOptions,
|
20
17
|
} from "../../core/hooks/connection/ConnectButtonProps.js";
|
21
|
-
import { useActiveAccount } from "../../core/hooks/wallets/useActiveAccount.js";
|
22
|
-
import { useActiveWallet } from "../../core/hooks/wallets/useActiveWallet.js";
|
23
18
|
import { useConnectionManager } from "../../core/providers/connection-manager.js";
|
24
19
|
import type { SupportedTokens } from "../../core/utils/defaultTokens.js";
|
25
|
-
import { AutoConnect } from "../../web/ui/AutoConnect/AutoConnect.js";
|
26
20
|
import { BuyWidget } from "./Bridge/BuyWidget.js";
|
27
21
|
import { CheckoutWidget } from "./Bridge/CheckoutWidget.js";
|
28
22
|
import { TransactionWidget } from "./Bridge/TransactionWidget.js";
|
29
|
-
import { useConnectLocale } from "./ConnectWallet/locale/getConnectLocale.js";
|
30
23
|
import { EmbedContainer } from "./ConnectWallet/Modal/ConnectEmbed.js";
|
31
|
-
import BuyScreen from "./ConnectWallet/screens/Buy/BuyScreen.js";
|
32
24
|
import { DynamicHeight } from "./components/DynamicHeight.js";
|
33
|
-
import { Spinner } from "./components/Spinner.js";
|
34
25
|
import type { LocaleId } from "./types.js";
|
35
26
|
|
36
27
|
/**
|
@@ -309,17 +300,8 @@ export type PayEmbedProps = {
|
|
309
300
|
* @deprecated Use `BuyWidget`, `CheckoutWidget` or `TransactionWidget` instead.
|
310
301
|
*/
|
311
302
|
export function PayEmbed(props: PayEmbedProps) {
|
312
|
-
const localeQuery = useConnectLocale(props.locale || "en_US");
|
313
|
-
const [screen, setScreen] = useState<"buy" | "execute-tx">("buy");
|
314
303
|
const theme = props.theme || "dark";
|
315
304
|
const connectionManager = useConnectionManager();
|
316
|
-
const activeAccount = useActiveAccount();
|
317
|
-
const activeWallet = useActiveWallet();
|
318
|
-
const siweAuth = useSiweAuth(
|
319
|
-
activeWallet,
|
320
|
-
activeAccount,
|
321
|
-
props.connectOptions?.auth,
|
322
|
-
);
|
323
305
|
|
324
306
|
// Add props.chain and props.chains to defined chains store
|
325
307
|
useEffect(() => {
|
@@ -340,7 +322,7 @@ export function PayEmbed(props: PayEmbedProps) {
|
|
340
322
|
}
|
341
323
|
}, [props.activeWallet, connectionManager]);
|
342
324
|
|
343
|
-
|
325
|
+
const content = null;
|
344
326
|
const metadata =
|
345
327
|
props.payOptions && "metadata" in props.payOptions
|
346
328
|
? props.payOptions.metadata
|
@@ -421,51 +403,6 @@ export function PayEmbed(props: PayEmbedProps) {
|
|
421
403
|
);
|
422
404
|
}
|
423
405
|
|
424
|
-
if (!localeQuery.data) {
|
425
|
-
content = (
|
426
|
-
<div
|
427
|
-
style={{
|
428
|
-
alignItems: "center",
|
429
|
-
display: "flex",
|
430
|
-
justifyContent: "center",
|
431
|
-
minHeight: "350px",
|
432
|
-
}}
|
433
|
-
>
|
434
|
-
<Spinner color="secondaryText" size="xl" />
|
435
|
-
</div>
|
436
|
-
);
|
437
|
-
} else {
|
438
|
-
content = (
|
439
|
-
<>
|
440
|
-
<AutoConnect client={props.client} siweAuth={siweAuth} />
|
441
|
-
{screen === "buy" && (
|
442
|
-
<BuyScreen
|
443
|
-
client={props.client}
|
444
|
-
connectLocale={localeQuery.data}
|
445
|
-
connectOptions={props.connectOptions}
|
446
|
-
hiddenWallets={props.hiddenWallets}
|
447
|
-
isEmbed={true}
|
448
|
-
onBack={undefined}
|
449
|
-
onDone={() => {
|
450
|
-
if (props.payOptions?.mode === "transaction") {
|
451
|
-
setScreen("execute-tx");
|
452
|
-
}
|
453
|
-
}}
|
454
|
-
paymentLinkId={props.paymentLinkId}
|
455
|
-
payOptions={
|
456
|
-
props.payOptions || {
|
457
|
-
mode: "fund_wallet",
|
458
|
-
}
|
459
|
-
}
|
460
|
-
supportedTokens={props.supportedTokens}
|
461
|
-
theme={theme}
|
462
|
-
title={metadata?.name || "Buy"}
|
463
|
-
/>
|
464
|
-
)}
|
465
|
-
</>
|
466
|
-
);
|
467
|
-
}
|
468
|
-
|
469
406
|
return (
|
470
407
|
<CustomThemeProvider theme={theme}>
|
471
408
|
<EmbedContainer
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
} from "../../../core/design-system/index.js";
|
9
9
|
import { StyledButton } from "../design-system/elements.js";
|
10
10
|
|
11
|
-
|
11
|
+
type ButtonProps = {
|
12
12
|
variant: "primary" | "secondary" | "link" | "accent" | "outline" | "ghost";
|
13
13
|
unstyled?: boolean;
|
14
14
|
fullWidth?: boolean;
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.105.
|
1
|
+
export const version = "5.105.11-nightly-692cedf9211fb5a6c24406df69155b920f7d2557-20250709000414";
|
@@ -1,468 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = BuyScreen;
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
-
const react_query_1 = require("@tanstack/react-query");
|
6
|
-
const react_1 = require("react");
|
7
|
-
const pay_js_1 = require("../../../../../../analytics/track/pay.js");
|
8
|
-
const utils_js_1 = require("../../../../../../chains/utils.js");
|
9
|
-
const addresses_js_1 = require("../../../../../../constants/addresses.js");
|
10
|
-
const formatNumber_js_1 = require("../../../../../../utils/formatNumber.js");
|
11
|
-
const index_js_1 = require("../../../../../core/design-system/index.js");
|
12
|
-
const useActiveAccount_js_1 = require("../../../../../core/hooks/wallets/useActiveAccount.js");
|
13
|
-
const invalidateWalletBalance_js_1 = require("../../../../../core/providers/invalidateWalletBalance.js");
|
14
|
-
const ErrorState_js_1 = require("../../../../wallets/shared/ErrorState.js");
|
15
|
-
const LoadingScreen_js_1 = require("../../../../wallets/shared/LoadingScreen.js");
|
16
|
-
const basic_js_1 = require("../../../components/basic.js");
|
17
|
-
const buttons_js_1 = require("../../../components/buttons.js");
|
18
|
-
const ChainName_js_1 = require("../../../components/ChainName.js");
|
19
|
-
const formElements_js_1 = require("../../../components/formElements.js");
|
20
|
-
const Spacer_js_1 = require("../../../components/Spacer.js");
|
21
|
-
const TokenSymbol_js_1 = require("../../../components/token/TokenSymbol.js");
|
22
|
-
const ConnectButton_js_1 = require("../../ConnectButton.js");
|
23
|
-
const NetworkSelector_js_1 = require("../../NetworkSelector.js");
|
24
|
-
const PoweredByTW_js_1 = require("../../PoweredByTW.js");
|
25
|
-
const nativeToken_js_1 = require("../nativeToken.js");
|
26
|
-
const TokenSelector_js_1 = require("../TokenSelector.js");
|
27
|
-
const WalletSwitcherConnectionScreen_js_1 = require("../WalletSwitcherConnectionScreen.js");
|
28
|
-
const DirectPaymentModeScreen_js_1 = require("./DirectPaymentModeScreen.js");
|
29
|
-
const CurrencySelection_js_1 = require("./fiat/CurrencySelection.js");
|
30
|
-
const FiatScreenContent_js_1 = require("./fiat/FiatScreenContent.js");
|
31
|
-
const OnRampScreen_js_1 = require("./fiat/OnRampScreen.js");
|
32
|
-
const useEnabledPaymentMethods_js_1 = require("./main/useEnabledPaymentMethods.js");
|
33
|
-
const useUISelectionStates_js_1 = require("./main/useUISelectionStates.js");
|
34
|
-
const PayTokenIcon_js_1 = require("./PayTokenIcon.js");
|
35
|
-
const BuyTokenInput_js_1 = require("./swap/BuyTokenInput.js");
|
36
|
-
const FiatValue_js_1 = require("./swap/FiatValue.js");
|
37
|
-
const fetchBalancesForWallet_js_1 = require("./swap/fetchBalancesForWallet.js");
|
38
|
-
const SwapFlow_js_1 = require("./swap/SwapFlow.js");
|
39
|
-
const SwapScreenContent_js_1 = require("./swap/SwapScreenContent.js");
|
40
|
-
const TokenSelectorScreen_js_1 = require("./swap/TokenSelectorScreen.js");
|
41
|
-
const TransferFlow_js_1 = require("./swap/TransferFlow.js");
|
42
|
-
const useSwapSupportedChains_js_1 = require("./swap/useSwapSupportedChains.js");
|
43
|
-
const TransactionModeScreen_js_1 = require("./TransactionModeScreen.js");
|
44
|
-
const usePayerSetup_js_1 = require("./usePayerSetup.js");
|
45
|
-
/**
|
46
|
-
* @internal
|
47
|
-
*/
|
48
|
-
function BuyScreen(props) {
|
49
|
-
const isTestMode = props.payOptions.buyWithCrypto
|
50
|
-
? props.payOptions.buyWithCrypto.testMode
|
51
|
-
: undefined;
|
52
|
-
const supportedDestinationsQuery = (0, useSwapSupportedChains_js_1.useBuySupportedDestinations)(props.client, isTestMode);
|
53
|
-
if (supportedDestinationsQuery.isError) {
|
54
|
-
return ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { center: "both", flex: "row", fullHeight: true, style: {
|
55
|
-
minHeight: "350px",
|
56
|
-
}, children: (0, jsx_runtime_1.jsx)(ErrorState_js_1.ErrorState, { onTryAgain: supportedDestinationsQuery.refetch, title: "Something went wrong" }) }));
|
57
|
-
}
|
58
|
-
if (!supportedDestinationsQuery.data) {
|
59
|
-
return (0, jsx_runtime_1.jsx)(LoadingScreen_js_1.LoadingScreen, {});
|
60
|
-
}
|
61
|
-
const supportedDestinations = props.supportedTokens
|
62
|
-
? Object.entries(props.supportedTokens).map(([chainId, tokens]) => ({
|
63
|
-
chain: (0, utils_js_1.getCachedChain)(Number.parseInt(chainId)),
|
64
|
-
tokens: tokens.map((t) => ({
|
65
|
-
...t,
|
66
|
-
buyWithCryptoEnabled: true,
|
67
|
-
buyWithFiatEnabled: true,
|
68
|
-
})),
|
69
|
-
}))
|
70
|
-
: supportedDestinationsQuery.data;
|
71
|
-
return ((0, jsx_runtime_1.jsx)(BuyScreenContent, { ...props, supportedDestinations: supportedDestinations }));
|
72
|
-
}
|
73
|
-
/**
|
74
|
-
* @internal
|
75
|
-
*/
|
76
|
-
function BuyScreenContent(props) {
|
77
|
-
const { client, supportedDestinations, connectLocale, payOptions } = props;
|
78
|
-
const activeAccount = (0, useActiveAccount_js_1.useActiveAccount)();
|
79
|
-
const { payer, setPayer } = (0, usePayerSetup_js_1.usePayerSetup)();
|
80
|
-
const [screen, setScreen] = (0, react_1.useState)({
|
81
|
-
id: "main",
|
82
|
-
});
|
83
|
-
const { tokenAmount, setTokenAmount, toChain, setToChain, deferredTokenAmount, toToken, setToToken, } = (0, useUISelectionStates_js_1.useToTokenSelectionStates)({
|
84
|
-
payOptions,
|
85
|
-
supportedDestinations,
|
86
|
-
});
|
87
|
-
const [hasEditedAmount, setHasEditedAmount] = (0, react_1.useState)(false);
|
88
|
-
const onDone = (0, react_1.useCallback)(() => {
|
89
|
-
setScreen({ id: "main" });
|
90
|
-
props.onDone();
|
91
|
-
}, [props.onDone]);
|
92
|
-
// check if the screen is expanded or not
|
93
|
-
// update supportedSources whenever toToken or toChain is updated
|
94
|
-
const supportedSourcesQuery = (0, useSwapSupportedChains_js_1.useBuySupportedSources)({
|
95
|
-
client: props.client,
|
96
|
-
destinationChainId: toChain.id,
|
97
|
-
destinationTokenAddress: (0, nativeToken_js_1.isNativeToken)(toToken)
|
98
|
-
? addresses_js_1.NATIVE_TOKEN_ADDRESS
|
99
|
-
: toToken.address,
|
100
|
-
});
|
101
|
-
const destinationSupportedTokens = (0, react_1.useMemo)(() => {
|
102
|
-
return createSupportedTokens(supportedDestinations, payOptions, props.supportedTokens);
|
103
|
-
}, [props.supportedTokens, supportedDestinations, payOptions]);
|
104
|
-
const sourceSupportedTokens = (0, react_1.useMemo)(() => {
|
105
|
-
if (!supportedSourcesQuery.data) {
|
106
|
-
return undefined;
|
107
|
-
}
|
108
|
-
const supportedSources = supportedSourcesQuery.data;
|
109
|
-
return createSupportedTokens(supportedSources, payOptions, props.supportedTokens);
|
110
|
-
}, [props.supportedTokens, supportedSourcesQuery.data, payOptions]);
|
111
|
-
// preload wallets and balances
|
112
|
-
(0, fetchBalancesForWallet_js_1.useWalletsAndBalances)({
|
113
|
-
client: props.client,
|
114
|
-
mode: payOptions.mode,
|
115
|
-
sourceSupportedTokens: sourceSupportedTokens || [],
|
116
|
-
toChain: toChain,
|
117
|
-
toToken: toToken,
|
118
|
-
});
|
119
|
-
const { fromChain, setFromChain, fromToken, setFromToken } = (0, useUISelectionStates_js_1.useFromTokenSelectionStates)({
|
120
|
-
payOptions,
|
121
|
-
supportedSources: supportedSourcesQuery.data || [],
|
122
|
-
});
|
123
|
-
const { selectedCurrency, setSelectedCurrency } = (0, useUISelectionStates_js_1.useFiatCurrencySelectionStates)({
|
124
|
-
payOptions,
|
125
|
-
});
|
126
|
-
const enabledPaymentMethods = (0, useEnabledPaymentMethods_js_1.useEnabledPaymentMethods)({
|
127
|
-
payOptions: props.payOptions,
|
128
|
-
supportedDestinations: props.supportedDestinations,
|
129
|
-
toChain: toChain,
|
130
|
-
toToken: toToken,
|
131
|
-
});
|
132
|
-
const payDisabled = enabledPaymentMethods.buyWithCryptoEnabled === false &&
|
133
|
-
enabledPaymentMethods.buyWithFiatEnabled === false;
|
134
|
-
// screens ----------------------------
|
135
|
-
const queryClient = (0, react_query_1.useQueryClient)();
|
136
|
-
const onSwapSuccess = (0, react_1.useCallback)((_status) => {
|
137
|
-
props.payOptions.onPurchaseSuccess?.({
|
138
|
-
status: _status,
|
139
|
-
type: "crypto",
|
140
|
-
});
|
141
|
-
(0, invalidateWalletBalance_js_1.invalidateWalletBalance)(queryClient);
|
142
|
-
}, [props.payOptions.onPurchaseSuccess, queryClient]);
|
143
|
-
const onFiatSuccess = (0, react_1.useCallback)((_status) => {
|
144
|
-
props.payOptions.onPurchaseSuccess?.({
|
145
|
-
status: _status,
|
146
|
-
type: "fiat",
|
147
|
-
});
|
148
|
-
(0, invalidateWalletBalance_js_1.invalidateWalletBalance)(queryClient);
|
149
|
-
}, [props.payOptions.onPurchaseSuccess, queryClient]);
|
150
|
-
if (screen.id === "connect-payer-wallet") {
|
151
|
-
return ((0, jsx_runtime_1.jsx)(WalletSwitcherConnectionScreen_js_1.WalletSwitcherConnectionScreen, { accountAbstraction: props.connectOptions?.accountAbstraction, appMetadata: props.connectOptions?.appMetadata, chain: toChain || props.connectOptions?.chain, chains: [toChain, ...(props.connectOptions?.chains || [])], client: props.client, connectLocale: props.connectLocale, hiddenWallets: props.hiddenWallets, isEmbed: props.isEmbed, onBack: () => setScreen(screen.backScreen), onSelect: (w) => {
|
152
|
-
const account = w.getAccount();
|
153
|
-
const chain = w.getChain();
|
154
|
-
if (w && account && chain) {
|
155
|
-
setPayer({
|
156
|
-
account,
|
157
|
-
chain,
|
158
|
-
wallet: w,
|
159
|
-
});
|
160
|
-
}
|
161
|
-
}, recommendedWallets: props.connectOptions?.recommendedWallets, showAllWallets: props.connectOptions?.showAllWallets === undefined
|
162
|
-
? true
|
163
|
-
: props.connectOptions?.showAllWallets, walletConnect: props.connectOptions?.walletConnect, wallets: props.connectOptions?.wallets?.filter((w) => w.id !== "inApp") }));
|
164
|
-
}
|
165
|
-
if (screen.id === "swap-flow" && payer) {
|
166
|
-
return ((0, jsx_runtime_1.jsx)(SwapFlow_js_1.SwapFlow, { approvalAmount: screen.approvalAmount, buyWithCryptoQuote: screen.quote, client: client, isEmbed: props.isEmbed, isFiatFlow: false, onBack: () => {
|
167
|
-
setScreen({
|
168
|
-
id: "buy-with-crypto",
|
169
|
-
});
|
170
|
-
}, onDone: onDone, onSuccess: onSwapSuccess, onTryAgain: () => {
|
171
|
-
setScreen({
|
172
|
-
id: "buy-with-crypto",
|
173
|
-
});
|
174
|
-
}, payer: payer, title: props.title, transactionMode: payOptions.mode === "transaction" }));
|
175
|
-
}
|
176
|
-
if (screen.id === "fiat-flow" && payer) {
|
177
|
-
const defaultRecipientAddress = props.payOptions?.paymentInfo?.sellerAddress;
|
178
|
-
const receiverAddress = defaultRecipientAddress || payer.account.address;
|
179
|
-
return ((0, jsx_runtime_1.jsx)(OnRampScreen_js_1.OnRampScreen, { client: client, isEmbed: props.isEmbed, onBack: () => {
|
180
|
-
setScreen({
|
181
|
-
id: "buy-with-fiat",
|
182
|
-
});
|
183
|
-
}, onDone: onDone, onSuccess: onFiatSuccess, payer: payer, paymentLinkId: props.paymentLinkId, quote: screen.quote, receiverAddress: receiverAddress, testMode: props.payOptions.buyWithFiat !== false &&
|
184
|
-
props.payOptions.buyWithFiat?.testMode === true, theme: typeof props.theme === "string" ? props.theme : props.theme.type, title: props.title, transactionMode: payOptions.mode === "transaction" }));
|
185
|
-
}
|
186
|
-
if (screen.id === "transfer-flow" && payer && activeAccount) {
|
187
|
-
const goBack = () => setScreen({ id: "buy-with-crypto" });
|
188
|
-
// TODO (pay) pass it via screen props
|
189
|
-
const defaultRecipientAddress = props.payOptions?.paymentInfo?.sellerAddress;
|
190
|
-
const receiverAddress = defaultRecipientAddress || activeAccount.address;
|
191
|
-
return ((0, jsx_runtime_1.jsx)(TransferFlow_js_1.TransferFlow, { chain: toChain, client: props.client, isEmbed: props.isEmbed, onBack: goBack, onDone: onDone, onSuccess: onSwapSuccess, onTryAgain: () => {
|
192
|
-
setScreen({
|
193
|
-
id: "buy-with-crypto",
|
194
|
-
});
|
195
|
-
}, payer: payer, paymentLinkId: props.paymentLinkId, payOptions: payOptions, receiverAddress: receiverAddress, title: props.title, token: toToken, tokenAmount: tokenAmount, transactionMode: props.payOptions.mode === "transaction" }));
|
196
|
-
}
|
197
|
-
if (screen.id === "select-currency") {
|
198
|
-
const goBack = () => setScreen(screen.backScreen);
|
199
|
-
return ((0, jsx_runtime_1.jsx)(CurrencySelection_js_1.CurrencySelection, { onBack: goBack, onSelect: (currency) => {
|
200
|
-
goBack();
|
201
|
-
setSelectedCurrency(currency);
|
202
|
-
} }));
|
203
|
-
}
|
204
|
-
if (screen.id === "select-to-token") {
|
205
|
-
const chains = supportedDestinations.map((x) => x.chain);
|
206
|
-
const goBack = () => setScreen(screen.backScreen);
|
207
|
-
const allowEdits = payOptions?.prefillBuy
|
208
|
-
?.allowEdits;
|
209
|
-
// if token selection is disabled - only show network selector screen
|
210
|
-
if (allowEdits?.token === false) {
|
211
|
-
return ((0, jsx_runtime_1.jsx)(ChainSelectionScreen, { chains: chains, client: props.client, connectLocale: props.connectLocale, goBack: goBack, setChain: setToChain }));
|
212
|
-
}
|
213
|
-
return ((0, jsx_runtime_1.jsx)(TokenSelector_js_1.TokenSelector, { chain: toChain, chainSelection:
|
214
|
-
// hide chain selection if it's disabled
|
215
|
-
allowEdits?.chain !== false
|
216
|
-
? {
|
217
|
-
chains: chains,
|
218
|
-
select: (c) => {
|
219
|
-
setToChain(c);
|
220
|
-
},
|
221
|
-
}
|
222
|
-
: undefined, client: client, connectLocale: connectLocale, modalTitle: props.title, onBack: goBack, onTokenSelect: (tokenInfo) => {
|
223
|
-
setToToken(tokenInfo);
|
224
|
-
goBack();
|
225
|
-
}, tokenList: ((toChain?.id ? destinationSupportedTokens[toChain.id] : undefined) ||
|
226
|
-
[]).filter((x) => x.address.toLowerCase() !== addresses_js_1.NATIVE_TOKEN_ADDRESS.toLowerCase()) }));
|
227
|
-
}
|
228
|
-
return ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { animate: "fadein", children: (0, jsx_runtime_1.jsxs)("div", { children: [screen.id === "main" && ((0, jsx_runtime_1.jsx)(MainScreen, { client: client, connectOptions: props.connectOptions, enabledPaymentMethods: enabledPaymentMethods, hasEditedAmount: hasEditedAmount, onBack: props.onBack, onSelectBuyToken: () => setScreen({ backScreen: screen, id: "select-to-token" }), payerAccount: payer?.account, payOptions: payOptions, setFromChain: setFromChain, setFromToken: setFromToken, setHasEditedAmount: setHasEditedAmount, setScreen: setScreen, setToChain: setToChain, setTokenAmount: setTokenAmount, setToToken: setToToken, supportedDestinations: supportedDestinations, theme: props.theme, title: props.title, toChain: toChain, tokenAmount: tokenAmount, toToken: toToken })), (screen.id === "select-payment-method" ||
|
229
|
-
screen.id === "buy-with-crypto" ||
|
230
|
-
screen.id === "buy-with-fiat" ||
|
231
|
-
screen.id === "select-from-token") &&
|
232
|
-
payer && ((0, jsx_runtime_1.jsxs)(TokenSelectedLayout, { client: client, disabled: ("prefillBuy" in payOptions &&
|
233
|
-
payOptions.prefillBuy?.allowEdits?.amount === false) ||
|
234
|
-
payOptions.mode !== "fund_wallet", onBack: () => {
|
235
|
-
if ((screen.id === "buy-with-crypto" ||
|
236
|
-
screen.id === "buy-with-fiat") &&
|
237
|
-
enabledPaymentMethods.buyWithCryptoEnabled) {
|
238
|
-
setScreen({
|
239
|
-
backScreen: { id: "main" },
|
240
|
-
id: "select-from-token",
|
241
|
-
});
|
242
|
-
}
|
243
|
-
else if (screen.id === "select-from-token") {
|
244
|
-
setScreen(screen.backScreen);
|
245
|
-
}
|
246
|
-
else {
|
247
|
-
setScreen({ id: "main" });
|
248
|
-
}
|
249
|
-
}, selectedChain: toChain, selectedToken: toToken, setTokenAmount: setTokenAmount, title: props.title, tokenAmount: tokenAmount, children: [screen.id === "buy-with-crypto" && activeAccount && ((0, jsx_runtime_1.jsx)(SwapScreenContent_js_1.SwapScreenContent, { activeAccount: activeAccount, client: client, connectLocale: connectLocale, connectOptions: props.connectOptions, disableTokenSelection: payDisabled === true ||
|
250
|
-
(payOptions.buyWithCrypto !== false &&
|
251
|
-
payOptions.buyWithCrypto?.prefillSource?.allowEdits
|
252
|
-
?.chain === false &&
|
253
|
-
payOptions.buyWithCrypto?.prefillSource?.allowEdits
|
254
|
-
?.token === false), fromChain: fromChain, fromToken: fromToken, isEmbed: props.isEmbed, onDone: onDone, payer: payer, paymentLinkId: props.paymentLinkId, payOptions: payOptions, setHasEditedAmount: setHasEditedAmount, setPayer: setPayer, setScreen: setScreen, setTokenAmount: setTokenAmount,
|
255
|
-
// pass it even though we are passing payer, because payer might be different
|
256
|
-
showFromTokenSelector: () => {
|
257
|
-
setScreen({
|
258
|
-
backScreen: screen,
|
259
|
-
id: "select-from-token",
|
260
|
-
});
|
261
|
-
}, toChain: toChain, tokenAmount: deferredTokenAmount, toToken: toToken })), screen.id === "buy-with-fiat" && ((0, jsx_runtime_1.jsx)(FiatScreenContent_js_1.FiatScreenContent, { client: client, isEmbed: props.isEmbed, onDone: onDone, payer: payer, paymentLinkId: props.paymentLinkId, payOptions: payOptions, selectedCurrency: selectedCurrency, setHasEditedAmount: setHasEditedAmount, setScreen: setScreen, setTokenAmount: setTokenAmount, showCurrencySelector: () => {
|
262
|
-
setScreen({
|
263
|
-
backScreen: screen,
|
264
|
-
id: "select-currency",
|
265
|
-
});
|
266
|
-
}, theme: props.theme, toChain: toChain, tokenAmount: deferredTokenAmount, toToken: toToken })), screen.id === "select-from-token" &&
|
267
|
-
supportedSourcesQuery.data &&
|
268
|
-
sourceSupportedTokens && ((0, jsx_runtime_1.jsx)(TokenSelectorScreen_js_1.TokenSelectorScreen, { client: props.client, fiatSupported: props.payOptions.buyWithFiat !== false, hiddenWallets: props.hiddenWallets, mode: payOptions.mode, onConnect: () => {
|
269
|
-
setScreen({
|
270
|
-
backScreen: screen,
|
271
|
-
id: "connect-payer-wallet",
|
272
|
-
});
|
273
|
-
}, onPayWithFiat: () => {
|
274
|
-
setScreen({
|
275
|
-
id: "buy-with-fiat",
|
276
|
-
});
|
277
|
-
}, onSelectToken: (w, token, chain) => {
|
278
|
-
const account = w.getAccount();
|
279
|
-
if (account) {
|
280
|
-
setPayer({
|
281
|
-
account,
|
282
|
-
chain,
|
283
|
-
wallet: w,
|
284
|
-
});
|
285
|
-
setFromToken(token);
|
286
|
-
setFromChain(chain);
|
287
|
-
}
|
288
|
-
setScreen({ id: "buy-with-crypto" });
|
289
|
-
}, sourceSupportedTokens: sourceSupportedTokens, sourceTokens: sourceSupportedTokens, toChain: toChain, tokenAmount: tokenAmount, toToken: toToken }))] }))] }) }));
|
290
|
-
}
|
291
|
-
function SelectedTokenInfo(props) {
|
292
|
-
const getWidth = () => {
|
293
|
-
const amount = (0, formatNumber_js_1.formatNumber)(Number(props.tokenAmount), 6).toString();
|
294
|
-
let chars = amount.replace(".", "").length;
|
295
|
-
const hasDot = amount.includes(".");
|
296
|
-
if (hasDot) {
|
297
|
-
chars += 0.3;
|
298
|
-
}
|
299
|
-
return `calc(${`${Math.max(1, chars)}ch + 2px`})`;
|
300
|
-
};
|
301
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { center: "y", flex: "row", gap: "sm", style: {
|
302
|
-
justifyContent: "space-between",
|
303
|
-
}, children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { center: "y", flex: "row", gap: "xxs", children: [(0, jsx_runtime_1.jsx)(formElements_js_1.Input, { "data-placeholder": props.tokenAmount === "", disabled: props.disabled, inputMode: "decimal", onChange: (e) => {
|
304
|
-
let value = e.target.value;
|
305
|
-
// Replace comma with period if it exists
|
306
|
-
value = value.replace(",", ".");
|
307
|
-
if (value.startsWith(".")) {
|
308
|
-
value = `0${value}`;
|
309
|
-
}
|
310
|
-
if (value.length > 10) {
|
311
|
-
return;
|
312
|
-
}
|
313
|
-
const numValue = Number(value);
|
314
|
-
if (Number.isNaN(numValue)) {
|
315
|
-
return;
|
316
|
-
}
|
317
|
-
if (value.startsWith("0") && !value.startsWith("0.")) {
|
318
|
-
props.setTokenAmount(value.slice(1));
|
319
|
-
}
|
320
|
-
else {
|
321
|
-
props.setTokenAmount(value);
|
322
|
-
}
|
323
|
-
}, onClick: (e) => {
|
324
|
-
// put cursor at the end of the input
|
325
|
-
if (props.tokenAmount === "") {
|
326
|
-
e.currentTarget.setSelectionRange(e.currentTarget.value.length, e.currentTarget.value.length);
|
327
|
-
}
|
328
|
-
}, pattern: "^[0-9]*[.,]?[0-9]*$", placeholder: "0", style: {
|
329
|
-
border: "none",
|
330
|
-
borderRadius: "0",
|
331
|
-
boxShadow: "none",
|
332
|
-
fontSize: index_js_1.fontSize.lg,
|
333
|
-
fontWeight: 600,
|
334
|
-
padding: "0",
|
335
|
-
paddingBlock: "2px",
|
336
|
-
textAlign: "left",
|
337
|
-
width: getWidth(),
|
338
|
-
}, tabIndex: -1, type: "text", value: props.tokenAmount || "0", variant: "outline" }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { center: "y", flex: "row", gap: "xxs", children: [(0, jsx_runtime_1.jsx)(TokenSymbol_js_1.TokenSymbol, { chain: props.selectedChain, color: "secondaryText", size: "md", token: props.selectedToken }), (0, jsx_runtime_1.jsx)(PayTokenIcon_js_1.PayTokenIcon, { chain: props.selectedChain, client: props.client, size: "sm", token: props.selectedToken })] }), (0, jsx_runtime_1.jsx)(FiatValue_js_1.FiatValue, { chain: props.selectedChain, client: props.client, size: "sm", token: props.selectedToken, tokenAmount: props.tokenAmount })] }), (0, jsx_runtime_1.jsx)(ChainName_js_1.ChainName, { chain: props.selectedChain, client: props.client, short: true, size: "sm" })] }) }));
|
339
|
-
}
|
340
|
-
function MainScreen(props) {
|
341
|
-
const { setTokenAmount, setToChain, setToToken, setFromChain, setFromToken, payerAccount, client, tokenAmount, payOptions, toToken, toChain, supportedDestinations, enabledPaymentMethods, } = props;
|
342
|
-
const { buyWithCryptoEnabled, buyWithFiatEnabled } = enabledPaymentMethods;
|
343
|
-
const disableContinue = !tokenAmount;
|
344
|
-
switch (payOptions.mode) {
|
345
|
-
case "transaction": {
|
346
|
-
return ((0, jsx_runtime_1.jsx)(TransactionModeScreen_js_1.TransactionModeScreen, { client: client, connectOptions: props.connectOptions, onContinue: (tokenAmount, toChain, toToken) => {
|
347
|
-
setTokenAmount(tokenAmount);
|
348
|
-
setToChain(toChain);
|
349
|
-
setFromChain(toChain);
|
350
|
-
setFromToken(toToken);
|
351
|
-
setToToken(toToken);
|
352
|
-
if (buyWithFiatEnabled && !buyWithCryptoEnabled) {
|
353
|
-
props.setScreen({ id: "buy-with-fiat" });
|
354
|
-
}
|
355
|
-
else {
|
356
|
-
props.setScreen({
|
357
|
-
backScreen: { id: "main" },
|
358
|
-
id: "select-from-token",
|
359
|
-
});
|
360
|
-
}
|
361
|
-
}, payerAccount: payerAccount, payUiOptions: payOptions, supportedDestinations: supportedDestinations }));
|
362
|
-
}
|
363
|
-
case "direct_payment": {
|
364
|
-
return ((0, jsx_runtime_1.jsx)(DirectPaymentModeScreen_js_1.DirectPaymentModeScreen, { client: client, connectOptions: props.connectOptions, onContinue: (tokenAmount, toChain, toToken) => {
|
365
|
-
setTokenAmount(tokenAmount);
|
366
|
-
setToChain(toChain);
|
367
|
-
setFromChain(toChain);
|
368
|
-
setFromToken(toToken);
|
369
|
-
setToToken(toToken);
|
370
|
-
if (buyWithFiatEnabled && !buyWithCryptoEnabled) {
|
371
|
-
props.setScreen({ id: "buy-with-fiat" });
|
372
|
-
}
|
373
|
-
else {
|
374
|
-
props.setScreen({
|
375
|
-
backScreen: { id: "main" },
|
376
|
-
id: "select-from-token",
|
377
|
-
});
|
378
|
-
}
|
379
|
-
}, payerAccount: payerAccount, payUiOptions: payOptions, supportedDestinations: supportedDestinations }));
|
380
|
-
}
|
381
|
-
default: {
|
382
|
-
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { px: "lg", children: [(0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" }), (0, jsx_runtime_1.jsx)(basic_js_1.ModalHeader, { onBack: props.onBack, title: props.title }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xl" }), (0, jsx_runtime_1.jsx)(BuyTokenInput_js_1.BuyTokenInput, { chain: toChain, client: props.client, freezeAmount: payOptions.prefillBuy?.allowEdits?.amount === false, freezeChainAndToken: (payOptions.prefillBuy?.allowEdits?.chain === false &&
|
383
|
-
payOptions.prefillBuy?.allowEdits?.token === false) ||
|
384
|
-
(payOptions.buyWithCrypto !== false &&
|
385
|
-
payOptions.buyWithCrypto?.prefillSource?.allowEdits?.token ===
|
386
|
-
false &&
|
387
|
-
payOptions.buyWithCrypto?.prefillSource?.allowEdits?.chain ===
|
388
|
-
false), onChange: async (value) => {
|
389
|
-
props.setHasEditedAmount(true);
|
390
|
-
setTokenAmount(value);
|
391
|
-
}, onSelectToken: props.onSelectBuyToken, token: toToken, value: tokenAmount }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "md" }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "column", gap: "sm", children: !payerAccount ? ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ConnectButton_js_1.ConnectButton, { ...props.connectOptions, client: props.client, connectButton: {
|
392
|
-
style: {
|
393
|
-
width: "100%",
|
394
|
-
},
|
395
|
-
}, theme: props.theme }) })) : ((0, jsx_runtime_1.jsx)(buttons_js_1.Button, { "data-disabled": disableContinue, disabled: disableContinue, fullWidth: true, onClick: () => {
|
396
|
-
if (buyWithFiatEnabled && !buyWithCryptoEnabled) {
|
397
|
-
props.setScreen({ id: "buy-with-fiat" });
|
398
|
-
}
|
399
|
-
else {
|
400
|
-
props.setScreen({
|
401
|
-
backScreen: { id: "main" },
|
402
|
-
id: "select-from-token",
|
403
|
-
});
|
404
|
-
}
|
405
|
-
(0, pay_js_1.trackPayEvent)({
|
406
|
-
client,
|
407
|
-
event: "choose_payment_method_fund_wallet_mode",
|
408
|
-
toChainId: toChain.id,
|
409
|
-
toToken: (0, nativeToken_js_1.isNativeToken)(toToken)
|
410
|
-
? undefined
|
411
|
-
: toToken.address,
|
412
|
-
walletAddress: payerAccount.address,
|
413
|
-
});
|
414
|
-
}, variant: "accent", children: "Continue" })) }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" }), payOptions.showThirdwebBranding !== false && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(PoweredByTW_js_1.PoweredByThirdweb, { link: "https://playground.thirdweb.com/connect/pay?utm_source=ub_text" }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" })] }))] }));
|
415
|
-
}
|
416
|
-
}
|
417
|
-
}
|
418
|
-
function TokenSelectedLayout(props) {
|
419
|
-
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { children: [(0, jsx_runtime_1.jsx)(basic_js_1.Container, { p: "lg", children: (0, jsx_runtime_1.jsx)(basic_js_1.ModalHeader, { onBack: props.onBack, title: props.title }) }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { px: "lg", style: {
|
420
|
-
paddingBottom: index_js_1.spacing.lg,
|
421
|
-
}, children: [(0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xs" }), (0, jsx_runtime_1.jsx)(SelectedTokenInfo, { client: props.client, disabled: props.disabled, selectedChain: props.selectedChain, selectedToken: props.selectedToken, setTokenAmount: props.setTokenAmount, tokenAmount: props.tokenAmount }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" }), (0, jsx_runtime_1.jsx)(basic_js_1.Line, {}), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" }), props.children] })] }));
|
422
|
-
}
|
423
|
-
function createSupportedTokens(data, payOptions, supportedTokensOverrides) {
|
424
|
-
// dev override
|
425
|
-
if (supportedTokensOverrides) {
|
426
|
-
return supportedTokensOverrides;
|
427
|
-
}
|
428
|
-
const tokens = {};
|
429
|
-
const isBuyWithFiatDisabled = payOptions.buyWithFiat === false;
|
430
|
-
const isBuyWithCryptoDisabled = payOptions.buyWithCrypto === false;
|
431
|
-
for (const x of data) {
|
432
|
-
tokens[x.chain.id] = x.tokens.filter((t) => {
|
433
|
-
if (t.address === addresses_js_1.ZERO_ADDRESS) {
|
434
|
-
return false;
|
435
|
-
}
|
436
|
-
// for source tokens, data is not provided, so we include all of them
|
437
|
-
if (t.buyWithCryptoEnabled === undefined &&
|
438
|
-
t.buyWithFiatEnabled === undefined) {
|
439
|
-
return true;
|
440
|
-
}
|
441
|
-
// it token supports both - include it
|
442
|
-
if (t.buyWithCryptoEnabled && t.buyWithFiatEnabled) {
|
443
|
-
return true;
|
444
|
-
}
|
445
|
-
// if buyWithFiat is disabled, and buyWithCrypto is not supported by token - exclude the token
|
446
|
-
if (!t.buyWithCryptoEnabled && isBuyWithFiatDisabled) {
|
447
|
-
return false;
|
448
|
-
}
|
449
|
-
// if buyWithCrypto is disabled, and buyWithFiat is not supported by token - exclude the token
|
450
|
-
if (!t.buyWithFiatEnabled && isBuyWithCryptoDisabled) {
|
451
|
-
return false;
|
452
|
-
}
|
453
|
-
return true; // include the token
|
454
|
-
});
|
455
|
-
}
|
456
|
-
return tokens;
|
457
|
-
}
|
458
|
-
function ChainSelectionScreen(props) {
|
459
|
-
return ((0, jsx_runtime_1.jsx)(NetworkSelector_js_1.NetworkSelectorContent, { chains: props.chains, client: props.client, closeModal: props.goBack, connectLocale: props.connectLocale, networkSelector: {
|
460
|
-
renderChain(renderChainProps) {
|
461
|
-
return ((0, jsx_runtime_1.jsx)(NetworkSelector_js_1.ChainButton, { chain: renderChainProps.chain, client: props.client, confirming: false, connectLocale: props.connectLocale, onClick: () => {
|
462
|
-
props.setChain(renderChainProps.chain);
|
463
|
-
props.goBack();
|
464
|
-
}, switchingFailed: false }));
|
465
|
-
},
|
466
|
-
}, onBack: props.goBack, showTabs: false }));
|
467
|
-
}
|
468
|
-
//# sourceMappingURL=BuyScreen.js.map
|