thirdweb 5.29.3-nightly-ffaff744f72d2cb22896e7501677b48f76ea857a-20240614184424 → 5.29.3-nightly-476b6cc271b0891fa01fb09ca509c564b850ccfa-20240614185219
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/wallets/in-app.js +17 -0
- package/dist/cjs/exports/react-native/wallets/in-app.js.map +1 -0
- package/dist/cjs/exports/react-native/wallets.js +4 -2
- package/dist/cjs/exports/react-native/wallets.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.js +6 -4
- package/dist/cjs/exports/wallets.js.map +1 -1
- 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/wallets/in-app.js +9 -0
- package/dist/esm/exports/react-native/wallets/in-app.js.map +1 -0
- package/dist/esm/exports/react-native/wallets.js +3 -3
- package/dist/esm/exports/react-native/wallets.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.js +4 -2
- package/dist/esm/exports/wallets.js.map +1 -1
- 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/wallets/in-app.d.ts +5 -0
- package/dist/types/exports/react-native/wallets/in-app.d.ts.map +1 -0
- package/dist/types/exports/react-native/wallets.d.ts +1 -0
- package/dist/types/exports/react-native/wallets.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.d.ts +3 -2
- package/dist/types/exports/wallets.d.ts.map +1 -1
- 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 +2 -1
- package/src/exports/react-native/wallets/in-app.ts +18 -0
- package/src/exports/react-native/wallets.ts +3 -1
- package/src/exports/wallets/embedded.ts +4 -3
- package/src/exports/wallets/in-app.ts +6 -3
- package/src/exports/wallets.ts +6 -2
- 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/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/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/wallets/in-app/core/authentication/index.d.ts.map +0 -1
- package/dist/types/wallets/in-app/native/auth.d.ts.map +0 -1
@@ -1,12 +1,4 @@
|
|
1
|
-
import type
|
2
|
-
import { type AuthArgsType, type AuthLoginReturnType, AuthProvider, type PreAuthArgsType } from "./type.js";
|
3
|
-
export type GetAuthenticatedUserParams = {
|
4
|
-
client: ThirdwebClient;
|
5
|
-
};
|
6
|
-
/**
|
7
|
-
* @internal
|
8
|
-
*/
|
9
|
-
export declare function logoutAuthenticatedUser(options: GetAuthenticatedUserParams): Promise<import("./type.js").LogoutReturnType>;
|
1
|
+
import { type AuthArgsType, type AuthLoginReturnType, type GetAuthenticatedUserParams, type PreAuthArgsType } from "../../core/authentication/type.js";
|
10
2
|
/**
|
11
3
|
* Retrieves the authenticated user for the active in-app wallet.
|
12
4
|
* @param options - The arguments for retrieving the authenticated user.
|
@@ -22,7 +14,7 @@ export declare function logoutAuthenticatedUser(options: GetAuthenticatedUserPar
|
|
22
14
|
* ```
|
23
15
|
* @wallet
|
24
16
|
*/
|
25
|
-
export declare function getAuthenticatedUser(options: GetAuthenticatedUserParams): Promise<import("
|
17
|
+
export declare function getAuthenticatedUser(options: GetAuthenticatedUserParams): Promise<import("../../core/authentication/type.js").InitializedUser | undefined>;
|
26
18
|
/**
|
27
19
|
* Retrieves the authenticated user email for the active in-app wallet.
|
28
20
|
* @param options - The arguments for retrieving the authenticated user.
|
@@ -68,7 +60,7 @@ export declare function getUserPhoneNumber(options: GetAuthenticatedUserParams):
|
|
68
60
|
* ```
|
69
61
|
* @wallet
|
70
62
|
*/
|
71
|
-
export declare function preAuthenticate(args: PreAuthArgsType): Promise<import("
|
63
|
+
export declare function preAuthenticate(args: PreAuthArgsType): Promise<import("../../core/authentication/type.js").SendEmailOtpReturnType>;
|
72
64
|
/**
|
73
65
|
* Authenticates the user based on the provided authentication arguments.
|
74
66
|
* @param args - The authentication arguments.
|
@@ -87,5 +79,4 @@ export declare function preAuthenticate(args: PreAuthArgsType): Promise<import("
|
|
87
79
|
* @wallet
|
88
80
|
*/
|
89
81
|
export declare function authenticate(args: AuthArgsType): Promise<AuthLoginReturnType>;
|
90
|
-
export declare const oauthStrategyToAuthProvider: Record<"google" | "facebook" | "apple", AuthProvider>;
|
91
82
|
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/native/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAErB,MAAM,mCAAmC,CAAC;AAkB3C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,0BAA0B,oFAWpC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,0BAA0B,+BAMrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,+BAM3E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,eAAe,+EAG1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAG9B"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type { ThirdwebClient } from "
|
2
|
-
import { type AuthStoredTokenWithCookieReturnType, type OauthOption, type SendEmailOtpReturnType } from "
|
1
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
|
+
import { type AuthStoredTokenWithCookieReturnType, type OauthOption, type SendEmailOtpReturnType } from "../../core/authentication/type.js";
|
3
3
|
export declare function sendVerificationEmail(options: {
|
4
4
|
email: string;
|
5
5
|
client: ThirdwebClient;
|
@@ -26,4 +26,4 @@ export declare function authEndpoint(authOptions: {
|
|
26
26
|
export declare function deleteActiveAccount(options: {
|
27
27
|
client: ThirdwebClient;
|
28
28
|
}): Promise<boolean>;
|
29
|
-
//# sourceMappingURL=auth.d.ts.map
|
29
|
+
//# sourceMappingURL=native-auth.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"native-auth.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/native/auth/native-auth.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAEL,KAAK,mCAAmC,EACxC,KAAK,WAAW,EAEhB,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAC;AA8B3C,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA2ClC;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA2ClC;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,mCAAmC,CAAC,CA+D/C;AAED,wBAAsB,WAAW,CAC/B,YAAY,EAAE,WAAW,EACzB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,mCAAmC,CAAC,CAkF9C;AAED,wBAAsB,SAAS,CAC7B,WAAW,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC9C,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,mCAAmC,CAAC,CA0C9C;AAED,wBAAsB,YAAY,CAChC,WAAW,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,mCAAmC,CAAC,CA+C9C;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IACjD,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAAC,OAAO,CAAC,CAQnB"}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import type { Wallet } from "../../interfaces/wallet.js";
|
2
|
+
import type { CreateWalletArgs } from "../../wallet-types.js";
|
3
|
+
/**
|
4
|
+
* Creates an in-app wallet.
|
5
|
+
* @param createOptions - configuration options
|
6
|
+
* @returns The created in-app wallet.
|
7
|
+
* @example
|
8
|
+
* ```ts
|
9
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
10
|
+
*
|
11
|
+
* const wallet = inAppWallet();
|
12
|
+
*
|
13
|
+
* const account = await wallet.connect({
|
14
|
+
* client,
|
15
|
+
* chain,
|
16
|
+
* strategy: "google",
|
17
|
+
* });
|
18
|
+
* ```
|
19
|
+
*
|
20
|
+
* Enable smart accounts and sponsor gas for your users:
|
21
|
+
* ```ts
|
22
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
23
|
+
* const wallet = inAppWallet({
|
24
|
+
* smartAccount: {
|
25
|
+
* chain: sepolia,
|
26
|
+
* sponsorGas: true,
|
27
|
+
* },
|
28
|
+
* });
|
29
|
+
* ```
|
30
|
+
*
|
31
|
+
* Specify a logo for your login page
|
32
|
+
* ```ts
|
33
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
34
|
+
* const wallet = inAppWallet({
|
35
|
+
* metadata: {
|
36
|
+
* image: {
|
37
|
+
* src: "https://example.com/logo.png",
|
38
|
+
* alt: "My logo",
|
39
|
+
* width: 100,
|
40
|
+
* height: 100,
|
41
|
+
* },
|
42
|
+
* },
|
43
|
+
* });
|
44
|
+
* ```
|
45
|
+
*
|
46
|
+
* Hide the ability to export the private key within the Connect Modal
|
47
|
+
* ```ts
|
48
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
49
|
+
* const wallet = inAppWallet({
|
50
|
+
* hidePrivateKeyExport: true
|
51
|
+
* });
|
52
|
+
* ```
|
53
|
+
* @wallet
|
54
|
+
*/
|
55
|
+
export declare function inAppWallet(createOptions?: CreateWalletArgs<"inApp">[1]): Wallet<"inApp">;
|
56
|
+
//# sourceMappingURL=in-app.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/native/in-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,WAAW,CACzB,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC3C,MAAM,CAAC,OAAO,CAAC,CAUjB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"native-connector.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/native/native-connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;
|
1
|
+
{"version":3,"file":"native-connector.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/native/native-connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,gBAAgB,EAErB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAG5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAetE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,EAAE,sBAAsB;IAIrC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IA6BjC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAmBnE,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC;YAyDxD,gBAAgB;IA+BxB,mBAAmB;YAIX,WAAW;YAgCX,SAAS;YAqBT,YAAY;IAwB1B,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAGpC"}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import type { Wallet } from "../../interfaces/wallet.js";
|
2
|
+
import type { CreateWalletArgs } from "../../wallet-types.js";
|
3
|
+
/**
|
4
|
+
* Creates an in-app wallet.
|
5
|
+
* @param createOptions - configuration options
|
6
|
+
* @returns The created in-app wallet.
|
7
|
+
* @example
|
8
|
+
* ```ts
|
9
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
10
|
+
*
|
11
|
+
* const wallet = inAppWallet();
|
12
|
+
*
|
13
|
+
* const account = await wallet.connect({
|
14
|
+
* client,
|
15
|
+
* chain,
|
16
|
+
* strategy: "google",
|
17
|
+
* });
|
18
|
+
* ```
|
19
|
+
*
|
20
|
+
* Enable smart accounts and sponsor gas for your users:
|
21
|
+
* ```ts
|
22
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
23
|
+
* const wallet = inAppWallet({
|
24
|
+
* smartAccount: {
|
25
|
+
* chain: sepolia,
|
26
|
+
* sponsorGas: true,
|
27
|
+
* },
|
28
|
+
* });
|
29
|
+
* ```
|
30
|
+
*
|
31
|
+
* Specify a logo for your login page
|
32
|
+
* ```ts
|
33
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
34
|
+
* const wallet = inAppWallet({
|
35
|
+
* metadata: {
|
36
|
+
* image: {
|
37
|
+
* src: "https://example.com/logo.png",
|
38
|
+
* alt: "My logo",
|
39
|
+
* width: 100,
|
40
|
+
* height: 100,
|
41
|
+
* },
|
42
|
+
* },
|
43
|
+
* });
|
44
|
+
* ```
|
45
|
+
*
|
46
|
+
* Hide the ability to export the private key within the Connect Modal
|
47
|
+
* ```ts
|
48
|
+
* import { inAppWallet } from "thirdweb/wallets";
|
49
|
+
* const wallet = inAppWallet({
|
50
|
+
* hidePrivateKeyExport: true
|
51
|
+
* });
|
52
|
+
* ```
|
53
|
+
* @wallet
|
54
|
+
*/
|
55
|
+
export declare function inAppWallet(createOptions?: CreateWalletArgs<"inApp">[1]): Wallet<"inApp">;
|
56
|
+
//# sourceMappingURL=in-app.d.ts.map
|
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,WAAW,CACzB,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC3C,MAAM,CAAC,OAAO,CAAC,CAUjB"}
|
@@ -0,0 +1,141 @@
|
|
1
|
+
import type { ThirdwebClient } from "../../../../../client/client.js";
|
2
|
+
import type { AuthAndWalletRpcReturnType, AuthLoginReturnType, AuthStoredTokenWithCookieReturnType, LogoutReturnType, SendEmailOtpReturnType } from "../../../core/authentication/type.js";
|
3
|
+
import type { ClientIdWithQuerierType } from "../../types.js";
|
4
|
+
import { LocalStorage } from "../../utils/Storage/LocalStorage.js";
|
5
|
+
import type { InAppWalletIframeCommunicator } from "../../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
|
6
|
+
import { BaseLogin } from "./base-login.js";
|
7
|
+
export type AuthQuerierTypes = {
|
8
|
+
logout: undefined;
|
9
|
+
initIframe: {
|
10
|
+
clientId: string;
|
11
|
+
authCookie: string;
|
12
|
+
walletUserId: string;
|
13
|
+
deviceShareStored: string;
|
14
|
+
};
|
15
|
+
loginWithStoredTokenDetails: {
|
16
|
+
storedToken: AuthStoredTokenWithCookieReturnType["storedToken"];
|
17
|
+
recoveryCode?: string;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
/**
|
21
|
+
*
|
22
|
+
*/
|
23
|
+
export declare class Auth {
|
24
|
+
protected client: ThirdwebClient;
|
25
|
+
protected AuthQuerier: InAppWalletIframeCommunicator<AuthQuerierTypes>;
|
26
|
+
protected localStorage: LocalStorage;
|
27
|
+
protected onAuthSuccess: (authResults: AuthAndWalletRpcReturnType) => Promise<AuthLoginReturnType>;
|
28
|
+
private BaseLogin;
|
29
|
+
/**
|
30
|
+
* Used to manage the user's auth states. This should not be instantiated directly.
|
31
|
+
* Call {@link InAppWalletSdk.auth} instead.
|
32
|
+
* @internal
|
33
|
+
*/
|
34
|
+
constructor({ client, querier, onAuthSuccess, baseUrl, }: ClientIdWithQuerierType & {
|
35
|
+
baseUrl: string;
|
36
|
+
onAuthSuccess: (authDetails: AuthAndWalletRpcReturnType) => Promise<AuthLoginReturnType>;
|
37
|
+
});
|
38
|
+
private preLogin;
|
39
|
+
private postLogin;
|
40
|
+
loginWithAuthToken(authToken: AuthStoredTokenWithCookieReturnType, recoveryCode?: string): Promise<AuthLoginReturnType>;
|
41
|
+
/**
|
42
|
+
* Used to log the user into their thirdweb wallet on your platform via a myriad of auth providers
|
43
|
+
* @example
|
44
|
+
* ```typescript
|
45
|
+
* const thirdwebInAppWallet = new InAppWalletSdk({clientId: "YOUR_CLIENT_ID", chain: "Polygon"})
|
46
|
+
* try {
|
47
|
+
* const user = await thirdwebInAppWallet.auth.loginWithModal();
|
48
|
+
* // user is now logged in
|
49
|
+
* } catch (e) {
|
50
|
+
* // User closed modal or something else went wrong during the authentication process
|
51
|
+
* console.error(e)
|
52
|
+
* }
|
53
|
+
* ```
|
54
|
+
* @returns `{{user: InitializedUser}}` An InitializedUser object.
|
55
|
+
*/
|
56
|
+
loginWithModal(): Promise<AuthLoginReturnType>;
|
57
|
+
/**
|
58
|
+
* Used to log the user into their thirdweb wallet using email OTP
|
59
|
+
* @example
|
60
|
+
* ```typescript
|
61
|
+
* // Basic Flow
|
62
|
+
* const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
|
63
|
+
* try {
|
64
|
+
* // prompts user to enter the code they received
|
65
|
+
* const user = await thirdwebInAppWallet.auth.loginWithThirdwebEmailOtp({ email : "you@example.com" });
|
66
|
+
* // user is now logged in
|
67
|
+
* } catch (e) {
|
68
|
+
* // User closed the OTP modal or something else went wrong during the authentication process
|
69
|
+
* console.error(e)
|
70
|
+
* }
|
71
|
+
* ```
|
72
|
+
* @param args - args.email: We will send the email an OTP that needs to be entered in order for them to be logged in.
|
73
|
+
* @returns `{{user: InitializedUser}}` An InitializedUser object. See {@link InAppWalletSdk.getUser} for more
|
74
|
+
*/
|
75
|
+
loginWithEmailOtp(args: Parameters<BaseLogin["loginWithEmailOtp"]>[0]): Promise<AuthLoginReturnType>;
|
76
|
+
/**
|
77
|
+
* @internal
|
78
|
+
*/
|
79
|
+
loginWithCustomJwt(args: Parameters<BaseLogin["loginWithCustomJwt"]>[0]): Promise<AuthLoginReturnType>;
|
80
|
+
/**
|
81
|
+
* @internal
|
82
|
+
*/
|
83
|
+
loginWithCustomAuthEndpoint(args: Parameters<BaseLogin["loginWithCustomAuthEndpoint"]>[0]): Promise<AuthLoginReturnType>;
|
84
|
+
/**
|
85
|
+
* @internal
|
86
|
+
*/
|
87
|
+
loginWithOauth(args: Parameters<BaseLogin["loginWithOauth"]>[0]): Promise<AuthLoginReturnType>;
|
88
|
+
/**
|
89
|
+
* A headless way to send the users at the passed email an OTP code.
|
90
|
+
* You need to then call {@link Auth.verifyEmailLoginOtp} in order to complete the login process
|
91
|
+
* @example
|
92
|
+
* @param param0.email
|
93
|
+
* ```typescript
|
94
|
+
* const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
|
95
|
+
* // sends user an OTP code
|
96
|
+
* try {
|
97
|
+
* await thirdwebInAppWallet.auth.sendEmailLoginOtp({ email : "you@example.com" });
|
98
|
+
* } catch(e) {
|
99
|
+
* // Error Sending user's email an OTP code
|
100
|
+
* console.error(e);
|
101
|
+
* }
|
102
|
+
*
|
103
|
+
* // Then when your user is ready to verify their OTP
|
104
|
+
* try {
|
105
|
+
* const user = await thirdwebInAppWallet.auth.verifyEmailLoginOtp({ email: "you@example.com", otp: "6-DIGIT_CODE_HERE" });
|
106
|
+
* } catch(e) {
|
107
|
+
* // Error verifying the OTP code
|
108
|
+
* console.error(e)
|
109
|
+
* }
|
110
|
+
* ```
|
111
|
+
* @param param0 - param0.email We will send the email an OTP that needs to be entered in order for them to be logged in.
|
112
|
+
* @returns `{{ isNewUser: boolean }}` IsNewUser indicates if the user is a new user to your platform
|
113
|
+
* @internal
|
114
|
+
*/
|
115
|
+
sendEmailLoginOtp({ email, }: Parameters<BaseLogin["sendEmailLoginOtp"]>[0]): Promise<SendEmailOtpReturnType>;
|
116
|
+
/**
|
117
|
+
* @internal
|
118
|
+
*/
|
119
|
+
sendSmsLoginOtp({ phoneNumber, }: Parameters<BaseLogin["sendSmsLoginOtp"]>[0]): Promise<SendEmailOtpReturnType>;
|
120
|
+
/**
|
121
|
+
* Used to verify the otp that the user receives from thirdweb
|
122
|
+
*
|
123
|
+
* See {@link Auth.sendEmailLoginOtp} for how the headless call flow looks like. Simply swap out the calls to `loginWithThirdwebEmailOtp` with `verifyThirdwebEmailLoginOtp`
|
124
|
+
* @param args - props.email We will send the email an OTP that needs to be entered in order for them to be logged in.
|
125
|
+
* props.otp The code that the user received in their email
|
126
|
+
* @returns `{{user: InitializedUser}}` An InitializedUser object containing the user's status, wallet, authDetails, and more
|
127
|
+
* @internal
|
128
|
+
*/
|
129
|
+
verifyEmailLoginOtp(args: Parameters<BaseLogin["verifyEmailLoginOtp"]>[0]): Promise<AuthLoginReturnType>;
|
130
|
+
/**
|
131
|
+
* @internal
|
132
|
+
*/
|
133
|
+
verifySmsLoginOtp(args: Parameters<BaseLogin["verifySmsLoginOtp"]>[0]): Promise<AuthLoginReturnType>;
|
134
|
+
/**
|
135
|
+
* Logs any existing user out of their wallet.
|
136
|
+
* @returns `{{success: boolean}}` true if a user is successfully logged out. false if there's no user currently logged in.
|
137
|
+
* @internal
|
138
|
+
*/
|
139
|
+
logout(): Promise<LogoutReturnType>;
|
140
|
+
}
|
141
|
+
//# sourceMappingURL=iframe-auth.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"iframe-auth.d.ts","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/iframe-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,mCAAmC,EACnC,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AACtH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,2BAA2B,EAAE;QAC3B,WAAW,EAAE,mCAAmC,CAAC,aAAa,CAAC,CAAC;QAChE,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,qBAAa,IAAI;IACf,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC;IACjC,SAAS,CAAC,WAAW,EAAE,6BAA6B,CAAC,gBAAgB,CAAC,CAAC;IACvE,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IACrC,SAAS,CAAC,aAAa,EAAE,CACvB,WAAW,EAAE,0BAA0B,KACpC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClC,OAAO,CAAC,SAAS,CAAY;IAE7B;;;;OAIG;gBACS,EACV,MAAM,EACN,OAAO,EACP,aAAa,EACb,OAAO,GACR,EAAE,uBAAuB,GAAG;QAC3B,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,CACb,WAAW,EAAE,0BAA0B,KACpC,OAAO,CAAC,mBAAmB,CAAC,CAAC;KACnC;YAmBa,QAAQ;YAIR,SAAS;IAcjB,kBAAkB,CACtB,SAAS,EAAE,mCAAmC,EAC9C,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,mBAAmB,CAAC;IAY/B;;;;;;;;;;;;;;OAcG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAIpD;;;;;;;;;;;;;;;;;OAiBG;IACG,iBAAiB,CACrB,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,mBAAmB,CAAC;IAI/B;;OAEG;IACG,kBAAkB,CACtB,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,GACnD,OAAO,CAAC,mBAAmB,CAAC;IAI/B;;OAEG;IACG,2BAA2B,CAC/B,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAAC,GAC5D,OAAO,CAAC,mBAAmB,CAAC;IAI/B;;OAEG;IACG,cAAc,CAClB,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,GAC/C,OAAO,CAAC,mBAAmB,CAAC;IAI/B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,iBAAiB,CAAC,EACtB,KAAK,GACN,EAAE,UAAU,CACX,SAAS,CAAC,mBAAmB,CAAC,CAC/B,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAMtC;;OAEG;IACG,eAAe,CAAC,EACpB,WAAW,GACZ,EAAE,UAAU,CACX,SAAS,CAAC,iBAAiB,CAAC,CAC7B,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAMtC;;;;;;;;OAQG;IACG,mBAAmB,CACvB,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;IAKvD;;OAEG;IACG,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IAI3E;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAY1C"}
|
@@ -1,141 +1,82 @@
|
|
1
|
-
import type
|
2
|
-
import type { AuthAndWalletRpcReturnType, AuthLoginReturnType, AuthStoredTokenWithCookieReturnType, LogoutReturnType, SendEmailOtpReturnType } from "../../../core/authentication/type.js";
|
3
|
-
import type { ClientIdWithQuerierType } from "../../types.js";
|
4
|
-
import { LocalStorage } from "../../utils/Storage/LocalStorage.js";
|
5
|
-
import type { InAppWalletIframeCommunicator } from "../../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
|
6
|
-
import { BaseLogin } from "./base-login.js";
|
7
|
-
export type AuthQuerierTypes = {
|
8
|
-
logout: undefined;
|
9
|
-
initIframe: {
|
10
|
-
clientId: string;
|
11
|
-
authCookie: string;
|
12
|
-
walletUserId: string;
|
13
|
-
deviceShareStored: string;
|
14
|
-
};
|
15
|
-
loginWithStoredTokenDetails: {
|
16
|
-
storedToken: AuthStoredTokenWithCookieReturnType["storedToken"];
|
17
|
-
recoveryCode?: string;
|
18
|
-
};
|
19
|
-
};
|
1
|
+
import { type AuthArgsType, type AuthLoginReturnType, type GetAuthenticatedUserParams, type PreAuthArgsType } from "../../../core/authentication/type.js";
|
20
2
|
/**
|
3
|
+
* Retrieves the authenticated user for the active in-app wallet.
|
4
|
+
* @param options - The arguments for retrieving the authenticated user.
|
5
|
+
* @returns The authenticated user if logged in and wallet initialized, otherwise undefined.
|
6
|
+
* @example
|
7
|
+
* ```ts
|
8
|
+
* import { getAuthenticatedUser } from "thirdweb/wallets/in-app";
|
21
9
|
*
|
10
|
+
* const user = await getAuthenticatedUser({ client });
|
11
|
+
* if (user) {
|
12
|
+
* console.log(user.walletAddress);
|
13
|
+
* }
|
14
|
+
* ```
|
15
|
+
* @wallet
|
22
16
|
*/
|
23
|
-
export declare
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
/**
|
89
|
-
* A headless way to send the users at the passed email an OTP code.
|
90
|
-
* You need to then call {@link Auth.verifyEmailLoginOtp} in order to complete the login process
|
91
|
-
* @example
|
92
|
-
* @param param0.email
|
93
|
-
* ```typescript
|
94
|
-
* const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
|
95
|
-
* // sends user an OTP code
|
96
|
-
* try {
|
97
|
-
* await thirdwebInAppWallet.auth.sendEmailLoginOtp({ email : "you@example.com" });
|
98
|
-
* } catch(e) {
|
99
|
-
* // Error Sending user's email an OTP code
|
100
|
-
* console.error(e);
|
101
|
-
* }
|
102
|
-
*
|
103
|
-
* // Then when your user is ready to verify their OTP
|
104
|
-
* try {
|
105
|
-
* const user = await thirdwebInAppWallet.auth.verifyEmailLoginOtp({ email: "you@example.com", otp: "6-DIGIT_CODE_HERE" });
|
106
|
-
* } catch(e) {
|
107
|
-
* // Error verifying the OTP code
|
108
|
-
* console.error(e)
|
109
|
-
* }
|
110
|
-
* ```
|
111
|
-
* @param param0 - param0.email We will send the email an OTP that needs to be entered in order for them to be logged in.
|
112
|
-
* @returns `{{ isNewUser: boolean }}` IsNewUser indicates if the user is a new user to your platform
|
113
|
-
* @internal
|
114
|
-
*/
|
115
|
-
sendEmailLoginOtp({ email, }: Parameters<BaseLogin["sendEmailLoginOtp"]>[0]): Promise<SendEmailOtpReturnType>;
|
116
|
-
/**
|
117
|
-
* @internal
|
118
|
-
*/
|
119
|
-
sendSmsLoginOtp({ phoneNumber, }: Parameters<BaseLogin["sendSmsLoginOtp"]>[0]): Promise<SendEmailOtpReturnType>;
|
120
|
-
/**
|
121
|
-
* Used to verify the otp that the user receives from thirdweb
|
122
|
-
*
|
123
|
-
* See {@link Auth.sendEmailLoginOtp} for how the headless call flow looks like. Simply swap out the calls to `loginWithThirdwebEmailOtp` with `verifyThirdwebEmailLoginOtp`
|
124
|
-
* @param args - props.email We will send the email an OTP that needs to be entered in order for them to be logged in.
|
125
|
-
* props.otp The code that the user received in their email
|
126
|
-
* @returns `{{user: InitializedUser}}` An InitializedUser object containing the user's status, wallet, authDetails, and more
|
127
|
-
* @internal
|
128
|
-
*/
|
129
|
-
verifyEmailLoginOtp(args: Parameters<BaseLogin["verifyEmailLoginOtp"]>[0]): Promise<AuthLoginReturnType>;
|
130
|
-
/**
|
131
|
-
* @internal
|
132
|
-
*/
|
133
|
-
verifySmsLoginOtp(args: Parameters<BaseLogin["verifySmsLoginOtp"]>[0]): Promise<AuthLoginReturnType>;
|
134
|
-
/**
|
135
|
-
* Logs any existing user out of their wallet.
|
136
|
-
* @returns `{{success: boolean}}` true if a user is successfully logged out. false if there's no user currently logged in.
|
137
|
-
* @internal
|
138
|
-
*/
|
139
|
-
logout(): Promise<LogoutReturnType>;
|
140
|
-
}
|
17
|
+
export declare function getAuthenticatedUser(options: GetAuthenticatedUserParams): Promise<import("../../../core/authentication/type.js").InitializedUser | undefined>;
|
18
|
+
/**
|
19
|
+
* Retrieves the authenticated user email for the active in-app wallet.
|
20
|
+
* @param options - The arguments for retrieving the authenticated user.
|
21
|
+
* @returns The authenticated user email if logged in and wallet initialized, otherwise undefined.
|
22
|
+
* @example
|
23
|
+
* ```ts
|
24
|
+
* import { getUserEmail } from "thirdweb/wallets/in-app";
|
25
|
+
*
|
26
|
+
* const email = await getUserEmail({ client });
|
27
|
+
* console.log(email);
|
28
|
+
* ```
|
29
|
+
* @wallet
|
30
|
+
*/
|
31
|
+
export declare function getUserEmail(options: GetAuthenticatedUserParams): Promise<string | undefined>;
|
32
|
+
/**
|
33
|
+
* Retrieves the authenticated user phone number for the active embedded wallet.
|
34
|
+
* @param options - The arguments for retrieving the authenticated user.
|
35
|
+
* @returns The authenticated user phone number if authenticated with phone number, otherwise undefined.
|
36
|
+
* @example
|
37
|
+
* ```ts
|
38
|
+
* import { getUserPhoneNumber } from "thirdweb/wallets/embedded";
|
39
|
+
*
|
40
|
+
* const phoneNumber = await getUserPhoneNumber({ client });
|
41
|
+
* console.log(phoneNumber);
|
42
|
+
* ```
|
43
|
+
* @wallet
|
44
|
+
*/
|
45
|
+
export declare function getUserPhoneNumber(options: GetAuthenticatedUserParams): Promise<string | undefined>;
|
46
|
+
/**
|
47
|
+
* Pre-authenticates the user based on the provided authentication strategy.
|
48
|
+
* @param args - The arguments required for pre-authentication.
|
49
|
+
* @returns A promise that resolves to the pre-authentication result.
|
50
|
+
* @throws An error if the provided authentication strategy doesn't require pre-authentication.
|
51
|
+
* @example
|
52
|
+
* ```ts
|
53
|
+
* import { preAuthenticate } from "thirdweb/wallets/in-app";
|
54
|
+
*
|
55
|
+
* const result = await preAuthenticate({
|
56
|
+
* client,
|
57
|
+
* strategy: "email",
|
58
|
+
* email: "example@example.org",
|
59
|
+
* });
|
60
|
+
* ```
|
61
|
+
* @wallet
|
62
|
+
*/
|
63
|
+
export declare function preAuthenticate(args: PreAuthArgsType): Promise<import("../../../core/authentication/type.js").SendEmailOtpReturnType>;
|
64
|
+
/**
|
65
|
+
* Authenticates the user based on the provided authentication arguments.
|
66
|
+
* @param args - The authentication arguments.
|
67
|
+
* @returns A promise that resolves to the authentication result.
|
68
|
+
* @example
|
69
|
+
* ```ts
|
70
|
+
* import { authenticate } from "thirdweb/wallets/in-app";
|
71
|
+
*
|
72
|
+
* const result = await authenticate({
|
73
|
+
* client,
|
74
|
+
* strategy: "email",
|
75
|
+
* email: "example@example.org",
|
76
|
+
* verificationCode: "123456",
|
77
|
+
* });
|
78
|
+
* ```
|
79
|
+
* @wallet
|
80
|
+
*/
|
81
|
+
export declare function authenticate(args: AuthArgsType): Promise<AuthLoginReturnType>;
|
141
82
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAErB,MAAM,sCAAsC,CAAC;AAkB9C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,0BAA0B,uFAWpC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,0BAA0B,+BAMrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,+BAM3E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,eAAe,kFAG1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAG9B"}
|
@@ -4,7 +4,7 @@ import { type AuthArgsType, type AuthLoginReturnType, type GetUser, type LogoutR
|
|
4
4
|
import type { InAppConnector } from "../../core/interfaces/connector.js";
|
5
5
|
import type { InAppWalletConstructorType } from "../types.js";
|
6
6
|
import { InAppWalletIframeCommunicator } from "../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
|
7
|
-
import { Auth, type AuthQuerierTypes } from "./auth/
|
7
|
+
import { Auth, type AuthQuerierTypes } from "./auth/iframe-auth.js";
|
8
8
|
/**
|
9
9
|
* @internal
|
10
10
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"web-connector.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/web/lib/web-connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
1
|
+
{"version":3,"file":"web-connector.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/web/lib/web-connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAG5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,+DAA+D,CAAC;AAC9G,OAAO,EAAE,IAAI,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIpE;;GAEG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IACtD,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC;IACjC,SAAS,CAAC,OAAO,EAAE,6BAA6B,CAAC,gBAAgB,CAAC,CAAC;IAEnE,OAAO,CAAC,MAAM,CAAe;IAC7B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX,OAAO,CAAC,qBAAqB;IAO7B;;;;OAIG;gBACS,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,0BAA0B;IAgDjE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAIjC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxB,eAAe,CACnB,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,sBAAsB,CAAC;IAiB5B,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAiE9D,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAG1C"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "thirdweb",
|
3
|
-
"version": "5.29.3-nightly-
|
3
|
+
"version": "5.29.3-nightly-476b6cc271b0891fa01fb09ca509c564b850ccfa-20240614185219",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/thirdweb-dev/js.git#main"
|
@@ -105,6 +105,7 @@
|
|
105
105
|
"./wallets/*": {
|
106
106
|
"types": "./dist/types/exports/wallets/*.d.ts",
|
107
107
|
"import": "./dist/esm/exports/wallets/*.js",
|
108
|
+
"react-native": "./dist/esm/exports/react-native/wallets/*.js",
|
108
109
|
"default": "./dist/cjs/exports/wallets/*.js"
|
109
110
|
},
|
110
111
|
"./package.json": "./package.json"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// --- KEEEP IN SYNC with exports/wallets/in-app.ts ---
|
2
|
+
|
3
|
+
export { inAppWallet } from "../../../wallets/in-app/native/in-app.js";
|
4
|
+
|
5
|
+
export {
|
6
|
+
preAuthenticate,
|
7
|
+
authenticate,
|
8
|
+
getUserEmail,
|
9
|
+
getUserPhoneNumber,
|
10
|
+
} from "../../../wallets/in-app/native/auth/index.js";
|
11
|
+
|
12
|
+
export { type GetAuthenticatedUserParams } from "../../../wallets/in-app/core/authentication/type.js";
|
13
|
+
|
14
|
+
// NOT SUPPORTED (yet)
|
15
|
+
|
16
|
+
export const hasStoredPasskey = () => {
|
17
|
+
throw new Error("Not supported in native");
|
18
|
+
};
|
@@ -1,8 +1,10 @@
|
|
1
|
+
// --- KEEEP IN SYNC with exports/wallets.ts ---
|
2
|
+
|
1
3
|
export {
|
2
4
|
createWallet,
|
3
|
-
// TODO (rn) inAppWallet,
|
4
5
|
walletConnect,
|
5
6
|
} from "../../wallets/native/create-wallet.js";
|
7
|
+
export { inAppWallet } from "../../wallets/in-app/native/in-app.js";
|
6
8
|
export { smartWallet } from "../../wallets/smart/smart-wallet.js";
|
7
9
|
|
8
10
|
export type { Wallet, Account } from "../../wallets/interfaces/wallet.js";
|