thirdweb 5.42.0-nightly-e27ebef85bb61342c3de53f85e134cf4a29f787c-20240730000342 → 5.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/adapters/wallet-adapter.js +12 -1
- package/dist/cjs/adapters/wallet-adapter.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/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/wallets/shared/ConnectWalletSocialOptions.js +19 -7
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +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/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/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/wallets/shared/ConnectWalletSocialOptions.js +19 -7
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +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/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/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/wallets/shared/ConnectWalletSocialOptions.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/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/exports/wallets/in-app.ts +6 -0
- package/src/exports/wallets.native.ts +8 -1
- package/src/exports/wallets.ts +13 -1
- 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/wallets/shared/ConnectWalletSocialOptions.tsx +19 -8
- 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
@@ -1,17 +1,211 @@
|
|
1
1
|
import type { ConnectButtonProps } from "../../../core/hooks/connection/ConnectButtonProps.js";
|
2
2
|
/**
|
3
|
-
* A component that allows
|
4
|
-
*
|
3
|
+
* A fully featured wallet connection component that allows to:
|
4
|
+
*
|
5
|
+
* - Connect to 350+ external wallets
|
6
|
+
* - Connect with email, phone, passkey or socials
|
7
|
+
* - Convert any wallet to a ERC4337 smart wallet for gasless transactions
|
8
|
+
* - Sign in with ethereum (Auth)
|
9
|
+
*
|
10
|
+
* Once connected, the component allows to:
|
11
|
+
*
|
12
|
+
* - Reolve ENS names and avatars
|
13
|
+
* - Manage multipple connected wallets
|
14
|
+
* - Send and receive native tokens and ERC20 tokens
|
15
|
+
* - View ERC20 tokens and NFTs
|
16
|
+
* - Onramp, bridge and swap tokens
|
17
|
+
* - Switch chains
|
18
|
+
* - Connect to another app with WalletConnect
|
19
|
+
*
|
5
20
|
* @example
|
21
|
+
*
|
22
|
+
* ## Default setup
|
23
|
+
*
|
6
24
|
* ```tsx
|
25
|
+
* import { createThirdwebClient } from "thirdweb";
|
26
|
+
* import { ConnectButton } from "thirdweb/react";
|
27
|
+
*
|
28
|
+
* const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
|
29
|
+
*
|
7
30
|
* <ConnectButton
|
8
31
|
* client={client}
|
9
32
|
* />
|
10
33
|
* ```
|
34
|
+
*
|
35
|
+
* [View all available config options](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps)
|
36
|
+
*
|
37
|
+
* ## Customization options
|
38
|
+
*
|
39
|
+
* ### Customizing wallet options
|
40
|
+
*
|
41
|
+
* ```tsx
|
42
|
+
* <ConnectButton
|
43
|
+
* client={client}
|
44
|
+
* wallets={[
|
45
|
+
* createWallet("io.metamask"),
|
46
|
+
* createWallet("com.coinbase.wallet"),
|
47
|
+
* createWallet("me.rainbow"),
|
48
|
+
* ]}
|
49
|
+
* />
|
50
|
+
* ```
|
51
|
+
*
|
52
|
+
* [View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets)
|
53
|
+
*
|
54
|
+
* ### Customizing the default chain to connect to
|
55
|
+
*
|
56
|
+
* ```tsx
|
57
|
+
* import { base } from "thirdweb/chains";
|
58
|
+
*
|
59
|
+
* <ConnectButton
|
60
|
+
* client={client}
|
61
|
+
* chain={base}
|
62
|
+
* />
|
63
|
+
* ```
|
64
|
+
*
|
65
|
+
* ### Enabling sign in with ethereum (Auth)
|
66
|
+
*
|
67
|
+
* ```tsx
|
68
|
+
* <ConnectButton
|
69
|
+
* client={client}
|
70
|
+
* auth={{
|
71
|
+
* isLoggedIn: async (address) => {
|
72
|
+
* console.log("checking if logged in!", { address });
|
73
|
+
* return await isLoggedIn();
|
74
|
+
* },
|
75
|
+
* doLogin: async (params) => {
|
76
|
+
* console.log("logging in!");
|
77
|
+
* await login(params);
|
78
|
+
* },
|
79
|
+
* getLoginPayload: async ({ address }) =>
|
80
|
+
* generatePayload({ address }),
|
81
|
+
* doLogout: async () => {
|
82
|
+
* console.log("logging out!");
|
83
|
+
* await logout();
|
84
|
+
* },
|
85
|
+
* }}
|
86
|
+
* />;
|
87
|
+
* ```
|
88
|
+
*
|
89
|
+
* ### Customizing the theme
|
90
|
+
*
|
91
|
+
* ```tsx
|
92
|
+
* <ConnectButton
|
93
|
+
* client={client}
|
94
|
+
* theme="light"
|
95
|
+
* />
|
96
|
+
* ```
|
97
|
+
*
|
98
|
+
* For more granular control, you can also pass a custom theme object:
|
99
|
+
*
|
100
|
+
* ```tsx
|
101
|
+
* <ConnectButton
|
102
|
+
* client={client}
|
103
|
+
* theme={lightTheme({
|
104
|
+
* colors: {
|
105
|
+
* modalBg: "red",
|
106
|
+
* },
|
107
|
+
* })}
|
108
|
+
* />
|
109
|
+
* ```
|
110
|
+
*
|
111
|
+
* [View all available themes properties](https://portal.thirdweb.com/references/typescript/v5/Theme)
|
112
|
+
*
|
113
|
+
* ### Changing the display language
|
114
|
+
*
|
115
|
+
* ```tsx
|
116
|
+
* <ConnectEmbed
|
117
|
+
* client={client}
|
118
|
+
* locale="ja_JP"
|
119
|
+
* />
|
120
|
+
* ```
|
121
|
+
*
|
122
|
+
* [View all available locales](https://portal.thirdweb.com/references/typescript/v5/LocaleId)
|
123
|
+
*
|
124
|
+
* ### Customizing the connect button UI
|
125
|
+
*
|
126
|
+
* ```tsx
|
127
|
+
* <ConnectButton
|
128
|
+
* client={client}
|
129
|
+
* connectButton={{
|
130
|
+
* label: "Sign in to MyApp",
|
131
|
+
* }}
|
132
|
+
* />
|
133
|
+
* ```
|
134
|
+
*
|
135
|
+
* ### Customizing the modal UI
|
136
|
+
*
|
137
|
+
* ```tsx
|
138
|
+
* <ConnectButton
|
139
|
+
* client={client}
|
140
|
+
* connectModal={{
|
141
|
+
* title: "Sign in to MyApp",
|
142
|
+
* titleIcon: https://example.com/logo.png,
|
143
|
+
* size: "compact",
|
144
|
+
* }}
|
145
|
+
* />
|
146
|
+
* ```
|
147
|
+
*
|
148
|
+
* ### Customizing details button UI (after connecting)
|
149
|
+
*
|
150
|
+
* ```tsx
|
151
|
+
* <ConnectButton
|
152
|
+
* client={client}
|
153
|
+
* detailsButton={{
|
154
|
+
* displayBalanceToken: {
|
155
|
+
* [sepolia.id]: "0x...", // token address to display balance for
|
156
|
+
* [ethereum.id]: "0x...", // token address to display balance for
|
157
|
+
* },
|
158
|
+
* }}
|
159
|
+
* />
|
160
|
+
* ```
|
161
|
+
*
|
162
|
+
* [View all available auth helper functions](https://portal.thirdweb.com/references/typescript/v5/createAuth)
|
163
|
+
*
|
164
|
+
* ### Customizing the Auth sign in button (after connecting, but before authenticating)
|
165
|
+
*
|
166
|
+
* ```tsx
|
167
|
+
* <ConnectButton
|
168
|
+
* client={client}
|
169
|
+
* auth={{ ... }}
|
170
|
+
* signInButton: {
|
171
|
+
* label: "Authenticate with MyApp",
|
172
|
+
* },
|
173
|
+
* }}
|
174
|
+
* />;
|
175
|
+
* ```
|
176
|
+
*
|
177
|
+
* ### Customizing supported Tokens and NFTs
|
178
|
+
*
|
179
|
+
* These tokens and NFTs will be shown in the modal when the user clicks "View Assets", as well as the send token screen.
|
180
|
+
*
|
181
|
+
* ```tsx
|
182
|
+
* <ConnectButton
|
183
|
+
* client={client}
|
184
|
+
* supportedTokens={{
|
185
|
+
* [ethereum.id]: [
|
186
|
+
* {
|
187
|
+
* address: "0x...",
|
188
|
+
* name: "MyToken",
|
189
|
+
* symbol: "MT",
|
190
|
+
* icon: "https://example.com/icon.png",
|
191
|
+
* },
|
192
|
+
* ],
|
193
|
+
* }}
|
194
|
+
* supportedNFTs={{
|
195
|
+
* [ethereum.id]: [
|
196
|
+
* "0x...", // nft contract address
|
197
|
+
* ],
|
198
|
+
* }}
|
199
|
+
* />
|
200
|
+
* ```
|
201
|
+
*
|
11
202
|
* @param props
|
12
203
|
* Props for the `ConnectButton` component
|
13
204
|
*
|
14
205
|
* Refer to [ConnectButtonProps](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps) to see the available props.
|
206
|
+
*
|
207
|
+
* @returns A JSX element that renders the <ConnectButton> component.
|
208
|
+
*
|
15
209
|
* @component
|
16
210
|
*/
|
17
211
|
export declare function ConnectButton(props: ConnectButtonProps): import("react/jsx-runtime.js").JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ConnectButton.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/ConnectWallet/ConnectButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AA2B/F
|
1
|
+
{"version":3,"file":"ConnectButton.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/ConnectWallet/ConnectButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AA2B/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgNG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,8CAkGtD"}
|
@@ -1,20 +1,126 @@
|
|
1
1
|
import type { ConnectEmbedProps } from "../../../../core/hooks/connection/ConnectEmbedProps.js";
|
2
2
|
/**
|
3
|
-
*
|
3
|
+
* An inline wallet connection component that allows to:
|
4
4
|
*
|
5
|
-
*
|
5
|
+
* - Connect to 350+ external wallets
|
6
|
+
* - Connect with email, phone, passkey or socials
|
7
|
+
* - Convert any wallet to a ERC4337 smart wallet for gasless transactions
|
8
|
+
* - Sign in with ethereum (Auth)
|
9
|
+
*
|
10
|
+
* It renders the same UI as the [`ConnectButton`](https://portal.thirdweb.com/react/v5/ConnectButton) component's modal - but directly inline in the page instead of being in a modal.
|
11
|
+
*
|
12
|
+
* Once connected, the component does not render any UI. It only renders UI if wallet is not connected.
|
6
13
|
*
|
7
|
-
* It only renders UI if wallet is not connected
|
8
14
|
* @example
|
15
|
+
*
|
16
|
+
* ## Default setup
|
17
|
+
*
|
9
18
|
* ```tsx
|
19
|
+
* import { createThirdwebClient } from "thirdweb";
|
20
|
+
* import { ConnectEmbed } from "thirdweb/react";
|
21
|
+
*
|
22
|
+
* const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" });
|
23
|
+
*
|
10
24
|
* <ConnectEmbed
|
11
25
|
* client={client}
|
12
26
|
* />
|
13
27
|
* ```
|
28
|
+
*
|
29
|
+
* [View all available config options](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps)
|
30
|
+
*
|
31
|
+
* ## Customization options
|
32
|
+
*
|
33
|
+
* ### Customizing wallet options
|
34
|
+
*
|
35
|
+
* ```tsx
|
36
|
+
* <ConnectEmbed
|
37
|
+
* client={client}
|
38
|
+
* wallets={[
|
39
|
+
* createWallet("io.metamask"),
|
40
|
+
* createWallet("com.coinbase.wallet"),
|
41
|
+
* createWallet("me.rainbow"),
|
42
|
+
* ]}
|
43
|
+
* />
|
44
|
+
* ```
|
45
|
+
*
|
46
|
+
* [View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets)
|
47
|
+
*
|
48
|
+
* ### Customizing the default chain to connect to
|
49
|
+
*
|
50
|
+
* ```tsx
|
51
|
+
* import { base } from "thirdweb/chains";
|
52
|
+
*
|
53
|
+
* <ConnectEmbed
|
54
|
+
* client={client}
|
55
|
+
* chain={base}
|
56
|
+
* />
|
57
|
+
* ```
|
58
|
+
*
|
59
|
+
* ### Enabling sign in with ethereum (Auth)
|
60
|
+
*
|
61
|
+
* ```tsx
|
62
|
+
* <ConnectEmbed
|
63
|
+
* client={client}
|
64
|
+
* auth={{
|
65
|
+
* isLoggedIn: async (address) => {
|
66
|
+
* console.log("checking if logged in!", { address });
|
67
|
+
* return await isLoggedIn();
|
68
|
+
* },
|
69
|
+
* doLogin: async (params) => {
|
70
|
+
* console.log("logging in!");
|
71
|
+
* await login(params);
|
72
|
+
* },
|
73
|
+
* getLoginPayload: async ({ address }) =>
|
74
|
+
* generatePayload({ address }),
|
75
|
+
* doLogout: async () => {
|
76
|
+
* console.log("logging out!");
|
77
|
+
* await logout();
|
78
|
+
* },
|
79
|
+
* }}
|
80
|
+
* />;
|
81
|
+
* ```
|
82
|
+
*
|
83
|
+
* ### Customizing the theme
|
84
|
+
*
|
85
|
+
* ```tsx
|
86
|
+
* <ConnectEmbed
|
87
|
+
* client={client}
|
88
|
+
* theme="light"
|
89
|
+
* />
|
90
|
+
* ```
|
91
|
+
*
|
92
|
+
* For more granular control, you can also pass a custom theme object:
|
93
|
+
*
|
94
|
+
* ```tsx
|
95
|
+
* <ConnectEmbed
|
96
|
+
* client={client}
|
97
|
+
* theme={lightTheme({
|
98
|
+
* colors: {
|
99
|
+
* modalBg: "red",
|
100
|
+
* },
|
101
|
+
* })}
|
102
|
+
* />
|
103
|
+
* ```
|
104
|
+
*
|
105
|
+
* [View all available themes properties](https://portal.thirdweb.com/references/typescript/v5/Theme)
|
106
|
+
*
|
107
|
+
* ### Changing the display language
|
108
|
+
*
|
109
|
+
* ```tsx
|
110
|
+
* <ConnectEmbed
|
111
|
+
* client={client}
|
112
|
+
* locale="ja_JP"
|
113
|
+
* />
|
114
|
+
* ```
|
115
|
+
*
|
116
|
+
* [View all available locales](https://portal.thirdweb.com/references/typescript/v5/LocaleId)
|
117
|
+
*
|
14
118
|
* @param props -
|
15
119
|
* The props for the `ConnectEmbed` component.
|
16
120
|
*
|
17
121
|
* Refer to the [`ConnectEmbedProps`](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps) type for more details
|
122
|
+
*
|
123
|
+
* @returns A JSX element that renders the <ConnectEmbed> component.
|
18
124
|
* @component
|
19
125
|
*/
|
20
126
|
export declare function ConnectEmbed(props: ConnectEmbedProps): import("react/jsx-runtime.js").JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ConnectEmbed.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAyBhG
|
1
|
+
{"version":3,"file":"ConnectEmbed.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAyBhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,8CA+GpD;AAuHD,eAAO,MAAM,cAAc;;SAhYG,MAAO,WAAW;;eAiYnC,SAAS,GAAG,MAAM;yGAwB7B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ConnectWalletSocialOptions.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAuB7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,MAAM,MAAM,0BAA0B,GAClC,SAAS,GACT;IACE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,gBAAgB,CAAC;QACvB,iBAAiB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;KACrC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAWN,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,UAC9B,+BAA+B,+
|
1
|
+
{"version":3,"file":"ConnectWalletSocialOptions.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAuB7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,MAAM,MAAM,0BAA0B,GAClC,SAAS,GACT;IACE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,gBAAgB,CAAC;QACvB,iBAAiB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;KACrC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAWN,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,UAC9B,+BAA+B,+CAuTvC,CAAC"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "5.42.0
|
1
|
+
export declare const version = "5.42.0";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
@@ -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"}
|