@account-kit/signer 4.35.0 → 4.35.1

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 (42) hide show
  1. package/dist/esm/base.d.ts +2 -2
  2. package/dist/esm/base.js.map +1 -1
  3. package/dist/esm/client/base.d.ts +4 -292
  4. package/dist/esm/client/base.js.map +1 -1
  5. package/dist/esm/client/index.d.ts +14 -26
  6. package/dist/esm/client/index.js.map +1 -1
  7. package/dist/esm/client/types.js.map +1 -1
  8. package/dist/esm/errors.js.map +1 -1
  9. package/dist/esm/metrics.js.map +1 -1
  10. package/dist/esm/oauth.js.map +1 -1
  11. package/dist/esm/session/manager.d.ts +2 -2
  12. package/dist/esm/session/manager.js.map +1 -1
  13. package/dist/esm/signer.d.ts +25 -117
  14. package/dist/esm/signer.js.map +1 -1
  15. package/dist/esm/solanaSigner.js.map +1 -1
  16. package/dist/esm/version.d.ts +1 -1
  17. package/dist/esm/version.js +1 -1
  18. package/dist/esm/version.js.map +1 -1
  19. package/dist/types/base.d.ts +2 -2
  20. package/dist/types/base.d.ts.map +1 -1
  21. package/dist/types/client/base.d.ts +4 -292
  22. package/dist/types/client/base.d.ts.map +1 -1
  23. package/dist/types/client/index.d.ts +14 -26
  24. package/dist/types/client/index.d.ts.map +1 -1
  25. package/dist/types/session/manager.d.ts +2 -2
  26. package/dist/types/session/manager.d.ts.map +1 -1
  27. package/dist/types/signer.d.ts +25 -117
  28. package/dist/types/signer.d.ts.map +1 -1
  29. package/dist/types/utils/base64UrlEncode.d.ts.map +1 -1
  30. package/dist/types/version.d.ts +1 -1
  31. package/package.json +6 -8
  32. package/src/base.ts +49 -49
  33. package/src/client/base.ts +37 -38
  34. package/src/client/index.ts +10 -10
  35. package/src/client/types.ts +1 -1
  36. package/src/errors.ts +1 -1
  37. package/src/metrics.ts +1 -1
  38. package/src/oauth.ts +1 -1
  39. package/src/session/manager.ts +15 -12
  40. package/src/signer.ts +1 -1
  41. package/src/solanaSigner.ts +15 -15
  42. package/src/version.ts +1 -1
