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
@@ -8,18 +8,9 @@ import type {
|
|
8
8
|
CreateWalletArgs,
|
9
9
|
EcosystemWalletId,
|
10
10
|
} from "../../../wallet-types.js";
|
11
|
-
import type { Ecosystem } from "../../web/types.js";
|
12
|
-
import {
|
13
|
-
getLinkedProfilesInternal,
|
14
|
-
linkAccount as linkProfileWithToken,
|
15
|
-
} from "../authentication/linkAccount.js";
|
16
|
-
import type {
|
17
|
-
MultiStepAuthArgsType,
|
18
|
-
Profile,
|
19
|
-
SingleStepAuthArgsType,
|
20
|
-
} from "../authentication/types.js";
|
21
11
|
import type { InAppConnector } from "../interfaces/connector.js";
|
22
12
|
import { getOrCreateInAppWalletConnector } from "./in-app-core.js";
|
13
|
+
import type { Ecosystem } from "./types.js";
|
23
14
|
|
24
15
|
/**
|
25
16
|
* @internal
|
@@ -52,13 +43,6 @@ export function createEcosystemWallet(args: {
|
|
52
43
|
return chain;
|
53
44
|
},
|
54
45
|
getConfig: () => createOptions,
|
55
|
-
getProfiles: async () => {
|
56
|
-
if (!client) {
|
57
|
-
return [];
|
58
|
-
}
|
59
|
-
|
60
|
-
return getLinkedProfilesInternal({ client, ecosystem });
|
61
|
-
},
|
62
46
|
getAccount: () => account,
|
63
47
|
autoConnect: async (options) => {
|
64
48
|
const { autoConnectInAppWallet } = await import("./index.js");
|
@@ -133,28 +117,5 @@ export function createEcosystemWallet(args: {
|
|
133
117
|
chain = newChain;
|
134
118
|
emitter.emit("chainChanged", newChain);
|
135
119
|
},
|
136
|
-
// This is not included on the global interface but is force-resolved in linkProfile
|
137
|
-
linkProfile: async (
|
138
|
-
options: SingleStepAuthArgsType | MultiStepAuthArgsType,
|
139
|
-
): Promise<Profile[]> => {
|
140
|
-
if (!client) {
|
141
|
-
throw new Error(
|
142
|
-
"No client found, please connect the wallet before linking a profile",
|
143
|
-
);
|
144
|
-
}
|
145
|
-
|
146
|
-
const connector = await getOrCreateInAppWalletConnector(
|
147
|
-
client,
|
148
|
-
connectorFactory,
|
149
|
-
ecosystem,
|
150
|
-
);
|
151
|
-
|
152
|
-
const { storedToken } = await connector.authenticate(options);
|
153
|
-
return await linkProfileWithToken({
|
154
|
-
client,
|
155
|
-
ecosystem,
|
156
|
-
tokenToLink: storedToken.cookieString,
|
157
|
-
});
|
158
|
-
},
|
159
120
|
} as Wallet<EcosystemWalletId>;
|
160
121
|
}
|
@@ -5,17 +5,8 @@ import type { ThirdwebClient } from "../../../../client/client.js";
|
|
5
5
|
import type { Account, Wallet } from "../../../interfaces/wallet.js";
|
6
6
|
import { createWalletEmitter } from "../../../wallet-emitter.js";
|
7
7
|
import type { CreateWalletArgs } from "../../../wallet-types.js";
|
8
|
-
import type { Ecosystem } from "../../web/types.js";
|
9
|
-
import {
|
10
|
-
getLinkedProfilesInternal,
|
11
|
-
linkAccount as linkProfileWithToken,
|
12
|
-
} from "../authentication/linkAccount.js";
|
13
|
-
import type {
|
14
|
-
MultiStepAuthArgsType,
|
15
|
-
Profile,
|
16
|
-
SingleStepAuthArgsType,
|
17
|
-
} from "../authentication/types.js";
|
18
8
|
import type { InAppConnector } from "../interfaces/connector.js";
|
9
|
+
import type { Ecosystem } from "./types.js";
|
19
10
|
|
20
11
|
const connectorCache = new Map<string, InAppConnector>();
|
21
12
|
|
@@ -62,33 +53,6 @@ export function createInAppWallet(args: {
|
|
62
53
|
},
|
63
54
|
getConfig: () => createOptions,
|
64
55
|
getAccount: () => account,
|
65
|
-
/**
|
66
|
-
* @description
|
67
|
-
* Gets the linked profiles for the current wallet.
|
68
|
-
* This method is only available for in-app or ecosystem wallets.
|
69
|
-
*
|
70
|
-
* @returns An array of accounts user profiles linked to the current wallet.
|
71
|
-
*
|
72
|
-
* @example
|
73
|
-
* ```ts
|
74
|
-
* import { inAppWallet } from "thirdweb/wallets";
|
75
|
-
*
|
76
|
-
* const wallet = inAppWallet();
|
77
|
-
* wallet.connect({ strategy: "google" });
|
78
|
-
*
|
79
|
-
* const profiles = wallet.getProfiles();
|
80
|
-
*
|
81
|
-
* console.log(profiles[0].type);
|
82
|
-
* console.log(profiles[0].details.email);
|
83
|
-
* ```
|
84
|
-
*/
|
85
|
-
getProfiles: async () => {
|
86
|
-
if (!client) {
|
87
|
-
return [];
|
88
|
-
}
|
89
|
-
|
90
|
-
return getLinkedProfilesInternal({ client });
|
91
|
-
},
|
92
56
|
autoConnect: async (options) => {
|
93
57
|
const { autoConnectInAppWallet } = await import("./index.js");
|
94
58
|
|
@@ -178,26 +142,5 @@ export function createInAppWallet(args: {
|
|
178
142
|
}
|
179
143
|
emitter.emit("chainChanged", newChain);
|
180
144
|
},
|
181
|
-
// This is not included on the global interface but is force-resolved in linkProfile
|
182
|
-
linkProfile: async (
|
183
|
-
options: SingleStepAuthArgsType | MultiStepAuthArgsType,
|
184
|
-
): Promise<Profile[]> => {
|
185
|
-
if (!client) {
|
186
|
-
throw new Error(
|
187
|
-
"No client found, please connect the wallet before linking a profile",
|
188
|
-
);
|
189
|
-
}
|
190
|
-
|
191
|
-
const connector = await getOrCreateInAppWalletConnector(
|
192
|
-
client,
|
193
|
-
connectorFactory,
|
194
|
-
);
|
195
|
-
|
196
|
-
const { storedToken } = await connector.authenticate(options);
|
197
|
-
return await linkProfileWithToken({
|
198
|
-
client,
|
199
|
-
tokenToLink: storedToken.cookieString,
|
200
|
-
});
|
201
|
-
},
|
202
145
|
} as Wallet<"inApp">;
|
203
146
|
}
|
@@ -6,12 +6,18 @@ import type {
|
|
6
6
|
OAuthOption,
|
7
7
|
SocialAuthOption,
|
8
8
|
} from "../../../types.js";
|
9
|
+
import type { EcosystemWalletId } from "../../../wallet-types.js";
|
9
10
|
import type {
|
10
11
|
AuthStoredTokenWithCookieReturnType,
|
11
12
|
MultiStepAuthArgsType,
|
12
13
|
SingleStepAuthArgsType,
|
13
14
|
} from "../authentication/types.js";
|
14
15
|
|
16
|
+
export type Ecosystem = {
|
17
|
+
id: EcosystemWalletId;
|
18
|
+
partnerId?: string;
|
19
|
+
};
|
20
|
+
|
15
21
|
export type InAppWalletConnectionOptions = (
|
16
22
|
| MultiStepAuthArgsType
|
17
23
|
| SingleStepAuthArgsType
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import {
|
3
3
|
type AuthArgsType,
|
4
|
-
type AuthLoginReturnType,
|
5
4
|
type GetAuthenticatedUserParams,
|
6
5
|
type PreAuthArgsType,
|
7
6
|
UserWalletStatus,
|
8
7
|
} from "../../core/authentication/types.js";
|
9
8
|
import { getOrCreateInAppWalletConnector } from "../../core/wallet/in-app-core.js";
|
9
|
+
import type { Ecosystem } from "../../core/wallet/types.js";
|
10
10
|
|
11
11
|
// ---- KEEP IN SYNC WITH /wallets/in-app/web/lib/auth/index.ts ---- //
|
12
12
|
// duplication needed for separate exports between web and native
|
@@ -14,11 +14,15 @@ import { getOrCreateInAppWalletConnector } from "../../core/wallet/in-app-core.j
|
|
14
14
|
/**
|
15
15
|
* @internal
|
16
16
|
*/
|
17
|
-
async function getInAppWalletConnector(
|
17
|
+
async function getInAppWalletConnector(
|
18
|
+
client: ThirdwebClient,
|
19
|
+
ecosystem?: Ecosystem,
|
20
|
+
) {
|
18
21
|
return getOrCreateInAppWalletConnector(client, async (client) => {
|
19
22
|
const { InAppNativeConnector } = await import("../native-connector.js");
|
20
23
|
return new InAppNativeConnector({
|
21
24
|
client: client,
|
25
|
+
ecosystem: ecosystem,
|
22
26
|
});
|
23
27
|
});
|
24
28
|
}
|
@@ -131,9 +135,61 @@ export async function preAuthenticate(args: PreAuthArgsType) {
|
|
131
135
|
* ```
|
132
136
|
* @wallet
|
133
137
|
*/
|
134
|
-
export async function authenticate(
|
135
|
-
args: AuthArgsType,
|
136
|
-
): Promise<AuthLoginReturnType> {
|
138
|
+
export async function authenticate(args: AuthArgsType) {
|
137
139
|
const connector = await getInAppWalletConnector(args.client);
|
138
|
-
return connector.
|
140
|
+
return connector.authenticate(args);
|
141
|
+
}
|
142
|
+
|
143
|
+
/**
|
144
|
+
* Connects a new profile (authentication method) to the current user.
|
145
|
+
* The connected profile can be any valid in-app wallet including email, phone, passkey, etc.
|
146
|
+
* The inputs mirror those used when authenticating normally.
|
147
|
+
*
|
148
|
+
* **When a profile is linked to the account, that profile can then be used to sign into the account.**
|
149
|
+
*
|
150
|
+
* This method is only available for in-app wallets.
|
151
|
+
*
|
152
|
+
* @param wallet - The wallet to link an additional profile to.
|
153
|
+
* @param auth - The authentications options to add the new profile.
|
154
|
+
* @returns A promise that resolves to the currently linked profiles when the connection is successful.
|
155
|
+
* @throws If the connection fails, if the profile is already linked to the account, or if the profile is already associated with another account.
|
156
|
+
*
|
157
|
+
* @example
|
158
|
+
* ```ts
|
159
|
+
* const wallet = inAppWallet();
|
160
|
+
*
|
161
|
+
* await wallet.connect({ client, strategy: "google" });
|
162
|
+
* const profiles = await linkProfile({ client, strategy: "discord" });
|
163
|
+
* ```
|
164
|
+
* @wallet
|
165
|
+
*/
|
166
|
+
export async function linkProfile(args: AuthArgsType) {
|
167
|
+
const connector = await getInAppWalletConnector(args.client, args.ecosystem);
|
168
|
+
return await connector.linkProfile(args);
|
169
|
+
}
|
170
|
+
|
171
|
+
/**
|
172
|
+
* Gets the linked profiles for the connected in-app or ecosystem wallet.
|
173
|
+
*
|
174
|
+
* @returns An array of accounts user profiles linked to the connected wallet.
|
175
|
+
*
|
176
|
+
* @example
|
177
|
+
* ```ts
|
178
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
179
|
+
*
|
180
|
+
* const wallet = inAppWallet();
|
181
|
+
* wallet.connect({ strategy: "google" });
|
182
|
+
*
|
183
|
+
* const profiles = await getProfiles({
|
184
|
+
* client,
|
185
|
+
* });
|
186
|
+
*
|
187
|
+
* console.log(profiles[0].type);
|
188
|
+
* console.log(profiles[0].details.email);
|
189
|
+
* ```
|
190
|
+
* @wallet
|
191
|
+
*/
|
192
|
+
export async function getProfiles(args: GetAuthenticatedUserParams) {
|
193
|
+
const connector = await getInAppWalletConnector(args.client, args.ecosystem);
|
194
|
+
return connector.getProfiles();
|
139
195
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as WebBrowser from "expo-web-browser";
|
2
2
|
import type { Chain } from "../../../../chains/types.js";
|
3
3
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
4
|
+
import { nativeLocalStorage } from "../../../../utils/storage/nativeStorage.js";
|
4
5
|
import type { Wallet } from "../../../interfaces/wallet.js";
|
5
6
|
import { getLoginUrl } from "../../core/authentication/getLoginPath.js";
|
6
7
|
import { guestAuthenticate } from "../../core/authentication/guest.js";
|
@@ -10,8 +11,8 @@ import type {
|
|
10
11
|
MultiStepAuthArgsType,
|
11
12
|
OAuthRedirectObject,
|
12
13
|
} from "../../core/authentication/types.js";
|
14
|
+
import type { Ecosystem } from "../../core/wallet/types.js";
|
13
15
|
import { verifyOtp } from "../../web/lib/auth/otp.js";
|
14
|
-
import type { Ecosystem } from "../../web/types.js";
|
15
16
|
import {
|
16
17
|
deleteAccount,
|
17
18
|
getSessionHeaders,
|
@@ -166,6 +167,7 @@ export async function guestLogin(
|
|
166
167
|
const { storedToken } = await guestAuthenticate({
|
167
168
|
client,
|
168
169
|
ecosystem,
|
170
|
+
storage: nativeLocalStorage,
|
169
171
|
});
|
170
172
|
try {
|
171
173
|
const toStoreToken: AuthStoredTokenWithCookieReturnType["storedToken"] = {
|
@@ -3,7 +3,12 @@ import type { ThirdwebClient } from "../../../client/client.js";
|
|
3
3
|
import { stringify } from "../../../utils/json.js";
|
4
4
|
import { nativeLocalStorage } from "../../../utils/storage/nativeStorage.js";
|
5
5
|
import type { Account, Wallet } 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,
|
@@ -21,8 +26,8 @@ import {
|
|
21
26
|
UserWalletStatus,
|
22
27
|
} from "../core/authentication/types.js";
|
23
28
|
import type { InAppConnector } from "../core/interfaces/connector.js";
|
29
|
+
import type { Ecosystem } from "../core/wallet/types.js";
|
24
30
|
import { sendOtp, verifyOtp } from "../web/lib/auth/otp.js";
|
25
|
-
import type { Ecosystem } from "../web/types.js";
|
26
31
|
import {
|
27
32
|
authEndpoint,
|
28
33
|
authenticate,
|
@@ -41,21 +46,31 @@ import { getExistingUserAccount } from "./helpers/wallet/retrieval.js";
|
|
41
46
|
|
42
47
|
type NativeConnectorOptions = {
|
43
48
|
client: ThirdwebClient;
|
44
|
-
|
49
|
+
ecosystem?: Ecosystem;
|
45
50
|
passkeyDomain?: string;
|
46
51
|
};
|
47
52
|
|
48
53
|
export class InAppNativeConnector implements InAppConnector {
|
49
|
-
private
|
54
|
+
private client: ThirdwebClient;
|
55
|
+
private ecosystem?: Ecosystem;
|
56
|
+
private passkeyDomain?: string;
|
57
|
+
private localStorage: ClientScopedStorage;
|
50
58
|
|
51
59
|
constructor(options: NativeConnectorOptions) {
|
52
|
-
this.
|
60
|
+
this.client = options.client;
|
61
|
+
this.ecosystem = options.ecosystem;
|
62
|
+
this.passkeyDomain = options.passkeyDomain;
|
63
|
+
this.localStorage = new ClientScopedStorage({
|
64
|
+
storage: nativeLocalStorage,
|
65
|
+
clientId: this.client.clientId,
|
66
|
+
ecosystemId: this.ecosystem?.id,
|
67
|
+
});
|
53
68
|
}
|
54
69
|
|
55
70
|
async getUser(): Promise<GetUser> {
|
56
|
-
const localData = await getWalletUserDetails(this.
|
71
|
+
const localData = await getWalletUserDetails(this.client.clientId);
|
57
72
|
const userStatus = await fetchUserDetails({
|
58
|
-
client: this.
|
73
|
+
client: this.client,
|
59
74
|
email: localData?.email,
|
60
75
|
});
|
61
76
|
if (userStatus.status === UserWalletStatus.LOGGED_IN_WALLET_INITIALIZED) {
|
@@ -82,13 +97,13 @@ export class InAppNativeConnector implements InAppConnector {
|
|
82
97
|
return { status: UserWalletStatus.LOGGED_OUT };
|
83
98
|
}
|
84
99
|
getAccount(): Promise<Account> {
|
85
|
-
return getExistingUserAccount({ client: this.
|
100
|
+
return getExistingUserAccount({ client: this.client });
|
86
101
|
}
|
87
102
|
|
88
103
|
preAuthenticate(args: MultiStepAuthProviderType): Promise<void> {
|
89
104
|
return sendOtp({
|
90
105
|
...args,
|
91
|
-
client: this.
|
106
|
+
client: this.client,
|
92
107
|
});
|
93
108
|
}
|
94
109
|
|
@@ -103,13 +118,14 @@ export class InAppNativeConnector implements InAppConnector {
|
|
103
118
|
}
|
104
119
|
case "guest": {
|
105
120
|
return guestAuthenticate({
|
106
|
-
client: this.
|
121
|
+
client: this.client,
|
107
122
|
ecosystem: params.ecosystem,
|
123
|
+
storage: nativeLocalStorage,
|
108
124
|
});
|
109
125
|
}
|
110
126
|
case "wallet": {
|
111
127
|
return siweAuthenticate({
|
112
|
-
client: this.
|
128
|
+
client: this.client,
|
113
129
|
wallet: params.wallet,
|
114
130
|
chain: params.chain,
|
115
131
|
});
|
@@ -123,7 +139,7 @@ export class InAppNativeConnector implements InAppConnector {
|
|
123
139
|
const ExpoLinking = require("expo-linking");
|
124
140
|
const redirectUrl =
|
125
141
|
params.redirectUrl || (ExpoLinking.createURL("") as string);
|
126
|
-
return authenticate({ strategy, redirectUrl }, this.
|
142
|
+
return authenticate({ strategy, redirectUrl }, this.client);
|
127
143
|
}
|
128
144
|
case "passkey":
|
129
145
|
return this.passkeyAuth(params);
|
@@ -140,7 +156,7 @@ export class InAppNativeConnector implements InAppConnector {
|
|
140
156
|
email: params.email,
|
141
157
|
verificationCode: params.verificationCode,
|
142
158
|
strategy: "email",
|
143
|
-
client: this.
|
159
|
+
client: this.client,
|
144
160
|
});
|
145
161
|
}
|
146
162
|
case "phone": {
|
@@ -148,7 +164,7 @@ export class InAppNativeConnector implements InAppConnector {
|
|
148
164
|
phoneNumber: params.phoneNumber,
|
149
165
|
verificationCode: params.verificationCode,
|
150
166
|
strategy: "phone",
|
151
|
-
client: this.
|
167
|
+
client: this.client,
|
152
168
|
});
|
153
169
|
}
|
154
170
|
case "google":
|
@@ -221,7 +237,7 @@ export class InAppNativeConnector implements InAppConnector {
|
|
221
237
|
ecosystem?: Ecosystem;
|
222
238
|
}): Promise<AuthStoredTokenWithCookieReturnType> {
|
223
239
|
const { type, passkeyName, client, ecosystem } = args;
|
224
|
-
const domain = this.
|
240
|
+
const domain = this.passkeyDomain;
|
225
241
|
if (!domain) {
|
226
242
|
throw new Error(
|
227
243
|
"Passkey domain is required for native platforms. Please pass it in the 'auth' options when creating the inAppWallet().",
|
@@ -311,14 +327,14 @@ export class InAppNativeConnector implements InAppConnector {
|
|
311
327
|
|
312
328
|
// TODO (rn) expose in the interface
|
313
329
|
async deleteActiveAccount() {
|
314
|
-
return deleteActiveAccount({ client: this.
|
330
|
+
return deleteActiveAccount({ client: this.client });
|
315
331
|
}
|
316
332
|
|
317
333
|
private async socialLogin(
|
318
334
|
auth: OAuthRedirectObject,
|
319
335
|
): Promise<AuthLoginReturnType> {
|
320
336
|
try {
|
321
|
-
const { storedToken } = await socialLogin(auth, this.
|
337
|
+
const { storedToken } = await socialLogin(auth, this.client);
|
322
338
|
const account = await this.getAccount();
|
323
339
|
return {
|
324
340
|
user: {
|
@@ -343,7 +359,7 @@ export class InAppNativeConnector implements InAppConnector {
|
|
343
359
|
}): Promise<AuthLoginReturnType> {
|
344
360
|
try {
|
345
361
|
const { storedToken } = await siweLogin(
|
346
|
-
this.
|
362
|
+
this.client,
|
347
363
|
options.wallet,
|
348
364
|
options.chain,
|
349
365
|
);
|
@@ -375,10 +391,7 @@ export class InAppNativeConnector implements InAppConnector {
|
|
375
391
|
ecosystem?: Ecosystem;
|
376
392
|
}): Promise<AuthLoginReturnType> {
|
377
393
|
try {
|
378
|
-
const { storedToken } = await guestLogin(
|
379
|
-
this.options.client,
|
380
|
-
options.ecosystem,
|
381
|
-
);
|
394
|
+
const { storedToken } = await guestLogin(this.client, options.ecosystem);
|
382
395
|
const account = await this.getAccount();
|
383
396
|
return {
|
384
397
|
user: {
|
@@ -401,7 +414,7 @@ export class InAppNativeConnector implements InAppConnector {
|
|
401
414
|
password: string;
|
402
415
|
}): Promise<AuthLoginReturnType> {
|
403
416
|
try {
|
404
|
-
const { storedToken } = await customJwt(authOptions, this.
|
417
|
+
const { storedToken } = await customJwt(authOptions, this.client);
|
405
418
|
const account = await this.getAccount();
|
406
419
|
return {
|
407
420
|
user: {
|
@@ -422,10 +435,7 @@ export class InAppNativeConnector implements InAppConnector {
|
|
422
435
|
encryptionKey: string;
|
423
436
|
}): Promise<AuthLoginReturnType> {
|
424
437
|
try {
|
425
|
-
const { storedToken } = await authEndpoint(
|
426
|
-
authOptions,
|
427
|
-
this.options.client,
|
428
|
-
);
|
438
|
+
const { storedToken } = await authEndpoint(authOptions, this.client);
|
429
439
|
const account = await this.getAccount();
|
430
440
|
return {
|
431
441
|
user: {
|
@@ -442,7 +452,24 @@ export class InAppNativeConnector implements InAppConnector {
|
|
442
452
|
}
|
443
453
|
|
444
454
|
logout(): Promise<LogoutReturnType> {
|
445
|
-
return logoutUser(this.
|
455
|
+
return logoutUser(this.client.clientId);
|
456
|
+
}
|
457
|
+
|
458
|
+
async linkProfile(args: AuthArgsType) {
|
459
|
+
const { storedToken } = await this.authenticate(args);
|
460
|
+
return await linkAccount({
|
461
|
+
client: args.client,
|
462
|
+
tokenToLink: storedToken.cookieString,
|
463
|
+
storage: this.localStorage,
|
464
|
+
});
|
465
|
+
}
|
466
|
+
|
467
|
+
async getProfiles() {
|
468
|
+
return getLinkedProfilesInternal({
|
469
|
+
client: this.client,
|
470
|
+
ecosystem: this.ecosystem,
|
471
|
+
storage: this.localStorage,
|
472
|
+
});
|
446
473
|
}
|
447
474
|
}
|
448
475
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
2
2
|
import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
|
3
3
|
import { getClientFetch } from "../../../../../utils/fetch.js";
|
4
|
-
import type { Ecosystem } from "
|
4
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
5
5
|
|
6
6
|
/**
|
7
7
|
* Generate a new enclave wallet using an auth token
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
2
2
|
import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
|
3
3
|
import { getClientFetch } from "../../../../../utils/fetch.js";
|
4
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
4
5
|
import type { UserStatus } from "../../lib/enclave-wallet.js";
|
5
|
-
import type { Ecosystem } from "../../types.js";
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Gets the user's status from the backend.
|
@@ -2,7 +2,7 @@ import type { ThirdwebClient } from "../../../../../client/client.js";
|
|
2
2
|
import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
|
3
3
|
import { getClientFetch } from "../../../../../utils/fetch.js";
|
4
4
|
import { stringify } from "../../../../../utils/json.js";
|
5
|
-
import type { Ecosystem } from "
|
5
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
6
6
|
import { getAuthToken } from "../get-auth-token.js";
|
7
7
|
|
8
8
|
export async function signMessage({
|
@@ -18,7 +18,7 @@ export async function signMessage({
|
|
18
18
|
};
|
19
19
|
}) {
|
20
20
|
const clientFetch = getClientFetch(client, ecosystem);
|
21
|
-
const authToken = await getAuthToken(client, ecosystem);
|
21
|
+
const authToken = await getAuthToken(client, ecosystem); // TODO (enclave): pass storage from web/native
|
22
22
|
|
23
23
|
const response = await clientFetch(
|
24
24
|
`${getThirdwebBaseUrl("inAppWallet")}/api/v1/enclave-wallet/sign-message`,
|
@@ -3,7 +3,7 @@ import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
|
|
3
3
|
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
4
4
|
import { getClientFetch } from "../../../../../utils/fetch.js";
|
5
5
|
import { stringify } from "../../../../../utils/json.js";
|
6
|
-
import type { Ecosystem } from "
|
6
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
7
7
|
import { getAuthToken } from "../get-auth-token.js";
|
8
8
|
|
9
9
|
export async function signTransaction({
|
@@ -17,7 +17,7 @@ export async function signTransaction({
|
|
17
17
|
}) {
|
18
18
|
console.log("payload", payload);
|
19
19
|
const clientFetch = getClientFetch(client, ecosystem);
|
20
|
-
const authToken = await getAuthToken(client, ecosystem);
|
20
|
+
const authToken = await getAuthToken(client, ecosystem); // TODO (enclave): pass storage from web/native
|
21
21
|
|
22
22
|
const response = await clientFetch(
|
23
23
|
`${getThirdwebBaseUrl("inAppWallet")}/api/v1/enclave-wallet/sign-transaction`,
|
@@ -4,7 +4,7 @@ import type { ThirdwebClient } from "../../../../../client/client.js";
|
|
4
4
|
import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
|
5
5
|
import { getClientFetch } from "../../../../../utils/fetch.js";
|
6
6
|
import { stringify } from "../../../../../utils/json.js";
|
7
|
-
import type { Ecosystem } from "
|
7
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
8
8
|
import { getAuthToken } from "../get-auth-token.js";
|
9
9
|
|
10
10
|
export async function signTypedData<
|
@@ -20,7 +20,7 @@ export async function signTypedData<
|
|
20
20
|
payload: TypedDataDefinition<typedData, primaryType>;
|
21
21
|
}) {
|
22
22
|
const clientFetch = getClientFetch(client, ecosystem);
|
23
|
-
const authToken = await getAuthToken(client, ecosystem);
|
23
|
+
const authToken = await getAuthToken(client, ecosystem); // TODO (enclave): pass storage from web/native
|
24
24
|
|
25
25
|
const response = await clientFetch(
|
26
26
|
`${getThirdwebBaseUrl("inAppWallet")}/api/v1/enclave-wallet/sign-typed-data`,
|
@@ -5,7 +5,8 @@ import type {
|
|
5
5
|
AuthProvider,
|
6
6
|
SendEmailOtpReturnType,
|
7
7
|
} from "../../../core/authentication/types.js";
|
8
|
-
import type {
|
8
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
9
|
+
import type { ClientIdWithQuerierType } from "../../types.js";
|
9
10
|
import type { InAppWalletIframeCommunicator } from "../../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
|
10
11
|
|
11
12
|
export type LoginQuerierTypes = {
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
2
|
-
import {
|
3
|
-
import { ClientScopedStorage } from "../../../core/authentication/client-scoped-storage.js";
|
2
|
+
import type { ClientScopedStorage } from "../../../core/authentication/client-scoped-storage.js";
|
4
3
|
import type {
|
5
4
|
AuthAndWalletRpcReturnType,
|
6
5
|
AuthLoginReturnType,
|
@@ -8,7 +7,8 @@ import type {
|
|
8
7
|
LogoutReturnType,
|
9
8
|
SendEmailOtpReturnType,
|
10
9
|
} from "../../../core/authentication/types.js";
|
11
|
-
import type {
|
10
|
+
import type { Ecosystem } from "../../../core/wallet/types.js";
|
11
|
+
import type { ClientIdWithQuerierType } from "../../types.js";
|
12
12
|
import type { InAppWalletIframeCommunicator } from "../../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
|
13
13
|
import { generateWallet } from "../actions/generate-wallet.enclave.js";
|
14
14
|
import { getUserStatus } from "../actions/get-enclave-user-status.js";
|
@@ -56,22 +56,20 @@ export class Auth {
|
|
56
56
|
onAuthSuccess,
|
57
57
|
ecosystem,
|
58
58
|
baseUrl,
|
59
|
+
localStorage,
|
59
60
|
}: ClientIdWithQuerierType & {
|
60
61
|
baseUrl: string;
|
61
62
|
ecosystem?: Ecosystem;
|
62
63
|
onAuthSuccess: (
|
63
64
|
authDetails: AuthAndWalletRpcReturnType,
|
64
65
|
) => Promise<AuthLoginReturnType>;
|
66
|
+
localStorage: ClientScopedStorage;
|
65
67
|
}) {
|
66
68
|
this.client = client;
|
67
69
|
this.ecosystem = ecosystem;
|
68
70
|
|
69
71
|
this.AuthQuerier = querier;
|
70
|
-
this.localStorage =
|
71
|
-
storage: webLocalStorage,
|
72
|
-
clientId: client.clientId,
|
73
|
-
ecosystemId: ecosystem?.id,
|
74
|
-
});
|
72
|
+
this.localStorage = localStorage;
|
75
73
|
this.onAuthSuccess = onAuthSuccess;
|
76
74
|
this.BaseLogin = new BaseLogin({
|
77
75
|
postLogin: async (result) => {
|