thirdweb 5.58.4 → 5.59.0-nightly-e2b3484764275560aa899f3f894b767faedaa9a1-20240925000331
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 +3 -3
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/exports/react.native.js +5 -3
- package/dist/cjs/exports/react.native.js.map +1 -1
- package/dist/cjs/exports/wallets/in-app.js +3 -1
- package/dist/cjs/exports/wallets/in-app.js.map +1 -1
- package/dist/cjs/exports/wallets/in-app.native.js +3 -1
- package/dist/cjs/exports/wallets/in-app.native.js.map +1 -1
- package/dist/cjs/exports/wallets.js +15 -10
- package/dist/cjs/exports/wallets.js.map +1 -1
- package/dist/cjs/exports/wallets.native.js +18 -7
- package/dist/cjs/exports/wallets.native.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/{useAdminAccount.js → useAdminWallet.js} +1 -1
- package/dist/cjs/react/core/hooks/wallets/useAdminWallet.js.map +1 -0
- package/dist/cjs/react/{core/hooks/others → native/hooks/wallets}/useProfiles.js +15 -7
- package/dist/cjs/react/native/hooks/wallets/useProfiles.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/ConnectButton.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/WalletLoadingThumbnail.js.map +1 -1
- package/dist/cjs/react/native/ui/transaction/TransactionButton.js.map +1 -1
- package/dist/cjs/react/web/hooks/wallets/useProfiles.js +45 -0
- package/dist/cjs/react/web/hooks/wallets/useProfiles.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +6 -3
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +5 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/PoweredByTW.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +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/DirectPaymentModeScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +4 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/StartScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletConnectDisconnectScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletConnectDisconnectScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletLogoSpinner.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/index.js.map +1 -1
- package/dist/cjs/react/web/ui/components/ChainName.js.map +1 -1
- package/dist/cjs/react/web/ui/components/Modal.js +1 -1
- package/dist/cjs/react/web/ui/components/Modal.js.map +1 -1
- package/dist/cjs/react/web/ui/components/basic.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/CountrySelector.js +1 -1
- package/dist/cjs/react/web/wallets/in-app/CountrySelector.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js +5 -4
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +10 -10
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectingScreen.js +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectingScreen.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +4 -3
- package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +9 -7
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/SocialLogin.js +3 -2
- package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
- package/dist/cjs/storage/upload/web-node.js +6 -0
- package/dist/cjs/storage/upload/web-node.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/client-scoped-storage.js +12 -0
- package/dist/cjs/wallets/in-app/core/authentication/client-scoped-storage.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/guest.js +13 -1
- package/dist/cjs/wallets/in-app/core/authentication/guest.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/linkAccount.js +7 -7
- package/dist/cjs/wallets/in-app/core/authentication/linkAccount.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/types.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/constants/settings.js +6 -1
- package/dist/cjs/wallets/in-app/core/constants/settings.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/wallet/ecosystem-core.js +0 -20
- package/dist/cjs/wallets/in-app/core/wallet/ecosystem-core.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js +0 -39
- package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/auth/index.js +57 -2
- package/dist/cjs/wallets/in-app/native/auth/index.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/auth/native-auth.js +2 -0
- package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js +62 -19
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/sign-message.enclave.js +1 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/sign-message.enclave.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/sign-transaction.enclave.js +1 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/sign-transaction.enclave.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js +1 -1
- package/dist/cjs/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/abstract-login.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js +2 -8
- package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js +80 -4
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/enclave-wallet.js +2 -8
- package/dist/cjs/wallets/in-app/web/lib/enclave-wallet.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/get-auth-token.js +1 -0
- package/dist/cjs/wallets/in-app/web/lib/get-auth-token.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/iframe-wallet.js +2 -8
- package/dist/cjs/wallets/in-app/web/lib/iframe-wallet.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js +32 -0
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/esm/exports/react.js +2 -2
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/react.native.js +2 -1
- 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/exports/wallets/in-app.native.js +1 -1
- package/dist/esm/exports/wallets/in-app.native.js.map +1 -1
- package/dist/esm/exports/wallets.js +1 -1
- package/dist/esm/exports/wallets.js.map +1 -1
- package/dist/esm/exports/wallets.native.js +4 -0
- package/dist/esm/exports/wallets.native.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/{useAdminAccount.js → useAdminWallet.js} +1 -1
- package/dist/esm/react/core/hooks/wallets/useAdminWallet.js.map +1 -0
- package/dist/esm/react/{core/hooks/others → native/hooks/wallets}/useProfiles.js +14 -6
- package/dist/esm/react/native/hooks/wallets/useProfiles.js.map +1 -0
- package/dist/esm/react/native/ui/connect/ConnectButton.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/esm/react/native/ui/connect/WalletLoadingThumbnail.js.map +1 -1
- package/dist/esm/react/native/ui/transaction/TransactionButton.js.map +1 -1
- package/dist/esm/react/web/hooks/wallets/useProfiles.js +42 -0
- package/dist/esm/react/web/hooks/wallets/useProfiles.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +6 -3
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +4 -3
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.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/NetworkSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/PoweredByTW.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +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/DirectPaymentModeScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +4 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +4 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/StartScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletConnectDisconnectScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletConnectDisconnectScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletLogoSpinner.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +1 -1
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/index.js.map +1 -1
- package/dist/esm/react/web/ui/components/ChainName.js.map +1 -1
- package/dist/esm/react/web/ui/components/Modal.js +1 -1
- package/dist/esm/react/web/ui/components/Modal.js.map +1 -1
- package/dist/esm/react/web/ui/components/basic.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/CountrySelector.js +1 -1
- package/dist/esm/react/web/wallets/in-app/CountrySelector.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js +3 -2
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +2 -2
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectingScreen.js +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectingScreen.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +5 -4
- package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +5 -3
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/SocialLogin.js +3 -2
- package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
- package/dist/esm/storage/upload/web-node.js +6 -0
- package/dist/esm/storage/upload/web-node.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/client-scoped-storage.js +13 -1
- package/dist/esm/wallets/in-app/core/authentication/client-scoped-storage.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/guest.js +13 -1
- package/dist/esm/wallets/in-app/core/authentication/guest.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/linkAccount.js +7 -7
- package/dist/esm/wallets/in-app/core/authentication/linkAccount.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/types.js.map +1 -1
- package/dist/esm/wallets/in-app/core/constants/settings.js +4 -0
- package/dist/esm/wallets/in-app/core/constants/settings.js.map +1 -1
- package/dist/esm/wallets/in-app/core/wallet/ecosystem-core.js +0 -20
- package/dist/esm/wallets/in-app/core/wallet/ecosystem-core.js.map +1 -1
- package/dist/esm/wallets/in-app/core/wallet/in-app-core.js +0 -39
- package/dist/esm/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
- package/dist/esm/wallets/in-app/native/auth/index.js +55 -2
- package/dist/esm/wallets/in-app/native/auth/index.js.map +1 -1
- package/dist/esm/wallets/in-app/native/auth/native-auth.js +2 -0
- package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js +62 -19
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/actions/sign-message.enclave.js +1 -1
- package/dist/esm/wallets/in-app/web/lib/actions/sign-message.enclave.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/actions/sign-transaction.enclave.js +1 -1
- package/dist/esm/wallets/in-app/web/lib/actions/sign-transaction.enclave.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js +1 -1
- package/dist/esm/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/abstract-login.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js +2 -8
- package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/index.js +77 -4
- package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/enclave-wallet.js +2 -8
- package/dist/esm/wallets/in-app/web/lib/enclave-wallet.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/get-auth-token.js +1 -0
- package/dist/esm/wallets/in-app/web/lib/get-auth-token.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/iframe-wallet.js +2 -8
- package/dist/esm/wallets/in-app/web/lib/iframe-wallet.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/web-connector.js +32 -0
- package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/types/exports/react.d.ts +2 -2
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +2 -1
- 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/exports/wallets/in-app.native.d.ts +1 -1
- package/dist/types/exports/wallets/in-app.native.d.ts.map +1 -1
- package/dist/types/exports/wallets.d.ts +1 -1
- package/dist/types/exports/wallets.d.ts.map +1 -1
- package/dist/types/exports/wallets.native.d.ts +2 -0
- package/dist/types/exports/wallets.native.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveWallet.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveWallet.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveWalletConnectionStatus.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveWalletConnectionStatus.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useAddConnectedWallet.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useAddConnectedWallet.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/{useAdminAccount.d.ts → useAdminWallet.d.ts} +2 -2
- package/dist/types/react/core/hooks/wallets/useAdminWallet.d.ts.map +1 -0
- package/dist/types/react/core/hooks/wallets/useConnectedWallets.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useConnectedWallets.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useDisconnect.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useSetActiveWallet.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useSetActiveWallet.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts.map +1 -1
- package/dist/types/react/core/providers/connection-manager.d.ts +27 -27
- package/dist/types/react/{core/hooks/others → native/hooks/wallets}/useProfiles.d.ts +8 -3
- package/dist/types/react/native/hooks/wallets/useProfiles.d.ts.map +1 -0
- package/dist/types/react/web/hooks/wallets/useProfiles.d.ts +28 -0
- package/dist/types/react/web/hooks/wallets/useProfiles.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/MediaRenderer/ModelViewer.d.ts +1 -1
- package/dist/types/react/web/wallets/in-app/WalletAuth.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/PassKeyLogin.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/oauthSignIn.d.ts +1 -2
- package/dist/types/react/web/wallets/shared/oauthSignIn.d.ts.map +1 -1
- package/dist/types/storage/upload/web-node.d.ts.map +1 -1
- package/dist/types/utils/fetch.d.ts +1 -1
- package/dist/types/utils/fetch.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/client-scoped-storage.d.ts +8 -0
- package/dist/types/wallets/in-app/core/authentication/client-scoped-storage.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/guest.d.ts +3 -1
- package/dist/types/wallets/in-app/core/authentication/guest.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/linkAccount.d.ts +6 -3
- package/dist/types/wallets/in-app/core/authentication/linkAccount.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/passkeys.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/siwe.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts +4 -3
- package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/constants/settings.d.ts +4 -0
- package/dist/types/wallets/in-app/core/constants/settings.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/interfaces/connector.d.ts +3 -1
- package/dist/types/wallets/in-app/core/interfaces/connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/ecosystem-core.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts +1 -1
- package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/types.d.ts +5 -0
- package/dist/types/wallets/in-app/core/wallet/types.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/auth/index.d.ts +48 -2
- package/dist/types/wallets/in-app/native/auth/index.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/auth/native-auth.d.ts +1 -1
- package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/native-connector.d.ts +8 -2
- package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/generate-wallet.enclave.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/generate-wallet.enclave.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/get-enclave-user-status.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/get-enclave-user-status.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/sign-message.enclave.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/sign-message.enclave.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/sign-transaction.enclave.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/sign-transaction.enclave.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/sign-typed-data.enclave.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/actions/sign-typed-data.enclave.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/abstract-login.d.ts +2 -1
- package/dist/types/wallets/in-app/web/lib/auth/abstract-login.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts +5 -3
- package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +68 -8
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/otp.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/otp.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/enclave-wallet.d.ts +8 -7
- package/dist/types/wallets/in-app/web/lib/enclave-wallet.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/get-auth-token.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/get-auth-token.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/iframe-wallet.d.ts +5 -3
- package/dist/types/wallets/in-app/web/lib/iframe-wallet.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +9 -8
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/types.d.ts +1 -5
- package/dist/types/wallets/in-app/web/types.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.d.ts +1 -1
- package/dist/types/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/exports/react.native.ts +2 -1
- package/src/exports/react.ts +2 -2
- package/src/exports/wallets/in-app.native.ts +2 -0
- package/src/exports/wallets/in-app.ts +2 -0
- package/src/exports/wallets.native.ts +12 -0
- package/src/exports/wallets.ts +6 -1
- package/src/react/{core/hooks/others → native/hooks/wallets}/useProfiles.ts +19 -8
- package/src/react/native/ui/connect/ConnectButton.tsx +1 -1
- package/src/react/native/ui/connect/ConnectModal.tsx +1 -1
- package/src/react/native/ui/connect/WalletLoadingThumbnail.tsx +1 -1
- package/src/react/native/ui/transaction/TransactionButton.tsx +1 -1
- package/src/react/web/hooks/wallets/useProfiles.ts +48 -0
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +6 -9
- package/src/react/web/ui/ConnectWallet/Details.tsx +11 -12
- package/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx +0 -1
- package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/PoweredByTW.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +4 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.tsx +1 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.tsx +1 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.tsx +4 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/LinkProfileScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx +4 -2
- package/src/react/web/ui/ConnectWallet/screens/ManageWalletScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/StartScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/WalletConnectDisconnectScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/WalletLogoSpinner.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx +2 -2
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +1 -1
- package/src/react/web/ui/TransactionButton/index.tsx +1 -1
- package/src/react/web/ui/components/ChainName.tsx +1 -1
- package/src/react/web/ui/components/Modal.tsx +1 -1
- package/src/react/web/ui/components/basic.tsx +1 -1
- package/src/react/web/wallets/in-app/CountrySelector.tsx +1 -1
- package/src/react/web/wallets/in-app/WalletAuth.tsx +3 -2
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +3 -3
- package/src/react/web/wallets/shared/ConnectingScreen.tsx +1 -1
- package/src/react/web/wallets/shared/OTPLoginUI.tsx +8 -4
- package/src/react/web/wallets/shared/PassKeyLogin.tsx +6 -3
- package/src/react/web/wallets/shared/SocialLogin.tsx +3 -2
- package/src/react/web/wallets/shared/oauthSignIn.ts +1 -1
- package/src/storage/upload/web-node.ts +10 -0
- package/src/utils/fetch.test.ts +1 -1
- package/src/utils/fetch.ts +1 -1
- package/src/version.ts +1 -1
- package/src/wallets/in-app/core/authentication/client-scoped-storage.ts +14 -0
- package/src/wallets/in-app/core/authentication/getLoginPath.ts +1 -1
- package/src/wallets/in-app/core/authentication/guest.ts +18 -2
- package/src/wallets/in-app/core/authentication/linkAccount.ts +15 -11
- package/src/wallets/in-app/core/authentication/passkeys.ts +1 -1
- package/src/wallets/in-app/core/authentication/siwe.ts +1 -1
- package/src/wallets/in-app/core/authentication/types.ts +10 -8
- package/src/wallets/in-app/core/constants/settings.ts +6 -0
- package/src/wallets/in-app/core/interfaces/connector.ts +4 -0
- package/src/wallets/in-app/core/wallet/ecosystem-core.ts +1 -40
- package/src/wallets/in-app/core/wallet/in-app-core.ts +1 -58
- package/src/wallets/in-app/core/wallet/types.ts +6 -0
- package/src/wallets/in-app/native/auth/index.ts +62 -6
- package/src/wallets/in-app/native/auth/native-auth.ts +3 -1
- package/src/wallets/in-app/native/native-connector.ts +54 -27
- package/src/wallets/in-app/web/lib/actions/generate-wallet.enclave.ts +1 -1
- package/src/wallets/in-app/web/lib/actions/get-enclave-user-status.ts +1 -1
- package/src/wallets/in-app/web/lib/actions/sign-message.enclave.ts +2 -2
- package/src/wallets/in-app/web/lib/actions/sign-transaction.enclave.ts +2 -2
- package/src/wallets/in-app/web/lib/actions/sign-typed-data.enclave.ts +2 -2
- package/src/wallets/in-app/web/lib/auth/abstract-login.ts +2 -1
- package/src/wallets/in-app/web/lib/auth/iframe-auth.ts +6 -8
- package/src/wallets/in-app/web/lib/auth/index.ts +89 -19
- package/src/wallets/in-app/web/lib/auth/oauth.ts +1 -1
- package/src/wallets/in-app/web/lib/auth/otp.ts +1 -1
- package/src/wallets/in-app/web/lib/enclave-wallet.ts +9 -13
- package/src/wallets/in-app/web/lib/get-auth-token.ts +2 -1
- package/src/wallets/in-app/web/lib/iframe-wallet.ts +5 -9
- package/src/wallets/in-app/web/lib/web-connector.ts +38 -4
- package/src/wallets/in-app/web/types.ts +1 -6
- package/src/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.ts +1 -1
- package/dist/cjs/react/core/hooks/others/useProfiles.js.map +0 -1
- package/dist/cjs/react/core/hooks/wallets/useAdminAccount.js.map +0 -1
- package/dist/cjs/wallets/in-app/core/wallet/profiles.js +0 -61
- package/dist/cjs/wallets/in-app/core/wallet/profiles.js.map +0 -1
- package/dist/esm/react/core/hooks/others/useProfiles.js.map +0 -1
- package/dist/esm/react/core/hooks/wallets/useAdminAccount.js.map +0 -1
- package/dist/esm/wallets/in-app/core/wallet/profiles.js +0 -57
- package/dist/esm/wallets/in-app/core/wallet/profiles.js.map +0 -1
- package/dist/types/react/core/hooks/others/useProfiles.d.ts.map +0 -1
- package/dist/types/react/core/hooks/wallets/useAdminAccount.d.ts.map +0 -1
- package/dist/types/wallets/in-app/core/wallet/profiles.d.ts +0 -49
- package/dist/types/wallets/in-app/core/wallet/profiles.d.ts.map +0 -1
- package/src/wallets/in-app/core/wallet/profiles.ts +0 -76
- /package/src/react/core/hooks/wallets/{useAdminAccount.ts → useAdminWallet.ts} +0 -0
@@ -1,14 +1,14 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
2
|
-
import type { OneOf } from "../../../../../utils/type-utils.js";
|
3
2
|
import type { SocialAuthOption } from "../../../../../wallets/types.js";
|
4
3
|
import {
|
5
4
|
type AuthArgsType,
|
6
5
|
type GetAuthenticatedUserParams,
|
7
6
|
type PreAuthArgsType,
|
7
|
+
type SocialAuthArgsType,
|
8
8
|
UserWalletStatus,
|
9
9
|
} from "../../../core/authentication/types.js";
|
10
10
|
import { getOrCreateInAppWalletConnector } from "../../../core/wallet/in-app-core.js";
|
11
|
-
import type { Ecosystem } from "
|
11
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
12
12
|
|
13
13
|
// ---- KEEP IN SYNC WITH /wallets/in-app/native/auth/index.ts ---- //
|
14
14
|
// duplication needed for separate exports between web and native
|
@@ -142,24 +142,94 @@ export async function preAuthenticate(args: PreAuthArgsType) {
|
|
142
142
|
* ```
|
143
143
|
* @wallet
|
144
144
|
*/
|
145
|
-
export async function authenticate(
|
146
|
-
args
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
145
|
+
export async function authenticate(args: AuthArgsType) {
|
146
|
+
const connector = await getInAppWalletConnector(args.client, args.ecosystem);
|
147
|
+
return connector.authenticate(args);
|
148
|
+
}
|
149
|
+
|
150
|
+
/**
|
151
|
+
* Authenticates the user based on the provided authentication arguments using a redirect.
|
152
|
+
* @param args - The authentication arguments.
|
153
|
+
* @returns A promise that resolves to the authentication result.
|
154
|
+
* @example
|
155
|
+
* ```ts
|
156
|
+
* import { authenticate } from "thirdweb/wallets/in-app";
|
157
|
+
*
|
158
|
+
* const result = await authenticate({
|
159
|
+
* client,
|
160
|
+
* strategy: "google",
|
161
|
+
* mode: "redirect",
|
162
|
+
* redirectUrl: "https://example.org",
|
163
|
+
* });
|
164
|
+
* ```
|
165
|
+
* @wallet
|
166
|
+
*/
|
167
|
+
export async function authenticateWithRedirect(
|
168
|
+
args: SocialAuthArgsType & { client: ThirdwebClient; ecosystem?: Ecosystem },
|
155
169
|
) {
|
156
170
|
const connector = await getInAppWalletConnector(args.client, args.ecosystem);
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
args.strategy as SocialAuthOption,
|
161
|
-
args.mode,
|
162
|
-
args.redirectUrl,
|
171
|
+
if (!connector.authenticateWithRedirect) {
|
172
|
+
throw new Error(
|
173
|
+
"authenticateWithRedirect is not supported on this platform",
|
163
174
|
);
|
164
|
-
|
175
|
+
}
|
176
|
+
return connector.authenticateWithRedirect(
|
177
|
+
args.strategy as SocialAuthOption,
|
178
|
+
args.mode,
|
179
|
+
args.redirectUrl,
|
180
|
+
);
|
181
|
+
}
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Connects a new profile (authentication method) to the current user.
|
185
|
+
* The connected profile can be any valid in-app wallet including email, phone, passkey, etc.
|
186
|
+
* The inputs mirror those used when authenticating normally.
|
187
|
+
*
|
188
|
+
* **When a profile is linked to the account, that profile can then be used to sign into the account.**
|
189
|
+
*
|
190
|
+
* This method is only available for in-app wallets.
|
191
|
+
*
|
192
|
+
* @param wallet - The wallet to link an additional profile to.
|
193
|
+
* @param auth - The authentications options to add the new profile.
|
194
|
+
* @returns A promise that resolves to the currently linked profiles when the connection is successful.
|
195
|
+
* @throws If the connection fails, if the profile is already linked to the account, or if the profile is already associated with another account.
|
196
|
+
*
|
197
|
+
* @example
|
198
|
+
* ```ts
|
199
|
+
* const wallet = inAppWallet();
|
200
|
+
*
|
201
|
+
* await wallet.connect({ client, strategy: "google" });
|
202
|
+
* const profiles = await linkProfile({ client, strategy: "discord" });
|
203
|
+
* ```
|
204
|
+
* @wallet
|
205
|
+
*/
|
206
|
+
export async function linkProfile(args: AuthArgsType) {
|
207
|
+
const connector = await getInAppWalletConnector(args.client, args.ecosystem);
|
208
|
+
return await connector.linkProfile(args);
|
209
|
+
}
|
210
|
+
|
211
|
+
/**
|
212
|
+
* Gets the linked profiles for the connected in-app or ecosystem wallet.
|
213
|
+
*
|
214
|
+
* @returns An array of accounts user profiles linked to the connected wallet.
|
215
|
+
*
|
216
|
+
* @example
|
217
|
+
* ```ts
|
218
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
219
|
+
*
|
220
|
+
* const wallet = inAppWallet();
|
221
|
+
* wallet.connect({ strategy: "google" });
|
222
|
+
*
|
223
|
+
* const profiles = await getProfiles({
|
224
|
+
* client,
|
225
|
+
* });
|
226
|
+
*
|
227
|
+
* console.log(profiles[0].type);
|
228
|
+
* console.log(profiles[0].details.email);
|
229
|
+
* ```
|
230
|
+
* @wallet
|
231
|
+
*/
|
232
|
+
export async function getProfiles(args: GetAuthenticatedUserParams) {
|
233
|
+
const connector = await getInAppWalletConnector(args.client, args.ecosystem);
|
234
|
+
return connector.getProfiles();
|
165
235
|
}
|
@@ -3,7 +3,7 @@ import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
|
|
3
3
|
import type { OAuthOption } from "../../../../../wallets/types.js";
|
4
4
|
import { getLoginUrl } from "../../../core/authentication/getLoginPath.js";
|
5
5
|
import type { AuthStoredTokenWithCookieReturnType } from "../../../core/authentication/types.js";
|
6
|
-
import type { Ecosystem } from "
|
6
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
7
7
|
import { DEFAULT_POP_UP_SIZE } from "./constants.js";
|
8
8
|
|
9
9
|
const closeWindow = ({
|
@@ -6,20 +6,19 @@ import { getRpcClient } from "../../../../rpc/rpc.js";
|
|
6
6
|
import { getAddress } from "../../../../utils/address.js";
|
7
7
|
import { type Hex, toHex } from "../../../../utils/encoding/hex.js";
|
8
8
|
import { parseTypedData } from "../../../../utils/signatures/helpers/parseTypedData.js";
|
9
|
-
import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
10
9
|
import type { Prettify } from "../../../../utils/type-utils.js";
|
11
10
|
import type {
|
12
11
|
Account,
|
13
12
|
SendTransactionOption,
|
14
13
|
} from "../../../interfaces/wallet.js";
|
15
|
-
import { ClientScopedStorage } from "../../core/authentication/client-scoped-storage.js";
|
14
|
+
import type { ClientScopedStorage } from "../../core/authentication/client-scoped-storage.js";
|
16
15
|
import {
|
17
16
|
type GetUser,
|
18
17
|
RecoveryShareManagement,
|
19
18
|
UserWalletStatus,
|
20
19
|
type WalletAddressObjectType,
|
21
20
|
} from "../../core/authentication/types.js";
|
22
|
-
import type { Ecosystem } from "
|
21
|
+
import type { Ecosystem } from "../../core/wallet/types.js";
|
23
22
|
import { getUserStatus } from "./actions/get-enclave-user-status.js";
|
24
23
|
import { signMessage as signEnclaveMessage } from "./actions/sign-message.enclave.js";
|
25
24
|
import { signTransaction as signEnclaveTransaction } from "./actions/sign-transaction.enclave.js";
|
@@ -48,29 +47,26 @@ export type UserStatus = {
|
|
48
47
|
};
|
49
48
|
|
50
49
|
export class EnclaveWallet implements IWebWallet {
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
private client: ThirdwebClient;
|
51
|
+
private ecosystem?: Ecosystem;
|
52
|
+
private address: string;
|
53
|
+
private localStorage: ClientScopedStorage;
|
55
54
|
|
56
55
|
constructor({
|
57
56
|
client,
|
58
57
|
ecosystem,
|
59
58
|
address,
|
59
|
+
storage,
|
60
60
|
}: Prettify<{
|
61
61
|
client: ThirdwebClient;
|
62
62
|
ecosystem?: Ecosystem;
|
63
63
|
address: string;
|
64
|
+
storage: ClientScopedStorage;
|
64
65
|
}>) {
|
65
66
|
this.client = client;
|
66
67
|
this.ecosystem = ecosystem;
|
67
68
|
this.address = address;
|
68
|
-
|
69
|
-
this.localStorage = new ClientScopedStorage({
|
70
|
-
storage: webLocalStorage,
|
71
|
-
clientId: client.clientId,
|
72
|
-
ecosystemId: ecosystem?.id,
|
73
|
-
});
|
69
|
+
this.localStorage = storage;
|
74
70
|
}
|
75
71
|
|
76
72
|
/**
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
3
3
|
import { ClientScopedStorage } from "../../core/authentication/client-scoped-storage.js";
|
4
|
-
import type { Ecosystem } from "
|
4
|
+
import type { Ecosystem } from "../../core/wallet/types.js";
|
5
5
|
|
6
|
+
// TODO: Remove this and properly pass storage from web / native
|
6
7
|
export async function getAuthToken(
|
7
8
|
client: ThirdwebClient,
|
8
9
|
ecosystem?: Ecosystem,
|
@@ -8,22 +8,21 @@ import { getAddress } from "../../../../utils/address.js";
|
|
8
8
|
import { getThirdwebDomains } from "../../../../utils/domains.js";
|
9
9
|
import { type Hex, hexToString } from "../../../../utils/encoding/hex.js";
|
10
10
|
import { parseTypedData } from "../../../../utils/signatures/helpers/parseTypedData.js";
|
11
|
-
import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
12
11
|
import type { Prettify } from "../../../../utils/type-utils.js";
|
13
12
|
import type {
|
14
13
|
Account,
|
15
14
|
SendTransactionOption,
|
16
15
|
} from "../../../interfaces/wallet.js";
|
17
|
-
import { ClientScopedStorage } from "../../core/authentication/client-scoped-storage.js";
|
16
|
+
import type { ClientScopedStorage } from "../../core/authentication/client-scoped-storage.js";
|
18
17
|
import {
|
19
18
|
type GetUser,
|
20
19
|
type GetUserWalletStatusRpcReturnType,
|
21
20
|
UserWalletStatus,
|
22
21
|
type WalletAddressObjectType,
|
23
22
|
} from "../../core/authentication/types.js";
|
23
|
+
import type { Ecosystem } from "../../core/wallet/types.js";
|
24
24
|
import type {
|
25
25
|
ClientIdWithQuerierType,
|
26
|
-
Ecosystem,
|
27
26
|
GetAddressReturnType,
|
28
27
|
SignMessageReturnType,
|
29
28
|
SignTransactionReturnType,
|
@@ -86,20 +85,17 @@ export class IFrameWallet implements IWebWallet {
|
|
86
85
|
client,
|
87
86
|
ecosystem,
|
88
87
|
querier,
|
88
|
+
localStorage,
|
89
89
|
}: Prettify<
|
90
90
|
ClientIdWithQuerierType & {
|
91
91
|
ecosystem?: Ecosystem;
|
92
|
+
localStorage: ClientScopedStorage;
|
92
93
|
}
|
93
94
|
>) {
|
94
95
|
this.client = client;
|
95
96
|
this.ecosystem = ecosystem;
|
96
97
|
this.walletManagerQuerier = querier;
|
97
|
-
|
98
|
-
this.localStorage = new ClientScopedStorage({
|
99
|
-
storage: webLocalStorage,
|
100
|
-
clientId: client.clientId,
|
101
|
-
ecosystemId: ecosystem?.id,
|
102
|
-
});
|
98
|
+
this.localStorage = localStorage;
|
103
99
|
}
|
104
100
|
|
105
101
|
/**
|
@@ -3,13 +3,19 @@ import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
|
3
3
|
import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
4
4
|
import type { SocialAuthOption } from "../../../../wallets/types.js";
|
5
5
|
import type { Account } from "../../../interfaces/wallet.js";
|
6
|
+
import { ClientScopedStorage } from "../../core/authentication/client-scoped-storage.js";
|
6
7
|
import { guestAuthenticate } from "../../core/authentication/guest.js";
|
8
|
+
import {
|
9
|
+
getLinkedProfilesInternal,
|
10
|
+
linkAccount,
|
11
|
+
} from "../../core/authentication/linkAccount.js";
|
7
12
|
import {
|
8
13
|
loginWithPasskey,
|
9
14
|
registerPasskey,
|
10
15
|
} from "../../core/authentication/passkeys.js";
|
11
16
|
import { siweAuthenticate } from "../../core/authentication/siwe.js";
|
12
17
|
import {
|
18
|
+
type AuthArgsType,
|
13
19
|
type AuthLoginReturnType,
|
14
20
|
type AuthStoredTokenWithCookieReturnType,
|
15
21
|
type GetUser,
|
@@ -20,8 +26,9 @@ import {
|
|
20
26
|
UserWalletStatus,
|
21
27
|
} from "../../core/authentication/types.js";
|
22
28
|
import type { InAppConnector } from "../../core/interfaces/connector.js";
|
29
|
+
import type { Ecosystem } from "../../core/wallet/types.js";
|
23
30
|
import { getUserStatus } from "../lib/actions/get-enclave-user-status.js";
|
24
|
-
import type {
|
31
|
+
import type { InAppWalletConstructorType } from "../types.js";
|
25
32
|
import { InAppWalletIframeCommunicator } from "../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
|
26
33
|
import { Auth, type AuthQuerierTypes } from "./auth/iframe-auth.js";
|
27
34
|
import { loginWithOauth, loginWithOauthRedirect } from "./auth/oauth.js";
|
@@ -34,9 +41,10 @@ import { IFrameWallet } from "./iframe-wallet.js";
|
|
34
41
|
* @internal
|
35
42
|
*/
|
36
43
|
export class InAppWebConnector implements InAppConnector {
|
37
|
-
|
38
|
-
|
39
|
-
|
44
|
+
private client: ThirdwebClient;
|
45
|
+
private ecosystem?: Ecosystem;
|
46
|
+
private querier: InAppWalletIframeCommunicator<AuthQuerierTypes>;
|
47
|
+
private localStorage: ClientScopedStorage;
|
40
48
|
|
41
49
|
private wallet?: EnclaveWallet | IFrameWallet;
|
42
50
|
/**
|
@@ -72,6 +80,11 @@ export class InAppWebConnector implements InAppConnector {
|
|
72
80
|
this.client = client;
|
73
81
|
this.ecosystem = ecosystem;
|
74
82
|
this.passkeyDomain = passkeyDomain;
|
83
|
+
this.localStorage = new ClientScopedStorage({
|
84
|
+
storage: webLocalStorage,
|
85
|
+
clientId: client.clientId,
|
86
|
+
ecosystemId: ecosystem?.id,
|
87
|
+
});
|
75
88
|
this.querier = new InAppWalletIframeCommunicator({
|
76
89
|
clientId: client.clientId,
|
77
90
|
ecosystem,
|
@@ -82,6 +95,7 @@ export class InAppWebConnector implements InAppConnector {
|
|
82
95
|
client,
|
83
96
|
querier: this.querier,
|
84
97
|
baseUrl,
|
98
|
+
localStorage: this.localStorage,
|
85
99
|
ecosystem,
|
86
100
|
onAuthSuccess: async (authResult) => {
|
87
101
|
onAuthSuccess?.(authResult);
|
@@ -171,6 +185,7 @@ export class InAppWebConnector implements InAppConnector {
|
|
171
185
|
client: this.client,
|
172
186
|
ecosystem: this.ecosystem,
|
173
187
|
address: user.wallets[0].address,
|
188
|
+
storage: this.localStorage,
|
174
189
|
});
|
175
190
|
return;
|
176
191
|
}
|
@@ -179,6 +194,7 @@ export class InAppWebConnector implements InAppConnector {
|
|
179
194
|
client: this.client,
|
180
195
|
ecosystem: this.ecosystem,
|
181
196
|
querier: this.querier,
|
197
|
+
localStorage: this.localStorage,
|
182
198
|
});
|
183
199
|
}
|
184
200
|
|
@@ -316,6 +332,7 @@ export class InAppWebConnector implements InAppConnector {
|
|
316
332
|
return guestAuthenticate({
|
317
333
|
client: this.client,
|
318
334
|
ecosystem: this.ecosystem,
|
335
|
+
storage: webLocalStorage,
|
319
336
|
});
|
320
337
|
}
|
321
338
|
case "wallet": {
|
@@ -417,6 +434,23 @@ export class InAppWebConnector implements InAppConnector {
|
|
417
434
|
},
|
418
435
|
});
|
419
436
|
}
|
437
|
+
|
438
|
+
async linkProfile(args: AuthArgsType) {
|
439
|
+
const { storedToken } = await this.authenticate(args);
|
440
|
+
return await linkAccount({
|
441
|
+
client: args.client,
|
442
|
+
tokenToLink: storedToken.cookieString,
|
443
|
+
storage: this.localStorage,
|
444
|
+
});
|
445
|
+
}
|
446
|
+
|
447
|
+
async getProfiles() {
|
448
|
+
return getLinkedProfilesInternal({
|
449
|
+
client: this.client,
|
450
|
+
ecosystem: this.ecosystem,
|
451
|
+
storage: this.localStorage,
|
452
|
+
});
|
453
|
+
}
|
420
454
|
}
|
421
455
|
|
422
456
|
function assertUnreachable(x: never, message?: string): never {
|
@@ -2,15 +2,10 @@
|
|
2
2
|
// types for class constructors still a little messy right now.
|
3
3
|
|
4
4
|
import type { ThirdwebClient } from "../../../client/client.js";
|
5
|
-
import type { EcosystemWalletId } from "../../wallet-types.js";
|
6
5
|
import type { AuthAndWalletRpcReturnType } from "../core/authentication/types.js";
|
6
|
+
import type { Ecosystem } from "../core/wallet/types.js";
|
7
7
|
import type { InAppWalletIframeCommunicator } from "./utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
|
8
8
|
|
9
|
-
export type Ecosystem = {
|
10
|
-
id: EcosystemWalletId;
|
11
|
-
partnerId?: string;
|
12
|
-
};
|
13
|
-
|
14
9
|
// Open to PRs from whoever sees this and knows of a cleaner way to handle things
|
15
10
|
type ClientIdConstructorType = {
|
16
11
|
/**
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { webLocalStorage } from "../../../../../utils/storage/webStorage.js";
|
2
2
|
import { ClientScopedStorage } from "../../../core/authentication/client-scoped-storage.js";
|
3
3
|
import { IN_APP_WALLET_PATH } from "../../../core/constants/settings.js";
|
4
|
-
import type { Ecosystem } from "
|
4
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
5
5
|
import { IframeCommunicator } from "./IframeCommunicator.js";
|
6
6
|
|
7
7
|
/**
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useProfiles.js","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/others/useProfiles.ts"],"names":[],"mappings":";;AA0BA,kCAUC;AApCD,uDAAsE;AACtE,iGAAyF;AAEzF,oFAAiF;AAEjF,sEAA+D;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,WAAW;IACzB,MAAM,MAAM,GAAG,IAAA,mCAAc,GAAE,CAAC;IAEhC,OAAO,IAAA,sBAAQ,EAAC;QACd,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC;QAClC,OAAO,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,OAAO,IAAI,IAAA,0CAAiB,EAAC,MAAM,CAAC,CAAC;QACzE,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO,IAAA,yBAAW,EAAC,MAAyB,CAAC,CAAC;QAChD,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useAdminAccount.js","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/wallets/useAdminAccount.ts"],"names":[],"mappings":";;AAQA,wCAgBC;AAxBD,6DAAuD;AACvD,qEAA+D;AAE/D;;;;GAIG;AACH,SAAgB,cAAc;IAC5B,MAAM,YAAY,GAAG,IAAA,oCAAe,GAAE,CAAC;IACvC,MAAM,gBAAgB,GAAG,IAAA,4CAAmB,GAAE,CAAC;IAC/C,MAAM,YAAY,GAAG,YAAY,EAAE,eAAe,EAAE,EAAE,CAAC;IAEvD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,+EAA+E;QAC/E,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,sGAAsG;IACtG,OAAO,gBAAgB,CAAC,IAAI,CAC1B,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;QAC3C,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,CACvC,CAAC;AACJ,CAAC"}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getProfiles = getProfiles;
|
4
|
-
exports.linkProfile = linkProfile;
|
5
|
-
const is_ecosystem_wallet_js_1 = require("../../../../wallets/ecosystem/is-ecosystem-wallet.js");
|
6
|
-
/**
|
7
|
-
* Gets the linked profiles for the provided wallet.
|
8
|
-
* This method is only available for in-app wallets.
|
9
|
-
*
|
10
|
-
* @returns An array of accounts user profiles linked to the current wallet.
|
11
|
-
*
|
12
|
-
* @example
|
13
|
-
* ```ts
|
14
|
-
* import { inAppWallet } from "thirdweb/wallets";
|
15
|
-
*
|
16
|
-
* const wallet = inAppWallet();
|
17
|
-
* wallet.connect({ strategy: "google" });
|
18
|
-
*
|
19
|
-
* const profiles = await getProfiles(wallet);
|
20
|
-
*
|
21
|
-
* console.log(profiles[0].type);
|
22
|
-
* console.log(profiles[0].details.email);
|
23
|
-
* ```
|
24
|
-
* @wallet
|
25
|
-
*/
|
26
|
-
async function getProfiles(wallet) {
|
27
|
-
if (wallet.id !== "inApp" && !(0, is_ecosystem_wallet_js_1.isEcosystemWallet)(wallet)) {
|
28
|
-
throw new Error("Multi-auth currently only supports in-app wallets");
|
29
|
-
}
|
30
|
-
return wallet.getProfiles();
|
31
|
-
}
|
32
|
-
/**
|
33
|
-
* Connects a new profile (authentication method) to the current user.
|
34
|
-
* The connected profile can be any valid in-app wallet including email, phone, passkey, etc.
|
35
|
-
* The inputs mirror those used when authenticating normally.
|
36
|
-
*
|
37
|
-
* **When a profile is linked to the account, that profile can then be used to sign into the account.**
|
38
|
-
*
|
39
|
-
* This method is only available for in-app wallets.
|
40
|
-
*
|
41
|
-
* @param wallet - The wallet to link an additional profile to.
|
42
|
-
* @param auth - The authentications options to add the new profile.
|
43
|
-
* @returns A promise that resolves to the currently linked profiles when the connection is successful.
|
44
|
-
* @throws If the connection fails, if the profile is already linked to the account, or if the profile is already associated with another account.
|
45
|
-
*
|
46
|
-
* @example
|
47
|
-
* ```ts
|
48
|
-
* const wallet = inAppWallet();
|
49
|
-
*
|
50
|
-
* await wallet.connect({ strategy: "google" });
|
51
|
-
* const profiles = await linkProfile(wallet, { strategy: "discord" });
|
52
|
-
* ```
|
53
|
-
* @wallet
|
54
|
-
*/
|
55
|
-
async function linkProfile(wallet, auth) {
|
56
|
-
if (wallet.id !== "inApp" && !(0, is_ecosystem_wallet_js_1.isEcosystemWallet)(wallet)) {
|
57
|
-
throw new Error("Multi-auth currently only supports in-app wallets");
|
58
|
-
}
|
59
|
-
return wallet.linkProfile(auth);
|
60
|
-
}
|
61
|
-
//# sourceMappingURL=profiles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/wallet/profiles.ts"],"names":[],"mappings":";;AA6BA,kCAQC;AAyBD,kCAaC;AA3ED,iGAAyF;AASzF;;;;;;;;;;;;;;;;;;;GAmBG;AACI,KAAK,UAAU,WAAW,CAAC,MAA2C;IAC3E,IAAI,MAAM,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,IAAA,0CAAiB,EAAC,MAAM,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OACE,MACD,CAAC,WAAW,EAAE,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,KAAK,UAAU,WAAW,CAC/B,MAA2C,EAC3C,IAAoD;IAEpD,IAAI,MAAM,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,IAAA,0CAAiB,EAAC,MAAM,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OACE,MAGD,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useProfiles.js","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/others/useProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAC;AAEjF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAEhC,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC;QAClC,OAAO,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACzE,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO,WAAW,CAAC,MAAyB,CAAC,CAAC;QAChD,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useAdminAccount.js","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/wallets/useAdminAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,YAAY,GAAG,YAAY,EAAE,eAAe,EAAE,EAAE,CAAC;IAEvD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,+EAA+E;QAC/E,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,sGAAsG;IACtG,OAAO,gBAAgB,CAAC,IAAI,CAC1B,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;QAC3C,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,CACvC,CAAC;AACJ,CAAC"}
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
|
2
|
-
/**
|
3
|
-
* Gets the linked profiles for the provided wallet.
|
4
|
-
* This method is only available for in-app wallets.
|
5
|
-
*
|
6
|
-
* @returns An array of accounts user profiles linked to the current wallet.
|
7
|
-
*
|
8
|
-
* @example
|
9
|
-
* ```ts
|
10
|
-
* import { inAppWallet } from "thirdweb/wallets";
|
11
|
-
*
|
12
|
-
* const wallet = inAppWallet();
|
13
|
-
* wallet.connect({ strategy: "google" });
|
14
|
-
*
|
15
|
-
* const profiles = await getProfiles(wallet);
|
16
|
-
*
|
17
|
-
* console.log(profiles[0].type);
|
18
|
-
* console.log(profiles[0].details.email);
|
19
|
-
* ```
|
20
|
-
* @wallet
|
21
|
-
*/
|
22
|
-
export async function getProfiles(wallet) {
|
23
|
-
if (wallet.id !== "inApp" && !isEcosystemWallet(wallet)) {
|
24
|
-
throw new Error("Multi-auth currently only supports in-app wallets");
|
25
|
-
}
|
26
|
-
return wallet.getProfiles();
|
27
|
-
}
|
28
|
-
/**
|
29
|
-
* Connects a new profile (authentication method) to the current user.
|
30
|
-
* The connected profile can be any valid in-app wallet including email, phone, passkey, etc.
|
31
|
-
* The inputs mirror those used when authenticating normally.
|
32
|
-
*
|
33
|
-
* **When a profile is linked to the account, that profile can then be used to sign into the account.**
|
34
|
-
*
|
35
|
-
* This method is only available for in-app wallets.
|
36
|
-
*
|
37
|
-
* @param wallet - The wallet to link an additional profile to.
|
38
|
-
* @param auth - The authentications options to add the new profile.
|
39
|
-
* @returns A promise that resolves to the currently linked profiles when the connection is successful.
|
40
|
-
* @throws If the connection fails, if the profile is already linked to the account, or if the profile is already associated with another account.
|
41
|
-
*
|
42
|
-
* @example
|
43
|
-
* ```ts
|
44
|
-
* const wallet = inAppWallet();
|
45
|
-
*
|
46
|
-
* await wallet.connect({ strategy: "google" });
|
47
|
-
* const profiles = await linkProfile(wallet, { strategy: "discord" });
|
48
|
-
* ```
|
49
|
-
* @wallet
|
50
|
-
*/
|
51
|
-
export async function linkProfile(wallet, auth) {
|
52
|
-
if (wallet.id !== "inApp" && !isEcosystemWallet(wallet)) {
|
53
|
-
throw new Error("Multi-auth currently only supports in-app wallets");
|
54
|
-
}
|
55
|
-
return wallet.linkProfile(auth);
|
56
|
-
}
|
57
|
-
//# sourceMappingURL=profiles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/wallet/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AASzF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAA2C;IAC3E,IAAI,MAAM,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OACE,MACD,CAAC,WAAW,EAAE,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAA2C,EAC3C,IAAoD;IAEpD,IAAI,MAAM,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OACE,MAGD,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useProfiles.d.ts","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/others/useProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yDAAyD,CAAC;AAKvF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC,CAUvD"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useAdminAccount.d.ts","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/wallets/useAdminAccount.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,cAAc,gEAgB7B"}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import type { EcosystemWalletId } from "../../../../wallets/wallet-types.js";
|
2
|
-
import type { Wallet } from "../../../interfaces/wallet.js";
|
3
|
-
import type { MultiStepAuthArgsType, Profile, SingleStepAuthArgsType } from "../authentication/types.js";
|
4
|
-
/**
|
5
|
-
* Gets the linked profiles for the provided wallet.
|
6
|
-
* This method is only available for in-app wallets.
|
7
|
-
*
|
8
|
-
* @returns An array of accounts user profiles linked to the current wallet.
|
9
|
-
*
|
10
|
-
* @example
|
11
|
-
* ```ts
|
12
|
-
* import { inAppWallet } from "thirdweb/wallets";
|
13
|
-
*
|
14
|
-
* const wallet = inAppWallet();
|
15
|
-
* wallet.connect({ strategy: "google" });
|
16
|
-
*
|
17
|
-
* const profiles = await getProfiles(wallet);
|
18
|
-
*
|
19
|
-
* console.log(profiles[0].type);
|
20
|
-
* console.log(profiles[0].details.email);
|
21
|
-
* ```
|
22
|
-
* @wallet
|
23
|
-
*/
|
24
|
-
export declare function getProfiles(wallet: Wallet<"inApp" | EcosystemWalletId>): Promise<Profile[]>;
|
25
|
-
/**
|
26
|
-
* Connects a new profile (authentication method) to the current user.
|
27
|
-
* The connected profile can be any valid in-app wallet including email, phone, passkey, etc.
|
28
|
-
* The inputs mirror those used when authenticating normally.
|
29
|
-
*
|
30
|
-
* **When a profile is linked to the account, that profile can then be used to sign into the account.**
|
31
|
-
*
|
32
|
-
* This method is only available for in-app wallets.
|
33
|
-
*
|
34
|
-
* @param wallet - The wallet to link an additional profile to.
|
35
|
-
* @param auth - The authentications options to add the new profile.
|
36
|
-
* @returns A promise that resolves to the currently linked profiles when the connection is successful.
|
37
|
-
* @throws If the connection fails, if the profile is already linked to the account, or if the profile is already associated with another account.
|
38
|
-
*
|
39
|
-
* @example
|
40
|
-
* ```ts
|
41
|
-
* const wallet = inAppWallet();
|
42
|
-
*
|
43
|
-
* await wallet.connect({ strategy: "google" });
|
44
|
-
* const profiles = await linkProfile(wallet, { strategy: "discord" });
|
45
|
-
* ```
|
46
|
-
* @wallet
|
47
|
-
*/
|
48
|
-
export declare function linkProfile(wallet: Wallet<"inApp" | EcosystemWalletId>, auth: MultiStepAuthArgsType | SingleStepAuthArgsType): Promise<Profile[]>;
|
49
|
-
//# sourceMappingURL=profiles.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/wallet/profiles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,EACV,qBAAqB,EACrB,OAAO,EACP,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAAC,sBAQ5E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAAC,EAC3C,IAAI,EAAE,qBAAqB,GAAG,sBAAsB,GACnD,OAAO,CAAC,OAAO,EAAE,CAAC,CAUpB"}
|