@@ -68,7 +68,6 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
68
68
  client: z.ZodUnion<[z.ZodType<AlchemySignerWebClient, z.ZodTypeDef, AlchemySignerWebClient>, z.ZodObject<{
69
69
  connection: z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
70
70
  rpcUrl: z.ZodOptional<z.ZodNever>;
71
- /** @deprecated This option will be overriden by dashboard settings. Please use the dashboard settings instead. This option will be removed in a future release. */
72
71
  apiKey: z.ZodString;
73
72
  jwt: z.ZodOptional<z.ZodNever>;
74
73
  }, "strip", z.ZodTypeAny, {
@@ -141,27 +140,21 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
141
140
  apiKey: string;
142
141
  rpcUrl?: undefined;
143
142
  jwt?: undefined;
144
- } & {
145
- chainAgnosticUrl?: string | undefined;
146
- }) | ({
143
+ } | {
147
144
  jwt: string;
148
145
  rpcUrl?: undefined;
149
146
  apiKey?: undefined;
150
- } & {
151
- chainAgnosticUrl?: string | undefined;
152
- }) | ({
147
+ } | {
153
148
  rpcUrl: string;
154
149
  apiKey?: undefined;
155
150
  jwt?: undefined;
156
- } & {
157
- chainAgnosticUrl?: string | undefined;
158
- }) | ({
151
+ } | {
159
152
  rpcUrl: string;
160
153
  jwt: string;
161
154
  apiKey?: undefined;
162
- } & {
155
+ }) & {
163
156
  chainAgnosticUrl?: string | undefined;
164
- });
157
+ };
165
158
  iframeConfig: {
166
159
  iframeElementId: string;
167
160
  iframeContainerId: string;
@@ -175,27 +168,21 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
175
168
  apiKey: string;
176
169
  rpcUrl?: undefined;
177
170
  jwt?: undefined;
178
- } & {
179
- chainAgnosticUrl?: string | undefined;
180
- }) | ({
171
+ } | {
181
172
  jwt: string;
182
173
  rpcUrl?: undefined;
183
174
  apiKey?: undefined;
184
- } & {
185
- chainAgnosticUrl?: string | undefined;
186
- }) | ({
175
+ } | {
187
176
  rpcUrl: string;
188
177
  apiKey?: undefined;
189
178
  jwt?: undefined;
190
- } & {
191
- chainAgnosticUrl?: string | undefined;
192
- }) | ({
179
+ } | {
193
180
  rpcUrl: string;
194
181
  jwt: string;
195
182
  apiKey?: undefined;
196
- } & {
183
+ }) & {
197
184
  chainAgnosticUrl?: string | undefined;
198
- });
185
+ };
199
186
  iframeConfig: {
200
187
  iframeContainerId: string;
201
188
  iframeElementId?: string | undefined;
@@ -205,13 +192,14 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
205
192
  oauthCallbackUrl?: string | undefined;
206
193
  enablePopupOauth?: boolean | undefined;
207
194
  }>]>;
