thirdweb 5.42.0-nightly-e27ebef85bb61342c3de53f85e134cf4a29f787c-20240730000342 → 5.43.0-nightly-75cc5a6434d29dbfe69b6cd6344a7c8426d59fac-20240731000316
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/adapters/wallet-adapter.js +12 -1
- package/dist/cjs/adapters/wallet-adapter.js.map +1 -1
- package/dist/cjs/cli/bin.js +13 -0
- package/dist/cjs/cli/bin.js.map +1 -1
- package/dist/cjs/exports/react.js +3 -1
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/exports/wallets/in-app.js.map +1 -1
- package/dist/cjs/exports/wallets.js.map +1 -1
- package/dist/cjs/exports/wallets.native.js.map +1 -1
- package/dist/cjs/extensions/marketplace/direct-listings/write/createListing.js +5 -1
- package/dist/cjs/extensions/marketplace/direct-listings/write/createListing.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveWallet.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveWallet.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveWalletChain.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveWalletChain.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveWalletConnectionStatus.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveWalletConnectionStatus.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useAutoConnect.js +4 -2
- package/dist/cjs/react/core/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useConnect.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useConnect.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useConnectedWallets.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useConnectedWallets.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useDisconnect.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useDisconnect.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useIsAutoConnecting.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useIsAutoConnecting.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSetActiveWallet.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSetActiveWallet.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSwitchActiveWalletChain.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSwitchActiveWalletChain.js.map +1 -1
- package/dist/cjs/react/core/providers/connection-manager.js +14 -2
- package/dist/cjs/react/core/providers/connection-manager.js.map +1 -1
- package/dist/cjs/react/web/ui/AutoConnect/AutoConnect.js +5 -0
- package/dist/cjs/react/web/ui/AutoConnect/AutoConnect.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +196 -2
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +109 -3
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/de.js +114 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/de.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/getConnectLocale.js +3 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/getConnectLocale.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js +2 -0
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js +118 -0
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js.map +1 -0
- package/dist/cjs/react/web/wallets/injected/locale/de.js +27 -0
- package/dist/cjs/react/web/wallets/injected/locale/de.js.map +1 -0
- package/dist/cjs/react/web/wallets/injected/locale/getInjectedWalletLocale.js +2 -0
- package/dist/cjs/react/web/wallets/injected/locale/getInjectedWalletLocale.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +19 -7
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/de.js +55 -0
- package/dist/cjs/react/web/wallets/shared/locale/de.js.map +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js +2 -0
- package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
- package/dist/cjs/react/web/wallets/smartWallet/locale/de.js +13 -0
- package/dist/cjs/react/web/wallets/smartWallet/locale/de.js.map +1 -0
- package/dist/cjs/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js +2 -0
- package/dist/cjs/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js.map +1 -1
- package/dist/cjs/react/web/wallets/walletConnect/locale.js +4 -0
- package/dist/cjs/react/web/wallets/walletConnect/locale.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/create-wallet.js +73 -0
- package/dist/cjs/wallets/create-wallet.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/ecosystem.js +29 -3
- package/dist/cjs/wallets/in-app/web/ecosystem.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/in-app.js +100 -5
- package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
- package/dist/cjs/wallets/smart/smart-wallet.js +71 -5
- package/dist/cjs/wallets/smart/smart-wallet.js.map +1 -1
- package/dist/esm/adapters/wallet-adapter.js +12 -1
- package/dist/esm/adapters/wallet-adapter.js.map +1 -1
- package/dist/esm/cli/bin.js +13 -0
- package/dist/esm/cli/bin.js.map +1 -1
- package/dist/esm/exports/react.js +1 -0
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/wallets/in-app.js.map +1 -1
- package/dist/esm/exports/wallets.js.map +1 -1
- package/dist/esm/exports/wallets.native.js.map +1 -1
- package/dist/esm/extensions/marketplace/direct-listings/write/createListing.js +5 -1
- package/dist/esm/extensions/marketplace/direct-listings/write/createListing.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveAccount.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveWallet.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useActiveWallet.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveWalletChain.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useActiveWalletChain.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveWalletConnectionStatus.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useActiveWalletConnectionStatus.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useAutoConnect.js +5 -3
- package/dist/esm/react/core/hooks/wallets/useAutoConnect.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useConnect.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useConnect.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useConnectedWallets.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useConnectedWallets.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useDisconnect.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useDisconnect.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useIsAutoConnecting.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useIsAutoConnecting.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSetActiveWallet.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useSetActiveWallet.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSwitchActiveWalletChain.js +2 -2
- package/dist/esm/react/core/hooks/wallets/useSwitchActiveWalletChain.js.map +1 -1
- package/dist/esm/react/core/providers/connection-manager.js +13 -2
- package/dist/esm/react/core/providers/connection-manager.js.map +1 -1
- package/dist/esm/react/web/ui/AutoConnect/AutoConnect.js +5 -0
- package/dist/esm/react/web/ui/AutoConnect/AutoConnect.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +196 -2
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +109 -3
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/de.js +112 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/de.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/getConnectLocale.js +3 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/getConnectLocale.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js +2 -0
- package/dist/esm/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js +115 -0
- package/dist/esm/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js.map +1 -0
- package/dist/esm/react/web/wallets/injected/locale/de.js +25 -0
- package/dist/esm/react/web/wallets/injected/locale/de.js.map +1 -0
- package/dist/esm/react/web/wallets/injected/locale/getInjectedWalletLocale.js +2 -0
- package/dist/esm/react/web/wallets/injected/locale/getInjectedWalletLocale.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +19 -7
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/de.js +53 -0
- package/dist/esm/react/web/wallets/shared/locale/de.js.map +1 -0
- package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js +2 -0
- package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
- package/dist/esm/react/web/wallets/smartWallet/locale/de.js +11 -0
- package/dist/esm/react/web/wallets/smartWallet/locale/de.js.map +1 -0
- package/dist/esm/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js +2 -0
- package/dist/esm/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js.map +1 -1
- package/dist/esm/react/web/wallets/walletConnect/locale.js +4 -0
- package/dist/esm/react/web/wallets/walletConnect/locale.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/create-wallet.js +73 -0
- package/dist/esm/wallets/create-wallet.js.map +1 -1
- package/dist/esm/wallets/in-app/web/ecosystem.js +29 -3
- package/dist/esm/wallets/in-app/web/ecosystem.js.map +1 -1
- package/dist/esm/wallets/in-app/web/in-app.js +100 -5
- package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
- package/dist/esm/wallets/smart/smart-wallet.js +71 -5
- package/dist/esm/wallets/smart/smart-wallet.js.map +1 -1
- package/dist/types/adapters/wallet-adapter.d.ts +12 -1
- package/dist/types/adapters/wallet-adapter.d.ts.map +1 -1
- package/dist/types/exports/react.d.ts +1 -0
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/wallets/in-app.d.ts +1 -0
- package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
- package/dist/types/exports/wallets.d.ts +4 -2
- package/dist/types/exports/wallets.d.ts.map +1 -1
- package/dist/types/exports/wallets.native.d.ts +3 -2
- package/dist/types/exports/wallets.native.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/direct-listings/write/createListing.d.ts +5 -1
- package/dist/types/extensions/marketplace/direct-listings/write/createListing.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useAutoConnect.d.ts.map +1 -1
- package/dist/types/react/core/providers/connection-manager.d.ts +21 -0
- package/dist/types/react/core/providers/connection-manager.d.ts.map +1 -1
- package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts +5 -0
- package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +196 -2
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +109 -3
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/locale/de.d.ts +4 -0
- package/dist/types/react/web/ui/ConnectWallet/locale/de.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/locale/getConnectLocale.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts +2 -0
- package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts +37 -0
- package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts.map +1 -0
- package/dist/types/react/web/ui/types.d.ts +1 -1
- package/dist/types/react/web/ui/types.d.ts.map +1 -1
- package/dist/types/react/web/wallets/injected/locale/de.d.ts +7 -0
- package/dist/types/react/web/wallets/injected/locale/de.d.ts.map +1 -0
- package/dist/types/react/web/wallets/injected/locale/getInjectedWalletLocale.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/de.d.ts +54 -0
- package/dist/types/react/web/wallets/shared/locale/de.d.ts.map +1 -0
- package/dist/types/react/web/wallets/shared/locale/getConnectLocale.d.ts.map +1 -1
- package/dist/types/react/web/wallets/smartWallet/locale/de.d.ts +4 -0
- package/dist/types/react/web/wallets/smartWallet/locale/de.d.ts.map +1 -0
- package/dist/types/react/web/wallets/smartWallet/locale/getSmartWalletLocale.d.ts.map +1 -1
- package/dist/types/react/web/wallets/walletConnect/locale.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/create-wallet.d.ts +73 -0
- package/dist/types/wallets/create-wallet.d.ts.map +1 -1
- package/dist/types/wallets/ecosystem/types.d.ts +5 -4
- package/dist/types/wallets/ecosystem/types.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/ecosystem.d.ts +29 -3
- package/dist/types/wallets/in-app/web/ecosystem.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/in-app.d.ts +100 -5
- package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
- package/dist/types/wallets/smart/smart-wallet.d.ts +71 -5
- package/dist/types/wallets/smart/smart-wallet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/wallet-adapter.ts +12 -1
- package/src/cli/bin.ts +18 -0
- package/src/exports/react.ts +4 -0
- package/src/exports/wallets/in-app.ts +6 -0
- package/src/exports/wallets.native.ts +8 -1
- package/src/exports/wallets.ts +13 -1
- package/src/extensions/marketplace/direct-listings/write/createListing.ts +5 -1
- package/src/pay/buyWithCrypto/getStatus.ts +2 -1
- package/src/react/core/hooks/wallets/useActiveAccount.ts +2 -2
- package/src/react/core/hooks/wallets/useActiveWallet.ts +2 -2
- package/src/react/core/hooks/wallets/useActiveWalletChain.ts +2 -2
- package/src/react/core/hooks/wallets/useActiveWalletConnectionStatus.ts +2 -2
- package/src/react/core/hooks/wallets/useAutoConnect.ts +5 -3
- package/src/react/core/hooks/wallets/useConnect.ts +2 -2
- package/src/react/core/hooks/wallets/useConnectedWallets.ts +2 -2
- package/src/react/core/hooks/wallets/useDisconnect.ts +2 -2
- package/src/react/core/hooks/wallets/useIsAutoConnecting.ts +2 -2
- package/src/react/core/hooks/wallets/useSetActiveWallet.ts +2 -2
- package/src/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.ts +2 -2
- package/src/react/core/hooks/wallets/useSwitchActiveWalletChain.ts +2 -2
- package/src/react/core/providers/connection-manager.tsx +15 -2
- package/src/react/web/ui/AutoConnect/AutoConnect.tsx +5 -0
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +196 -2
- package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +109 -3
- package/src/react/web/ui/ConnectWallet/locale/de.ts +117 -0
- package/src/react/web/ui/ConnectWallet/locale/getConnectLocale.ts +3 -0
- package/src/react/web/ui/prebuilt/thirdweb/ClaimButton/index.tsx +2 -0
- package/src/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/CreateDirectListingButton.test.tsx +29 -0
- package/src/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.tsx +165 -0
- package/src/react/web/ui/types.ts +7 -1
- package/src/react/web/wallets/injected/locale/de.ts +27 -0
- package/src/react/web/wallets/injected/locale/getInjectedWalletLocale.ts +2 -0
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +19 -8
- package/src/react/web/wallets/shared/locale/de.ts +58 -0
- package/src/react/web/wallets/shared/locale/getConnectLocale.ts +2 -0
- package/src/react/web/wallets/smartWallet/locale/de.ts +13 -0
- package/src/react/web/wallets/smartWallet/locale/getSmartWalletLocale.ts +2 -0
- package/src/react/web/wallets/walletConnect/locale.ts +4 -0
- package/src/version.ts +1 -1
- package/src/wallets/create-wallet.ts +73 -0
- package/src/wallets/ecosystem/types.ts +9 -5
- package/src/wallets/in-app/web/ecosystem.ts +29 -3
- package/src/wallets/in-app/web/in-app.ts +100 -5
- package/src/wallets/smart/smart-wallet.ts +71 -5
@@ -2,9 +2,31 @@ import type { Wallet } from "./interfaces/wallet.js";
|
|
2
2
|
import type { CreateWalletArgs, WalletId } from "./wallet-types.js";
|
3
3
|
/**
|
4
4
|
* Creates a wallet based on the provided ID and arguments.
|
5
|
+
*
|
6
|
+
* - Supports 350+ wallets
|
7
|
+
* - Handles both injected browser wallets and WalletConnect sessions
|
8
|
+
*
|
9
|
+
* [View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets)
|
10
|
+
*
|
5
11
|
* @param args - The arguments for creating the wallet.
|
12
|
+
* @param args.id - The ID of the wallet to create, this will be autocompleted by your IDE.
|
13
|
+
* [View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets)
|
14
|
+
* @param args.createOptions - The options for creating the wallet.
|
15
|
+
* The arguments are different for each wallet type.
|
16
|
+
* Refer to the [WalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/WalletCreationOptions) type for more details.
|
6
17
|
* @returns - The created wallet.
|
7
18
|
* @example
|
19
|
+
*
|
20
|
+
* ## Connecting the wallet
|
21
|
+
*
|
22
|
+
* Once created, you can connect the wallet to your app by calling the `connect` method.
|
23
|
+
*
|
24
|
+
* The `connect` method returns a promise that resolves to the connected account.
|
25
|
+
*
|
26
|
+
* Each wallet type can have different connect options. [View the different connect options](https://portal.thirdweb.com/references/typescript/v5/WalletConnectionOption)
|
27
|
+
*
|
28
|
+
* ## Connecting to an injected wallet
|
29
|
+
*
|
8
30
|
* ```ts
|
9
31
|
* import { createWallet } from "thirdweb/wallets";
|
10
32
|
*
|
@@ -14,6 +36,57 @@ import type { CreateWalletArgs, WalletId } from "./wallet-types.js";
|
|
14
36
|
* client,
|
15
37
|
* });
|
16
38
|
* ```
|
39
|
+
*
|
40
|
+
* You can check if a wallet is installed by calling the [injectedProvider](https://portal.thirdweb.com/references/typescript/v5/injectedProvider) method.
|
41
|
+
*
|
42
|
+
* ## Connecting via WalletConnect modal
|
43
|
+
*
|
44
|
+
* ```ts
|
45
|
+
* import { createWallet } from "thirdweb/wallets";
|
46
|
+
*
|
47
|
+
* const metamaskWallet = createWallet("io.metamask");
|
48
|
+
*
|
49
|
+
* await metamask.connect({
|
50
|
+
* client,
|
51
|
+
* walletConnect: {
|
52
|
+
* projectId: "YOUR_PROJECT_ID",
|
53
|
+
* showQrModal: true,
|
54
|
+
* appMetadata: {
|
55
|
+
* name: "My App",
|
56
|
+
* url: "https://my-app.com",
|
57
|
+
* description: "my app description",
|
58
|
+
* logoUrl: "https://path/to/my-app/logo.svg",
|
59
|
+
* },
|
60
|
+
* },
|
61
|
+
* });
|
62
|
+
* ```
|
63
|
+
* [View ConnectWallet connection options](https://portal.thirdweb.com/references/typescript/v5/WCConnectOptions)
|
64
|
+
*
|
65
|
+
* ## Connecting with coinbase wallet
|
66
|
+
*
|
67
|
+
* ```ts
|
68
|
+
* import { createWallet } from "thirdweb/wallets";
|
69
|
+
*
|
70
|
+
* const cbWallet = createWallet("com.coinbase.wallet", {
|
71
|
+
* appMetadata: {
|
72
|
+
* name: "My App",
|
73
|
+
* url: "https://my-app.com",
|
74
|
+
* description: "my app description",
|
75
|
+
* logoUrl: "https://path/to/my-app/logo.svg",
|
76
|
+
* },
|
77
|
+
* walletConfig: {
|
78
|
+
* // options: 'all' | 'smartWalletOnly' | 'eoaOnly'
|
79
|
+
* options: 'all',
|
80
|
+
* },
|
81
|
+
* });
|
82
|
+
*
|
83
|
+
* const account = await cbWallet.connect({
|
84
|
+
* client,
|
85
|
+
* });
|
86
|
+
* ```
|
87
|
+
*
|
88
|
+
* [View Coinbase wallet creation options](https://portal.thirdweb.com/references/typescript/v5/CoinbaseWalletCreationOptions)
|
89
|
+
*
|
17
90
|
* @wallet
|
18
91
|
*/
|
19
92
|
export declare function createWallet<const ID extends WalletId>(...args: CreateWalletArgs<ID>): Wallet<ID>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-wallet.d.ts","sourceRoot":"","sources":["../../../src/wallets/create-wallet.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EACV,gBAAgB,EAIhB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAkB3B
|
1
|
+
{"version":3,"file":"create-wallet.d.ts","sourceRoot":"","sources":["../../../src/wallets/create-wallet.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EACV,gBAAgB,EAIhB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAkB3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EACpD,GAAG,IAAI,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAC5B,MAAM,CAAC,EAAE,CAAC,CAyPZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,4BAE5B"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { Prettify } from "../../utils/type-utils.js";
|
1
2
|
import type { InAppWalletAutoConnectOptions, InAppWalletConnectionOptions } from "../in-app/core/wallet/types.js";
|
2
3
|
import type { Ecosystem } from "../in-app/web/types.js";
|
3
4
|
export type EcosystemWalletCreationOptions = {
|
@@ -6,10 +7,10 @@ export type EcosystemWalletCreationOptions = {
|
|
6
7
|
mode?: "popup" | "redirect";
|
7
8
|
};
|
8
9
|
};
|
9
|
-
export type EcosystemWalletConnectionOptions = InAppWalletConnectionOptions & {
|
10
|
+
export type EcosystemWalletConnectionOptions = Prettify<InAppWalletConnectionOptions & {
|
10
11
|
ecosystem: Ecosystem;
|
11
|
-
}
|
12
|
-
export type EcosystemWalletAutoConnectOptions = InAppWalletAutoConnectOptions & {
|
12
|
+
}>;
|
13
|
+
export type EcosystemWalletAutoConnectOptions = Prettify<InAppWalletAutoConnectOptions & {
|
13
14
|
ecosystem: Ecosystem;
|
14
|
-
}
|
15
|
+
}>;
|
15
16
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/wallets/ecosystem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,4BAA4B,GAAG;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/wallets/ecosystem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CACrD,4BAA4B,GAAG;IAC7B,SAAS,EAAE,SAAS,CAAC;CACtB,CACF,CAAC;AACF,MAAM,MAAM,iCAAiC,GAAG,QAAQ,CACtD,6BAA6B,GAAG;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,CACzD,CAAC"}
|
@@ -1,10 +1,29 @@
|
|
1
1
|
import type { Wallet } from "../../interfaces/wallet.js";
|
2
2
|
import type { CreateWalletArgs, EcosystemWalletId } from "../../wallet-types.js";
|
3
3
|
/**
|
4
|
-
* Creates an
|
4
|
+
* Creates an [Ecosystem Wallet](https://portal.thirdweb.com/connect/ecosystems/overview) based on various authentication methods.
|
5
|
+
*
|
6
|
+
* Available authentication methods:
|
7
|
+
* - Email
|
8
|
+
* - Phone
|
9
|
+
* - Passkey
|
10
|
+
* - Google
|
11
|
+
* - Apple
|
12
|
+
* - Facebook
|
13
|
+
* - Discord
|
14
|
+
* - Farcaster
|
15
|
+
*
|
16
|
+
* Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods.
|
17
|
+
*
|
18
|
+
* Refer to [inAppWallet](https://portal.thirdweb.com/references/typescript/v5/inAppWallet) for detailed usage examples.
|
19
|
+
*
|
5
20
|
* @param createOptions - configuration options
|
21
|
+
* Refer to [EcosystemWalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/EcosystemWalletCreationOptions) for more details.
|
6
22
|
* @returns The created ecosystem wallet.
|
7
23
|
* @example
|
24
|
+
*
|
25
|
+
* ### Connect to an ecosystem wallet
|
26
|
+
*
|
8
27
|
* ```ts
|
9
28
|
* import { ecosystemWallet } from "thirdweb/wallets";
|
10
29
|
*
|
@@ -17,14 +36,21 @@ import type { CreateWalletArgs, EcosystemWalletId } from "../../wallet-types.js"
|
|
17
36
|
* });
|
18
37
|
* ```
|
19
38
|
*
|
20
|
-
*
|
21
|
-
*
|
39
|
+
* [View all connection options](https://portal.thirdweb.com/references/typescript/v5/EcosystemWalletConnectionOptions)
|
40
|
+
*
|
41
|
+
* ### Connect to a restricted ecosystem wallet with your designated partner ID
|
42
|
+
*
|
43
|
+
* The parnter ID will be provided to you by the ecosystem with which you're integrating.
|
44
|
+
*
|
22
45
|
* ```ts
|
23
46
|
* import { ecosystemWallet } from "thirdweb/wallets";
|
24
47
|
* const wallet = ecosystemWallet("ecosystem.hooli", {
|
25
48
|
* partnerId: "..."
|
26
49
|
* });
|
27
50
|
* ```
|
51
|
+
*
|
52
|
+
* Refer to [inAppWallet](https://portal.thirdweb.com/references/typescript/v5/inAppWallet) for more usage examples.
|
53
|
+
*
|
28
54
|
* @wallet
|
29
55
|
*/
|
30
56
|
export declare function ecosystemWallet(...args: CreateWalletArgs<EcosystemWalletId>): Wallet<EcosystemWalletId>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ecosystem.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/web/ecosystem.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAG/B
|
1
|
+
{"version":3,"file":"ecosystem.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/web/ecosystem.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,eAAe,CAC7B,GAAG,IAAI,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,GAC3C,MAAM,CAAC,iBAAiB,CAAC,CAgB3B"}
|
@@ -1,10 +1,27 @@
|
|
1
1
|
import type { Wallet } from "../../interfaces/wallet.js";
|
2
2
|
import type { CreateWalletArgs } from "../../wallet-types.js";
|
3
3
|
/**
|
4
|
-
* Creates an
|
4
|
+
* Creates an app scoped wallet for users based on various authentication methods.
|
5
|
+
*
|
6
|
+
* Available authentication methods:
|
7
|
+
* - Email
|
8
|
+
* - Phone
|
9
|
+
* - Passkey
|
10
|
+
* - Google
|
11
|
+
* - Apple
|
12
|
+
* - Facebook
|
13
|
+
* - Discord
|
14
|
+
* - Farcaster
|
15
|
+
*
|
16
|
+
* Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods.
|
17
|
+
*
|
5
18
|
* @param createOptions - configuration options
|
19
|
+
* Refer to [InAppWalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/InAppWalletCreationOptions) to see the available options.
|
6
20
|
* @returns The created in-app wallet.
|
7
21
|
* @example
|
22
|
+
*
|
23
|
+
* ### Login with socials
|
24
|
+
*
|
8
25
|
* ```ts
|
9
26
|
* import { inAppWallet } from "thirdweb/wallets";
|
10
27
|
*
|
@@ -17,18 +34,90 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
|
|
17
34
|
* });
|
18
35
|
* ```
|
19
36
|
*
|
20
|
-
*
|
37
|
+
* [View all available social auth methods](https://portal.thirdweb.com/references/typescript/v5/InAppWalletSocialAuth)
|
38
|
+
*
|
39
|
+
* * ### Login with email
|
40
|
+
*
|
41
|
+
* ```ts
|
42
|
+
* import { inAppWallet, preAuthenticate } from "thirdweb/wallets/in-app";
|
43
|
+
*
|
44
|
+
* const wallet = inAppWallet();
|
45
|
+
*
|
46
|
+
* // sends a verification code to the provided email
|
47
|
+
* await preAuthenticate({
|
48
|
+
* client,
|
49
|
+
* strategy: "email",
|
50
|
+
* email: "example@example.com",
|
51
|
+
* });
|
52
|
+
*
|
53
|
+
* // login with the verification code
|
54
|
+
* const account = await wallet.connect({
|
55
|
+
* client,
|
56
|
+
* chain,
|
57
|
+
* strategy: "email",
|
58
|
+
* verificationCode: "123456",
|
59
|
+
* });
|
60
|
+
* ```
|
61
|
+
*
|
62
|
+
* ### Login with phone number
|
63
|
+
* ```ts
|
64
|
+
* import { inAppWallet, preAuthenticate } from "thirdweb/wallets/in-app";
|
65
|
+
*
|
66
|
+
* const wallet = inAppWallet();
|
67
|
+
*
|
68
|
+
* // sends a verification code to the provided phone number
|
69
|
+
* await preAuthenticate({
|
70
|
+
* client,
|
71
|
+
* strategy: "phone",
|
72
|
+
* phoneNumber: "+1234567890",
|
73
|
+
* });
|
74
|
+
*
|
75
|
+
* // login with the verification code
|
76
|
+
* const account = await wallet.connect({
|
77
|
+
* client,
|
78
|
+
* chain,
|
79
|
+
* strategy: "phone",
|
80
|
+
* verificationCode: "123456",
|
81
|
+
* });
|
82
|
+
*
|
83
|
+
* ### Login with passkey
|
84
|
+
*
|
85
|
+
* ```ts
|
86
|
+
* import { inAppWallet, hasStoredPasskey } from "thirdweb/wallets/in-app";
|
87
|
+
*
|
88
|
+
* const wallet = inAppWallet();
|
89
|
+
*
|
90
|
+
* const wallet = inAppWallet();
|
91
|
+
* const hasPasskey = await hasStoredPasskey(client);
|
92
|
+
* await wallet.connect({
|
93
|
+
* client,
|
94
|
+
* strategy: "passkey",
|
95
|
+
* type: hasPasskey ? "sign-in" : "sign-up",
|
96
|
+
* });
|
97
|
+
* ```
|
98
|
+
*
|
99
|
+
* ### Enable smart accounts and sponsor gas for your users:
|
100
|
+
*
|
21
101
|
* ```ts
|
22
102
|
* import { inAppWallet } from "thirdweb/wallets";
|
103
|
+
* import { sepolia } from "thirdweb/chains";
|
104
|
+
*
|
23
105
|
* const wallet = inAppWallet({
|
24
106
|
* smartAccount: {
|
25
107
|
* chain: sepolia,
|
26
108
|
* sponsorGas: true,
|
27
109
|
* },
|
28
110
|
* });
|
111
|
+
*
|
112
|
+
* // account will be a smart account with sponsored gas enabled
|
113
|
+
* const account = await wallet.connect({
|
114
|
+
* client,
|
115
|
+
* chain,
|
116
|
+
* strategy: "google",
|
117
|
+
* });
|
29
118
|
* ```
|
30
119
|
*
|
31
|
-
* Specify a logo for your login page
|
120
|
+
* ### Specify a logo for your login page (Connect UI)
|
32
121
|
* ```ts
|
33
122
|
* import { inAppWallet } from "thirdweb/wallets";
|
34
123
|
* const wallet = inAppWallet({
|
@@ -43,7 +132,8 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
|
|
43
132
|
* });
|
44
133
|
* ```
|
45
134
|
*
|
46
|
-
* Hide the ability to export the private key within the Connect Modal
|
135
|
+
* ### Hide the ability to export the private key within the Connect Modal UI
|
136
|
+
*
|
47
137
|
* ```ts
|
48
138
|
* import { inAppWallet } from "thirdweb/wallets";
|
49
139
|
* const wallet = inAppWallet({
|
@@ -51,7 +141,10 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
|
|
51
141
|
* });
|
52
142
|
* ```
|
53
143
|
*
|
54
|
-
* Open the Oauth window in the same tab
|
144
|
+
* ### Open the Oauth window in the same tab
|
145
|
+
*
|
146
|
+
* By default, the Oauth window will open in a popup window. You can change this behavior by setting the `auth.mode` option to `"redirect"`.
|
147
|
+
*
|
55
148
|
* ```ts
|
56
149
|
* import { inAppWallet } from "thirdweb/wallets";
|
57
150
|
* const wallet = inAppWallet({
|
@@ -60,6 +153,8 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
|
|
60
153
|
* }
|
61
154
|
* });
|
62
155
|
* ```
|
156
|
+
*
|
157
|
+
* @returns The created in-app wallet.
|
63
158
|
* @wallet
|
64
159
|
*/
|
65
160
|
export declare function inAppWallet(createOptions?: CreateWalletArgs<"inApp">[1]): Wallet<"inApp">;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/web/in-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D
|
1
|
+
{"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/web/in-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4JG;AACH,wBAAgB,WAAW,CACzB,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC3C,MAAM,CAAC,OAAO,CAAC,CAUjB"}
|
@@ -1,23 +1,89 @@
|
|
1
1
|
import type { Wallet } from "../interfaces/wallet.js";
|
2
2
|
import type { CreateWalletArgs } from "../wallet-types.js";
|
3
3
|
/**
|
4
|
-
* Creates a smart wallet.
|
4
|
+
* Creates a ERC4337 smart wallet based on a admin account.
|
5
|
+
*
|
6
|
+
* Smart wallets are smart contract wallets that enable multiple benefits for users:
|
7
|
+
*
|
8
|
+
* - Sponsor gas fees for transactions
|
9
|
+
* - Multiple owners
|
10
|
+
* - Session keys
|
11
|
+
* - Batch transactions
|
12
|
+
* - Predictable addresses
|
13
|
+
* - Programmable features
|
14
|
+
*
|
15
|
+
* [Learn more about account abstraction](https://portal.thirdweb.com/connect/account-abstraction/how-it-works)
|
16
|
+
*
|
5
17
|
* @param createOptions - The options for creating the wallet.
|
18
|
+
* Refer to [SmartWalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/SmartWalletCreationOptions) for more details.
|
6
19
|
* @returns The created smart wallet.
|
7
20
|
* @example
|
21
|
+
*
|
22
|
+
* ## Connect to a smart wallet
|
23
|
+
*
|
24
|
+
* To connect to a smart wallet, you need to provide an admin account as the `personalAccount` option.
|
25
|
+
*
|
26
|
+
* Any wallet can be used as an admin account, including an in-app wallets.
|
27
|
+
*
|
28
|
+
* The `sponsorGas` option is used to enable sponsored gas for transactions automatically.
|
29
|
+
*
|
8
30
|
* ```ts
|
9
|
-
* import {
|
31
|
+
* import { smartWalletm inAppWallet } from "thirdweb/wallets";
|
32
|
+
* import { sepolia } from "thirdweb/chains";
|
33
|
+
* import { sendTransaction } from "thirdweb";
|
10
34
|
*
|
11
35
|
* const wallet = smartWallet({
|
12
36
|
* chain: sepolia,
|
13
|
-
*
|
37
|
+
* sponsorGas: true, // enable sponsored transactions
|
14
38
|
* });
|
15
39
|
*
|
16
|
-
*
|
40
|
+
* // any wallet can be used as an admin account
|
41
|
+
* // in this example we use an in-app wallet
|
42
|
+
* const adminWallet = inAppWallet();
|
43
|
+
* const personalAccount = await adminWallet.connect({
|
17
44
|
* client,
|
18
|
-
*
|
45
|
+
* chain: sepolia,
|
46
|
+
* strategy: "google",
|
47
|
+
* });
|
48
|
+
*
|
49
|
+
* const smartAccount = await wallet.connect({
|
50
|
+
* client,
|
51
|
+
* personalAccount, // pass the admin account
|
52
|
+
* });
|
53
|
+
*
|
54
|
+
* // sending sponsored transactions with the smartAccount
|
55
|
+
* await sendTransaction({
|
56
|
+
* account: smartAccount,
|
57
|
+
* transaction,
|
19
58
|
* });
|
20
59
|
* ```
|
60
|
+
*
|
61
|
+
* ## Configuring the smart wallet
|
62
|
+
*
|
63
|
+
* You can pass options to the `smartWallet` function to configure the smart wallet.
|
64
|
+
*
|
65
|
+
* ```ts
|
66
|
+
* import { smartWallet } from "thirdweb/wallets";
|
67
|
+
* import { sepolia } from "thirdweb/chains";
|
68
|
+
*
|
69
|
+
* const wallet = smartWallet({
|
70
|
+
* chain: sepolia,
|
71
|
+
* sponsorGas: true, // enable sponsored transactions
|
72
|
+
* factoryAddress: "0x...", // custom factory address
|
73
|
+
* overrides: {
|
74
|
+
* accountAddress: "0x...", // override account address
|
75
|
+
* accountSalt: "0x...", // override account salt
|
76
|
+
* entrypointAddress: "0x...", // override entrypoint address
|
77
|
+
* erc20Paymaster: { ... }, // enable erc20 paymaster
|
78
|
+
* bundlerUrl: "https://...", // override bundler url
|
79
|
+
* paymaster: (userOp) => { ... }, // override paymaster
|
80
|
+
* ...
|
81
|
+
* }
|
82
|
+
* });
|
83
|
+
* ```
|
84
|
+
*
|
85
|
+
* Refer to [SmartWalletOptions](https://portal.thirdweb.com/references/typescript/v5/SmartWalletOptions) for more details.
|
86
|
+
*
|
21
87
|
* @wallet
|
22
88
|
*/
|
23
89
|
export declare function smartWallet(createOptions: CreateWalletArgs<"smart">[1]): Wallet<"smart">;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"smart-wallet.d.ts","sourceRoot":"","sources":["../../../../src/wallets/smart/smart-wallet.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAG5B
|
1
|
+
{"version":3,"file":"smart-wallet.d.ts","sourceRoot":"","sources":["../../../../src/wallets/smart/smart-wallet.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AACH,wBAAgB,WAAW,CACzB,aAAa,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC1C,MAAM,CAAC,OAAO,CAAC,CAwFjB"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "thirdweb",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.43.0-nightly-75cc5a6434d29dbfe69b6cd6344a7c8426d59fac-20240731000316",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/thirdweb-dev/js.git#main"
|
@@ -12,7 +12,18 @@ export type AdapterWalletOptions = {
|
|
12
12
|
};
|
13
13
|
|
14
14
|
/**
|
15
|
-
* Creates a wallet from the given
|
15
|
+
* Creates a wallet from the given account.
|
16
|
+
*
|
17
|
+
* You can use this to:
|
18
|
+
*
|
19
|
+
* - convert a third party library wallet (wagmi, viem, ethers) into a thirdweb wallet.
|
20
|
+
* - connect with a private key (for automated tests)
|
21
|
+
*
|
22
|
+
* Available wallet adatpers:
|
23
|
+
* - [Viem](https://portal.thirdweb.com/references/typescript/v5/viemAdapter)
|
24
|
+
* - [Ethers 6](https://portal.thirdweb.com/references/typescript/v5/ethers6Adapter)
|
25
|
+
* - [Ethers 5](https://portal.thirdweb.com/references/typescript/v5/ethers5Adapter)
|
26
|
+
*
|
16
27
|
* @param options - The options for the adapter wallet.
|
17
28
|
* @returns a wallet instance.
|
18
29
|
*
|
package/src/cli/bin.ts
CHANGED
@@ -19,11 +19,29 @@ async function main() {
|
|
19
19
|
} else {
|
20
20
|
await generate(chainIdPlusContract);
|
21
21
|
}
|
22
|
+
break;
|
23
|
+
}
|
22
24
|
|
25
|
+
case "login": {
|
26
|
+
// Not implemented yet
|
27
|
+
console.info(
|
28
|
+
"Please instead pass a secret key to the command directly, learn more: https://support.thirdweb.com/troubleshooting-errors/7Y1BqKNvtLdBv5fZkRZZB3/issue-linking-device-on-the-authorization-page-via-thirdweb-cli/cn9LRA3ax7XCP6uxwRYdvx",
|
29
|
+
);
|
30
|
+
process.exit(1);
|
23
31
|
break;
|
24
32
|
}
|
25
33
|
|
26
34
|
default: {
|
35
|
+
// check several commands for missing -k flag
|
36
|
+
const commands = ["create", "deploy", "publish", "generate", "upload"];
|
37
|
+
if (commands.includes(command) && !rest.includes("-k")) {
|
38
|
+
console.info(
|
39
|
+
"Please include the -k flag with your secret key, learn more: https://support.thirdweb.com/troubleshooting-errors/7Y1BqKNvtLdBv5fZkRZZB3/issue-linking-device-on-the-authorization-page-via-thirdweb-cli/cn9LRA3ax7XCP6uxwRYdvx",
|
40
|
+
);
|
41
|
+
process.exit(1);
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
|
27
45
|
const isWindows = /^win/.test(process.platform);
|
28
46
|
|
29
47
|
const isBunAvailable = (() => {
|
package/src/exports/react.ts
CHANGED
@@ -165,5 +165,9 @@ export {
|
|
165
165
|
BuyDirectListingButton,
|
166
166
|
type BuyDirectListingButtonProps,
|
167
167
|
} from "../react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.js";
|
168
|
+
export {
|
169
|
+
CreateDirectListingButton,
|
170
|
+
type CreateDirectListingButtonProps,
|
171
|
+
} from "../react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js";
|
168
172
|
|
169
173
|
export { useConnectionManager } from "../react/core/providers/connection-manager.js";
|
@@ -10,6 +10,12 @@ export {
|
|
10
10
|
} from "../../wallets/in-app/web/lib/auth/index.js";
|
11
11
|
|
12
12
|
export { type GetAuthenticatedUserParams } from "../../wallets/in-app/core/authentication/type.js";
|
13
|
+
export type {
|
14
|
+
InAppWalletCreationOptions,
|
15
|
+
InAppWalletAuth,
|
16
|
+
InAppWalletSocialAuth,
|
17
|
+
InAppWalletConnectionOptions,
|
18
|
+
} from "../../wallets/in-app/core/wallet/types.js";
|
13
19
|
|
14
20
|
export { hasStoredPasskey } from "../../wallets/in-app/web/lib/auth/passkeys.js";
|
15
21
|
|
@@ -42,6 +42,9 @@ export type {
|
|
42
42
|
WalletCreationOptions,
|
43
43
|
WalletConnectionOption,
|
44
44
|
CreateWalletArgs,
|
45
|
+
InjectedConnectOptions,
|
46
|
+
DeepLinkSupportedWalletCreationOptions,
|
47
|
+
StandaloneWCConnectOptions,
|
45
48
|
} from "../wallets/wallet-types.js";
|
46
49
|
|
47
50
|
export type {
|
@@ -82,7 +85,10 @@ export type {
|
|
82
85
|
InAppWalletSocialAuth as EmbeddedWalletSocialAuth,
|
83
86
|
} from "../wallets/in-app/core/wallet/types.js";
|
84
87
|
|
85
|
-
export type {
|
88
|
+
export type {
|
89
|
+
CoinbaseWalletCreationOptions,
|
90
|
+
CoinbaseSDKWalletConnectionOptions,
|
91
|
+
} from "../wallets/coinbase/coinbaseWebSDK.js";
|
86
92
|
|
87
93
|
export type {
|
88
94
|
WalletEmitter,
|
@@ -94,6 +100,7 @@ export { getWalletInfo } from "../wallets/__generated__/getWalletInfo.js";
|
|
94
100
|
export { type WalletInfo } from "../wallets/wallet-info.js";
|
95
101
|
|
96
102
|
export { createWalletAdapter } from "../adapters/wallet-adapter.js";
|
103
|
+
export type { AdapterWalletOptions } from "../adapters/wallet-adapter.js";
|
97
104
|
|
98
105
|
// wallet connect
|
99
106
|
export {
|
package/src/exports/wallets.ts
CHANGED
@@ -12,6 +12,11 @@ export {
|
|
12
12
|
inAppWallet as embeddedWallet,
|
13
13
|
} from "../wallets/in-app/web/in-app.js";
|
14
14
|
export { ecosystemWallet } from "../wallets/in-app/web/ecosystem.js";
|
15
|
+
export type {
|
16
|
+
EcosystemWalletCreationOptions,
|
17
|
+
EcosystemWalletConnectionOptions,
|
18
|
+
EcosystemWalletAutoConnectOptions,
|
19
|
+
} from "../wallets/ecosystem/types.js";
|
15
20
|
export { smartWallet } from "../wallets/smart/smart-wallet.js";
|
16
21
|
|
17
22
|
export type { Wallet, Account } from "../wallets/interfaces/wallet.js";
|
@@ -49,6 +54,9 @@ export type {
|
|
49
54
|
WalletCreationOptions,
|
50
55
|
WalletConnectionOption,
|
51
56
|
CreateWalletArgs,
|
57
|
+
InjectedConnectOptions,
|
58
|
+
DeepLinkSupportedWalletCreationOptions,
|
59
|
+
StandaloneWCConnectOptions,
|
52
60
|
} from "../wallets/wallet-types.js";
|
53
61
|
|
54
62
|
export type {
|
@@ -89,7 +97,10 @@ export type {
|
|
89
97
|
InAppWalletSocialAuth as EmbeddedWalletSocialAuth,
|
90
98
|
} from "../wallets/in-app/core/wallet/types.js";
|
91
99
|
|
92
|
-
export type {
|
100
|
+
export type {
|
101
|
+
CoinbaseWalletCreationOptions,
|
102
|
+
CoinbaseSDKWalletConnectionOptions,
|
103
|
+
} from "../wallets/coinbase/coinbaseWebSDK.js";
|
93
104
|
|
94
105
|
export type {
|
95
106
|
WalletEmitter,
|
@@ -101,6 +112,7 @@ export { getWalletInfo } from "../wallets/__generated__/getWalletInfo.js";
|
|
101
112
|
export { type WalletInfo } from "../wallets/wallet-info.js";
|
102
113
|
|
103
114
|
export { createWalletAdapter } from "../adapters/wallet-adapter.js";
|
115
|
+
export type { AdapterWalletOptions } from "../adapters/wallet-adapter.js";
|
104
116
|
|
105
117
|
// wallet connect
|
106
118
|
export {
|
@@ -76,7 +76,11 @@ export type CreateListingParams = {
|
|
76
76
|
* import { createListing } from "thirdweb/extensions/marketplace";
|
77
77
|
* import { sendTransaction } from "thirdweb";
|
78
78
|
*
|
79
|
-
* const transaction = createListing({
|
79
|
+
* const transaction = createListing({
|
80
|
+
* assetContractAddress: "0x...", // the NFT contract address that you want to sell
|
81
|
+
* tokenId={0n}, // the token id you want to sell
|
82
|
+
* pricePerToken="0.1" // sell for 0.1 <native token>
|
83
|
+
* });
|
80
84
|
*
|
81
85
|
* await sendTransaction({ transaction, account });
|
82
86
|
* ```
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { useSyncExternalStore } from "react";
|
2
|
-
import {
|
2
|
+
import { useConnectionManagerCtx } from "../../providers/connection-manager.js";
|
3
3
|
|
4
4
|
/**
|
5
5
|
* A hook that returns the active account
|
@@ -13,7 +13,7 @@ import { useConnectionManager } from "../../providers/connection-manager.js";
|
|
13
13
|
* @walletConnection
|
14
14
|
*/
|
15
15
|
export function useActiveAccount() {
|
16
|
-
const manager =
|
16
|
+
const manager = useConnectionManagerCtx("useActiveAccount");
|
17
17
|
const store = manager.activeAccountStore;
|
18
18
|
return useSyncExternalStore(store.subscribe, store.getValue, store.getValue);
|
19
19
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { useSyncExternalStore } from "react";
|
2
|
-
import {
|
2
|
+
import { useConnectionManagerCtx } from "../../providers/connection-manager.js";
|
3
3
|
|
4
4
|
/**
|
5
5
|
* A hook that returns the active wallet
|
@@ -13,7 +13,7 @@ import { useConnectionManager } from "../../providers/connection-manager.js";
|
|
13
13
|
* @walletConnection
|
14
14
|
*/
|
15
15
|
export function useActiveWallet() {
|
16
|
-
const manager =
|
16
|
+
const manager = useConnectionManagerCtx("useActiveWallet");
|
17
17
|
const store = manager.activeWalletStore;
|
18
18
|
return useSyncExternalStore(store.subscribe, store.getValue, store.getValue);
|
19
19
|
}
|