@account-kit/wallet-client 0.1.0-alpha.11 → 0.1.0-alpha.13

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 (141) hide show
  1. package/dist/esm/client/actions/getCallsStatus.d.ts +4 -3
  2. package/dist/esm/client/actions/getCallsStatus.js +1 -0
  3. package/dist/esm/client/actions/getCallsStatus.js.map +1 -1
  4. package/dist/esm/client/actions/grantPermissions.d.ts +5 -4
  5. package/dist/esm/client/actions/grantPermissions.js +21 -5
  6. package/dist/esm/client/actions/grantPermissions.js.map +1 -1
  7. package/dist/esm/client/actions/prepareCalls.d.ts +4 -3
  8. package/dist/esm/client/actions/prepareCalls.js +3 -2
  9. package/dist/esm/client/actions/prepareCalls.js.map +1 -1
  10. package/dist/esm/client/actions/prepareSign.d.ts +4 -3
  11. package/dist/esm/client/actions/prepareSign.js +1 -0
  12. package/dist/esm/client/actions/prepareSign.js.map +1 -1
  13. package/dist/esm/client/actions/requestAccount.js +1 -1
  14. package/dist/esm/client/actions/requestAccount.js.map +1 -1
  15. package/dist/esm/client/client.e2e-test.js +171 -349
  16. package/dist/esm/client/client.e2e-test.js.map +1 -1
  17. package/dist/esm/client/index.d.ts +8 -6
  18. package/dist/esm/client/index.js +18 -18
  19. package/dist/esm/client/index.js.map +1 -1
  20. package/dist/esm/{isomorphic/utils/createAccount.d.ts → internal/account.d.ts} +1 -5
  21. package/dist/esm/{isomorphic/utils/createAccount.js → internal/account.js} +8 -32
  22. package/dist/esm/internal/account.js.map +1 -0
  23. package/dist/esm/types.d.ts +4 -10
  24. package/dist/esm/types.js.map +1 -1
  25. package/dist/types/client/actions/getCallsStatus.d.ts +4 -3
  26. package/dist/types/client/actions/getCallsStatus.d.ts.map +1 -1
  27. package/dist/types/client/actions/grantPermissions.d.ts +5 -4
  28. package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
  29. package/dist/types/client/actions/prepareCalls.d.ts +4 -3
  30. package/dist/types/client/actions/prepareCalls.d.ts.map +1 -1
  31. package/dist/types/client/actions/prepareSign.d.ts +4 -3
  32. package/dist/types/client/actions/prepareSign.d.ts.map +1 -1
  33. package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
  34. package/dist/types/client/index.d.ts +8 -6
  35. package/dist/types/client/index.d.ts.map +1 -1
  36. package/dist/types/{isomorphic/utils/createAccount.d.ts → internal/account.d.ts} +2 -6
  37. package/dist/types/internal/account.d.ts.map +1 -0
  38. package/dist/types/types.d.ts +4 -10
  39. package/dist/types/types.d.ts.map +1 -1
  40. package/package.json +3 -8
  41. package/src/client/actions/getCallsStatus.ts +8 -6
  42. package/src/client/actions/grantPermissions.ts +41 -10
  43. package/src/client/actions/prepareCalls.ts +13 -8
  44. package/src/client/actions/prepareSign.ts +9 -6
  45. package/src/client/actions/requestAccount.ts +1 -1
  46. package/src/client/client.e2e-test.ts +208 -442
  47. package/src/client/index.ts +39 -30
  48. package/src/{isomorphic/utils/createAccount.ts → internal/account.ts} +9 -49
  49. package/src/types.ts +6 -17
  50. package/dist/esm/exports/internal.d.ts +0 -4
  51. package/dist/esm/exports/internal.js +0 -3
  52. package/dist/esm/exports/internal.js.map +0 -1
  53. package/dist/esm/isomorphic/actions/createSession.d.ts +0 -13
  54. package/dist/esm/isomorphic/actions/createSession.js +0 -94
  55. package/dist/esm/isomorphic/actions/createSession.js.map +0 -1
  56. package/dist/esm/isomorphic/actions/formatSign.d.ts +0 -8
  57. package/dist/esm/isomorphic/actions/formatSign.js +0 -42
  58. package/dist/esm/isomorphic/actions/formatSign.js.map +0 -1
  59. package/dist/esm/isomorphic/actions/getCallsStatus.d.ts +0 -7
  60. package/dist/esm/isomorphic/actions/getCallsStatus.js +0 -71
  61. package/dist/esm/isomorphic/actions/getCallsStatus.js.map +0 -1
  62. package/dist/esm/isomorphic/actions/prepareCalls.d.ts +0 -7
  63. package/dist/esm/isomorphic/actions/prepareCalls.js +0 -116
  64. package/dist/esm/isomorphic/actions/prepareCalls.js.map +0 -1
  65. package/dist/esm/isomorphic/actions/prepareSign.d.ts +0 -7
  66. package/dist/esm/isomorphic/actions/prepareSign.js +0 -49
  67. package/dist/esm/isomorphic/actions/prepareSign.js.map +0 -1
  68. package/dist/esm/isomorphic/actions/sendPreparedCalls.d.ts +0 -7
  69. package/dist/esm/isomorphic/actions/sendPreparedCalls.js +0 -183
  70. package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +0 -1
  71. package/dist/esm/isomorphic/client.d.ts +0 -275
  72. package/dist/esm/isomorphic/client.js +0 -41
  73. package/dist/esm/isomorphic/client.js.map +0 -1
  74. package/dist/esm/isomorphic/utils/7702.d.ts +0 -19
  75. package/dist/esm/isomorphic/utils/7702.js +0 -70
  76. package/dist/esm/isomorphic/utils/7702.js.map +0 -1
  77. package/dist/esm/isomorphic/utils/createAccount.js.map +0 -1
  78. package/dist/esm/isomorphic/utils/createDummySigner.d.ts +0 -3
  79. package/dist/esm/isomorphic/utils/createDummySigner.js +0 -17
  80. package/dist/esm/isomorphic/utils/createDummySigner.js.map +0 -1
  81. package/dist/esm/isomorphic/utils/decodeSignature.d.ts +0 -3
  82. package/dist/esm/isomorphic/utils/decodeSignature.js +0 -15
  83. package/dist/esm/isomorphic/utils/decodeSignature.js.map +0 -1
  84. package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +0 -21
  85. package/dist/esm/isomorphic/utils/parsePermissionsContext.js +0 -34
  86. package/dist/esm/isomorphic/utils/parsePermissionsContext.js.map +0 -1
  87. package/dist/esm/isomorphic/utils/supportsFeature.d.ts +0 -4
  88. package/dist/esm/isomorphic/utils/supportsFeature.js +0 -21
  89. package/dist/esm/isomorphic/utils/supportsFeature.js.map +0 -1
  90. package/dist/esm/local/client.d.ts +0 -3
  91. package/dist/esm/local/client.js +0 -97
  92. package/dist/esm/local/client.js.map +0 -1
  93. package/dist/esm/remote/client.d.ts +0 -9
  94. package/dist/esm/remote/client.js +0 -41
  95. package/dist/esm/remote/client.js.map +0 -1
  96. package/dist/types/exports/internal.d.ts +0 -5
  97. package/dist/types/exports/internal.d.ts.map +0 -1
  98. package/dist/types/isomorphic/actions/createSession.d.ts +0 -14
  99. package/dist/types/isomorphic/actions/createSession.d.ts.map +0 -1
  100. package/dist/types/isomorphic/actions/formatSign.d.ts +0 -9
  101. package/dist/types/isomorphic/actions/formatSign.d.ts.map +0 -1
  102. package/dist/types/isomorphic/actions/getCallsStatus.d.ts +0 -8
  103. package/dist/types/isomorphic/actions/getCallsStatus.d.ts.map +0 -1
  104. package/dist/types/isomorphic/actions/prepareCalls.d.ts +0 -8
  105. package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +0 -1
  106. package/dist/types/isomorphic/actions/prepareSign.d.ts +0 -8
  107. package/dist/types/isomorphic/actions/prepareSign.d.ts.map +0 -1
  108. package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts +0 -8
  109. package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +0 -1
  110. package/dist/types/isomorphic/client.d.ts +0 -276
  111. package/dist/types/isomorphic/client.d.ts.map +0 -1
  112. package/dist/types/isomorphic/utils/7702.d.ts +0 -20
  113. package/dist/types/isomorphic/utils/7702.d.ts.map +0 -1
  114. package/dist/types/isomorphic/utils/createAccount.d.ts.map +0 -1
  115. package/dist/types/isomorphic/utils/createDummySigner.d.ts +0 -4
  116. package/dist/types/isomorphic/utils/createDummySigner.d.ts.map +0 -1
  117. package/dist/types/isomorphic/utils/decodeSignature.d.ts +0 -4
  118. package/dist/types/isomorphic/utils/decodeSignature.d.ts.map +0 -1
  119. package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +0 -22
  120. package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts.map +0 -1
  121. package/dist/types/isomorphic/utils/supportsFeature.d.ts +0 -5
  122. package/dist/types/isomorphic/utils/supportsFeature.d.ts.map +0 -1
  123. package/dist/types/local/client.d.ts +0 -4
  124. package/dist/types/local/client.d.ts.map +0 -1
  125. package/dist/types/remote/client.d.ts +0 -10
  126. package/dist/types/remote/client.d.ts.map +0 -1
  127. package/src/exports/internal.ts +0 -8
  128. package/src/isomorphic/actions/createSession.ts +0 -163
  129. package/src/isomorphic/actions/formatSign.ts +0 -76
  130. package/src/isomorphic/actions/getCallsStatus.ts +0 -112
  131. package/src/isomorphic/actions/prepareCalls.ts +0 -172
  132. package/src/isomorphic/actions/prepareSign.ts +0 -88
  133. package/src/isomorphic/actions/sendPreparedCalls.ts +0 -271
  134. package/src/isomorphic/client.ts +0 -102
  135. package/src/isomorphic/utils/7702.ts +0 -135
  136. package/src/isomorphic/utils/createDummySigner.ts +0 -27
  137. package/src/isomorphic/utils/decodeSignature.ts +0 -21
  138. package/src/isomorphic/utils/parsePermissionsContext.ts +0 -51
  139. package/src/isomorphic/utils/supportsFeature.ts +0 -34
  140. package/src/local/client.ts +0 -136
  141. package/src/remote/client.ts +0 -67