195
+ } & {
208
196
  sessionConfig: z.ZodOptional<z.ZodObject<Omit<{
209
197
  sessionKey: z.ZodDefault<z.ZodString>;
210
198
  storage: z.ZodUnion<[z.ZodDefault<z.ZodEnum<["localStorage", "sessionStorage"]>>, z.ZodType<Storage, z.ZodTypeDef, Storage>]>;
211
199
  expirationTimeMs: z.ZodDefault<z.ZodNumber>;
212
200
  client: z.ZodType<import("./index.js").BaseSignerClient<unknown>, z.ZodTypeDef, import("./index.js").BaseSignerClient<unknown>>;
213
201
  }, "client">, "strip", z.ZodTypeAny, {
214
- storage: (Storage | "localStorage" | "sessionStorage") & (Storage | "localStorage" | "sessionStorage" | undefined);
202
+ storage: Storage | "localStorage" | "sessionStorage";
215
203
  sessionKey: string;
216
204
  expirationTimeMs: number;
217
205
  }, {
@@ -220,66 +208,26 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
220
208
  expirationTimeMs?: number | undefined;
221
209
  }>>;
222
210
  }, "strip", z.ZodTypeAny, {
223
- client: ({
211
+ client: {
224
212
  connection: ({
225
213
  apiKey: string;
226
214
  rpcUrl?: undefined;
227
215
  jwt?: undefined;
228
- } & {
229
- chainAgnosticUrl?: string | undefined;
230
- }) | ({
216
+ } | {
231
217
  jwt: string;
232
218
  rpcUrl?: undefined;
233
219
  apiKey?: undefined;
234
- } & {
235
- chainAgnosticUrl?: string | undefined;
236
- }) | ({
220
+ } | {
237
221
  rpcUrl: string;
238
222
  apiKey?: undefined;
239
223
  jwt?: undefined;
240
- } & {
241
- chainAgnosticUrl?: string | undefined;
242
- }) | ({
224
+ } | {
243
225
  rpcUrl: string;
244
226
  jwt: string;
245
227
  apiKey?: undefined;
246
- } & {
228
+ }) & {
247
229
  chainAgnosticUrl?: string | undefined;
248
- });
249
- iframeConfig: {
250
- iframeElementId: string;
251
- iframeContainerId: string;
252
230
  };
253
- rootOrgId: string;
254
- oauthCallbackUrl: string;
255
- enablePopupOauth: boolean;
256
- rpId?: string | undefined;
257
- } | AlchemySignerWebClient) & ({
258
- connection: ({
259
- apiKey: string;
260
- rpcUrl?: undefined;
261
- jwt?: undefined;
262
- } & {
263
- chainAgnosticUrl?: string | undefined;
264
- }) | ({
265
- jwt: string;
266
- rpcUrl?: undefined;
267
- apiKey?: undefined;
268
- } & {
269
- chainAgnosticUrl?: string | undefined;
270
- }) | ({
271
- rpcUrl: string;
272
- apiKey?: undefined;
273
- jwt?: undefined;
274
- } & {
275
- chainAgnosticUrl?: string | undefined;
276
- }) | ({
277
- rpcUrl: string;
278
- jwt: string;
279
- apiKey?: undefined;
280
- } & {
281
- chainAgnosticUrl?: string | undefined;
282
- });
283
231
  iframeConfig: {
284
232
  iframeElementId: string;
285
233
  iframeContainerId: string;
@@ -288,73 +236,33 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
288
236
  oauthCallbackUrl: string;
289
237
  enablePopupOauth: boolean;
290
238
  rpId?: string | undefined;
291
- } | AlchemySignerWebClient | undefined);
239
+ } | AlchemySignerWebClient;
292
240
  sessionConfig?: {
293
- storage: (Storage | "localStorage" | "sessionStorage") & (Storage | "localStorage" | "sessionStorage" | undefined);
241
+ storage: Storage | "localStorage" | "sessionStorage";
294
242
  sessionKey: string;
295
243
  expirationTimeMs: number;
296
244
  } | undefined;
297
245
  }, {
298
- client: ({
246
+ client: {
299
247
  connection: ({
300
248
  apiKey: string;
301
249
  rpcUrl?: undefined;
302
250
  jwt?: undefined;
303
- } & {
304
- chainAgnosticUrl?: string | undefined;
305
- }) | ({
251
+ } | {
306
252
  jwt: string;
307
253
  rpcUrl?: undefined;
308
254
  apiKey?: undefined;
309
- } & {
310
- chainAgnosticUrl?: string | undefined;
311
- }) | ({
255
+ } | {
312
256
  rpcUrl: string;
313
257
  apiKey?: undefined;
314
258
  jwt?: undefined;
315
- } & {
316
- chainAgnosticUrl?: string | undefined;
317
- }) | ({
259
+ } | {
318
260
  rpcUrl: string;
319
261
  jwt: string;
320
262
  apiKey?: undefined;
321
- } & {
263
+ }) & {
322
264
  chainAgnosticUrl?: string | undefined;
323
- });
324
- iframeConfig: {
325
- iframeContainerId: string;
326
- iframeElementId?: string | undefined;
327
265
  };
328
- rpId?: string | undefined;
329
- rootOrgId?: string | undefined;
330
- oauthCallbackUrl?: string | undefined;
331
- enablePopupOauth?: boolean | undefined;
332
- } | AlchemySignerWebClient) & ({
333
- connection: ({
334
- apiKey: string;
335
- rpcUrl?: undefined;
336
- jwt?: undefined;
337
- } & {
338
- chainAgnosticUrl?: string | undefined;
339
- }) | ({
340
- jwt: string;
341
- rpcUrl?: undefined;
342
- apiKey?: undefined;
343
- } & {
344
- chainAgnosticUrl?: string | undefined;
345
- }) | ({
346
- rpcUrl: string;
347
- apiKey?: undefined;
348
- jwt?: undefined;
349
- } & {
350
- chainAgnosticUrl?: string | undefined;
351
- }) | ({
352
- rpcUrl: string;
353
- jwt: string;
354
- apiKey?: undefined;
355
- } & {
356
- chainAgnosticUrl?: string | undefined;
357
- });
358
266
  iframeConfig: {
359
267
  iframeContainerId: string;
360
268
  iframeElementId?: string | undefined;
@@ -363,7 +271,7 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
363
271
  rootOrgId?: string | undefined;
364
272
  oauthCallbackUrl?: string | undefined;
365
273
  enablePopupOauth?: boolean | undefined;
366
- } | AlchemySignerWebClient | undefined);
274
+ } | AlchemySignerWebClient;
367
275
  sessionConfig?: {
368
276
  storage?: Storage | "localStorage" | "sessionStorage" | undefined;
369
277
  sessionKey?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAEL,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAEV,iCAAiC,EACjC,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,mKAAmK;IACnK,SAAS,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;IAChC,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;CAClC,GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GACtE;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,iCAAiC,CAAC;CAClD,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC;CAClB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,iCAAiC,CAAC;CAClD,GACD,CAAC;IACC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAA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AAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GACzB,QAAQ,GACR,OAAO,GACP,UAAU,GACV,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAE7C,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUlC,CAAC;AAEL,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,iBAAiB,CAAC,sBAAsB,CAAC;IAC7E,OAAO,CAAC,MAAM,CAAC,2BAA2B,CAAS;IACnD;;;;;;;;;;;;;;;;;;;;OAoBG;gBAES,MAAM,EAAE,mBAAmB;CA+FxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"base64UrlEncode.d.ts","sourceRoot":"","sources":["../../../src/utils/base64UrlEncode.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAAe,WAAW,KAAG,MAMxD,CAAC"}
1
+ {"version":3,"file":"base64UrlEncode.d.ts","sourceRoot":"","sources":["../../../src/utils/base64UrlEncode.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GAAI,WAAW,WAAW,KAAG,MAMxD,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.35.0";
1
+ export declare const VERSION = "4.35.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@account-kit/signer",
3
- "version": "4.35.0",
3
+ "version": "4.35.1",
4
4
  "description": "Core interfaces and clients for interfacing with the Alchemy Signer API",
5
5
  "author": "Alchemy",
6
6
  "license": "MIT",
@@ -45,13 +45,11 @@
45
45
  "react": "^18.2.0",
46
46
  "react-dom": "^18.2.0",
47
47
  "tailwindcss": "^3.4.3",
48
- "typescript": "^5.0.4",
49
- "typescript-template": "*",
50
- "vitest": "^2.0.4"
48
+ "typescript-template": "*"
51
49
  },
52
50
  "dependencies": {
53
- "@aa-sdk/core": "^4.35.0",
54
- "@account-kit/logging": "^4.35.0",
51
+ "@aa-sdk/core": "^4.35.1",
52
+ "@account-kit/logging": "^4.35.1",
55
53
  "@solana/web3.js": "^1.98.0",
56
54
  "@turnkey/http": "^2.22.0",
57
55
  "@turnkey/iframe-stamper": "^1.0.0",
@@ -63,7 +61,7 @@
63
61
  "zustand": "^5.0.0-rc.2"
64
62
  },
65
63
  "peerDependencies": {
66
- "viem": "^2.29.2"
64
+ "viem": "2.29.2"
67
65
  },
68
66
  "publishConfig": {
69
67
  "access": "public",
@@ -77,5 +75,5 @@
77
75
  "url": "https://github.com/alchemyplatform/aa-sdk/issues"
78
76
  },
79
77
  "homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
80
- "gitHead": "3e5736311d16ae0eeaef9a869da2aff1e361a3f9"
78
+ "gitHead": "31e2138c2dd08c5b32cc2d67b3f0d7b2a7d21f4f"
81
79
  }
package/src/base.ts CHANGED
@@ -141,8 +141,8 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
141
141
  mfaRequired: false,
142
142
  mfaFactorId: undefined,
143
143
  },
144
- } satisfies AlchemySignerStore)
145
- )
144
+ }) satisfies AlchemySignerStore,
145
+ ),
146
146
  );
