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
@@ -0,0 +1,64 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ThemedInput = ThemedInput;
|
4
|
+
exports.ThemedInputWithSubmit = ThemedInputWithSubmit;
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
6
|
+
const react_1 = require("react");
|
7
|
+
const react_native_1 = require("react-native");
|
8
|
+
const react_native_svg_1 = require("react-native-svg");
|
9
|
+
const index_js_1 = require("../../design-system/index.js");
|
10
|
+
const svgs_js_1 = require("../icons/svgs.js");
|
11
|
+
const spinner_js_1 = require("./spinner.js");
|
12
|
+
function ThemedInput(props) {
|
13
|
+
const { theme, rightView } = props;
|
14
|
+
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
16
|
+
styles.container,
|
17
|
+
{
|
18
|
+
borderColor: isFocused
|
19
|
+
? theme.colors.accentButtonBg
|
20
|
+
: theme.colors.borderColor,
|
21
|
+
},
|
22
|
+
], children: [(0, jsx_runtime_1.jsx)(react_native_1.TextInput, { placeholderTextColor: theme.colors.secondaryText, style: [styles.input, { color: theme.colors.primaryText }], onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ...props }), rightView && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 } }), rightView] }))] }));
|
23
|
+
}
|
24
|
+
function ThemedInputWithSubmit(props) {
|
25
|
+
const { theme, onSubmit } = props;
|
26
|
+
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
27
|
+
const [val, setVal] = (0, react_1.useState)("");
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
29
|
+
styles.container,
|
30
|
+
{
|
31
|
+
borderColor: isFocused
|
32
|
+
? theme.colors.accentButtonBg
|
33
|
+
: theme.colors.borderColor,
|
34
|
+
},
|
35
|
+
], children: [(0, jsx_runtime_1.jsx)(react_native_1.TextInput, { placeholderTextColor: theme.colors.secondaryText, style: [
|
36
|
+
styles.input,
|
37
|
+
{
|
38
|
+
color: theme.colors.primaryText,
|
39
|
+
},
|
40
|
+
], value: val, onChangeText: setVal, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ...props }), onSubmit && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: () => onSubmit(val), disabled: props.isSubmitting, style: {
|
41
|
+
paddingHorizontal: index_js_1.spacing.lg,
|
42
|
+
}, children: props.isSubmitting ? ((0, jsx_runtime_1.jsx)(spinner_js_1.ThemedSpinner, { size: 24, color: theme.colors.secondaryIconColor })) : ((0, jsx_runtime_1.jsx)(react_native_svg_1.SvgXml, { width: 24, height: 24, xml: svgs_js_1.RIGHT_ARROW, color: theme.colors.secondaryIconColor })) }))] }));
|
43
|
+
}
|
44
|
+
const styles = react_native_1.StyleSheet.create({
|
45
|
+
container: {
|
46
|
+
flexDirection: "row",
|
47
|
+
alignItems: "center",
|
48
|
+
borderRadius: index_js_1.radius.lg,
|
49
|
+
borderWidth: 1,
|
50
|
+
borderStyle: "solid",
|
51
|
+
},
|
52
|
+
input: {
|
53
|
+
flex: 1,
|
54
|
+
flexDirection: "row",
|
55
|
+
fontSize: 16,
|
56
|
+
height: 56,
|
57
|
+
gap: index_js_1.spacing.md,
|
58
|
+
paddingLeft: index_js_1.spacing.lg,
|
59
|
+
paddingVertical: index_js_1.spacing.md,
|
60
|
+
justifyContent: "center",
|
61
|
+
alignItems: "center",
|
62
|
+
},
|
63
|
+
});
|
64
|
+
//# sourceMappingURL=input.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/components/input.tsx"],"names":[],"mappings":";;AAmBA,kCA6BC;AAED,sDAwDC;;AA1GD,iCAAiC;AACjC,+CAMsB;AACtB,uDAA0C;AAE1C,2DAA+D;AAC/D,8CAA+C;AAC/C,6CAA6C;AAO7C,SAAgB,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACnC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAClD,OAAO,CACL,wBAAC,mBAAI,IACH,KAAK,EAAE;YACL,MAAM,CAAC,SAAS;YAChB;gBACE,WAAW,EAAE,SAAS;oBACpB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc;oBAC7B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW;aAC7B;SACF,aAED,uBAAC,wBAAS,IACR,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,EAChD,KAAK,EA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AQ,IAAI,CACX,uBAAC,+BAAgB,IACf,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAC5B,QAAQ,EAAE,KAAK,CAAC,YAAY,EAC5B,KAAK,EAAE;oBACL,iBAAiB,EAAE,kBAAO,CAAC,EAAE;iBAC9B,YAEA,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CACpB,uBAAC,0BAAa,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB,GAAI,CACpE,CAAC,CAAC,CAAC,CACF,uBAAC,yBAAM,IACL,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,GAAG,EAAE,qBAAW,EAChB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB,GACtC,CACH,GACgB,CACpB,IACI,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,iBAAM,CAAC,EAAE;QACvB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,OAAO;KACrB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,CAAC;QACP,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,kBAAO,CAAC,EAAE;QACf,WAAW,EAAE,kBAAO,CAAC,EAAE;QACvB,eAAe,EAAE,kBAAO,CAAC,EAAE;QAC3B,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Spacer = Spacer;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
const react_native_1 = require("react-native");
|
6
|
+
const index_js_1 = require("../../design-system/index.js");
|
7
|
+
function Spacer({ size }) {
|
8
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.View, { style: { height: index_js_1.spacing[size] } });
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=spacer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"spacer.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/components/spacer.tsx"],"names":[],"mappings":";;AAGA,wBAEC;;AALD,+CAAoC;AACpC,2DAAuD;AAEvD,SAAgB,MAAM,CAAC,EAAE,IAAI,EAAkC;IAC7D,OAAO,uBAAC,mBAAI,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,kBAAO,CAAC,IAAI,CAAC,EAAE,GAAI,CAAC;AACpD,CAAC"}
|
@@ -11,30 +11,33 @@ function ThemedText({ style, theme, type = "default", ...rest }) {
|
|
11
11
|
type === "defaultSemiBold" ? styles.defaultSemiBold : undefined,
|
12
12
|
type === "subtitle" ? styles.subtitle : undefined,
|
13
13
|
type === "link" ? styles.link : undefined,
|
14
|
+
type === "subtext"
|
15
|
+
? { ...styles.subtext, color: theme.colors.secondaryText }
|
16
|
+
: undefined,
|
14
17
|
style,
|
15
18
|
], ...rest }));
|
16
19
|
}
|
17
20
|
const styles = react_native_1.StyleSheet.create({
|
18
21
|
default: {
|
19
22
|
fontSize: 16,
|
20
|
-
lineHeight: 24,
|
21
23
|
},
|
22
24
|
defaultSemiBold: {
|
23
25
|
fontSize: 16,
|
24
|
-
lineHeight: 24,
|
25
26
|
fontWeight: "600",
|
26
27
|
},
|
28
|
+
subtext: {
|
29
|
+
fontSize: 14,
|
30
|
+
},
|
27
31
|
title: {
|
28
|
-
fontSize:
|
32
|
+
fontSize: 24,
|
29
33
|
fontWeight: "bold",
|
30
|
-
lineHeight:
|
34
|
+
lineHeight: 28,
|
31
35
|
},
|
32
36
|
subtitle: {
|
33
|
-
fontSize:
|
34
|
-
fontWeight: "
|
37
|
+
fontSize: 18,
|
38
|
+
fontWeight: "600",
|
35
39
|
},
|
36
40
|
link: {
|
37
|
-
lineHeight: 30,
|
38
41
|
fontSize: 16,
|
39
42
|
},
|
40
43
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/components/text.tsx"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/components/text.tsx"],"names":[],"mappings":";;AAcA,gCAuBC;;AArCD,+CAAgE;AAchE,SAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,IAAI,GAAG,SAAS,EAChB,GAAG,IAAI,EACS;IAChB,OAAO,CACL,uBAAC,mBAAI,IACH,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;YACnC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YAC/C,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;YAC3C,IAAI,KAAK,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS;YAC/D,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACjD,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YACzC,IAAI,KAAK,SAAS;gBAChB,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE;gBAC1D,CAAC,CAAC,SAAS;YACb,KAAK;SACN,KACG,IAAI,GACR,CACH,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE;KACb;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;KACb;CACF,CAAC,CAAC"}
|
@@ -0,0 +1,106 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConnectButton = ConnectButton;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
const react_1 = require("react");
|
6
|
+
const react_native_1 = require("react-native");
|
7
|
+
const CustomThemeProvider_js_1 = require("../../../core/design-system/CustomThemeProvider.js");
|
8
|
+
const useActiveAccount_js_1 = require("../../hooks/wallets/useActiveAccount.js");
|
9
|
+
const useActiveWallet_js_1 = require("../../hooks/wallets/useActiveWallet.js");
|
10
|
+
const useActiveWalletConnectionStatus_js_1 = require("../../hooks/wallets/useActiveWalletConnectionStatus.js");
|
11
|
+
const useAutoConnect_js_1 = require("../../hooks/wallets/useAutoConnect.js");
|
12
|
+
const button_js_1 = require("../components/button.js");
|
13
|
+
const spinner_js_1 = require("../components/spinner.js");
|
14
|
+
const text_js_1 = require("../components/text.js");
|
15
|
+
const ConnectModal_js_1 = require("./ConnectModal.js");
|
16
|
+
const ConnectedButton_js_1 = require("./ConnectedButton.js");
|
17
|
+
const ConnectedModal_js_1 = require("./ConnectedModal.js");
|
18
|
+
/**
|
19
|
+
* A component that allows the user to connect their wallet.
|
20
|
+
* It renders a button which when clicked opens a modal to allow users to connect to wallets specified in `wallets` prop.
|
21
|
+
* @example
|
22
|
+
* ```tsx
|
23
|
+
* <ConnectButton
|
24
|
+
* client={client}
|
25
|
+
* />
|
26
|
+
* ```
|
27
|
+
* @param props
|
28
|
+
* Props for the `ConnectButton` component
|
29
|
+
*
|
30
|
+
* Refer to [ConnectButtonProps](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps) to see the available props.
|
31
|
+
* @component
|
32
|
+
*/
|
33
|
+
function ConnectButton(props) {
|
34
|
+
const theme = (0, CustomThemeProvider_js_1.parseTheme)(props.theme);
|
35
|
+
const [visible, setVisible] = (0, react_1.useState)(false);
|
36
|
+
const wallet = (0, useActiveWallet_js_1.useActiveWallet)();
|
37
|
+
const account = (0, useActiveAccount_js_1.useActiveAccount)();
|
38
|
+
const status = (0, useActiveWalletConnectionStatus_js_1.useActiveWalletConnectionStatus)();
|
39
|
+
(0, useAutoConnect_js_1.useAutoConnect)(props);
|
40
|
+
const fadeAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)); // For background opacity
|
41
|
+
const slideAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(screenHeight)); // For bottom sheet position
|
42
|
+
const openModal = (0, react_1.useCallback)(() => {
|
43
|
+
setVisible(true);
|
44
|
+
react_native_1.Animated.parallel([
|
45
|
+
react_native_1.Animated.timing(fadeAnim.current, {
|
46
|
+
toValue: 1,
|
47
|
+
duration: 300,
|
48
|
+
useNativeDriver: true,
|
49
|
+
}),
|
50
|
+
react_native_1.Animated.timing(slideAnim.current, {
|
51
|
+
toValue: 0,
|
52
|
+
duration: 300,
|
53
|
+
useNativeDriver: true,
|
54
|
+
easing: react_native_1.Easing.out(react_native_1.Easing.exp),
|
55
|
+
}),
|
56
|
+
]).start();
|
57
|
+
}, []);
|
58
|
+
const closeModal = (0, react_1.useCallback)(() => {
|
59
|
+
react_native_1.Animated.parallel([
|
60
|
+
react_native_1.Animated.timing(fadeAnim.current, {
|
61
|
+
toValue: 0,
|
62
|
+
duration: 300,
|
63
|
+
useNativeDriver: true,
|
64
|
+
}),
|
65
|
+
react_native_1.Animated.timing(slideAnim.current, {
|
66
|
+
toValue: screenHeight,
|
67
|
+
duration: 300,
|
68
|
+
useNativeDriver: true,
|
69
|
+
easing: react_native_1.Easing.in(react_native_1.Easing.exp),
|
70
|
+
}),
|
71
|
+
]).start(() => {
|
72
|
+
setVisible(false);
|
73
|
+
fadeAnim.current.setValue(0);
|
74
|
+
slideAnim.current.setValue(screenHeight);
|
75
|
+
});
|
76
|
+
}, []);
|
77
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [wallet && account ? ((0, jsx_runtime_1.jsx)(ConnectedButton_js_1.ConnectedButton, { openModal: () => openModal(), onClose: closeModal, wallet: wallet, account: account, ...props })) : ((0, jsx_runtime_1.jsx)(button_js_1.ThemedButton, { theme: theme, onPress: () => openModal(), children: status === "connecting" ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(spinner_js_1.ThemedSpinner, { color: theme.colors.primaryButtonText }) })) : ((0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", style: { color: theme.colors.primaryButtonText }, children: "Connect Wallet" })) })), (0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: visible, animationType: "none", transparent: true, onRequestClose: closeModal, children: (0, jsx_runtime_1.jsxs)(react_native_1.KeyboardAvoidingView, { behavior: "padding", style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [styles.modalOverlay, { opacity: fadeAnim.current }] }), (0, jsx_runtime_1.jsxs)(react_native_1.Animated.View, { style: [
|
78
|
+
{ flex: 1, transform: [{ translateY: slideAnim.current }] },
|
79
|
+
], children: [(0, jsx_runtime_1.jsx)(react_native_1.Pressable, { style: styles.dismissArea, onPress: closeModal }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.bottomSheetContainer, children: wallet && account ? ((0, jsx_runtime_1.jsx)(ConnectedModal_js_1.ConnectedModal, { ...props, theme: theme, onClose: closeModal, containerType: "modal", wallet: wallet, account: account })) : status === "connecting" ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
80
|
+
flexDirection: "column",
|
81
|
+
flex: 1,
|
82
|
+
alignItems: "center",
|
83
|
+
justifyContent: "center",
|
84
|
+
}, children: (0, jsx_runtime_1.jsx)(spinner_js_1.ThemedSpinner, { color: theme.colors.primaryText, size: 32 }) })) : ((0, jsx_runtime_1.jsx)(ConnectModal_js_1.ConnectModal, { ...props, theme: theme, onClose: closeModal, containerType: "modal" })) })] })] }) })] }));
|
85
|
+
}
|
86
|
+
const screenHeight = react_native_1.Dimensions.get("window").height;
|
87
|
+
const modalHeight = 480;
|
88
|
+
const screenWidth = react_native_1.Dimensions.get("window").width;
|
89
|
+
const styles = react_native_1.StyleSheet.create({
|
90
|
+
modalOverlay: {
|
91
|
+
position: "absolute",
|
92
|
+
width: screenWidth,
|
93
|
+
height: screenHeight,
|
94
|
+
backgroundColor: "rgba(0,0,0,0.8)",
|
95
|
+
},
|
96
|
+
dismissArea: {
|
97
|
+
width: "100%",
|
98
|
+
flex: 1,
|
99
|
+
},
|
100
|
+
bottomSheetContainer: {
|
101
|
+
height: modalHeight,
|
102
|
+
width: screenWidth,
|
103
|
+
flexDirection: "column",
|
104
|
+
},
|
105
|
+
});
|
106
|
+
//# sourceMappingURL=ConnectButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ConnectButton.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/connect/ConnectButton.tsx"],"names":[],"mappings":";;AAuCA,sCA8HC;;AArKD,iCAAsD;AACtD,+CASsB;AACtB,+FAAgF;AAEhF,iFAA2E;AAC3E,+EAAyE;AACzE,+GAAyG;AACzG,6EAAuE;AACvE,uDAAuD;AACvD,yDAAyD;AACzD,mDAAmD;AACnD,uDAAiD;AACjD,6DAAuD;AACvD,2DAAqD;AAErD;;;;;;;;;;;;;;GAcG;AACH,SAAgB,aAAa,CAAC,KAAyB;IACrD,MAA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CACF,uBAAC,8BAAY,OACP,KAAK,EACT,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,UAAU,EACnB,aAAa,EAAC,OAAO,GACrB,CACH,GACI,IACO,IACK,GACjB,IACH,CACR,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,yBAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;AACrD,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,WAAW,GAAG,yBAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;AAEnD,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,YAAY,EAAE;QACZ,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,YAAY;QACpB,eAAe,EAAE,iBAAiB;KACnC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,CAAC;KACR;IACD,oBAAoB,EAAE;QACpB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,WAAW;QAClB,aAAa,EAAE,QAAQ;KACxB;CACF,CAAC,CAAC"}
|
@@ -0,0 +1,133 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConnectEmbed = ConnectEmbed;
|
4
|
+
exports.ConnectModal = ConnectModal;
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
6
|
+
const react_1 = require("react");
|
7
|
+
const react_native_1 = require("react-native");
|
8
|
+
const react_native_svg_1 = require("react-native-svg");
|
9
|
+
const CustomThemeProvider_js_1 = require("../../../core/design-system/CustomThemeProvider.js");
|
10
|
+
const socialIcons_js_1 = require("../../../core/utils/socialIcons.js");
|
11
|
+
const index_js_1 = require("../../design-system/index.js");
|
12
|
+
const useActiveWallet_js_1 = require("../../hooks/wallets/useActiveWallet.js");
|
13
|
+
const useConnect_js_1 = require("../../hooks/wallets/useConnect.js");
|
14
|
+
const defaultWallets_js_1 = require("../../wallets/defaultWallets.js");
|
15
|
+
const Header_js_1 = require("../components/Header.js");
|
16
|
+
const button_js_1 = require("../components/button.js");
|
17
|
+
const spacer_js_1 = require("../components/spacer.js");
|
18
|
+
const text_js_1 = require("../components/text.js");
|
19
|
+
const view_js_1 = require("../components/view.js");
|
20
|
+
const svgs_js_1 = require("../icons/svgs.js");
|
21
|
+
const ExternalWalletsList_js_1 = require("./ExternalWalletsList.js");
|
22
|
+
const InAppWalletUI_js_1 = require("./InAppWalletUI.js");
|
23
|
+
/**
|
24
|
+
* A component that allows the user to connect their wallet.
|
25
|
+
*
|
26
|
+
* it renders the same UI as the [`ConnectButton`](https://portal.thirdweb.com/react/v4/components/ConnectButton) component's modal - but directly on the page instead of being in a modal.
|
27
|
+
*
|
28
|
+
* It only renders UI if wallet is not connected
|
29
|
+
* @example
|
30
|
+
* ```tsx
|
31
|
+
* <ConnectEmbed
|
32
|
+
* client={client}
|
33
|
+
* />
|
34
|
+
* ```
|
35
|
+
* @param props -
|
36
|
+
* The props for the `ConnectEmbed` component.
|
37
|
+
*
|
38
|
+
* Refer to the [`ConnectEmbedProps`](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps) type for more details
|
39
|
+
* @component
|
40
|
+
*/
|
41
|
+
function ConnectEmbed(props) {
|
42
|
+
const theme = (0, CustomThemeProvider_js_1.parseTheme)(props.theme);
|
43
|
+
const wallet = (0, useActiveWallet_js_1.useActiveWallet)();
|
44
|
+
const adaptedProps = {
|
45
|
+
...props,
|
46
|
+
connectModal: { ...props },
|
47
|
+
};
|
48
|
+
return wallet ? null : ((0, jsx_runtime_1.jsx)(ConnectModal, { ...adaptedProps, theme: theme, containerType: "embed" }));
|
49
|
+
}
|
50
|
+
function ConnectModal(props) {
|
51
|
+
const { theme, client, containerType, accountAbstraction, onConnect } = props;
|
52
|
+
const connectMutation = (0, useConnect_js_1.useConnect)({
|
53
|
+
client,
|
54
|
+
accountAbstraction,
|
55
|
+
onConnect: (wallet) => {
|
56
|
+
props.onClose?.();
|
57
|
+
onConnect?.(wallet);
|
58
|
+
},
|
59
|
+
});
|
60
|
+
const wallets = props.wallets || (0, defaultWallets_js_1.getDefaultWallets)(props);
|
61
|
+
const [modalState, setModalState] = (0, react_1.useState)({ screen: "base" });
|
62
|
+
const inAppWallet = wallets.find((wallet) => wallet.id === "inApp");
|
63
|
+
const externalWallets = wallets.filter((wallet) => wallet.id !== "inApp");
|
64
|
+
const showBranding = props.connectModal?.showThirdwebBranding !== false;
|
65
|
+
let content;
|
66
|
+
switch (modalState.screen) {
|
67
|
+
case "otp": {
|
68
|
+
content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_js_1.Header, { theme: theme, onClose: props.onClose, containerType: containerType, onBack: () => setModalState({ screen: "base" }) }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "xl" }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
69
|
+
flexDirection: "column",
|
70
|
+
gap: index_js_1.spacing.md,
|
71
|
+
paddingHorizontal: containerType === "modal" ? index_js_1.spacing.lg : 0,
|
72
|
+
}, children: (0, jsx_runtime_1.jsx)(InAppWalletUI_js_1.OtpLogin, { auth: modalState.auth, wallet: modalState.wallet, client: client, setScreen: setModalState, theme: theme, connectMutation: connectMutation }) }), containerType === "modal" ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 } })) : ((0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "md" }))] }));
|
73
|
+
break;
|
74
|
+
}
|
75
|
+
case "external_wallets": {
|
76
|
+
content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_js_1.Header, { theme: theme, onClose: props.onClose, containerType: containerType, onBack: () => setModalState({ screen: "base" }) }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" }), (0, jsx_runtime_1.jsx)(ExternalWalletsList_js_1.ExternalWalletsList, { theme: theme, externalWallets: externalWallets, client: client, connectMutation: connectMutation, containerType: containerType })] }));
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
default: {
|
80
|
+
content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_js_1.Header, { theme: theme, onClose: props.onClose, containerType: containerType }), inAppWallet ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [containerType === "modal" ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 } })) : ((0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" })), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
81
|
+
flexDirection: "column",
|
82
|
+
gap: index_js_1.spacing.md,
|
83
|
+
paddingHorizontal: containerType === "modal" ? index_js_1.spacing.lg : 0,
|
84
|
+
}, children: [(0, jsx_runtime_1.jsx)(InAppWalletUI_js_1.InAppWalletUI, { wallet: inAppWallet, setScreen: setModalState, client: client, theme: theme, connectMutation: connectMutation }), externalWallets.length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrDivider, { theme: theme }), (0, jsx_runtime_1.jsx)(button_js_1.ThemedButtonWithIcon, { theme: theme, icon: socialIcons_js_1.genericWalletIcon, title: "Connect a wallet", onPress: () => setModalState({ screen: "external_wallets" }) })] })) : null] }), containerType === "modal" ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 } })) : ((0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "md" }))] })) : externalWallets.length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
85
|
+
flex: 1,
|
86
|
+
}, children: (0, jsx_runtime_1.jsx)(ExternalWalletsList_js_1.ExternalWalletsList, { theme: theme, externalWallets: externalWallets, client: client, connectMutation: connectMutation, containerType: containerType }) })] })) : null] }));
|
87
|
+
}
|
88
|
+
}
|
89
|
+
return ((0, jsx_runtime_1.jsxs)(view_js_1.ThemedView, { theme: theme, style: containerType === "modal"
|
90
|
+
? styles.modalContainer
|
91
|
+
: styles.embedContainer, children: [content, showBranding && (0, jsx_runtime_1.jsx)(PoweredByThirdweb, { theme: theme })] }));
|
92
|
+
}
|
93
|
+
function OrDivider({ theme }) {
|
94
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
95
|
+
flexDirection: "row",
|
96
|
+
alignItems: "center",
|
97
|
+
justifyContent: "center",
|
98
|
+
gap: index_js_1.spacing.lg,
|
99
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
100
|
+
flex: 1,
|
101
|
+
height: 1,
|
102
|
+
backgroundColor: theme.colors.borderColor,
|
103
|
+
} }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, style: { color: theme.colors.secondaryText }, children: "OR" }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
104
|
+
flex: 1,
|
105
|
+
height: 1,
|
106
|
+
backgroundColor: theme.colors.borderColor,
|
107
|
+
} })] }));
|
108
|
+
}
|
109
|
+
function PoweredByThirdweb({ theme }) {
|
110
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
111
|
+
flexDirection: "row",
|
112
|
+
justifyContent: "center",
|
113
|
+
alignItems: "center",
|
114
|
+
gap: index_js_1.spacing.xs,
|
115
|
+
paddingBottom: react_native_1.Platform.OS === "android" ? index_js_1.spacing.md : index_js_1.spacing.lg,
|
116
|
+
}, children: [(0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "subtext", children: "Powered by" }), (0, jsx_runtime_1.jsx)(react_native_svg_1.SvgXml, { xml: svgs_js_1.TW_ICON, width: 22, height: 22, style: { marginBottom: -2 }, color: theme.colors.secondaryText }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "subtext", style: { fontWeight: "600" }, children: "thirdweb" })] }));
|
117
|
+
}
|
118
|
+
const styles = react_native_1.StyleSheet.create({
|
119
|
+
modalContainer: {
|
120
|
+
flex: 1,
|
121
|
+
width: "100%",
|
122
|
+
flexDirection: "column",
|
123
|
+
borderTopLeftRadius: index_js_1.radius.lg,
|
124
|
+
borderTopRightRadius: index_js_1.radius.lg,
|
125
|
+
},
|
126
|
+
embedContainer: {
|
127
|
+
flex: 1,
|
128
|
+
width: "100%",
|
129
|
+
flexDirection: "column",
|
130
|
+
backgroundColor: "transparent",
|
131
|
+
},
|
132
|
+
});
|
133
|
+
//# sourceMappingURL=ConnectModal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ConnectModal.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/connect/ConnectModal.tsx"],"names":[],"mappings":";;AA8CA,oCAUC;AAED,oCAuKC;;AAjOD,iCAAiC;AACjC,+CAA0D;AAC1D,uDAA0C;AAG1C,+FAAgF;AAIhF,uEAAuE;AACvE,2DAA+D;AAC/D,+EAAyE;AACzE,qEAA+D;AAC/D,uEAAoE;AACpE,uDAAqE;AACrE,uDAA+D;AAC/D,uDAAiD;AACjD,mDAAmD;AACnD,mDAAmD;AACnD,8CAA2C;AAC3C,qEAA+D;AAC/D,yDAA6D;AAO7D;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,KAAK,GAAG,IAAA,mCAAU,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,IAAA,oCAAe,GAAE,CAAC;IACjC,MAAM,YAAY,GAAG;QACnB,GAAG,KAAK;QACR,YAAY,EAAE,EAAE,GAAG,KAAK,EAAE;KACL,CAAC;IACxB,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACrB,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AAa,EAAE,QAAQ;QACvB,eAAe,EAAE,aAAa;KAC/B;CACF,CAAC,CAAC"}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConnectedButton = ConnectedButton;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
const react_native_1 = require("react-native");
|
6
|
+
const CustomThemeProvider_js_1 = require("../../../core/design-system/CustomThemeProvider.js");
|
7
|
+
const wallet_js_1 = require("../../../core/utils/wallet.js");
|
8
|
+
const index_js_1 = require("../../design-system/index.js");
|
9
|
+
const useActiveWalletChain_js_1 = require("../../hooks/wallets/useActiveWalletChain.js");
|
10
|
+
const Skeleton_js_1 = require("../components/Skeleton.js");
|
11
|
+
const WalletImage_js_1 = require("../components/WalletImage.js");
|
12
|
+
const button_js_1 = require("../components/button.js");
|
13
|
+
const text_js_1 = require("../components/text.js");
|
14
|
+
function ConnectedButton(props) {
|
15
|
+
const theme = (0, CustomThemeProvider_js_1.parseTheme)(props.theme);
|
16
|
+
const { account, wallet } = props;
|
17
|
+
const walletChain = (0, useActiveWalletChain_js_1.useActiveWalletChain)();
|
18
|
+
const { ensAvatarQuery, addressOrENS, balanceQuery } = (0, wallet_js_1.useConnectedWalletDetails)(props.client, walletChain, account, props.detailsButton?.displayBalanceToken);
|
19
|
+
return ((0, jsx_runtime_1.jsx)(button_js_1.ThemedButton, { theme: theme, onPress: () => {
|
20
|
+
props.openModal();
|
21
|
+
}, style: {
|
22
|
+
paddingHorizontal: index_js_1.spacing.md,
|
23
|
+
paddingVertical: index_js_1.spacing.smd,
|
24
|
+
}, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.row, children: [(0, jsx_runtime_1.jsx)(WalletImage_js_1.WalletImage, { theme: theme, size: 40, wallet: wallet, ensAvatar: ensAvatarQuery.data }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.col, children: [(0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", style: {
|
25
|
+
color: theme.colors.primaryButtonText,
|
26
|
+
}, children: addressOrENS }), balanceQuery.data ? ((0, jsx_runtime_1.jsxs)(text_js_1.ThemedText, { theme: theme, type: "subtext", style: {
|
27
|
+
fontSize: index_js_1.fontSize.sm,
|
28
|
+
}, children: [Number(balanceQuery.data.displayValue).toFixed(3), " ", balanceQuery.data?.symbol] })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { theme: theme, style: { width: 80, height: 16 }, color: theme.colors.secondaryText }))] })] }) }));
|
29
|
+
}
|
30
|
+
const styles = react_native_1.StyleSheet.create({
|
31
|
+
row: {
|
32
|
+
flexDirection: "row",
|
33
|
+
flex: 1,
|
34
|
+
gap: index_js_1.spacing.md,
|
35
|
+
alignItems: "center",
|
36
|
+
},
|
37
|
+
col: {
|
38
|
+
flexDirection: "column",
|
39
|
+
gap: index_js_1.spacing.xxs,
|
40
|
+
},
|
41
|
+
});
|
42
|
+
//# sourceMappingURL=ConnectedButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ConnectedButton.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/connect/ConnectedButton.tsx"],"names":[],"mappings":";;AAYA,0CAoEC;;AAhFD,+CAAgD;AAEhD,+FAAgF;AAEhF,6DAA0E;AAC1E,2DAAiE;AACjE,yFAAmF;AACnF,2DAAqD;AACrD,iEAA2D;AAC3D,uDAAuD;AACvD,mDAAmD;AAEnD,SAAgB,eAAe,CAC7B,KAKC;IAED,MAAM,KAAK,GAAG,IAAA,mCAAU,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,WAAW,GAAG,IAAA,8CAAoB,GAAE,CAAC;IAC3C,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,GAClD,IAAA,qCAAyB,EACvB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,CACH,IACI,IACF,GACM,CAChB,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE;QACH,aAAa,EAAE,KAAK;QACpB,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,kBAAO,CAAC,EAAE;QACf,UAAU,EAAE,QAAQ;KACrB;IACD,GAAG,EAAE;QACH,aAAa,EAAE,QAAQ;QACvB,GAAG,EAAE,kBAAO,CAAC,GAAG;KACjB;CACF,CAAC,CAAC"}
|
@@ -0,0 +1,175 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConnectedModal = ConnectedModal;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
const react_1 = require("react");
|
6
|
+
const react_native_1 = require("react-native");
|
7
|
+
const contract_js_1 = require("../../../../contract/contract.js");
|
8
|
+
const is_contract_deployed_js_1 = require("../../../../utils/bytecode/is-contract-deployed.js");
|
9
|
+
const useChainQuery_js_1 = require("../../../core/hooks/others/useChainQuery.js");
|
10
|
+
const isSmartWallet_js_1 = require("../../../core/utils/isSmartWallet.js");
|
11
|
+
const wallet_js_1 = require("../../../core/utils/wallet.js");
|
12
|
+
const index_js_1 = require("../../design-system/index.js");
|
13
|
+
const useActiveAccount_js_1 = require("../../hooks/wallets/useActiveAccount.js");
|
14
|
+
const useActiveWallet_js_1 = require("../../hooks/wallets/useActiveWallet.js");
|
15
|
+
const useActiveWalletChain_js_1 = require("../../hooks/wallets/useActiveWalletChain.js");
|
16
|
+
const useDisconnect_js_1 = require("../../hooks/wallets/useDisconnect.js");
|
17
|
+
const Address_js_1 = require("../components/Address.js");
|
18
|
+
const ChainIcon_js_1 = require("../components/ChainIcon.js");
|
19
|
+
const Header_js_1 = require("../components/Header.js");
|
20
|
+
const RNImage_js_1 = require("../components/RNImage.js");
|
21
|
+
const Skeleton_js_1 = require("../components/Skeleton.js");
|
22
|
+
const WalletImage_js_1 = require("../components/WalletImage.js");
|
23
|
+
const button_js_1 = require("../components/button.js");
|
24
|
+
const spacer_js_1 = require("../components/spacer.js");
|
25
|
+
const text_js_1 = require("../components/text.js");
|
26
|
+
const view_js_1 = require("../components/view.js");
|
27
|
+
const svgs_js_1 = require("../icons/svgs.js");
|
28
|
+
const ReceiveScreen_js_1 = require("./ReceiveScreen.js");
|
29
|
+
const SendScreen_js_1 = require("./SendScreen.js");
|
30
|
+
const TokenListScreen_js_1 = require("./TokenListScreen.js");
|
31
|
+
function ConnectedModal(props) {
|
32
|
+
const { theme, containerType, client } = props;
|
33
|
+
const [modalState, setModalState] = (0, react_1.useState)({
|
34
|
+
screen: "account",
|
35
|
+
});
|
36
|
+
let content;
|
37
|
+
switch (modalState.screen) {
|
38
|
+
case "send": {
|
39
|
+
content = ((0, jsx_runtime_1.jsx)(SendScreen_js_1.SendScreen, { theme: theme, client: client, onClose: props.onClose, onBack: () => setModalState({ screen: "account" }), containerType: containerType, supportedTokens: props.supportedTokens }));
|
40
|
+
break;
|
41
|
+
}
|
42
|
+
case "receive": {
|
43
|
+
content = ((0, jsx_runtime_1.jsx)(ReceiveScreen_js_1.ReceiveScreen, { account: props.account, wallet: props.wallet, theme: theme, containerType: props.containerType, onBack: () => setModalState({ screen: "account" }), onClose: props.onClose }));
|
44
|
+
break;
|
45
|
+
}
|
46
|
+
case "view_funds": {
|
47
|
+
content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_js_1.Header, { theme: theme, onClose: props.onClose, onBack: () => setModalState({ screen: "account" }), containerType: containerType, title: "View Funds" }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "xl" }), (0, jsx_runtime_1.jsx)(TokenListScreen_js_1.TokenListScreen, { client: client, theme: theme, supportedTokens: props.supportedTokens })] }));
|
48
|
+
break;
|
49
|
+
}
|
50
|
+
default: {
|
51
|
+
content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.onClose && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: props.onClose, style: {
|
52
|
+
padding: index_js_1.spacing.lg,
|
53
|
+
position: "absolute",
|
54
|
+
right: 0,
|
55
|
+
top: 0,
|
56
|
+
zIndex: 1,
|
57
|
+
}, children: (0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, data: svgs_js_1.CLOSE_ICON, size: 24, color: theme.colors.secondaryIconColor }) })), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "xl" }), (0, jsx_runtime_1.jsx)(AccountHeader, { ...props }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" }), (0, jsx_runtime_1.jsx)(WalletActionsRow, { ...props, setModalState: setModalState }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" }), (0, jsx_runtime_1.jsx)(WalletMenu, { ...props, setModalState: setModalState })] }));
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return ((0, jsx_runtime_1.jsx)(view_js_1.ThemedView, { theme: theme, style: containerType === "modal"
|
61
|
+
? styles.modalContainer
|
62
|
+
: styles.embedContainer, children: content }));
|
63
|
+
}
|
64
|
+
const AccountHeader = (props) => {
|
65
|
+
const { account, wallet, theme } = props;
|
66
|
+
const walletChain = (0, useActiveWalletChain_js_1.useActiveWalletChain)();
|
67
|
+
const { ensAvatarQuery, addressOrENS, balanceQuery } = (0, wallet_js_1.useConnectedWalletDetails)(props.client, walletChain, account, props.detailsButton?.displayBalanceToken);
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.accountHeaderContainer, children: [(0, jsx_runtime_1.jsx)(WalletImage_js_1.WalletImage, { theme: theme, size: 64, wallet: wallet, ensAvatar: ensAvatarQuery.data }), (0, jsx_runtime_1.jsx)(SmartAccountBadge, { client: props.client, theme: theme }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "smd" }), (0, jsx_runtime_1.jsx)(Address_js_1.Address, { account: account, theme: theme, addressOrENS: addressOrENS }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "xxs" }), balanceQuery.data ? ((0, jsx_runtime_1.jsxs)(text_js_1.ThemedText, { theme: theme, type: "subtext", style: {
|
69
|
+
fontSize: index_js_1.fontSize.sm,
|
70
|
+
}, children: [Number(balanceQuery.data.displayValue).toFixed(3), " ", balanceQuery.data?.symbol] })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { theme: theme, style: { width: 80, height: 16 } }))] }));
|
71
|
+
};
|
72
|
+
const WalletActionsRow = (props) => {
|
73
|
+
const { theme, setModalState } = props;
|
74
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.walletActionRowContainer, children: [(0, jsx_runtime_1.jsxs)(button_js_1.ThemedButton, { theme: theme, variant: "secondary", style: styles.walletActionButton, onPress: () => setModalState({ screen: "send" }), children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, size: 24, data: svgs_js_1.SEND_ICON, color: theme.colors.secondaryIconColor }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: "Send" })] }), (0, jsx_runtime_1.jsxs)(button_js_1.ThemedButton, { theme: theme, variant: "secondary", style: styles.walletActionButton, onPress: () => setModalState({ screen: "receive" }), children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, size: 24, data: svgs_js_1.RECEIVE_ICON, color: theme.colors.secondaryIconColor }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: "Receive" })] })] }));
|
75
|
+
};
|
76
|
+
const WalletMenu = (props) => {
|
77
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.walletMenuContainer, children: [(0, jsx_runtime_1.jsx)(ChainSwitcher, { ...props }), (0, jsx_runtime_1.jsx)(ViewFunds, { ...props }), (0, jsx_runtime_1.jsx)(DisconnectWallet, { ...props })] }));
|
78
|
+
};
|
79
|
+
const ChainSwitcher = (props) => {
|
80
|
+
const { client, wallet, theme } = props;
|
81
|
+
const chain = wallet.getChain();
|
82
|
+
const chainQuery = (0, useChainQuery_js_1.useChainQuery)(chain);
|
83
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.TouchableOpacity, { style: styles.walletMenuRow, children: [(0, jsx_runtime_1.jsx)(ChainIcon_js_1.ChainIcon, { client: client, size: 32, chain: chain, theme: theme }), chainQuery.data?.name ? ((0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: chainQuery.data?.name })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { theme: theme, style: { width: 80, height: 16 } }))] }));
|
84
|
+
};
|
85
|
+
const ViewFunds = (props) => {
|
86
|
+
const { theme, setModalState } = props;
|
87
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.TouchableOpacity, { style: styles.walletMenuRow, onPress: () => setModalState({ screen: "view_funds" }), children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, size: 32, data: svgs_js_1.COINS_ICON, color: theme.colors.secondaryIconColor }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: "View Funds" })] }));
|
88
|
+
};
|
89
|
+
const DisconnectWallet = (props) => {
|
90
|
+
const { wallet, theme, onClose } = props;
|
91
|
+
const { disconnect } = (0, useDisconnect_js_1.useDisconnect)();
|
92
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.TouchableOpacity, { style: styles.walletMenuRow, onPress: () => {
|
93
|
+
onClose?.();
|
94
|
+
disconnect(wallet);
|
95
|
+
}, children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, size: 32, data: svgs_js_1.EXIT_ICON, color: theme.colors.secondaryIconColor }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: "Disconnect Wallet" })] }));
|
96
|
+
};
|
97
|
+
function SmartAccountBadge(props) {
|
98
|
+
const activeAccount = (0, useActiveAccount_js_1.useActiveAccount)();
|
99
|
+
const activeWallet = (0, useActiveWallet_js_1.useActiveWallet)();
|
100
|
+
const isSmartWallet = (0, isSmartWallet_js_1.hasSmartAccount)(activeWallet);
|
101
|
+
const chain = (0, useActiveWalletChain_js_1.useActiveWalletChain)();
|
102
|
+
const { client, theme } = props;
|
103
|
+
const [isSmartWalletDeployed, setIsSmartWalletDeployed] = (0, react_1.useState)(false);
|
104
|
+
(0, react_1.useEffect)(() => {
|
105
|
+
if (activeAccount && isSmartWallet && activeAccount.address && chain) {
|
106
|
+
const contract = (0, contract_js_1.getContract)({
|
107
|
+
address: activeAccount.address,
|
108
|
+
chain,
|
109
|
+
client,
|
110
|
+
});
|
111
|
+
(0, is_contract_deployed_js_1.isContractDeployed)(contract).then((isDeployed) => {
|
112
|
+
setIsSmartWalletDeployed(isDeployed);
|
113
|
+
});
|
114
|
+
}
|
115
|
+
else {
|
116
|
+
setIsSmartWalletDeployed(false);
|
117
|
+
}
|
118
|
+
}, [activeAccount, chain, client, isSmartWallet]);
|
119
|
+
const content = ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
120
|
+
flexDirection: "row",
|
121
|
+
alignItems: "center",
|
122
|
+
justifyContent: "center",
|
123
|
+
gap: index_js_1.spacing.xs,
|
124
|
+
backgroundColor: theme.colors.secondaryButtonBg,
|
125
|
+
borderRadius: index_js_1.radius.md,
|
126
|
+
paddingVertical: index_js_1.spacing.xs,
|
127
|
+
paddingLeft: index_js_1.spacing.sm,
|
128
|
+
paddingRight: index_js_1.spacing.smd,
|
129
|
+
}, children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, data: svgs_js_1.SMART_WALLET_ICON, size: 14, color: theme.colors.accentButtonBg }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, style: { color: theme.colors.primaryText, fontSize: index_js_1.fontSize.xs }, children: "Smart Account" })] }));
|
130
|
+
if (chain && activeAccount && isSmartWallet) {
|
131
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "smd" }), isSmartWalletDeployed ? ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: () => react_native_1.Linking.openURL(`https://thirdweb.com/${chain.id}/${activeAccount.address}/account`), children: content })) : ((0, jsx_runtime_1.jsx)(react_native_1.View, { children: content }))] }));
|
132
|
+
}
|
133
|
+
return null;
|
134
|
+
}
|
135
|
+
const styles = react_native_1.StyleSheet.create({
|
136
|
+
modalContainer: {
|
137
|
+
flex: 1,
|
138
|
+
width: "100%",
|
139
|
+
flexDirection: "column",
|
140
|
+
borderTopLeftRadius: index_js_1.radius.lg,
|
141
|
+
borderTopRightRadius: index_js_1.radius.lg,
|
142
|
+
},
|
143
|
+
embedContainer: {
|
144
|
+
flex: 1,
|
145
|
+
width: "100%",
|
146
|
+
flexDirection: "column",
|
147
|
+
backgroundColor: "transparent",
|
148
|
+
},
|
149
|
+
accountHeaderContainer: {
|
150
|
+
flexDirection: "column",
|
151
|
+
justifyContent: "center",
|
152
|
+
alignItems: "center",
|
153
|
+
paddingHorizontal: index_js_1.spacing.lg,
|
154
|
+
},
|
155
|
+
walletActionRowContainer: {
|
156
|
+
flexDirection: "row",
|
157
|
+
justifyContent: "space-evenly",
|
158
|
+
alignItems: "center",
|
159
|
+
gap: index_js_1.spacing.md,
|
160
|
+
paddingHorizontal: index_js_1.spacing.lg,
|
161
|
+
},
|
162
|
+
walletActionButton: { flex: 1, padding: index_js_1.spacing.smd, gap: index_js_1.spacing.smd },
|
163
|
+
walletMenuContainer: {
|
164
|
+
flexDirection: "column",
|
165
|
+
gap: index_js_1.spacing.lg,
|
166
|
+
paddingHorizontal: index_js_1.spacing.lg,
|
167
|
+
},
|
168
|
+
walletMenuRow: {
|
169
|
+
flexDirection: "row",
|
170
|
+
justifyContent: "flex-start",
|
171
|
+
alignItems: "center",
|
172
|
+
gap: index_js_1.spacing.md,
|
173
|
+
},
|
174
|
+
});
|
175
|
+
//# sourceMappingURL=ConnectedModal.js.map
|