@account-kit/wallet-client 4.76.0 → 4.77.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 (79) hide show
  1. package/dist/esm/client/actions/grantPermissions.d.ts +3 -3
  2. package/dist/esm/client/actions/grantPermissions.js +28 -3
  3. package/dist/esm/client/actions/grantPermissions.js.map +1 -1
  4. package/dist/esm/client/actions/listAccounts.d.ts +11 -7
  5. package/dist/esm/client/actions/listAccounts.js +27 -4
  6. package/dist/esm/client/actions/listAccounts.js.map +1 -1
  7. package/dist/esm/client/actions/requestAccount.d.ts +8 -4
  8. package/dist/esm/client/actions/requestAccount.js +37 -6
  9. package/dist/esm/client/actions/requestAccount.js.map +1 -1
  10. package/dist/esm/client/actions/sendCalls.d.ts +3 -3
  11. package/dist/esm/client/actions/sendCalls.js +5 -2
  12. package/dist/esm/client/actions/sendCalls.js.map +1 -1
  13. package/dist/esm/client/actions/signMessage.d.ts +3 -3
  14. package/dist/esm/client/actions/signMessage.js +1 -2
  15. package/dist/esm/client/actions/signMessage.js.map +1 -1
  16. package/dist/esm/client/actions/signPreparedCalls.d.ts +3 -3
  17. package/dist/esm/client/actions/signPreparedCalls.js +5 -2
  18. package/dist/esm/client/actions/signPreparedCalls.js.map +1 -1
  19. package/dist/esm/client/actions/signSignatureRequest.d.ts +8 -37
  20. package/dist/esm/client/actions/signSignatureRequest.js +30 -2
  21. package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
  22. package/dist/esm/client/actions/signTypedData.d.ts +3 -3
  23. package/dist/esm/client/actions/signTypedData.js +1 -1
  24. package/dist/esm/client/actions/signTypedData.js.map +1 -1
  25. package/dist/esm/client/actions/waitForCallsStatus.d.ts +1 -1
  26. package/dist/esm/client/decorator.d.ts +2 -2
  27. package/dist/esm/client/decorator.js +13 -1
  28. package/dist/esm/client/decorator.js.map +1 -1
  29. package/dist/esm/client/index.d.ts +9 -2
  30. package/dist/esm/client/index.js.map +1 -1
  31. package/dist/esm/internal/account.d.ts +3 -2
  32. package/dist/esm/internal/account.js +28 -3
  33. package/dist/esm/internal/account.js.map +1 -1
  34. package/dist/esm/utils.d.ts +6 -0
  35. package/dist/esm/utils.js +14 -1
  36. package/dist/esm/utils.js.map +1 -1
  37. package/dist/esm/version.d.ts +1 -1
  38. package/dist/esm/version.js +1 -1
  39. package/dist/esm/version.js.map +1 -1
  40. package/dist/types/client/actions/grantPermissions.d.ts +3 -3
  41. package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
  42. package/dist/types/client/actions/listAccounts.d.ts +11 -7
  43. package/dist/types/client/actions/listAccounts.d.ts.map +1 -1
  44. package/dist/types/client/actions/requestAccount.d.ts +8 -4
  45. package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
  46. package/dist/types/client/actions/sendCalls.d.ts +3 -3
  47. package/dist/types/client/actions/sendCalls.d.ts.map +1 -1
  48. package/dist/types/client/actions/signMessage.d.ts +3 -3
  49. package/dist/types/client/actions/signMessage.d.ts.map +1 -1
  50. package/dist/types/client/actions/signPreparedCalls.d.ts +3 -3
  51. package/dist/types/client/actions/signPreparedCalls.d.ts.map +1 -1
  52. package/dist/types/client/actions/signSignatureRequest.d.ts +8 -37
  53. package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
  54. package/dist/types/client/actions/signTypedData.d.ts +3 -3
  55. package/dist/types/client/actions/signTypedData.d.ts.map +1 -1
  56. package/dist/types/client/actions/waitForCallsStatus.d.ts +1 -1
  57. package/dist/types/client/decorator.d.ts +2 -2
  58. package/dist/types/client/decorator.d.ts.map +1 -1
  59. package/dist/types/client/index.d.ts +9 -2
  60. package/dist/types/client/index.d.ts.map +1 -1
  61. package/dist/types/internal/account.d.ts +3 -2
  62. package/dist/types/internal/account.d.ts.map +1 -1
  63. package/dist/types/utils.d.ts +6 -0
  64. package/dist/types/utils.d.ts.map +1 -1
  65. package/dist/types/version.d.ts +1 -1
  66. package/package.json +5 -5
  67. package/src/client/actions/grantPermissions.ts +33 -4
  68. package/src/client/actions/listAccounts.ts +38 -8
  69. package/src/client/actions/requestAccount.ts +60 -12
  70. package/src/client/actions/sendCalls.ts +9 -3
  71. package/src/client/actions/signMessage.ts +3 -3
  72. package/src/client/actions/signPreparedCalls.ts +10 -4
  73. package/src/client/actions/signSignatureRequest.ts +75 -8
  74. package/src/client/actions/signTypedData.ts +3 -3
  75. package/src/client/decorator.ts +21 -3
  76. package/src/client/index.ts +11 -2
  77. package/src/internal/account.ts +38 -5
  78. package/src/utils.ts +25 -1
  79. package/src/version.ts +1 -1