147
147
  // NOTE: it's important that the session manager share a client
148
148
  // with the signer. The SessionManager leverages the Signer's client
@@ -170,7 +170,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
170
170
  */
171
171
  on = <E extends AlchemySignerEvent>(
172
172
  event: E,
173
- listener: AlchemySignerEvents[E]
173
+ listener: AlchemySignerEvents[E],
174
174
  ) => {
175
175
  // NOTE: we're using zustand here to handle this because we are able to use the fireImmediately
176
176
  // option which deals with a possible race condition where the listener is added after the event
@@ -183,8 +183,8 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
183
183
  (status) =>
184
184
  status === AlchemySignerStatus.CONNECTED &&
185
185
  (listener as AlchemySignerEvents["connected"])(
186
- this.store.getState().user!
187
- )
186
+ this.store.getState().user!,
187
+ ),
188
188
  );
189
189
  case "disconnected":
190
190
  return subscribeWithDelayedFireImmediately(
@@ -192,13 +192,13 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
192
192
  ({ status }) => status,
193
193
  (status) =>
194
194
  status === AlchemySignerStatus.DISCONNECTED &&
195
- (listener as AlchemySignerEvents["disconnected"])()
195
+ (listener as AlchemySignerEvents["disconnected"])(),
196
196
  );
