thirdweb 5.58.5 → 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/ConnectedButton.js +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectedButton.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectedModal.js +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectedModal.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/TokenListScreen.js +1 -1
- package/dist/cjs/react/native/ui/connect/TokenListScreen.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/Details.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/TOS.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/TOS.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +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 +6 -6
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +2 -2
- 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/swap/ConfirmationScreen.js +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 +3 -3
- 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 +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/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/SignatureScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.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/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/version.js +1 -1
- package/dist/cjs/version.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/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.map +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js +61 -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 +31 -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/ConnectedButton.js +1 -1
- package/dist/esm/react/native/ui/connect/ConnectedButton.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectedModal.js +1 -1
- package/dist/esm/react/native/ui/connect/ConnectedModal.js.map +1 -1
- package/dist/esm/react/native/ui/connect/TokenListScreen.js +1 -1
- package/dist/esm/react/native/ui/connect/TokenListScreen.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/Details.js +3 -3
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/TOS.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/Modal/TOS.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +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 +6 -6
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +2 -2
- 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/swap/ConfirmationScreen.js +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 +3 -3
- 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 +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/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/SignatureScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.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/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/version.js +1 -1
- package/dist/esm/version.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/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.map +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js +61 -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 +31 -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/Modal/TOS.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/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/getLoginPath.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/guest.d.ts +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/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/ConnectedButton.tsx +1 -1
- package/src/react/native/ui/connect/ConnectedModal.tsx +1 -1
- package/src/react/native/ui/connect/TokenListScreen.tsx +1 -1
- package/src/react/web/hooks/wallets/useProfiles.ts +48 -0
- package/src/react/web/ui/ConnectWallet/Details.tsx +4 -4
- package/src/react/web/ui/ConnectWallet/Modal/TOS.tsx +3 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +4 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.tsx +2 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +10 -10
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.tsx +3 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.tsx +1 -1
- 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/SignatureScreen.tsx +1 -1
- package/src/react/web/ui/prebuilt/NFT/NFT.test.tsx +2 -2
- package/src/react/web/wallets/in-app/WalletAuth.tsx +3 -2
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +2 -2
- 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/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/getLoginPath.ts +1 -1
- package/src/wallets/in-app/core/authentication/guest.ts +1 -1
- 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/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 +1 -1
- package/src/wallets/in-app/native/native-connector.ts +53 -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 +37 -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
@@ -134,7 +134,7 @@ export function SwapStatusScreen(props: {
|
|
134
134
|
</Text>
|
135
135
|
<Spacer y="sm" />
|
136
136
|
<Text size="sm" color="danger">
|
137
|
-
Expected {swapStatus.data.quote.toToken.symbol}, Got
|
137
|
+
Expected {swapStatus.data.quote.toToken.symbol}, Got{" "}
|
138
138
|
{swapStatus.data.destination.token.symbol} instead
|
139
139
|
</Text>
|
140
140
|
</Container>
|
@@ -8,7 +8,7 @@ import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
|
|
8
8
|
import type { EcosystemWalletId } from "../../../../../wallets/wallet-types.js";
|
9
9
|
import { iconSize } from "../../../../core/design-system/index.js";
|
10
10
|
import { useActiveWalletChain } from "../../../../core/hooks/wallets/useActiveWalletChain.js";
|
11
|
-
import { useAdminWallet } from "../../../../core/hooks/wallets/
|
11
|
+
import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminWallet.js";
|
12
12
|
import EcosystemWalletConnectUI from "../../../wallets/ecosystem/EcosystemWalletConnectUI.js";
|
13
13
|
import { LoadingScreen } from "../../../wallets/shared/LoadingScreen.js";
|
14
14
|
import { Container, Line, ModalHeader } from "../../components/basic.js";
|
@@ -3,9 +3,9 @@ import type { ThirdwebClient } from "../../../../../client/client.js";
|
|
3
3
|
import { shortenAddress } from "../../../../../utils/address.js";
|
4
4
|
import type { Profile } from "../../../../../wallets/in-app/core/authentication/types.js";
|
5
5
|
import { fontSize, iconSize } from "../../../../core/design-system/index.js";
|
6
|
-
import { useProfiles } from "../../../../core/hooks/others/useProfiles.js";
|
7
6
|
import { useSocialProfiles } from "../../../../core/social/useSocialProfiles.js";
|
8
7
|
import { getWalletIcon } from "../../../../core/utils/walletIcon.js";
|
8
|
+
import { useProfiles } from "../../../hooks/wallets/useProfiles.js";
|
9
9
|
import { LoadingScreen } from "../../../wallets/shared/LoadingScreen.js";
|
10
10
|
import { Img } from "../../components/Img.js";
|
11
11
|
import { Spacer } from "../../components/Spacer.js";
|
@@ -44,7 +44,9 @@ export function LinkedProfilesScreen(props: {
|
|
44
44
|
locale: ConnectLocale;
|
45
45
|
client: ThirdwebClient;
|
46
46
|
}) {
|
47
|
-
const { data: connectedProfiles, isLoading } = useProfiles(
|
47
|
+
const { data: connectedProfiles, isLoading } = useProfiles({
|
48
|
+
client: props.client,
|
49
|
+
});
|
48
50
|
|
49
51
|
if (isLoading) {
|
50
52
|
return <LoadingScreen />;
|
@@ -6,7 +6,7 @@ import { isInAppWallet } from "../../../../../wallets/in-app/core/wallet/index.j
|
|
6
6
|
import { injectedProvider } from "../../../../../wallets/injected/mipdStore.js";
|
7
7
|
import { fontSize, iconSize } from "../../../../core/design-system/index.js";
|
8
8
|
import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js";
|
9
|
-
import { useAdminWallet } from "../../../../core/hooks/wallets/
|
9
|
+
import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminWallet.js";
|
10
10
|
import { Spacer } from "../../components/Spacer.js";
|
11
11
|
import { Container, Line, ModalHeader } from "../../components/basic.js";
|
12
12
|
import { Text } from "../../components/text.js";
|
@@ -13,7 +13,7 @@ import { useSiweAuth } from "../../../../core/hooks/auth/useSiweAuth.js";
|
|
13
13
|
import type { ConnectButtonProps } from "../../../../core/hooks/connection/ConnectButtonProps.js";
|
14
14
|
import { useActiveAccount } from "../../../../core/hooks/wallets/useActiveAccount.js";
|
15
15
|
import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js";
|
16
|
-
import { useAdminWallet } from "../../../../core/hooks/wallets/
|
16
|
+
import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminWallet.js";
|
17
17
|
import { useDisconnect } from "../../../../core/hooks/wallets/useDisconnect.js";
|
18
18
|
import { wait } from "../../../../core/utils/wait.js";
|
19
19
|
import { LoadingScreen } from "../../../wallets/shared/LoadingScreen.js";
|
@@ -58,8 +58,8 @@ describe.runIf(process.env.TW_SECRET_KEY)("NFT prebuilt component", () => {
|
|
58
58
|
}
|
59
59
|
return (
|
60
60
|
<div>
|
61
|
-
Contract: {String(context.contract
|
62
|
-
|
61
|
+
Contract: {String(context.contract)}, Token ID:{" "}
|
62
|
+
{context.tokenId.toString()}
|
63
63
|
</div>
|
64
64
|
);
|
65
65
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Suspense, useRef, useState } from "react";
|
2
2
|
import { defineChain } from "../../../../chains/utils.js";
|
3
3
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
4
|
-
import { linkProfile } from "../../../../wallets/in-app/
|
4
|
+
import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
|
5
5
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
6
6
|
import type { EcosystemWalletId } from "../../../../wallets/wallet-types.js";
|
7
7
|
import { iconSize } from "../../../core/design-system/index.js";
|
@@ -54,7 +54,8 @@ export function WalletAuth(props: {
|
|
54
54
|
setStatus("loading");
|
55
55
|
walletToConnect.current = walletToLink;
|
56
56
|
try {
|
57
|
-
await linkProfile(
|
57
|
+
await linkProfile({
|
58
|
+
client: props.client,
|
58
59
|
strategy: "wallet",
|
59
60
|
wallet: walletToLink,
|
60
61
|
chain: wallet.getChain() || defineChain(1),
|
@@ -8,7 +8,7 @@ import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
|
8
8
|
import { getEcosystemWalletAuthOptions } from "../../../../wallets/ecosystem/get-ecosystem-wallet-auth-options.js";
|
9
9
|
import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
|
10
10
|
import type { Profile } from "../../../../wallets/in-app/core/authentication/types.js";
|
11
|
-
import { linkProfile } from "../../../../wallets/in-app/
|
11
|
+
import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
|
12
12
|
import { loginWithOauthRedirect } from "../../../../wallets/in-app/web/lib/auth/oauth.js";
|
13
13
|
import type { Account, Wallet } from "../../../../wallets/interfaces/wallet.js";
|
14
14
|
import {
|
@@ -269,7 +269,7 @@ export const ConnectWalletSocialOptions = (
|
|
269
269
|
if (wallet.id !== "inApp" && !isEcosystemWallet(wallet)) {
|
270
270
|
throw new Error("Only in-app wallets support multi-auth");
|
271
271
|
}
|
272
|
-
return linkProfile(
|
272
|
+
return linkProfile(connectOptions);
|
273
273
|
}
|
274
274
|
|
275
275
|
const connectPromise = wallet.connect(connectOptions);
|
@@ -4,8 +4,10 @@ import type { Chain } from "../../../../chains/types.js";
|
|
4
4
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
5
5
|
import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
6
6
|
import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
|
7
|
-
import {
|
8
|
-
|
7
|
+
import {
|
8
|
+
linkProfile,
|
9
|
+
preAuthenticate,
|
10
|
+
} from "../../../../wallets/in-app/web/lib/auth/index.js";
|
9
11
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
10
12
|
import type { EcosystemWalletId } from "../../../../wallets/wallet-types.js";
|
11
13
|
import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
|
@@ -126,13 +128,15 @@ export function OTPLoginUI(props: {
|
|
126
128
|
|
127
129
|
async function link(otp: string) {
|
128
130
|
if ("email" in userInfo) {
|
129
|
-
await linkProfile(
|
131
|
+
await linkProfile({
|
132
|
+
client: props.client,
|
130
133
|
strategy: "email",
|
131
134
|
email: userInfo.email,
|
132
135
|
verificationCode: otp,
|
133
136
|
});
|
134
137
|
} else if ("phone" in userInfo) {
|
135
|
-
await linkProfile(
|
138
|
+
await linkProfile({
|
139
|
+
client: props.client,
|
136
140
|
strategy: "phone",
|
137
141
|
phoneNumber: userInfo.phone,
|
138
142
|
verificationCode: otp,
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
2
2
|
import type { Chain } from "../../../../chains/types.js";
|
3
3
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
4
|
-
import { type Wallet, linkProfile } from "../../../../exports/wallets.js";
|
5
4
|
import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
6
5
|
import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
|
6
|
+
import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
|
7
7
|
import { hasStoredPasskey } from "../../../../wallets/in-app/web/lib/auth/passkeys.js";
|
8
|
+
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
8
9
|
import { iconSize } from "../../../core/design-system/index.js";
|
9
10
|
import { setLastAuthProvider } from "../../../core/utils/storage.js";
|
10
11
|
import { FingerPrintIcon } from "../../ui/ConnectWallet/icons/FingerPrintIcon.js";
|
@@ -141,7 +142,8 @@ function LoginScreen(props: {
|
|
141
142
|
setStatus("loading");
|
142
143
|
try {
|
143
144
|
if (props.isLinking) {
|
144
|
-
await linkProfile(
|
145
|
+
await linkProfile({
|
146
|
+
client,
|
145
147
|
strategy: "passkey",
|
146
148
|
type: "sign-in",
|
147
149
|
}).catch((e) => {
|
@@ -214,7 +216,8 @@ function SignupScreen(props: {
|
|
214
216
|
setStatus("loading");
|
215
217
|
try {
|
216
218
|
if (props.isLinking) {
|
217
|
-
await linkProfile(
|
219
|
+
await linkProfile({
|
220
|
+
client,
|
218
221
|
strategy: "passkey",
|
219
222
|
type: "sign-up",
|
220
223
|
});
|
@@ -4,8 +4,8 @@ import type { Chain } from "../../../../chains/types.js";
|
|
4
4
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
5
5
|
import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
6
6
|
import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
|
7
|
-
import { linkProfile } from "../../../../wallets/in-app/core/wallet/profiles.js";
|
8
7
|
import type { InAppWalletSocialAuth } from "../../../../wallets/in-app/core/wallet/types.js";
|
8
|
+
import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
|
9
9
|
import { loginWithOauthRedirect } from "../../../../wallets/in-app/web/lib/auth/oauth.js";
|
10
10
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
11
11
|
import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
|
@@ -92,7 +92,8 @@ export function SocialLogin(props: {
|
|
92
92
|
|
93
93
|
setStatus("connecting");
|
94
94
|
if (props.isLinking) {
|
95
|
-
await linkProfile(
|
95
|
+
await linkProfile({
|
96
|
+
client: props.client,
|
96
97
|
strategy: props.socialAuth,
|
97
98
|
openedWindow: socialWindow,
|
98
99
|
closeOpenedWindow: (openedWindow) => {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import { getLoginUrl } from "../../../../wallets/in-app/core/authentication/getLoginPath.js";
|
3
3
|
import type {
|
4
|
+
Ecosystem,
|
4
5
|
InAppWalletOAuth,
|
5
6
|
InAppWalletSocialAuth,
|
6
7
|
} from "../../../../wallets/in-app/core/wallet/types.js";
|
7
|
-
import type { Ecosystem } from "../../../../wallets/in-app/web/types.js";
|
8
8
|
import type { Theme } from "../../../core/design-system/index.js";
|
9
9
|
|
10
10
|
function getBodyTitle(authOption: InAppWalletSocialAuth) {
|
package/src/utils/fetch.test.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
2
2
|
import type { ThirdwebClient } from "../client/client.js";
|
3
|
-
import type { Ecosystem } from "../wallets/in-app/
|
3
|
+
import type { Ecosystem } from "../wallets/in-app/core/wallet/types.js";
|
4
4
|
import {
|
5
5
|
IS_THIRDWEB_URL_CACHE,
|
6
6
|
getClientFetch,
|
package/src/utils/fetch.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ThirdwebClient } from "../client/client.js";
|
2
2
|
import { version } from "../version.js";
|
3
|
-
import type { Ecosystem } from "../wallets/in-app/
|
3
|
+
import type { Ecosystem } from "../wallets/in-app/core/wallet/types.js";
|
4
4
|
import { LruMap } from "./caching/lru.js";
|
5
5
|
import {
|
6
6
|
type OperatingSystem,
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.
|
1
|
+
export const version = "5.59.0-nightly-e2b3484764275560aa899f3f894b767faedaa9a1-20240925000331";
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
3
3
|
import { type AuthOption, authOptions } from "../../../../wallets/types.js";
|
4
|
-
import type { Ecosystem } from "
|
4
|
+
import type { Ecosystem } from "../wallet/types.js";
|
5
5
|
|
6
6
|
const getLoginOptionRoute = (option: AuthOption | "wallet") => {
|
7
7
|
if (!authOptions.includes(option as AuthOption) && option !== "wallet") {
|
@@ -2,7 +2,7 @@ import type { ThirdwebClient } from "../../../../client/client.js";
|
|
2
2
|
import { getClientFetch } from "../../../../utils/fetch.js";
|
3
3
|
import { randomBytesHex } from "../../../../utils/random.js";
|
4
4
|
import type { AsyncStorage } from "../../../../utils/storage/AsyncStorage.js";
|
5
|
-
import type { Ecosystem } from "
|
5
|
+
import type { Ecosystem } from "../wallet/types.js";
|
6
6
|
import { ClientScopedStorage } from "./client-scoped-storage.js";
|
7
7
|
import { getLoginCallbackUrl } from "./getLoginPath.js";
|
8
8
|
import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
|
@@ -1,7 +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 "
|
4
|
+
import type { Ecosystem } from "../wallet/types.js";
|
5
|
+
import type { ClientScopedStorage } from "./client-scoped-storage.js";
|
5
6
|
import type { Profile } from "./types.js";
|
6
7
|
|
7
8
|
/**
|
@@ -15,16 +16,16 @@ export async function linkAccount({
|
|
15
16
|
client,
|
16
17
|
ecosystem,
|
17
18
|
tokenToLink,
|
19
|
+
storage,
|
18
20
|
}: {
|
19
21
|
client: ThirdwebClient;
|
20
22
|
ecosystem?: Ecosystem;
|
21
23
|
tokenToLink: string;
|
24
|
+
storage: ClientScopedStorage;
|
22
25
|
}): Promise<Profile[]> {
|
23
26
|
const clientFetch = getClientFetch(client, ecosystem);
|
24
27
|
const IN_APP_URL = getThirdwebBaseUrl("inAppWallet");
|
25
|
-
const currentAccountToken =
|
26
|
-
`walletToken-${client.clientId}${ecosystem?.id ? `-${ecosystem.id}` : ""}`,
|
27
|
-
);
|
28
|
+
const currentAccountToken = await storage.getAuthCookie();
|
28
29
|
|
29
30
|
if (!currentAccountToken) {
|
30
31
|
throw new Error("Failed to link account, no user logged in");
|
@@ -65,20 +66,23 @@ export async function linkAccount({
|
|
65
66
|
export async function getLinkedProfilesInternal({
|
66
67
|
client,
|
67
68
|
ecosystem,
|
68
|
-
|
69
|
+
storage,
|
70
|
+
}: {
|
71
|
+
client: ThirdwebClient;
|
72
|
+
ecosystem?: Ecosystem;
|
73
|
+
storage: ClientScopedStorage;
|
74
|
+
}): Promise<Profile[]> {
|
69
75
|
const clientFetch = getClientFetch(client, ecosystem);
|
70
76
|
const IN_APP_URL = getThirdwebBaseUrl("inAppWallet");
|
71
|
-
const currentAccountToken =
|
72
|
-
|
73
|
-
|
77
|
+
const currentAccountToken = await storage.getAuthCookie();
|
78
|
+
if (!currentAccountToken) {
|
79
|
+
throw new Error("Failed to get linked accounts, no user logged in");
|
80
|
+
}
|
74
81
|
|
75
82
|
const headers: Record<string, string> = {
|
76
83
|
Authorization: `Bearer iaw-auth-token:${currentAccountToken}`,
|
77
84
|
"Content-Type": "application/json",
|
78
85
|
};
|
79
|
-
if (!currentAccountToken) {
|
80
|
-
throw new Error("Failed to get linked accounts, no user logged in");
|
81
|
-
}
|
82
86
|
|
83
87
|
const linkedAccountsResp = await clientFetch(
|
84
88
|
`${IN_APP_URL}/api/2024-05-05/accounts`,
|
@@ -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 type { AsyncStorage } from "../../../../utils/storage/AsyncStorage.js";
|
5
|
-
import type { Ecosystem } from "
|
5
|
+
import type { Ecosystem } from "../wallet/types.js";
|
6
6
|
import { ClientScopedStorage } from "./client-scoped-storage.js";
|
7
7
|
import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
|
8
8
|
|
@@ -4,7 +4,7 @@ import type { Chain } from "../../../../chains/types.js";
|
|
4
4
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
5
5
|
import { getClientFetch } from "../../../../utils/fetch.js";
|
6
6
|
import type { Wallet } from "../../../interfaces/wallet.js";
|
7
|
-
import type { Ecosystem } from "
|
7
|
+
import type { Ecosystem } from "../wallet/types.js";
|
8
8
|
import { getLoginCallbackUrl, getLoginUrl } from "./getLoginPath.js";
|
9
9
|
import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
|
10
10
|
|
@@ -4,7 +4,7 @@ import type { Address } from "../../../../utils/address.js";
|
|
4
4
|
import type { Account } from "../../../interfaces/wallet.js";
|
5
5
|
import type { Wallet } from "../../../interfaces/wallet.js";
|
6
6
|
import type { AuthOption, OAuthOption } from "../../../types.js";
|
7
|
-
import type { Ecosystem } from "
|
7
|
+
import type { Ecosystem } from "../wallet/types.js";
|
8
8
|
|
9
9
|
export type MultiStepAuthProviderType =
|
10
10
|
| {
|
@@ -24,14 +24,16 @@ export type MultiStepAuthArgsType = MultiStepAuthProviderType & {
|
|
24
24
|
verificationCode: string;
|
25
25
|
};
|
26
26
|
|
27
|
+
export type SocialAuthArgsType = {
|
28
|
+
strategy: OAuthOption;
|
29
|
+
openedWindow?: Window;
|
30
|
+
closeOpenedWindow?: (window: Window) => void;
|
31
|
+
redirectUrl?: string;
|
32
|
+
mode?: "redirect" | "popup" | "window";
|
33
|
+
};
|
34
|
+
|
27
35
|
export type SingleStepAuthArgsType =
|
28
|
-
|
|
29
|
-
strategy: OAuthOption;
|
30
|
-
openedWindow?: Window;
|
31
|
-
closeOpenedWindow?: (window: Window) => void;
|
32
|
-
redirectUrl?: string;
|
33
|
-
mode?: "redirect" | "popup" | "window";
|
34
|
-
}
|
36
|
+
| SocialAuthArgsType
|
35
37
|
| { strategy: "jwt"; jwt: string; encryptionKey: string }
|
36
38
|
| { strategy: "auth_endpoint"; payload: string; encryptionKey: string }
|
37
39
|
| { strategy: "iframe_email_verification"; email: string }
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import type { SocialAuthOption } from "../../../../wallets/types.js";
|
2
2
|
import type { Account } from "../../../interfaces/wallet.js";
|
3
3
|
import type {
|
4
|
+
AuthArgsType,
|
4
5
|
AuthLoginReturnType,
|
5
6
|
AuthStoredTokenWithCookieReturnType,
|
6
7
|
GetUser,
|
7
8
|
LogoutReturnType,
|
8
9
|
MultiStepAuthArgsType,
|
9
10
|
PreAuthArgsType,
|
11
|
+
Profile,
|
10
12
|
SingleStepAuthArgsType,
|
11
13
|
} from "../authentication/types.js";
|
12
14
|
|
@@ -33,4 +35,6 @@ export interface InAppConnector {
|
|
33
35
|
args: MultiStepAuthArgsType | SingleStepAuthArgsType,
|
34
36
|
): Promise<AuthLoginReturnType>;
|
35
37
|
logout(): Promise<LogoutReturnType>;
|
38
|
+
linkProfile(args: AuthArgsType): Promise<Profile[]>;
|
39
|
+
getProfiles(): Promise<Profile[]>;
|
36
40
|
}
|
@@ -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
|