@@ -1,23 +1,27 @@
1
1
  import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
2
2
  import type { InnerWalletApiClient } from "../../types.ts";
3
- import type { SmartAccountSigner } from "@aa-sdk/core";
4
3
  import type { Address } from "viem";
4
+ import type { SmartWalletSigner } from "../index.js";
5
+ import type { WebAuthnPublicKey } from "@alchemy/wallet-api-types";
5
6
  type RpcSchema = Extract<WalletServerRpcSchemaType, {
6
7
  Request: {
7
8
  method: "wallet_listAccounts";
8
9
  };
9
10
  }>;
10
- export type ListAccountsParams = Omit<RpcSchema["Request"]["params"][0], "signerAddress"> & {
11
- signerAddress?: Address;
12
- };
11
+ export type ListAccountsParams = Omit<RpcSchema["Request"]["params"][0], "signerAddress" | "signerPublicKey"> & ({
12
+ signerAddress: Address;
13
+ } | {
14
+ signerPublicKey: WebAuthnPublicKey;
15
+ } | {});
13
16
  export type ListAccountsResult = RpcSchema["ReturnType"];
14
17
  /**
15
18
  * Lists all smart accounts for a given signer using the wallet API client.
16
19
  *
17
20
  * @param {InnerWalletApiClient} client - The wallet API client to use for the request
18
- * @param {SmartAccountSigner} signer - The signer for which to list accounts
21
+ * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer for which to list accounts
19
22
  * @param {ListAccountsParams} params - Parameters for listing accounts
20
- * @param {string} params.signerAddress - The address of the signer to list accounts for
23
+ * @param {Address} [params.signerAddress] - The address of the signer to list accounts for
24
+ * @param {WebAuthnPublicKey} [params.signerPublicKey] - The public key of the signer to list accounts for
21
25
  * @param {number} [params.limit] - Optional maximum number of accounts to return (default: 100, max: 100)
22
26
  * @param {string} [params.after] - Optional pagination cursor for fetching subsequent pages
23
27
  * @returns {Promise<ListAccountsResult>} A Promise that resolves to the list of accounts and pagination metadata
@@ -38,6 +42,6 @@ export type ListAccountsResult = RpcSchema["ReturnType"];
38
42
  * });
39
43
  * ```
40
44
  */
41
- export declare function listAccounts(client: InnerWalletApiClient, signer: SmartAccountSigner, params: ListAccountsParams): Promise<ListAccountsResult>;
45
+ export declare function listAccounts(client: InnerWalletApiClient, signer: SmartWalletSigner, params: ListAccountsParams): Promise<ListAccountsResult>;
42
46
  export {};
43
47
  //# sourceMappingURL=listAccounts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"listAccounts.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/listAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,KAAK,SAAS,GAAG,OAAO,CACtB,yBAAyB,EACzB;IACE,OAAO,EAAE;QACP,MAAM,EAAE,qBAAqB,CAAC;KAC/B,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACjC,eAAe,CAChB,GAAG;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhC,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAgB7B"}