197
197
  case "statusChanged":
198
198
  return subscribeWithDelayedFireImmediately(
199
199
  this.store,
200
200
  ({ status }) => status,
201
- listener as AlchemySignerEvents["statusChanged"]
201
+ listener as AlchemySignerEvents["statusChanged"],
202
202
  );
203
203
  case "errorChanged":
204
204
  return subscribeWithDelayedFireImmediately(
@@ -206,8 +206,8 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
206
206
  ({ error }) => error,
207
207
  (error) =>
208
208
  (listener as AlchemySignerEvents["errorChanged"])(
209
- error ?? undefined
210
- )
209
+ error ?? undefined,
210
+ ),
211
211
  );
212
212
  case "newUserSignup":
213
213
  return subscribeWithDelayedFireImmediately(
@@ -215,14 +215,14 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
215
215
  ({ isNewUser }) => isNewUser,
216
216
  (isNewUser) => {
217
217
  if (isNewUser) (listener as AlchemySignerEvents["newUserSignup"])();
218
- }
218
+ },
219
219
  );
220
220
  case "mfaStatusChanged":
221
221
  return subscribeWithDelayedFireImmediately(
222
222
  this.store,
223
223
  ({ mfaStatus }) => mfaStatus,
224
224
  (mfaStatus) =>
225
- (listener as AlchemySignerEvents["mfaStatusChanged"])(mfaStatus)
225
+ (listener as AlchemySignerEvents["mfaStatusChanged"])(mfaStatus),
226
226
  );
227
227
  case "emailAuthLinkingRequired":
228
228
  return subscribeWithDelayedFireImmediately(
@@ -231,10 +231,10 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
231
231
  (authLinkingStatus) => {
232
232
  if (authLinkingStatus) {
233
233
  (listener as AlchemySignerEvents["emailAuthLinkingRequired"])(
234
- authLinkingStatus.email
234
+ authLinkingStatus.email,
235
235
  );
236
236
  }
237
- }
237
+ },
238
238
  );
239
239
  default:
240
240
  assertNever(event, `Unknown event type ${event}`);
@@ -337,7 +337,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
337
337
  });
338
338
  throw error;
339
339
  });
340
- }
340
+ },
341
341
  );
342
342
 
343
343
  private trackAuthenticateType = (params: AuthParams) => {
@@ -458,7 +458,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
458
458
  const { address } = await this.inner.whoami();
459
459
 
460
460
  return address;
461
- }
461
+ },
462
462
  );
463
463
 
464
464
  /**
@@ -529,16 +529,16 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
529
529
  */
530
530
  signTypedData: <
531
531
  const TTypedData extends TypedData | Record<string, unknown>,
