thirdweb 5.30.0-nightly-e7434891354f351d2a399daebdddae9cf1fc817b-20240623000619 → 5.30.0-nightly-3979ff0238ae9b3a0a216e6c2d562eb7206a9fe8-20240626085813
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/auth/verifySignature.js +15 -1
- package/dist/cjs/auth/verifySignature.js.map +1 -1
- package/dist/cjs/exports/extensions/erc1155.js +3 -1
- package/dist/cjs/exports/extensions/erc1155.js.map +1 -1
- package/dist/cjs/exports/transaction.js +3 -1
- package/dist/cjs/exports/transaction.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/web/ui/ConnectWallet/ConnectButton.js +12 -24
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +4 -6
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +12 -14
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +31 -28
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js +7 -5
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +15 -17
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +11 -13
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.js +1 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.js +4 -6
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +8 -11
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/TOS.js +1 -3
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/TOS.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/screen.js +5 -9
- 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/WalletEntryButton.js +2 -4
- package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +24 -30
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +114 -86
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +25 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +7 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +4 -11
- 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 +3 -16
- 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 +0 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +4 -6
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +2 -2
- 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/PayWithCrypto.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js +7 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js +2 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/StartScreen.js +7 -9
- package/dist/cjs/react/web/ui/ConnectWallet/screens/StartScreen.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/useConnectModal.js +23 -27
- package/dist/cjs/react/web/ui/ConnectWallet/useConnectModal.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +1 -0
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/components/ChainName.js +12 -1
- package/dist/cjs/react/web/ui/components/ChainName.js.map +1 -1
- package/dist/cjs/react/web/ui/components/basic.js +1 -1
- package/dist/cjs/react/web/ui/components/basic.js.map +1 -1
- package/dist/cjs/react/web/ui/components/buttons.js +6 -0
- package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +6 -8
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletFormUI.js +5 -7
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletFormUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +6 -8
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletFormUI.js +8 -11
- package/dist/cjs/react/web/wallets/in-app/InAppWalletFormUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletSelectionUI.js +5 -7
- package/dist/cjs/react/web/wallets/in-app/InAppWalletSelectionUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/useInAppWalletLocale.js +5 -5
- package/dist/cjs/react/web/wallets/in-app/useInAppWalletLocale.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/CoinbaseSDKConnection.js +4 -6
- package/dist/cjs/react/web/wallets/shared/CoinbaseSDKConnection.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +7 -9
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectingScreen.js +3 -5
- package/dist/cjs/react/web/wallets/shared/ConnectingScreen.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js +4 -6
- package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +8 -10
- package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +2 -4
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/SocialLogin.js +3 -6
- package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/WalletConnectConnection.js +24 -27
- package/dist/cjs/react/web/wallets/shared/WalletConnectConnection.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js +2 -2
- package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/cjs/react/web/wallets/walletConnect/locale.js +3 -3
- package/dist/cjs/react/web/wallets/walletConnect/locale.js.map +1 -1
- package/dist/cjs/transaction/actions/gasless/send-gasless-transaction.js +14 -4
- package/dist/cjs/transaction/actions/gasless/send-gasless-transaction.js.map +1 -1
- package/dist/cjs/transaction/actions/send-transaction.js +7 -0
- package/dist/cjs/transaction/actions/send-transaction.js.map +1 -1
- package/dist/cjs/transaction/transaction-store.js +33 -0
- package/dist/cjs/transaction/transaction-store.js.map +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/in-app/web/utils/Storage/LocalStorage.js.map +1 -1
- package/dist/cjs/wallets/wallet-connect/controller.js +7 -3
- package/dist/cjs/wallets/wallet-connect/controller.js.map +1 -1
- package/dist/esm/auth/verifySignature.js +15 -1
- package/dist/esm/auth/verifySignature.js.map +1 -1
- package/dist/esm/exports/extensions/erc1155.js +1 -0
- package/dist/esm/exports/extensions/erc1155.js.map +1 -1
- package/dist/esm/exports/transaction.js +1 -0
- package/dist/esm/exports/transaction.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/web/ui/ConnectWallet/ConnectButton.js +12 -24
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +4 -6
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +12 -14
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +31 -28
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js +7 -5
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +16 -18
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +11 -13
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.js +1 -4
- package/dist/esm/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.js +4 -6
- package/dist/esm/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +8 -11
- package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/TOS.js +1 -3
- package/dist/esm/react/web/ui/ConnectWallet/Modal/TOS.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/screen.js +5 -9
- 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/WalletEntryButton.js +2 -4
- package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +24 -30
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +115 -87
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +22 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +7 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +4 -11
- 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 +3 -16
- 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 +0 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +4 -6
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +2 -2
- 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/PayWithCrypto.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js +4 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js +2 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/StartScreen.js +7 -9
- package/dist/esm/react/web/ui/ConnectWallet/screens/StartScreen.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/useConnectModal.js +23 -27
- package/dist/esm/react/web/ui/ConnectWallet/useConnectModal.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +1 -0
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/components/ChainName.js +12 -1
- package/dist/esm/react/web/ui/components/ChainName.js.map +1 -1
- package/dist/esm/react/web/ui/components/basic.js +1 -1
- package/dist/esm/react/web/ui/components/basic.js.map +1 -1
- package/dist/esm/react/web/ui/components/buttons.js +6 -0
- package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +7 -9
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletFormUI.js +5 -7
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletFormUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +7 -9
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletFormUI.js +8 -11
- package/dist/esm/react/web/wallets/in-app/InAppWalletFormUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletSelectionUI.js +6 -8
- package/dist/esm/react/web/wallets/in-app/InAppWalletSelectionUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/useInAppWalletLocale.js +5 -5
- package/dist/esm/react/web/wallets/in-app/useInAppWalletLocale.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/CoinbaseSDKConnection.js +4 -6
- package/dist/esm/react/web/wallets/shared/CoinbaseSDKConnection.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +7 -9
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectingScreen.js +3 -5
- package/dist/esm/react/web/wallets/shared/ConnectingScreen.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/GetStartedScreen.js +4 -6
- package/dist/esm/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +8 -10
- package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +2 -4
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/SocialLogin.js +3 -6
- package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/WalletConnectConnection.js +24 -27
- package/dist/esm/react/web/wallets/shared/WalletConnectConnection.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js +1 -1
- package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/esm/react/web/wallets/walletConnect/locale.js +3 -3
- package/dist/esm/react/web/wallets/walletConnect/locale.js.map +1 -1
- package/dist/esm/transaction/actions/gasless/send-gasless-transaction.js +14 -4
- package/dist/esm/transaction/actions/gasless/send-gasless-transaction.js.map +1 -1
- package/dist/esm/transaction/actions/send-transaction.js +7 -0
- package/dist/esm/transaction/actions/send-transaction.js.map +1 -1
- package/dist/esm/transaction/transaction-store.js +29 -0
- package/dist/esm/transaction/transaction-store.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/in-app/web/utils/Storage/LocalStorage.js.map +1 -1
- package/dist/esm/wallets/wallet-connect/controller.js +7 -3
- package/dist/esm/wallets/wallet-connect/controller.js.map +1 -1
- package/dist/types/auth/verifySignature.d.ts +0 -20
- package/dist/types/auth/verifySignature.d.ts.map +1 -1
- package/dist/types/exports/extensions/erc1155.d.ts +1 -0
- package/dist/types/exports/extensions/erc1155.d.ts.map +1 -1
- package/dist/types/exports/transaction.d.ts +1 -0
- package/dist/types/exports/transaction.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/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButtonProps.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts +7 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts +20 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.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/ConnectModal.d.ts +32 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts +32 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalInline.d.ts +31 -2
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalInline.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.d.ts +5 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts +20 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/TOS.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/TOS.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/screen.d.ts +6 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/screen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts +25 -0
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts +14 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +9 -5
- 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 +2 -3
- 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 +2 -2
- 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/swap/BuyTokenInput.d.ts.map +1 -1
- 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/PayWithCrypto.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/StartScreen.d.ts +13 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/StartScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/useConnectModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts +1 -0
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/ChainName.d.ts +1 -0
- package/dist/types/react/web/ui/components/ChainName.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/basic.d.ts +1 -0
- package/dist/types/react/web/ui/components/basic.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/buttons.d.ts +2 -1
- package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts +16 -0
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts +16 -2
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts +16 -0
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts +16 -2
- package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts +10 -0
- package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/useInAppWalletLocale.d.ts +3 -2
- package/dist/types/react/web/wallets/in-app/useInAppWalletLocale.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/CoinbaseSDKConnection.d.ts +6 -1
- package/dist/types/react/web/wallets/shared/CoinbaseSDKConnection.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +7 -2
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectingScreen.d.ts +3 -0
- package/dist/types/react/web/wallets/shared/ConnectingScreen.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/GetStartedScreen.d.ts +2 -0
- package/dist/types/react/web/wallets/shared/GetStartedScreen.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts +7 -2
- package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts +5 -0
- package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/SocialLogin.d.ts +7 -2
- package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/WalletConnectConnection.d.ts +16 -0
- package/dist/types/react/web/wallets/shared/WalletConnectConnection.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/en.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/es.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/getConnectLocale.d.ts +2 -2
- package/dist/types/react/web/wallets/shared/locale/getConnectLocale.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/tl.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/types.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/locale/types.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/send-gasless-transaction.d.ts.map +1 -1
- package/dist/types/transaction/actions/send-transaction.d.ts.map +1 -1
- package/dist/types/transaction/actions/zksync/getEip721Domain.d.ts +3 -3
- package/dist/types/transaction/prepare-transaction.d.ts +3 -3
- package/dist/types/transaction/transaction-store.d.ts +22 -0
- package/dist/types/transaction/transaction-store.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/in-app/web/utils/Storage/LocalStorage.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/auth/verifySignature.ts +16 -1
- package/src/exports/extensions/erc1155.ts +4 -0
- package/src/exports/transaction.ts +1 -0
- package/src/extensions/airdrop/write/airdropERC1155WithSignature.test.ts +8 -9
- package/src/extensions/airdrop/write/airdropERC20WithSignature.test.ts +9 -10
- package/src/extensions/airdrop/write/airdropERC721WithSignature.test.ts +5 -5
- package/src/extensions/airdrop/write/claimERC1155.test.ts +6 -6
- package/src/extensions/airdrop/write/claimERC20.test.ts +7 -7
- package/src/extensions/airdrop/write/claimERC721.test.ts +6 -6
- package/src/react/core/design-system/index.ts +2 -0
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +35 -33
- package/src/react/web/ui/ConnectWallet/ConnectButtonProps.ts +2 -2
- package/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx +13 -6
- package/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx +58 -4
- package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +97 -38
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx +56 -4
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx +98 -30
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModalInline.tsx +100 -15
- package/src/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.tsx +3 -5
- package/src/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.tsx +10 -5
- package/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx +43 -10
- package/src/react/web/ui/ConnectWallet/Modal/TOS.tsx +3 -3
- package/src/react/web/ui/ConnectWallet/Modal/screen.tsx +10 -12
- package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +2 -1
- package/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx +14 -6
- package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +112 -33
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +411 -204
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.tsx +45 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +7 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +12 -12
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +14 -5
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts +6 -15
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.ts +3 -28
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +2 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.tsx +4 -6
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/utils.ts +3 -0
- package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +2 -3
- package/src/react/web/ui/ConnectWallet/screens/StartScreen.tsx +23 -14
- package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +5 -1
- package/src/react/web/ui/ConnectWallet/useConnectModal.tsx +44 -39
- package/src/react/web/ui/PayEmbed-disconnected.test.tsx +15 -0
- package/src/react/web/ui/PayEmbed.test.tsx +33 -6
- package/src/react/web/ui/PayEmbed.tsx +3 -0
- package/src/react/web/ui/components/ChainName.tsx +18 -1
- package/src/react/web/ui/components/basic.tsx +2 -1
- package/src/react/web/ui/components/buttons.tsx +8 -0
- package/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx +33 -5
- package/src/react/web/wallets/ecosystem/EcosystemWalletFormUI.tsx +25 -12
- package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +34 -6
- package/src/react/web/wallets/in-app/InAppWalletFormUI.tsx +44 -23
- package/src/react/web/wallets/in-app/InAppWalletSelectionUI.tsx +20 -6
- package/src/react/web/wallets/in-app/useInAppWalletLocale.ts +10 -7
- package/src/react/web/wallets/shared/CoinbaseSDKConnection.tsx +12 -9
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +14 -11
- package/src/react/web/wallets/shared/ConnectingScreen.tsx +7 -5
- package/src/react/web/wallets/shared/GetStartedScreen.tsx +7 -4
- package/src/react/web/wallets/shared/OTPLoginUI.tsx +15 -12
- package/src/react/web/wallets/shared/PassKeyLogin.tsx +5 -4
- package/src/react/web/wallets/shared/SocialLogin.tsx +11 -8
- package/src/react/web/wallets/shared/WalletConnectConnection.tsx +48 -27
- package/src/react/web/wallets/shared/locale/en.ts +2 -2
- package/src/react/web/wallets/shared/locale/es.ts +2 -2
- package/src/react/web/wallets/shared/locale/getConnectLocale.ts +3 -3
- package/src/react/web/wallets/shared/locale/ja.ts +2 -2
- package/src/react/web/wallets/shared/locale/tl.ts +2 -2
- package/src/react/web/wallets/shared/locale/types.ts +1 -1
- package/src/react/web/wallets/walletConnect/locale.ts +3 -3
- package/src/rpc/actions/eth_getLogs.test.ts +3 -2
- package/src/transaction/actions/gasless/send-gasless-transaction.ts +15 -4
- package/src/transaction/actions/send-transaction.test.ts +22 -1
- package/src/transaction/actions/send-transaction.ts +7 -0
- package/src/transaction/actions/zksync/getEip721Domain.ts +4 -4
- package/src/transaction/prepare-transaction.ts +3 -3
- package/src/transaction/transaction-store.test.ts +51 -0
- package/src/transaction/transaction-store.ts +46 -0
- package/src/version.ts +1 -1
- package/src/wallets/in-app/web/utils/Storage/LocalStorage.ts +4 -1
- package/src/wallets/wallet-connect/controller.ts +8 -3
- package/dist/cjs/react/core/hooks/others/useWalletConnectionCtx.js +0 -16
- package/dist/cjs/react/core/hooks/others/useWalletConnectionCtx.js.map +0 -1
- package/dist/cjs/react/core/providers/wallet-connection.js +0 -7
- package/dist/cjs/react/core/providers/wallet-connection.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/CryptoIcon.js +0 -12
- package/dist/cjs/react/web/ui/ConnectWallet/icons/CryptoIcon.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.js +0 -44
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.js.map +0 -1
- package/dist/esm/react/core/hooks/others/useWalletConnectionCtx.js +0 -13
- package/dist/esm/react/core/hooks/others/useWalletConnectionCtx.js.map +0 -1
- package/dist/esm/react/core/providers/wallet-connection.js +0 -4
- package/dist/esm/react/core/providers/wallet-connection.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/CryptoIcon.js +0 -8
- package/dist/esm/react/web/ui/ConnectWallet/icons/CryptoIcon.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.js +0 -41
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.js.map +0 -1
- package/dist/types/react/core/hooks/others/useWalletConnectionCtx.d.ts +0 -29
- package/dist/types/react/core/hooks/others/useWalletConnectionCtx.d.ts.map +0 -1
- package/dist/types/react/core/providers/wallet-connection.d.ts +0 -35
- package/dist/types/react/core/providers/wallet-connection.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/icons/CryptoIcon.d.ts +0 -6
- package/dist/types/react/web/ui/ConnectWallet/icons/CryptoIcon.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.d.ts +0 -8
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.d.ts.map +0 -1
- package/src/react/core/hooks/others/useWalletConnectionCtx.ts +0 -15
- package/src/react/core/providers/wallet-connection.tsx +0 -37
- package/src/react/web/ui/ConnectWallet/icons/CryptoIcon.tsx +0 -50
- package/src/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.tsx +0 -72
@@ -1,3 +1,4 @@
|
|
1
|
+
import { IdCardIcon } from "@radix-ui/react-icons";
|
1
2
|
import { useMemo, useState } from "react";
|
2
3
|
import type { Chain } from "../../../../../../chains/types.js";
|
3
4
|
import type { ThirdwebClient } from "../../../../../../client/client.js";
|
@@ -10,6 +11,7 @@ import type { Account } from "../../../../../../wallets/interfaces/wallet.js";
|
|
10
11
|
import {
|
11
12
|
type Theme,
|
12
13
|
fontSize,
|
14
|
+
iconSize,
|
13
15
|
spacing,
|
14
16
|
} from "../../../../../core/design-system/index.js";
|
15
17
|
import {
|
@@ -22,6 +24,7 @@ import { useBuyWithFiatQuote } from "../../../../../core/hooks/pay/useBuyWithFia
|
|
22
24
|
import { useActiveAccount } from "../../../../hooks/wallets/useActiveAccount.js";
|
23
25
|
import { useActiveWalletChain } from "../../../../hooks/wallets/useActiveWalletChain.js";
|
24
26
|
import { LoadingScreen } from "../../../../wallets/shared/LoadingScreen.js";
|
27
|
+
import { ChainName } from "../../../components/ChainName.js";
|
25
28
|
import {
|
26
29
|
Drawer,
|
27
30
|
DrawerOverlay,
|
@@ -36,9 +39,11 @@ import { TokenIcon } from "../../../components/TokenIcon.js";
|
|
36
39
|
import { Container, Line, ModalHeader } from "../../../components/basic.js";
|
37
40
|
import { Button } from "../../../components/buttons.js";
|
38
41
|
import { Text } from "../../../components/text.js";
|
42
|
+
import { TokenSymbol } from "../../../components/token/TokenSymbol.js";
|
39
43
|
import type { PayUIOptions } from "../../ConnectButtonProps.js";
|
40
44
|
import { ChainButton, NetworkSelectorContent } from "../../NetworkSelector.js";
|
41
45
|
import type { SupportedTokens } from "../../defaultTokens.js";
|
46
|
+
import { CoinsIcon } from "../../icons/CoinsIcon.js";
|
42
47
|
import type { ConnectLocale } from "../../locale/types.js";
|
43
48
|
import { TokenSelector } from "../TokenSelector.js";
|
44
49
|
import {
|
@@ -47,8 +52,8 @@ import {
|
|
47
52
|
isNativeToken,
|
48
53
|
} from "../nativeToken.js";
|
49
54
|
import { EstimatedTimeAndFees } from "./EstimatedTimeAndFees.js";
|
55
|
+
import { PayTokenIcon } from "./PayTokenIcon.js";
|
50
56
|
import { PayWithCreditCard } from "./PayWIthCreditCard.js";
|
51
|
-
import { PaymentSelection } from "./PaymentSelection.js";
|
52
57
|
import { CurrencySelection } from "./fiat/CurrencySelection.js";
|
53
58
|
import { FiatFlow } from "./fiat/FiatFlow.js";
|
54
59
|
import type { CurrencyMeta } from "./fiat/currencies.js";
|
@@ -119,19 +124,9 @@ type BuyScreenContentProps = {
|
|
119
124
|
isEmbed: boolean;
|
120
125
|
};
|
121
126
|
|
122
|
-
function useBuyScreenStates(
|
123
|
-
const { payOptions } = options;
|
124
|
-
|
125
|
-
const [method, setMethod] = useState<"crypto" | "creditCard">(
|
126
|
-
payOptions.buyWithCrypto === false
|
127
|
-
? "creditCard"
|
128
|
-
: payOptions.buyWithFiat === false
|
129
|
-
? "crypto"
|
130
|
-
: "creditCard",
|
131
|
-
);
|
132
|
-
|
127
|
+
function useBuyScreenStates() {
|
133
128
|
const [screen, setScreen] = useState<SelectedScreen>({
|
134
|
-
|
129
|
+
id: "main",
|
135
130
|
});
|
136
131
|
|
137
132
|
const [drawerScreen, setDrawerScreen] = useState<React.ReactNode>();
|
@@ -143,15 +138,7 @@ function useBuyScreenStates(options: { payOptions: PayUIOptions }) {
|
|
143
138
|
});
|
144
139
|
}
|
145
140
|
|
146
|
-
function showMainScreen() {
|
147
|
-
setScreen({
|
148
|
-
type: "main",
|
149
|
-
});
|
150
|
-
}
|
151
|
-
|
152
141
|
return {
|
153
|
-
method,
|
154
|
-
setMethod,
|
155
142
|
screen,
|
156
143
|
setScreen,
|
157
144
|
drawerScreen,
|
@@ -159,7 +146,6 @@ function useBuyScreenStates(options: { payOptions: PayUIOptions }) {
|
|
159
146
|
drawerRef,
|
160
147
|
drawerOverlayRef,
|
161
148
|
closeDrawer,
|
162
|
-
showMainScreen,
|
163
149
|
};
|
164
150
|
}
|
165
151
|
|
@@ -178,8 +164,6 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
178
164
|
|
179
165
|
// screen
|
180
166
|
const {
|
181
|
-
method,
|
182
|
-
setMethod,
|
183
167
|
screen,
|
184
168
|
setScreen,
|
185
169
|
drawerScreen,
|
@@ -187,15 +171,12 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
187
171
|
drawerRef,
|
188
172
|
drawerOverlayRef,
|
189
173
|
closeDrawer,
|
190
|
-
|
191
|
-
} = useBuyScreenStates({ payOptions });
|
174
|
+
} = useBuyScreenStates();
|
192
175
|
|
193
176
|
// UI selection
|
194
177
|
const {
|
195
178
|
tokenAmount,
|
196
179
|
setTokenAmount,
|
197
|
-
setHasEditedAmount,
|
198
|
-
hasEditedAmount,
|
199
180
|
toChain,
|
200
181
|
setToChain,
|
201
182
|
deferredTokenAmount,
|
@@ -213,17 +194,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
213
194
|
supportedDestinations,
|
214
195
|
});
|
215
196
|
|
216
|
-
// Buy Transaction flow states
|
217
|
-
const { amountNeeded } = useBuyTxStates({
|
218
|
-
setTokenAmount,
|
219
|
-
buyForTx,
|
220
|
-
hasEditedAmount,
|
221
|
-
isMainScreen: screen.type === "main",
|
222
|
-
account,
|
223
|
-
});
|
224
|
-
|
225
197
|
// check if the screen is expanded or not
|
226
|
-
const isExpanded = activeChain && tokenAmount;
|
227
198
|
|
228
199
|
// update supportedSources whenever toToken or toChain is updated
|
229
200
|
const supportedSourcesQuery = useBuySupportedSources({
|
@@ -254,35 +225,28 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
254
225
|
);
|
255
226
|
}, [props.supportedTokens, supportedSourcesQuery.data, payOptions]);
|
256
227
|
|
257
|
-
const { showPaymentSelection } = useEnabledPaymentMethods({
|
258
|
-
payOptions,
|
259
|
-
supportedDestinations,
|
260
|
-
toChain,
|
261
|
-
toToken,
|
262
|
-
method,
|
263
|
-
setMethod,
|
264
|
-
});
|
265
|
-
|
266
228
|
// screens ----------------------------
|
267
229
|
|
268
|
-
if (screen.
|
230
|
+
if (screen.id === "node") {
|
269
231
|
return screen.node;
|
270
232
|
}
|
271
233
|
|
272
|
-
if (screen.
|
234
|
+
if (screen.id === "select-currency") {
|
235
|
+
const goBack = () => setScreen(screen.backScreen);
|
273
236
|
return (
|
274
237
|
<CurrencySelection
|
275
238
|
onSelect={(currency) => {
|
276
|
-
|
239
|
+
goBack();
|
277
240
|
setSelectedCurrency(currency);
|
278
241
|
}}
|
279
|
-
onBack={
|
242
|
+
onBack={goBack}
|
280
243
|
/>
|
281
244
|
);
|
282
245
|
}
|
283
246
|
|
284
|
-
if (screen.
|
247
|
+
if (screen.id === "select-to-token") {
|
285
248
|
const chains = supportedDestinations.map((x) => x.chain);
|
249
|
+
const goBack = () => setScreen(screen.backScreen);
|
286
250
|
// if token selection is disabled - only show network selector screen
|
287
251
|
if (payOptions.prefillBuy?.allowEdits?.token === false) {
|
288
252
|
return (
|
@@ -291,21 +255,21 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
291
255
|
client={props.client}
|
292
256
|
connectLocale={props.connectLocale}
|
293
257
|
setChain={setToChain}
|
294
|
-
|
258
|
+
goBack={goBack}
|
295
259
|
/>
|
296
260
|
);
|
297
261
|
}
|
298
262
|
|
299
263
|
return (
|
300
264
|
<TokenSelector
|
301
|
-
onBack={
|
265
|
+
onBack={goBack}
|
302
266
|
tokenList={(
|
303
267
|
(toChain?.id ? destinationSupportedTokens[toChain.id] : undefined) ||
|
304
268
|
[]
|
305
269
|
).filter((x) => x.address !== NATIVE_TOKEN_ADDRESS)}
|
306
270
|
onTokenSelect={(tokenInfo) => {
|
307
271
|
setToToken(tokenInfo);
|
308
|
-
|
272
|
+
goBack();
|
309
273
|
}}
|
310
274
|
chain={toChain}
|
311
275
|
chainSelection={
|
@@ -321,17 +285,18 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
321
285
|
}
|
322
286
|
connectLocale={connectLocale}
|
323
287
|
client={client}
|
288
|
+
modalTitle="Buy"
|
324
289
|
/>
|
325
290
|
);
|
326
291
|
}
|
327
292
|
|
328
293
|
if (
|
329
|
-
screen.
|
330
|
-
screen.name === "select-from-token" &&
|
294
|
+
screen.id === "select-from-token" &&
|
331
295
|
supportedSourcesQuery.data &&
|
332
296
|
sourceSupportedTokens
|
333
297
|
) {
|
334
298
|
const chains = supportedSourcesQuery.data.map((x) => x.chain);
|
299
|
+
const goBack = () => setScreen(screen.backScreen);
|
335
300
|
// if token selection is disabled - only show network selector screen
|
336
301
|
if (
|
337
302
|
payOptions.buyWithCrypto !== false &&
|
@@ -343,23 +308,21 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
343
308
|
client={props.client}
|
344
309
|
connectLocale={props.connectLocale}
|
345
310
|
setChain={setFromChain}
|
346
|
-
|
311
|
+
goBack={goBack}
|
347
312
|
/>
|
348
313
|
);
|
349
314
|
}
|
350
315
|
|
351
316
|
return (
|
352
317
|
<TokenSelector
|
353
|
-
onBack={
|
318
|
+
onBack={goBack}
|
354
319
|
tokenList={(
|
355
320
|
(fromChain?.id ? sourceSupportedTokens[fromChain.id] : undefined) ||
|
356
321
|
[]
|
357
322
|
).filter((x) => x.address !== NATIVE_TOKEN_ADDRESS)}
|
358
323
|
onTokenSelect={(tokenInfo) => {
|
359
324
|
setFromToken(tokenInfo);
|
360
|
-
|
361
|
-
type: "main",
|
362
|
-
});
|
325
|
+
goBack();
|
363
326
|
}}
|
364
327
|
chain={fromChain}
|
365
328
|
chainSelection={
|
@@ -374,6 +337,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
374
337
|
}
|
375
338
|
connectLocale={connectLocale}
|
376
339
|
client={client}
|
340
|
+
modalTitle="Pay with"
|
377
341
|
/>
|
378
342
|
);
|
379
343
|
}
|
@@ -404,74 +368,51 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
404
368
|
</>
|
405
369
|
)}
|
406
370
|
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
title={
|
415
|
-
props.buyForTx
|
416
|
-
? `Not enough ${props.buyForTx.tokenSymbol}`
|
417
|
-
: "Buy"
|
371
|
+
{screen.id === "main" && (
|
372
|
+
<MainScreen
|
373
|
+
account={account || null}
|
374
|
+
buyForTx={buyForTx || null}
|
375
|
+
client={client}
|
376
|
+
onSelectBuyToken={() =>
|
377
|
+
setScreen({ id: "select-to-token", backScreen: screen })
|
418
378
|
}
|
419
|
-
|
379
|
+
payOptions={payOptions}
|
380
|
+
setTokenAmount={setTokenAmount}
|
381
|
+
toChain={toChain}
|
382
|
+
toToken={toToken}
|
383
|
+
tokenAmount={tokenAmount}
|
384
|
+
connectButton={props.connectButton}
|
385
|
+
onViewPendingTx={props.onViewPendingTx}
|
386
|
+
setScreen={setScreen}
|
387
|
+
supportedDestinations={supportedDestinations}
|
420
388
|
/>
|
389
|
+
)}
|
421
390
|
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
onChange={async (value) => {
|
440
|
-
setHasEditedAmount(true);
|
441
|
-
setTokenAmount(value);
|
442
|
-
}}
|
443
|
-
freezeAmount={payOptions.prefillBuy?.allowEdits?.amount === false}
|
444
|
-
freezeChainAndToken={
|
445
|
-
payOptions.prefillBuy?.allowEdits?.chain === false &&
|
446
|
-
payOptions.prefillBuy?.allowEdits?.token === false
|
447
|
-
}
|
448
|
-
token={toToken}
|
449
|
-
chain={toChain}
|
450
|
-
onSelectToken={() => {
|
451
|
-
setScreen({
|
452
|
-
type: "screen-id",
|
453
|
-
name: "select-to-token",
|
454
|
-
});
|
391
|
+
{(screen.id === "select-payment-method" ||
|
392
|
+
screen.id === "buy-with-crypto" ||
|
393
|
+
screen.id === "buy-with-fiat") && (
|
394
|
+
<TokenSelectedLayout
|
395
|
+
selectedChain={toChain}
|
396
|
+
selectedToken={toToken}
|
397
|
+
tokenAmount={tokenAmount}
|
398
|
+
client={client}
|
399
|
+
onBack={() => {
|
400
|
+
if (
|
401
|
+
screen.id === "buy-with-crypto" ||
|
402
|
+
screen.id === "buy-with-fiat"
|
403
|
+
) {
|
404
|
+
setScreen({ id: "select-payment-method" });
|
405
|
+
} else if (screen.id === "select-payment-method") {
|
406
|
+
setScreen({ id: "main" });
|
407
|
+
}
|
455
408
|
}}
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
</Container>
|
460
|
-
|
461
|
-
{showPaymentSelection ? <Spacer y="lg" /> : <Spacer y="md" />}
|
462
|
-
|
463
|
-
{isExpanded && (
|
464
|
-
<>
|
465
|
-
{showPaymentSelection && (
|
466
|
-
<Container px="lg">
|
467
|
-
<PaymentSelection selected={method} onSelect={setMethod} />
|
468
|
-
<Spacer y="md" />
|
469
|
-
</Container>
|
409
|
+
>
|
410
|
+
{screen.id === "select-payment-method" && (
|
411
|
+
<PaymentMethodSelection setScreen={(id) => setScreen({ id })} />
|
470
412
|
)}
|
471
413
|
|
472
|
-
{
|
414
|
+
{screen.id === "buy-with-crypto" && account && activeChain && (
|
473
415
|
<SwapScreenContent
|
474
|
-
{...props}
|
475
416
|
setScreen={setScreen}
|
476
417
|
setDrawerScreen={setDrawerScreen}
|
477
418
|
tokenAmount={deferredTokenAmount}
|
@@ -481,91 +422,354 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
481
422
|
fromToken={fromToken}
|
482
423
|
showFromTokenSelector={() => {
|
483
424
|
setScreen({
|
484
|
-
|
485
|
-
|
425
|
+
id: "select-from-token",
|
426
|
+
backScreen: screen,
|
486
427
|
});
|
487
428
|
}}
|
488
429
|
account={account}
|
489
430
|
activeChain={activeChain}
|
431
|
+
buyForTx={buyForTx || null}
|
432
|
+
client={client}
|
433
|
+
isEmbed={props.isEmbed}
|
434
|
+
onDone={props.onDone}
|
435
|
+
onViewPendingTx={props.onViewPendingTx}
|
436
|
+
payOptions={payOptions}
|
490
437
|
/>
|
491
438
|
)}
|
492
439
|
|
493
|
-
{
|
440
|
+
{screen.id === "buy-with-fiat" && account && activeChain && (
|
494
441
|
<FiatScreenContent
|
495
|
-
{...props}
|
496
442
|
setScreen={setScreen}
|
497
443
|
setDrawerScreen={setDrawerScreen}
|
498
444
|
tokenAmount={deferredTokenAmount}
|
499
445
|
toChain={toChain}
|
500
446
|
toToken={toToken}
|
501
|
-
closeDrawer={closeDrawer}
|
502
447
|
selectedCurrency={selectedCurrency}
|
448
|
+
buyForTx={buyForTx || null}
|
449
|
+
client={client}
|
450
|
+
isEmbed={props.isEmbed}
|
451
|
+
onDone={props.onDone}
|
452
|
+
onViewPendingTx={props.onViewPendingTx}
|
453
|
+
payOptions={payOptions}
|
454
|
+
theme={props.theme}
|
503
455
|
showCurrencySelector={() => {
|
504
456
|
setScreen({
|
505
|
-
|
457
|
+
id: "select-currency",
|
458
|
+
backScreen: screen,
|
506
459
|
});
|
507
460
|
}}
|
508
461
|
account={account}
|
509
462
|
/>
|
510
463
|
)}
|
464
|
+
</TokenSelectedLayout>
|
465
|
+
)}
|
466
|
+
</div>
|
467
|
+
</Container>
|
468
|
+
);
|
469
|
+
}
|
511
470
|
|
512
|
-
|
513
|
-
|
471
|
+
function SelectedTokenInfo(props: {
|
472
|
+
selectedToken: ERC20OrNativeToken;
|
473
|
+
selectedChain: Chain;
|
474
|
+
tokenAmount: string;
|
475
|
+
client: ThirdwebClient;
|
476
|
+
}) {
|
477
|
+
return (
|
478
|
+
<div>
|
479
|
+
<Container
|
480
|
+
flex="row"
|
481
|
+
gap="sm"
|
482
|
+
center="y"
|
483
|
+
style={{
|
484
|
+
justifyContent: "space-between",
|
485
|
+
}}
|
486
|
+
>
|
487
|
+
<Container flex="row" gap="xs" center="y">
|
488
|
+
<Text color="primaryText" data-testid="tokenAmount" size="xxl">
|
489
|
+
{formatNumber(Number(props.tokenAmount), 3)}
|
490
|
+
</Text>
|
491
|
+
|
492
|
+
<Container flex="row" gap="xxs" center="y">
|
493
|
+
<TokenSymbol
|
494
|
+
token={props.selectedToken}
|
495
|
+
chain={props.selectedChain}
|
496
|
+
size="md"
|
497
|
+
color="secondaryText"
|
498
|
+
/>
|
499
|
+
<PayTokenIcon
|
500
|
+
chain={props.selectedChain}
|
501
|
+
client={props.client}
|
502
|
+
size="sm"
|
503
|
+
token={props.selectedToken}
|
504
|
+
/>
|
505
|
+
</Container>
|
506
|
+
</Container>
|
507
|
+
|
508
|
+
<ChainName
|
509
|
+
chain={props.selectedChain}
|
510
|
+
client={props.client}
|
511
|
+
size="sm"
|
512
|
+
short
|
513
|
+
/>
|
514
|
+
</Container>
|
515
|
+
</div>
|
516
|
+
);
|
517
|
+
}
|
518
|
+
|
519
|
+
function MainScreen(props: {
|
520
|
+
buyForTx: BuyForTx | null;
|
521
|
+
client: ThirdwebClient;
|
522
|
+
setTokenAmount: (amount: string) => void;
|
523
|
+
account: Account | null;
|
524
|
+
tokenAmount: string;
|
525
|
+
payOptions: PayUIOptions;
|
526
|
+
toToken: ERC20OrNativeToken;
|
527
|
+
toChain: Chain;
|
528
|
+
onSelectBuyToken: () => void;
|
529
|
+
connectButton?: React.ReactNode;
|
530
|
+
onViewPendingTx: () => void;
|
531
|
+
setScreen: (screen: SelectedScreen) => void;
|
532
|
+
supportedDestinations: SupportedChainAndTokens;
|
533
|
+
}) {
|
534
|
+
const { showPaymentSelection, buyWithCryptoEnabled, buyWithFiatEnabled } =
|
535
|
+
useEnabledPaymentMethods({
|
536
|
+
payOptions: props.payOptions,
|
537
|
+
supportedDestinations: props.supportedDestinations,
|
538
|
+
toChain: props.toChain,
|
539
|
+
toToken: props.toToken,
|
540
|
+
});
|
541
|
+
|
542
|
+
const [hasEditedAmount, setHasEditedAmount] = useState(false);
|
543
|
+
const {
|
544
|
+
buyForTx,
|
545
|
+
setTokenAmount,
|
546
|
+
account,
|
547
|
+
client,
|
548
|
+
tokenAmount,
|
549
|
+
payOptions,
|
550
|
+
toToken,
|
551
|
+
toChain,
|
552
|
+
} = props;
|
553
|
+
|
554
|
+
// Buy Transaction flow states
|
555
|
+
const { amountNeeded } = useBuyTxStates({
|
556
|
+
setTokenAmount,
|
557
|
+
buyForTx,
|
558
|
+
hasEditedAmount,
|
559
|
+
account,
|
560
|
+
});
|
561
|
+
|
562
|
+
const disableContinue = !tokenAmount;
|
563
|
+
|
564
|
+
return (
|
565
|
+
<Container p="lg">
|
566
|
+
<ModalHeader
|
567
|
+
title={
|
568
|
+
props.buyForTx ? `Not enough ${props.buyForTx.tokenSymbol}` : "Buy"
|
569
|
+
}
|
570
|
+
/>
|
571
|
+
|
572
|
+
{/* Amount needed for Send Tx */}
|
573
|
+
{amountNeeded && props.buyForTx ? (
|
574
|
+
<>
|
575
|
+
<Spacer y="lg" />
|
576
|
+
<BuyForTxUI
|
577
|
+
amountNeeded={String(
|
578
|
+
formatNumber(Number(toEther(amountNeeded)), 4),
|
579
|
+
)}
|
580
|
+
buyForTx={props.buyForTx}
|
581
|
+
client={client}
|
582
|
+
/>
|
583
|
+
</>
|
584
|
+
) : (
|
585
|
+
<Spacer y="xl" />
|
586
|
+
)}
|
587
|
+
|
588
|
+
{/* To */}
|
589
|
+
<BuyTokenInput
|
590
|
+
value={tokenAmount}
|
591
|
+
onChange={async (value) => {
|
592
|
+
setHasEditedAmount(true);
|
593
|
+
setTokenAmount(value);
|
594
|
+
}}
|
595
|
+
freezeAmount={payOptions.prefillBuy?.allowEdits?.amount === false}
|
596
|
+
freezeChainAndToken={
|
597
|
+
payOptions.prefillBuy?.allowEdits?.chain === false &&
|
598
|
+
payOptions.prefillBuy?.allowEdits?.token === false
|
599
|
+
}
|
600
|
+
token={toToken}
|
601
|
+
chain={toChain}
|
602
|
+
onSelectToken={props.onSelectBuyToken}
|
603
|
+
client={props.client}
|
604
|
+
hideTokenSelector={!!props.buyForTx}
|
605
|
+
/>
|
606
|
+
|
607
|
+
<Spacer y="xl" />
|
608
|
+
|
609
|
+
{/* Continue */}
|
610
|
+
<Container flex="column" gap="sm">
|
611
|
+
{!account && props.connectButton ? (
|
612
|
+
<div>{props.connectButton}</div>
|
613
|
+
) : (
|
614
|
+
<Button
|
615
|
+
variant="accent"
|
616
|
+
fullWidth
|
617
|
+
disabled={disableContinue}
|
618
|
+
data-disabled={disableContinue}
|
619
|
+
onClick={() => {
|
620
|
+
if (showPaymentSelection) {
|
621
|
+
props.setScreen({ id: "select-payment-method" });
|
622
|
+
} else if (buyWithCryptoEnabled) {
|
623
|
+
props.setScreen({ id: "buy-with-crypto" });
|
624
|
+
} else if (buyWithFiatEnabled) {
|
625
|
+
props.setScreen({ id: "buy-with-fiat" });
|
626
|
+
} else {
|
627
|
+
console.error("No payment method enabled");
|
628
|
+
}
|
629
|
+
}}
|
630
|
+
>
|
631
|
+
Continue
|
632
|
+
</Button>
|
514
633
|
)}
|
515
634
|
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
635
|
+
{/* Do we want to remove this? */}
|
636
|
+
{account && (
|
637
|
+
<Button
|
638
|
+
variant="outline"
|
639
|
+
fullWidth
|
640
|
+
style={{
|
641
|
+
padding: spacing.xs,
|
642
|
+
fontSize: fontSize.sm,
|
643
|
+
}}
|
644
|
+
onClick={props.onViewPendingTx}
|
645
|
+
>
|
646
|
+
View all transactions
|
647
|
+
</Button>
|
648
|
+
)}
|
649
|
+
</Container>
|
650
|
+
</Container>
|
651
|
+
);
|
652
|
+
}
|
653
|
+
|
654
|
+
function TokenSelectedLayout(props: {
|
655
|
+
children: React.ReactNode;
|
656
|
+
tokenAmount: string;
|
657
|
+
selectedToken: ERC20OrNativeToken;
|
658
|
+
selectedChain: Chain;
|
659
|
+
client: ThirdwebClient;
|
660
|
+
onBack: () => void;
|
661
|
+
}) {
|
662
|
+
return (
|
663
|
+
<Container>
|
664
|
+
<Container p="lg">
|
665
|
+
<ModalHeader title={"Buy"} onBack={props.onBack} />
|
666
|
+
</Container>
|
533
667
|
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
668
|
+
<Container
|
669
|
+
px="lg"
|
670
|
+
style={{
|
671
|
+
paddingBottom: spacing.lg,
|
672
|
+
}}
|
673
|
+
>
|
674
|
+
<Spacer y="xs" />
|
675
|
+
<SelectedTokenInfo
|
676
|
+
selectedToken={props.selectedToken}
|
677
|
+
selectedChain={props.selectedChain}
|
678
|
+
tokenAmount={props.tokenAmount}
|
679
|
+
client={props.client}
|
680
|
+
/>
|
681
|
+
|
682
|
+
<Spacer y="md" />
|
683
|
+
<Line />
|
684
|
+
<Spacer y="lg" />
|
685
|
+
|
686
|
+
<Text size="sm"> Pay with </Text>
|
687
|
+
<Spacer y="sm" />
|
688
|
+
|
689
|
+
{props.children}
|
690
|
+
</Container>
|
691
|
+
</Container>
|
692
|
+
);
|
693
|
+
}
|
694
|
+
|
695
|
+
function PaymentMethodSelection(props: {
|
696
|
+
setScreen: (screenId: "buy-with-crypto" | "buy-with-fiat") => void;
|
697
|
+
}) {
|
698
|
+
return (
|
699
|
+
<Container animate="fadein">
|
700
|
+
{/* Credit Card */}
|
701
|
+
<Container flex="column" gap="sm">
|
702
|
+
<Button
|
703
|
+
variant="outline"
|
704
|
+
bg="tertiaryBg"
|
705
|
+
onClick={() => props.setScreen("buy-with-fiat")}
|
706
|
+
gap="sm"
|
707
|
+
style={{
|
708
|
+
justifyContent: "flex-start",
|
709
|
+
textAlign: "left",
|
710
|
+
}}
|
711
|
+
>
|
712
|
+
<Container color="secondaryText" flex="row" center="both">
|
713
|
+
<IdCardIcon
|
538
714
|
style={{
|
539
|
-
|
540
|
-
|
715
|
+
width: iconSize.md,
|
716
|
+
height: iconSize.md,
|
541
717
|
}}
|
542
|
-
|
543
|
-
|
544
|
-
View all transactions
|
545
|
-
</Button>
|
546
|
-
)}
|
547
|
-
</Container>
|
718
|
+
/>
|
719
|
+
</Container>
|
548
720
|
|
549
|
-
|
550
|
-
|
721
|
+
<Container flex="column" gap="xxs">
|
722
|
+
<Text size="md" color="primaryText">
|
723
|
+
Credit Card
|
724
|
+
</Text>
|
725
|
+
<Text size="xs">Easily and securely make payments</Text>
|
726
|
+
</Container>
|
727
|
+
</Button>
|
728
|
+
|
729
|
+
{/* Crypto */}
|
730
|
+
<Button
|
731
|
+
variant="outline"
|
732
|
+
bg="tertiaryBg"
|
733
|
+
onClick={() => props.setScreen("buy-with-crypto")}
|
734
|
+
style={{
|
735
|
+
justifyContent: "flex-start",
|
736
|
+
}}
|
737
|
+
gap="sm"
|
738
|
+
>
|
739
|
+
<Container color="secondaryText" flex="row" center="both">
|
740
|
+
<CoinsIcon size={iconSize.md} />
|
741
|
+
</Container>
|
742
|
+
|
743
|
+
<Container flex="column" gap="xxs">
|
744
|
+
<Text size="md" color="primaryText">
|
745
|
+
Crypto
|
746
|
+
</Text>
|
747
|
+
<Text size="xs">Pay with confidence using crypto</Text>
|
748
|
+
</Container>
|
749
|
+
</Button>
|
750
|
+
</Container>
|
551
751
|
</Container>
|
552
752
|
);
|
553
753
|
}
|
554
754
|
|
555
|
-
function SwapScreenContent(
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
755
|
+
function SwapScreenContent(props: {
|
756
|
+
setDrawerScreen: (screen: React.ReactNode) => void;
|
757
|
+
setScreen: (screen: SelectedScreen) => void;
|
758
|
+
tokenAmount: string;
|
759
|
+
toToken: ERC20OrNativeToken;
|
760
|
+
toChain: Chain;
|
761
|
+
fromChain: Chain;
|
762
|
+
fromToken: ERC20OrNativeToken;
|
763
|
+
showFromTokenSelector: () => void;
|
764
|
+
account: Account;
|
765
|
+
activeChain: Chain;
|
766
|
+
client: ThirdwebClient;
|
767
|
+
payOptions: PayUIOptions;
|
768
|
+
buyForTx: BuyForTx | null;
|
769
|
+
isEmbed: boolean;
|
770
|
+
onViewPendingTx: () => void;
|
771
|
+
onDone: () => void;
|
772
|
+
}) {
|
569
773
|
const {
|
570
774
|
setDrawerScreen,
|
571
775
|
setScreen,
|
@@ -646,7 +850,7 @@ function SwapScreenContent(
|
|
646
850
|
}
|
647
851
|
|
648
852
|
setScreen({
|
649
|
-
|
853
|
+
id: "node",
|
650
854
|
node: (
|
651
855
|
<SwapFlow
|
652
856
|
isBuyForTx={!!props.buyForTx}
|
@@ -654,7 +858,7 @@ function SwapScreenContent(
|
|
654
858
|
client={client}
|
655
859
|
onBack={() => {
|
656
860
|
setScreen({
|
657
|
-
|
861
|
+
id: "buy-with-crypto",
|
658
862
|
});
|
659
863
|
}}
|
660
864
|
buyWithCryptoQuote={quoteQuery.data}
|
@@ -664,7 +868,7 @@ function SwapScreenContent(
|
|
664
868
|
onDone={props.onDone}
|
665
869
|
onTryAgain={() => {
|
666
870
|
setScreen({
|
667
|
-
|
871
|
+
id: "buy-with-crypto",
|
668
872
|
});
|
669
873
|
quoteQuery.refetch();
|
670
874
|
}}
|
@@ -695,7 +899,7 @@ function SwapScreenContent(
|
|
695
899
|
: undefined;
|
696
900
|
|
697
901
|
return (
|
698
|
-
<Container
|
902
|
+
<Container flex="column" gap="md" animate="fadein">
|
699
903
|
{/* Quote info */}
|
700
904
|
<div>
|
701
905
|
<PayWithCrypto
|
@@ -749,8 +953,8 @@ function SwapScreenContent(
|
|
749
953
|
<Text color="danger">Not Enough Funds</Text>
|
750
954
|
) : quoteQuery.isLoading ? (
|
751
955
|
<>
|
752
|
-
<Spinner size="sm" color="accentText" />
|
753
956
|
Getting price quote
|
957
|
+
<Spinner size="sm" color="accentText" />
|
754
958
|
</>
|
755
959
|
) : (
|
756
960
|
"Continue"
|
@@ -761,19 +965,23 @@ function SwapScreenContent(
|
|
761
965
|
);
|
762
966
|
}
|
763
967
|
|
764
|
-
function FiatScreenContent(
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
968
|
+
function FiatScreenContent(props: {
|
969
|
+
setDrawerScreen: (screen: React.ReactNode) => void;
|
970
|
+
setScreen: (screen: SelectedScreen) => void;
|
971
|
+
tokenAmount: string;
|
972
|
+
toToken: ERC20OrNativeToken;
|
973
|
+
toChain: Chain;
|
974
|
+
selectedCurrency: CurrencyMeta;
|
975
|
+
showCurrencySelector: () => void;
|
976
|
+
account: Account;
|
977
|
+
payOptions: PayUIOptions;
|
978
|
+
theme: "light" | "dark" | Theme;
|
979
|
+
buyForTx: BuyForTx | null;
|
980
|
+
client: ThirdwebClient;
|
981
|
+
onViewPendingTx: () => void;
|
982
|
+
onDone: () => void;
|
983
|
+
isEmbed: boolean;
|
984
|
+
}) {
|
777
985
|
const {
|
778
986
|
toToken,
|
779
987
|
tokenAmount,
|
@@ -827,14 +1035,14 @@ function FiatScreenContent(
|
|
827
1035
|
}
|
828
1036
|
|
829
1037
|
setScreen({
|
830
|
-
|
1038
|
+
id: "node",
|
831
1039
|
node: (
|
832
1040
|
<FiatFlow
|
833
1041
|
isBuyForTx={!!props.buyForTx}
|
834
1042
|
quote={fiatQuoteQuery.data}
|
835
1043
|
onBack={() => {
|
836
1044
|
setScreen({
|
837
|
-
|
1045
|
+
id: "buy-with-fiat",
|
838
1046
|
});
|
839
1047
|
}}
|
840
1048
|
client={client}
|
@@ -899,8 +1107,7 @@ function FiatScreenContent(
|
|
899
1107
|
const disableSubmit = !fiatQuoteQuery.data;
|
900
1108
|
|
901
1109
|
return (
|
902
|
-
<Container
|
903
|
-
{/* Show Calculated Fiat Amount */}
|
1110
|
+
<Container flex="column" gap="md" animate="fadein">
|
904
1111
|
<div>
|
905
1112
|
<PayWithCreditCard
|
906
1113
|
isLoading={fiatQuoteQuery.isLoading}
|
@@ -939,8 +1146,8 @@ function FiatScreenContent(
|
|
939
1146
|
>
|
940
1147
|
{fiatQuoteQuery.isLoading ? (
|
941
1148
|
<>
|
942
|
-
<Spinner size="sm" color="accentText" />
|
943
1149
|
Getting price quote
|
1150
|
+
<Spinner size="sm" color="accentText" />
|
944
1151
|
</>
|
945
1152
|
) : (
|
946
1153
|
"Continue"
|
@@ -1020,7 +1227,7 @@ function BuyForTxUI(props: {
|
|
1020
1227
|
|
1021
1228
|
<Spacer y="md" />
|
1022
1229
|
<Line />
|
1023
|
-
<Spacer y="
|
1230
|
+
<Spacer y="xl" />
|
1024
1231
|
|
1025
1232
|
<Text center size="sm">
|
1026
1233
|
Purchase
|
@@ -1077,7 +1284,7 @@ function createSupportedTokens(
|
|
1077
1284
|
}
|
1078
1285
|
|
1079
1286
|
function ChainSelectionScreen(props: {
|
1080
|
-
|
1287
|
+
goBack: () => void;
|
1081
1288
|
chains: Chain[];
|
1082
1289
|
client: ThirdwebClient;
|
1083
1290
|
connectLocale: ConnectLocale;
|
@@ -1088,9 +1295,9 @@ function ChainSelectionScreen(props: {
|
|
1088
1295
|
client={props.client}
|
1089
1296
|
connectLocale={props.connectLocale}
|
1090
1297
|
showTabs={false}
|
1091
|
-
onBack={props.
|
1298
|
+
onBack={props.goBack}
|
1092
1299
|
chains={props.chains}
|
1093
|
-
closeModal={props.
|
1300
|
+
closeModal={props.goBack}
|
1094
1301
|
networkSelector={{
|
1095
1302
|
renderChain(renderChainProps) {
|
1096
1303
|
return (
|
@@ -1100,7 +1307,7 @@ function ChainSelectionScreen(props: {
|
|
1100
1307
|
switchingFailed={false}
|
1101
1308
|
onClick={() => {
|
1102
1309
|
props.setChain(renderChainProps.chain);
|
1103
|
-
props.
|
1310
|
+
props.goBack();
|
1104
1311
|
}}
|
1105
1312
|
client={props.client}
|
1106
1313
|
connectLocale={props.connectLocale}
|