1
+ {"version":3,"file":"listAccounts.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/listAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAMnE,KAAK,SAAS,GAAG,OAAO,CACtB,yBAAyB,EACzB;IACE,OAAO,EAAE;QACP,MAAM,EAAE,qBAAqB,CAAC;KAC/B,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACjC,eAAe,GAAG,iBAAiB,CACpC,GACC,CAAC;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,eAAe,EAAE,iBAAiB,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC;AAE7E,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAuC7B"}
@@ -1,7 +1,9 @@
1
- import { type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
1
+ import { type SmartContractAccount } from "@aa-sdk/core";
2
2
  import type { Address } from "abitype";
3
3
  import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
4
4
  import type { InnerWalletApiClient } from "../../types.js";
5
+ import type { SmartWalletSigner } from "../index.js";
6
+ import { type WebAuthnPublicKey } from "@alchemy/wallet-api-types";
5
7
  type RpcSchema = Extract<WalletServerRpcSchemaType, {
6
8
  Request: {
7
9
  method: "wallet_requestAccount";
@@ -9,7 +11,9 @@ type RpcSchema = Extract<WalletServerRpcSchemaType, {
9
11
  }>;
10
12
  export type RequestAccountParams = Omit<Extract<RpcSchema["Request"]["params"][0], {
11
13
  signerAddress: Address;
12
- }>, "signerAddress" | "includeCounterfactualInfo"> & {
14
+ } | {
15
+ signerPublicKey: WebAuthnPublicKey;
16
+ }>, "signerAddress" | "signerPublicKey" | "includeCounterfactualInfo"> & {
13
17
  accountAddress?: Address;
14
18
  };
15
19
  export type RequestAccountResult = SmartContractAccount;
@@ -19,7 +23,7 @@ export type RequestAccountResult = SmartContractAccount;
19
23
  * If an account already exists, the creationHint will be ignored.
20
24
  *
21
25
  * @param {InnerWalletApiClient} client - The wallet API client to use for the request
22
- * @param {SmartAccountSigner} signer - The signer that will be associated with the account
26
+ * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer that will be associated with the account
23
27
  * @param {RequestAccountParams} [params] - Optional parameters for requesting a specific account
24
28
  * @param {string} [params.id] - Optional identifier for the account. If specified, a new account with this ID will be created even if one already exists for the signer
25
29
  * @param {object} [params.creationHint] - Optional hints to guide account creation. These are ignored if an account already exists
@@ -32,6 +36,6 @@ export type RequestAccountResult = SmartContractAccount;
32
36
  * const account = await client.requestAccount(signer);
33
37
  * ```
34
38
  */
35
- export declare function requestAccount(client: InnerWalletApiClient, signer: SmartAccountSigner, params?: RequestAccountParams): Promise<RequestAccountResult>;
39
+ export declare function requestAccount(client: InnerWalletApiClient, signer: SmartWalletSigner, params?: RequestAccountParams): Promise<RequestAccountResult>;
36
40
  export {};
37
41
  //# sourceMappingURL=requestAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestAccount.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/requestAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAG3D,KAAK,SAAS,GAAG,OAAO,CACtB,yBAAyB,EACzB;IACE,OAAO,EAAE;QACP,MAAM,EAAE,uBAAuB,CAAC;KACjC,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC,EACtE,eAAe,GAAG,2BAA2B,CAC9C,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEjC,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAExD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CA0C/B"}
1
+ {"version":3,"file":"requestAccount.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/requestAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAKrD,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,2BAA2B,CAAC;AAEnC,KAAK,SAAS,GAAG,OAAO,CACtB,yBAAyB,EACzB;IACE,OAAO,EAAE;QACP,MAAM,EAAE,uBAAuB,CAAC;KACjC,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,OAAO,CACL,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACjC;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,eAAe,EAAE,iBAAiB,CAAA;CAAE,CACpE,EACD,eAAe,GAAG,iBAAiB,GAAG,2BAA2B,CAClE,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEjC,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAExD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,iBAAiB,EACzB,MAAM,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAgF/B"}
@@ -1,8 +1,8 @@
1
1
  import type { Address } from "viem";
2
2
  import type { InnerWalletApiClient } from "../../types.js";
3
3
  import { type PrepareCallsParams } from "./prepareCalls.js";
4
- import { type SmartAccountSigner } from "@aa-sdk/core";
5
4
  import { type SendPreparedCallsResult } from "./sendPreparedCalls.js";
5
+ import type { SmartWalletSigner } from "../index.js";
6
6
  export type SendCallsParams<TAccount extends Address | undefined = Address | undefined> = PrepareCallsParams<TAccount>;
7
7
  export type SendCallsResult = SendPreparedCallsResult;
8
8
  /**
@@ -14,7 +14,7 @@ export type SendCallsResult = SendPreparedCallsResult;
14
14
  * </Note>
15
15
  *
16
16
  * @param {InnerWalletApiClient} client - The wallet API client to use for the request
17
- * @param {SmartAccountSigner} signer - The signer to use
17
+ * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer to use
18
18
  * @param {PrepareCallsParams<TAccount>} params - Parameters for sending calls
19
19
  * @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute
20
20
  * @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)
@@ -38,5 +38,5 @@ export type SendCallsResult = SendPreparedCallsResult;
38
38
  * console.log(result.preparedCallIds);
39
39
  * ```
40
40
  */
41
- export declare function sendCalls<TAccount extends Address | undefined = Address | undefined>(client: InnerWalletApiClient, signer: SmartAccountSigner, params: SendCallsParams<TAccount>): Promise<SendCallsResult>;
41
+ export declare function sendCalls<TAccount extends Address | undefined = Address | undefined>(client: InnerWalletApiClient, signer: SmartWalletSigner, params: SendCallsParams<TAccount>): Promise<SendCallsResult>;
42
42
  //# sourceMappingURL=sendCalls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sendCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/sendCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,wBAAwB,CAAC;AAGhC,MAAM,MAAM,eAAe,CACzB,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACxD,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAE1D,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,GAChC,OAAO,CAAC,eAAe,CAAC,CAgC1B"}
1
+ {"version":3,"file":"sendCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/sendCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,MAAM,MAAM,eAAe,CACzB,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACxD,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAE1D,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,GAChC,OAAO,CAAC,eAAe,CAAC,CAqC1B"}
@@ -1,6 +1,6 @@
1
- import { type SmartAccountSigner } from "@aa-sdk/core";
2
1
  import { type Address, type Hex, type SignableMessage } from "viem";
3
2
  import type { InnerWalletApiClient } from "../../types.ts";
3
+ import type { SmartWalletSigner } from "../index.js";
4
4
  export type SignMessageParams = {
5
5
  message: SignableMessage;
6
6
  account?: Address;
@@ -11,7 +11,7 @@ export type SignMessageResult = Hex;
11
11
  * This method requests the account associated with the signer and uses it to sign the message.
12
12
  *
13
13
  * @param {InnerWalletApiClient} client - The wallet API client to use for the request
14
- * @param {SmartAccountSigner} signer - The signer of the smart account
14
+ * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer of the smart account
15
15
  * @param {SignMessageParams} params - Parameters for signing the message
16
16
  * @param {SignableMessage} params.message - The message to sign using EIP-191. Can be a string, or object with raw bytes.
17
17
  * @param {Address} [params.account] - Optional account address to use for signing. If not provided, uses the client's current account.
@@ -26,5 +26,5 @@ export type SignMessageResult = Hex;
26
26
  * const signature = await client.signMessage({ raw: "0x48656c6c6f2c20776f726c6421" });
27
27
  * ```
28
28
  */
29
- export declare function signMessage(client: InnerWalletApiClient, signer: SmartAccountSigner, params: SignMessageParams): Promise<SignMessageResult>;
29
+ export declare function signMessage(client: InnerWalletApiClient, signer: SmartWalletSigner, params: SignMessageParams): Promise<SignMessageResult>;
30
30
  //# sourceMappingURL=signMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,eAAe,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAI3D,MAAM,MAAM,iBAAiB,GAAG;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAU5B"}
1
+ {"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,eAAe,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAG3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,iBAAiB,GAAG;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAU5B"}
@@ -1,6 +1,6 @@
1
1
  import type { PrepareCallsResult } from "./prepareCalls.ts";
2
- import { type SmartAccountSigner } from "@aa-sdk/core";
3
2
  import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
3
+ import type { SmartWalletSigner } from "../index.js";
4
4
  type RpcSchema = Extract<WalletServerRpcSchemaType, {
5
5
  Request: {
6
6
  method: "wallet_sendPreparedCalls";
@@ -11,10 +11,10 @@ export type SignPreparedCallsResult = RpcSchema["Request"]["params"][0];
11
11
  /**
12
12
  * Signs prepared calls using the provided signer.
13
13
  *
14
- * @param {SmartAccountSigner} signer - The signer to use
14
+ * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer to use
15
15
  * @param {SignPreparedCallsParams} params - The prepared calls with signature requests
16
16
  * @returns {Promise<SignPreparedCallsResult>} A Promise that resolves to the signed calls
17
17
  */
18
- export declare function signPreparedCalls(signer: SmartAccountSigner, params: SignPreparedCallsParams): Promise<SignPreparedCallsResult>;
18
+ export declare function signPreparedCalls(signer: SmartWalletSigner, params: SignPreparedCallsParams): Promise<SignPreparedCallsResult>;
19
19
  export {};
20
20
  //# sourceMappingURL=signPreparedCalls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signPreparedCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAa,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAS/E,KAAK,SAAS,GAAG,OAAO,CACtB,yBAAyB,EACzB;IACE,OAAO,EAAE;QACP,MAAM,EAAE,0BAA0B,CAAC;KACpC,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAExE;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAmElC"}
1
+ {"version":3,"file":"signPreparedCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAQ/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,KAAK,SAAS,GAAG,OAAO,CACtB,yBAAyB,EACzB;IACE,OAAO,EAAE;QACP,MAAM,EAAE,0BAA0B,CAAC;KACpC,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAExE;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAwElC"}
@@ -1,43 +1,14 @@
1
1
  import type { SmartAccountSigner } from "@aa-sdk/core";
2
- import { type Hex } from "viem";
3
- import type { PersonalSignSignatureRequest, TypedDataSignatureRequest, AuthorizationSignatureRequest, Eip7702UnsignedAuth } from "@alchemy/wallet-api-types";
2
+ import type { PersonalSignSignatureRequest, TypedDataSignatureRequest, AuthorizationSignatureRequest, Eip7702UnsignedAuth, UserOpSig, EcdsaSig, WebauthnSig } from "@alchemy/wallet-api-types";
4
3
  import type { WithoutRawPayload } from "../../types.ts";
4
+ import type { WebAuthnSigner } from "../index.js";
5
5
  export type SignSignatureRequestParams = WithoutRawPayload<PersonalSignSignatureRequest | TypedDataSignatureRequest | (AuthorizationSignatureRequest & {
6
6
  data: Eip7702UnsignedAuth;
7
7
  })>;
8
- export type SignSignatureRequestResult = {
9
- type: "secp256k1";
10
- data: Hex;
11
- };
12
- /**
13
- * Signs a signature request using the provided signer.
14
- * This method handles different types of signature requests including personal_sign, eth_signTypedData_v4, and authorization.
15
- *
16
- * @param {SmartAccountSigner} signer - The signer to use for signing the request
17
- * @param {SignSignatureRequestParams} params - The signature request parameters
18
- * @param {string} params.type - The type of signature request ('personal_sign', 'eth_signTypedData_v4', or 'signature_with_authorization')
19
- * @param {SignSignatureRequestParams["data"]} params.data - The data to sign, format depends on the signature type
20
- * @returns {Promise<SignSignatureRequestResult>} A Promise that resolves to the signature result
21
- *
22
- * @example
23
- * ```ts
24
- * // Sign a personal message
25
- * const result = await client.signSignatureRequest({
26
- * type: 'personal_sign',
27
- * data: 'Hello, world!'
28
- * });
29
- *
30
- * // Sign typed data (EIP-712)
31
- * const result = await client.signSignatureRequest({
32
- * type: 'eth_signTypedData_v4',
33
- * data: {
34
- * domain: { ... },
35
- * types: { ... },
36
- * primaryType: '...',
37
- * message: { ... }
38
- * }
39
- * });
40
- * ```
41
- */
42
- export declare function signSignatureRequest(signer: SmartAccountSigner, params: SignSignatureRequestParams): Promise<SignSignatureRequestResult>;
8
+ export type SignSignatureRequestResult = UserOpSig["signature"];
9
+ export declare function signSignatureRequest(signer: SmartAccountSigner, params: WithoutRawPayload<PersonalSignSignatureRequest | TypedDataSignatureRequest | (AuthorizationSignatureRequest & {
10
+ data: Eip7702UnsignedAuth;
11
+ })>): Promise<EcdsaSig["signature"]>;
12
+ export declare function signSignatureRequest(signer: WebAuthnSigner, params: WithoutRawPayload<PersonalSignSignatureRequest | TypedDataSignatureRequest>): Promise<WebauthnSig["signature"]>;
13
+ export declare function signSignatureRequest(signer: SmartAccountSigner | WebAuthnSigner, params: WithoutRawPayload<PersonalSignSignatureRequest | TypedDataSignatureRequest>): Promise<UserOpSig["signature"]>;
43
14
  //# sourceMappingURL=signSignatureRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signSignatureRequest.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signSignatureRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,KAAK,GAAG,EAAmC,MAAM,MAAM,CAAC;AAEjE,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EACzB,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,MAAM,0BAA0B,GAAG,iBAAiB,CACtD,4BAA4B,GAC5B,yBAAyB,GACzB,CAAC,6BAA6B,GAAG;IAC/B,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC,CACL,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAkDrC"}
1
+ {"version":3,"file":"signSignatureRequest.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signSignatureRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EACzB,6BAA6B,EAC7B,mBAAmB,EACnB,SAAS,EACT,QAAQ,EACR,WAAW,EACZ,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,aAAa,CAAC;AAGrE,MAAM,MAAM,0BAA0B,GAAG,iBAAiB,CACtD,4BAA4B,GAC5B,yBAAyB,GACzB,CAAC,6BAA6B,GAAG;IAC/B,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC,CACL,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;AAGhE,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,iBAAiB,CACrB,4BAA4B,GAC5B,yBAAyB,GACzB,CAAC,6BAA6B,GAAG;IAC/B,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC,CACL,GACA,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AAGlC,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,iBAAiB,CACvB,4BAA4B,GAAG,yBAAyB,CACzD,GACA,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;AAGrC,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,kBAAkB,GAAG,cAAc,EAC3C,MAAM,EAAE,iBAAiB,CACvB,4BAA4B,GAAG,yBAAyB,CACzD,GACA,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
- import type { SmartAccountSigner } from "@aa-sdk/core";
2
1
  import { type Address, type Hex, type TypedDataDefinition } from "viem";
3
2
  import type { InnerWalletApiClient } from "../../types.ts";
3
+ import type { SmartWalletSigner } from "../index.js";
4
4
  export type SignTypedDataParams = TypedDataDefinition & {
5
5
  account?: Address;
6
6
  };
@@ -10,7 +10,7 @@ export type SignTypedDataResult = Hex;
10
10
  * This method requests the account associated with the signer and uses it to sign the typed data.
11
11
  *
12
12
  * @param {InnerWalletApiClient} client - The wallet API client to use for the request
13
- * @param {SmartAccountSigner} signer - The signer of the smart account
13
+ * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer of the smart account
14
14
  * @param {TypedDataDefinition} params - The typed data to sign, following EIP-712 format
15
15
  * @returns {Promise<SignTypedDataResult>} A Promise that resolves to the signature as a hex string
16
16
  *
@@ -38,5 +38,5 @@ export type SignTypedDataResult = Hex;
38
38
  * });
39
39
  * ```
40
40
  */
41
- export declare function signTypedData(client: InnerWalletApiClient, signer: SmartAccountSigner, params: SignTypedDataParams): Promise<SignTypedDataResult>;
41
+ export declare function signTypedData(client: InnerWalletApiClient, signer: SmartWalletSigner, params: SignTypedDataParams): Promise<SignTypedDataResult>;
42
42
  //# sourceMappingURL=signTypedData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signTypedData.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,mBAAmB,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAI3D,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAU9B"}
1
+ {"version":3,"file":"signTypedData.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,mBAAmB,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAG3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAU9B"}
@@ -15,7 +15,6 @@ import type { InnerWalletApiClient } from "../../types.js";
15
15
  */
16
16
  export declare function waitForCallsStatus(client: InnerWalletApiClient, params: WaitForCallsStatusParameters): Promise<{
17
17
  version: string;
18
- id: string;
19
18
  chainId: number;
20
19
  capabilities?: {
21
20
  [key: string]: any;
@@ -23,6 +22,7 @@ export declare function waitForCallsStatus(client: InnerWalletApiClient, params:
23
22
  [x: string]: any;
24
23
  } | undefined;
25
24
  atomic: boolean;
25
+ id: string;
26
26
  receipts?: import("viem").WalletCallReceipt<bigint, "success" | "reverted">[] | undefined;
27
27
  statusCode: number;
28
28
  status: "pending" | "success" | "failure" | undefined;
@@ -1,4 +1,3 @@
1
- import type { SmartAccountSigner } from "@aa-sdk/core";
2
1
  import type { Address, Hex } from "viem";
3
2
  import { type WaitForCallsStatusParameters, type WaitForCallsStatusReturnType } from "viem/actions";
4
3
  import type { InnerWalletApiClient } from "../types.ts";
@@ -13,6 +12,7 @@ import { type SignSignatureRequestParams, type SignSignatureRequestResult } from
13
12
  import { type SignTypedDataParams } from "./actions/signTypedData.js";
14
13
  import { type SignPreparedCallsParams, type SignPreparedCallsResult } from "./actions/signPreparedCalls.js";
15
14
  import { type SendCallsParams, type SendCallsResult } from "./actions/sendCalls.js";
15
+ import type { SmartWalletSigner } from "./index.js";
16
16
  export type SmartWalletActions<TAccount extends Address | undefined = Address | undefined> = {
17
17
  requestAccount: (params?: RequestAccountParams) => Promise<RequestAccountResult>;
18
18
  prepareCalls: (params: PrepareCallsParams<TAccount>) => Promise<PrepareCallsResult>;
@@ -27,5 +27,5 @@ export type SmartWalletActions<TAccount extends Address | undefined = Address |
27
27
  signTypedData: (params: SignTypedDataParams) => Promise<Hex>;
28
28
  grantPermissions: (params: GrantPermissionsParams<TAccount>) => Promise<GrantPermissionsResult>;
29
29
  };
30
- export declare function smartWalletClientActions<TAccount extends Address | undefined = Address | undefined>(client: InnerWalletApiClient, signer: SmartAccountSigner): SmartWalletActions<TAccount>;
30
+ export declare function smartWalletClientActions<TAccount extends Address | undefined = Address | undefined>(client: InnerWalletApiClient, signer: SmartWalletSigner): SmartWalletActions<TAccount>;
31
31
  //# sourceMappingURL=decorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../../src/client/decorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAClC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC7B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,eA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AO,CAAC,sBAAsB,CAAC,CAAC;CACtC,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAE1D,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,iBAAiB,GACxB,kBAAkB,CAAC,QAAQ,CAAC,CAe9B"}
@@ -3,10 +3,17 @@ import type { AlchemyTransport } from "@account-kit/infra";
3
3
  import { type Address, type Chain, type Prettify } from "viem";
4
4
  import type { InnerWalletApiClientBase } from "../types.ts";
5
5
  import { type SmartWalletActions } from "./decorator.js";
6
+ import type { ToWebAuthnAccountParameters } from "viem/account-abstraction";
7
+ export type WebAuthnSigner = {
8
+ credential: ToWebAuthnAccountParameters["credential"];
9
+ getFn?: ToWebAuthnAccountParameters["getFn"] | undefined;
10
+ rpId?: ToWebAuthnAccountParameters["rpId"] | undefined;
11
+ };
12
+ export type SmartWalletSigner = SmartAccountSigner<any> | WebAuthnSigner;
6
13
  export type SmartWalletClientParams<TAccount extends Address | undefined = Address | undefined> = Prettify<{
7
14
  transport: AlchemyTransport;
8
15
  chain: Chain;
9
- signer: SmartAccountSigner;
16
+ signer: SmartWalletSigner;
10
17
  account?: TAccount | Address | undefined;
11
18
  } & ({
12
19
  policyId?: string;
@@ -22,7 +29,7 @@ export type SmartWalletClient<TAccount extends Address | undefined = Address | u
22
29
  * @param {SmartWalletClientParams} params - The parameters for creating the smart wallet client
23
30
  * @param {AlchemyTransport} params.transport - The Alchemy transport to use
24
31
  * @param {Chain} params.chain - The chain to use
25
- * @param {SmartAccountSigner} params.signer - The signer to use for the smart account
32
+ * @param {SmartAccountSigner | WebAuthnSigner} params.signer - The signer to use for the smart account
26
33
  * @param {string} [params.policyId] - The policy ID for gas sponsorship (optional)
27
34
  * @param {Address} [params.account] - The smart account address to use (optional)
28
35
  * @returns {SmartWalletClient} - A viem-compatible client
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../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AS,GAAG,OAAO,GAAG,SAAS,IACxD,wBAAwB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAChD,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,10 +1,11 @@
1
- import type { SmartAccountSigner, SmartContractAccount } from "@aa-sdk/core";
1
+ import { type SmartContractAccount } from "@aa-sdk/core";
2
2
  import { type Chain, type Transport, type Address } from "viem";
3
3
  import type { SerializedInitcode } from "@alchemy/wallet-api-types";
4
+ import type { SmartWalletSigner } from "../client/index.js";
4
5
  type CreateAccountParams = {
5
6
  chain: Chain;
6
7
  transport: Transport;
7
- signer: SmartAccountSigner;
8
+ signer: SmartWalletSigner;
8
9
  accountAddress: Address;
9
10
  counterfactualInfo?: SerializedInitcode;
10
11
  delegation?: Address;
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/internal/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAO7E,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,OAAO,EAEb,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAKpE,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,oBAAoB,CAAC,CAkF/B"}
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/internal/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAOtB,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,OAAO,EAEb,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAIpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,oBAAoB,CAAC,CA+G/B"}
@@ -1,4 +1,8 @@
1
1
  import { type Hex } from "viem";
2
+ import type { SmartAccountSigner } from "@aa-sdk/core";
3
+ import type { WebAuthnPublicKey } from "@alchemy/wallet-api-types";
4
+ import type { ToWebAuthnAccountParameters } from "viem/account-abstraction";
5
+ import type { WebAuthnSigner } from "./client";
2
6
  export type Expect<T extends true> = T;
3
7
  export declare const assertNever: (_val: never, msg: string) => never;
4
8
  /**
@@ -15,4 +19,6 @@ export declare const assertNever: (_val: never, msg: string) => never;
15
19
  * ```
16
20
  */
17
21
  export declare const castToHex: (val: string | number | bigint | Hex) => Hex;
22
+ export declare function isWebAuthnSigner(signer: SmartAccountSigner | WebAuthnSigner): signer is WebAuthnSigner;
23
+ export declare function credentialToWebAuthnPublicKey(credential: ToWebAuthnAccountParameters["credential"]): WebAuthnPublicKey;
18
24
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAE9C,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;AAEvC,eAAO,MAAM,WAAW,GAAI,MAAM,KAAK,EAAE,KAAK,MAAM,KAAG,KAEtD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,KAAG,GAK/D,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;AAEvC,eAAO,MAAM,WAAW,GAAI,MAAM,KAAK,EAAE,KAAK,MAAM,KAAG,KAEtD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,KAAG,GAK/D,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,GAAG,cAAc,GAC1C,MAAM,IAAI,cAAc,CAE1B;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,2BAA2B,CAAC,YAAY,CAAC,GACpD,iBAAiB,CAUnB"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.76.0";
1
+ export declare const VERSION = "4.77.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@account-kit/wallet-client",
3
- "version": "4.76.0",
3
+ "version": "4.77.1",
4
4
  "description": "Wallet Client for Alchemy Account Kit",
5
5
  "author": "Alchemy",
6
6
  "license": "MIT",
@@ -44,9 +44,9 @@
44
44
  "test:e2e": "bun test ./src/**/*.e2e.test.*"
45
45
  },
46
46
  "dependencies": {
47
- "@aa-sdk/core": "^4.76.0",
48
- "@account-kit/infra": "^4.76.0",
49
- "@account-kit/smart-contracts": "^4.76.0",
47
+ "@aa-sdk/core": "^4.77.1",
48
+ "@account-kit/infra": "^4.77.1",
49
+ "@account-kit/smart-contracts": "^4.77.1",
50
50
  "@alchemy/wallet-api-types": "0.1.0-alpha.18",
51
51
  "deep-equal": "^2.2.3",
52
52
  "ox": "^0.6.12"
@@ -73,5 +73,5 @@
73
73
  "url": "https://github.com/alchemyplatform/aa-sdk/issues"
74
74
  },
75
75
  "homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
76
- "gitHead": "664b587d4ab2c3be0ff244a8a25b172a6d496a78"
76
+ "gitHead": "59bb8fdc3b720c0363a23dea3450504890f598a7"
77
77
  }
@@ -1,4 +1,4 @@
1
- import { AccountNotFoundError, type SmartAccountSigner } from "@aa-sdk/core";
1
+ import { AccountNotFoundError } from "@aa-sdk/core";
2
2
  import {
3
3
  toHex,
4
4
  type Address,
@@ -6,11 +6,14 @@ import {
6
6
  type IsUndefined,
7
7
  type Prettify,
8
8
  concatHex,
9
+ serializeSignature,
9
10
  } from "viem";
10
11
  import type { InnerWalletApiClient } from "../../types.ts";
11
12
  import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
12
13
  import { signSignatureRequest } from "./signSignatureRequest.js";
13
14
  import { metrics } from "../../metrics.js";
15
+ import type { SmartWalletSigner } from "../index.js";
16
+ import { isWebAuthnSigner } from "../../utils.js";
14
17
 
15
18
  type RpcSchema = Extract<
16
19
  WalletServerRpcSchemaType,
@@ -39,7 +42,7 @@ export type GrantPermissionsResult = {
39
42
  * This allows another key to perform operations on behalf of the account.
40
43
  *
41
44
  * @param {InnerWalletApiClient} client - The wallet API client to use for the request
42
- * @param {SmartAccountSigner} signer - The signer of the smart account
45
+ * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer of the smart account
43
46
  * @param {GrantPermissionsParams} params - The parameters for granting permissions
44
47
  * @param {Address} [params.account] - The account address (required if client was not initialized with an account)
45
48
  * @param {number} params.expirySec - Unix timestamp when the permissions expire
@@ -93,7 +96,7 @@ export async function grantPermissions<
93
96
  TAccount extends Address | undefined = Address | undefined,
94
97
  >(
95
98
  client: InnerWalletApiClient,
96
- signer: SmartAccountSigner,
99
+ signer: SmartWalletSigner,
97
100
  params: GrantPermissionsParams<TAccount>,
98
101
  ): Promise<GrantPermissionsResult> {
99
102
  metrics.trackEvent({
@@ -105,6 +108,12 @@ export async function grantPermissions<
105
108
  throw new AccountNotFoundError();
106
109
  }
107
110
 
111
+ if (isWebAuthnSigner(signer)) {
112
+ throw new Error(
113
+ "WebAuthn signer is not currently supported for grantPermissions",
114
+ );
115
+ }
116
+
108
117
  const { sessionId, signatureRequest } = await client.request({
109
118
  method: "wallet_createSession",
110
119
  params: [
@@ -118,11 +127,31 @@ export async function grantPermissions<
118
127
 
119
128
  const signature = await signSignatureRequest(signer, signatureRequest);
120
129
 
130
+ let signatureHex: Hex;
131
+ if (typeof signature.data === "string") {
132
+ signatureHex = signature.data;
133
+ } else {
134
+ const sigData = signature.data;
135
+ if ("yParity" in sigData) {
136
+ signatureHex = serializeSignature({
137
+ r: sigData.r,
138
+ s: sigData.s,
139
+ yParity: Number(sigData.yParity),
140
+ });
141
+ } else {
142
+ signatureHex = serializeSignature({
143
+ r: sigData.r,
144
+ s: sigData.s,
145
+ v: BigInt(sigData.v),
146
+ });
147
+ }
148
+ }
149
+
121
150
  return {
122
151
  context: concatHex([
123
152
  "0x00", // remote mode
124
153
  sessionId,
125
- signature.data,
154
+ signatureHex,
126
155
  ]),
127
156
  };
128
157
  }
@@ -1,8 +1,13 @@
1
1
  import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
2
2
  import type { InnerWalletApiClient } from "../../types.ts";
3
- import type { SmartAccountSigner } from "@aa-sdk/core";
4
3
  import type { Address } from "viem";
5
4
  import { metrics } from "../../metrics.js";
5
+ import type { SmartWalletSigner } from "../index.js";
6
+ import type { WebAuthnPublicKey } from "@alchemy/wallet-api-types";
7
+ import {
8
+ credentialToWebAuthnPublicKey,
9
+ isWebAuthnSigner,
10
+ } from "../../utils.js";
6
11
 
7
12
  type RpcSchema = Extract<
8
13
  WalletServerRpcSchemaType,
@@ -15,8 +20,9 @@ type RpcSchema = Extract<
15
20
 
16
21
  export type ListAccountsParams = Omit<
17
22
  RpcSchema["Request"]["params"][0],
18
- "signerAddress"
19
- > & { signerAddress?: Address };
23
+ "signerAddress" | "signerPublicKey"
24
+ > &
25
+ ({ signerAddress: Address } | { signerPublicKey: WebAuthnPublicKey } | {});
20
26
 
21
27
  export type ListAccountsResult = RpcSchema["ReturnType"];
22
28
 
@@ -24,9 +30,10 @@ export type ListAccountsResult = RpcSchema["ReturnType"];
24
30
  * Lists all smart accounts for a given signer using the wallet API client.
25
31
  *
26
32
  * @param {InnerWalletApiClient} client - The wallet API client to use for the request
27
- * @param {SmartAccountSigner} signer - The signer for which to list accounts
33
+ * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer for which to list accounts
28
34
  * @param {ListAccountsParams} params - Parameters for listing accounts
29
- * @param {string} params.signerAddress - The address of the signer to list accounts for
35
+ * @param {Address} [params.signerAddress] - The address of the signer to list accounts for
36
+ * @param {WebAuthnPublicKey} [params.signerPublicKey] - The public key of the signer to list accounts for
30
37
  * @param {number} [params.limit] - Optional maximum number of accounts to return (default: 100, max: 100)
31
38
  * @param {string} [params.after] - Optional pagination cursor for fetching subsequent pages
32
39
  * @returns {Promise<ListAccountsResult>} A Promise that resolves to the list of accounts and pagination metadata
@@ -49,21 +56,44 @@ export type ListAccountsResult = RpcSchema["ReturnType"];
49
56
  */
50
57
  export async function listAccounts(
51
58
  client: InnerWalletApiClient,
52
- signer: SmartAccountSigner,
59
+ signer: SmartWalletSigner,
53
60
  params: ListAccountsParams,
54
61
  ): Promise<ListAccountsResult> {
55
62
  metrics.trackEvent({
56
63
  name: "list_accounts",
57
64
  });
58
65
 
59
- const signerAddress = params.signerAddress ?? (await signer.getAddress());
66
+ // Coalesce:
67
+ // signerAddress or signerPublicKey in params takes priority
68
+ // if not present, then fallback to client's attached signer
69
+
70
+ const signerArg =
71
+ "signerAddress" in params
72
+ ? { signerAddress: params.signerAddress }
73
+ : "signerPublicKey" in params
74
+ ? {
75
+ signerPublicKey: {
76
+ ...params.signerPublicKey,
77
+ type: "webauthn-p256" as const,
78
+ },
79
+ }
80
+ : isWebAuthnSigner(signer)
81
+ ? {
82
+ signerPublicKey: {
83
+ ...credentialToWebAuthnPublicKey(signer.credential),
84
+ type: "webauthn-p256" as const,
85
+ },
86
+ }
87
+ : ({
88
+ signerAddress: await signer.getAddress(),
89
+ } satisfies RpcSchema["Request"]["params"][0]);
60
90
 
61
91
  return client.request({
62
92
  method: "wallet_listAccounts",
63
93
  params: [
64
94
  {
65
95
  ...params,
66
- signerAddress,
96
+ ...signerArg,
67
97
  },
68
98
  ],
69
99
  });