532
- TPrimaryType extends keyof TTypedData | "EIP712Domain" = keyof TTypedData
532
+ TPrimaryType extends keyof TTypedData | "EIP712Domain" = keyof TTypedData,
533
533
  >(
534
- params: TypedDataDefinition<TTypedData, TPrimaryType>
534
+ params: TypedDataDefinition<TTypedData, TPrimaryType>,
535
535
  ) => Promise<Hex> = SignerLogger.profiled(
536
536
  "BaseAlchemySigner.signTypedData",
537
537
  async (params) => {
538
538
  const messageHash = hashTypedData(params);
539
539
 
540
540
  return this.inner.signRawMessage(messageHash);
541
- }
541
+ },
542
542
  );
543
543
 
544
544
  /**
@@ -572,15 +572,16 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
572
572
  * @returns {Promise<string>} a promise that resolves to the serialized transaction with the signature
573
573
  */
574
574
  signTransaction: <
575
- serializer extends SerializeTransactionFn<TransactionSerializable> = SerializeTransactionFn<TransactionSerializable>,
576
- transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]
575
+ serializer extends
576
+ SerializeTransactionFn<TransactionSerializable> = SerializeTransactionFn<TransactionSerializable>,
577
+ transaction extends Parameters<serializer>[0] = Parameters<serializer>[0],
577
578
  >(
578
579
  transaction: transaction,
579
580
  options?:
580
581
  | {
581
582
  serializer?: serializer | undefined;
582
583
  }
583
- | undefined
584
+ | undefined,
584
585
  ) => Promise<
585
586
  IsNarrowable<
586
587
  TransactionSerialized<GetTransactionType<transaction>>,
@@ -594,13 +595,13 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
594
595
  const serializeFn = args?.serializer ?? serializeTransaction;
595
596
  const serializedTx = serializeFn(tx);
596
597
  const signatureHex = await this.inner.signRawMessage(
597
- keccak256(serializedTx)
598
+ keccak256(serializedTx),
598
599
  );
599
600
 
600
601
  const signature = this.unpackSignRawMessageBytes(signatureHex);
601
602
 
602
603
  return serializeFn(tx, signature);
603
- }
604
+ },
604
605
  );
605
606
 
606
607
  /**
@@ -632,14 +633,13 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
632
633
  * @returns {Promise<SignedAuthorization<number>> | undefined} a promise that resolves to the authorization with the signature
633
634
  */
634
635
  signAuthorization: (
635
- unsignedAuthorization: AuthorizationRequest<number>
636
+ unsignedAuthorization: AuthorizationRequest<number>,
636
637
  ) => Promise<SignedAuthorization<number>> = SignerLogger.profiled(
637
638
  "BaseAlchemySigner.signAuthorization",
638
639
  async (unsignedAuthorization) => {
639
640
  const hashedAuthorization = hashAuthorization(unsignedAuthorization);
640
- const signedAuthorizationHex = await this.inner.signRawMessage(
641
- hashedAuthorization
642
- );
641
+ const signedAuthorizationHex =
642
+ await this.inner.signRawMessage(hashedAuthorization);
643
643
  const signature = this.unpackSignRawMessageBytes(signedAuthorizationHex);
644
644
  const { address, contractAddress, ...unsignedAuthorizationRest } =
645
645
  unsignedAuthorization;
@@ -649,7 +649,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
649
649
  ...signature,
650
650
  address: address ?? contractAddress,
651
651
  };
652
- }
652
+ },
653
653
  );
654
654
 
655
655
  /**
@@ -686,7 +686,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
686
686
  };
687
687
 
688
688
  private unpackSignRawMessageBytes = (
689
- hex: `0x${string}`
689
+ hex: `0x${string}`,
690
690
  ): UnpackedSignature => {
691
691
  return {
692
692
  r: takeBytes(hex, { count: 32 }),
@@ -794,7 +794,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
794
794
  * @returns {boolean} true if the wallet was exported successfully
795
795
  */