@@ -1,275 +0,0 @@
1
- import { type ClientMiddlewareFn, type SmartAccountClient, type SmartAccountClientRpcSchema, type SmartContractAccount } from "@aa-sdk/core";
2
- import { type Chain, type Transport } from "viem";
3
- import type { WalletServerViemRpcSchema } from "@alchemy/wallet-api-types/rpc";
4
- import { type CreateSessionParams } from "./actions/createSession.js";
5
- import { type GetCallsStatusParams } from "./actions/getCallsStatus.js";
6
- import { type PrepareCallsParams } from "./actions/prepareCalls.js";
7
- import { type SendPreparedCallsParams } from "./actions/sendPreparedCalls.js";
8
- import { type PrepareSignParams } from "./actions/prepareSign.js";
9
- import { type FormatSignParams } from "./actions/formatSign.js";
10
- type ClientParams = {
11
- chain: Chain;
12
- transport: Transport;
13
- policyId?: string;
14
- useErc7677middleware?: boolean;
15
- feeEstimator?: ClientMiddlewareFn;
16
- };
17
- export declare function isomorphicClientActions(client: SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, Record<string, unknown>, WalletServerViemRpcSchema>): {
18
- prepareCalls: (params: PrepareCallsParams) => Promise<{
19
- type: "array";
20
- data: ({
21
- type: "user-operation-v060";
22
- data: {
23
- nonce: `0x${string}`;
24
- initCode: `0x${string}`;
25
- maxFeePerGas: `0x${string}`;
26
- maxPriorityFeePerGas: `0x${string}`;
27
- paymasterAndData: `0x${string}`;
28
- sender: `0x${string}`;
29
- callData: `0x${string}`;
30
- callGasLimit: `0x${string}`;
31
- verificationGasLimit: `0x${string}`;
32
- preVerificationGas: `0x${string}`;
33
- };
34
- chainId: `0x${string}`;
35
- signatureRequest: {
36
- type: "personal_sign";
37
- data: string | {
38
- raw: `0x${string}`;
39
- };
40
- rawPayload: `0x${string}`;
41
- } | {
42
- type: "eth_signTypedData_v4";
43
- data: {
44
- domain?: {
45
- name?: string | undefined;
46
- chainId?: number | undefined;
47
- salt?: `0x${string}` | undefined;
48
- version?: string | undefined;
49
- verifyingContract?: `0x${string}` | undefined;
50
- } | undefined;
51
- message: {
52
- [x: string]: unknown;
53
- };
54
- primaryType: string;
55
- types: {
56
- [x: string]: {
57
- type: string;
58
- name: string;
59
- }[];
60
- };
61
- };
62
- rawPayload: `0x${string}`;
63
- };
64
- } | {
65
- type: "user-operation-v070";
66
- data: {
67
- factoryData?: `0x${string}` | undefined;
68
- paymasterVerificationGasLimit?: `0x${string}` | undefined;
69
- paymasterPostOpGasLimit?: `0x${string}` | undefined;
70
- factory?: `0x${string}` | undefined;
71
- paymaster?: `0x${string}` | undefined;
72
- paymasterData?: `0x${string}` | undefined;
73
- nonce: `0x${string}`;
74
- maxFeePerGas: `0x${string}`;
75
- maxPriorityFeePerGas: `0x${string}`;
76
- sender: `0x${string}`;
77
- callData: `0x${string}`;
78
- callGasLimit: `0x${string}`;
79
- verificationGasLimit: `0x${string}`;
80
- preVerificationGas: `0x${string}`;
81
- };
82
- chainId: `0x${string}`;
83
- signatureRequest: {
84
- type: "personal_sign";
85
- data: string | {
86
- raw: `0x${string}`;
87
- };
88
- rawPayload: `0x${string}`;
89
- } | {
90
- type: "eth_signTypedData_v4";
91
- data: {
92
- domain?: {
93
- name?: string | undefined;
94
- chainId?: number | undefined;
95
- salt?: `0x${string}` | undefined;
96
- version?: string | undefined;
97
- verifyingContract?: `0x${string}` | undefined;
98
- } | undefined;
99
- message: {
100
- [x: string]: unknown;
101
- };
102
- primaryType: string;
103
- types: {
104
- [x: string]: {
105
- type: string;
106
- name: string;
107
- }[];
108
- };
109
- };
110
- rawPayload: `0x${string}`;
111
- };
112
- } | {
113
- type: "authorization";
114
- data: {
115
- address: `0x${string}`;
116
- nonce: `0x${string}`;
117
- };
118
- chainId: `0x${string}`;
119
- signatureRequest: {
120
- type: "eip7702Auth";
121
- rawPayload: `0x${string}`;
122
- };
123
- })[];
124
- } | {
125
- type: "user-operation-v060";
126
- data: {
127
- nonce: `0x${string}`;
128
- initCode: `0x${string}`;
129
- maxFeePerGas: `0x${string}`;
130
- maxPriorityFeePerGas: `0x${string}`;
131
- paymasterAndData: `0x${string}`;
132
- sender: `0x${string}`;
133
- callData: `0x${string}`;
134
- callGasLimit: `0x${string}`;
135
- verificationGasLimit: `0x${string}`;
136
- preVerificationGas: `0x${string}`;
137
- };
138
- chainId: `0x${string}`;
139
- signatureRequest: {
140
- type: "personal_sign";
141
- data: string | {
142
- raw: `0x${string}`;
143
- };
144
- rawPayload: `0x${string}`;
145
- } | {
146
- type: "eth_signTypedData_v4";
147
- data: {
148
- domain?: {
149
- name?: string | undefined;
150
- chainId?: number | undefined;
151
- salt?: `0x${string}` | undefined;
152
- version?: string | undefined;
153
- verifyingContract?: `0x${string}` | undefined;
154
- } | undefined;
155
- message: {
156
- [x: string]: unknown;
157
- };
158
- primaryType: string;
159
- types: {
160
- [x: string]: {
161
- type: string;
162
- name: string;
163
- }[];
164
- };
165
- };
166
- rawPayload: `0x${string}`;
167
- };
168
- } | {
169
- type: "user-operation-v070";
170
- data: {
171
- factoryData?: `0x${string}` | undefined;
172
- paymasterVerificationGasLimit?: `0x${string}` | undefined;
173
- paymasterPostOpGasLimit?: `0x${string}` | undefined;
174
- factory?: `0x${string}` | undefined;
175
- paymaster?: `0x${string}` | undefined;
176
- paymasterData?: `0x${string}` | undefined;
177
- nonce: `0x${string}`;
178
- maxFeePerGas: `0x${string}`;
179
- maxPriorityFeePerGas: `0x${string}`;
180
- sender: `0x${string}`;
181
- callData: `0x${string}`;
182
- callGasLimit: `0x${string}`;
183
- verificationGasLimit: `0x${string}`;
184
- preVerificationGas: `0x${string}`;
185
- };
186
- chainId: `0x${string}`;
187
- signatureRequest: {
188
- type: "personal_sign";
189
- data: string | {
190
- raw: `0x${string}`;
191
- };
192
- rawPayload: `0x${string}`;
193
- } | {
194
- type: "eth_signTypedData_v4";
195
- data: {
196
- domain?: {
197
- name?: string | undefined;
198
- chainId?: number | undefined;
199
- salt?: `0x${string}` | undefined;
200
- version?: string | undefined;
201
- verifyingContract?: `0x${string}` | undefined;
202
- } | undefined;
203
- message: {
204
- [x: string]: unknown;
205
- };
206
- primaryType: string;
207
- types: {
208
- [x: string]: {
209
- type: string;
210
- name: string;
211
- }[];
212
- };
213
- };
214
- rawPayload: `0x${string}`;
215
- };
216
- }>;
217
- sendPreparedCalls: (params: SendPreparedCallsParams) => Promise<{
218
- preparedCallIds: `0x${string}`[];
219
- }>;
220
- getCallsStatus: (params: GetCallsStatusParams) => Promise<{
221
- receipts?: {
222
- blockHash: `0x${string}`;
223
- blockNumber: `0x${string}`;
224
- gasUsed: `0x${string}`;
225
- status: `0x${string}`;
226
- logs: {
227
- address: `0x${string}`;
228
- data: `0x${string}`;
229
- topics: `0x${string}`[];
230
- }[];
231
- transactionHash: `0x${string}`;
232
- }[] | undefined;
233
- chainId: `0x${string}`;
234
- id: `0x${string}`;
235
- atomic: boolean;
236
- status: 200 | 100 | 400 | 500 | 600;
237
- }>;
238
- createSession: (params: CreateSessionParams) => Promise<import("./actions/createSession.js").CreateSessionResult>;
239
- prepareSign: (params: PrepareSignParams) => Promise<{
240
- chainId: `0x${string}`;
241
- signatureRequest: {
242
- type: "personal_sign";
243
- data: string | {
244
- raw: `0x${string}`;
245
- };
246
- } | {
247
- type: "eth_signTypedData_v4";
248
- data: {
249
- domain?: {
250
- name?: string | undefined;
251
- chainId?: number | undefined;
252
- salt?: `0x${string}` | undefined;
253
- version?: string | undefined;
254
- verifyingContract?: `0x${string}` | undefined;
255
- } | undefined;
256
- message: {
257
- [x: string]: unknown;
258
- };
259
- primaryType: string;
260
- types: {
261
- [x: string]: {
262
- type: string;
263
- name: string;
264
- }[];
265
- };
266
- };
267
- };
268
- }>;
269
- formatSign: (params: FormatSignParams) => Promise<{
270
- signature: `0x${string}`;
271
- }>;
272
- };
273
- export declare function createIsomorphicClient({ chain, transport, policyId, useErc7677middleware, feeEstimator, }: ClientParams): SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, ReturnType<typeof isomorphicClientActions>, WalletServerViemRpcSchema & SmartAccountClientRpcSchema>;
274
- export type IsomorphicClient = ReturnType<typeof createIsomorphicClient>;
275
- export {};
@@ -1,41 +0,0 @@
1
- import { createSmartAccountClient, } from "@aa-sdk/core";
2
- import { alchemyFeeEstimator, alchemyGasAndPaymasterAndDataMiddleware, alchemyGasManagerMiddleware, } from "@account-kit/infra";
3
- import {} from "viem";
4
- import { createSession, } from "./actions/createSession.js";
5
- import { getCallsStatus, } from "./actions/getCallsStatus.js";
6
- import { prepareCalls, } from "./actions/prepareCalls.js";
7
- import { sendPreparedCalls, } from "./actions/sendPreparedCalls.js";
8
- import { prepareSign } from "./actions/prepareSign.js";
9
- import { formatSign } from "./actions/formatSign.js";
10
- export function isomorphicClientActions(client) {
11
- return {
12
- prepareCalls: (params) => prepareCalls(client, params),
13
- sendPreparedCalls: (params) => sendPreparedCalls(client, params),
14
- getCallsStatus: (params) => getCallsStatus(client, params),
15
- createSession: (params) => createSession(client, params),
16
- prepareSign: (params) => prepareSign(client, params),
17
- formatSign: (params) => formatSign(client, params),
18
- };
19
- }
20
- // the isomorphic client likely won't be exposed directly. This client contains the business logic that can be run on the wallet server or on the client
21
- // if the dev chooses to run the client in "local" mode.
22
- export function createIsomorphicClient({ chain, transport, policyId, useErc7677middleware = true, feeEstimator, }) {
23
- // This must be a smart account client since as of now we use it to build UOs under the hood
24
- const client = createSmartAccountClient({
25
- transport,
26
- chain,
27
- // TODO: we will want to enforce alchemy transport here probably
28
- feeEstimator: feeEstimator ?? alchemyFeeEstimator(transport),
29
- ...(policyId
30
- ? useErc7677middleware
31
- ? alchemyGasManagerMiddleware(policyId)
32
- : // NOTE: DO NOT USE THIS MIDDLEWARE in the server, currently we require using the erc7677 middleware
33
- alchemyGasAndPaymasterAndDataMiddleware({
34
- policyId,
35
- transport: transport,
36
- })
37
- : {}),
38
- }).extend(isomorphicClientActions);
39
- return client;
40
- }
41
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/isomorphic/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAKzB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,uCAAuC,EACvC,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA8B,MAAM,MAAM,CAAC;AAElD,OAAO,EACL,aAAa,GAEd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,GAEf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,YAAY,GAEb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,GAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAyB,MAAM,yBAAyB,CAAC;AAW5E,MAAM,UAAU,uBAAuB,CACrC,MAMC;IAED,OAAO;QACL,YAAY,EAAE,CAAC,MAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;QAC1E,iBAAiB,EAAE,CAAC,MAA+B,EAAE,EAAE,CACrD,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC;QACnC,cAAc,EAAE,CAAC,MAA4B,EAAE,EAAE,CAC/C,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC;QAChC,aAAa,EAAE,CAAC,MAA2B,EAAE,EAAE,CAC7C,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC;QAC/B,WAAW,EAAE,CAAC,MAAyB,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;QACvE,UAAU,EAAE,CAAC,MAAwB,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;KACrE,CAAC;AACJ,CAAC;AAED,wJAAwJ;AACxJ,wDAAwD;AACxD,MAAM,UAAU,sBAAsB,CAAC,EACrC,KAAK,EACL,SAAS,EACT,QAAQ,EACR,oBAAoB,GAAG,IAAI,EAC3B,YAAY,GACC;IAOb,4FAA4F;IAC5F,MAAM,MAAM,GAAG,wBAAwB,CAAC;QACtC,SAAS;QACT,KAAK;QACL,gEAAgE;QAChE,YAAY,EACV,YAAY,IAAI,mBAAmB,CAAC,SAA6B,CAAC;QACpE,GAAG,CAAC,QAAQ;YACV,CAAC,CAAC,oBAAoB;gBACpB,CAAC,CAAC,2BAA2B,CAAC,QAAQ,CAAC;gBACvC,CAAC,CAAC,oGAAoG;oBACpG,uCAAuC,CAAC;wBACtC,QAAQ;wBACR,SAAS,EAAE,SAA6B;qBACzC,CAAC;YACN,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAEnC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n type ClientMiddlewareFn,\n type SmartAccountClient,\n type SmartAccountClientRpcSchema,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport {\n alchemyFeeEstimator,\n alchemyGasAndPaymasterAndDataMiddleware,\n alchemyGasManagerMiddleware,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\nimport { type Chain, type Transport } from \"viem\";\nimport type { WalletServerViemRpcSchema } from \"@alchemy/wallet-api-types/rpc\";\nimport {\n createSession,\n type CreateSessionParams,\n} from \"./actions/createSession.js\";\nimport {\n getCallsStatus,\n type GetCallsStatusParams,\n} from \"./actions/getCallsStatus.js\";\nimport {\n prepareCalls,\n type PrepareCallsParams,\n} from \"./actions/prepareCalls.js\";\nimport {\n sendPreparedCalls,\n type SendPreparedCallsParams,\n} from \"./actions/sendPreparedCalls.js\";\nimport { prepareSign, type PrepareSignParams } from \"./actions/prepareSign.js\";\nimport { formatSign, type FormatSignParams } from \"./actions/formatSign.js\";\n\n// let's start with something that takes in as many params as possible, then we can eliminate them as we don't need them\ntype ClientParams = {\n chain: Chain;\n transport: Transport;\n policyId?: string;\n useErc7677middleware?: boolean;\n feeEstimator?: ClientMiddlewareFn;\n};\n\nexport function isomorphicClientActions(\n client: SmartAccountClient<\n Transport,\n Chain,\n SmartContractAccount | undefined,\n Record<string, unknown>,\n WalletServerViemRpcSchema\n >,\n) {\n return {\n prepareCalls: (params: PrepareCallsParams) => prepareCalls(client, params),\n sendPreparedCalls: (params: SendPreparedCallsParams) =>\n sendPreparedCalls(client, params),\n getCallsStatus: (params: GetCallsStatusParams) =>\n getCallsStatus(client, params),\n createSession: (params: CreateSessionParams) =>\n createSession(client, params),\n prepareSign: (params: PrepareSignParams) => prepareSign(client, params),\n formatSign: (params: FormatSignParams) => formatSign(client, params),\n };\n}\n\n// the isomorphic client likely won't be exposed directly. This client contains the business logic that can be run on the wallet server or on the client\n// if the dev chooses to run the client in \"local\" mode.\nexport function createIsomorphicClient({\n chain,\n transport,\n policyId,\n useErc7677middleware = true,\n feeEstimator,\n}: ClientParams): SmartAccountClient<\n Transport,\n Chain,\n SmartContractAccount | undefined,\n ReturnType<typeof isomorphicClientActions>,\n WalletServerViemRpcSchema & SmartAccountClientRpcSchema\n> {\n // This must be a smart account client since as of now we use it to build UOs under the hood\n const client = createSmartAccountClient({\n transport,\n chain,\n // TODO: we will want to enforce alchemy transport here probably\n feeEstimator:\n feeEstimator ?? alchemyFeeEstimator(transport as AlchemyTransport),\n ...(policyId\n ? useErc7677middleware\n ? alchemyGasManagerMiddleware(policyId)\n : // NOTE: DO NOT USE THIS MIDDLEWARE in the server, currently we require using the erc7677 middleware\n alchemyGasAndPaymasterAndDataMiddleware({\n policyId,\n transport: transport as AlchemyTransport,\n })\n : {}),\n }).extend(isomorphicClientActions);\n\n return client;\n}\n\nexport type IsomorphicClient = ReturnType<typeof createIsomorphicClient>;\n"]}
@@ -1,19 +0,0 @@
1
- import type { SmartAccountClient, SmartContractAccount } from "@aa-sdk/core";
2
- import { type Address, type Chain, type Transport } from "viem";
3
- import type { WalletServerViemRpcSchema } from "@alchemy/wallet-api-types/rpc";
4
- import { type Supported7702AccountType, type Eip7702AuthCapability } from "@alchemy/wallet-api-types/capabilities";
5
- import type { PreparedCall_Authorization } from "@alchemy/wallet-api-types";
6
- /** Checks if an address is actively delegated on-chain. */
7
- export declare const isDelegated: (client: SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, Record<string, unknown>, WalletServerViemRpcSchema>, params: {
8
- address: Address;
9
- delegation: Address;
10
- }) => Promise<boolean>;
11
- export declare const createAuthorizationRequest: (client: SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, Record<string, unknown>, WalletServerViemRpcSchema>, params: {
12
- address: Address;
13
- delegation: Address;
14
- }) => Promise<PreparedCall_Authorization>;
15
- export declare const DelegationAddressToAccountType: Record<Address, Supported7702AccountType>;
16
- export declare const isSupportedDelegationAddress7702: (address: Address) => boolean;
17
- export declare const getAccountTypeForDelegationAddress7702: (address: Address) => Supported7702AccountType | undefined;
18
- export declare const parseDelegation: (eip7702AuthCapability: Eip7702AuthCapability) => "0x69007702764179f14F51cdce752f4f775d74E139";
19
- export declare const assertValid7702AccountAddress: (fromAddress: Address, eip7702AuthCapability: Eip7702AuthCapability | undefined) => void;
@@ -1,70 +0,0 @@
1
- import { concatHex, numberToHex, isAddress, hexToNumber, } from "viem";
2
- import { Eip7702AccountTypeToDelegationAddress, SUPPORTED_DELEGATION_ADDRESSES, } from "@alchemy/wallet-api-types/capabilities";
3
- import { InvalidRequestError } from "ox/RpcResponse";
4
- import { hashAuthorization } from "viem/utils";
5
- /** Checks if an address is actively delegated on-chain. */
6
- export const isDelegated = async (client, params) => {
7
- const expectedCode = concatHex(["0xef0100", params.delegation]);
8
- const code = (await client.getCode({ address: params.address })) ?? "0x";
9
- return code.toLowerCase() === expectedCode.toLowerCase();
10
- };
11
- export const createAuthorizationRequest = async (client, params) => {
12
- const data = {
13
- address: params.delegation,
14
- nonce: numberToHex(await client.getTransactionCount({
15
- address: params.address,
16
- })),
17
- };
18
- return {
19
- type: "authorization",
20
- data,
21
- chainId: numberToHex(client.chain.id),
22
- signatureRequest: {
23
- type: "eip7702Auth",
24
- rawPayload: hashAuthorization({
25
- chainId: client.chain.id,
26
- nonce: hexToNumber(data.nonce),
27
- address: params.delegation,
28
- }),
29
- },
30
- };
31
- };
32
- export const DelegationAddressToAccountType = Object.fromEntries(Object.entries(Eip7702AccountTypeToDelegationAddress).map(([key, value]) => [
33
- value,
34
- key,
35
- ]));
36
- export const isSupportedDelegationAddress7702 = (address) => {
37
- return SUPPORTED_DELEGATION_ADDRESSES.includes(address);
38
- };
39
- export const getAccountTypeForDelegationAddress7702 = (address) => {
40
- return DelegationAddressToAccountType[address];
41
- };
42
- const getDelegationAddressForAccountType7702 = (accountType) => {
43
- return Eip7702AccountTypeToDelegationAddress[accountType];
44
- };
45
- const DEFAULT_7702_DELEGATION_ADDR = Eip7702AccountTypeToDelegationAddress["ModularAccountV2"];
46
- export const parseDelegation = (eip7702AuthCapability) => {
47
- return eip7702AuthCapability === true
48
- ? DEFAULT_7702_DELEGATION_ADDR
49
- : isAddress(eip7702AuthCapability.delegation)
50
- ? eip7702AuthCapability.delegation
51
- : getDelegationAddressForAccountType7702(eip7702AuthCapability.delegation);
52
- };
53
- export const assertValid7702AccountAddress = (fromAddress, eip7702AuthCapability) => {
54
- if (eip7702AuthCapability) {
55
- if (typeof eip7702AuthCapability === "object" &&
56
- "account" in eip7702AuthCapability &&
57
- eip7702AuthCapability?.account !== fromAddress) {
58
- throw new InvalidRequestError({
59
- message: `EIP-7702 delegation account ${eip7702AuthCapability.account} must match 'from' address ${fromAddress}.`,
60
- });
61
- }
62
- const delegation = parseDelegation(eip7702AuthCapability);
63
- if (!isSupportedDelegationAddress7702(delegation)) {
64
- throw new InvalidRequestError({
65
- message: `Unsupported 7702 delegation address: ${delegation}`,
66
- });
67
- }
68
- }
69
- };
70
- //# sourceMappingURL=7702.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"7702.js","sourceRoot":"","sources":["../../../../src/isomorphic/utils/7702.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,WAAW,EAIX,SAAS,EACT,WAAW,GACZ,MAAM,MAAM,CAAC;AAEd,OAAO,EACL,qCAAqC,EACrC,8BAA8B,GAG/B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAC9B,MAMC,EACD,MAAiD,EAC/B,EAAE;IACpB,MAAM,YAAY,GAAG,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAChE,MAAM,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC;IACzE,OAAO,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC,WAAW,EAAE,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,EAC7C,MAMC,EACD,MAAiD,EACZ,EAAE;IACvC,MAAM,IAAI,GAAG;QACX,OAAO,EAAE,MAAM,CAAC,UAAU;QAC1B,KAAK,EAAE,WAAW,CAChB,MAAM,MAAM,CAAC,mBAAmB,CAAC;YAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC,CACH;KACF,CAAC;IACF,OAAO;QACL,IAAI,EAAE,eAAwB;QAC9B,IAAI;QACJ,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,gBAAgB,EAAE;YAChB,IAAI,EAAE,aAAsB;YAC5B,UAAU,EAAE,iBAAiB,CAAC;gBAC5B,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE;gBACxB,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC9B,OAAO,EAAE,MAAM,CAAC,UAAU;aAC3B,CAAC;SACH;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAGvC,MAAM,CAAC,WAAW,CACpB,MAAM,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;IAC1E,KAAK;IACL,GAAG;CACJ,CAAC,CAC0C,CAAC;AAE/C,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,OAAgB,EAAW,EAAE;IAC5E,OAAQ,8BAA4C,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,CACpD,OAAgB,EACsB,EAAE;IACxC,OAAO,8BAA8B,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,sCAAsC,GAAG,CAC7C,WAAqC,EACY,EAAE;IACnD,OAAO,qCAAqC,CAAC,WAAW,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,4BAA4B,GAChC,qCAAqC,CAAC,kBAAkB,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,qBAA4C,EAC5C,EAAE;IACF,OAAO,qBAAqB,KAAK,IAAI;QACnC,CAAC,CAAC,4BAA4B;QAC9B,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC;YAC3C,CAAC,CAAC,qBAAqB,CAAC,UAAU;YAClC,CAAC,CAAC,sCAAsC,CACpC,qBAAqB,CAAC,UAAU,CACjC,CAAC;AACV,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,WAAoB,EACpB,qBAAwD,EACxD,EAAE;IACF,IAAI,qBAAqB,EAAE,CAAC;QAC1B,IACE,OAAO,qBAAqB,KAAK,QAAQ;YACzC,SAAS,IAAI,qBAAqB;YAClC,qBAAqB,EAAE,OAAO,KAAK,WAAW,EAC9C,CAAC;YACD,MAAM,IAAI,mBAAmB,CAAC;gBAC5B,OAAO,EAAE,+BAA+B,qBAAqB,CAAC,OAAO,8BAA8B,WAAW,GAAG;aAClH,CAAC,CAAC;QACL,CAAC;QAED,MAAM,UAAU,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAAC;QAE1D,IAAI,CAAC,gCAAgC,CAAC,UAAU,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,mBAAmB,CAAC;gBAC5B,OAAO,EAAE,wCAAwC,UAAU,EAAE;aAC9D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { SmartAccountClient, SmartContractAccount } from \"@aa-sdk/core\";\nimport {\n concatHex,\n numberToHex,\n type Address,\n type Chain,\n type Transport,\n isAddress,\n hexToNumber,\n} from \"viem\";\nimport type { WalletServerViemRpcSchema } from \"@alchemy/wallet-api-types/rpc\";\nimport {\n Eip7702AccountTypeToDelegationAddress,\n SUPPORTED_DELEGATION_ADDRESSES,\n type Supported7702AccountType,\n type Eip7702AuthCapability,\n} from \"@alchemy/wallet-api-types/capabilities\";\nimport type { PreparedCall_Authorization } from \"@alchemy/wallet-api-types\";\nimport { InvalidRequestError } from \"ox/RpcResponse\";\nimport { hashAuthorization } from \"viem/utils\";\n\n/** Checks if an address is actively delegated on-chain. */\nexport const isDelegated = async (\n client: SmartAccountClient<\n Transport,\n Chain,\n SmartContractAccount | undefined,\n Record<string, unknown>,\n WalletServerViemRpcSchema\n >,\n params: { address: Address; delegation: Address },\n): Promise<boolean> => {\n const expectedCode = concatHex([\"0xef0100\", params.delegation]);\n const code = (await client.getCode({ address: params.address })) ?? \"0x\";\n return code.toLowerCase() === expectedCode.toLowerCase();\n};\n\nexport const createAuthorizationRequest = async (\n client: SmartAccountClient<\n Transport,\n Chain,\n SmartContractAccount | undefined,\n Record<string, unknown>,\n WalletServerViemRpcSchema\n >,\n params: { address: Address; delegation: Address },\n): Promise<PreparedCall_Authorization> => {\n const data = {\n address: params.delegation,\n nonce: numberToHex(\n await client.getTransactionCount({\n address: params.address,\n }),\n ),\n };\n return {\n type: \"authorization\" as const,\n data,\n chainId: numberToHex(client.chain.id),\n signatureRequest: {\n type: \"eip7702Auth\" as const,\n rawPayload: hashAuthorization({\n chainId: client.chain.id,\n nonce: hexToNumber(data.nonce),\n address: params.delegation,\n }),\n },\n };\n};\n\nexport const DelegationAddressToAccountType: Record<\n Address,\n Supported7702AccountType\n> = Object.fromEntries(\n Object.entries(Eip7702AccountTypeToDelegationAddress).map(([key, value]) => [\n value,\n key,\n ]),\n) as Record<Address, Supported7702AccountType>;\n\nexport const isSupportedDelegationAddress7702 = (address: Address): boolean => {\n return (SUPPORTED_DELEGATION_ADDRESSES as Address[]).includes(address);\n};\n\nexport const getAccountTypeForDelegationAddress7702 = (\n address: Address,\n): Supported7702AccountType | undefined => {\n return DelegationAddressToAccountType[address];\n};\n\nconst getDelegationAddressForAccountType7702 = (\n accountType: Supported7702AccountType,\n): (typeof SUPPORTED_DELEGATION_ADDRESSES)[number] => {\n return Eip7702AccountTypeToDelegationAddress[accountType];\n};\n\nconst DEFAULT_7702_DELEGATION_ADDR =\n Eip7702AccountTypeToDelegationAddress[\"ModularAccountV2\"];\n\nexport const parseDelegation = (\n eip7702AuthCapability: Eip7702AuthCapability,\n) => {\n return eip7702AuthCapability === true\n ? DEFAULT_7702_DELEGATION_ADDR\n : isAddress(eip7702AuthCapability.delegation)\n ? eip7702AuthCapability.delegation\n : getDelegationAddressForAccountType7702(\n eip7702AuthCapability.delegation,\n );\n};\n\nexport const assertValid7702AccountAddress = (\n fromAddress: Address,\n eip7702AuthCapability: Eip7702AuthCapability | undefined,\n) => {\n if (eip7702AuthCapability) {\n if (\n typeof eip7702AuthCapability === \"object\" &&\n \"account\" in eip7702AuthCapability &&\n eip7702AuthCapability?.account !== fromAddress\n ) {\n throw new InvalidRequestError({\n message: `EIP-7702 delegation account ${eip7702AuthCapability.account} must match 'from' address ${fromAddress}.`,\n });\n }\n\n const delegation = parseDelegation(eip7702AuthCapability);\n\n if (!isSupportedDelegationAddress7702(delegation)) {\n throw new InvalidRequestError({\n message: `Unsupported 7702 delegation address: ${delegation}`,\n });\n }\n }\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createAccount.js","sourceRoot":"","sources":["../../../../src/isomorphic/utils/createAccount.ts"],"names":[],"mappings":"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","sourcesContent":["import type { SmartAccountSigner, SmartContractAccount } from \"@aa-sdk/core\";\nimport {\n createLightAccount,\n createModularAccountV2,\n createMultiOwnerLightAccount,\n createMultiOwnerModularAccount,\n type ModularAccountV2,\n} from \"@account-kit/smart-contracts\";\nimport type { StaticDecode } from \"@sinclair/typebox\";\nimport type { Address, Chain, Transport } from \"viem\";\nimport { concatHex, hexToNumber } from \"viem\";\nimport { parsePermissionsContext } from \"./parsePermissionsContext.js\";\nimport { assertNever } from \"../../utils.js\";\nimport { getAccountTypeForDelegationAddress7702 } from \"./7702.js\";\nimport { SerializedInitcode } from \"@alchemy/wallet-api-types\";\nimport { PermissionsCapability } from \"@alchemy/wallet-api-types/capabilities\";\nimport { InternalError, InvalidRequestError } from \"ox/RpcResponse\";\n\ntype CreateAccountParams = {\n chain: Chain;\n transport: Transport;\n signer: SmartAccountSigner;\n accountAddress: Address;\n counterfactualInfo?: StaticDecode<typeof SerializedInitcode>; // undefined for 7702 accounts\n permissions?: StaticDecode<typeof PermissionsCapability>;\n delegation?: Address;\n};\n\n/**\n * Creates a smart account instance from the given parameters.\n * @param params - The parameters for creating a smart account.\n * @returns A promise that resolves to the created smart account.\n */\nexport async function createAccount(\n params: CreateAccountParams,\n): Promise<SmartContractAccount> {\n const { counterfactualInfo: ci, ...accountParams } = params;\n\n // This throws if we pass a permission context and the account is not MA-v2\n // TODO: test that this edge case is handled correctly\n const parsedContext = parsePermissionsContext(\n params.permissions,\n ci,\n params.delegation,\n );\n\n const signerEntity =\n parsedContext?.contextVersion === \"NON_DEFERRED_ACTION\"\n ? {\n entityId: hexToNumber(parsedContext.entityId),\n isGlobalValidation: parsedContext.isGlobalValidation,\n }\n : undefined;\n\n const mode = params.delegation ? \"7702\" : \"default\";\n\n if (mode === \"7702\") {\n const accountType = getAccountTypeForDelegationAddress7702(\n params.delegation!,\n );\n if (accountType !== \"ModularAccountV2\") {\n throw new Error(\"7702 mode currently only supports ModularAccountV2\");\n }\n return createModularAccountV2({\n ...accountParams,\n signerEntity,\n deferredAction: parsedContext?.deferredAction,\n mode,\n });\n }\n\n if (mode !== \"default\") {\n return assertNever(mode, \"Unexpected mode in createAccount\");\n }\n\n // At this point, we are guaranteed to be in default mode, where ci\n // (counterfactualInfo) must be defined\n\n if (!ci) {\n throw new InternalError({\n message: \"Counterfactual info not found\",\n });\n }\n\n const factoryType = ci.factoryType;\n const commonParams = {\n ...accountParams,\n initCode: concatHex([ci.factoryAddress, ci.factoryData]),\n };\n\n // Return the account created based on the factory type\n switch (factoryType) {\n case \"MAv2.0.0-sma-b\":\n return createModularAccountV2({\n ...commonParams,\n signerEntity,\n deferredAction: parsedContext?.deferredAction,\n mode,\n });\n case \"LightAccountV2.0.0\":\n return createLightAccount({\n ...commonParams,\n version: \"v2.0.0\",\n });\n case \"LightAccountV1.0.1\":\n return createLightAccount({\n ...commonParams,\n version: \"v1.0.1\",\n });\n case \"LightAccountV1.0.2\":\n return createLightAccount({\n ...commonParams,\n version: \"v1.0.2\",\n });\n case \"LightAccountV1.1.0\":\n return createLightAccount({\n ...commonParams,\n version: \"v1.1.0\",\n });\n case \"MAv1.0.0-MultiOwner\":\n return createMultiOwnerModularAccount({\n ...commonParams,\n });\n case \"LightAccountV2.0.0-MultiOwner\":\n return createMultiOwnerLightAccount({\n ...commonParams,\n version: \"v2.0.0\",\n });\n case \"MAv1.0.0-MultiSig\":\n case \"MAv2.0.0-ma-ssv\":\n case \"MAv2.0.0-ma-webauthn\":\n case \"unknown\":\n case undefined:\n throw new InvalidRequestError({\n message: `Account type currently unsupported: ${factoryType}`,\n });\n default:\n return assertNever(factoryType, \"Unsupported factory type\");\n }\n}\n\nexport function isModularAccountV2(\n account: SmartContractAccount,\n): account is ModularAccountV2 {\n return account.source === \"ModularAccountV2\";\n}\n"]}
@@ -1,3 +0,0 @@
1
- import { type SmartAccountSigner } from "@aa-sdk/core";
2
- import { type Address } from "viem";
3
- export declare const createDummySigner: (address: Address) => SmartAccountSigner;
@@ -1,17 +0,0 @@
1
- import {} from "@aa-sdk/core";
2
- import { BaseError, } from "viem";
3
- export const createDummySigner = (address) => ({
4
- signerType: "",
5
- inner: undefined,
6
- getAddress: async function () {
7
- return address;
8
- },
9
- // Not supported on the server
10
- signMessage: function (_message) {
11
- throw new BaseError("signMessage not implemented by dummy signer.");
12
- },
13
- signTypedData: function (_params) {
14
- throw new BaseError("signTypedData not implemented by dummy signer.");
15
- },
16
- });
17
- //# sourceMappingURL=createDummySigner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDummySigner.js","sourceRoot":"","sources":["../../../../src/isomorphic/utils/createDummySigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,cAAc,CAAC;AAEvD,OAAO,EACL,SAAS,GAKV,MAAM,MAAM,CAAC;AAEd,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAgB,EAAsB,EAAE,CAAC,CAAC;IAC1E,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,KAAK;QACf,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,8BAA8B;IAC9B,WAAW,EAAE,UAAU,QAAyB;QAC9C,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;IACtE,CAAC;IACD,aAAa,EAAE,UAGb,OAAsD;QACtD,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAC;IACxE,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { type SmartAccountSigner } from \"@aa-sdk/core\";\nimport type { TypedData } from \"abitype\";\nimport {\n BaseError,\n type Address,\n type Hex,\n type SignableMessage,\n type TypedDataDefinition,\n} from \"viem\";\n\nexport const createDummySigner = (address: Address): SmartAccountSigner => ({\n signerType: \"\",\n inner: undefined,\n getAddress: async function (): Promise<`0x${string}`> {\n return address;\n },\n // Not supported on the server\n signMessage: function (_message: SignableMessage): Promise<Hex> {\n throw new BaseError(\"signMessage not implemented by dummy signer.\");\n },\n signTypedData: function <\n const TTypedData extends TypedData | Record<string, unknown>,\n TPrimaryType extends keyof TTypedData | \"EIP712Domain\" = keyof TTypedData,\n >(_params: TypedDataDefinition<TTypedData, TPrimaryType>): Promise<Hex> {\n throw new BaseError(\"signTypedData not implemented by dummy signer.\");\n },\n});\n"]}
@@ -1,3 +0,0 @@
1
- import type { StaticDecode } from "@sinclair/typebox";
2
- import { EcdsaSig, type EcdsaSig as EcdsaSigType } from "@alchemy/wallet-api-types";
3
- export declare const decodeSignature: (signature: EcdsaSigType["signature"]) => StaticDecode<typeof EcdsaSig>["signature"];
@@ -1,15 +0,0 @@
1
- import { Value } from "@sinclair/typebox/value";
2
- import { EcdsaSig, } from "@alchemy/wallet-api-types";
3
- import { assertNever } from "../../utils.js";
4
- export const decodeSignature = (signature) => {
5
- switch (signature.type) {
6
- case "ecdsa":
7
- case "secp256k1":
8
- return Value.Decode(EcdsaSig, {
9
- signature,
10
- }).signature;
11
- default:
12
- return assertNever(signature, "Unexpected signature type");
13
- }
14
- };
15
- //# sourceMappingURL=decodeSignature.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decodeSignature.js","sourceRoot":"","sources":["../../../../src/isomorphic/utils/decodeSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EACL,QAAQ,GAET,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAoC,EACQ,EAAE;IAC9C,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,OAAO,CAAC;QACb,KAAK,WAAW;YACd,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAC5B,SAAS;aACa,CAAC,CAAC,SAAS,CAAC;QACtC;YACE,OAAO,WAAW,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { Value } from \"@sinclair/typebox/value\";\nimport type { StaticDecode } from \"@sinclair/typebox\";\nimport {\n EcdsaSig,\n type EcdsaSig as EcdsaSigType,\n} from \"@alchemy/wallet-api-types\";\nimport { assertNever } from \"../../utils.js\";\n\nexport const decodeSignature = (\n signature: EcdsaSigType[\"signature\"],\n): StaticDecode<typeof EcdsaSig>[\"signature\"] => {\n switch (signature.type) {\n case \"ecdsa\":\n case \"secp256k1\":\n return Value.Decode(EcdsaSig, {\n signature,\n } satisfies EcdsaSigType).signature;\n default:\n return assertNever(signature, \"Unexpected signature type\");\n }\n};\n"]}
@@ -1,21 +0,0 @@
1
- import type { StaticDecode } from "@sinclair/typebox";
2
- import type { Address } from "viem";
3
- import { PermissionsCapability } from "@alchemy/wallet-api-types/capabilities";
4
- import { SerializedInitcode } from "@alchemy/wallet-api-types";
5
- export declare function parsePermissionsContext(permissions?: StaticDecode<typeof PermissionsCapability>, parsedCi?: StaticDecode<typeof SerializedInitcode> | undefined, delegation7702?: Address): ({
6
- contextVersion: keyof typeof import("@alchemy/wallet-api-types/capabilities").PermissionsContextVersion;
7
- } & {
8
- contextVersion: "LOCAL_MODE_DEFERRED_ACTION";
9
- deferredAction: import("viem").Hex;
10
- sessionId?: never;
11
- signature?: never;
12
- }) | ({
13
- contextVersion: keyof typeof import("@alchemy/wallet-api-types/capabilities").PermissionsContextVersion;
14
- } & {
15
- contextVersion: "NON_DEFERRED_ACTION";
16
- deferredAction?: never;
17
- sessionId?: never;
18
- signature?: never;
19
- entityId: import("viem").Hex;
20
- isGlobalValidation: boolean;
21
- }) | undefined;
@@ -1,34 +0,0 @@
1
- import { InvalidRequestError } from "ox/RpcResponse";
2
- import { getAccountTypeForDelegationAddress7702 } from "./7702.js";
3
- import { decodePermissionsContext, PermissionsCapability, } from "@alchemy/wallet-api-types/capabilities";
4
- import { SerializedInitcode } from "@alchemy/wallet-api-types";
5
- export function parsePermissionsContext(permissions, parsedCi, delegation7702) {
6
- if (!permissions) {
7
- return undefined;
8
- }
9
- if ("sessionId" in permissions) {
10
- throw new InvalidRequestError({
11
- message: "Remote permissions are not supported in isomorphic client",
12
- });
13
- }
14
- if (!("context" in permissions)) {
15
- return undefined;
16
- }
17
- const isMAV2 = (parsedCi && parsedCi.factoryType === "MAv2.0.0-sma-b") ||
18
- (delegation7702 &&
19
- getAccountTypeForDelegationAddress7702(delegation7702) ===
20
- "ModularAccountV2");
21
- if (!isMAV2) {
22
- throw new InvalidRequestError({
23
- message: "Permissions are currently only supported by MAv2 accounts",
24
- });
25
- }
26
- const context = decodePermissionsContext(permissions);
27
- if (context?.contextVersion === "REMOTE_MODE_DEFERRED_ACTION") {
28
- throw new InvalidRequestError({
29
- message: "Remote mode deferred action not supported in isomorphic client",
30
- });
31
- }
32
- return context;
33
- }
34
- //# sourceMappingURL=parsePermissionsContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parsePermissionsContext.js","sourceRoot":"","sources":["../../../../src/isomorphic/utils/parsePermissionsContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,sCAAsC,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EACL,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,UAAU,uBAAuB,CACrC,WAAwD,EACxD,QAA8D,EAC9D,cAAwB;IAExB,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,WAAW,IAAI,WAAW,EAAE,CAAC;QAC/B,MAAM,IAAI,mBAAmB,CAAC;YAC5B,OAAO,EAAE,2DAA2D;SACrE,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,CAAC,SAAS,IAAI,WAAW,CAAC,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GACV,CAAC,QAAQ,IAAI,QAAQ,CAAC,WAAW,KAAK,gBAAgB,CAAC;QACvD,CAAC,cAAc;YACb,sCAAsC,CAAC,cAAc,CAAC;gBACpD,kBAAkB,CAAC,CAAC;IAE1B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,mBAAmB,CAAC;YAC5B,OAAO,EAAE,2DAA2D;SACrE,CAAC,CAAC;IACL,CAAC;IAED,MAAM,OAAO,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;IAEtD,IAAI,OAAO,EAAE,cAAc,KAAK,6BAA6B,EAAE,CAAC;QAC9D,MAAM,IAAI,mBAAmB,CAAC;YAC5B,OAAO,EAAE,gEAAgE;SAC1E,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { StaticDecode } from \"@sinclair/typebox\";\nimport { InvalidRequestError } from \"ox/RpcResponse\";\nimport type { Address } from \"viem\";\nimport { getAccountTypeForDelegationAddress7702 } from \"./7702.js\";\nimport {\n decodePermissionsContext,\n PermissionsCapability,\n} from \"@alchemy/wallet-api-types/capabilities\";\nimport { SerializedInitcode } from \"@alchemy/wallet-api-types\";\n\nexport function parsePermissionsContext(\n permissions?: StaticDecode<typeof PermissionsCapability>,\n parsedCi?: StaticDecode<typeof SerializedInitcode> | undefined,\n delegation7702?: Address,\n) {\n if (!permissions) {\n return undefined;\n }\n\n if (\"sessionId\" in permissions) {\n throw new InvalidRequestError({\n message: \"Remote permissions are not supported in isomorphic client\",\n });\n }\n\n if (!(\"context\" in permissions)) {\n return undefined;\n }\n\n const isMAV2 =\n (parsedCi && parsedCi.factoryType === \"MAv2.0.0-sma-b\") ||\n (delegation7702 &&\n getAccountTypeForDelegationAddress7702(delegation7702) ===\n \"ModularAccountV2\");\n\n if (!isMAV2) {\n throw new InvalidRequestError({\n message: \"Permissions are currently only supported by MAv2 accounts\",\n });\n }\n\n const context = decodePermissionsContext(permissions);\n\n if (context?.contextVersion === \"REMOTE_MODE_DEFERRED_ACTION\") {\n throw new InvalidRequestError({\n message: \"Remote mode deferred action not supported in isomorphic client\",\n });\n }\n\n return context;\n}\n"]}
@@ -1,4 +0,0 @@
1
- import type { StaticDecode } from "@sinclair/typebox";
2
- import type { SerializedInitcode } from "@alchemy/wallet-api-types";
3
- export type Feature = "permissions";
4
- export declare function supportsFeature(counterfactualInfo: StaticDecode<typeof SerializedInitcode>, feature: Feature): boolean;
@@ -1,21 +0,0 @@
1
- const supportedFeatures = {
2
- "LightAccountV1.0.1": [],
3
- "LightAccountV1.0.2": [],
4
- "LightAccountV1.1.0": [],
5
- "LightAccountV2.0.0": [],
6
- "LightAccountV2.0.0-MultiOwner": [],
7
- "MAv1.0.0-MultiOwner": [],
8
- "MAv1.0.0-MultiSig": [],
9
- "MAv2.0.0-sma-b": ["permissions"],
10
- "MAv2.0.0-ma-ssv": ["permissions"],
11
- "MAv2.0.0-ma-webauthn": [],
12
- unknown: [],
13
- };
14
- export function supportsFeature(counterfactualInfo, feature) {
15
- const factorySupportedFeatures = supportedFeatures[counterfactualInfo.factoryType];
16
- if (factorySupportedFeatures === undefined) {
17
- throw new Error("Unsupported FactoryType: " + counterfactualInfo.factoryType);
18
- }
19
- return factorySupportedFeatures.includes(feature);
20
- }
21
- //# sourceMappingURL=supportsFeature.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"supportsFeature.js","sourceRoot":"","sources":["../../../../src/isomorphic/utils/supportsFeature.ts"],"names":[],"mappings":"AAOA,MAAM,iBAAiB,GAAmC;IACxD,oBAAoB,EAAE,EAAE;IACxB,oBAAoB,EAAE,EAAE;IACxB,oBAAoB,EAAE,EAAE;IACxB,oBAAoB,EAAE,EAAE;IACxB,+BAA+B,EAAE,EAAE;IACnC,qBAAqB,EAAE,EAAE;IACzB,mBAAmB,EAAE,EAAE;IACvB,gBAAgB,EAAE,CAAC,aAAa,CAAC;IACjC,iBAAiB,EAAE,CAAC,aAAa,CAAC;IAClC,sBAAsB,EAAE,EAAE;IAC1B,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,MAAM,UAAU,eAAe,CAC7B,kBAA2D,EAC3D,OAAgB;IAEhB,MAAM,wBAAwB,GAC5B,iBAAiB,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACpD,IAAI,wBAAwB,KAAK,SAAS,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,2BAA2B,GAAG,kBAAkB,CAAC,WAAW,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import type { StaticDecode } from \"@sinclair/typebox\";\nimport type { SerializedInitcode } from \"@alchemy/wallet-api-types\";\n\nexport type Feature = \"permissions\";\n\ntype FactoryType = StaticDecode<typeof SerializedInitcode>[\"factoryType\"];\n\nconst supportedFeatures: Record<FactoryType, Feature[]> = {\n \"LightAccountV1.0.1\": [],\n \"LightAccountV1.0.2\": [],\n \"LightAccountV1.1.0\": [],\n \"LightAccountV2.0.0\": [],\n \"LightAccountV2.0.0-MultiOwner\": [],\n \"MAv1.0.0-MultiOwner\": [],\n \"MAv1.0.0-MultiSig\": [],\n \"MAv2.0.0-sma-b\": [\"permissions\"],\n \"MAv2.0.0-ma-ssv\": [\"permissions\"],\n \"MAv2.0.0-ma-webauthn\": [],\n unknown: [],\n};\n\nexport function supportsFeature(\n counterfactualInfo: StaticDecode<typeof SerializedInitcode>,\n feature: Feature,\n): boolean {\n const factorySupportedFeatures =\n supportedFeatures[counterfactualInfo.factoryType];\n if (factorySupportedFeatures === undefined) {\n throw new Error(\n \"Unsupported FactoryType: \" + counterfactualInfo.factoryType,\n );\n }\n return factorySupportedFeatures.includes(feature);\n}\n"]}
@@ -1,3 +0,0 @@
1
- import { type Address } from "viem";
2
- import type { CreateInnerClientParams, InnerWalletApiClient } from "../types.ts";
3
- export declare function createLocalClient<TAccount extends Address | undefined = Address | undefined>(params: CreateInnerClientParams<TAccount>): InnerWalletApiClient;