thirdweb 5.29.3-nightly-ffaff744f72d2cb22896e7501677b48f76ea857a-20240614184424 → 5.29.3-nightly-f8e0c5f84bb3a07a2911b5fce51da3983bb2e9e9-20240614190203
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-native.js → react.native.js} +1 -1
- package/dist/cjs/exports/{react-native.js.map → react.native.js.map} +1 -1
- package/dist/cjs/exports/wallets/embedded.js +4 -4
- package/dist/cjs/exports/wallets/embedded.js.map +1 -1
- package/dist/cjs/exports/wallets/in-app.js +4 -3
- package/dist/cjs/exports/wallets/in-app.js.map +1 -1
- package/dist/cjs/exports/wallets/in-app.native.js +17 -0
- package/dist/cjs/exports/wallets/in-app.native.js.map +1 -0
- package/dist/cjs/exports/wallets.js +10 -7
- package/dist/cjs/exports/wallets.js.map +1 -1
- package/dist/cjs/exports/{react-native/wallets.js → wallets.native.js} +13 -11
- package/dist/cjs/exports/wallets.native.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletOTPLoginUI.js +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletOTPLoginUI.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/create-wallet.js +3 -128
- package/dist/cjs/wallets/create-wallet.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/type.js +6 -1
- package/dist/cjs/wallets/in-app/core/authentication/type.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js +100 -0
- package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js.map +1 -0
- package/dist/cjs/wallets/in-app/core/wallet/index.js +14 -6
- package/dist/cjs/wallets/in-app/core/wallet/index.js.map +1 -1
- package/dist/cjs/wallets/in-app/{core/authentication → native/auth}/index.js +15 -42
- package/dist/cjs/wallets/in-app/native/auth/index.js.map +1 -0
- package/dist/cjs/wallets/in-app/native/{auth.js → auth/native-auth.js} +9 -9
- package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -0
- package/dist/cjs/wallets/in-app/native/in-app.js +69 -0
- package/dist/cjs/wallets/in-app/native/in-app.js.map +1 -0
- package/dist/cjs/wallets/in-app/native/native-connector.js +9 -10
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/in-app.js +69 -0
- package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -0
- package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js +219 -0
- package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -0
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js +121 -208
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js +3 -4
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/esm/exports/{react-native.js → react.native.js} +1 -1
- package/dist/esm/exports/{react-native.js.map → react.native.js.map} +1 -1
- package/dist/esm/exports/wallets/embedded.js +3 -2
- package/dist/esm/exports/wallets/embedded.js.map +1 -1
- package/dist/esm/exports/wallets/in-app.js +4 -2
- package/dist/esm/exports/wallets/in-app.js.map +1 -1
- package/dist/esm/exports/wallets/in-app.native.js +9 -0
- package/dist/esm/exports/wallets/in-app.native.js.map +1 -0
- package/dist/esm/exports/wallets.js +7 -4
- package/dist/esm/exports/wallets.js.map +1 -1
- package/dist/esm/exports/wallets.native.js +23 -0
- package/dist/esm/exports/wallets.native.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletOTPLoginUI.js +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletOTPLoginUI.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/create-wallet.js +1 -125
- package/dist/esm/wallets/create-wallet.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/type.js +5 -0
- package/dist/esm/wallets/in-app/core/authentication/type.js.map +1 -1
- package/dist/esm/wallets/in-app/core/wallet/in-app-core.js +95 -0
- package/dist/esm/wallets/in-app/core/wallet/in-app-core.js.map +1 -0
- package/dist/esm/wallets/in-app/core/wallet/index.js +14 -6
- package/dist/esm/wallets/in-app/core/wallet/index.js.map +1 -1
- package/dist/esm/wallets/in-app/{core/authentication → native/auth}/index.js +14 -40
- package/dist/esm/wallets/in-app/native/auth/index.js.map +1 -0
- package/dist/esm/wallets/in-app/native/{auth.js → auth/native-auth.js} +9 -9
- package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -0
- package/dist/esm/wallets/in-app/native/in-app.js +65 -0
- package/dist/esm/wallets/in-app/native/in-app.js.map +1 -0
- package/dist/esm/wallets/in-app/native/native-connector.js +2 -3
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/in-app.js +65 -0
- package/dist/esm/wallets/in-app/web/in-app.js.map +1 -0
- package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js +215 -0
- package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -0
- package/dist/esm/wallets/in-app/web/lib/auth/index.js +115 -206
- package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/web-connector.js +2 -3
- package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/types/exports/{react-native.d.ts → react.native.d.ts} +1 -1
- package/dist/types/exports/{react-native.d.ts.map → react.native.d.ts.map} +1 -1
- package/dist/types/exports/wallets/embedded.d.ts +3 -2
- package/dist/types/exports/wallets/embedded.d.ts.map +1 -1
- package/dist/types/exports/wallets/in-app.d.ts +3 -2
- package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
- package/dist/types/exports/wallets/in-app.native.d.ts +5 -0
- package/dist/types/exports/wallets/in-app.native.d.ts.map +1 -0
- package/dist/types/exports/wallets.d.ts +4 -3
- package/dist/types/exports/wallets.d.ts.map +1 -1
- package/dist/types/exports/{react-native/wallets.d.ts → wallets.native.d.ts} +20 -19
- package/dist/types/exports/wallets.native.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/create-wallet.d.ts +0 -53
- package/dist/types/wallets/create-wallet.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/type.d.ts +4 -0
- package/dist/types/wallets/in-app/core/authentication/type.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts +16 -0
- package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts.map +1 -0
- package/dist/types/wallets/in-app/core/wallet/index.d.ts +3 -2
- package/dist/types/wallets/in-app/core/wallet/index.d.ts.map +1 -1
- package/dist/types/wallets/in-app/{core/authentication → native/auth}/index.d.ts +3 -12
- package/dist/types/wallets/in-app/native/auth/index.d.ts.map +1 -0
- package/dist/types/wallets/in-app/native/{auth.d.ts → auth/native-auth.d.ts} +3 -3
- package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -0
- package/dist/types/wallets/in-app/native/in-app.d.ts +56 -0
- package/dist/types/wallets/in-app/native/in-app.d.ts.map +1 -0
- package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/in-app.d.ts +56 -0
- package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -0
- package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts +141 -0
- package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts.map +1 -0
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +78 -137
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
- package/package.json +9 -3
- package/src/exports/wallets/embedded.ts +4 -3
- package/src/exports/wallets/in-app.native.ts +18 -0
- package/src/exports/wallets/in-app.ts +6 -3
- package/src/exports/{react-native/wallets.ts → wallets.native.ts} +21 -19
- package/src/exports/wallets.ts +11 -5
- package/src/react/web/ui/ConnectWallet/Details.tsx +1 -1
- package/src/react/web/wallets/in-app/InAppWalletOTPLoginUI.tsx +1 -1
- package/src/version.ts +1 -1
- package/src/wallets/create-wallet.ts +1 -146
- package/src/wallets/in-app/core/authentication/type.ts +13 -0
- package/src/wallets/in-app/core/wallet/in-app-core.ts +134 -0
- package/src/wallets/in-app/core/wallet/index.ts +16 -5
- package/src/wallets/in-app/{core/authentication → native/auth}/index.ts +15 -57
- package/src/wallets/in-app/native/{auth.ts → auth/native-auth.ts} +10 -10
- package/src/wallets/in-app/native/in-app.ts +70 -0
- package/src/wallets/in-app/native/native-connector.ts +2 -2
- package/src/wallets/in-app/web/in-app.ts +70 -0
- package/src/wallets/in-app/web/lib/auth/iframe-auth.ts +266 -0
- package/src/wallets/in-app/web/lib/auth/index.ts +124 -249
- package/src/wallets/in-app/web/lib/web-connector.ts +2 -2
- package/dist/cjs/exports/react-native/wallets.js.map +0 -1
- package/dist/cjs/wallets/in-app/core/authentication/index.js.map +0 -1
- package/dist/cjs/wallets/in-app/native/auth.js.map +0 -1
- package/dist/esm/exports/react-native/wallets.js +0 -23
- package/dist/esm/exports/react-native/wallets.js.map +0 -1
- package/dist/esm/wallets/in-app/core/authentication/index.js.map +0 -1
- package/dist/esm/wallets/in-app/native/auth.js.map +0 -1
- package/dist/types/exports/react-native/wallets.d.ts.map +0 -1
- package/dist/types/wallets/in-app/core/authentication/index.d.ts.map +0 -1
- package/dist/types/wallets/in-app/native/auth.d.ts.map +0 -1
- /package/src/exports/{react-native.ts → react.native.ts} +0 -0
@@ -1,215 +1,124 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { UserWalletStatus, } from "../../../core/authentication/type.js";
|
2
|
+
import { getOrCreateInAppWalletConnector } from "../../../core/wallet/in-app-core.js";
|
3
|
+
// ---- KEEP IN SYNC WITH /wallets/in-app/native/auth/index.ts ---- //
|
4
|
+
// duplication needed for separate exports between web and native
|
3
5
|
/**
|
4
|
-
*
|
6
|
+
* @internal
|
5
7
|
*/
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
*/
|
12
|
-
constructor({ client, querier, onAuthSuccess, baseUrl, }) {
|
13
|
-
Object.defineProperty(this, "client", {
|
14
|
-
enumerable: true,
|
15
|
-
configurable: true,
|
16
|
-
writable: true,
|
17
|
-
value: void 0
|
18
|
-
});
|
19
|
-
Object.defineProperty(this, "AuthQuerier", {
|
20
|
-
enumerable: true,
|
21
|
-
configurable: true,
|
22
|
-
writable: true,
|
23
|
-
value: void 0
|
24
|
-
});
|
25
|
-
Object.defineProperty(this, "localStorage", {
|
26
|
-
enumerable: true,
|
27
|
-
configurable: true,
|
28
|
-
writable: true,
|
29
|
-
value: void 0
|
30
|
-
});
|
31
|
-
Object.defineProperty(this, "onAuthSuccess", {
|
32
|
-
enumerable: true,
|
33
|
-
configurable: true,
|
34
|
-
writable: true,
|
35
|
-
value: void 0
|
36
|
-
});
|
37
|
-
Object.defineProperty(this, "BaseLogin", {
|
38
|
-
enumerable: true,
|
39
|
-
configurable: true,
|
40
|
-
writable: true,
|
41
|
-
value: void 0
|
42
|
-
});
|
43
|
-
this.client = client;
|
44
|
-
this.AuthQuerier = querier;
|
45
|
-
this.localStorage = new LocalStorage({ clientId: client.clientId });
|
46
|
-
this.onAuthSuccess = onAuthSuccess;
|
47
|
-
this.BaseLogin = new BaseLogin({
|
48
|
-
postLogin: async (result) => {
|
49
|
-
return this.postLogin(result);
|
50
|
-
},
|
51
|
-
preLogin: async () => {
|
52
|
-
await this.preLogin();
|
53
|
-
},
|
54
|
-
querier: querier,
|
55
|
-
client,
|
56
|
-
baseUrl,
|
8
|
+
async function getInAppWalletConnector(client) {
|
9
|
+
return getOrCreateInAppWalletConnector(client, async (client) => {
|
10
|
+
const { InAppWebConnector } = await import("../web-connector.js");
|
11
|
+
return new InAppWebConnector({
|
12
|
+
client: client,
|
57
13
|
});
|
58
|
-
}
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
14
|
+
});
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* Retrieves the authenticated user for the active in-app wallet.
|
18
|
+
* @param options - The arguments for retrieving the authenticated user.
|
19
|
+
* @returns The authenticated user if logged in and wallet initialized, otherwise undefined.
|
20
|
+
* @example
|
21
|
+
* ```ts
|
22
|
+
* import { getAuthenticatedUser } from "thirdweb/wallets/in-app";
|
23
|
+
*
|
24
|
+
* const user = await getAuthenticatedUser({ client });
|
25
|
+
* if (user) {
|
26
|
+
* console.log(user.walletAddress);
|
27
|
+
* }
|
28
|
+
* ```
|
29
|
+
* @wallet
|
30
|
+
*/
|
31
|
+
export async function getAuthenticatedUser(options) {
|
32
|
+
const { client } = options;
|
33
|
+
const connector = await getInAppWalletConnector(client);
|
34
|
+
const user = await connector.getUser();
|
35
|
+
switch (user.status) {
|
36
|
+
case UserWalletStatus.LOGGED_IN_WALLET_INITIALIZED: {
|
37
|
+
return user;
|
65
38
|
}
|
66
|
-
const initializedUser = await this.onAuthSuccess({
|
67
|
-
storedToken,
|
68
|
-
walletDetails,
|
69
|
-
});
|
70
|
-
return initializedUser;
|
71
|
-
}
|
72
|
-
async loginWithAuthToken(authToken, recoveryCode) {
|
73
|
-
await this.preLogin();
|
74
|
-
const result = await this.AuthQuerier.call({
|
75
|
-
procedureName: "loginWithStoredTokenDetails",
|
76
|
-
params: {
|
77
|
-
storedToken: authToken.storedToken,
|
78
|
-
recoveryCode,
|
79
|
-
},
|
80
|
-
});
|
81
|
-
return this.postLogin(result);
|
82
|
-
}
|
83
|
-
/**
|
84
|
-
* Used to log the user into their thirdweb wallet on your platform via a myriad of auth providers
|
85
|
-
* @example
|
86
|
-
* ```typescript
|
87
|
-
* const thirdwebInAppWallet = new InAppWalletSdk({clientId: "YOUR_CLIENT_ID", chain: "Polygon"})
|
88
|
-
* try {
|
89
|
-
* const user = await thirdwebInAppWallet.auth.loginWithModal();
|
90
|
-
* // user is now logged in
|
91
|
-
* } catch (e) {
|
92
|
-
* // User closed modal or something else went wrong during the authentication process
|
93
|
-
* console.error(e)
|
94
|
-
* }
|
95
|
-
* ```
|
96
|
-
* @returns `{{user: InitializedUser}}` An InitializedUser object.
|
97
|
-
*/
|
98
|
-
async loginWithModal() {
|
99
|
-
return this.BaseLogin.loginWithModal();
|
100
|
-
}
|
101
|
-
/**
|
102
|
-
* Used to log the user into their thirdweb wallet using email OTP
|
103
|
-
* @example
|
104
|
-
* ```typescript
|
105
|
-
* // Basic Flow
|
106
|
-
* const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
|
107
|
-
* try {
|
108
|
-
* // prompts user to enter the code they received
|
109
|
-
* const user = await thirdwebInAppWallet.auth.loginWithThirdwebEmailOtp({ email : "you@example.com" });
|
110
|
-
* // user is now logged in
|
111
|
-
* } catch (e) {
|
112
|
-
* // User closed the OTP modal or something else went wrong during the authentication process
|
113
|
-
* console.error(e)
|
114
|
-
* }
|
115
|
-
* ```
|
116
|
-
* @param args - args.email: We will send the email an OTP that needs to be entered in order for them to be logged in.
|
117
|
-
* @returns `{{user: InitializedUser}}` An InitializedUser object. See {@link InAppWalletSdk.getUser} for more
|
118
|
-
*/
|
119
|
-
async loginWithEmailOtp(args) {
|
120
|
-
return this.BaseLogin.loginWithEmailOtp(args);
|
121
|
-
}
|
122
|
-
/**
|
123
|
-
* @internal
|
124
|
-
*/
|
125
|
-
async loginWithCustomJwt(args) {
|
126
|
-
return this.BaseLogin.loginWithCustomJwt(args);
|
127
|
-
}
|
128
|
-
/**
|
129
|
-
* @internal
|
130
|
-
*/
|
131
|
-
async loginWithCustomAuthEndpoint(args) {
|
132
|
-
return this.BaseLogin.loginWithCustomAuthEndpoint(args);
|
133
|
-
}
|
134
|
-
/**
|
135
|
-
* @internal
|
136
|
-
*/
|
137
|
-
async loginWithOauth(args) {
|
138
|
-
return this.BaseLogin.loginWithOauth(args);
|
139
|
-
}
|
140
|
-
/**
|
141
|
-
* A headless way to send the users at the passed email an OTP code.
|
142
|
-
* You need to then call {@link Auth.verifyEmailLoginOtp} in order to complete the login process
|
143
|
-
* @example
|
144
|
-
* @param param0.email
|
145
|
-
* ```typescript
|
146
|
-
* const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
|
147
|
-
* // sends user an OTP code
|
148
|
-
* try {
|
149
|
-
* await thirdwebInAppWallet.auth.sendEmailLoginOtp({ email : "you@example.com" });
|
150
|
-
* } catch(e) {
|
151
|
-
* // Error Sending user's email an OTP code
|
152
|
-
* console.error(e);
|
153
|
-
* }
|
154
|
-
*
|
155
|
-
* // Then when your user is ready to verify their OTP
|
156
|
-
* try {
|
157
|
-
* const user = await thirdwebInAppWallet.auth.verifyEmailLoginOtp({ email: "you@example.com", otp: "6-DIGIT_CODE_HERE" });
|
158
|
-
* } catch(e) {
|
159
|
-
* // Error verifying the OTP code
|
160
|
-
* console.error(e)
|
161
|
-
* }
|
162
|
-
* ```
|
163
|
-
* @param param0 - param0.email We will send the email an OTP that needs to be entered in order for them to be logged in.
|
164
|
-
* @returns `{{ isNewUser: boolean }}` IsNewUser indicates if the user is a new user to your platform
|
165
|
-
* @internal
|
166
|
-
*/
|
167
|
-
async sendEmailLoginOtp({ email, }) {
|
168
|
-
return this.BaseLogin.sendEmailLoginOtp({
|
169
|
-
email,
|
170
|
-
});
|
171
|
-
}
|
172
|
-
/**
|
173
|
-
* @internal
|
174
|
-
*/
|
175
|
-
async sendSmsLoginOtp({ phoneNumber, }) {
|
176
|
-
return this.BaseLogin.sendSmsLoginOtp({
|
177
|
-
phoneNumber,
|
178
|
-
});
|
179
39
|
}
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
40
|
+
return undefined;
|
41
|
+
}
|
42
|
+
/**
|
43
|
+
* Retrieves the authenticated user email for the active in-app wallet.
|
44
|
+
* @param options - The arguments for retrieving the authenticated user.
|
45
|
+
* @returns The authenticated user email if logged in and wallet initialized, otherwise undefined.
|
46
|
+
* @example
|
47
|
+
* ```ts
|
48
|
+
* import { getUserEmail } from "thirdweb/wallets/in-app";
|
49
|
+
*
|
50
|
+
* const email = await getUserEmail({ client });
|
51
|
+
* console.log(email);
|
52
|
+
* ```
|
53
|
+
* @wallet
|
54
|
+
*/
|
55
|
+
export async function getUserEmail(options) {
|
56
|
+
const user = await getAuthenticatedUser(options);
|
57
|
+
if (user && "email" in user.authDetails) {
|
58
|
+
return user.authDetails.email;
|
197
59
|
}
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
60
|
+
return undefined;
|
61
|
+
}
|
62
|
+
/**
|
63
|
+
* Retrieves the authenticated user phone number for the active embedded wallet.
|
64
|
+
* @param options - The arguments for retrieving the authenticated user.
|
65
|
+
* @returns The authenticated user phone number if authenticated with phone number, otherwise undefined.
|
66
|
+
* @example
|
67
|
+
* ```ts
|
68
|
+
* import { getUserPhoneNumber } from "thirdweb/wallets/embedded";
|
69
|
+
*
|
70
|
+
* const phoneNumber = await getUserPhoneNumber({ client });
|
71
|
+
* console.log(phoneNumber);
|
72
|
+
* ```
|
73
|
+
* @wallet
|
74
|
+
*/
|
75
|
+
export async function getUserPhoneNumber(options) {
|
76
|
+
const user = await getAuthenticatedUser(options);
|
77
|
+
if (user && "phoneNumber" in user.authDetails) {
|
78
|
+
return user.authDetails.phoneNumber;
|
213
79
|
}
|
80
|
+
return undefined;
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* Pre-authenticates the user based on the provided authentication strategy.
|
84
|
+
* @param args - The arguments required for pre-authentication.
|
85
|
+
* @returns A promise that resolves to the pre-authentication result.
|
86
|
+
* @throws An error if the provided authentication strategy doesn't require pre-authentication.
|
87
|
+
* @example
|
88
|
+
* ```ts
|
89
|
+
* import { preAuthenticate } from "thirdweb/wallets/in-app";
|
90
|
+
*
|
91
|
+
* const result = await preAuthenticate({
|
92
|
+
* client,
|
93
|
+
* strategy: "email",
|
94
|
+
* email: "example@example.org",
|
95
|
+
* });
|
96
|
+
* ```
|
97
|
+
* @wallet
|
98
|
+
*/
|
99
|
+
export async function preAuthenticate(args) {
|
100
|
+
const connector = await getInAppWalletConnector(args.client);
|
101
|
+
return connector.preAuthenticate(args);
|
102
|
+
}
|
103
|
+
/**
|
104
|
+
* Authenticates the user based on the provided authentication arguments.
|
105
|
+
* @param args - The authentication arguments.
|
106
|
+
* @returns A promise that resolves to the authentication result.
|
107
|
+
* @example
|
108
|
+
* ```ts
|
109
|
+
* import { authenticate } from "thirdweb/wallets/in-app";
|
110
|
+
*
|
111
|
+
* const result = await authenticate({
|
112
|
+
* client,
|
113
|
+
* strategy: "email",
|
114
|
+
* email: "example@example.org",
|
115
|
+
* verificationCode: "123456",
|
116
|
+
* });
|
117
|
+
* ```
|
118
|
+
* @wallet
|
119
|
+
*/
|
120
|
+
export async function authenticate(args) {
|
121
|
+
const connector = await getInAppWalletConnector(args.client);
|
122
|
+
return connector.authenticate(args);
|
214
123
|
}
|
215
124
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/index.ts"],"names":[],"mappings":"AACA,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AAmC;IAC1E,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACjD,IAAI,IAAI,IAAI,aAAa,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC;IACtC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAqB;IACzD,MAAM,SAAS,GAAG,MAAM,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,OAAO,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,IAAkB;IAElB,MAAM,SAAS,GAAG,MAAM,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,OAAO,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
2
|
-
import { oauthStrategyToAuthProvider } from "../../core/authentication/
|
3
|
-
import { UserWalletStatus, } from "../../core/authentication/type.js";
|
2
|
+
import { UserWalletStatus, oauthStrategyToAuthProvider, } from "../../core/authentication/type.js";
|
4
3
|
import { InAppWalletIframeCommunicator } from "../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
|
5
|
-
import { Auth } from "./auth/
|
4
|
+
import { Auth } from "./auth/iframe-auth.js";
|
6
5
|
import { loginWithPasskey, registerPasskey } from "./auth/passkeys.js";
|
7
6
|
import { IFrameWallet } from "./in-app-account.js";
|
8
7
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"web-connector.js","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/web/lib/web-connector.ts"],"names":[],"mappings":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G,MAAM,gBAAgB,CAAC;oBACvC,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;iBAC1C,CAAC,CAAC;gBACH,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YACjD,CAAC;YACD;gBACE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAClC,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,CAAQ,EAAE,OAAgB;IACnD,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
@@ -39,4 +39,4 @@ export { useAutoConnect } from "../react/core/hooks/connection/useAutoConnect.js
|
|
39
39
|
export { TransactionButton } from "../react/native/ui/TransactionButton/TrabsactionButton.js";
|
40
40
|
export type { TransactionButtonProps } from "../react/core/hooks/transaction/button-core.js";
|
41
41
|
export { useWalletInfo, useWalletImage, } from "../react/web/ui/hooks/useWalletInfo.js";
|
42
|
-
//# sourceMappingURL=react
|
42
|
+
//# sourceMappingURL=react.native.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"react
|
1
|
+
{"version":3,"file":"react.native.d.ts","sourceRoot":"","sources":["../../../src/exports/react.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAGhF,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,0BAA0B,EAC1B,+BAA+B,EAC/B,kCAAkC,EAClC,mBAAmB,GACpB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAGlF,OAAO,E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AAgB,GACtB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,YAAY,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAG7F,OAAO,EACL,aAAa,EACb,cAAc,GACf,MAAM,wCAAwC,CAAC"}
|
@@ -2,6 +2,7 @@ export { inAppWallet,
|
|
2
2
|
/**
|
3
3
|
* @deprecated use inAppWallet instead
|
4
4
|
*/
|
5
|
-
inAppWallet as embeddedWallet, } from "../../wallets/
|
6
|
-
export { preAuthenticate, authenticate, getUserEmail,
|
5
|
+
inAppWallet as embeddedWallet, } from "../../wallets/in-app/web/in-app.js";
|
6
|
+
export { preAuthenticate, authenticate, getUserEmail, } from "../../wallets/in-app/web/lib/auth/index.js";
|
7
|
+
export { type GetAuthenticatedUserParams } from "../../wallets/in-app/core/authentication/type.js";
|
7
8
|
//# sourceMappingURL=embedded.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"embedded.d.ts","sourceRoot":"","sources":["../../../../src/exports/wallets/embedded.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW;AACX;;GAEG;AACH,WAAW,IAAI,cAAc,GAC9B,MAAM,
|
1
|
+
{"version":3,"file":"embedded.d.ts","sourceRoot":"","sources":["../../../../src/exports/wallets/embedded.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW;AACX;;GAEG;AACH,WAAW,IAAI,cAAc,GAC9B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,GACb,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,kDAAkD,CAAC"}
|
@@ -1,5 +1,6 @@
|
|
1
|
-
export { inAppWallet } from "../../wallets/
|
2
|
-
export { preAuthenticate, authenticate, getUserEmail, getUserPhoneNumber,
|
1
|
+
export { inAppWallet } from "../../wallets/in-app/web/in-app.js";
|
2
|
+
export { preAuthenticate, authenticate, getUserEmail, getUserPhoneNumber, } from "../../wallets/in-app/web/lib/auth/index.js";
|
3
|
+
export { type GetAuthenticatedUserParams } from "../../wallets/in-app/core/authentication/type.js";
|
3
4
|
export { hasStoredPasskey } from "../../wallets/in-app/web/lib/auth/passkeys.js";
|
4
5
|
export { socialIcons } from "../../react/web/wallets/in-app/socialIcons.js";
|
5
6
|
//# sourceMappingURL=in-app.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../src/exports/wallets/in-app.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../src/exports/wallets/in-app.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,kBAAkB,GACnB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAEnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAEjF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export { inAppWallet } from "../../wallets/in-app/native/in-app.js";
|
2
|
+
export { preAuthenticate, authenticate, getUserEmail, getUserPhoneNumber, } from "../../wallets/in-app/native/auth/index.js";
|
3
|
+
export { type GetAuthenticatedUserParams } from "../../wallets/in-app/core/authentication/type.js";
|
4
|
+
export declare const hasStoredPasskey: () => never;
|
5
|
+
//# sourceMappingURL=in-app.native.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"in-app.native.d.ts","sourceRoot":"","sources":["../../../../src/exports/wallets/in-app.native.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,kBAAkB,GACnB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAInG,eAAO,MAAM,gBAAgB,aAE5B,CAAC"}
|
@@ -1,8 +1,9 @@
|
|
1
|
-
export { createWallet,
|
1
|
+
export { createWallet, walletConnect, } from "../wallets/create-wallet.js";
|
2
|
+
export { inAppWallet,
|
2
3
|
/**
|
3
4
|
* @deprecated use inAppWallet instead
|
4
5
|
*/
|
5
|
-
inAppWallet as embeddedWallet,
|
6
|
+
inAppWallet as embeddedWallet, } from "../wallets/in-app/web/in-app.js";
|
6
7
|
export { smartWallet } from "../wallets/smart/smart-wallet.js";
|
7
8
|
export type { Wallet, Account } from "../wallets/interfaces/wallet.js";
|
8
9
|
export type { ConnectionStatus } from "../wallets/manager/index.js";
|
@@ -19,7 +20,6 @@ privateKeyToAccount as privateKeyAccount, type PrivateKeyToAccountOptions,
|
|
19
20
|
* @deprecated - use {@link PrivateKeyToAccountOptions} instead
|
20
21
|
*/
|
21
22
|
type PrivateKeyToAccountOptions as PrivateKeyAccountOptions, } from "../wallets/private-key.js";
|
22
|
-
export { injectedProvider } from "../wallets/injected/mipdStore.js";
|
23
23
|
export type { WalletId, WalletAutoConnectionOption, WalletCreationOptions, WalletConnectionOption, CreateWalletArgs, } from "../wallets/wallet-types.js";
|
24
24
|
export type { WCSupportedWalletIds, InjectedSupportedWalletIds, } from "../wallets/__generated__/wallet-ids.js";
|
25
25
|
export type { WCConnectOptions, WCAutoConnectOptions, } from "../wallets/wallet-connect/types.js";
|
@@ -47,4 +47,5 @@ export { getAllWalletsList } from "../wallets/getAllWalletsList.js";
|
|
47
47
|
export { getWalletInfo } from "../wallets/__generated__/getWalletInfo.js";
|
48
48
|
export { type WalletInfo } from "../wallets/wallet-info.js";
|
49
49
|
export { createWalletAdapter } from "../adapters/wallet-adapter.js";
|
50
|
+
export { injectedProvider } from "../wallets/injected/mipdStore.js";
|
50
51
|
//# sourceMappingURL=wallets.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../../src/exports/wallets.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../../src/exports/wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,aAAa,GACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,WAAW;AACX;;GAEG;AACH,WAAW,IAAI,cAAc,GAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,GAC7B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,GAC5B,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EACL,mBAAmB;AACnB;;;GAGG;AACH,mBAAmB,IAAI,iBAAiB,EACxC,KAAK,0BAA0B;AAC/B;;;GAGG;AACH,KAAK,0BAA0B,IAAI,wBAAwB,GAC5D,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,QAAQ,EACR,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;AAE5C,YAAY,EACV,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,eAAe;AACf;;GAEG;AACH,eAAe,IAAI,kBAAkB,EACrC,6BAA6B;AAC7B;;GAEG;AACH,6BAA6B,IAAI,gCAAgC,EACjE,4BAA4B;AAC5B;;GAEG;AACH,4BAA4B,IAAI,+BAA+B,EAC/D,qBAAqB;AACrB;;GAEG;AACH,qBAAqB,IAAI,wBAAwB,GAClD,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAEnG,YAAY,EACV,aAAa,EACb,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC"}
|
@@ -1,9 +1,10 @@
|
|
1
|
-
export { createWallet, walletConnect, } from "
|
2
|
-
export {
|
3
|
-
export
|
4
|
-
export type {
|
5
|
-
export {
|
6
|
-
export {
|
1
|
+
export { createWallet, walletConnect, } from "../wallets/native/create-wallet.js";
|
2
|
+
export { inAppWallet } from "../wallets/in-app/native/in-app.js";
|
3
|
+
export { smartWallet } from "../wallets/smart/smart-wallet.js";
|
4
|
+
export type { Wallet, Account } from "../wallets/interfaces/wallet.js";
|
5
|
+
export type { ConnectionStatus } from "../wallets/manager/index.js";
|
6
|
+
export { getWalletBalance, type GetWalletBalanceOptions, } from "../wallets/utils/getWalletBalance.js";
|
7
|
+
export { generateAccount, type GenerateAccountOptions, } from "../wallets/utils/generateAccount.js";
|
7
8
|
export { privateKeyToAccount,
|
8
9
|
/**
|
9
10
|
* @internal
|
@@ -14,11 +15,11 @@ privateKeyToAccount as privateKeyAccount, type PrivateKeyToAccountOptions,
|
|
14
15
|
* @internal
|
15
16
|
* @deprecated - use {@link PrivateKeyToAccountOptions} instead
|
16
17
|
*/
|
17
|
-
type PrivateKeyToAccountOptions as PrivateKeyAccountOptions, } from "
|
18
|
-
export type { WalletId, WalletAutoConnectionOption, WalletCreationOptions, WalletConnectionOption, CreateWalletArgs, } from "
|
19
|
-
export type { WCSupportedWalletIds, InjectedSupportedWalletIds, } from "
|
20
|
-
export type { WCConnectOptions, WCAutoConnectOptions, } from "
|
21
|
-
export type { SmartWalletConnectionOptions, SmartWalletOptions, } from "
|
18
|
+
type PrivateKeyToAccountOptions as PrivateKeyAccountOptions, } from "../wallets/private-key.js";
|
19
|
+
export type { WalletId, WalletAutoConnectionOption, WalletCreationOptions, WalletConnectionOption, CreateWalletArgs, } from "../wallets/wallet-types.js";
|
20
|
+
export type { WCSupportedWalletIds, InjectedSupportedWalletIds, } from "../wallets/__generated__/wallet-ids.js";
|
21
|
+
export type { WCConnectOptions, WCAutoConnectOptions, } from "../wallets/wallet-connect/types.js";
|
22
|
+
export type { SmartWalletConnectionOptions, SmartWalletOptions, } from "../wallets/smart/types.js";
|
22
23
|
export type { InAppWalletAuth,
|
23
24
|
/**
|
24
25
|
* @deprecated use InAppWalletAuth instead
|
@@ -35,12 +36,12 @@ InAppWalletConnectionOptions as EmbeddedWalletConnectionOptions, InAppWalletSoci
|
|
35
36
|
/**
|
36
37
|
* @deprecated use InAppWalletSocialAuth instead
|
37
38
|
*/
|
38
|
-
InAppWalletSocialAuth as EmbeddedWalletSocialAuth, } from "
|
39
|
-
export type { CoinbaseSDKWalletConnectionOptions } from "
|
40
|
-
export type { WalletEmitter, WalletEmitterEvents, } from "
|
41
|
-
export { getAllWalletsList } from "
|
42
|
-
export { getWalletInfo } from "
|
43
|
-
export { type WalletInfo } from "
|
44
|
-
export { createWalletAdapter } from "
|
39
|
+
InAppWalletSocialAuth as EmbeddedWalletSocialAuth, } from "../wallets/in-app/core/wallet/types.js";
|
40
|
+
export type { CoinbaseSDKWalletConnectionOptions } from "../wallets/coinbase/coinbaseSDKWallet.js";
|
41
|
+
export type { WalletEmitter, WalletEmitterEvents, } from "../wallets/wallet-emitter.js";
|
42
|
+
export { getAllWalletsList } from "../wallets/getAllWalletsList.js";
|
43
|
+
export { getWalletInfo } from "../wallets/__generated__/getWalletInfo.js";
|
44
|
+
export { type WalletInfo } from "../wallets/wallet-info.js";
|
45
|
+
export { createWalletAdapter } from "../adapters/wallet-adapter.js";
|
45
46
|
export declare const injectedProvider: () => never;
|
46
|
-
//# sourceMappingURL=wallets.d.ts.map
|
47
|
+
//# sourceMappingURL=wallets.native.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallets.native.d.ts","sourceRoot":"","sources":["../../../src/exports/wallets.native.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,aAAa,GACd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,GAC7B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,GAC5B,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EACL,mBAAmB;AACnB;;;GAGG;AACH,mBAAmB,IAAI,iBAAiB,EACxC,KAAK,0BAA0B;AAC/B;;;GAGG;AACH,KAAK,0BAA0B,IAAI,wBAAwB,GAC5D,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,QAAQ,EACR,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;AAE5C,YAAY,EACV,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,eAAe;AACf;;GAEG;AACH,eAAe,IAAI,kBAAkB,EACrC,6BAA6B;AAC7B;;GAEG;AACH,6BAA6B,IAAI,gCAAgC,EACjE,4BAA4B;AAC5B;;GAEG;AACH,4BAA4B,IAAI,+BAA+B,EAC/D,qBAAqB;AACrB;;GAEG;AACH,qBAAqB,IAAI,wBAAwB,GAClD,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAEnG,YAAY,EACV,aAAa,EACb,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIpE,eAAO,MAAM,gBAAgB,aAE5B,CAAC"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "5.29.3-nightly-
|
1
|
+
export declare const version = "5.29.3-nightly-f8e0c5f84bb3a07a2911b5fce51da3983bb2e9e9-20240614190203";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
@@ -33,57 +33,4 @@ export declare function createWallet<const ID extends WalletId>(...args: CreateW
|
|
33
33
|
* @wallet
|
34
34
|
*/
|
35
35
|
export declare function walletConnect(): Wallet<"walletConnect">;
|
36
|
-
/**
|
37
|
-
* Creates an in-app wallet.
|
38
|
-
* @param createOptions - configuration options
|
39
|
-
* @returns The created in-app wallet.
|
40
|
-
* @example
|
41
|
-
* ```ts
|
42
|
-
* import { inAppWallet } from "thirdweb/wallets";
|
43
|
-
*
|
44
|
-
* const wallet = inAppWallet();
|
45
|
-
*
|
46
|
-
* const account = await wallet.connect({
|
47
|
-
* client,
|
48
|
-
* chain,
|
49
|
-
* strategy: "google",
|
50
|
-
* });
|
51
|
-
* ```
|
52
|
-
*
|
53
|
-
* Enable smart accounts and sponsor gas for your users:
|
54
|
-
* ```ts
|
55
|
-
* import { inAppWallet } from "thirdweb/wallets";
|
56
|
-
* const wallet = inAppWallet({
|
57
|
-
* smartAccount: {
|
58
|
-
* chain: sepolia,
|
59
|
-
* sponsorGas: true,
|
60
|
-
* },
|
61
|
-
* });
|
62
|
-
* ```
|
63
|
-
*
|
64
|
-
* Specify a logo for your login page
|
65
|
-
* ```ts
|
66
|
-
* import { inAppWallet } from "thirdweb/wallets";
|
67
|
-
* const wallet = inAppWallet({
|
68
|
-
* metadata: {
|
69
|
-
* image: {
|
70
|
-
* src: "https://example.com/logo.png",
|
71
|
-
* alt: "My logo",
|
72
|
-
* width: 100,
|
73
|
-
* height: 100,
|
74
|
-
* },
|
75
|
-
* },
|
76
|
-
* });
|
77
|
-
* ```
|
78
|
-
*
|
79
|
-
* Hide the ability to export the private key within the Connect Modal
|
80
|
-
* ```ts
|
81
|
-
* import { inAppWallet } from "thirdweb/wallets";
|
82
|
-
* const wallet = inAppWallet({
|
83
|
-
* hidePrivateKeyExport: true
|
84
|
-
* });
|
85
|
-
* ```
|
86
|
-
* @wallet
|
87
|
-
*/
|
88
|
-
export declare function inAppWallet(createOptions?: CreateWalletArgs<"inApp">[1]): Wallet<"inApp">;
|
89
36
|
//# sourceMappingURL=create-wallet.d.ts.map
|
@@ -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,EAGhB,QAAQ,EACT,MAAM,mBAAmB,CAAC;
|
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,EAGhB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAa3B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EACpD,GAAG,IAAI,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAC5B,MAAM,CAAC,EAAE,CAAC,CAqOZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,4BAE5B"}
|
@@ -183,4 +183,8 @@ export type GetUser = {
|
|
183
183
|
authDetails: AuthDetails;
|
184
184
|
walletAddress: string;
|
185
185
|
} | InitializedUser;
|
186
|
+
export type GetAuthenticatedUserParams = {
|
187
|
+
client: ThirdwebClient;
|
188
|
+
};
|
189
|
+
export declare const oauthStrategyToAuthProvider: Record<"google" | "facebook" | "apple", AuthProvider>;
|
186
190
|
//# sourceMappingURL=type.d.ts.map
|