796
796
  exportWallet: (
797
- params: Parameters<(typeof this.inner)["exportWallet"]>[0]
797
+ params: Parameters<(typeof this.inner)["exportWallet"]>[0],
798
798
  ) => Promise<boolean> = async (params) => {
799
799
  return this.inner.exportWallet(params);
800
800
  };
@@ -836,9 +836,9 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
836
836
  signMessage: (msg) => this.signMessage(msg.message),
837
837
  signTypedData: <
838
838
  const typedData extends TypedData | Record<string, unknown>,
839
- primaryType extends keyof typedData | "EIP712Domain" = keyof typedData
839
+ primaryType extends keyof typedData | "EIP712Domain" = keyof typedData,
840
840
  >(
841
- typedDataDefinition: TypedDataDefinition<typedData, primaryType>
841
+ typedDataDefinition: TypedDataDefinition<typedData, primaryType>,
842
842
  ) => this.signTypedData<typedData, primaryType>(typedDataDefinition),
843
843
  signTransaction: this.signTransaction,
844
844
  });
@@ -877,7 +877,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
877
877
  };
878
878
 
879
879
  private authenticateWithEmail = async (
880
- params: Extract<AuthParams, { type: "email" }>
880
+ params: Extract<AuthParams, { type: "email" }>,
881
881
  ): Promise<User> => {
882
882
  if ("bundle" in params) {
883
883
  return this.completeEmailAuth(params);
@@ -887,7 +887,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
887
887
  params.email,
888
888
  params.emailMode,
889
889
  params.multiFactors,
890
- params.redirectParams
890
+ params.redirectParams,
891
891
  );
892
892
 
893
893
  this.setAwaitingEmailAuth({ orgId, otpId, isNewUser });
@@ -906,7 +906,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
906
906
  };
907
907
 
908
908
  private authenticateWithPasskey = async (
909
- args: Extract<AuthParams, { type: "passkey" }>
909
+ args: Extract<AuthParams, { type: "passkey" }>,
910
910
  ): Promise<User> => {
911
911
  let user: User;
912
912
  const shouldCreateNew = async () => {
@@ -923,7 +923,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
923
923
  args as Extract<
924
924
  AuthParams,
925
925
  { type: "passkey" } & ({ email: string } | { createNew: true })
926
- >
926
+ >,
927
927
  );
928
928
  // account creation for passkeys returns the whoami response so we don't have to
929
929
  // call it again after signup
@@ -946,7 +946,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
946
946
  };
947
947
 
