thirdweb 5.31.1 → 5.32.0
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 +4 -4
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/exports/react.native.js +14 -6
- package/dist/cjs/exports/react.native.js.map +1 -1
- package/dist/cjs/exports/wallets/in-app.js +1 -1
- package/dist/cjs/exports/wallets/in-app.js.map +1 -1
- package/dist/cjs/pay/utils/definitions.js +17 -10
- package/dist/cjs/pay/utils/definitions.js.map +1 -1
- package/dist/cjs/react/core/hooks/connection/ConnectButtonProps.js.map +1 -0
- package/dist/cjs/react/core/hooks/connection/ConnectEmbedProps.js +3 -0
- package/dist/cjs/react/core/hooks/connection/ConnectEmbedProps.js.map +1 -0
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSendToken.js +81 -0
- package/dist/cjs/react/core/hooks/wallets/useSendToken.js.map +1 -0
- package/dist/cjs/react/{web/ui/ConnectWallet → core/utils}/defaultTokens.js +20 -25
- package/dist/cjs/react/core/utils/defaultTokens.js.map +1 -0
- package/dist/cjs/react/core/utils/isSmartWallet.js.map +1 -0
- package/dist/cjs/react/{web/ui/ConnectWallet/icons/dataUris.js → core/utils/socialIcons.js} +19 -2
- package/dist/cjs/react/core/utils/socialIcons.js.map +1 -0
- package/dist/cjs/react/core/utils/storage.js.map +1 -0
- package/dist/cjs/react/core/utils/wallet.js +85 -0
- package/dist/cjs/react/core/utils/wallet.js.map +1 -0
- package/dist/cjs/react/native/design-system/index.js +33 -0
- package/dist/cjs/react/native/design-system/index.js.map +1 -0
- package/dist/cjs/react/native/hooks/wallets/useAutoConnect.js +5 -1
- package/dist/cjs/react/native/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/cjs/react/native/hooks/wallets/useSendToken.js +31 -0
- package/dist/cjs/react/native/hooks/wallets/useSendToken.js.map +1 -0
- package/dist/cjs/react/native/ui/components/Address.js +31 -0
- package/dist/cjs/react/native/ui/components/Address.js.map +1 -0
- package/dist/cjs/react/native/ui/components/ChainIcon.js +30 -0
- package/dist/cjs/react/native/ui/components/ChainIcon.js.map +1 -0
- package/dist/cjs/react/native/ui/components/Header.js +30 -0
- package/dist/cjs/react/native/ui/components/Header.js.map +1 -0
- package/dist/cjs/react/native/ui/components/RNImage.js +43 -0
- package/dist/cjs/react/native/ui/components/RNImage.js.map +1 -0
- package/dist/cjs/react/native/ui/components/Skeleton.js +62 -0
- package/dist/cjs/react/native/ui/components/Skeleton.js.map +1 -0
- package/dist/cjs/react/native/ui/components/TokenIcon.js +16 -0
- package/dist/cjs/react/native/ui/components/TokenIcon.js.map +1 -0
- package/dist/cjs/react/native/ui/components/WalletImage.js +69 -0
- package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -0
- package/dist/cjs/react/native/ui/components/button.js +23 -8
- package/dist/cjs/react/native/ui/components/button.js.map +1 -1
- package/dist/cjs/react/native/ui/components/input.js +64 -0
- package/dist/cjs/react/native/ui/components/input.js.map +1 -0
- package/dist/cjs/react/native/ui/components/spacer.js +10 -0
- package/dist/cjs/react/native/ui/components/spacer.js.map +1 -0
- package/dist/cjs/react/native/ui/components/text.js +10 -7
- package/dist/cjs/react/native/ui/components/text.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectButton.js +106 -0
- package/dist/cjs/react/native/ui/connect/ConnectButton.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/ConnectModal.js +133 -0
- package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/ConnectedButton.js +42 -0
- package/dist/cjs/react/native/ui/connect/ConnectedButton.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/ConnectedModal.js +175 -0
- package/dist/cjs/react/native/ui/connect/ConnectedModal.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/ErrorView.js +25 -0
- package/dist/cjs/react/native/ui/connect/ErrorView.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/ExternalWalletsList.js +67 -0
- package/dist/cjs/react/native/ui/connect/ExternalWalletsList.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/InAppWalletUI.js +167 -0
- package/dist/cjs/react/native/ui/connect/InAppWalletUI.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/ReceiveScreen.js +42 -0
- package/dist/cjs/react/native/ui/connect/ReceiveScreen.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/SendScreen.js +82 -0
- package/dist/cjs/react/native/ui/connect/SendScreen.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/SuccessView.js +25 -0
- package/dist/cjs/react/native/ui/connect/SuccessView.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/TokenListScreen.js +59 -0
- package/dist/cjs/react/native/ui/connect/TokenListScreen.js.map +1 -0
- package/dist/cjs/react/native/ui/icons/svgs.js +236 -0
- package/dist/cjs/react/native/ui/icons/svgs.js.map +1 -0
- package/dist/cjs/react/native/ui/{TransactionButton/TrabsactionButton.js → transaction/TransactionButton.js} +1 -1
- package/dist/cjs/react/native/ui/transaction/TransactionButton.js.map +1 -0
- package/dist/cjs/react/native/wallets/defaultWallets.js +22 -0
- package/dist/cjs/react/native/wallets/defaultWallets.js.map +1 -0
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/hooks/wallets/useAutoConnect.js +7 -2
- package/dist/cjs/react/web/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/cjs/react/web/hooks/wallets/useSendToken.js +31 -0
- package/dist/cjs/react/web/hooks/wallets/useSendToken.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +7 -51
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +2 -8
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +0 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- 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/PayWithCrypto.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js +4 -15
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewFunds.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewFunds.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/components/ChainIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/components/TokenIcon.js +2 -2
- package/dist/cjs/react/web/ui/components/TokenIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/components/WalletImage.js +12 -13
- package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletHeader.js +2 -2
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletHeader.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +8 -4
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +5 -6
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +1 -1
- package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +1 -1
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/SocialLogin.js +1 -1
- package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js +3 -4
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/manager/index.js +3 -2
- package/dist/cjs/wallets/manager/index.js.map +1 -1
- package/dist/esm/exports/react.js +4 -3
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/react.native.js +6 -2
- package/dist/esm/exports/react.native.js.map +1 -1
- package/dist/esm/exports/wallets/in-app.js +1 -1
- package/dist/esm/exports/wallets/in-app.js.map +1 -1
- package/dist/esm/pay/utils/definitions.js +15 -9
- package/dist/esm/pay/utils/definitions.js.map +1 -1
- package/dist/esm/react/core/hooks/connection/ConnectButtonProps.js.map +1 -0
- package/dist/esm/react/core/hooks/connection/ConnectEmbedProps.js +2 -0
- package/dist/esm/react/core/hooks/connection/ConnectEmbedProps.js.map +1 -0
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSendToken.js +78 -0
- package/dist/esm/react/core/hooks/wallets/useSendToken.js.map +1 -0
- package/dist/esm/react/{web/ui/ConnectWallet → core/utils}/defaultTokens.js +10 -15
- package/dist/esm/react/core/utils/defaultTokens.js.map +1 -0
- package/dist/esm/react/core/utils/isSmartWallet.js.map +1 -0
- package/dist/esm/react/{web/ui/ConnectWallet/icons/dataUris.js → core/utils/socialIcons.js} +18 -1
- package/dist/esm/react/core/utils/socialIcons.js.map +1 -0
- package/dist/esm/react/core/utils/storage.js.map +1 -0
- package/dist/esm/react/core/utils/wallet.js +80 -0
- package/dist/esm/react/core/utils/wallet.js.map +1 -0
- package/dist/esm/react/native/design-system/index.js +30 -0
- package/dist/esm/react/native/design-system/index.js.map +1 -0
- package/dist/esm/react/native/hooks/wallets/useAutoConnect.js +5 -1
- package/dist/esm/react/native/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/esm/react/native/hooks/wallets/useSendToken.js +28 -0
- package/dist/esm/react/native/hooks/wallets/useSendToken.js.map +1 -0
- package/dist/esm/react/native/ui/components/Address.js +27 -0
- package/dist/esm/react/native/ui/components/Address.js.map +1 -0
- package/dist/esm/react/native/ui/components/ChainIcon.js +26 -0
- package/dist/esm/react/native/ui/components/ChainIcon.js.map +1 -0
- package/dist/esm/react/native/ui/components/Header.js +27 -0
- package/dist/esm/react/native/ui/components/Header.js.map +1 -0
- package/dist/esm/react/native/ui/components/RNImage.js +39 -0
- package/dist/esm/react/native/ui/components/RNImage.js.map +1 -0
- package/dist/esm/react/native/ui/components/Skeleton.js +58 -0
- package/dist/esm/react/native/ui/components/Skeleton.js.map +1 -0
- package/dist/esm/react/native/ui/components/TokenIcon.js +13 -0
- package/dist/esm/react/native/ui/components/TokenIcon.js.map +1 -0
- package/dist/esm/react/native/ui/components/WalletImage.js +65 -0
- package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -0
- package/dist/esm/react/native/ui/components/button.js +24 -10
- package/dist/esm/react/native/ui/components/button.js.map +1 -1
- package/dist/esm/react/native/ui/components/input.js +60 -0
- package/dist/esm/react/native/ui/components/input.js.map +1 -0
- package/dist/esm/react/native/ui/components/spacer.js +7 -0
- package/dist/esm/react/native/ui/components/spacer.js.map +1 -0
- package/dist/esm/react/native/ui/components/text.js +10 -7
- package/dist/esm/react/native/ui/components/text.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectButton.js +103 -0
- package/dist/esm/react/native/ui/connect/ConnectButton.js.map +1 -0
- package/dist/esm/react/native/ui/connect/ConnectModal.js +129 -0
- package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -0
- package/dist/esm/react/native/ui/connect/ConnectedButton.js +39 -0
- package/dist/esm/react/native/ui/connect/ConnectedButton.js.map +1 -0
- package/dist/esm/react/native/ui/connect/ConnectedModal.js +172 -0
- package/dist/esm/react/native/ui/connect/ConnectedModal.js.map +1 -0
- package/dist/esm/react/native/ui/connect/ErrorView.js +21 -0
- package/dist/esm/react/native/ui/connect/ErrorView.js.map +1 -0
- package/dist/esm/react/native/ui/connect/ExternalWalletsList.js +64 -0
- package/dist/esm/react/native/ui/connect/ExternalWalletsList.js.map +1 -0
- package/dist/esm/react/native/ui/connect/InAppWalletUI.js +163 -0
- package/dist/esm/react/native/ui/connect/InAppWalletUI.js.map +1 -0
- package/dist/esm/react/native/ui/connect/ReceiveScreen.js +38 -0
- package/dist/esm/react/native/ui/connect/ReceiveScreen.js.map +1 -0
- package/dist/esm/react/native/ui/connect/SendScreen.js +78 -0
- package/dist/esm/react/native/ui/connect/SendScreen.js.map +1 -0
- package/dist/esm/react/native/ui/connect/SuccessView.js +21 -0
- package/dist/esm/react/native/ui/connect/SuccessView.js.map +1 -0
- package/dist/esm/react/native/ui/connect/TokenListScreen.js +54 -0
- package/dist/esm/react/native/ui/connect/TokenListScreen.js.map +1 -0
- package/dist/esm/react/native/ui/icons/svgs.js +233 -0
- package/dist/esm/react/native/ui/icons/svgs.js.map +1 -0
- package/dist/esm/react/native/ui/{TransactionButton/TrabsactionButton.js → transaction/TransactionButton.js} +1 -1
- package/dist/esm/react/native/ui/transaction/TransactionButton.js.map +1 -0
- package/dist/esm/react/native/wallets/defaultWallets.js +19 -0
- package/dist/esm/react/native/wallets/defaultWallets.js.map +1 -0
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/hooks/wallets/useAutoConnect.js +7 -2
- package/dist/esm/react/web/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/esm/react/web/hooks/wallets/useSendToken.js +28 -0
- package/dist/esm/react/web/hooks/wallets/useSendToken.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +7 -51
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +2 -8
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +1 -5
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- 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/PayWithCrypto.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js +5 -16
- package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewFunds.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewFunds.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/components/ChainIcon.js.map +1 -1
- package/dist/esm/react/web/ui/components/TokenIcon.js +1 -1
- package/dist/esm/react/web/ui/components/WalletImage.js +3 -4
- package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletHeader.js +1 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletHeader.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +8 -4
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +2 -3
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +1 -1
- package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +1 -1
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/SocialLogin.js +1 -1
- package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js +3 -4
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/manager/index.js +3 -2
- package/dist/esm/wallets/manager/index.js.map +1 -1
- package/dist/types/exports/react.d.ts +7 -6
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +7 -2
- package/dist/types/exports/react.native.d.ts.map +1 -1
- package/dist/types/exports/wallets/in-app.d.ts +1 -1
- package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
- package/dist/types/pay/utils/definitions.d.ts +1 -0
- package/dist/types/pay/utils/definitions.d.ts.map +1 -1
- package/dist/types/react/{web/ui/ConnectWallet → core/hooks/connection}/ConnectButtonProps.d.ts +6 -6
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -0
- package/dist/types/react/core/hooks/connection/ConnectEmbedProps.d.ts +264 -0
- package/dist/types/react/core/hooks/connection/ConnectEmbedProps.d.ts.map +1 -0
- package/dist/types/react/core/hooks/connection/types.d.ts +1 -1
- package/dist/types/react/core/hooks/connection/types.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useAutoConnect.d.ts +3 -1
- package/dist/types/react/core/hooks/wallets/useAutoConnect.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useSendToken.d.ts +12 -0
- package/dist/types/react/core/hooks/wallets/useSendToken.d.ts.map +1 -0
- package/dist/types/react/{web/ui/ConnectWallet → core/utils}/defaultTokens.d.ts +1 -0
- package/dist/types/react/core/utils/defaultTokens.d.ts.map +1 -0
- package/dist/types/react/core/utils/isSmartWallet.d.ts.map +1 -0
- package/dist/types/react/{web/ui/ConnectWallet/icons/dataUris.d.ts → core/utils/socialIcons.d.ts} +17 -1
- package/dist/types/react/core/utils/socialIcons.d.ts.map +1 -0
- package/dist/types/react/core/utils/storage.d.ts +5 -0
- package/dist/types/react/core/utils/storage.d.ts.map +1 -0
- package/dist/types/react/core/utils/wallet.d.ts +26 -0
- package/dist/types/react/core/utils/wallet.d.ts.map +1 -0
- package/dist/types/react/native/design-system/index.d.ts +30 -0
- package/dist/types/react/native/design-system/index.d.ts.map +1 -0
- package/dist/types/react/native/hooks/wallets/useAutoConnect.d.ts.map +1 -1
- package/dist/types/react/{web/ui/hooks → native/hooks/wallets}/useSendToken.d.ts +18 -1
- package/dist/types/react/native/hooks/wallets/useSendToken.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/Address.d.ts +9 -0
- package/dist/types/react/native/ui/components/Address.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/ChainIcon.d.ts +11 -0
- package/dist/types/react/native/ui/components/ChainIcon.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/Header.d.ts +10 -0
- package/dist/types/react/native/ui/components/Header.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/RNImage.d.ts +10 -0
- package/dist/types/react/native/ui/components/RNImage.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/Skeleton.d.ts +11 -0
- package/dist/types/react/native/ui/components/Skeleton.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/TokenIcon.d.ts +15 -0
- package/dist/types/react/native/ui/components/TokenIcon.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/WalletImage.d.ts +9 -0
- package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/button.d.ts +5 -1
- package/dist/types/react/native/ui/components/button.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/input.d.ts +12 -0
- package/dist/types/react/native/ui/components/input.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/spacer.d.ts +5 -0
- package/dist/types/react/native/ui/components/spacer.d.ts.map +1 -0
- package/dist/types/react/native/ui/components/text.d.ts +1 -1
- package/dist/types/react/native/ui/components/text.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectButton.d.ts +18 -0
- package/dist/types/react/native/ui/connect/ConnectButton.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts +40 -0
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/ConnectedButton.d.ts +9 -0
- package/dist/types/react/native/ui/connect/ConnectedButton.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/ConnectedModal.d.ts +14 -0
- package/dist/types/react/native/ui/connect/ConnectedModal.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/ErrorView.d.ts +7 -0
- package/dist/types/react/native/ui/connect/ErrorView.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/ExternalWalletsList.d.ts +15 -0
- package/dist/types/react/native/ui/connect/ExternalWalletsList.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts +19 -0
- package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts +13 -0
- package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/SendScreen.d.ts +14 -0
- package/dist/types/react/native/ui/connect/SendScreen.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/SuccessView.d.ts +7 -0
- package/dist/types/react/native/ui/connect/SuccessView.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/TokenListScreen.d.ts +20 -0
- package/dist/types/react/native/ui/connect/TokenListScreen.d.ts.map +1 -0
- package/dist/types/react/native/ui/icons/svgs.d.ts +22 -0
- package/dist/types/react/native/ui/icons/svgs.d.ts.map +1 -0
- package/dist/types/react/native/ui/{TransactionButton/TrabsactionButton.d.ts → transaction/TransactionButton.d.ts} +1 -1
- package/dist/types/react/native/ui/transaction/TransactionButton.d.ts.map +1 -0
- package/dist/types/react/native/wallets/defaultWallets.d.ts +11 -0
- package/dist/types/react/native/wallets/defaultWallets.d.ts.map +1 -0
- 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/hooks/wallets/useSendToken.d.ts +28 -0
- package/dist/types/react/web/hooks/wallets/useSendToken.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- 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 +1 -267
- 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/WalletEntryButton.d.ts.map +1 -1
- 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 +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts +1 -1
- 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 +1 -1
- 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/PayWithCrypto.d.ts +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/SendFunds.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/SendFunds.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewFunds.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewFunds.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/nativeToken.d.ts +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 +2 -2
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/ChainIcon.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
- package/dist/types/wallets/manager/index.d.ts +1 -0
- package/dist/types/wallets/manager/index.d.ts.map +1 -1
- package/package.json +19 -3
- package/src/exports/react.native.ts +19 -5
- package/src/exports/react.ts +7 -12
- package/src/exports/wallets/in-app.ts +1 -1
- package/src/pay/utils/definitions.ts +16 -9
- package/src/react/{web/ui/ConnectWallet → core/hooks/connection}/ConnectButtonProps.ts +7 -10
- package/src/react/core/hooks/connection/ConnectEmbedProps.ts +285 -0
- package/src/react/core/hooks/connection/types.ts +1 -1
- package/src/react/core/hooks/transaction/useSendTransaction.ts +1 -1
- package/src/react/core/hooks/wallets/useAutoConnect.ts +1 -1
- package/src/react/core/hooks/wallets/useSendToken.ts +94 -0
- package/src/react/{web/ui/ConnectWallet → core/utils}/defaultTokens.ts +10 -15
- package/src/react/{web/ui/ConnectWallet/icons/dataUris.ts → core/utils/socialIcons.ts} +30 -0
- package/src/react/{web/wallets/shared → core/utils}/storage.ts +2 -2
- package/src/react/core/utils/wallet.ts +101 -0
- package/src/react/native/design-system/index.ts +31 -0
- package/src/react/native/hooks/wallets/useAutoConnect.ts +5 -1
- package/src/react/native/hooks/wallets/useSendToken.ts +29 -0
- package/src/react/native/ui/components/Address.tsx +52 -0
- package/src/react/native/ui/components/ChainIcon.tsx +42 -0
- package/src/react/native/ui/components/Header.tsx +84 -0
- package/src/react/native/ui/components/RNImage.tsx +71 -0
- package/src/react/native/ui/components/Skeleton.tsx +93 -0
- package/src/react/native/ui/components/TokenIcon.tsx +31 -0
- package/src/react/native/ui/components/WalletImage.tsx +81 -0
- package/src/react/native/ui/components/button.tsx +41 -9
- package/src/react/native/ui/components/input.tsx +128 -0
- package/src/react/native/ui/components/spacer.tsx +6 -0
- package/src/react/native/ui/components/text.tsx +17 -8
- package/src/react/native/ui/connect/ConnectButton.tsx +188 -0
- package/src/react/native/ui/connect/ConnectModal.tsx +301 -0
- package/src/react/native/ui/connect/ConnectedButton.tsx +94 -0
- package/src/react/native/ui/connect/ConnectedModal.tsx +434 -0
- package/src/react/native/ui/connect/ErrorView.tsx +44 -0
- package/src/react/native/ui/connect/ExternalWalletsList.tsx +162 -0
- package/src/react/native/ui/connect/InAppWalletUI.tsx +320 -0
- package/src/react/native/ui/connect/ReceiveScreen.tsx +81 -0
- package/src/react/native/ui/connect/SendScreen.tsx +238 -0
- package/src/react/native/ui/connect/SuccessView.tsx +44 -0
- package/src/react/native/ui/connect/TokenListScreen.tsx +147 -0
- package/src/react/native/ui/icons/svgs.ts +252 -0
- package/src/react/native/wallets/defaultWallets.ts +30 -0
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +2 -2
- package/src/react/web/hooks/wallets/useAutoConnect.ts +18 -8
- package/src/react/web/hooks/wallets/useSendToken.ts +29 -0
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/Details.tsx +26 -78
- package/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx +2 -9
- package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +6 -285
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx +8 -21
- package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/ViewFunds.tsx +4 -1
- package/src/react/web/ui/ConnectWallet/screens/nativeToken.ts +1 -1
- package/src/react/web/ui/PayEmbed.tsx +3 -3
- package/src/react/web/ui/components/ChainIcon.tsx +0 -1
- package/src/react/web/ui/components/TokenIcon.tsx +1 -1
- package/src/react/web/ui/components/WalletImage.tsx +7 -9
- package/src/react/web/wallets/ecosystem/EcosystemWalletHeader.tsx +1 -1
- package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +8 -4
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +6 -6
- package/src/react/web/wallets/shared/OTPLoginUI.tsx +1 -1
- package/src/react/web/wallets/shared/PassKeyLogin.tsx +1 -1
- package/src/react/web/wallets/shared/SocialLogin.tsx +1 -1
- package/src/version.ts +1 -1
- package/src/wallets/in-app/native/native-connector.ts +4 -6
- package/src/wallets/manager/index.ts +4 -2
- package/dist/cjs/react/native/ui/TransactionButton/TrabsactionButton.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButtonProps.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/defaultTokens.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/dataUris.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/socialLogins.js +0 -15
- package/dist/cjs/react/web/ui/ConnectWallet/icons/socialLogins.js.map +0 -1
- package/dist/cjs/react/web/ui/hooks/useSendToken.js +0 -57
- package/dist/cjs/react/web/ui/hooks/useSendToken.js.map +0 -1
- package/dist/cjs/react/web/ui/hooks/useWalletInfo.js +0 -37
- package/dist/cjs/react/web/ui/hooks/useWalletInfo.js.map +0 -1
- package/dist/cjs/react/web/utils/isSmartWallet.js.map +0 -1
- package/dist/cjs/react/web/wallets/in-app/socialIcons.js +0 -10
- package/dist/cjs/react/web/wallets/in-app/socialIcons.js.map +0 -1
- package/dist/cjs/react/web/wallets/shared/storage.js.map +0 -1
- package/dist/esm/react/native/ui/TransactionButton/TrabsactionButton.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButtonProps.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/defaultTokens.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/dataUris.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/socialLogins.js +0 -12
- package/dist/esm/react/web/ui/ConnectWallet/icons/socialLogins.js.map +0 -1
- package/dist/esm/react/web/ui/hooks/useSendToken.js +0 -54
- package/dist/esm/react/web/ui/hooks/useSendToken.js.map +0 -1
- package/dist/esm/react/web/ui/hooks/useWalletInfo.js +0 -33
- package/dist/esm/react/web/ui/hooks/useWalletInfo.js.map +0 -1
- package/dist/esm/react/web/utils/isSmartWallet.js.map +0 -1
- package/dist/esm/react/web/wallets/in-app/socialIcons.js +0 -7
- package/dist/esm/react/web/wallets/in-app/socialIcons.js.map +0 -1
- package/dist/esm/react/web/wallets/shared/storage.js.map +0 -1
- package/dist/types/react/native/ui/TransactionButton/TrabsactionButton.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButtonProps.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/defaultTokens.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/icons/dataUris.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/icons/socialLogins.d.ts +0 -12
- package/dist/types/react/web/ui/ConnectWallet/icons/socialLogins.d.ts.map +0 -1
- package/dist/types/react/web/ui/hooks/useSendToken.d.ts.map +0 -1
- package/dist/types/react/web/ui/hooks/useWalletInfo.d.ts +0 -13
- package/dist/types/react/web/ui/hooks/useWalletInfo.d.ts.map +0 -1
- package/dist/types/react/web/utils/isSmartWallet.d.ts.map +0 -1
- package/dist/types/react/web/wallets/in-app/socialIcons.d.ts +0 -6
- package/dist/types/react/web/wallets/in-app/socialIcons.d.ts.map +0 -1
- package/dist/types/react/web/wallets/shared/storage.d.ts +0 -5
- package/dist/types/react/web/wallets/shared/storage.d.ts.map +0 -1
- package/src/react/web/ui/ConnectWallet/icons/socialLogins.ts +0 -22
- package/src/react/web/ui/hooks/useSendToken.ts +0 -66
- package/src/react/web/ui/hooks/useWalletInfo.ts +0 -37
- package/src/react/web/wallets/in-app/socialIcons.ts +0 -11
- /package/dist/cjs/react/{web/ui/ConnectWallet → core/hooks/connection}/ConnectButtonProps.js +0 -0
- /package/dist/cjs/react/{web → core}/utils/isSmartWallet.js +0 -0
- /package/dist/cjs/react/{web/wallets/shared → core/utils}/storage.js +0 -0
- /package/dist/esm/react/{web/ui/ConnectWallet → core/hooks/connection}/ConnectButtonProps.js +0 -0
- /package/dist/esm/react/{web → core}/utils/isSmartWallet.js +0 -0
- /package/dist/esm/react/{web/wallets/shared → core/utils}/storage.js +0 -0
- /package/dist/types/react/{web → core}/utils/isSmartWallet.d.ts +0 -0
- /package/src/react/{web → core}/utils/isSmartWallet.ts +0 -0
- /package/src/react/native/ui/{TransactionButton/TrabsactionButton.tsx → transaction/TransactionButton.tsx} +0 -0
@@ -10,12 +10,9 @@ import {
|
|
10
10
|
} from "@radix-ui/react-icons";
|
11
11
|
import { useQuery } from "@tanstack/react-query";
|
12
12
|
import { useContext, useEffect, useState } from "react";
|
13
|
-
import { ethereum } from "../../../../chains/chain-definitions/ethereum.js";
|
14
13
|
import type { Chain } from "../../../../chains/types.js";
|
15
14
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
16
15
|
import { getContract } from "../../../../contract/contract.js";
|
17
|
-
import { resolveAvatar } from "../../../../extensions/ens/resolve-avatar.js";
|
18
|
-
import { resolveName } from "../../../../extensions/ens/resolve-name.js";
|
19
16
|
import { isContractDeployed } from "../../../../utils/bytecode/is-contract-deployed.js";
|
20
17
|
import type { Account, Wallet } from "../../../../wallets/interfaces/wallet.js";
|
21
18
|
import {
|
@@ -30,19 +27,25 @@ import {
|
|
30
27
|
radius,
|
31
28
|
spacing,
|
32
29
|
} from "../../../core/design-system/index.js";
|
30
|
+
import type {
|
31
|
+
ConnectButtonProps,
|
32
|
+
ConnectButton_detailsButtonOptions,
|
33
|
+
ConnectButton_detailsModalOptions,
|
34
|
+
PayUIOptions,
|
35
|
+
} from "../../../core/hooks/connection/ConnectButtonProps.js";
|
33
36
|
import {
|
34
37
|
useChainQuery,
|
35
38
|
useChainsQuery,
|
36
39
|
} from "../../../core/hooks/others/useChainQuery.js";
|
37
|
-
import { useWalletBalance } from "../../../core/hooks/others/useWalletBalance.js";
|
38
40
|
import { SetRootElementContext } from "../../../core/providers/RootElementContext.js";
|
39
|
-
import {
|
41
|
+
import type { SupportedTokens } from "../../../core/utils/defaultTokens.js";
|
42
|
+
import { hasSmartAccount } from "../../../core/utils/isSmartWallet.js";
|
43
|
+
import { useConnectedWalletDetails } from "../../../core/utils/wallet.js";
|
40
44
|
import { useActiveAccount } from "../../hooks/wallets/useActiveAccount.js";
|
41
45
|
import { useActiveWallet } from "../../hooks/wallets/useActiveWallet.js";
|
42
46
|
import { useActiveWalletChain } from "../../hooks/wallets/useActiveWalletChain.js";
|
43
47
|
import { useDisconnect } from "../../hooks/wallets/useDisconnect.js";
|
44
48
|
import { useSwitchActiveWalletChain } from "../../hooks/wallets/useSwitchActiveWalletChain.js";
|
45
|
-
import { hasSmartAccount } from "../../utils/isSmartWallet.js";
|
46
49
|
import { ChainIcon } from "../components/ChainIcon.js";
|
47
50
|
import { CopyIcon } from "../components/CopyIcon.js";
|
48
51
|
import { Img } from "../components/Img.js";
|
@@ -57,19 +60,12 @@ import { Link, Text } from "../components/text.js";
|
|
57
60
|
import { fadeInAnimation } from "../design-system/animations.js";
|
58
61
|
import { StyledButton } from "../design-system/elements.js";
|
59
62
|
import type { LocaleId } from "../types.js";
|
60
|
-
import type {
|
61
|
-
ConnectButtonProps,
|
62
|
-
ConnectButton_detailsButtonOptions,
|
63
|
-
ConnectButton_detailsModalOptions,
|
64
|
-
PayUIOptions,
|
65
|
-
} from "./ConnectButtonProps.js";
|
66
63
|
import { MenuButton, MenuLink } from "./MenuButton.js";
|
67
64
|
import {
|
68
65
|
NetworkSelectorContent,
|
69
66
|
type NetworkSelectorProps,
|
70
67
|
} from "./NetworkSelector.js";
|
71
68
|
import { onModalUnmount } from "./constants.js";
|
72
|
-
import type { SupportedTokens } from "./defaultTokens.js";
|
73
69
|
import { CoinsIcon } from "./icons/CoinsIcon.js";
|
74
70
|
import { FundsIcon } from "./icons/FundsIcon.js";
|
75
71
|
import { GenericWalletIcon } from "./icons/GenericWalletIcon.js";
|
@@ -113,14 +109,18 @@ export const ConnectedWalletDetails: React.FC<{
|
|
113
109
|
|
114
110
|
const setRootEl = useContext(SetRootElementContext);
|
115
111
|
const activeWallet = useActiveWallet();
|
112
|
+
const activeAccount = useActiveAccount();
|
116
113
|
const walletChain = useActiveWalletChain();
|
117
114
|
|
118
115
|
useChainsQuery(props.chains, 5);
|
119
116
|
|
120
|
-
const { ensAvatarQuery, addressOrENS, balanceQuery } =
|
121
|
-
|
122
|
-
|
123
|
-
|
117
|
+
const { ensAvatarQuery, addressOrENS, balanceQuery } =
|
118
|
+
useConnectedWalletDetails(
|
119
|
+
client,
|
120
|
+
walletChain,
|
121
|
+
activeAccount,
|
122
|
+
props.detailsButton?.displayBalanceToken,
|
123
|
+
);
|
124
124
|
|
125
125
|
function closeModal() {
|
126
126
|
setRootEl(null);
|
@@ -245,14 +245,17 @@ function DetailsModal(props: {
|
|
245
245
|
const [isOpen, setIsOpen] = useState(true);
|
246
246
|
|
247
247
|
const { client, locale } = props;
|
248
|
-
const
|
249
|
-
|
250
|
-
|
251
|
-
|
248
|
+
const walletChain = useActiveWalletChain();
|
249
|
+
const activeAccount = useActiveAccount();
|
250
|
+
const { ensAvatarQuery, addressOrENS, balanceQuery } =
|
251
|
+
useConnectedWalletDetails(
|
252
|
+
client,
|
253
|
+
walletChain,
|
254
|
+
activeAccount,
|
255
|
+
props.displayBalanceToken,
|
256
|
+
);
|
252
257
|
|
253
258
|
const activeWallet = useActiveWallet();
|
254
|
-
const activeAccount = useActiveAccount();
|
255
|
-
const walletChain = useActiveWalletChain();
|
256
259
|
const chainQuery = useChainQuery(walletChain);
|
257
260
|
|
258
261
|
const disableSwitchChain = !activeWallet?.switchChain;
|
@@ -1184,58 +1187,3 @@ export function useWalletDetailsModal() {
|
|
1184
1187
|
open: openModal,
|
1185
1188
|
};
|
1186
1189
|
}
|
1187
|
-
|
1188
|
-
function useWalletInfo(
|
1189
|
-
client: ThirdwebClient,
|
1190
|
-
displayBalanceToken?: Record<number, string>,
|
1191
|
-
) {
|
1192
|
-
const walletChain = useActiveWalletChain();
|
1193
|
-
|
1194
|
-
const tokenAddress =
|
1195
|
-
walletChain && displayBalanceToken
|
1196
|
-
? displayBalanceToken[Number(walletChain.id)]
|
1197
|
-
: undefined;
|
1198
|
-
|
1199
|
-
const activeAccount = useActiveAccount();
|
1200
|
-
const ensNameQuery = useQuery({
|
1201
|
-
queryKey: ["ens-name", activeAccount?.address],
|
1202
|
-
enabled: !!activeAccount?.address,
|
1203
|
-
queryFn: () =>
|
1204
|
-
resolveName({
|
1205
|
-
client,
|
1206
|
-
address: activeAccount?.address || "",
|
1207
|
-
resolverChain: ethereum,
|
1208
|
-
}),
|
1209
|
-
});
|
1210
|
-
|
1211
|
-
const ensAvatarQuery = useQuery({
|
1212
|
-
queryKey: ["ens-avatar", ensNameQuery.data],
|
1213
|
-
enabled: !!ensNameQuery.data,
|
1214
|
-
queryFn: async () =>
|
1215
|
-
resolveAvatar({
|
1216
|
-
client,
|
1217
|
-
name: ensNameQuery.data || "",
|
1218
|
-
}),
|
1219
|
-
});
|
1220
|
-
|
1221
|
-
const shortAddress = activeAccount?.address
|
1222
|
-
? shortenString(activeAccount.address, false)
|
1223
|
-
: "";
|
1224
|
-
|
1225
|
-
const balanceQuery = useWalletBalance({
|
1226
|
-
chain: walletChain ? walletChain : undefined,
|
1227
|
-
tokenAddress,
|
1228
|
-
address: activeAccount?.address,
|
1229
|
-
client,
|
1230
|
-
});
|
1231
|
-
|
1232
|
-
const addressOrENS = ensNameQuery.data || shortAddress;
|
1233
|
-
|
1234
|
-
return {
|
1235
|
-
ensNameQuery,
|
1236
|
-
ensAvatarQuery,
|
1237
|
-
addressOrENS,
|
1238
|
-
shortAddress,
|
1239
|
-
balanceQuery,
|
1240
|
-
};
|
1241
|
-
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
3
|
-
import { Suspense, lazy,
|
3
|
+
import { Suspense, lazy, useState } from "react";
|
4
4
|
import type { Chain } from "../../../../../chains/types.js";
|
5
5
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
6
6
|
import { isMobile } from "../../../../../utils/web/isMobile.js";
|
@@ -15,7 +15,7 @@ import { getInstalledWalletProviders } from "../../../../../wallets/injected/mip
|
|
15
15
|
import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
|
16
16
|
import type { EcosystemWalletId } from "../../../../../wallets/wallet-types.js";
|
17
17
|
import { iconSize } from "../../../../core/design-system/index.js";
|
18
|
-
import {
|
18
|
+
import { useWalletInfo } from "../../../../core/utils/wallet.js";
|
19
19
|
import EcosystemWalletConnectUI from "../../../wallets/ecosystem/EcosystemWalletConnectUI.js";
|
20
20
|
import { getInjectedWalletLocale } from "../../../wallets/injected/locale/getInjectedWalletLocale.js";
|
21
21
|
import { GetStartedScreen } from "../../../wallets/shared/GetStartedScreen.js";
|
@@ -27,7 +27,6 @@ import {
|
|
27
27
|
import { Spacer } from "../../components/Spacer.js";
|
28
28
|
import { Container, ModalHeader } from "../../components/basic.js";
|
29
29
|
import { Text } from "../../components/text.js";
|
30
|
-
import { useWalletInfo } from "../../hooks/useWalletInfo.js";
|
31
30
|
import type { LocaleId } from "../../types.js";
|
32
31
|
import { AccentFailIcon } from "../icons/AccentFailIcon.js";
|
33
32
|
import type { ConnectLocale } from "../locale/types.js";
|
@@ -71,12 +70,6 @@ export function AnyWalletConnectUI(props: {
|
|
71
70
|
const [screen, setScreen] = useState<"main" | "get-started">("main");
|
72
71
|
const { wallet } = props;
|
73
72
|
const walletInfo = useWalletInfo(props.wallet.id);
|
74
|
-
const setSelectionData = useSetSelectionData();
|
75
|
-
|
76
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: reset the selection data when the wallet changes
|
77
|
-
useEffect(() => {
|
78
|
-
setSelectionData({});
|
79
|
-
}, [wallet.id]);
|
80
73
|
|
81
74
|
const localeFnQuery = useQuery({
|
82
75
|
queryKey: ["injectedWalletLocale", props.localeId, walletInfo.data?.name],
|
@@ -4,14 +4,16 @@ import type { Chain } from "../../../../../chains/types.js";
|
|
4
4
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
5
5
|
import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
|
6
6
|
import type { SmartWalletOptions } from "../../../../../wallets/smart/types.js";
|
7
|
-
import type { AppMetadata } from "../../../../../wallets/types.js";
|
8
7
|
import {
|
9
8
|
CustomThemeProvider,
|
10
9
|
useCustomTheme,
|
11
10
|
} from "../../../../core/design-system/CustomThemeProvider.js";
|
12
|
-
import {
|
13
|
-
import
|
14
|
-
|
11
|
+
import { radius } from "../../../../core/design-system/index.js";
|
12
|
+
import {
|
13
|
+
type SiweAuthOptions,
|
14
|
+
useSiweAuth,
|
15
|
+
} from "../../../../core/hooks/auth/useSiweAuth.js";
|
16
|
+
import type { ConnectEmbedProps } from "../../../../core/hooks/connection/ConnectEmbedProps.js";
|
15
17
|
import { useActiveAccount } from "../../../hooks/wallets/useActiveAccount.js";
|
16
18
|
import { useActiveWallet } from "../../../hooks/wallets/useActiveWallet.js";
|
17
19
|
import { useIsAutoConnecting } from "../../../hooks/wallets/useIsAutoConnecting.js";
|
@@ -35,283 +37,6 @@ import type { ConnectLocale } from "../locale/types.js";
|
|
35
37
|
import { ConnectModalContent } from "./ConnectModalContent.js";
|
36
38
|
import { useSetupScreen } from "./screen.js";
|
37
39
|
|
38
|
-
export type ConnectEmbedProps = {
|
39
|
-
/**
|
40
|
-
* A client is the entry point to the thirdweb SDK.
|
41
|
-
* It is required for all other actions.
|
42
|
-
* You can create a client using the `createThirdwebClient` function. Refer to the [Creating a Client](https://portal.thirdweb.com/typescript/v5/client) documentation for more information.
|
43
|
-
*
|
44
|
-
* You must provide a `clientId` or `secretKey` in order to initialize a client. Pass `clientId` if you want for client-side usage and `secretKey` for server-side usage.
|
45
|
-
*
|
46
|
-
* ```tsx
|
47
|
-
* import { createThirdwebClient } from "thirdweb";
|
48
|
-
*
|
49
|
-
* const client = createThirdwebClient({
|
50
|
-
* clientId: "<your_client_id>",
|
51
|
-
* })
|
52
|
-
* ```
|
53
|
-
*/
|
54
|
-
client: ThirdwebClient;
|
55
|
-
|
56
|
-
/**
|
57
|
-
* Metadata of the app that will be passed to connected wallet. Setting this is highly recommended.
|
58
|
-
*
|
59
|
-
* Some wallets display this information to the user when they connect to your app.
|
60
|
-
* @example
|
61
|
-
* ```ts
|
62
|
-
* {
|
63
|
-
* name: "My App",
|
64
|
-
* url: "https://my-app.com",
|
65
|
-
* description: "some description about your app",
|
66
|
-
* logoUrl: "https://path/to/my-app/logo.svg",
|
67
|
-
* };
|
68
|
-
* ```
|
69
|
-
*/
|
70
|
-
appMetadata?: AppMetadata;
|
71
|
-
|
72
|
-
/**
|
73
|
-
* By default - ConnectEmbed UI uses the `en-US` locale for english language users.
|
74
|
-
*
|
75
|
-
* You can customize the language used in the ConnectEmbed UI by setting the `locale` prop.
|
76
|
-
*
|
77
|
-
* Refer to the [`LocaleId`](https://portal.thirdweb.com/references/typescript/v5/LocaleId) type for supported locales.
|
78
|
-
*/
|
79
|
-
locale?: LocaleId;
|
80
|
-
|
81
|
-
/**
|
82
|
-
* Array of supported wallets. If not provided, default wallets will be used.
|
83
|
-
* @example
|
84
|
-
* ```tsx
|
85
|
-
* import { AutoConnect } from "thirdweb/react";
|
86
|
-
* import { createWallet, inAppWallet } from "thirdweb/wallets";
|
87
|
-
*
|
88
|
-
* const wallets = [
|
89
|
-
* inAppWallet(),
|
90
|
-
* createWallet("io.metamask"),
|
91
|
-
* createWallet("com.coinbase.wallet"),
|
92
|
-
* createWallet("me.rainbow"),
|
93
|
-
* ];
|
94
|
-
*
|
95
|
-
* function Example() {
|
96
|
-
* return (
|
97
|
-
* <ConnectEmbed
|
98
|
-
* client={client}
|
99
|
-
* wallets={wallets}
|
100
|
-
* />
|
101
|
-
* )
|
102
|
-
* }
|
103
|
-
* ```
|
104
|
-
*
|
105
|
-
* If no wallets are specified. The component will show All the EIP-6963 compliant installed wallet extensions, as well as below default wallets:
|
106
|
-
*
|
107
|
-
* ```tsx
|
108
|
-
* const defaultWallets = [
|
109
|
-
* inAppWallet(),
|
110
|
-
* createWallet("io.metamask"),
|
111
|
-
* createWallet("com.coinbase.wallet"),
|
112
|
-
* createWallet("me.rainbow"),
|
113
|
-
* createWallet("io.zerion.wallet"),
|
114
|
-
* ]
|
115
|
-
* ```
|
116
|
-
*
|
117
|
-
* The `ConnectEmbed` also shows a "All wallets" button at the end of wallet list which allows user to connect to any of the 350+ wallets
|
118
|
-
*/
|
119
|
-
wallets?: Wallet[];
|
120
|
-
|
121
|
-
/**
|
122
|
-
* When the user has connected their wallet to your site, this configuration determines whether or not you want to automatically connect to the last connected wallet when user visits your site again in the future.
|
123
|
-
*
|
124
|
-
* By default it is set to `{ timeout: 15000 }` meaning that autoConnect is enabled and if the autoConnection does not succeed within 15 seconds, it will be cancelled.
|
125
|
-
*
|
126
|
-
* If you want to disable autoConnect, set this prop to `false`.
|
127
|
-
*
|
128
|
-
* If you want to customize the timeout, you can assign an object with a `timeout` key to this prop.
|
129
|
-
* ```tsx
|
130
|
-
* <ConnectEmbed client={client} autoConnect={{ timeout: 10000 }} />
|
131
|
-
* ```
|
132
|
-
*/
|
133
|
-
autoConnect?:
|
134
|
-
| {
|
135
|
-
timeout: number;
|
136
|
-
}
|
137
|
-
| boolean;
|
138
|
-
|
139
|
-
/**
|
140
|
-
* The [`Chain`](https://portal.thirdweb.com/references/typescript/v5/Chain) object of the blockchain you want the wallet to connect to
|
141
|
-
*
|
142
|
-
* If a `chain` is not specified, Wallet will be connected to whatever is the default set in the wallet.
|
143
|
-
*
|
144
|
-
* If a `chain` is specified, Wallet will be prompted to switch to given chain after connection if it is not already connected to it.
|
145
|
-
* This ensures that the wallet is connected to the correct blockchain before interacting with your app.
|
146
|
-
*
|
147
|
-
* You can create a `Chain` object using the [`defineChain`](https://portal.thirdweb.com/references/typescript/v5/defineChain) function.
|
148
|
-
* At minimum, you need to pass the `id` of the blockchain to `defineChain` function to create a `Chain` object.
|
149
|
-
* @example
|
150
|
-
* ```tsx
|
151
|
-
* import { polygon } from "thirdweb/chains";
|
152
|
-
*
|
153
|
-
* function Example() {
|
154
|
-
* return <div> <ConnectEmbed chain={polygon} /> </div>
|
155
|
-
* }
|
156
|
-
* ```
|
157
|
-
*/
|
158
|
-
chain?: Chain;
|
159
|
-
|
160
|
-
/**
|
161
|
-
* Array of chains that your app supports.
|
162
|
-
*
|
163
|
-
* This is only relevant if your app is a multi-chain app and works across multiple blockchains.
|
164
|
-
* If your app only works on a single blockchain, you should only specify the `chain` prop.
|
165
|
-
*
|
166
|
-
* Given list of chains will used in various ways:
|
167
|
-
* - They will be displayed in the network selector in the `ConnectEmbed`'s details modal post connection
|
168
|
-
* - They will be sent to wallet at the time of connection if the wallet supports requesting multiple chains ( example: WalletConnect ) so that users can switch between the chains post connection easily
|
169
|
-
*
|
170
|
-
* ```tsx
|
171
|
-
* <ConnectEmbed chains={[ethereum, polygon, optimism]} />
|
172
|
-
* ```
|
173
|
-
*
|
174
|
-
* You can create a `Chain` object using the [`defineChain`](https://portal.thirdweb.com/references/typescript/v5/defineChain) function.
|
175
|
-
* At minimum, you need to pass the `id` of the blockchain to `defineChain` function to create a `Chain` object.
|
176
|
-
*
|
177
|
-
* ```tsx
|
178
|
-
* import { defineChain } from "thirdweb/react";
|
179
|
-
*
|
180
|
-
* const polygon = defineChain({
|
181
|
-
* id: 137,
|
182
|
-
* });
|
183
|
-
* ```
|
184
|
-
*/
|
185
|
-
chains?: Chain[];
|
186
|
-
|
187
|
-
/**
|
188
|
-
* Class name to be added to the root element of ConnectEmbed
|
189
|
-
*/
|
190
|
-
className?: string;
|
191
|
-
|
192
|
-
/**
|
193
|
-
* Set the theme for the `ConnectEmbed` component. By default it is set to `"dark"`
|
194
|
-
*
|
195
|
-
* theme can be set to either `"dark"`, `"light"` or a custom theme object.
|
196
|
-
* You can also import [`lightTheme`](https://portal.thirdweb.com/references/typescript/v5/lightTheme)
|
197
|
-
* or [`darkTheme`](https://portal.thirdweb.com/references/typescript/v5/darkTheme)
|
198
|
-
* functions from `thirdweb/react` to use the default themes as base and overrides parts of it.
|
199
|
-
* @example
|
200
|
-
* ```ts
|
201
|
-
* import { lightTheme } from "thirdweb/react";
|
202
|
-
*
|
203
|
-
* const customTheme = lightTheme({
|
204
|
-
* colors: {
|
205
|
-
* modalBg: 'red'
|
206
|
-
* }
|
207
|
-
* })
|
208
|
-
*
|
209
|
-
* function Example() {
|
210
|
-
* return <ConnectEmbed theme={customTheme} />
|
211
|
-
* }
|
212
|
-
* ```
|
213
|
-
*/
|
214
|
-
theme?: "dark" | "light" | Theme;
|
215
|
-
|
216
|
-
/**
|
217
|
-
* CSS styles to be applied to the root element of ConnectEmbed
|
218
|
-
*/
|
219
|
-
style?: React.CSSProperties;
|
220
|
-
|
221
|
-
/**
|
222
|
-
* If provided, Embed will show a Terms of Service message at the bottom with below link
|
223
|
-
*/
|
224
|
-
termsOfServiceUrl?: string;
|
225
|
-
|
226
|
-
/**
|
227
|
-
* If provided, Embed will show a Privacy Policy message at the bottom with below link
|
228
|
-
*/
|
229
|
-
privacyPolicyUrl?: string;
|
230
|
-
|
231
|
-
/**
|
232
|
-
* Callback to be called on successful connection of wallet - including auto-connect.
|
233
|
-
* The callback is called with the connected wallet
|
234
|
-
*
|
235
|
-
* ```tsx
|
236
|
-
* <ConnectEmbed
|
237
|
-
* onConnect={(wallet) => {
|
238
|
-
* console.log("connected to", wallet)
|
239
|
-
* }}
|
240
|
-
* />
|
241
|
-
* ```
|
242
|
-
* ```
|
243
|
-
*/
|
244
|
-
onConnect?: (wallet: Wallet) => void;
|
245
|
-
|
246
|
-
/**
|
247
|
-
* By default, A "Powered by Thirdweb" branding is shown at the bottom of the embed.
|
248
|
-
*
|
249
|
-
* If you want to hide it, set this to `false`
|
250
|
-
* @example
|
251
|
-
* ```tsx
|
252
|
-
* <ConnectEmbed showThirdwebBranding={false} />
|
253
|
-
* ```
|
254
|
-
*/
|
255
|
-
showThirdwebBranding?: boolean;
|
256
|
-
|
257
|
-
/**
|
258
|
-
* Configure options for WalletConnect
|
259
|
-
*
|
260
|
-
* By default WalletConnect uses the thirdweb's default project id.
|
261
|
-
* Setting your own project id is recommended.
|
262
|
-
*
|
263
|
-
* You can create a project id by signing up on [walletconnect.com](https://walletconnect.com/)
|
264
|
-
*/
|
265
|
-
walletConnect?: {
|
266
|
-
projectId?: string;
|
267
|
-
};
|
268
|
-
|
269
|
-
/**
|
270
|
-
* Enable Account abstraction for all wallets. This will connect to the users's smart account based on the connected personal wallet and the given options.
|
271
|
-
*
|
272
|
-
* This allows to sponsor gas fees for your user's transaction using the thirdweb account abstraction infrastructure.
|
273
|
-
*
|
274
|
-
* ```tsx
|
275
|
-
* <ConnectEmbed
|
276
|
-
* accountAbstraction={{
|
277
|
-
* factoryAddress: "0x123...",
|
278
|
-
* chain: sepolia,
|
279
|
-
* gasless: true;
|
280
|
-
* }}
|
281
|
-
* />
|
282
|
-
*/
|
283
|
-
accountAbstraction?: SmartWalletOptions;
|
284
|
-
|
285
|
-
/**
|
286
|
-
* Wallets to show as recommended in the `ConnectEmbed` UI
|
287
|
-
*/
|
288
|
-
recommendedWallets?: Wallet[];
|
289
|
-
|
290
|
-
/**
|
291
|
-
* By default, `ConnectEmbed` shows a "All Wallets" button that shows a list of 350+ wallets.
|
292
|
-
*
|
293
|
-
* You can disable this button by setting `showAllWallets` prop to `false`
|
294
|
-
*/
|
295
|
-
showAllWallets?: boolean;
|
296
|
-
|
297
|
-
/**
|
298
|
-
* ConnectEmbed supports two modal size variants: `compact` and `wide`.
|
299
|
-
*
|
300
|
-
* By default it is set to `compact`, you can set it to `wide` if you want to show a wider modal.
|
301
|
-
*
|
302
|
-
* Note that if the screen width can not fit the wide modal, the `compact` version will be shown regardless of this `modalSize` options provided
|
303
|
-
*/
|
304
|
-
modalSize?: "compact" | "wide";
|
305
|
-
|
306
|
-
/**
|
307
|
-
* Enable SIWE (Sign in with Ethererum) by passing an object of type `SiweAuthOptions` to
|
308
|
-
* enforce the users to sign a message after connecting their wallet to authenticate themselves.
|
309
|
-
*
|
310
|
-
* Refer to the [`SiweAuthOptions`](https://portal.thirdweb.com/references/typescript/v5/SiweAuthOptions) for more details
|
311
|
-
*/
|
312
|
-
auth?: SiweAuthOptions;
|
313
|
-
};
|
314
|
-
|
315
40
|
/**
|
316
41
|
* A component that allows the user to connect their wallet.
|
317
42
|
*
|
@@ -322,10 +47,6 @@ export type ConnectEmbedProps = {
|
|
322
47
|
* ```tsx
|
323
48
|
* <ConnectEmbed
|
324
49
|
* client={client}
|
325
|
-
* appMetadata={{
|
326
|
-
* name: "Example",
|
327
|
-
* url: "https://example.com",
|
328
|
-
* }}
|
329
50
|
* />
|
330
51
|
* ```
|
331
52
|
* @param props -
|
@@ -109,8 +109,9 @@ export const ConnectModalContent = (props: {
|
|
109
109
|
);
|
110
110
|
|
111
111
|
const handleBack = useCallback(() => {
|
112
|
+
setSelectionData({});
|
112
113
|
setScreen(initialScreen);
|
113
|
-
}, [setScreen, initialScreen]);
|
114
|
+
}, [setScreen, initialScreen, setSelectionData]);
|
114
115
|
|
115
116
|
const walletList = (
|
116
117
|
<WalletSelector
|
@@ -120,6 +121,7 @@ export const ConnectModalContent = (props: {
|
|
120
121
|
setScreen(reservedScreens.getStarted);
|
121
122
|
}}
|
122
123
|
selectWallet={(newWallet) => {
|
124
|
+
setSelectionData({});
|
123
125
|
if (newWallet.onConnectRequested) {
|
124
126
|
newWallet
|
125
127
|
.onConnectRequested()
|
@@ -13,6 +13,7 @@ import {
|
|
13
13
|
iconSize,
|
14
14
|
spacing,
|
15
15
|
} from "../../../../core/design-system/index.js";
|
16
|
+
import { useWalletInfo } from "../../../../core/utils/wallet.js";
|
16
17
|
import { LoadingScreen } from "../../../wallets/shared/LoadingScreen.js";
|
17
18
|
import { getSmartWalletLocale } from "../../../wallets/smartWallet/locale/getSmartWalletLocale.js";
|
18
19
|
import type { SmartWalletLocale } from "../../../wallets/smartWallet/locale/types.js";
|
@@ -21,7 +22,6 @@ import { Spinner } from "../../components/Spinner.js";
|
|
21
22
|
import { Container, ModalHeader } from "../../components/basic.js";
|
22
23
|
import { Button } from "../../components/buttons.js";
|
23
24
|
import { Text } from "../../components/text.js";
|
24
|
-
import { useWalletInfo } from "../../hooks/useWalletInfo.js";
|
25
25
|
import type { LocaleId } from "../../types.js";
|
26
26
|
import type { ConnectLocale } from "../locale/types.js";
|
27
27
|
import { AnyWalletConnectUI } from "./AnyWalletConnectUI.js";
|
@@ -10,12 +10,12 @@ import {
|
|
10
10
|
radius,
|
11
11
|
spacing,
|
12
12
|
} from "../../../core/design-system/index.js";
|
13
|
+
import { useWalletInfo } from "../../../core/utils/wallet.js";
|
13
14
|
import { Skeleton } from "../components/Skeleton.js";
|
14
15
|
import { WalletImage } from "../components/WalletImage.js";
|
15
16
|
import { Container } from "../components/basic.js";
|
16
17
|
import { Text } from "../components/text.js";
|
17
18
|
import { StyledButton } from "../design-system/elements.js";
|
18
|
-
import { useWalletInfo } from "../hooks/useWalletInfo.js";
|
19
19
|
import { useScreenContext } from "./Modal/screen.js";
|
20
20
|
import type { ConnectLocale } from "./locale/types.js";
|
21
21
|
|
@@ -16,6 +16,7 @@ import {
|
|
16
16
|
radius,
|
17
17
|
spacing,
|
18
18
|
} from "../../../core/design-system/index.js";
|
19
|
+
import { genericWalletIcon } from "../../../core/utils/socialIcons.js";
|
19
20
|
import { sortWallets } from "../../utils/sortWallets.js";
|
20
21
|
import { LoadingScreen } from "../../wallets/shared/LoadingScreen.js";
|
21
22
|
import { Img } from "../components/Img.js";
|
@@ -40,7 +41,6 @@ import { PoweredByThirdweb } from "./PoweredByTW.js";
|
|
40
41
|
import { WalletButton, WalletEntryButton } from "./WalletEntryButton.js";
|
41
42
|
import { WalletTypeRowButton } from "./WalletTypeRowButton.js";
|
42
43
|
import { compactModalMaxHeight } from "./constants.js";
|
43
|
-
import { genericWalletIcon } from "./icons/dataUris.js";
|
44
44
|
import type { ConnectLocale } from "./locale/types.js";
|
45
45
|
|
46
46
|
const InAppWalletSelectionUI = /* @__PURE__ */ lazy(
|
@@ -14,6 +14,7 @@ import {
|
|
14
14
|
iconSize,
|
15
15
|
spacing,
|
16
16
|
} from "../../../../../core/design-system/index.js";
|
17
|
+
import type { PayUIOptions } from "../../../../../core/hooks/connection/ConnectButtonProps.js";
|
17
18
|
import {
|
18
19
|
useChainQuery,
|
19
20
|
useChainsQuery,
|
@@ -21,6 +22,7 @@ import {
|
|
21
22
|
import { useWalletBalance } from "../../../../../core/hooks/others/useWalletBalance.js";
|
22
23
|
import { useBuyWithCryptoQuote } from "../../../../../core/hooks/pay/useBuyWithCryptoQuote.js";
|
23
24
|
import { useBuyWithFiatQuote } from "../../../../../core/hooks/pay/useBuyWithFiatQuote.js";
|
25
|
+
import type { SupportedTokens } from "../../../../../core/utils/defaultTokens.js";
|
24
26
|
import { useActiveAccount } from "../../../../hooks/wallets/useActiveAccount.js";
|
25
27
|
import { useActiveWalletChain } from "../../../../hooks/wallets/useActiveWalletChain.js";
|
26
28
|
import { LoadingScreen } from "../../../../wallets/shared/LoadingScreen.js";
|
@@ -40,9 +42,7 @@ import { Container, Line, ModalHeader } from "../../../components/basic.js";
|
|
40
42
|
import { Button } from "../../../components/buttons.js";
|
41
43
|
import { Text } from "../../../components/text.js";
|
42
44
|
import { TokenSymbol } from "../../../components/token/TokenSymbol.js";
|
43
|
-
import type { PayUIOptions } from "../../ConnectButtonProps.js";
|
44
45
|
import { ChainButton, NetworkSelectorContent } from "../../NetworkSelector.js";
|
45
|
-
import type { SupportedTokens } from "../../defaultTokens.js";
|
46
46
|
import { CoinsIcon } from "../../icons/CoinsIcon.js";
|
47
47
|
import type { ConnectLocale } from "../../locale/types.js";
|
48
48
|
import { TokenSelector } from "../TokenSelector.js";
|
@@ -18,13 +18,13 @@ import {
|
|
18
18
|
spacing,
|
19
19
|
} from "../../../../../../core/design-system/index.js";
|
20
20
|
import { useChainQuery } from "../../../../../../core/hooks/others/useChainQuery.js";
|
21
|
+
import type { TokenInfo } from "../../../../../../core/utils/defaultTokens.js";
|
21
22
|
import { Spacer } from "../../../../components/Spacer.js";
|
22
23
|
import { Spinner } from "../../../../components/Spinner.js";
|
23
24
|
import { Container, Line, ModalHeader } from "../../../../components/basic.js";
|
24
25
|
import { Button, ButtonLink } from "../../../../components/buttons.js";
|
25
26
|
import { Text } from "../../../../components/text.js";
|
26
27
|
import { TokenSymbol } from "../../../../components/token/TokenSymbol.js";
|
27
|
-
import type { TokenInfo } from "../../../defaultTokens.js";
|
28
28
|
import { type ERC20OrNativeToken, NATIVE_TOKEN } from "../../nativeToken.js";
|
29
29
|
import { PayTokenIcon } from "../PayTokenIcon.js";
|
30
30
|
import { StepIcon } from "../Stepper.js";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Chain } from "../../../../../../../chains/types.js";
|
2
2
|
import { NATIVE_TOKEN_ADDRESS } from "../../../../../../../constants/addresses.js";
|
3
|
-
import type { PayUIOptions } from "
|
3
|
+
import type { PayUIOptions } from "../../../../../../core/hooks/connection/ConnectButtonProps.js";
|
4
4
|
import { type ERC20OrNativeToken, isNativeToken } from "../../nativeToken.js";
|
5
5
|
import type { SupportedChainAndTokens } from "../swap/useSwapSupportedChains.js";
|
6
6
|
|
@@ -3,9 +3,9 @@ import { polygon } from "../../../../../../../chains/chain-definitions/polygon.j
|
|
3
3
|
import type { Chain } from "../../../../../../../chains/types.js";
|
4
4
|
import { formatNumber } from "../../../../../../../utils/formatNumber.js";
|
5
5
|
import { toEther } from "../../../../../../../utils/units.js";
|
6
|
+
import type { PayUIOptions } from "../../../../../../core/hooks/connection/ConnectButtonProps.js";
|
6
7
|
import { useActiveWalletChain } from "../../../../../hooks/wallets/useActiveWalletChain.js";
|
7
8
|
import { useDebouncedValue } from "../../../../hooks/useDebouncedValue.js";
|
8
|
-
import type { PayUIOptions } from "../../../ConnectButtonProps.js";
|
9
9
|
import { type ERC20OrNativeToken, NATIVE_TOKEN } from "../../nativeToken.js";
|
10
10
|
import { defaultSelectedCurrency } from "../fiat/currencies.js";
|
11
11
|
import type { SupportedChainAndTokens } from "../swap/useSwapSupportedChains.js";
|
@@ -10,13 +10,13 @@ import {
|
|
10
10
|
} from "../../../../../../core/design-system/index.js";
|
11
11
|
import { useChainQuery } from "../../../../../../core/hooks/others/useChainQuery.js";
|
12
12
|
import { useWalletBalance } from "../../../../../../core/hooks/others/useWalletBalance.js";
|
13
|
+
import type { TokenInfo } from "../../../../../../core/utils/defaultTokens.js";
|
13
14
|
import { useActiveAccount } from "../../../../../hooks/wallets/useActiveAccount.js";
|
14
15
|
import { Skeleton } from "../../../../components/Skeleton.js";
|
15
16
|
import { Container } from "../../../../components/basic.js";
|
16
17
|
import { Button } from "../../../../components/buttons.js";
|
17
18
|
import { Text } from "../../../../components/text.js";
|
18
19
|
import { TokenSymbol } from "../../../../components/token/TokenSymbol.js";
|
19
|
-
import type { TokenInfo } from "../../../defaultTokens.js";
|
20
20
|
import { GenericWalletIcon } from "../../../icons/GenericWalletIcon.js";
|
21
21
|
import { formatTokenBalance } from "../../formatTokenBalance.js";
|
22
22
|
import { type NativeToken, isNativeToken } from "../../nativeToken.js";
|