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.
Files changed (139) hide show
  1. package/dist/cjs/exports/react-native/wallets/in-app.js +17 -0
  2. package/dist/cjs/exports/react-native/wallets/in-app.js.map +1 -0
  3. package/dist/cjs/exports/react-native/wallets.js +4 -2
  4. package/dist/cjs/exports/react-native/wallets.js.map +1 -1
  5. package/dist/cjs/exports/wallets/embedded.js +4 -4
  6. package/dist/cjs/exports/wallets/embedded.js.map +1 -1
  7. package/dist/cjs/exports/wallets/in-app.js +4 -3
  8. package/dist/cjs/exports/wallets/in-app.js.map +1 -1
  9. package/dist/cjs/exports/wallets.js +6 -4
  10. package/dist/cjs/exports/wallets.js.map +1 -1
  11. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +1 -1
  12. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  13. package/dist/cjs/react/web/wallets/in-app/InAppWalletOTPLoginUI.js +1 -1
  14. package/dist/cjs/react/web/wallets/in-app/InAppWalletOTPLoginUI.js.map +1 -1
  15. package/dist/cjs/version.js +1 -1
  16. package/dist/cjs/wallets/create-wallet.js +3 -128
  17. package/dist/cjs/wallets/create-wallet.js.map +1 -1
  18. package/dist/cjs/wallets/in-app/core/authentication/type.js +6 -1
  19. package/dist/cjs/wallets/in-app/core/authentication/type.js.map +1 -1
  20. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js +100 -0
  21. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js.map +1 -0
  22. package/dist/cjs/wallets/in-app/core/wallet/index.js +14 -6
  23. package/dist/cjs/wallets/in-app/core/wallet/index.js.map +1 -1
  24. package/dist/cjs/wallets/in-app/{core/authentication → native/auth}/index.js +15 -42
  25. package/dist/cjs/wallets/in-app/native/auth/index.js.map +1 -0
  26. package/dist/cjs/wallets/in-app/native/{auth.js → auth/native-auth.js} +9 -9
  27. package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -0
  28. package/dist/cjs/wallets/in-app/native/in-app.js +69 -0
  29. package/dist/cjs/wallets/in-app/native/in-app.js.map +1 -0
  30. package/dist/cjs/wallets/in-app/native/native-connector.js +9 -10
  31. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  32. package/dist/cjs/wallets/in-app/web/in-app.js +69 -0
  33. package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -0
  34. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js +219 -0
  35. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -0
  36. package/dist/cjs/wallets/in-app/web/lib/auth/index.js +121 -208
  37. package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
  38. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +3 -4
  39. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  40. package/dist/esm/exports/react-native/wallets/in-app.js +9 -0
  41. package/dist/esm/exports/react-native/wallets/in-app.js.map +1 -0
  42. package/dist/esm/exports/react-native/wallets.js +3 -3
  43. package/dist/esm/exports/react-native/wallets.js.map +1 -1
  44. package/dist/esm/exports/wallets/embedded.js +3 -2
  45. package/dist/esm/exports/wallets/embedded.js.map +1 -1
  46. package/dist/esm/exports/wallets/in-app.js +4 -2
  47. package/dist/esm/exports/wallets/in-app.js.map +1 -1
  48. package/dist/esm/exports/wallets.js +4 -2
  49. package/dist/esm/exports/wallets.js.map +1 -1
  50. package/dist/esm/react/web/ui/ConnectWallet/Details.js +1 -1
  51. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  52. package/dist/esm/react/web/wallets/in-app/InAppWalletOTPLoginUI.js +1 -1
  53. package/dist/esm/react/web/wallets/in-app/InAppWalletOTPLoginUI.js.map +1 -1
  54. package/dist/esm/version.js +1 -1
  55. package/dist/esm/wallets/create-wallet.js +1 -125
  56. package/dist/esm/wallets/create-wallet.js.map +1 -1
  57. package/dist/esm/wallets/in-app/core/authentication/type.js +5 -0
  58. package/dist/esm/wallets/in-app/core/authentication/type.js.map +1 -1
  59. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js +95 -0
  60. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js.map +1 -0
  61. package/dist/esm/wallets/in-app/core/wallet/index.js +14 -6
  62. package/dist/esm/wallets/in-app/core/wallet/index.js.map +1 -1
  63. package/dist/esm/wallets/in-app/{core/authentication → native/auth}/index.js +14 -40
  64. package/dist/esm/wallets/in-app/native/auth/index.js.map +1 -0
  65. package/dist/esm/wallets/in-app/native/{auth.js → auth/native-auth.js} +9 -9
  66. package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -0
  67. package/dist/esm/wallets/in-app/native/in-app.js +65 -0
  68. package/dist/esm/wallets/in-app/native/in-app.js.map +1 -0
  69. package/dist/esm/wallets/in-app/native/native-connector.js +2 -3
  70. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  71. package/dist/esm/wallets/in-app/web/in-app.js +65 -0
  72. package/dist/esm/wallets/in-app/web/in-app.js.map +1 -0
  73. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js +215 -0
  74. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -0
  75. package/dist/esm/wallets/in-app/web/lib/auth/index.js +115 -206
  76. package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
  77. package/dist/esm/wallets/in-app/web/lib/web-connector.js +2 -3
  78. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  79. package/dist/types/exports/react-native/wallets/in-app.d.ts +5 -0
  80. package/dist/types/exports/react-native/wallets/in-app.d.ts.map +1 -0
  81. package/dist/types/exports/react-native/wallets.d.ts +1 -0
  82. package/dist/types/exports/react-native/wallets.d.ts.map +1 -1
  83. package/dist/types/exports/wallets/embedded.d.ts +3 -2
  84. package/dist/types/exports/wallets/embedded.d.ts.map +1 -1
  85. package/dist/types/exports/wallets/in-app.d.ts +3 -2
  86. package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
  87. package/dist/types/exports/wallets.d.ts +3 -2
  88. package/dist/types/exports/wallets.d.ts.map +1 -1
  89. package/dist/types/version.d.ts +1 -1
  90. package/dist/types/wallets/create-wallet.d.ts +0 -53
  91. package/dist/types/wallets/create-wallet.d.ts.map +1 -1
  92. package/dist/types/wallets/in-app/core/authentication/type.d.ts +4 -0
  93. package/dist/types/wallets/in-app/core/authentication/type.d.ts.map +1 -1
  94. package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts +16 -0
  95. package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts.map +1 -0
  96. package/dist/types/wallets/in-app/core/wallet/index.d.ts +3 -2
  97. package/dist/types/wallets/in-app/core/wallet/index.d.ts.map +1 -1
  98. package/dist/types/wallets/in-app/{core/authentication → native/auth}/index.d.ts +3 -12
  99. package/dist/types/wallets/in-app/native/auth/index.d.ts.map +1 -0
  100. package/dist/types/wallets/in-app/native/{auth.d.ts → auth/native-auth.d.ts} +3 -3
  101. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -0
  102. package/dist/types/wallets/in-app/native/in-app.d.ts +56 -0
  103. package/dist/types/wallets/in-app/native/in-app.d.ts.map +1 -0
  104. package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
  105. package/dist/types/wallets/in-app/web/in-app.d.ts +56 -0
  106. package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -0
  107. package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts +141 -0
  108. package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts.map +1 -0
  109. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +78 -137
  110. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
  111. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +1 -1
  112. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  113. package/package.json +2 -1
  114. package/src/exports/react-native/wallets/in-app.ts +18 -0
  115. package/src/exports/react-native/wallets.ts +3 -1
  116. package/src/exports/wallets/embedded.ts +4 -3
  117. package/src/exports/wallets/in-app.ts +6 -3
  118. package/src/exports/wallets.ts +6 -2
  119. package/src/react/web/ui/ConnectWallet/Details.tsx +1 -1
  120. package/src/react/web/wallets/in-app/InAppWalletOTPLoginUI.tsx +1 -1
  121. package/src/version.ts +1 -1
  122. package/src/wallets/create-wallet.ts +1 -146
  123. package/src/wallets/in-app/core/authentication/type.ts +13 -0
  124. package/src/wallets/in-app/core/wallet/in-app-core.ts +134 -0
  125. package/src/wallets/in-app/core/wallet/index.ts +16 -5
  126. package/src/wallets/in-app/{core/authentication → native/auth}/index.ts +15 -57
  127. package/src/wallets/in-app/native/{auth.ts → auth/native-auth.ts} +10 -10
  128. package/src/wallets/in-app/native/in-app.ts +70 -0
  129. package/src/wallets/in-app/native/native-connector.ts +2 -2
  130. package/src/wallets/in-app/web/in-app.ts +70 -0
  131. package/src/wallets/in-app/web/lib/auth/iframe-auth.ts +266 -0
  132. package/src/wallets/in-app/web/lib/auth/index.ts +124 -249
  133. package/src/wallets/in-app/web/lib/web-connector.ts +2 -2
  134. package/dist/cjs/wallets/in-app/core/authentication/index.js.map +0 -1
  135. package/dist/cjs/wallets/in-app/native/auth.js.map +0 -1
  136. package/dist/esm/wallets/in-app/core/authentication/index.js.map +0 -1
  137. package/dist/esm/wallets/in-app/native/auth.js.map +0 -1
  138. package/dist/types/wallets/in-app/core/authentication/index.d.ts.map +0 -1
  139. package/dist/types/wallets/in-app/native/auth.d.ts.map +0 -1
