@account-kit/wallet-client 0.1.0-alpha.3 → 0.1.0-alpha.5

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 (147) hide show
  1. package/dist/esm/capabilities/eip7702Auth.d.ts +4 -0
  2. package/dist/esm/capabilities/eip7702Auth.js +16 -0
  3. package/dist/esm/capabilities/eip7702Auth.js.map +1 -0
  4. package/dist/esm/capabilities/index.d.ts +4 -0
  5. package/dist/esm/capabilities/index.js +2 -0
  6. package/dist/esm/capabilities/index.js.map +1 -1
  7. package/dist/esm/capabilities/permissions/index.d.ts +1 -1
  8. package/dist/esm/capabilities/permissions/mav2.js +1 -0
  9. package/dist/esm/capabilities/permissions/mav2.js.map +1 -1
  10. package/dist/esm/client/actions/getCallsStatus.d.ts +1 -2
  11. package/dist/esm/client/actions/getCallsStatus.js +19 -0
  12. package/dist/esm/client/actions/getCallsStatus.js.map +1 -1
  13. package/dist/esm/client/actions/grantPermissions.d.ts +6 -6
  14. package/dist/esm/client/actions/grantPermissions.js +115 -3
  15. package/dist/esm/client/actions/grantPermissions.js.map +1 -1
  16. package/dist/esm/client/actions/prepareCalls.d.ts +4 -4
  17. package/dist/esm/client/actions/prepareCalls.js +38 -5
  18. package/dist/esm/client/actions/prepareCalls.js.map +1 -1
  19. package/dist/esm/client/actions/requestAccount.d.ts +3 -4
  20. package/dist/esm/client/actions/requestAccount.js +18 -1
  21. package/dist/esm/client/actions/requestAccount.js.map +1 -1
  22. package/dist/esm/client/actions/signMessage.d.ts +3 -3
  23. package/dist/esm/client/actions/signMessage.js +18 -0
  24. package/dist/esm/client/actions/signMessage.js.map +1 -1
  25. package/dist/esm/client/actions/signSignatureRequest.d.ts +3 -3
  26. package/dist/esm/client/actions/signSignatureRequest.js +2 -2
  27. package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
  28. package/dist/esm/client/actions/signTypedData.d.ts +2 -2
  29. package/dist/esm/client/actions/signTypedData.js +31 -0
  30. package/dist/esm/client/actions/signTypedData.js.map +1 -1
  31. package/dist/esm/client/client.e2e-test.js +19 -19
  32. package/dist/esm/client/client.e2e-test.js.map +1 -1
  33. package/dist/esm/client/decorator.d.ts +4 -4
  34. package/dist/esm/client/decorator.js.map +1 -1
  35. package/dist/esm/client/index.d.ts +36 -10
  36. package/dist/esm/client/index.js +0 -29
  37. package/dist/esm/client/index.js.map +1 -1
  38. package/dist/esm/exports/index.d.ts +2 -2
  39. package/dist/esm/exports/index.js +1 -1
  40. package/dist/esm/exports/index.js.map +1 -1
  41. package/dist/esm/isomorphic/actions/createSession.js +21 -10
  42. package/dist/esm/isomorphic/actions/createSession.js.map +1 -1
  43. package/dist/esm/isomorphic/actions/getCallsStatus.js +62 -9
  44. package/dist/esm/isomorphic/actions/getCallsStatus.js.map +1 -1
  45. package/dist/esm/isomorphic/actions/prepareCalls.js +18 -11
  46. package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -1
  47. package/dist/esm/isomorphic/actions/sendPreparedCalls.js +2 -2
  48. package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -1
  49. package/dist/esm/isomorphic/client.d.ts +1 -1
  50. package/dist/esm/isomorphic/utils/7702.d.ts +9 -3
  51. package/dist/esm/isomorphic/utils/7702.js +35 -8
  52. package/dist/esm/isomorphic/utils/7702.js.map +1 -1
  53. package/dist/esm/isomorphic/utils/createAccount.d.ts +2 -2
  54. package/dist/esm/isomorphic/utils/createAccount.js +4 -3
  55. package/dist/esm/isomorphic/utils/createAccount.js.map +1 -1
  56. package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +2 -2
  57. package/dist/esm/isomorphic/utils/parsePermissionsContext.js +8 -7
  58. package/dist/esm/isomorphic/utils/parsePermissionsContext.js.map +1 -1
  59. package/dist/esm/local/client.d.ts +2 -2
  60. package/dist/esm/local/client.js.map +1 -1
  61. package/dist/esm/remote/client.d.ts +8 -2
  62. package/dist/esm/remote/client.js +1 -7
  63. package/dist/esm/remote/client.js.map +1 -1
  64. package/dist/esm/rpc/request.d.ts +12 -2
  65. package/dist/esm/rpc/request.js +6 -9
  66. package/dist/esm/rpc/request.js.map +1 -1
  67. package/dist/esm/rpc/schema.d.ts +23 -13
  68. package/dist/esm/schemas.d.ts +3 -1
  69. package/dist/esm/schemas.js +6 -4
  70. package/dist/esm/schemas.js.map +1 -1
  71. package/dist/esm/types.d.ts +7 -10
  72. package/dist/esm/types.js.map +1 -1
  73. package/dist/types/capabilities/eip7702Auth.d.ts +5 -0
  74. package/dist/types/capabilities/eip7702Auth.d.ts.map +1 -0
  75. package/dist/types/capabilities/index.d.ts +4 -0
  76. package/dist/types/capabilities/index.d.ts.map +1 -1
  77. package/dist/types/capabilities/permissions/index.d.ts +1 -1
  78. package/dist/types/capabilities/permissions/mav2.d.ts.map +1 -1
  79. package/dist/types/client/actions/getCallsStatus.d.ts +1 -2
  80. package/dist/types/client/actions/getCallsStatus.d.ts.map +1 -1
  81. package/dist/types/client/actions/grantPermissions.d.ts +6 -6
  82. package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
  83. package/dist/types/client/actions/prepareCalls.d.ts +4 -4
  84. package/dist/types/client/actions/prepareCalls.d.ts.map +1 -1
  85. package/dist/types/client/actions/requestAccount.d.ts +3 -4
  86. package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
  87. package/dist/types/client/actions/signMessage.d.ts +3 -3
  88. package/dist/types/client/actions/signMessage.d.ts.map +1 -1
  89. package/dist/types/client/actions/signSignatureRequest.d.ts +3 -3
  90. package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
  91. package/dist/types/client/actions/signTypedData.d.ts +2 -2
  92. package/dist/types/client/actions/signTypedData.d.ts.map +1 -1
  93. package/dist/types/client/decorator.d.ts +4 -4
  94. package/dist/types/client/decorator.d.ts.map +1 -1
  95. package/dist/types/client/index.d.ts +36 -10
  96. package/dist/types/client/index.d.ts.map +1 -1
  97. package/dist/types/exports/index.d.ts +2 -2
  98. package/dist/types/exports/index.d.ts.map +1 -1
  99. package/dist/types/isomorphic/actions/createSession.d.ts.map +1 -1
  100. package/dist/types/isomorphic/actions/getCallsStatus.d.ts.map +1 -1
  101. package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +1 -1
  102. package/dist/types/isomorphic/client.d.ts +1 -1
  103. package/dist/types/isomorphic/utils/7702.d.ts +9 -3
  104. package/dist/types/isomorphic/utils/7702.d.ts.map +1 -1
  105. package/dist/types/isomorphic/utils/createAccount.d.ts +2 -2
  106. package/dist/types/isomorphic/utils/createAccount.d.ts.map +1 -1
  107. package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +2 -2
  108. package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts.map +1 -1
  109. package/dist/types/local/client.d.ts +2 -2
  110. package/dist/types/local/client.d.ts.map +1 -1
  111. package/dist/types/remote/client.d.ts +8 -2
  112. package/dist/types/remote/client.d.ts.map +1 -1
  113. package/dist/types/rpc/request.d.ts +12 -2
  114. package/dist/types/rpc/request.d.ts.map +1 -1
  115. package/dist/types/rpc/schema.d.ts +23 -13
  116. package/dist/types/rpc/schema.d.ts.map +1 -1
  117. package/dist/types/schemas.d.ts +3 -1
  118. package/dist/types/schemas.d.ts.map +1 -1
  119. package/dist/types/types.d.ts +7 -10
  120. package/dist/types/types.d.ts.map +1 -1
  121. package/package.json +2 -2
  122. package/src/capabilities/eip7702Auth.ts +19 -0
  123. package/src/capabilities/index.ts +2 -0
  124. package/src/capabilities/permissions/mav2.ts +1 -0
  125. package/src/client/actions/getCallsStatus.ts +0 -10
  126. package/src/client/actions/grantPermissions.ts +12 -25
  127. package/src/client/actions/prepareCalls.ts +18 -23
  128. package/src/client/actions/requestAccount.ts +9 -26
  129. package/src/client/actions/signMessage.ts +2 -17
  130. package/src/client/actions/signSignatureRequest.ts +5 -5
  131. package/src/client/actions/signTypedData.ts +1 -16
  132. package/src/client/client.e2e-test.ts +22 -22
  133. package/src/client/decorator.ts +5 -10
  134. package/src/client/index.ts +20 -41
  135. package/src/exports/index.ts +2 -1
  136. package/src/isomorphic/actions/createSession.ts +29 -10
  137. package/src/isomorphic/actions/getCallsStatus.ts +82 -10
  138. package/src/isomorphic/actions/prepareCalls.ts +19 -11
  139. package/src/isomorphic/actions/sendPreparedCalls.ts +2 -2
  140. package/src/isomorphic/utils/7702.ts +61 -13
  141. package/src/isomorphic/utils/createAccount.ts +5 -5
  142. package/src/isomorphic/utils/parsePermissionsContext.ts +9 -9
  143. package/src/local/client.ts +3 -5
  144. package/src/remote/client.ts +5 -13
  145. package/src/rpc/request.ts +8 -9
  146. package/src/schemas.ts +8 -4
  147. package/src/types.ts +5 -21
