thirdweb 5.40.0-nightly-3848327373e49aa83c5902e6a16d5b8e96cf1eeb-20240726000343 → 5.40.1-nightly-b128530355f0dc47d897bd2ef7c3823752ea9b6c-20240727000321
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/exports/react.js +28 -21
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/exports/react.native.js +22 -20
- package/dist/cjs/exports/react.native.js.map +1 -1
- package/dist/cjs/react/core/design-system/index.js +2 -0
- package/dist/cjs/react/core/design-system/index.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useEstimateGas.js +17 -2
- package/dist/cjs/react/core/hooks/transaction/useEstimateGas.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useEstimateGasCost.js +17 -1
- package/dist/cjs/react/core/hooks/transaction/useEstimateGasCost.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendAndConfirmTransaction.js +17 -2
- package/dist/cjs/react/core/hooks/transaction/useSendAndConfirmTransaction.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendBatchTransaction.js +17 -2
- package/dist/cjs/react/core/hooks/transaction/useSendBatchTransaction.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +13 -94
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js +15 -2
- package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveWallet.js +15 -2
- package/dist/cjs/react/core/hooks/wallets/useActiveWallet.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveWalletChain.js +15 -2
- package/dist/cjs/react/core/hooks/wallets/useActiveWalletChain.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveWalletConnectionStatus.js +19 -2
- package/dist/cjs/react/core/hooks/wallets/useActiveWalletConnectionStatus.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useAutoConnect.js +5 -3
- package/dist/cjs/react/core/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useCallsStatus.js +18 -2
- package/dist/cjs/react/core/hooks/wallets/useCallsStatus.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useCapabilities.js +19 -2
- package/dist/cjs/react/core/hooks/wallets/useCapabilities.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useConnect.js +34 -2
- package/dist/cjs/react/core/hooks/wallets/useConnect.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useConnectedWallets.js +15 -2
- package/dist/cjs/react/core/hooks/wallets/useConnectedWallets.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useDisconnect.js +24 -2
- package/dist/cjs/react/core/hooks/wallets/useDisconnect.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useIsAutoConnecting.js +17 -2
- package/dist/cjs/react/core/hooks/wallets/useIsAutoConnecting.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSendCalls.js +70 -7
- package/dist/cjs/react/core/hooks/wallets/useSendCalls.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSendToken.js +22 -3
- package/dist/cjs/react/core/hooks/wallets/useSendToken.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSetActiveWallet.js +18 -2
- package/dist/cjs/react/core/hooks/wallets/useSetActiveWallet.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.js +18 -2
- package/dist/cjs/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSwitchActiveWalletChain.js +19 -2
- package/dist/cjs/react/core/hooks/wallets/useSwitchActiveWalletChain.js.map +1 -1
- package/dist/cjs/react/core/providers/connection-manager.js +14 -0
- package/dist/cjs/react/core/providers/connection-manager.js.map +1 -0
- package/dist/cjs/react/core/providers/thirdweb-provider.js +5 -18
- package/dist/cjs/react/core/providers/thirdweb-provider.js.map +1 -1
- package/dist/cjs/react/core/utils/defaultTokens.js +32 -25
- package/dist/cjs/react/core/utils/defaultTokens.js.map +1 -1
- package/dist/cjs/react/core/utils/wallet.js +91 -13
- package/dist/cjs/react/core/utils/wallet.js.map +1 -1
- package/dist/cjs/react/native/hooks/transaction/useSendTransaction.js +2 -2
- package/dist/cjs/react/native/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/native/hooks/wallets/useAutoConnect.js +1 -2
- package/dist/cjs/react/native/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/cjs/react/native/providers/thirdweb-provider.js +31 -0
- package/dist/cjs/react/native/providers/thirdweb-provider.js.map +1 -0
- package/dist/cjs/react/native/ui/AutoConnect/AutoConnect.js +1 -1
- package/dist/cjs/react/native/ui/AutoConnect/AutoConnect.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectButton.js +3 -3
- package/dist/cjs/react/native/ui/connect/ConnectButton.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectModal.js +13 -5
- package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectedButton.js +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectedButton.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectedModal.js +4 -4
- package/dist/cjs/react/native/ui/connect/ConnectedModal.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/SendScreen.js +3 -3
- package/dist/cjs/react/native/ui/connect/SendScreen.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/TokenListScreen.js +2 -2
- package/dist/cjs/react/native/ui/connect/TokenListScreen.js.map +1 -1
- package/dist/cjs/react/native/ui/transaction/TransactionButton.js +1 -1
- package/dist/cjs/react/native/ui/transaction/TransactionButton.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +20 -129
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/hooks/wallets/useAutoConnect.js +1 -2
- package/dist/cjs/react/web/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/cjs/react/web/providers/thirdweb-provider.js +31 -0
- package/dist/cjs/react/web/providers/thirdweb-provider.js.map +1 -0
- package/dist/cjs/react/web/ui/AutoConnect/AutoConnect.js +1 -1
- package/dist/cjs/react/web/ui/AutoConnect/AutoConnect.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +3 -3
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +8 -6
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +5 -11
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +6 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +10 -3
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/screen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/screen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +185 -119
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +104 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js +3 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +69 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +24 -6
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +132 -45
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +2 -5
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +14 -9
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +9 -5
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +8 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +84 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js +14 -8
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +3 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js +3 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewNFTs.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewNFTs.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewTokens.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewTokens.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/nativeToken.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/nativeToken.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +16 -9
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +53 -0
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +33 -0
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -0
- package/dist/cjs/react/web/ui/TransactionButton/index.js +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/index.js.map +1 -1
- package/dist/cjs/react/web/ui/components/WalletImage.js +1 -1
- package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js +1 -1
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/exports/react.js +23 -20
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/react.native.js +20 -19
- package/dist/esm/exports/react.native.js.map +1 -1
- package/dist/esm/react/core/design-system/index.js +2 -0
- package/dist/esm/react/core/design-system/index.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useEstimateGas.js +16 -1
- package/dist/esm/react/core/hooks/transaction/useEstimateGas.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useEstimateGasCost.js +17 -1
- package/dist/esm/react/core/hooks/transaction/useEstimateGasCost.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendAndConfirmTransaction.js +16 -1
- package/dist/esm/react/core/hooks/transaction/useSendAndConfirmTransaction.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendBatchTransaction.js +16 -1
- package/dist/esm/react/core/hooks/transaction/useSendBatchTransaction.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +13 -93
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveAccount.js +14 -1
- package/dist/esm/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveWallet.js +14 -1
- package/dist/esm/react/core/hooks/wallets/useActiveWallet.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveWalletChain.js +14 -1
- package/dist/esm/react/core/hooks/wallets/useActiveWalletChain.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveWalletConnectionStatus.js +18 -1
- package/dist/esm/react/core/hooks/wallets/useActiveWalletConnectionStatus.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useAutoConnect.js +7 -5
- package/dist/esm/react/core/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useCallsStatus.js +17 -1
- package/dist/esm/react/core/hooks/wallets/useCallsStatus.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useCapabilities.js +18 -1
- package/dist/esm/react/core/hooks/wallets/useCapabilities.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useConnect.js +33 -1
- package/dist/esm/react/core/hooks/wallets/useConnect.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useConnectedWallets.js +14 -1
- package/dist/esm/react/core/hooks/wallets/useConnectedWallets.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useDisconnect.js +23 -1
- package/dist/esm/react/core/hooks/wallets/useDisconnect.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useIsAutoConnecting.js +16 -1
- package/dist/esm/react/core/hooks/wallets/useIsAutoConnecting.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSendCalls.js +69 -6
- package/dist/esm/react/core/hooks/wallets/useSendCalls.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSendToken.js +21 -2
- package/dist/esm/react/core/hooks/wallets/useSendToken.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSetActiveWallet.js +17 -1
- package/dist/esm/react/core/hooks/wallets/useSetActiveWallet.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.js +17 -1
- package/dist/esm/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSwitchActiveWalletChain.js +18 -1
- package/dist/esm/react/core/hooks/wallets/useSwitchActiveWalletChain.js.map +1 -1
- package/dist/esm/react/core/providers/connection-manager.js +10 -0
- package/dist/esm/react/core/providers/connection-manager.js.map +1 -0
- package/dist/esm/react/core/providers/thirdweb-provider.js +4 -17
- package/dist/esm/react/core/providers/thirdweb-provider.js.map +1 -1
- package/dist/esm/react/core/utils/defaultTokens.js +31 -25
- package/dist/esm/react/core/utils/defaultTokens.js.map +1 -1
- package/dist/esm/react/core/utils/wallet.js +88 -13
- package/dist/esm/react/core/utils/wallet.js.map +1 -1
- package/dist/esm/react/native/hooks/transaction/useSendTransaction.js +2 -2
- package/dist/esm/react/native/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/native/hooks/wallets/useAutoConnect.js +1 -2
- package/dist/esm/react/native/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/esm/react/native/providers/thirdweb-provider.js +28 -0
- package/dist/esm/react/native/providers/thirdweb-provider.js.map +1 -0
- package/dist/esm/react/native/ui/AutoConnect/AutoConnect.js +1 -1
- package/dist/esm/react/native/ui/AutoConnect/AutoConnect.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectButton.js +3 -3
- package/dist/esm/react/native/ui/connect/ConnectButton.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectModal.js +12 -4
- package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectedButton.js +1 -1
- package/dist/esm/react/native/ui/connect/ConnectedButton.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectedModal.js +4 -4
- package/dist/esm/react/native/ui/connect/ConnectedModal.js.map +1 -1
- package/dist/esm/react/native/ui/connect/SendScreen.js +3 -3
- package/dist/esm/react/native/ui/connect/SendScreen.js.map +1 -1
- package/dist/esm/react/native/ui/connect/TokenListScreen.js +2 -2
- package/dist/esm/react/native/ui/connect/TokenListScreen.js.map +1 -1
- package/dist/esm/react/native/ui/transaction/TransactionButton.js +1 -1
- package/dist/esm/react/native/ui/transaction/TransactionButton.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +22 -131
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/hooks/wallets/useAutoConnect.js +1 -2
- package/dist/esm/react/web/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/esm/react/web/providers/thirdweb-provider.js +28 -0
- package/dist/esm/react/web/providers/thirdweb-provider.js.map +1 -0
- package/dist/esm/react/web/ui/AutoConnect/AutoConnect.js +1 -1
- package/dist/esm/react/web/ui/AutoConnect/AutoConnect.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +3 -3
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +8 -6
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +5 -11
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +5 -3
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +9 -2
- package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/screen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/screen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +4 -4
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +189 -123
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +101 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js +2 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +66 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +23 -6
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +4 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +130 -44
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +2 -5
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +14 -9
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +4 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +7 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +9 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +81 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js +15 -9
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +3 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +4 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js +3 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewNFTs.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewNFTs.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewTokens.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewTokens.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/nativeToken.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/nativeToken.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +16 -9
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +50 -0
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -0
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +29 -0
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -0
- package/dist/esm/react/web/ui/TransactionButton/index.js +1 -1
- package/dist/esm/react/web/ui/TransactionButton/index.js.map +1 -1
- package/dist/esm/react/web/ui/components/WalletImage.js +1 -1
- package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js +1 -1
- package/dist/esm/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/exports/react.d.ts +23 -21
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +20 -19
- package/dist/types/exports/react.native.d.ts.map +1 -1
- package/dist/types/exports/wallets.d.ts +1 -0
- package/dist/types/exports/wallets.d.ts.map +1 -1
- package/dist/types/react/core/design-system/index.d.ts +2 -0
- package/dist/types/react/core/design-system/index.d.ts.map +1 -1
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +80 -34
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
- package/dist/types/react/core/hooks/connection/ConnectEmbedProps.d.ts +28 -0
- package/dist/types/react/core/hooks/connection/ConnectEmbedProps.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useEstimateGas.d.ts +14 -2
- package/dist/types/react/core/hooks/transaction/useEstimateGas.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useEstimateGasCost.d.ts +15 -2
- package/dist/types/react/core/hooks/transaction/useEstimateGasCost.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendAndConfirmTransaction.d.ts +14 -2
- package/dist/types/react/core/hooks/transaction/useSendAndConfirmTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendBatchTransaction.d.ts +14 -2
- package/dist/types/react/core/hooks/transaction/useSendBatchTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +3 -15
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts +12 -2
- package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveWallet.d.ts +12 -2
- package/dist/types/react/core/hooks/wallets/useActiveWallet.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveWalletChain.d.ts +12 -2
- package/dist/types/react/core/hooks/wallets/useActiveWalletChain.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveWalletConnectionStatus.d.ts +16 -2
- package/dist/types/react/core/hooks/wallets/useActiveWalletConnectionStatus.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useAutoConnect.d.ts +1 -2
- package/dist/types/react/core/hooks/wallets/useAutoConnect.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useCallsStatus.d.ts +16 -3
- package/dist/types/react/core/hooks/wallets/useCallsStatus.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useCapabilities.d.ts +17 -3
- package/dist/types/react/core/hooks/wallets/useCapabilities.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useConnect.d.ts +32 -2
- package/dist/types/react/core/hooks/wallets/useConnect.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useConnectedWallets.d.ts +12 -2
- package/dist/types/react/core/hooks/wallets/useConnectedWallets.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useDisconnect.d.ts +21 -2
- package/dist/types/react/core/hooks/wallets/useDisconnect.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useIsAutoConnecting.d.ts +14 -2
- package/dist/types/react/core/hooks/wallets/useIsAutoConnecting.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useSendCalls.d.ts +64 -2
- package/dist/types/react/core/hooks/wallets/useSendCalls.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useSendToken.d.ts +19 -3
- package/dist/types/react/core/hooks/wallets/useSendToken.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useSetActiveWallet.d.ts +15 -2
- package/dist/types/react/core/hooks/wallets/useSetActiveWallet.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts +15 -2
- package/dist/types/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useSwitchActiveWalletChain.d.ts +16 -2
- package/dist/types/react/core/hooks/wallets/useSwitchActiveWalletChain.d.ts.map +1 -1
- package/dist/types/react/core/providers/connection-manager.d.ts +35 -0
- package/dist/types/react/core/providers/connection-manager.d.ts.map +1 -0
- package/dist/types/react/core/providers/thirdweb-provider.d.ts +6 -16
- package/dist/types/react/core/providers/thirdweb-provider.d.ts.map +1 -1
- package/dist/types/react/core/utils/defaultTokens.d.ts +222 -0
- package/dist/types/react/core/utils/defaultTokens.d.ts.map +1 -1
- package/dist/types/react/core/utils/wallet.d.ts +43 -1
- package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
- package/dist/types/react/native/hooks/wallets/useAutoConnect.d.ts.map +1 -1
- package/dist/types/react/native/providers/thirdweb-provider.d.ts +22 -0
- package/dist/types/react/native/providers/thirdweb-provider.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/SendScreen.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/TokenListScreen.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +2 -4
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/hooks/wallets/useAutoConnect.d.ts.map +1 -1
- package/dist/types/react/web/providers/thirdweb-provider.d.ts +22 -0
- package/dist/types/react/web/providers/thirdweb-provider.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +3 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +0 -3
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts +18 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts +18 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts +5 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +14 -8
- 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/main/useBuyTxStates.d.ts +19 -9
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts +6 -5
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +0 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts +4 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts +19 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/SendFunds.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewNFTs.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewTokens.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/nativeToken.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts +0 -6
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts +9 -0
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +24 -0
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/exports/react.native.ts +21 -19
- package/src/exports/react.ts +35 -21
- package/src/exports/wallets.ts +2 -0
- package/src/react/core/design-system/index.ts +2 -0
- package/src/react/core/hooks/connection/ConnectButtonProps.ts +103 -51
- package/src/react/core/hooks/connection/ConnectEmbedProps.ts +29 -0
- package/src/react/core/hooks/transaction/useEstimateGas.ts +20 -4
- package/src/react/core/hooks/transaction/useEstimateGasCost.ts +21 -4
- package/src/react/core/hooks/transaction/useSendAndConfirmTransaction.ts +20 -4
- package/src/react/core/hooks/transaction/useSendBatchTransaction.ts +20 -4
- package/src/react/core/hooks/transaction/useSendTransaction.ts +17 -127
- package/src/react/core/hooks/wallets/useActiveAccount.ts +14 -2
- package/src/react/core/hooks/wallets/useActiveWallet.ts +14 -2
- package/src/react/core/hooks/wallets/useActiveWalletChain.ts +14 -2
- package/src/react/core/hooks/wallets/useActiveWalletConnectionStatus.ts +18 -4
- package/src/react/core/hooks/wallets/useAutoConnect.ts +6 -6
- package/src/react/core/hooks/wallets/useCallsStatus.ts +21 -9
- package/src/react/core/hooks/wallets/useCapabilities.ts +20 -7
- package/src/react/core/hooks/wallets/useConnect.ts +34 -8
- package/src/react/core/hooks/wallets/useConnectedWallets.ts +14 -2
- package/src/react/core/hooks/wallets/useDisconnect.ts +23 -2
- package/src/react/core/hooks/wallets/useIsAutoConnecting.ts +16 -2
- package/src/react/core/hooks/wallets/useSendCalls.ts +72 -12
- package/src/react/core/hooks/wallets/useSendToken.ts +21 -3
- package/src/react/core/hooks/wallets/useSetActiveWallet.ts +17 -2
- package/src/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.ts +17 -4
- package/src/react/core/hooks/wallets/useSwitchActiveWalletChain.ts +18 -2
- package/src/react/core/providers/connection-manager.tsx +16 -0
- package/src/react/core/providers/thirdweb-provider.tsx +15 -22
- package/src/react/core/utils/defaultTokens.ts +38 -26
- package/src/react/core/utils/wallet.ts +102 -18
- package/src/react/native/hooks/transaction/useSendTransaction.tsx +2 -2
- package/src/react/native/hooks/wallets/useAutoConnect.ts +1 -2
- package/src/react/native/providers/thirdweb-provider.tsx +43 -0
- package/src/react/native/ui/AutoConnect/AutoConnect.tsx +1 -1
- package/src/react/native/ui/connect/ConnectButton.tsx +3 -3
- package/src/react/native/ui/connect/ConnectModal.tsx +12 -4
- package/src/react/native/ui/connect/ConnectedButton.tsx +1 -1
- package/src/react/native/ui/connect/ConnectedModal.tsx +4 -4
- package/src/react/native/ui/connect/SendScreen.tsx +3 -3
- package/src/react/native/ui/connect/TokenListScreen.tsx +2 -2
- package/src/react/native/ui/transaction/TransactionButton.tsx +1 -1
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +36 -280
- package/src/react/web/hooks/wallets/useAutoConnect.ts +1 -2
- package/src/react/web/providers/thirdweb-provider.tsx +42 -0
- package/src/react/web/ui/AutoConnect/AutoConnect.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +3 -3
- package/src/react/web/ui/ConnectWallet/Details.tsx +11 -9
- package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +7 -8
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx +5 -3
- package/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx +9 -2
- package/src/react/web/ui/ConnectWallet/Modal/screen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +4 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +348 -384
- package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +266 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.tsx +2 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +253 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.tsx +53 -22
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx +3 -6
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.tsx +5 -6
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.tsx +2 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.tsx +2 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +16 -12
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts +155 -60
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.ts +8 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +18 -13
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.tsx +5 -5
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.tsx +2 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +27 -19
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.tsx +8 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +12 -5
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx +2 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.tsx +3 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.tsx +243 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.tsx +31 -18
- package/src/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.tsx +3 -3
- package/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx +4 -4
- package/src/react/web/ui/ConnectWallet/screens/ManageWalletScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx +3 -3
- package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/ViewNFTs.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/ViewTokens.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/nativeToken.ts +5 -1
- package/src/react/web/ui/PayEmbed.tsx +31 -32
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +127 -0
- package/src/react/web/ui/TransactionButton/TransactionButton.test.tsx +8 -5
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +83 -0
- package/src/react/web/ui/TransactionButton/index.tsx +1 -1
- package/src/react/web/ui/components/WalletImage.tsx +1 -1
- package/src/react/web/ui/prebuilt/thirdweb/ClaimButton/index.tsx +1 -1
- package/src/version.ts +1 -1
- package/dist/cjs/react/core/connectionManager.js +0 -12
- package/dist/cjs/react/core/connectionManager.js.map +0 -1
- package/dist/cjs/react/native/hooks/transaction/useEstimateGas.js +0 -23
- package/dist/cjs/react/native/hooks/transaction/useEstimateGas.js.map +0 -1
- package/dist/cjs/react/native/hooks/transaction/useEstimateGasCost.js +0 -27
- package/dist/cjs/react/native/hooks/transaction/useEstimateGasCost.js.map +0 -1
- package/dist/cjs/react/native/hooks/transaction/useSendAndConfirmTransaction.js +0 -23
- package/dist/cjs/react/native/hooks/transaction/useSendAndConfirmTransaction.js.map +0 -1
- package/dist/cjs/react/native/hooks/transaction/useSendBatchTransaction.js +0 -23
- package/dist/cjs/react/native/hooks/transaction/useSendBatchTransaction.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useActiveAccount.js +0 -20
- package/dist/cjs/react/native/hooks/wallets/useActiveAccount.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useActiveWallet.js +0 -20
- package/dist/cjs/react/native/hooks/wallets/useActiveWallet.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useActiveWalletChain.js +0 -20
- package/dist/cjs/react/native/hooks/wallets/useActiveWalletChain.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useActiveWalletConnectionStatus.js +0 -24
- package/dist/cjs/react/native/hooks/wallets/useActiveWalletConnectionStatus.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useCallsStatus.js +0 -24
- package/dist/cjs/react/native/hooks/wallets/useCallsStatus.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useCapabilities.js +0 -25
- package/dist/cjs/react/native/hooks/wallets/useCapabilities.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useConnect.js +0 -39
- package/dist/cjs/react/native/hooks/wallets/useConnect.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useConnectedWallets.js +0 -20
- package/dist/cjs/react/native/hooks/wallets/useConnectedWallets.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useDisconnect.js +0 -29
- package/dist/cjs/react/native/hooks/wallets/useDisconnect.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useIsAutoConnecting.js +0 -22
- package/dist/cjs/react/native/hooks/wallets/useIsAutoConnecting.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useSendCalls.js +0 -71
- package/dist/cjs/react/native/hooks/wallets/useSendCalls.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useSendToken.js +0 -31
- package/dist/cjs/react/native/hooks/wallets/useSendToken.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useSetActiveWallet.js +0 -23
- package/dist/cjs/react/native/hooks/wallets/useSetActiveWallet.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useSetActiveWalletConnectionStatus.js +0 -23
- package/dist/cjs/react/native/hooks/wallets/useSetActiveWalletConnectionStatus.js.map +0 -1
- package/dist/cjs/react/native/hooks/wallets/useSwitchActiveWalletChain.js +0 -24
- package/dist/cjs/react/native/hooks/wallets/useSwitchActiveWalletChain.js.map +0 -1
- package/dist/cjs/react/native/index.js +0 -7
- package/dist/cjs/react/native/index.js.map +0 -1
- package/dist/cjs/react/web/hooks/transaction/useEstimateGas.js +0 -23
- package/dist/cjs/react/web/hooks/transaction/useEstimateGas.js.map +0 -1
- package/dist/cjs/react/web/hooks/transaction/useEstimateGasCost.js +0 -27
- package/dist/cjs/react/web/hooks/transaction/useEstimateGasCost.js.map +0 -1
- package/dist/cjs/react/web/hooks/transaction/useSendAndConfirmTransaction.js +0 -23
- package/dist/cjs/react/web/hooks/transaction/useSendAndConfirmTransaction.js.map +0 -1
- package/dist/cjs/react/web/hooks/transaction/useSendBatchTransaction.js +0 -23
- package/dist/cjs/react/web/hooks/transaction/useSendBatchTransaction.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useActiveAccount.js +0 -20
- package/dist/cjs/react/web/hooks/wallets/useActiveAccount.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useActiveWallet.js +0 -20
- package/dist/cjs/react/web/hooks/wallets/useActiveWallet.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useActiveWalletChain.js +0 -20
- package/dist/cjs/react/web/hooks/wallets/useActiveWalletChain.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useActiveWalletConnectionStatus.js +0 -24
- package/dist/cjs/react/web/hooks/wallets/useActiveWalletConnectionStatus.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useCallsStatus.js +0 -24
- package/dist/cjs/react/web/hooks/wallets/useCallsStatus.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useCapabilities.js +0 -25
- package/dist/cjs/react/web/hooks/wallets/useCapabilities.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useConnect.js +0 -39
- package/dist/cjs/react/web/hooks/wallets/useConnect.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useConnectedWallets.js +0 -20
- package/dist/cjs/react/web/hooks/wallets/useConnectedWallets.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useDisconnect.js +0 -29
- package/dist/cjs/react/web/hooks/wallets/useDisconnect.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useIsAutoConnecting.js +0 -22
- package/dist/cjs/react/web/hooks/wallets/useIsAutoConnecting.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useSendCalls.js +0 -71
- package/dist/cjs/react/web/hooks/wallets/useSendCalls.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useSendToken.js +0 -31
- package/dist/cjs/react/web/hooks/wallets/useSendToken.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useSetActiveWallet.js +0 -23
- package/dist/cjs/react/web/hooks/wallets/useSetActiveWallet.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useSetActiveWalletConnectionStatus.js +0 -23
- package/dist/cjs/react/web/hooks/wallets/useSetActiveWalletConnectionStatus.js.map +0 -1
- package/dist/cjs/react/web/hooks/wallets/useSwitchActiveWalletChain.js +0 -24
- package/dist/cjs/react/web/hooks/wallets/useSwitchActiveWalletChain.js.map +0 -1
- package/dist/cjs/react/web/index.js +0 -7
- package/dist/cjs/react/web/index.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +0 -66
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +0 -1
- package/dist/esm/react/core/connectionManager.js +0 -9
- package/dist/esm/react/core/connectionManager.js.map +0 -1
- package/dist/esm/react/native/hooks/transaction/useEstimateGas.js +0 -20
- package/dist/esm/react/native/hooks/transaction/useEstimateGas.js.map +0 -1
- package/dist/esm/react/native/hooks/transaction/useEstimateGasCost.js +0 -24
- package/dist/esm/react/native/hooks/transaction/useEstimateGasCost.js.map +0 -1
- package/dist/esm/react/native/hooks/transaction/useSendAndConfirmTransaction.js +0 -20
- package/dist/esm/react/native/hooks/transaction/useSendAndConfirmTransaction.js.map +0 -1
- package/dist/esm/react/native/hooks/transaction/useSendBatchTransaction.js +0 -20
- package/dist/esm/react/native/hooks/transaction/useSendBatchTransaction.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useActiveAccount.js +0 -17
- package/dist/esm/react/native/hooks/wallets/useActiveAccount.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useActiveWallet.js +0 -17
- package/dist/esm/react/native/hooks/wallets/useActiveWallet.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useActiveWalletChain.js +0 -17
- package/dist/esm/react/native/hooks/wallets/useActiveWalletChain.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useActiveWalletConnectionStatus.js +0 -21
- package/dist/esm/react/native/hooks/wallets/useActiveWalletConnectionStatus.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useCallsStatus.js +0 -21
- package/dist/esm/react/native/hooks/wallets/useCallsStatus.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useCapabilities.js +0 -22
- package/dist/esm/react/native/hooks/wallets/useCapabilities.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useConnect.js +0 -36
- package/dist/esm/react/native/hooks/wallets/useConnect.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useConnectedWallets.js +0 -17
- package/dist/esm/react/native/hooks/wallets/useConnectedWallets.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useDisconnect.js +0 -26
- package/dist/esm/react/native/hooks/wallets/useDisconnect.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useIsAutoConnecting.js +0 -19
- package/dist/esm/react/native/hooks/wallets/useIsAutoConnecting.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useSendCalls.js +0 -69
- package/dist/esm/react/native/hooks/wallets/useSendCalls.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useSendToken.js +0 -28
- package/dist/esm/react/native/hooks/wallets/useSendToken.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useSetActiveWallet.js +0 -20
- package/dist/esm/react/native/hooks/wallets/useSetActiveWallet.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useSetActiveWalletConnectionStatus.js +0 -20
- package/dist/esm/react/native/hooks/wallets/useSetActiveWalletConnectionStatus.js.map +0 -1
- package/dist/esm/react/native/hooks/wallets/useSwitchActiveWalletChain.js +0 -21
- package/dist/esm/react/native/hooks/wallets/useSwitchActiveWalletChain.js.map +0 -1
- package/dist/esm/react/native/index.js +0 -4
- package/dist/esm/react/native/index.js.map +0 -1
- package/dist/esm/react/web/hooks/transaction/useEstimateGas.js +0 -20
- package/dist/esm/react/web/hooks/transaction/useEstimateGas.js.map +0 -1
- package/dist/esm/react/web/hooks/transaction/useEstimateGasCost.js +0 -24
- package/dist/esm/react/web/hooks/transaction/useEstimateGasCost.js.map +0 -1
- package/dist/esm/react/web/hooks/transaction/useSendAndConfirmTransaction.js +0 -20
- package/dist/esm/react/web/hooks/transaction/useSendAndConfirmTransaction.js.map +0 -1
- package/dist/esm/react/web/hooks/transaction/useSendBatchTransaction.js +0 -20
- package/dist/esm/react/web/hooks/transaction/useSendBatchTransaction.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useActiveAccount.js +0 -17
- package/dist/esm/react/web/hooks/wallets/useActiveAccount.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useActiveWallet.js +0 -17
- package/dist/esm/react/web/hooks/wallets/useActiveWallet.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useActiveWalletChain.js +0 -17
- package/dist/esm/react/web/hooks/wallets/useActiveWalletChain.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useActiveWalletConnectionStatus.js +0 -21
- package/dist/esm/react/web/hooks/wallets/useActiveWalletConnectionStatus.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useCallsStatus.js +0 -21
- package/dist/esm/react/web/hooks/wallets/useCallsStatus.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useCapabilities.js +0 -22
- package/dist/esm/react/web/hooks/wallets/useCapabilities.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useConnect.js +0 -36
- package/dist/esm/react/web/hooks/wallets/useConnect.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useConnectedWallets.js +0 -17
- package/dist/esm/react/web/hooks/wallets/useConnectedWallets.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useDisconnect.js +0 -26
- package/dist/esm/react/web/hooks/wallets/useDisconnect.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useIsAutoConnecting.js +0 -19
- package/dist/esm/react/web/hooks/wallets/useIsAutoConnecting.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useSendCalls.js +0 -69
- package/dist/esm/react/web/hooks/wallets/useSendCalls.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useSendToken.js +0 -28
- package/dist/esm/react/web/hooks/wallets/useSendToken.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useSetActiveWallet.js +0 -20
- package/dist/esm/react/web/hooks/wallets/useSetActiveWallet.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useSetActiveWalletConnectionStatus.js +0 -20
- package/dist/esm/react/web/hooks/wallets/useSetActiveWalletConnectionStatus.js.map +0 -1
- package/dist/esm/react/web/hooks/wallets/useSwitchActiveWalletChain.js +0 -21
- package/dist/esm/react/web/hooks/wallets/useSwitchActiveWalletChain.js.map +0 -1
- package/dist/esm/react/web/index.js +0 -4
- package/dist/esm/react/web/index.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +0 -62
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +0 -1
- package/dist/types/react/core/connectionManager.d.ts +0 -19
- package/dist/types/react/core/connectionManager.d.ts.map +0 -1
- package/dist/types/react/native/hooks/transaction/useEstimateGas.d.ts +0 -18
- package/dist/types/react/native/hooks/transaction/useEstimateGas.d.ts.map +0 -1
- package/dist/types/react/native/hooks/transaction/useEstimateGasCost.d.ts +0 -19
- package/dist/types/react/native/hooks/transaction/useEstimateGasCost.d.ts.map +0 -1
- package/dist/types/react/native/hooks/transaction/useSendAndConfirmTransaction.d.ts +0 -18
- package/dist/types/react/native/hooks/transaction/useSendAndConfirmTransaction.d.ts.map +0 -1
- package/dist/types/react/native/hooks/transaction/useSendBatchTransaction.d.ts +0 -18
- package/dist/types/react/native/hooks/transaction/useSendBatchTransaction.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useActiveAccount.d.ts +0 -13
- package/dist/types/react/native/hooks/wallets/useActiveAccount.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useActiveWallet.d.ts +0 -13
- package/dist/types/react/native/hooks/wallets/useActiveWallet.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useActiveWalletChain.d.ts +0 -15
- package/dist/types/react/native/hooks/wallets/useActiveWalletChain.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useActiveWalletConnectionStatus.d.ts +0 -17
- package/dist/types/react/native/hooks/wallets/useActiveWalletConnectionStatus.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useCallsStatus.d.ts +0 -23
- package/dist/types/react/native/hooks/wallets/useCallsStatus.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useCapabilities.d.ts +0 -21
- package/dist/types/react/native/hooks/wallets/useCapabilities.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useConnect.d.ts +0 -37
- package/dist/types/react/native/hooks/wallets/useConnect.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useConnectedWallets.d.ts +0 -13
- package/dist/types/react/native/hooks/wallets/useConnectedWallets.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useDisconnect.d.ts +0 -24
- package/dist/types/react/native/hooks/wallets/useDisconnect.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useIsAutoConnecting.d.ts +0 -15
- package/dist/types/react/native/hooks/wallets/useIsAutoConnecting.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useSendCalls.d.ts +0 -73
- package/dist/types/react/native/hooks/wallets/useSendCalls.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useSendToken.d.ts +0 -28
- package/dist/types/react/native/hooks/wallets/useSendToken.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useSetActiveWallet.d.ts +0 -16
- package/dist/types/react/native/hooks/wallets/useSetActiveWallet.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts +0 -16
- package/dist/types/react/native/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts.map +0 -1
- package/dist/types/react/native/hooks/wallets/useSwitchActiveWalletChain.d.ts +0 -17
- package/dist/types/react/native/hooks/wallets/useSwitchActiveWalletChain.d.ts.map +0 -1
- package/dist/types/react/native/index.d.ts +0 -18
- package/dist/types/react/native/index.d.ts.map +0 -1
- package/dist/types/react/web/hooks/transaction/useEstimateGas.d.ts +0 -18
- package/dist/types/react/web/hooks/transaction/useEstimateGas.d.ts.map +0 -1
- package/dist/types/react/web/hooks/transaction/useEstimateGasCost.d.ts +0 -19
- package/dist/types/react/web/hooks/transaction/useEstimateGasCost.d.ts.map +0 -1
- package/dist/types/react/web/hooks/transaction/useSendAndConfirmTransaction.d.ts +0 -18
- package/dist/types/react/web/hooks/transaction/useSendAndConfirmTransaction.d.ts.map +0 -1
- package/dist/types/react/web/hooks/transaction/useSendBatchTransaction.d.ts +0 -18
- package/dist/types/react/web/hooks/transaction/useSendBatchTransaction.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useActiveAccount.d.ts +0 -13
- package/dist/types/react/web/hooks/wallets/useActiveAccount.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useActiveWallet.d.ts +0 -13
- package/dist/types/react/web/hooks/wallets/useActiveWallet.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useActiveWalletChain.d.ts +0 -15
- package/dist/types/react/web/hooks/wallets/useActiveWalletChain.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useActiveWalletConnectionStatus.d.ts +0 -17
- package/dist/types/react/web/hooks/wallets/useActiveWalletConnectionStatus.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useCallsStatus.d.ts +0 -23
- package/dist/types/react/web/hooks/wallets/useCallsStatus.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useCapabilities.d.ts +0 -21
- package/dist/types/react/web/hooks/wallets/useCapabilities.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useConnect.d.ts +0 -37
- package/dist/types/react/web/hooks/wallets/useConnect.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useConnectedWallets.d.ts +0 -13
- package/dist/types/react/web/hooks/wallets/useConnectedWallets.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useDisconnect.d.ts +0 -24
- package/dist/types/react/web/hooks/wallets/useDisconnect.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useIsAutoConnecting.d.ts +0 -15
- package/dist/types/react/web/hooks/wallets/useIsAutoConnecting.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useSendCalls.d.ts +0 -73
- package/dist/types/react/web/hooks/wallets/useSendCalls.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useSendToken.d.ts +0 -28
- package/dist/types/react/web/hooks/wallets/useSendToken.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useSetActiveWallet.d.ts +0 -16
- package/dist/types/react/web/hooks/wallets/useSetActiveWallet.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts +0 -16
- package/dist/types/react/web/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts.map +0 -1
- package/dist/types/react/web/hooks/wallets/useSwitchActiveWalletChain.d.ts +0 -17
- package/dist/types/react/web/hooks/wallets/useSwitchActiveWalletChain.d.ts.map +0 -1
- package/dist/types/react/web/index.d.ts +0 -18
- package/dist/types/react/web/index.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalInline.d.ts +0 -53
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalInline.d.ts.map +0 -1
- package/src/react/core/connectionManager.ts +0 -14
- package/src/react/native/hooks/transaction/useEstimateGas.ts +0 -27
- package/src/react/native/hooks/transaction/useEstimateGasCost.ts +0 -33
- package/src/react/native/hooks/transaction/useSendAndConfirmTransaction.ts +0 -27
- package/src/react/native/hooks/transaction/useSendBatchTransaction.ts +0 -27
- package/src/react/native/hooks/wallets/useActiveAccount.ts +0 -17
- package/src/react/native/hooks/wallets/useActiveWallet.ts +0 -17
- package/src/react/native/hooks/wallets/useActiveWalletChain.ts +0 -17
- package/src/react/native/hooks/wallets/useActiveWalletConnectionStatus.ts +0 -21
- package/src/react/native/hooks/wallets/useCallsStatus.ts +0 -29
- package/src/react/native/hooks/wallets/useCapabilities.ts +0 -26
- package/src/react/native/hooks/wallets/useConnect.ts +0 -37
- package/src/react/native/hooks/wallets/useConnectedWallets.ts +0 -17
- package/src/react/native/hooks/wallets/useDisconnect.ts +0 -26
- package/src/react/native/hooks/wallets/useIsAutoConnecting.ts +0 -19
- package/src/react/native/hooks/wallets/useSendCalls.ts +0 -86
- package/src/react/native/hooks/wallets/useSendToken.ts +0 -29
- package/src/react/native/hooks/wallets/useSetActiveWallet.ts +0 -20
- package/src/react/native/hooks/wallets/useSetActiveWalletConnectionStatus.ts +0 -20
- package/src/react/native/hooks/wallets/useSwitchActiveWalletChain.ts +0 -21
- package/src/react/native/index.ts +0 -4
- package/src/react/web/hooks/transaction/useEstimateGas.ts +0 -27
- package/src/react/web/hooks/transaction/useEstimateGasCost.ts +0 -33
- package/src/react/web/hooks/transaction/useSendAndConfirmTransaction.ts +0 -27
- package/src/react/web/hooks/transaction/useSendBatchTransaction.ts +0 -27
- package/src/react/web/hooks/wallets/useActiveAccount.ts +0 -17
- package/src/react/web/hooks/wallets/useActiveWallet.ts +0 -17
- package/src/react/web/hooks/wallets/useActiveWalletChain.ts +0 -17
- package/src/react/web/hooks/wallets/useActiveWalletConnectionStatus.ts +0 -21
- package/src/react/web/hooks/wallets/useCallsStatus.ts +0 -29
- package/src/react/web/hooks/wallets/useCapabilities.ts +0 -26
- package/src/react/web/hooks/wallets/useConnect.ts +0 -37
- package/src/react/web/hooks/wallets/useConnectedWallets.ts +0 -17
- package/src/react/web/hooks/wallets/useDisconnect.ts +0 -26
- package/src/react/web/hooks/wallets/useIsAutoConnecting.ts +0 -19
- package/src/react/web/hooks/wallets/useSendCalls.ts +0 -86
- package/src/react/web/hooks/wallets/useSendToken.ts +0 -29
- package/src/react/web/hooks/wallets/useSetActiveWallet.ts +0 -20
- package/src/react/web/hooks/wallets/useSetActiveWalletConnectionStatus.ts +0 -20
- package/src/react/web/hooks/wallets/useSwitchActiveWalletChain.ts +0 -21
- package/src/react/web/index.ts +0 -4
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModalInline.tsx +0 -227
@@ -1,26 +1,26 @@
|
|
1
1
|
import { IdCardIcon } from "@radix-ui/react-icons";
|
2
|
-
import { useMemo, useState } from "react";
|
2
|
+
import { useCallback, useMemo, useState } from "react";
|
3
3
|
import type { Chain } from "../../../../../../chains/types.js";
|
4
4
|
import type { ThirdwebClient } from "../../../../../../client/client.js";
|
5
5
|
import { NATIVE_TOKEN_ADDRESS } from "../../../../../../constants/addresses.js";
|
6
6
|
import type { GetBuyWithCryptoQuoteParams } from "../../../../../../pay/buyWithCrypto/getQuote.js";
|
7
7
|
import { isSwapRequiredPostOnramp } from "../../../../../../pay/buyWithFiat/isSwapRequiredPostOnramp.js";
|
8
8
|
import { formatNumber } from "../../../../../../utils/formatNumber.js";
|
9
|
-
import { toEther, toTokens } from "../../../../../../utils/units.js";
|
10
9
|
import type { Account } from "../../../../../../wallets/interfaces/wallet.js";
|
11
10
|
import {
|
12
11
|
type Theme,
|
13
|
-
fontSize,
|
14
12
|
iconSize,
|
15
13
|
spacing,
|
16
14
|
} from "../../../../../core/design-system/index.js";
|
17
|
-
import type {
|
18
|
-
|
15
|
+
import type {
|
16
|
+
FundWalletOptions,
|
17
|
+
PayUIOptions,
|
18
|
+
} from "../../../../../core/hooks/connection/ConnectButtonProps.js";
|
19
19
|
import { useWalletBalance } from "../../../../../core/hooks/others/useWalletBalance.js";
|
20
20
|
import { useBuyWithCryptoQuote } from "../../../../../core/hooks/pay/useBuyWithCryptoQuote.js";
|
21
21
|
import { useBuyWithFiatQuote } from "../../../../../core/hooks/pay/useBuyWithFiatQuote.js";
|
22
|
+
import { useActiveAccount } from "../../../../../core/hooks/wallets/useActiveAccount.js";
|
22
23
|
import type { SupportedTokens } from "../../../../../core/utils/defaultTokens.js";
|
23
|
-
import { useActiveAccount } from "../../../../hooks/wallets/useActiveAccount.js";
|
24
24
|
import { LoadingScreen } from "../../../../wallets/shared/LoadingScreen.js";
|
25
25
|
import type { PayEmbedConnectOptions } from "../../../PayEmbed.js";
|
26
26
|
import { ChainName } from "../../../components/ChainName.js";
|
@@ -29,11 +29,9 @@ import {
|
|
29
29
|
DrawerOverlay,
|
30
30
|
useDrawer,
|
31
31
|
} from "../../../components/Drawer.js";
|
32
|
-
import { Skeleton } from "../../../components/Skeleton.js";
|
33
32
|
import { Spacer } from "../../../components/Spacer.js";
|
34
33
|
import { Spinner } from "../../../components/Spinner.js";
|
35
34
|
import { SwitchNetworkButton } from "../../../components/SwitchNetwork.js";
|
36
|
-
import { TokenIcon } from "../../../components/TokenIcon.js";
|
37
35
|
import { Container, Line, ModalHeader } from "../../../components/basic.js";
|
38
36
|
import { Button } from "../../../components/buttons.js";
|
39
37
|
import { Text } from "../../../components/text.js";
|
@@ -44,28 +42,28 @@ import { CoinsIcon } from "../../icons/CoinsIcon.js";
|
|
44
42
|
import type { ConnectLocale } from "../../locale/types.js";
|
45
43
|
import { TokenSelector } from "../TokenSelector.js";
|
46
44
|
import { WalletSwitcherConnectionScreen } from "../WalletSwitcherConnectionScreen.js";
|
47
|
-
import {
|
48
|
-
|
49
|
-
NATIVE_TOKEN,
|
50
|
-
isNativeToken,
|
51
|
-
} from "../nativeToken.js";
|
45
|
+
import { type ERC20OrNativeToken, isNativeToken } from "../nativeToken.js";
|
46
|
+
import { DirectPaymentModeScreen } from "./DirectPaymentModeScreen.js";
|
52
47
|
import { EstimatedTimeAndFees } from "./EstimatedTimeAndFees.js";
|
53
48
|
import { PayTokenIcon } from "./PayTokenIcon.js";
|
54
49
|
import { PayWithCreditCard } from "./PayWIthCreditCard.js";
|
55
|
-
import {
|
50
|
+
import { TransactionModeScreen } from "./TransactionModeScreen.js";
|
56
51
|
import { WalletSelectorButton } from "./WalletSelectorButton.js";
|
57
52
|
import { CurrencySelection } from "./fiat/CurrencySelection.js";
|
58
53
|
import { FiatFlow } from "./fiat/FiatFlow.js";
|
59
54
|
import type { CurrencyMeta } from "./fiat/currencies.js";
|
60
|
-
import type {
|
61
|
-
import {
|
62
|
-
|
55
|
+
import type { SelectedScreen } from "./main/types.js";
|
56
|
+
import {
|
57
|
+
type PaymentMethods,
|
58
|
+
useEnabledPaymentMethods,
|
59
|
+
} from "./main/useEnabledPaymentMethods.js";
|
63
60
|
import { useUISelectionStates } from "./main/useUISelectionStates.js";
|
64
61
|
import { openOnrampPopup } from "./openOnRamppopup.js";
|
65
62
|
import { BuyTokenInput } from "./swap/BuyTokenInput.js";
|
66
63
|
import { FiatFees, SwapFees } from "./swap/Fees.js";
|
67
64
|
import { PayWithCrypto } from "./swap/PayWithCrypto.js";
|
68
65
|
import { SwapFlow } from "./swap/SwapFlow.js";
|
66
|
+
import { TransferFlow } from "./swap/TransferFlow.js";
|
69
67
|
import { WalletSwitcherDrawerContent } from "./swap/WalletSwitcherDrawerContent.js";
|
70
68
|
import { addPendingTx } from "./swap/pendingSwapTx.js";
|
71
69
|
import {
|
@@ -80,10 +78,8 @@ export type BuyScreenProps = {
|
|
80
78
|
title: string;
|
81
79
|
onBack: (() => void) | undefined;
|
82
80
|
supportedTokens: SupportedTokens | undefined;
|
83
|
-
onViewPendingTx: () => void;
|
84
81
|
client: ThirdwebClient;
|
85
82
|
connectLocale: ConnectLocale;
|
86
|
-
buyForTx: BuyForTx | undefined;
|
87
83
|
payOptions: PayUIOptions;
|
88
84
|
theme: "light" | "dark" | Theme;
|
89
85
|
onDone: () => void;
|
@@ -104,9 +100,7 @@ export default function BuyScreen(props: BuyScreenProps) {
|
|
104
100
|
return (
|
105
101
|
<BuyScreenContent
|
106
102
|
{...props}
|
107
|
-
onViewPendingTx={props.onViewPendingTx}
|
108
103
|
supportedDestinations={supportedDestinationsQuery.data}
|
109
|
-
buyForTx={props.buyForTx}
|
110
104
|
/>
|
111
105
|
);
|
112
106
|
}
|
@@ -116,10 +110,8 @@ type BuyScreenContentProps = {
|
|
116
110
|
client: ThirdwebClient;
|
117
111
|
onBack?: () => void;
|
118
112
|
supportedTokens?: SupportedTokens;
|
119
|
-
onViewPendingTx: () => void;
|
120
113
|
supportedDestinations: SupportedChainAndTokens;
|
121
114
|
connectLocale: ConnectLocale;
|
122
|
-
buyForTx?: BuyForTx;
|
123
115
|
theme: "light" | "dark" | Theme;
|
124
116
|
payOptions: PayUIOptions;
|
125
117
|
onDone: () => void;
|
@@ -131,8 +123,7 @@ type BuyScreenContentProps = {
|
|
131
123
|
* @internal
|
132
124
|
*/
|
133
125
|
function BuyScreenContent(props: BuyScreenContentProps) {
|
134
|
-
const { client, supportedDestinations, connectLocale, payOptions
|
135
|
-
props;
|
126
|
+
const { client, supportedDestinations, connectLocale, payOptions } = props;
|
136
127
|
|
137
128
|
const activeAccount = useActiveAccount();
|
138
129
|
const { payer, setPayer } = usePayerSetup();
|
@@ -143,6 +134,11 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
143
134
|
|
144
135
|
const [hasEditedAmount, setHasEditedAmount] = useState(false);
|
145
136
|
|
137
|
+
const onDone = useCallback(() => {
|
138
|
+
setScreen({ id: "main" });
|
139
|
+
props.onDone();
|
140
|
+
}, [props.onDone]);
|
141
|
+
|
146
142
|
// UI selection
|
147
143
|
const {
|
148
144
|
tokenAmount,
|
@@ -160,7 +156,6 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
160
156
|
setSelectedCurrency,
|
161
157
|
} = useUISelectionStates({
|
162
158
|
payOptions,
|
163
|
-
buyForTx,
|
164
159
|
supportedDestinations,
|
165
160
|
});
|
166
161
|
|
@@ -195,6 +190,18 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
195
190
|
);
|
196
191
|
}, [props.supportedTokens, supportedSourcesQuery.data, payOptions]);
|
197
192
|
|
193
|
+
const enabledPaymentMethods = useEnabledPaymentMethods({
|
194
|
+
payOptions: props.payOptions,
|
195
|
+
supportedDestinations: props.supportedDestinations,
|
196
|
+
toChain: toChain,
|
197
|
+
toToken: toToken,
|
198
|
+
});
|
199
|
+
|
200
|
+
const payDisabled =
|
201
|
+
enabledPaymentMethods.showPaymentSelection === false &&
|
202
|
+
enabledPaymentMethods.buyWithCryptoEnabled === false &&
|
203
|
+
enabledPaymentMethods.buyWithFiatEnabled === false;
|
204
|
+
|
198
205
|
// screens ----------------------------
|
199
206
|
|
200
207
|
if (screen.id === "connect-payer-wallet") {
|
@@ -231,7 +238,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
231
238
|
return (
|
232
239
|
<SwapFlow
|
233
240
|
title={props.title}
|
234
|
-
|
241
|
+
transactionMode={payOptions.mode === "transaction"}
|
235
242
|
isEmbed={props.isEmbed}
|
236
243
|
client={client}
|
237
244
|
onBack={() => {
|
@@ -241,9 +248,8 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
241
248
|
}}
|
242
249
|
buyWithCryptoQuote={screen.quote}
|
243
250
|
payer={payer}
|
244
|
-
onViewPendingTx={props.onViewPendingTx}
|
245
251
|
isFiatFlow={false}
|
246
|
-
onDone={
|
252
|
+
onDone={onDone}
|
247
253
|
onTryAgain={() => {
|
248
254
|
setScreen({
|
249
255
|
id: "buy-with-crypto",
|
@@ -257,7 +263,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
257
263
|
return (
|
258
264
|
<FiatFlow
|
259
265
|
title={props.title}
|
260
|
-
|
266
|
+
transactionMode={payOptions.mode === "transaction"}
|
261
267
|
quote={screen.quote}
|
262
268
|
onBack={() => {
|
263
269
|
setScreen({
|
@@ -270,15 +276,37 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
270
276
|
props.payOptions.buyWithFiat?.testMode === true
|
271
277
|
}
|
272
278
|
theme={typeof props.theme === "string" ? props.theme : props.theme.type}
|
273
|
-
onViewPendingTx={props.onViewPendingTx}
|
274
279
|
openedWindow={screen.openedWindow}
|
275
|
-
onDone={
|
280
|
+
onDone={onDone}
|
276
281
|
isEmbed={props.isEmbed}
|
277
282
|
payer={payer}
|
278
283
|
/>
|
279
284
|
);
|
280
285
|
}
|
281
286
|
|
287
|
+
if (screen.id === "transfer-flow" && payer && activeAccount) {
|
288
|
+
const goBack = () => setScreen({ id: "buy-with-crypto" });
|
289
|
+
// TODO (pay) pass it via screen props
|
290
|
+
const defaultRecipientAddress = (
|
291
|
+
props.payOptions as Extract<PayUIOptions, { mode: "direct_payment" }>
|
292
|
+
)?.paymentInfo?.sellerAddress;
|
293
|
+
const receiverAddress = defaultRecipientAddress || activeAccount.address;
|
294
|
+
return (
|
295
|
+
<TransferFlow
|
296
|
+
title={props.title}
|
297
|
+
onBack={goBack}
|
298
|
+
payer={payer}
|
299
|
+
client={props.client}
|
300
|
+
onDone={onDone}
|
301
|
+
chain={toChain}
|
302
|
+
token={toToken}
|
303
|
+
tokenAmount={tokenAmount}
|
304
|
+
receiverAddress={receiverAddress}
|
305
|
+
transactionMode={props.payOptions.mode === "transaction"}
|
306
|
+
/>
|
307
|
+
);
|
308
|
+
}
|
309
|
+
|
282
310
|
if (screen.id === "select-currency") {
|
283
311
|
const goBack = () => setScreen(screen.backScreen);
|
284
312
|
return (
|
@@ -295,8 +323,10 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
295
323
|
if (screen.id === "select-to-token") {
|
296
324
|
const chains = supportedDestinations.map((x) => x.chain);
|
297
325
|
const goBack = () => setScreen(screen.backScreen);
|
326
|
+
const allowEdits = (payOptions as FundWalletOptions)?.prefillBuy
|
327
|
+
?.allowEdits;
|
298
328
|
// if token selection is disabled - only show network selector screen
|
299
|
-
if (
|
329
|
+
if (allowEdits?.token === false) {
|
300
330
|
return (
|
301
331
|
<ChainSelectionScreen
|
302
332
|
chains={chains}
|
@@ -322,7 +352,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
322
352
|
chain={toChain}
|
323
353
|
chainSelection={
|
324
354
|
// hide chain selection if it's disabled
|
325
|
-
|
355
|
+
allowEdits?.chain !== false
|
326
356
|
? {
|
327
357
|
chains: chains,
|
328
358
|
select: (c) => {
|
@@ -397,28 +427,32 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
397
427
|
<MainScreen
|
398
428
|
title={props.title}
|
399
429
|
payerAccount={payer?.account}
|
400
|
-
buyForTx={buyForTx}
|
401
430
|
client={client}
|
402
431
|
onSelectBuyToken={() =>
|
403
432
|
setScreen({ id: "select-to-token", backScreen: screen })
|
404
433
|
}
|
405
434
|
payOptions={payOptions}
|
406
435
|
setTokenAmount={setTokenAmount}
|
436
|
+
setToChain={setToChain}
|
437
|
+
setToToken={setToToken}
|
438
|
+
setFromChain={setFromChain}
|
439
|
+
setFromToken={setFromToken}
|
407
440
|
toChain={toChain}
|
408
441
|
toToken={toToken}
|
409
442
|
tokenAmount={tokenAmount}
|
410
443
|
connectOptions={props.connectOptions}
|
411
|
-
onViewPendingTx={props.onViewPendingTx}
|
412
444
|
setScreen={setScreen}
|
413
445
|
supportedDestinations={supportedDestinations}
|
414
446
|
onBack={props.onBack}
|
415
447
|
theme={props.theme}
|
416
448
|
hasEditedAmount={hasEditedAmount}
|
417
449
|
setHasEditedAmount={setHasEditedAmount}
|
450
|
+
enabledPaymentMethods={enabledPaymentMethods}
|
418
451
|
/>
|
419
452
|
)}
|
420
453
|
|
421
454
|
{(screen.id === "select-payment-method" ||
|
455
|
+
screen.id === "select-wallet" ||
|
422
456
|
screen.id === "buy-with-crypto" ||
|
423
457
|
screen.id === "buy-with-fiat") &&
|
424
458
|
payer && (
|
@@ -430,11 +464,14 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
430
464
|
client={client}
|
431
465
|
onBack={() => {
|
432
466
|
if (
|
433
|
-
|
434
|
-
screen.id === "
|
467
|
+
enabledPaymentMethods.showPaymentSelection &&
|
468
|
+
(screen.id === "select-wallet" ||
|
469
|
+
screen.id === "buy-with-fiat")
|
435
470
|
) {
|
436
471
|
setScreen({ id: "select-payment-method" });
|
437
|
-
} else if (screen.id === "
|
472
|
+
} else if (screen.id === "buy-with-crypto") {
|
473
|
+
setScreen({ id: "select-wallet" });
|
474
|
+
} else {
|
438
475
|
setScreen({ id: "main" });
|
439
476
|
}
|
440
477
|
}}
|
@@ -443,6 +480,38 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
443
480
|
<PaymentMethodSelection setScreen={(id) => setScreen({ id })} />
|
444
481
|
)}
|
445
482
|
|
483
|
+
{screen.id === "select-wallet" && (
|
484
|
+
<WalletSwitcherDrawerContent
|
485
|
+
client={client}
|
486
|
+
onSelect={(w) => {
|
487
|
+
const chain = w.getChain();
|
488
|
+
const account = w.getAccount();
|
489
|
+
if (chain && account) {
|
490
|
+
setPayer({
|
491
|
+
account,
|
492
|
+
chain,
|
493
|
+
wallet: w,
|
494
|
+
});
|
495
|
+
setScreen({ id: "buy-with-crypto" });
|
496
|
+
}
|
497
|
+
}}
|
498
|
+
showAllWallets={!!props.connectOptions?.showAllWallets}
|
499
|
+
wallets={props.connectOptions?.wallets}
|
500
|
+
onBack={() => {
|
501
|
+
// no-op
|
502
|
+
}}
|
503
|
+
onConnect={() => {
|
504
|
+
setScreen({
|
505
|
+
id: "connect-payer-wallet",
|
506
|
+
backScreen: {
|
507
|
+
id: "select-wallet",
|
508
|
+
},
|
509
|
+
});
|
510
|
+
}}
|
511
|
+
selectedAddress={payer.account.address}
|
512
|
+
/>
|
513
|
+
)}
|
514
|
+
|
446
515
|
{screen.id === "buy-with-crypto" && activeAccount && (
|
447
516
|
<SwapScreenContent
|
448
517
|
setScreen={setScreen}
|
@@ -458,11 +527,9 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
458
527
|
});
|
459
528
|
}}
|
460
529
|
payer={payer}
|
461
|
-
buyForTx={buyForTx || null}
|
462
530
|
client={client}
|
463
531
|
isEmbed={props.isEmbed}
|
464
|
-
onDone={
|
465
|
-
onViewPendingTx={props.onViewPendingTx}
|
532
|
+
onDone={onDone}
|
466
533
|
payOptions={payOptions}
|
467
534
|
connectLocale={connectLocale}
|
468
535
|
connectOptions={props.connectOptions}
|
@@ -471,6 +538,14 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
471
538
|
activeAccount={activeAccount}
|
472
539
|
setTokenAmount={setTokenAmount}
|
473
540
|
setHasEditedAmount={setHasEditedAmount}
|
541
|
+
disableTokenSelection={
|
542
|
+
payDisabled === true ||
|
543
|
+
(payOptions.buyWithCrypto !== false &&
|
544
|
+
payOptions.buyWithCrypto?.prefillSource?.allowEdits
|
545
|
+
?.chain === false &&
|
546
|
+
payOptions.buyWithCrypto?.prefillSource?.allowEdits
|
547
|
+
?.token === false)
|
548
|
+
}
|
474
549
|
/>
|
475
550
|
)}
|
476
551
|
|
@@ -481,11 +556,9 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
481
556
|
toChain={toChain}
|
482
557
|
toToken={toToken}
|
483
558
|
selectedCurrency={selectedCurrency}
|
484
|
-
buyForTx={buyForTx || null}
|
485
559
|
client={client}
|
486
560
|
isEmbed={props.isEmbed}
|
487
|
-
onDone={
|
488
|
-
onViewPendingTx={props.onViewPendingTx}
|
561
|
+
onDone={onDone}
|
489
562
|
payOptions={payOptions}
|
490
563
|
theme={props.theme}
|
491
564
|
showCurrencySelector={() => {
|
@@ -556,9 +629,12 @@ function SelectedTokenInfo(props: {
|
|
556
629
|
|
557
630
|
function MainScreen(props: {
|
558
631
|
title: string;
|
559
|
-
buyForTx: BuyForTx | undefined;
|
560
632
|
client: ThirdwebClient;
|
561
633
|
setTokenAmount: (amount: string) => void;
|
634
|
+
setFromChain: (chain: Chain) => void;
|
635
|
+
setFromToken: (token: ERC20OrNativeToken) => void;
|
636
|
+
setToChain: (chain: Chain) => void;
|
637
|
+
setToToken: (token: ERC20OrNativeToken) => void;
|
562
638
|
payerAccount: Account | undefined;
|
563
639
|
tokenAmount: string;
|
564
640
|
payOptions: PayUIOptions;
|
@@ -566,148 +642,159 @@ function MainScreen(props: {
|
|
566
642
|
toChain: Chain;
|
567
643
|
onSelectBuyToken: () => void;
|
568
644
|
connectOptions: PayEmbedConnectOptions | undefined;
|
569
|
-
onViewPendingTx: () => void;
|
570
645
|
setScreen: (screen: SelectedScreen) => void;
|
571
646
|
supportedDestinations: SupportedChainAndTokens;
|
572
647
|
onBack: (() => void) | undefined;
|
573
648
|
theme: "light" | "dark" | Theme;
|
574
649
|
hasEditedAmount: boolean;
|
575
650
|
setHasEditedAmount: (hasEdited: boolean) => void;
|
651
|
+
enabledPaymentMethods: PaymentMethods;
|
576
652
|
}) {
|
577
|
-
const { showPaymentSelection, buyWithCryptoEnabled, buyWithFiatEnabled } =
|
578
|
-
useEnabledPaymentMethods({
|
579
|
-
payOptions: props.payOptions,
|
580
|
-
supportedDestinations: props.supportedDestinations,
|
581
|
-
toChain: props.toChain,
|
582
|
-
toToken: props.toToken,
|
583
|
-
});
|
584
|
-
|
585
653
|
const {
|
586
|
-
buyForTx,
|
587
654
|
setTokenAmount,
|
655
|
+
setToChain,
|
656
|
+
setToToken,
|
657
|
+
setFromChain,
|
658
|
+
setFromToken,
|
588
659
|
payerAccount,
|
589
660
|
client,
|
590
661
|
tokenAmount,
|
591
662
|
payOptions,
|
592
663
|
toToken,
|
593
664
|
toChain,
|
665
|
+
supportedDestinations,
|
666
|
+
enabledPaymentMethods,
|
594
667
|
} = props;
|
595
668
|
|
596
|
-
|
597
|
-
|
598
|
-
setTokenAmount,
|
599
|
-
buyForTx: buyForTx || null,
|
600
|
-
hasEditedAmount: props.hasEditedAmount,
|
601
|
-
account: payerAccount || null,
|
602
|
-
});
|
603
|
-
|
669
|
+
const { showPaymentSelection, buyWithCryptoEnabled, buyWithFiatEnabled } =
|
670
|
+
enabledPaymentMethods;
|
604
671
|
const disableContinue = !tokenAmount;
|
605
672
|
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
)
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
673
|
+
switch (payOptions.mode) {
|
674
|
+
case "transaction": {
|
675
|
+
return (
|
676
|
+
<TransactionModeScreen
|
677
|
+
supportedDestinations={supportedDestinations}
|
678
|
+
payUiOptions={payOptions}
|
679
|
+
payerAccount={payerAccount}
|
680
|
+
connectOptions={props.connectOptions}
|
681
|
+
client={client}
|
682
|
+
onContinue={(tokenAmount, toChain, toToken) => {
|
683
|
+
setTokenAmount(tokenAmount);
|
684
|
+
setToChain(toChain);
|
685
|
+
setFromChain(toChain);
|
686
|
+
setFromToken(toToken);
|
687
|
+
setToToken(toToken);
|
688
|
+
if (showPaymentSelection) {
|
689
|
+
props.setScreen({ id: "select-payment-method" });
|
690
|
+
} else if (buyWithCryptoEnabled) {
|
691
|
+
props.setScreen({ id: "select-wallet" });
|
692
|
+
} else if (buyWithFiatEnabled) {
|
693
|
+
props.setScreen({ id: "buy-with-fiat" });
|
694
|
+
} else {
|
695
|
+
// default to buy with crypto with connected wallet if chain not supported by pay
|
696
|
+
props.setScreen({ id: "select-wallet" });
|
697
|
+
}
|
698
|
+
}}
|
699
|
+
/>
|
700
|
+
);
|
701
|
+
}
|
702
|
+
case "direct_payment": {
|
703
|
+
return (
|
704
|
+
<DirectPaymentModeScreen
|
705
|
+
client={client}
|
706
|
+
payUiOptions={payOptions}
|
707
|
+
payerAccount={payerAccount}
|
708
|
+
connectOptions={props.connectOptions}
|
709
|
+
supportedDestinations={supportedDestinations}
|
710
|
+
onContinue={(tokenAmount, toChain, toToken) => {
|
711
|
+
setTokenAmount(tokenAmount);
|
712
|
+
setToChain(toChain);
|
713
|
+
setFromChain(toChain);
|
714
|
+
setFromToken(toToken);
|
715
|
+
setToToken(toToken);
|
716
|
+
if (showPaymentSelection) {
|
717
|
+
props.setScreen({ id: "select-payment-method" });
|
718
|
+
} else if (buyWithCryptoEnabled) {
|
719
|
+
props.setScreen({ id: "buy-with-crypto" });
|
720
|
+
} else if (buyWithFiatEnabled) {
|
721
|
+
props.setScreen({ id: "buy-with-fiat" });
|
722
|
+
} else {
|
723
|
+
// default to buy with crypto with connected wallet if chain not supported by pay
|
724
|
+
props.setScreen({ id: "select-wallet" });
|
725
|
+
}
|
726
|
+
}}
|
727
|
+
/>
|
728
|
+
);
|
729
|
+
}
|
730
|
+
default: {
|
731
|
+
return (
|
732
|
+
<Container p="lg">
|
733
|
+
<ModalHeader title={props.title} onBack={props.onBack} />
|
654
734
|
|
655
|
-
|
735
|
+
<Spacer y="xl" />
|
656
736
|
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
client={props.client}
|
664
|
-
theme={props.theme}
|
665
|
-
connectButton={{
|
666
|
-
style: {
|
667
|
-
width: "100%",
|
668
|
-
},
|
669
|
-
}}
|
670
|
-
/>
|
671
|
-
</div>
|
672
|
-
) : (
|
673
|
-
<Button
|
674
|
-
variant="accent"
|
675
|
-
fullWidth
|
676
|
-
disabled={disableContinue}
|
677
|
-
data-disabled={disableContinue}
|
678
|
-
onClick={() => {
|
679
|
-
if (showPaymentSelection) {
|
680
|
-
props.setScreen({ id: "select-payment-method" });
|
681
|
-
} else if (buyWithCryptoEnabled) {
|
682
|
-
props.setScreen({ id: "buy-with-crypto" });
|
683
|
-
} else if (buyWithFiatEnabled) {
|
684
|
-
props.setScreen({ id: "buy-with-fiat" });
|
685
|
-
} else {
|
686
|
-
console.error("No payment method enabled");
|
687
|
-
}
|
737
|
+
{/* To */}
|
738
|
+
<BuyTokenInput
|
739
|
+
value={tokenAmount}
|
740
|
+
onChange={async (value) => {
|
741
|
+
props.setHasEditedAmount(true);
|
742
|
+
setTokenAmount(value);
|
688
743
|
}}
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
744
|
+
freezeAmount={payOptions.prefillBuy?.allowEdits?.amount === false}
|
745
|
+
freezeChainAndToken={
|
746
|
+
payOptions.prefillBuy?.allowEdits?.chain === false &&
|
747
|
+
payOptions.prefillBuy?.allowEdits?.token === false
|
748
|
+
}
|
749
|
+
token={toToken}
|
750
|
+
chain={toChain}
|
751
|
+
onSelectToken={props.onSelectBuyToken}
|
752
|
+
client={props.client}
|
753
|
+
/>
|
693
754
|
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
755
|
+
<Spacer y="xl" />
|
756
|
+
|
757
|
+
{/* Continue */}
|
758
|
+
<Container flex="column" gap="sm">
|
759
|
+
{!payerAccount ? (
|
760
|
+
<div>
|
761
|
+
<ConnectButton
|
762
|
+
{...props.connectOptions}
|
763
|
+
client={props.client}
|
764
|
+
theme={props.theme}
|
765
|
+
connectButton={{
|
766
|
+
style: {
|
767
|
+
width: "100%",
|
768
|
+
},
|
769
|
+
}}
|
770
|
+
/>
|
771
|
+
</div>
|
772
|
+
) : (
|
773
|
+
<Button
|
774
|
+
variant="accent"
|
775
|
+
fullWidth
|
776
|
+
disabled={disableContinue}
|
777
|
+
data-disabled={disableContinue}
|
778
|
+
onClick={() => {
|
779
|
+
if (showPaymentSelection) {
|
780
|
+
props.setScreen({ id: "select-payment-method" });
|
781
|
+
} else if (buyWithCryptoEnabled) {
|
782
|
+
props.setScreen({ id: "buy-with-crypto" });
|
783
|
+
} else if (buyWithFiatEnabled) {
|
784
|
+
props.setScreen({ id: "buy-with-fiat" });
|
785
|
+
} else {
|
786
|
+
console.error("No payment method enabled");
|
787
|
+
}
|
788
|
+
}}
|
789
|
+
>
|
790
|
+
Continue
|
791
|
+
</Button>
|
792
|
+
)}
|
793
|
+
</Container>
|
794
|
+
</Container>
|
795
|
+
);
|
796
|
+
}
|
797
|
+
}
|
711
798
|
}
|
712
799
|
|
713
800
|
function TokenSelectedLayout(props: {
|
@@ -753,7 +840,7 @@ function TokenSelectedLayout(props: {
|
|
753
840
|
}
|
754
841
|
|
755
842
|
function PaymentMethodSelection(props: {
|
756
|
-
setScreen: (screenId: "
|
843
|
+
setScreen: (screenId: "select-wallet" | "buy-with-fiat") => void;
|
757
844
|
}) {
|
758
845
|
return (
|
759
846
|
<Container animate="fadein">
|
@@ -782,7 +869,7 @@ function PaymentMethodSelection(props: {
|
|
782
869
|
<Text size="md" color="primaryText">
|
783
870
|
Credit Card
|
784
871
|
</Text>
|
785
|
-
<Text size="xs">
|
872
|
+
<Text size="xs">Securely pay with credit card</Text>
|
786
873
|
</Container>
|
787
874
|
</Button>
|
788
875
|
|
@@ -790,7 +877,7 @@ function PaymentMethodSelection(props: {
|
|
790
877
|
<Button
|
791
878
|
variant="outline"
|
792
879
|
bg="tertiaryBg"
|
793
|
-
onClick={() => props.setScreen("
|
880
|
+
onClick={() => props.setScreen("select-wallet")}
|
794
881
|
style={{
|
795
882
|
justifyContent: "flex-start",
|
796
883
|
}}
|
@@ -804,7 +891,7 @@ function PaymentMethodSelection(props: {
|
|
804
891
|
<Text size="md" color="primaryText">
|
805
892
|
Crypto
|
806
893
|
</Text>
|
807
|
-
<Text size="xs">Pay with
|
894
|
+
<Text size="xs">Pay with your connected wallet</Text>
|
808
895
|
</Container>
|
809
896
|
</Button>
|
810
897
|
</Container>
|
@@ -823,9 +910,7 @@ function SwapScreenContent(props: {
|
|
823
910
|
payer: PayerInfo;
|
824
911
|
client: ThirdwebClient;
|
825
912
|
payOptions: PayUIOptions;
|
826
|
-
buyForTx: BuyForTx | null;
|
827
913
|
isEmbed: boolean;
|
828
|
-
onViewPendingTx: () => void;
|
829
914
|
onDone: () => void;
|
830
915
|
connectOptions: PayEmbedConnectOptions | undefined;
|
831
916
|
connectLocale: ConnectLocale;
|
@@ -833,6 +918,7 @@ function SwapScreenContent(props: {
|
|
833
918
|
activeAccount: Account;
|
834
919
|
setTokenAmount: (amount: string) => void;
|
835
920
|
setHasEditedAmount: (hasEdited: boolean) => void;
|
921
|
+
disableTokenSelection: boolean;
|
836
922
|
}) {
|
837
923
|
const {
|
838
924
|
setScreen,
|
@@ -845,11 +931,14 @@ function SwapScreenContent(props: {
|
|
845
931
|
fromToken,
|
846
932
|
showFromTokenSelector,
|
847
933
|
payOptions,
|
934
|
+
disableTokenSelection,
|
848
935
|
} = props;
|
849
936
|
|
850
|
-
const
|
851
|
-
props.payOptions
|
852
|
-
);
|
937
|
+
const defaultRecipientAddress = (
|
938
|
+
props.payOptions as Extract<PayUIOptions, { mode: "direct_payment" }>
|
939
|
+
)?.paymentInfo?.sellerAddress;
|
940
|
+
const receiverAddress =
|
941
|
+
defaultRecipientAddress || props.activeAccount.address;
|
853
942
|
const { drawerRef, drawerOverlayRef, isOpen, setIsOpen } = useDrawer();
|
854
943
|
const [drawerScreen, setDrawerScreen] = useState<
|
855
944
|
"fees" | "receiver" | "payer"
|
@@ -862,27 +951,35 @@ function SwapScreenContent(props: {
|
|
862
951
|
client,
|
863
952
|
});
|
864
953
|
|
865
|
-
const
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
954
|
+
const fromTokenId = isNativeToken(fromToken)
|
955
|
+
? NATIVE_TOKEN_ADDRESS
|
956
|
+
: fromToken.address.toLowerCase();
|
957
|
+
const toTokenId = isNativeToken(toToken)
|
958
|
+
? NATIVE_TOKEN_ADDRESS
|
959
|
+
: toToken.address.toLowerCase();
|
960
|
+
const swapRequired =
|
961
|
+
!!tokenAmount &&
|
962
|
+
!(fromChain.id === toChain.id && fromTokenId === toTokenId);
|
963
|
+
const quoteParams: GetBuyWithCryptoQuoteParams | undefined = swapRequired
|
964
|
+
? {
|
965
|
+
// wallets
|
966
|
+
fromAddress: payer.account.address,
|
967
|
+
toAddress: receiverAddress,
|
968
|
+
// from
|
969
|
+
fromChainId: fromChain.id,
|
970
|
+
fromTokenAddress: isNativeToken(fromToken)
|
971
|
+
? NATIVE_TOKEN_ADDRESS
|
972
|
+
: fromToken.address,
|
973
|
+
// to
|
974
|
+
toChainId: toChain.id,
|
975
|
+
toTokenAddress: isNativeToken(toToken)
|
976
|
+
? NATIVE_TOKEN_ADDRESS
|
977
|
+
: toToken.address,
|
978
|
+
toAmount: tokenAmount,
|
979
|
+
client,
|
980
|
+
purchaseData: payOptions.purchaseData,
|
981
|
+
}
|
982
|
+
: undefined;
|
886
983
|
|
887
984
|
const quoteQuery = useBuyWithCryptoQuote(quoteParams, {
|
888
985
|
// refetch every 30 seconds
|
@@ -891,14 +988,17 @@ function SwapScreenContent(props: {
|
|
891
988
|
gcTime: 30 * 1000,
|
892
989
|
});
|
893
990
|
|
894
|
-
const sourceTokenAmount =
|
991
|
+
const sourceTokenAmount = swapRequired
|
992
|
+
? quoteQuery.data?.swapDetails.fromAmount
|
993
|
+
: tokenAmount;
|
895
994
|
|
896
995
|
const isNotEnoughBalance =
|
897
996
|
!!sourceTokenAmount &&
|
898
997
|
!!fromTokenBalanceQuery.data &&
|
899
998
|
Number(fromTokenBalanceQuery.data.displayValue) < Number(sourceTokenAmount);
|
900
999
|
|
901
|
-
const disableContinue =
|
1000
|
+
const disableContinue =
|
1001
|
+
(swapRequired && !quoteQuery.data) || isNotEnoughBalance;
|
902
1002
|
const switchChainRequired = props.payer.chain.id !== fromChain.id;
|
903
1003
|
|
904
1004
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
@@ -935,6 +1035,25 @@ function SwapScreenContent(props: {
|
|
935
1035
|
: undefined;
|
936
1036
|
|
937
1037
|
function showSwapFlow() {
|
1038
|
+
if (
|
1039
|
+
(props.payOptions.mode === "transaction" ||
|
1040
|
+
props.payOptions.mode === "direct_payment") &&
|
1041
|
+
!isNotEnoughBalance &&
|
1042
|
+
!swapRequired
|
1043
|
+
) {
|
1044
|
+
if (payer.account.address !== receiverAddress) {
|
1045
|
+
// same currency, just transfer, but from another wallet
|
1046
|
+
setScreen({
|
1047
|
+
id: "transfer-flow",
|
1048
|
+
});
|
1049
|
+
} else {
|
1050
|
+
// has enough balance to just do the transaction directly
|
1051
|
+
props.onDone();
|
1052
|
+
}
|
1053
|
+
|
1054
|
+
return;
|
1055
|
+
}
|
1056
|
+
|
938
1057
|
if (!quoteQuery.data) {
|
939
1058
|
return;
|
940
1059
|
}
|
@@ -954,13 +1073,6 @@ function SwapScreenContent(props: {
|
|
954
1073
|
setDrawerScreen("fees");
|
955
1074
|
}
|
956
1075
|
|
957
|
-
const prefillSource =
|
958
|
-
payOptions.buyWithCrypto !== false
|
959
|
-
? payOptions.buyWithCrypto?.prefillSource
|
960
|
-
: undefined;
|
961
|
-
|
962
|
-
const disableReceiverSelection = !!props.payOptions.recipientAddress;
|
963
|
-
|
964
1076
|
return (
|
965
1077
|
<Container flex="column" gap="md" animate="fadein">
|
966
1078
|
{isOpen && (
|
@@ -976,46 +1088,6 @@ function SwapScreenContent(props: {
|
|
976
1088
|
<SwapFees quote={quoteQuery.data} align="left" />
|
977
1089
|
</div>
|
978
1090
|
)}
|
979
|
-
|
980
|
-
{drawerScreen === "receiver" && (
|
981
|
-
<ReceiverWalletDrawerScreen
|
982
|
-
client={props.client}
|
983
|
-
onSelect={(x) => setReceiverAddress(x)}
|
984
|
-
receiverAddress={receiverAddress}
|
985
|
-
onBack={() => setIsOpen(false)}
|
986
|
-
/>
|
987
|
-
)}
|
988
|
-
|
989
|
-
{drawerScreen === "payer" && (
|
990
|
-
<WalletSwitcherDrawerContent
|
991
|
-
client={client}
|
992
|
-
onSelect={(w) => {
|
993
|
-
const chain = w.getChain();
|
994
|
-
const account = w.getAccount();
|
995
|
-
if (chain && account) {
|
996
|
-
props.setPayer({
|
997
|
-
account,
|
998
|
-
chain,
|
999
|
-
wallet: w,
|
1000
|
-
});
|
1001
|
-
}
|
1002
|
-
}}
|
1003
|
-
showAllWallets={!!props.connectOptions?.showAllWallets}
|
1004
|
-
wallets={props.connectOptions?.wallets}
|
1005
|
-
onBack={() => {
|
1006
|
-
setIsOpen(false);
|
1007
|
-
}}
|
1008
|
-
onConnect={() => {
|
1009
|
-
setScreen({
|
1010
|
-
id: "connect-payer-wallet",
|
1011
|
-
backScreen: {
|
1012
|
-
id: "buy-with-crypto",
|
1013
|
-
},
|
1014
|
-
});
|
1015
|
-
}}
|
1016
|
-
selectedAddress={payer.account.address}
|
1017
|
-
/>
|
1018
|
-
)}
|
1019
1091
|
</Drawer>
|
1020
1092
|
</>
|
1021
1093
|
)}
|
@@ -1025,8 +1097,7 @@ function SwapScreenContent(props: {
|
|
1025
1097
|
<WalletSelectorButton
|
1026
1098
|
client={props.client}
|
1027
1099
|
onClick={() => {
|
1028
|
-
|
1029
|
-
setDrawerScreen("payer");
|
1100
|
+
setScreen({ id: "select-wallet" });
|
1030
1101
|
}}
|
1031
1102
|
address={props.payer.account.address}
|
1032
1103
|
walletId={props.payer.wallet.id}
|
@@ -1043,34 +1114,20 @@ function SwapScreenContent(props: {
|
|
1043
1114
|
token={fromToken}
|
1044
1115
|
isLoading={quoteQuery.isLoading && !sourceTokenAmount}
|
1045
1116
|
client={client}
|
1046
|
-
freezeChainAndTokenSelection={
|
1047
|
-
prefillSource?.allowEdits?.chain === false &&
|
1048
|
-
prefillSource?.allowEdits?.token === false
|
1049
|
-
}
|
1117
|
+
freezeChainAndTokenSelection={disableTokenSelection}
|
1050
1118
|
payerAccount={props.payer.account}
|
1119
|
+
swapRequired={swapRequired}
|
1051
1120
|
/>
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1121
|
+
{swapRequired && (
|
1122
|
+
<EstimatedTimeAndFees
|
1123
|
+
quoteIsLoading={quoteQuery.isLoading}
|
1124
|
+
estimatedSeconds={
|
1125
|
+
quoteQuery.data?.swapDetails.estimated.durationSeconds
|
1126
|
+
}
|
1127
|
+
onViewFees={showFees}
|
1128
|
+
/>
|
1129
|
+
)}
|
1060
1130
|
<Spacer y="md" />
|
1061
|
-
<Text size="sm">Send to</Text>
|
1062
|
-
<Spacer y="xs" />
|
1063
|
-
<WalletSelectorButton
|
1064
|
-
client={props.client}
|
1065
|
-
disabled={disableReceiverSelection}
|
1066
|
-
disableChevron={disableReceiverSelection}
|
1067
|
-
onClick={() => {
|
1068
|
-
setIsOpen(true);
|
1069
|
-
setDrawerScreen("receiver");
|
1070
|
-
}}
|
1071
|
-
address={receiverAddress}
|
1072
|
-
walletId={undefined}
|
1073
|
-
/>
|
1074
1131
|
</div>
|
1075
1132
|
|
1076
1133
|
{/* Error message */}
|
@@ -1097,6 +1154,17 @@ function SwapScreenContent(props: {
|
|
1097
1154
|
</div>
|
1098
1155
|
)}
|
1099
1156
|
|
1157
|
+
{!errorMsg && isNotEnoughBalance && (
|
1158
|
+
<div>
|
1159
|
+
<Text color="danger" size="sm" center multiline>
|
1160
|
+
Not enough funds.
|
1161
|
+
</Text>
|
1162
|
+
<Text color="danger" size="sm" center multiline>
|
1163
|
+
Try a different wallet or token.
|
1164
|
+
</Text>
|
1165
|
+
</div>
|
1166
|
+
)}
|
1167
|
+
|
1100
1168
|
{/* Button */}
|
1101
1169
|
{errorMsg?.minAmount ? (
|
1102
1170
|
<Button
|
@@ -1133,9 +1201,7 @@ function SwapScreenContent(props: {
|
|
1133
1201
|
}}
|
1134
1202
|
gap="xs"
|
1135
1203
|
>
|
1136
|
-
{
|
1137
|
-
<Text color="danger">Not Enough Funds</Text>
|
1138
|
-
) : quoteQuery.isLoading ? (
|
1204
|
+
{quoteQuery.isLoading ? (
|
1139
1205
|
<>
|
1140
1206
|
Getting price quote
|
1141
1207
|
<Spinner size="sm" color="accentText" />
|
@@ -1158,9 +1224,7 @@ function FiatScreenContent(props: {
|
|
1158
1224
|
showCurrencySelector: () => void;
|
1159
1225
|
payOptions: PayUIOptions;
|
1160
1226
|
theme: "light" | "dark" | Theme;
|
1161
|
-
buyForTx: BuyForTx | null;
|
1162
1227
|
client: ThirdwebClient;
|
1163
|
-
onViewPendingTx: () => void;
|
1164
1228
|
onDone: () => void;
|
1165
1229
|
isEmbed: boolean;
|
1166
1230
|
payer: PayerInfo;
|
@@ -1177,11 +1241,13 @@ function FiatScreenContent(props: {
|
|
1177
1241
|
showCurrencySelector,
|
1178
1242
|
selectedCurrency,
|
1179
1243
|
} = props;
|
1180
|
-
const
|
1181
|
-
props.payOptions
|
1182
|
-
);
|
1244
|
+
const defaultRecipientAddress = (
|
1245
|
+
props.payOptions as Extract<PayUIOptions, { mode: "direct_payment" }>
|
1246
|
+
)?.paymentInfo?.sellerAddress;
|
1247
|
+
const receiverAddress =
|
1248
|
+
defaultRecipientAddress || props.payer.account.address;
|
1183
1249
|
const { drawerRef, drawerOverlayRef, isOpen, setIsOpen } = useDrawer();
|
1184
|
-
const [drawerScreen, setDrawerScreen] = useState<"fees"
|
1250
|
+
const [drawerScreen, setDrawerScreen] = useState<"fees">("fees");
|
1185
1251
|
|
1186
1252
|
const buyWithFiatOptions = props.payOptions.buyWithFiat;
|
1187
1253
|
|
@@ -1269,8 +1335,6 @@ function FiatScreenContent(props: {
|
|
1269
1335
|
|
1270
1336
|
const disableSubmit = !fiatQuoteQuery.data;
|
1271
1337
|
|
1272
|
-
const disableReceiverSelection = !!props.payOptions.recipientAddress;
|
1273
|
-
|
1274
1338
|
const errorMsg =
|
1275
1339
|
!fiatQuoteQuery.isLoading && fiatQuoteQuery.error
|
1276
1340
|
? getErrorMessage(fiatQuoteQuery.error)
|
@@ -1292,15 +1356,6 @@ function FiatScreenContent(props: {
|
|
1292
1356
|
<FiatFees quote={fiatQuoteQuery.data} />
|
1293
1357
|
</div>
|
1294
1358
|
)}
|
1295
|
-
|
1296
|
-
{drawerScreen === "receiver" && (
|
1297
|
-
<ReceiverWalletDrawerScreen
|
1298
|
-
client={props.client}
|
1299
|
-
onSelect={(x) => setReceiverAddress(x)}
|
1300
|
-
receiverAddress={receiverAddress}
|
1301
|
-
onBack={() => setIsOpen(false)}
|
1302
|
-
/>
|
1303
|
-
)}
|
1304
1359
|
</Drawer>
|
1305
1360
|
</>
|
1306
1361
|
)}
|
@@ -1320,19 +1375,6 @@ function FiatScreenContent(props: {
|
|
1320
1375
|
onViewFees={showFees}
|
1321
1376
|
/>
|
1322
1377
|
<Spacer y="md" />
|
1323
|
-
<Text size="sm">Send to</Text>
|
1324
|
-
<Spacer y="xs" />
|
1325
|
-
<WalletSelectorButton
|
1326
|
-
client={props.client}
|
1327
|
-
onClick={() => {
|
1328
|
-
setDrawerScreen("receiver");
|
1329
|
-
setIsOpen(true);
|
1330
|
-
}}
|
1331
|
-
address={receiverAddress}
|
1332
|
-
disabled={disableReceiverSelection}
|
1333
|
-
disableChevron={disableReceiverSelection}
|
1334
|
-
walletId={undefined}
|
1335
|
-
/>
|
1336
1378
|
</div>
|
1337
1379
|
|
1338
1380
|
{/* Error message */}
|
@@ -1393,86 +1435,6 @@ function FiatScreenContent(props: {
|
|
1393
1435
|
);
|
1394
1436
|
}
|
1395
1437
|
|
1396
|
-
function BuyForTxUI(props: {
|
1397
|
-
amountNeeded: string;
|
1398
|
-
buyForTx: BuyForTx;
|
1399
|
-
client: ThirdwebClient;
|
1400
|
-
}) {
|
1401
|
-
const chainNameQuery = useChainName(props.buyForTx.tx.chain);
|
1402
|
-
|
1403
|
-
return (
|
1404
|
-
<Container>
|
1405
|
-
<Spacer y="xs" />
|
1406
|
-
<Container
|
1407
|
-
flex="row"
|
1408
|
-
style={{
|
1409
|
-
justifyContent: "space-between",
|
1410
|
-
}}
|
1411
|
-
>
|
1412
|
-
<Text size="sm">Amount Needed</Text>
|
1413
|
-
<Container
|
1414
|
-
flex="column"
|
1415
|
-
style={{
|
1416
|
-
alignItems: "flex-end",
|
1417
|
-
}}
|
1418
|
-
>
|
1419
|
-
<Container flex="row" gap="xs" center="y">
|
1420
|
-
<Text color="primaryText" size="sm">
|
1421
|
-
{props.amountNeeded} {props.buyForTx.tokenSymbol}
|
1422
|
-
</Text>
|
1423
|
-
<TokenIcon
|
1424
|
-
chain={props.buyForTx.tx.chain}
|
1425
|
-
client={props.client}
|
1426
|
-
size="sm"
|
1427
|
-
token={NATIVE_TOKEN}
|
1428
|
-
/>
|
1429
|
-
</Container>
|
1430
|
-
<Spacer y="xxs" />
|
1431
|
-
{chainNameQuery.name ? (
|
1432
|
-
<Text size="sm">{chainNameQuery.name}</Text>
|
1433
|
-
) : (
|
1434
|
-
<Skeleton height={fontSize.sm} width="50px" />
|
1435
|
-
)}
|
1436
|
-
</Container>
|
1437
|
-
</Container>
|
1438
|
-
|
1439
|
-
<Spacer y="md" />
|
1440
|
-
<Line />
|
1441
|
-
<Spacer y="md" />
|
1442
|
-
|
1443
|
-
<Container
|
1444
|
-
flex="row"
|
1445
|
-
style={{
|
1446
|
-
justifyContent: "space-between",
|
1447
|
-
}}
|
1448
|
-
>
|
1449
|
-
<Text size="sm">Your Balance</Text>
|
1450
|
-
<Container flex="row" gap="xs">
|
1451
|
-
<Text color="primaryText" size="sm">
|
1452
|
-
{formatNumber(Number(toEther(props.buyForTx.balance)), 6)}{" "}
|
1453
|
-
{props.buyForTx.tokenSymbol}
|
1454
|
-
</Text>
|
1455
|
-
<TokenIcon
|
1456
|
-
chain={props.buyForTx.tx.chain}
|
1457
|
-
client={props.client}
|
1458
|
-
size="sm"
|
1459
|
-
token={NATIVE_TOKEN}
|
1460
|
-
/>
|
1461
|
-
</Container>
|
1462
|
-
</Container>
|
1463
|
-
|
1464
|
-
<Spacer y="md" />
|
1465
|
-
<Line />
|
1466
|
-
<Spacer y="xl" />
|
1467
|
-
|
1468
|
-
<Text center size="sm">
|
1469
|
-
Purchase
|
1470
|
-
</Text>
|
1471
|
-
<Spacer y="xxs" />
|
1472
|
-
</Container>
|
1473
|
-
);
|
1474
|
-
}
|
1475
|
-
|
1476
1438
|
function createSupportedTokens(
|
1477
1439
|
data: SupportedChainAndTokens,
|
1478
1440
|
payOptions: PayUIOptions,
|
@@ -1483,6 +1445,8 @@ function createSupportedTokens(
|
|
1483
1445
|
const isBuyWithFiatDisabled = payOptions.buyWithFiat === false;
|
1484
1446
|
const isBuyWithCryptoDisabled = payOptions.buyWithCrypto === false;
|
1485
1447
|
|
1448
|
+
// FIXME (pay) when buywithFiat is disabled, missing a bunch of tokens on base??
|
1449
|
+
|
1486
1450
|
for (const x of data) {
|
1487
1451
|
tokens[x.chain.id] = x.tokens.filter((t) => {
|
1488
1452
|
// it token supports both - include it
|