@@ -1,6 +1,5 @@
1
1
  import type { ThirdwebClient } from "../../../client/client.js";
2
2
  import type { Account } from "../../interfaces/wallet.js";
3
- import { oauthStrategyToAuthProvider } from "../core/authentication/index.js";
4
3
  import {
5
4
  type AuthArgsType,
6
5
  type AuthLoginReturnType,
@@ -10,6 +9,7 @@ import {
10
9
  type PreAuthArgsType,
11
10
  type SendEmailOtpReturnType,
12
11
  UserWalletStatus,
12
+ oauthStrategyToAuthProvider,
13
13
  } from "../core/authentication/type.js";
14
14
  import type { InAppConnector } from "../core/interfaces/connector.js";
15
15
  import {
@@ -20,7 +20,7 @@ import {
20
20
  sendVerificationSms,
21
21
  socialLogin,
22
22
  validateEmailOTP,
23
- } from "./auth.js";
23
+ } from "./auth/native-auth.js";
24
24
  import { fetchUserDetails } from "./helpers/api/fetchers.js";
25
25
  import { logoutUser } from "./helpers/auth/logout.js";
26
26
  import { getWalletUserDetails } from "./helpers/storage/local.js";
@@ -0,0 +1,70 @@
1
+ import type { ThirdwebClient } from "../../../client/client.js";
2
+ import type { Wallet } from "../../interfaces/wallet.js";
3
+ import type { CreateWalletArgs } from "../../wallet-types.js";
4
+ import { createInAppWallet } from "../core/wallet/in-app-core.js";
5
+
6
+ /**
7
+ * Creates an in-app wallet.
8
+ * @param createOptions - configuration options
9
+ * @returns The created in-app wallet.
10
+ * @example
11
+ * ```ts
12
+ * import { inAppWallet } from "thirdweb/wallets";
13
+ *
14
+ * const wallet = inAppWallet();
15
+ *
16
+ * const account = await wallet.connect({
17
+ * client,
18
+ * chain,
19
+ * strategy: "google",
20
+ * });
21
+ * ```
22
+ *
23
+ * Enable smart accounts and sponsor gas for your users:
24
+ * ```ts
25
+ * import { inAppWallet } from "thirdweb/wallets";
26
+ * const wallet = inAppWallet({
27
+ * smartAccount: {
28
+ * chain: sepolia,
29
+ * sponsorGas: true,
30
+ * },
31
+ * });
32
+ * ```
33
+ *
34
+ * Specify a logo for your login page
35
+ * ```ts
36
+ * import { inAppWallet } from "thirdweb/wallets";
37
+ * const wallet = inAppWallet({
38
+ * metadata: {
39
+ * image: {
40
+ * src: "https://example.com/logo.png",
41
+ * alt: "My logo",
42
+ * width: 100,
43
+ * height: 100,
44
+ * },
45
+ * },
46
+ * });
47
+ * ```
48
+ *
49
+ * Hide the ability to export the private key within the Connect Modal
50
+ * ```ts
51
+ * import { inAppWallet } from "thirdweb/wallets";
52
+ * const wallet = inAppWallet({
53
+ * hidePrivateKeyExport: true
54
+ * });
55
+ * ```
56
+ * @wallet
57
+ */
58
+ export function inAppWallet(
59
+ createOptions?: CreateWalletArgs<"inApp">[1],
60
+ ): Wallet<"inApp"> {
61
+ return createInAppWallet({
62
+ createOptions,
63
+ connectorFactory: async (client: ThirdwebClient) => {
64
+ const { InAppWebConnector } = await import("./lib/web-connector.js");
65
+ return new InAppWebConnector({
66
+ client,
67
+ });
68
+ },
69
+ });
70
+ }
@@ -0,0 +1,266 @@
1
+ import type { ThirdwebClient } from "../../../../../client/client.js";
2
+ import type {
3
+ AuthAndWalletRpcReturnType,
4
+ AuthLoginReturnType,
5
+ AuthStoredTokenWithCookieReturnType,
6
+ LogoutReturnType,
7
+ SendEmailOtpReturnType,
8
+ } from "../../../core/authentication/type.js";
9
+ import type { ClientIdWithQuerierType } from "../../types.js";
10
+ import { LocalStorage } from "../../utils/Storage/LocalStorage.js";
11
+ import type { InAppWalletIframeCommunicator } from "../../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
12
+ import { BaseLogin } from "./base-login.js";
13
+
14
+ export type AuthQuerierTypes = {
15
+ logout: undefined;
16
+ initIframe: {
17
+ clientId: string;
18
+ authCookie: string;
19
+ walletUserId: string;
20
+ deviceShareStored: string;
21
+ };
22
+ loginWithStoredTokenDetails: {
23
+ storedToken: AuthStoredTokenWithCookieReturnType["storedToken"];
24
+ recoveryCode?: string;
25
+ };
26
+ };
27
+
28
+ /**
29
+ *
30
+ */
31
+ export class Auth {
32
+ protected client: ThirdwebClient;
33
+ protected AuthQuerier: InAppWalletIframeCommunicator<AuthQuerierTypes>;
34
+ protected localStorage: LocalStorage;
35
+ protected onAuthSuccess: (
36
+ authResults: AuthAndWalletRpcReturnType,
37
+ ) => Promise<AuthLoginReturnType>;
38
+ private BaseLogin: BaseLogin;
39
+
40
+ /**
41
+ * Used to manage the user's auth states. This should not be instantiated directly.
42
+ * Call {@link InAppWalletSdk.auth} instead.
43
+ * @internal
44
+ */
45
+ constructor({
46
+ client,
47
+ querier,
48
+ onAuthSuccess,
49
+ baseUrl,
50
+ }: ClientIdWithQuerierType & {
51
+ baseUrl: string;
52
+ onAuthSuccess: (
53
+ authDetails: AuthAndWalletRpcReturnType,
54
+ ) => Promise<AuthLoginReturnType>;
55
+ }) {
56
+ this.client = client;
57
+
58
+ this.AuthQuerier = querier;
59
+ this.localStorage = new LocalStorage({ clientId: client.clientId });
60
+ this.onAuthSuccess = onAuthSuccess;
61
+ this.BaseLogin = new BaseLogin({
62
+ postLogin: async (result) => {
63
+ return this.postLogin(result);
64
+ },
65
+ preLogin: async () => {
66
+ await this.preLogin();
67
+ },
68
+ querier: querier,
69
+ client,
70
+ baseUrl,
71
+ });
72
+ }
73
+
74
+ private async preLogin() {
75
+ await this.logout();
76
+ }
77
+
78
+ private async postLogin({
79
+ storedToken,
80
+ walletDetails,
81
+ }: AuthAndWalletRpcReturnType): Promise<AuthLoginReturnType> {
82
+ if (storedToken.shouldStoreCookieString) {
83
+ await this.localStorage.saveAuthCookie(storedToken.cookieString);
84
+ }
85
+ const initializedUser = await this.onAuthSuccess({
86
+ storedToken,
87
+ walletDetails,
88
+ });
89
+ return initializedUser;
90
+ }
91
+
92
+ async loginWithAuthToken(
93
+ authToken: AuthStoredTokenWithCookieReturnType,
94
+ recoveryCode?: string,
95
+ ): Promise<AuthLoginReturnType> {
96
+ await this.preLogin();
97
+ const result = await this.AuthQuerier.call<AuthAndWalletRpcReturnType>({
98
+ procedureName: "loginWithStoredTokenDetails",
99
+ params: {
100
+ storedToken: authToken.storedToken,
101
+ recoveryCode,
102
+ },
103
+ });
104
+ return this.postLogin(result);
105
+ }
106
+
107
+ /**
108
+ * Used to log the user into their thirdweb wallet on your platform via a myriad of auth providers
109
+ * @example
110
+ * ```typescript
111
+ * const thirdwebInAppWallet = new InAppWalletSdk({clientId: "YOUR_CLIENT_ID", chain: "Polygon"})
112
+ * try {
113
+ * const user = await thirdwebInAppWallet.auth.loginWithModal();
114
+ * // user is now logged in
115
+ * } catch (e) {
116
+ * // User closed modal or something else went wrong during the authentication process
117
+ * console.error(e)
118
+ * }
119
+ * ```
120
+ * @returns `{{user: InitializedUser}}` An InitializedUser object.
121
+ */
122
+ async loginWithModal(): Promise<AuthLoginReturnType> {
123
+ return this.BaseLogin.loginWithModal();
124
+ }
125
+
126
+ /**
127
+ * Used to log the user into their thirdweb wallet using email OTP
128
+ * @example
129
+ * ```typescript
130
+ * // Basic Flow
131
+ * const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
132
+ * try {
133
+ * // prompts user to enter the code they received
134
+ * const user = await thirdwebInAppWallet.auth.loginWithThirdwebEmailOtp({ email : "you@example.com" });
135
+ * // user is now logged in
136
+ * } catch (e) {
137
+ * // User closed the OTP modal or something else went wrong during the authentication process
138
+ * console.error(e)
139
+ * }
140
+ * ```
141
+ * @param args - args.email: We will send the email an OTP that needs to be entered in order for them to be logged in.
142
+ * @returns `{{user: InitializedUser}}` An InitializedUser object. See {@link InAppWalletSdk.getUser} for more
143
+ */
144
+ async loginWithEmailOtp(
145
+ args: Parameters<BaseLogin["loginWithEmailOtp"]>[0],
146
+ ): Promise<AuthLoginReturnType> {
147
+ return this.BaseLogin.loginWithEmailOtp(args);
148
+ }
149
+
150
+ /**
151
+ * @internal
152
+ */
153
+ async loginWithCustomJwt(
154
+ args: Parameters<BaseLogin["loginWithCustomJwt"]>[0],
155
+ ): Promise<AuthLoginReturnType> {
156
+ return this.BaseLogin.loginWithCustomJwt(args);
157
+ }
158
+
159
+ /**
160
+ * @internal
161
+ */
162
+ async loginWithCustomAuthEndpoint(
163
+ args: Parameters<BaseLogin["loginWithCustomAuthEndpoint"]>[0],
164
+ ): Promise<AuthLoginReturnType> {
165
+ return this.BaseLogin.loginWithCustomAuthEndpoint(args);
166
+ }
167
+
168
+ /**
169
+ * @internal
170
+ */
171
+ async loginWithOauth(
172
+ args: Parameters<BaseLogin["loginWithOauth"]>[0],
173
+ ): Promise<AuthLoginReturnType> {
174
+ return this.BaseLogin.loginWithOauth(args);
175
+ }
176
+
177
+ /**
178
+ * A headless way to send the users at the passed email an OTP code.
179
+ * You need to then call {@link Auth.verifyEmailLoginOtp} in order to complete the login process
180
+ * @example
181
+ * @param param0.email
182
+ * ```typescript
183
+ * const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
184
+ * // sends user an OTP code
185
+ * try {
186
+ * await thirdwebInAppWallet.auth.sendEmailLoginOtp({ email : "you@example.com" });
187
+ * } catch(e) {
188
+ * // Error Sending user's email an OTP code
189
+ * console.error(e);
190
+ * }
191
+ *
192
+ * // Then when your user is ready to verify their OTP
193
+ * try {
194
+ * const user = await thirdwebInAppWallet.auth.verifyEmailLoginOtp({ email: "you@example.com", otp: "6-DIGIT_CODE_HERE" });
195
+ * } catch(e) {
196
+ * // Error verifying the OTP code
197
+ * console.error(e)
198
+ * }
199
+ * ```
200
+ * @param param0 - param0.email We will send the email an OTP that needs to be entered in order for them to be logged in.
201
+ * @returns `{{ isNewUser: boolean }}` IsNewUser indicates if the user is a new user to your platform
202
+ * @internal
203
+ */
204
+ async sendEmailLoginOtp({
205
+ email,
206
+ }: Parameters<
207
+ BaseLogin["sendEmailLoginOtp"]
208
+ >[0]): Promise<SendEmailOtpReturnType> {
209
+ return this.BaseLogin.sendEmailLoginOtp({
210
+ email,
211
+ });
212
+ }
213
+
214
+ /**
215
+ * @internal
216
+ */
217
+ async sendSmsLoginOtp({
218
+ phoneNumber,
219
+ }: Parameters<
220
+ BaseLogin["sendSmsLoginOtp"]
221
+ >[0]): Promise<SendEmailOtpReturnType> {
222
+ return this.BaseLogin.sendSmsLoginOtp({
223
+ phoneNumber,
224
+ });
225
+ }
226
+
227
+ /**
228
+ * Used to verify the otp that the user receives from thirdweb
229
+ *
230
+ * See {@link Auth.sendEmailLoginOtp} for how the headless call flow looks like. Simply swap out the calls to `loginWithThirdwebEmailOtp` with `verifyThirdwebEmailLoginOtp`
231
+ * @param args - props.email We will send the email an OTP that needs to be entered in order for them to be logged in.
232
+ * props.otp The code that the user received in their email
233
+ * @returns `{{user: InitializedUser}}` An InitializedUser object containing the user's status, wallet, authDetails, and more
234
+ * @internal
235
+ */
236
+ async verifyEmailLoginOtp(
237
+ args: Parameters<BaseLogin["verifyEmailLoginOtp"]>[0],
238
+ ) {
239
+ return this.BaseLogin.verifyEmailLoginOtp(args);
240
+ }
241
+
242
+ /**
243
+ * @internal
244
+ */
245
+ async verifySmsLoginOtp(args: Parameters<BaseLogin["verifySmsLoginOtp"]>[0]) {
246
+ return this.BaseLogin.verifySmsLoginOtp(args);
247
+ }
248
+
249
+ /**
250
+ * Logs any existing user out of their wallet.
251
+ * @returns `{{success: boolean}}` true if a user is successfully logged out. false if there's no user currently logged in.
252
+ * @internal
253
+ */
254
+ async logout(): Promise<LogoutReturnType> {
255
+ const { success } = await this.AuthQuerier.call<LogoutReturnType>({
256
+ procedureName: "logout",
257
+ params: undefined,
258
+ });
259
+ const isRemoveAuthCookie = await this.localStorage.removeAuthCookie();
260
+ const isRemoveUserId = await this.localStorage.removeWalletUserId();
261
+
262
+ return {
263
+ success: success || isRemoveAuthCookie || isRemoveUserId,
264
+ };
265
+ }
266
+ }