@@ -34,6 +34,10 @@ export declare const WalletServerRpcSchema: {
34
34
  multiplier: number;
35
35
  } | undefined;
36
36
  } | undefined;
37
+ eip7702Auth?: true | {
38
+ account?: `0x${string}` | undefined;
39
+ delegation: "ModularAccountV2" | "0x69007702764179f14F51cdce752f4f775d74E139";
40
+ } | undefined;
37
41
  } | undefined;
38
42
  chainId: `0x${string}`;
39
43
  calls: {
@@ -46,7 +50,7 @@ export declare const WalletServerRpcSchema: {
46
50
  method: "wallet_prepareCalls";
47
51
  };
48
52
  ReturnType: {
49
- type: "user-operation-v070" | "user-operation-v060";
53
+ type: "user-operation-v060" | "user-operation-v070";
50
54
  chainId: `0x${string}`;
51
55
  data: {
52
56
  sender: `0x${string}`;
@@ -112,14 +116,6 @@ export declare const WalletServerRpcSchema: {
112
116
  } | {
113
117
  Request: {
114
118
  params: [{
115
- signedAuthorization?: {
116
- nonce: `0x${string}`;
117
- chainId: `0x${string}`;
118
- address: `0x${string}`;
119
- r: `0x${string}`;
120
- s: `0x${string}`;
121
- yParity: `0x${string}`;
122
- } | undefined;
123
119
  capabilities?: {
124
120
  permissions?: {
125
121
  context: `0x${string}`;
@@ -128,9 +124,17 @@ export declare const WalletServerRpcSchema: {
128
124
  sessionId: `0x${string}`;
129
125
  } | undefined;
130
126
  } | undefined;
131
- type: "user-operation-v070" | "user-operation-v060";
127
+ signedAuthorization?: {
128
+ nonce: `0x${string}`;
129
+ chainId: `0x${string}`;
130
+ address: `0x${string}`;
131
+ r: `0x${string}`;
132
+ s: `0x${string}`;
133
+ yParity: `0x${string}`;
134
+ } | undefined;
135
+ type: "user-operation-v060" | "user-operation-v070";
132
136
  signature: {
133
- type: "ecdsa";
137
+ type: "secp256k1" | "ecdsa";
134
138
  signature: `0x${string}`;
135
139
  };
136
140
  chainId: `0x${string}`;
@@ -204,12 +208,12 @@ export declare const WalletServerRpcSchema: {
204
208
  method: "wallet_requestAccount";
205
209
  };
206
210
  ReturnType: {
211
+ delegation?: `0x${string}` | undefined;
207
212
  counterfactualInfo?: {
208
213
  factoryData: `0x${string}`;
209
214
  factoryAddress: `0x${string}`;
210
215
  factoryType: "unknown" | "LightAccountV2.0.0" | "LightAccountV1.1.0" | "LightAccountV1.0.2" | "LightAccountV1.0.1" | "MAv1.0.0-MultiOwner" | "LightAccountV2.0.0-MultiOwner" | "MAv1.0.0-MultiSig" | "MAv2.0.0-sma-b" | "MAv2.0.0-ma-ssv" | "MAv2.0.0-ma-webauthn";
211
216
  } | undefined;
212
- delegation?: `0x${string}` | undefined;
213
217
  accountAddress: `0x${string}`;
214
218
  id: string;
215
219
  };
@@ -238,7 +242,7 @@ export declare const WalletServerRpcSchema: {
238
242
  expiry?: number | undefined;
239
243
  chainId: `0x${string}`;
240
244
  key: {
241
- type: "secp256k1" | "contract";
245
+ type: "secp256k1" | "ecdsa" | "contract";
242
246
  publicKey: `0x${string}`;
243
247
  };
244
248
  permissions: ({
@@ -283,6 +287,12 @@ export declare const WalletServerRpcSchema: {
283
287
  type: "root";
284
288
  })[];
285
289
  } & {
290
+ capabilities?: {
291
+ eip7702Auth?: true | {
292
+ account?: `0x${string}` | undefined;
293
+ delegation: "ModularAccountV2" | "0x69007702764179f14F51cdce752f4f775d74E139";
294
+ } | undefined;
295
+ } | undefined;
286
296
  account: `0x${string}`;
287
297
  }];
288
298
  method: "wallet_createSession";
@@ -1 +1 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qBAAqB,CAAC,qBAAqB,CAAC;IAC5C,qBAAqB,CAAC,0BAA0B,CAAC;IACjD,qBAAqB,CAAC,uBAAuB,CAAC;IAC9C,qBAAqB,CAAC,sBAAsB,CAAC;CAC9C,CAAC"}
@@ -147,8 +147,10 @@ export declare const TypeCreationOptions: import("@sinclair/typebox").TOptional<
147
147
  }>]>>;
148
148
  export type TypeCreationOptions = Static<typeof TypeCreationOptions>;
149
149
  export type TypeAccountType = Exclude<Static<typeof TypeCreationOptions>, undefined>["accountType"];
150
+ export declare const TypeSignatureType: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"secp256k1">, import("@sinclair/typebox").TLiteral<"ecdsa">, import("@sinclair/typebox").TLiteral<"contract">]>;
151
+ export type TypeSignatureType = Static<typeof TypeSignatureType>;
150
152
  export declare const KeySigner: import("@sinclair/typebox").TObject<{
151
- type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"secp256k1">, import("@sinclair/typebox").TLiteral<"contract">]>;
153
+ type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"secp256k1">, import("@sinclair/typebox").TLiteral<"ecdsa">, import("@sinclair/typebox").TLiteral<"contract">]>;
152
154
  publicKey: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
153
155
  }>;
154
156
  export type KeySigner = Static<typeof KeySigner>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAU3B,eAAO,MAAM,OAAO,GAAI,UAAU,aAAa,sEAG3C,CAAC;AAEL,eAAO,MAAM,WAAW,mEAA0C,CAAC;AAEnE,eAAO,MAAM,QAAQ,qCAEnB,CAAC;AAEH,eAAO,MAAM,0BAA0B,qCAErC,CAAC;AAGH,eAAO,MAAM,QAAQ,qFAEa,CAAC;AAEnC,eA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AG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAEjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4C7B,CAAC;AA4BL,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK/B,CAAC;AAEH,eAAO,MAAM,UAAU;;;EAUnB,CAAC"}
@@ -1,23 +1,20 @@
1
1
  import type { SmartAccountSigner, SmartContractAccount } from "@aa-sdk/core";
2
2
  import type { AlchemyTransport } from "@account-kit/infra";
3
- import type { Address, Chain, Client, Hex, IsUndefined, JsonRpcAccount, Transport } from "viem";
3
+ import type { Address, Chain, Client, Hex, JsonRpcAccount, Transport } from "viem";
4
4
  import type { GrantPermissionsParams, GrantPermissionsResult } from "./client/actions/grantPermissions.ts";
5
5
  import type { RequestAccountParams } from "./client/actions/requestAccount.ts";
6
6
  import type { WalletServerViemRpcSchema } from "./rpc/schema.ts";
7
- export type CreateInnerClientParams<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = {
7
+ export type CreateInnerClientParams<TAccount extends Address | undefined = Address | undefined> = {
8
8
  chain: Chain;
9
9
  transport: AlchemyTransport;
10
10
  policyId?: string;
11
- } & (IsUndefined<TAccount> extends true ? {
12
- account?: never;
13
- } : {
14
- account: Address;
15
- });
16
- export type InnerWalletApiClientBase<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined, TExtend extends {
11
+ account?: TAccount | Address | undefined;
12
+ };
13
+ export type InnerWalletApiClientBase<TExtend extends {
17
14
  [key: string]: unknown;
18
15
  } | undefined = {
19
16
  [key: string]: unknown;
20
- } | undefined> = Client<Transport, Chain, TAccount, WalletServerViemRpcSchema, {
17
+ } | undefined> = Client<Transport, Chain, JsonRpcAccount<Address> | undefined, WalletServerViemRpcSchema, {
21
18
  policyId?: string;
22
19
  } & TExtend>;
23
20
  export type InnerClientActions = {
@@ -33,7 +30,7 @@ export type InternalState = {
33
30
  setAccount: (account: CachedAccount) => void;
34
31
  getAccount: () => CachedAccount | undefined;
35
32
  };
36
- export type InnerWalletApiClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = InnerWalletApiClientBase<TAccount, InnerClientActions & {
33
+ export type InnerWalletApiClient = InnerWalletApiClientBase<InnerClientActions & {
37
34
  internal: InternalState;
38
35
  }>;
39
36
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,MAAM,EACN,GAAG,EACH,WAAW,EACX,cAAc,EACd,SAAS,EACV,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,MAAM,uBAAuB,CACjC,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,IACX;IACF,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GACnC;IACE,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,GACD;IACE,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEP,MAAM,MAAM,wBAAwB,CAClC,QA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AoB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,UAAU,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CACzD,kBAAkB,GAAG;IAAE,QAAQ,EAAE,aAAa,CAAA;CAAE,CACjD,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@account-kit/wallet-client",
3
3
  "private": false,
4
4
  "type": "module",
5
- "version": "0.1.0-alpha.3",
5
+ "version": "0.1.0-alpha.5",
6
6
  "main": "./dist/esm/exports/index.js",
7
7
  "module": "./dist/esm/exports/index.js",
8
8
  "types": "./dist/types/exports/index.d.ts",
@@ -70,5 +70,5 @@
70
70
  "access": "public",
71
71
  "registry": "https://registry.npmjs.org/"
72
72
  },
73
- "gitHead": "017c20b3777d96b1b4ab6f01385725aa2689416a"
73
+ "gitHead": "4323e2956bec73ebfc890ce40803b09bb0372d4a"
74
74
  }
@@ -0,0 +1,19 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { TypeAddress } from "../schemas.js";
3
+ import {
4
+ EIP_7702_ACCOUNT_TYPE,
5
+ SUPPORTED_DELEGATION_ADDRESSES,
6
+ } from "../isomorphic/utils/7702.js";
7
+
8
+ export const Eip7702AuthCapability = Type.Union([
9
+ Type.Object({
10
+ account: Type.Optional(TypeAddress),
11
+ // Wallet applications must maintain a strict shortlist of well-known accounts.
12
+ // https://github.com/ethereum/ERCs/pull/947/files#diff-dab085f963ca621595044bcbc0922705aa38b69f5bf8770dcb3d0496a633efcfR189
13
+ delegation: Type.Union([
14
+ ...SUPPORTED_DELEGATION_ADDRESSES.map((address) => Type.Literal(address)),
15
+ ...EIP_7702_ACCOUNT_TYPE.map((it) => Type.Literal(it)),
16
+ ]),
17
+ }),
18
+ Type.Literal(true),
19
+ ]);
@@ -2,9 +2,11 @@ import { Type } from "@sinclair/typebox";
2
2
  import { GasParamsOverrideCapability } from "./overrides.js";
3
3
  import { PaymasterCapability } from "./paymaster.js";
4
4
  import { PermissionsCapability } from "./permissions/index.js";
5
+ import { Eip7702AuthCapability } from "./eip7702Auth.js";
5
6
 
6
7
  export const Capabilities = Type.Object({
7
8
  permissions: Type.Optional(PermissionsCapability),
8
9
  paymasterService: Type.Optional(PaymasterCapability),
9
10
  gasParamsOverride: Type.Optional(GasParamsOverrideCapability),
11
+ eip7702Auth: Type.Optional(Eip7702AuthCapability),
10
12
  });
@@ -121,6 +121,7 @@ export const prefixSignatureKeyType = (
121
121
  type: KeySigner["type"],
122
122
  ): Hex => {
123
123
  switch (type) {
124
+ case "ecdsa":
124
125
  case "secp256k1":
125
126
  return concatHex(["0x00", sig]);
126
127
  case "contract":
@@ -1,4 +1,3 @@
1
- import type { Address, JsonRpcAccount } from "viem";
2
1
  import type {
3
2
  GetCallsStatusParams as IsomorphicGetCallsStatusParams,
4
3
  GetCallsStatusResponse as IsomorphicGetCallsStatusResult,
@@ -28,15 +27,6 @@ export type GetCallsStatusResult = IsomorphicGetCallsStatusResult;
28
27
  * // Check the status of the first call ID
29
28
  * const status = await client.getCallsStatus(sendResult.preparedCallIds[0]);
30
29
  */
31
- export async function getCallsStatus<
32
- TAccount extends JsonRpcAccount<Address> | undefined =
33
- | JsonRpcAccount<Address>
34
- | undefined,
35
- >(
36
- client: InnerWalletApiClient<TAccount>,
37
- params: GetCallsStatusParams,
38
- ): Promise<GetCallsStatusResult>;
39
-
40
30
  export async function getCallsStatus(
41
31
  client: InnerWalletApiClient,
42
32
  params: GetCallsStatusParams,
@@ -1,20 +1,12 @@
1
- import {
2
- type Address,
3
- type Hex,
4
- type IsUndefined,
5
- type JsonRpcAccount,
6
- toHex,
7
- } from "viem";
8
- import type { InnerWalletApiClient } from "../../types.ts";
9
- import type { SmartAccountSigner } from "@aa-sdk/core";
1
+ import { AccountNotFoundError, type SmartAccountSigner } from "@aa-sdk/core";
2
+ import type { Static } from "@sinclair/typebox";
3
+ import { type Address, type Hex, type IsUndefined, toHex } from "viem";
10
4
  import type { CreateSessionParams } from "../../isomorphic/actions/createSession.ts";
11
5
  import { TypeEip7702AuthExtendedFields } from "../../schemas.js";
12
- import type { Static } from "@sinclair/typebox";
6
+ import type { InnerWalletApiClient } from "../../types.ts";
13
7
 
14
8
  export type GrantPermissionsParams<
15
- TAccount extends JsonRpcAccount<Address> | undefined =
16
- | JsonRpcAccount<Address>
17
- | undefined,
9
+ TAccount extends Address | undefined = Address | undefined,
18
10
  > = Omit<CreateSessionParams, "account" | "chainId"> &
19
11
  (IsUndefined<TAccount> extends true
20
12
  ? { account: Address }
@@ -135,26 +127,21 @@ export type GrantPermissionsResult = {
135
127
  * });
136
128
  */
137
129
  export async function grantPermissions<
138
- TAccount extends JsonRpcAccount<Address> | undefined =
139
- | JsonRpcAccount<Address>
140
- | undefined,
130
+ TAccount extends Address | undefined = Address | undefined,
141
131
  >(
142
- client: InnerWalletApiClient<TAccount>,
143
- signer: SmartAccountSigner,
144
- params: GrantPermissionsParams<TAccount>,
145
- ): Promise<GrantPermissionsResult>;
146
-
147
- export async function grantPermissions(
148
132
  client: InnerWalletApiClient,
149
133
  signer: SmartAccountSigner,
150
- params: GrantPermissionsParams,
134
+ params: GrantPermissionsParams<TAccount>,
151
135
  ): Promise<GrantPermissionsResult> {
152
- if (client.account && !params.account) {
153
- params.account = client.account.address;
136
+ const account = params.account ?? client.account?.address;
137
+
138
+ if (!account) {
139
+ throw new AccountNotFoundError();
154
140
  }
155
141
 
156
142
  return client.grantPermissions(signer, {
157
143
  ...params,
144
+ account,
158
145
  chainId: toHex(client.chain.id),
159
146
  });
160
147
  }
@@ -1,9 +1,5 @@
1
- import {
2
- toHex,
3
- type Address,
4
- type IsUndefined,
5
- type JsonRpcAccount,
6
- } from "viem";
1
+ import { AccountNotFoundError } from "@aa-sdk/core";
2
+ import { toHex, type Address, type IsUndefined } from "viem";
7
3
  import type {
8
4
  PrepareCallsParams as IsomorphicPrepareCallsParams,
9
5
  PrepareCallsResult as IsomorphicPrepareCallsResult,
@@ -13,12 +9,10 @@ import type { InnerWalletApiClient } from "../../types.ts";
13
9
  export type GetAccountParam<TAccount> =
14
10
  IsUndefined<TAccount> extends true
15
11
  ? { account: Address }
16
- : { account?: never };
12
+ : { account?: Address };
17
13
 
18
14
  export type PrepareCallsParams<
19
- TAccount extends JsonRpcAccount<Address> | undefined =
20
- | JsonRpcAccount<Address>
21
- | undefined,
15
+ TAccount extends Address | undefined = Address | undefined,
22
16
  > = Omit<IsomorphicPrepareCallsParams, "from" | "chainId"> &
23
17
  (IsUndefined<TAccount> extends true ? { from: Address } : { from?: never });
24
18
 
@@ -51,18 +45,17 @@ export type PrepareCallsResult = IsomorphicPrepareCallsResult;
51
45
  * });
52
46
  */
53
47
  export async function prepareCalls<
54
- TAccount extends JsonRpcAccount<Address> | undefined =
55
- | JsonRpcAccount<Address>
56
- | undefined,
48
+ TAccount extends Address | undefined = Address | undefined,
57
49
  >(
58
- client: InnerWalletApiClient<TAccount>,
59
- params: PrepareCallsParams<TAccount>,
60
- ): Promise<PrepareCallsResult>;
61
-
62
- export async function prepareCalls(
63
50
  client: InnerWalletApiClient,
64
- params: PrepareCallsParams,
51
+ params: PrepareCallsParams<TAccount>,
65
52
  ): Promise<PrepareCallsResult> {
53
+ const from = params.from ?? client.account?.address;
54
+
55
+ if (!from) {
56
+ throw new AccountNotFoundError();
57
+ }
58
+
66
59
  if (client.policyId && !params.capabilities?.paymasterService) {
67
60
  params.capabilities = {
68
61
  ...params.capabilities,
@@ -70,12 +63,14 @@ export async function prepareCalls(
70
63
  };
71
64
  }
72
65
 
73
- if (client.account && !params.from) {
74
- params.from = client.account.address;
75
- }
66
+ const params_ = {
67
+ ...params,
68
+ chainId: toHex(client.chain.id),
69
+ from,
70
+ };
76
71
 
77
72
  return await client.request({
78
73
  method: "wallet_prepareCalls",
79
- params: [{ ...params, chainId: toHex(client.chain.id) }],
74
+ params: [params_],
80
75
  });
81
76
  }
@@ -5,27 +5,20 @@ import {
5
5
  import type { Static } from "@sinclair/typebox";
6
6
  import { Value } from "@sinclair/typebox/value";
7
7
  import type { Address } from "abitype";
8
- import { custom, type IsUndefined, type JsonRpcAccount } from "viem";
8
+ import deepEqual from "deep-equal";
9
+ import { custom } from "viem";
9
10
  import { createAccount } from "../../isomorphic/utils/createAccount.js";
10
11
  import type { wallet_requestAccount } from "../../rpc/request.js";
11
12
  import { TypeSerializedInitcode } from "../../schemas.js";
12
13
  import type { InnerWalletApiClient } from "../../types.js";
13
- import deepEqual from "deep-equal";
14
14
 
15
- export type RequestAccountParams<
16
- TAccount extends JsonRpcAccount<Address> | undefined =
17
- | JsonRpcAccount<Address>
18
- | undefined,
19
- > =
20
- IsUndefined<TAccount> extends true
21
- ? Omit<
22
- Extract<
23
- Static<typeof wallet_requestAccount>["Request"]["params"][0],
24
- { signerAddress: Address }
25
- >,
26
- "signerAddress" | "includeCounterfactualInfo"
27
- > & { accountAddress?: Address }
28
- : never;
15
+ export type RequestAccountParams = Omit<
16
+ Extract<
17
+ Static<typeof wallet_requestAccount>["Request"]["params"][0],
18
+ { signerAddress: Address }
19
+ >,
20
+ "signerAddress" | "includeCounterfactualInfo"
21
+ > & { accountAddress?: Address };
29
22
 
30
23
  export type RequestAccountResult = SmartContractAccount;
31
24
 
@@ -46,16 +39,6 @@ export type RequestAccountResult = SmartContractAccount;
46
39
  * const signer = LocalAccountSigner.privateKeyToAccountSigner("0x...");
47
40
  * const account = await client.requestAccount(signer);
48
41
  */
49
- export function requestAccount<
50
- TAccount extends JsonRpcAccount<Address> | undefined =
51
- | JsonRpcAccount<Address>
52
- | undefined,
53
- >(
54
- client: InnerWalletApiClient<TAccount>,
55
- signer: SmartAccountSigner,
56
- params?: RequestAccountParams<TAccount>,
57
- ): Promise<RequestAccountResult>;
58
-
59
42
  export async function requestAccount(
60
43
  client: InnerWalletApiClient,
61
44
  signer: SmartAccountSigner,
@@ -1,10 +1,5 @@
1
- import type { SmartAccountSigner } from "@aa-sdk/core";
2
- import {
3
- type Address,
4
- type Hex,
5
- type JsonRpcAccount,
6
- type SignableMessage,
7
- } from "viem";
1
+ import { type SmartAccountSigner } from "@aa-sdk/core";
2
+ import { type Address, type Hex, type SignableMessage } from "viem";
8
3
  import type { InnerWalletApiClient } from "../../types.ts";
9
4
  import { requestAccount } from "./requestAccount.js";
10
5
 
@@ -29,16 +24,6 @@ export type SignMessageResult = Hex;
29
24
  * // Sign a raw hex message
30
25
  * const signature = await client.signMessage({ raw: "0x48656c6c6f2c20776f726c6421" });
31
26
  */
32
- export async function signMessage<
33
- TAccount extends JsonRpcAccount<Address> | undefined =
34
- | JsonRpcAccount<Address>
35
- | undefined,
36
- >(
37
- client: InnerWalletApiClient<TAccount>,
38
- signer: SmartAccountSigner,
39
- params: SignMessageParams,
40
- ): Promise<SignMessageResult>;
41
-
42
27
  export async function signMessage(
43
28
  client: InnerWalletApiClient,
44
29
  signer: SmartAccountSigner,
@@ -1,14 +1,14 @@
1
1
  import type { SmartAccountSigner } from "@aa-sdk/core";
2
2
  import type { Static } from "@sinclair/typebox";
3
3
  import { type Hex, toHex } from "viem";
4
- import { TypeSignatureRequest } from "../../schemas.js";
4
+ import { TypeSignatureRequest, type TypeSignatureType } from "../../schemas.js";
5
5
  import { assertNever } from "../../utils.js";
6
6
  import type { Eip7702ExtendedFields } from "@aa-sdk/core";
7
7
 
8
8
  export type SignSignatureRequestParams = Static<typeof TypeSignatureRequest>;
9
9
 
10
10
  export type SignSignatureRequestResult = {
11
- type: "ecdsa";
11
+ type: Exclude<TypeSignatureType, "contract">; // TODO: Add support for identifying contract signatures
12
12
  signature: Hex;
13
13
  signedAuthorization?: Eip7702ExtendedFields["eip7702Auth"];
14
14
  };
@@ -22,7 +22,7 @@ export type SignSignatureRequestResult = {
22
22
  * @param {string} params.type - The type of signature request ('personal_sign', 'eth_signTypedData_v4', or 'signature_with_authorization')
23
23
  * @param {any} params.data - The data to sign, format depends on the signature type
24
24
  * @returns {Promise<SignSignatureRequestResult>} A Promise that resolves to the signature result
25
- * @returns {string} result.type - The signature type (currently only 'ecdsa' is supported)
25
+ * @returns {string} result.type - The signature type (currently only 'secp256k1' is supported)
26
26
  * @returns {Hex} result.signature - The hex-encoded signature
27
27
  * @returns {Eip7702ExtendedFields["eip7702Auth"]} result.signedAuthorization - The signed EIP-7702 authorization, if applicable
28
28
  *
@@ -63,7 +63,7 @@ export async function signSignatureRequest(
63
63
 
64
64
  if (!params.authorizationRequest) {
65
65
  return {
66
- type: "ecdsa" as const,
66
+ type: "secp256k1" as const,
67
67
  signature,
68
68
  };
69
69
  }
@@ -86,7 +86,7 @@ export async function signSignatureRequest(
86
86
  };
87
87
 
88
88
  return {
89
- type: "ecdsa" as const,
89
+ type: "secp256k1" as const,
90
90
  signature,
91
91
  signedAuthorization,
92
92
  };
@@ -1,10 +1,5 @@
1
1
  import type { SmartAccountSigner } from "@aa-sdk/core";
2
- import {
3
- type Address,
4
- type Hex,
5
- type JsonRpcAccount,
6
- type TypedDataDefinition,
7
- } from "viem";
2
+ import { type Address, type Hex, type TypedDataDefinition } from "viem";
8
3
  import type { InnerWalletApiClient } from "../../types.ts";
9
4
  import { requestAccount } from "./requestAccount.js";
10
5
 
@@ -45,16 +40,6 @@ export type SignTypedDataResult = Hex;
45
40
  * }
46
41
  * });
47
42
  */
48
- export async function signTypedData<
49
- TAccount extends JsonRpcAccount<Address> | undefined =
50
- | JsonRpcAccount<Address>
51
- | undefined,
52
- >(
53
- client: InnerWalletApiClient<TAccount>,
54
- signer: SmartAccountSigner,
55
- params: SignTypedDataParams,
56
- ): Promise<SignTypedDataResult>;
57
-
58
43
  export async function signTypedData(
59
44
  client: InnerWalletApiClient,
60
45
  signer: SmartAccountSigner,