948
948
  private authenticateWithOauth = async (
949
- args: Extract<AuthParams, { type: "oauth" }>
949
+ args: Extract<AuthParams, { type: "oauth" }>,
950
950
  ): Promise<User> => {
951
951
  this.store.setState({ authLinkingStatus: undefined });
952
952
  const params: OauthParams = {
@@ -965,7 +965,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
965
965
  };
966
966
 
967
967
  private authenticateWithOtp = async (
968
- args: Extract<AuthParams, { type: "otp" }>
968
+ args: Extract<AuthParams, { type: "otp" }>,
969
969
  ): Promise<User> => {
970
970
  const tempSession = this.sessionManager.getTemporarySession();
971
971
  const { orgId, isNewUser } = tempSession ?? {};
@@ -1059,7 +1059,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
1059
1059
 
1060
1060
  private handleMfaRequired(
1061
1061
  encryptedPayload: string,
1062
- multiFactors: MfaFactor[]
1062
+ multiFactors: MfaFactor[],
1063
1063
  ) {
1064
1064
  // Store complete MFA context in the temporary session
1065
1065
  const tempSession = this.sessionManager.getTemporarySession();
@@ -1154,7 +1154,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
1154
1154
  email: string,
1155
1155
  emailMode?: EmailType,
1156
1156
  multiFactors?: VerifyMfaParams[],
1157
- redirectParams?: URLSearchParams
1157
+ redirectParams?: URLSearchParams,
1158
1158
  ): Promise<{
1159
1159
  orgId: string;
1160
1160
  otpId?: string;
@@ -1193,7 +1193,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
1193
1193
  }
1194
1194
 
1195
1195
  private async completeEmailAuth(
1196
- params: Extract<AuthParams, { type: "email"; bundle: string }>
1196
+ params: Extract<AuthParams, { type: "email"; bundle: string }>,
1197
1197
  ): Promise<User> {
1198
1198
  const temporarySession = params.orgId
1199
1199
  ? { orgId: params.orgId }
@@ -1307,12 +1307,12 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
1307
1307
  * @returns {Promise<{ multiFactors: MfaFactor[] }>} A promise that resolves to the updated list of MFA factors
1308
1308
  */
1309
1309
  verifyMfa: (
1310
- params: VerifyMfaParams
1310
+ params: VerifyMfaParams,
1311
1311
  ) => Promise<{ multiFactors: MfaFactor[] }> = SignerLogger.profiled(
1312
1312
  "BaseAlchemySigner.verifyMfa",
1313
1313
  async (params) => {
1314
1314
  return this.inner.verifyMfa(params);
1315
- }
1315
+ },
1316
1316
  );
1317
1317
 
1318
1318
  /**
@@ -1343,12 +1343,12 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
1343
1343
  * @returns {Promise<{ multiFactors: MfaFactor[] }>} A promise that resolves to the updated list of MFA factors
1344
1344
  */
1345
1345
  removeMfa: (
1346
- params: RemoveMfaParams
1346
+ params: RemoveMfaParams,
1347
1347
  ) => Promise<{ multiFactors: MfaFactor[] }> = SignerLogger.profiled(
1348
1348
  "BaseAlchemySigner.removeMfa",
1349
1349
  async (params) => {
1350
1350
  return this.inner.removeMfa(params);
1351
- }
1351
+ },
1352
1352
  );
1353
1353
 
1354
1354
  /**
@@ -1383,7 +1383,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
1383
1383
  * @returns {Promise<User>} A promise that resolves to the authenticated user
1384
1384
  */
1385
1385
  public async validateMultiFactors(
1386
- params: ValidateMultiFactorsArgs
1386
+ params: ValidateMultiFactorsArgs,
1387
1387
  ): Promise<User> {
1388
1388
  // Get MFA context from temporary session
1389
1389
  const tempSession = this.sessionManager.getTemporarySession();
@@ -1393,7 +1393,7 @@ export abstract class BaseAlchemySigner<TClient extends BaseSignerClient>
1393
1393
  !tempSession.mfaFactorId
1394
1394
  ) {
1395
1395
  throw new Error(
1396
- "No pending MFA context found. Call submitOtpCode() first."
1396
+ "No pending MFA context found. Call submitOtpCode() first.",
1397
1397
  );
1398
1398
  }
1399
1399
 
@@ -1518,7 +1518,7 @@ function toErrorInfo(error: unknown): ErrorInfo {
1518
1518
  function subscribeWithDelayedFireImmediately<T>(
1519
1519
  store: InternalStore,
1520
1520
  selector: (state: AlchemySignerStore) => T,
1521
- listener: (selectedState: T, previousSelectedState: T) => void
1521
+ listener: (selectedState: T, previousSelectedState: T) => void,
1522
1522
  ): () => void {
1523
1523
  let subscribeHasReturned = false;
1524
1524
  const unsubscribe = store.subscribe(
@@ -1530,7 +1530,7 @@ function subscribeWithDelayedFireImmediately<T>(
1530
1530
  setTimeout(() => listener(...args), 0);
1531
1531
  }
1532
1532
  },
1533
- { fireImmediately: true }
1533
+ { fireImmediately: true },
1534
1534
  );
1535
1535
  subscribeHasReturned = true;
1536
1536
  return unsubscribe;