@account-kit/smart-contracts 4.0.0-beta.8 → 4.0.0-beta.9

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.
@@ -38,8 +38,7 @@ type ExecutionActions<
38
38
  TContext extends UserOperationContext | undefined =
39
39
  | UserOperationContext
40
40
  | undefined,
41
- TEntryPointVersion extends
42
- GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
41
+ TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
43
42
  > = {
44
43
  updateOwners: (
45
44
  args: Pick<
@@ -51,7 +50,7 @@ type ExecutionActions<
51
50
  > &
52
51
  UserOperationOverridesParameter<TEntryPointVersion> &
53
52
  GetAccountParameter<TAccount> &
54
- GetContextParameter<TContext>,
53
+ GetContextParameter<TContext>
55
54
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
56
55
  };
57
56
 
@@ -70,21 +69,20 @@ type ManagementActions<
70
69
  TContext extends UserOperationContext | undefined =
71
70
  | Record<string, any>
72
71
  | undefined,
73
- TEntryPointVersion extends
74
- GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
72
+ TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
75
73
  > = {
76
74
  installMultiOwnerPlugin: (
77
75
  args: UserOperationOverridesParameter<TEntryPointVersion> &
78
76
  InstallMultiOwnerPluginParams &
79
77
  GetAccountParameter<TAccount> &
80
- GetContextParameter<TContext>,
78
+ GetContextParameter<TContext>
81
79
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
82
80
  };
83
81
 
84
82
  type ReadAndEncodeActions<
85
83
  TAccount extends SmartContractAccount | undefined =
86
84
  | SmartContractAccount
87
- | undefined,
85
+ | undefined
88
86
  > = {
89
87
  encodeUpdateOwners: (
90
88
  args: Pick<
@@ -93,7 +91,7 @@ type ReadAndEncodeActions<
93
91
  "updateOwners"
94
92
  >,
95
93
  "args"
96
- >,
94
+ >
97
95
  ) => Hex;
98
96
 
99
97
  encodeEip712Domain: (
@@ -103,11 +101,11 @@ type ReadAndEncodeActions<
103
101
  "eip712Domain"
104
102
  >,
105
103
  "args"
106
- >,
104
+ >
107
105
  ) => Hex;
108
106
 
109
107
  readEip712Domain: (
110
- args: GetAccountParameter<TAccount>,
108
+ args: GetAccountParameter<TAccount>
111
109
  ) => Promise<
112
110
  ReadContractReturnType<
113
111
  typeof MultiOwnerPluginExecutionFunctionAbi,
@@ -122,7 +120,7 @@ type ReadAndEncodeActions<
122
120
  "isValidSignature"
123
121
  >,
124
122
  "args"
125
- >,
123
+ >
126
124
  ) => Hex;
127
125
 
128
126
  readIsValidSignature: (
@@ -133,7 +131,7 @@ type ReadAndEncodeActions<
133
131
  >,
134
132
  "args"
135
133
  > &
136
- GetAccountParameter<TAccount>,
134
+ GetAccountParameter<TAccount>
137
135
  ) => Promise<
138
136
  ReadContractReturnType<
139
137
  typeof MultiOwnerPluginExecutionFunctionAbi,
@@ -148,7 +146,7 @@ export type MultiOwnerPluginActions<
148
146
  | undefined,
149
147
  TContext extends UserOperationContext | undefined =
150
148
  | UserOperationContext
151
- | undefined,
149
+ | undefined
152
150
  > = ExecutionActions<TAccount, TContext> &
153
151
  ManagementActions<TAccount, TContext> &
154
152
  ReadAndEncodeActions<TAccount>;
@@ -179,7 +177,7 @@ export const MultiOwnerPlugin: Plugin<typeof MultiOwnerPluginAbi> = {
179
177
  },
180
178
  getContract: <C extends Client>(
181
179
  client: C,
182
- address?: Address,
180
+ address?: Address
183
181
  ): GetContractReturnType<
184
182
  typeof MultiOwnerPluginAbi,
185
183
  PublicClient,
@@ -207,9 +205,9 @@ export const multiOwnerPluginActions: <
207
205
  | undefined,
208
206
  TContext extends UserOperationContext | undefined =
209
207
  | UserOperationContext
210
- | undefined,
208
+ | undefined
211
209
  >(
212
- client: Client<TTransport, TChain, TAccount>,
210
+ client: Client<TTransport, TChain, TAccount>
213
211
  ) => MultiOwnerPluginActions<TAccount, TContext> = (client) => ({
214
212
  updateOwners({ args, overrides, context, account = client.account }) {
215
213
  if (!account) {
@@ -219,7 +217,7 @@ export const multiOwnerPluginActions: <
219
217
  throw new IncompatibleClientError(
220
218
  "SmartAccountClient",
221
219
  "updateOwners",
222
- client,
220
+ client
223
221
  );
224
222
  }
225
223
 
@@ -245,7 +243,7 @@ export const multiOwnerPluginActions: <
245
243
  throw new IncompatibleClientError(
246
244
  "SmartAccountClient",
247
245
  "installMultiOwnerPlugin",
248
- client,
246
+ client
249
247
  );
250
248
  }
251
249
 
@@ -261,7 +259,7 @@ export const multiOwnerPluginActions: <
261
259
 
262
260
  if (!pluginAddress) {
263
261
  throw new Error(
264
- "missing MultiOwnerPlugin address for chain " + chain.name,
262
+ "missing MultiOwnerPlugin address for chain " + chain.name
265
263
  );
266
264
  }
267
265
 
@@ -297,7 +295,7 @@ export const multiOwnerPluginActions: <
297
295
  throw new IncompatibleClientError(
298
296
  "SmartAccountClient",
299
297
  "readEip712Domain",
300
- client,
298
+ client
301
299
  );
302
300
  }
303
301
 
@@ -324,7 +322,7 @@ export const multiOwnerPluginActions: <
324
322
  throw new IncompatibleClientError(
325
323
  "SmartAccountClient",
326
324
  "readIsValidSignature",
327
- client,
325
+ client
328
326
  );
329
327
  }
330
328
 
@@ -38,8 +38,7 @@ type ExecutionActions<
38
38
  TContext extends UserOperationContext | undefined =
39
39
  | UserOperationContext
40
40
  | undefined,
41
- TEntryPointVersion extends
42
- GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
41
+ TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
43
42
  > = {
44
43
  updateOwnership: (
45
44
  args: Pick<
@@ -51,7 +50,7 @@ type ExecutionActions<
51
50
  > &
52
51
  UserOperationOverridesParameter<TEntryPointVersion> &
53
52
  GetAccountParameter<TAccount> &
54
- GetContextParameter<TContext>,
53
+ GetContextParameter<TContext>
55
54
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
56
55
  };
57
56
 
@@ -70,21 +69,20 @@ type ManagementActions<
70
69
  TContext extends UserOperationContext | undefined =
71
70
  | Record<string, any>
72
71
  | undefined,
73
- TEntryPointVersion extends
74
- GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
72
+ TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
75
73
  > = {
76
74
  installMultisigPlugin: (
77
75
  args: UserOperationOverridesParameter<TEntryPointVersion> &
78
76
  InstallMultisigPluginParams &
79
77
  GetAccountParameter<TAccount> &
80
- GetContextParameter<TContext>,
78
+ GetContextParameter<TContext>
81
79
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
82
80
  };
83
81
 
84
82
  type ReadAndEncodeActions<
85
83
  TAccount extends SmartContractAccount | undefined =
86
84
  | SmartContractAccount
87
- | undefined,
85
+ | undefined
88
86
  > = {
89
87
  encodeUpdateOwnership: (
90
88
  args: Pick<
@@ -93,7 +91,7 @@ type ReadAndEncodeActions<
93
91
  "updateOwnership"
94
92
  >,
95
93
  "args"
96
- >,
94
+ >
97
95
  ) => Hex;
98
96
 
99
97
  encodeEip712Domain: (
@@ -103,11 +101,11 @@ type ReadAndEncodeActions<
103
101
  "eip712Domain"
104
102
  >,
105
103
  "args"
106
- >,
104
+ >
107
105
  ) => Hex;
108
106
 
109
107
  readEip712Domain: (
110
- args: GetAccountParameter<TAccount>,
108
+ args: GetAccountParameter<TAccount>
111
109
  ) => Promise<
112
110
  ReadContractReturnType<
113
111
  typeof MultisigPluginExecutionFunctionAbi,
@@ -122,7 +120,7 @@ type ReadAndEncodeActions<
122
120
  "isValidSignature"
123
121
  >,
124
122
  "args"
125
- >,
123
+ >
126
124
  ) => Hex;
127
125
 
128
126
  readIsValidSignature: (
@@ -133,7 +131,7 @@ type ReadAndEncodeActions<
133
131
  >,
134
132
  "args"
135
133
  > &
136
- GetAccountParameter<TAccount>,
134
+ GetAccountParameter<TAccount>
137
135
  ) => Promise<
138
136
  ReadContractReturnType<
139
137
  typeof MultisigPluginExecutionFunctionAbi,
@@ -148,7 +146,7 @@ export type MultisigPluginActions<
148
146
  | undefined,
149
147
  TContext extends UserOperationContext | undefined =
150
148
  | UserOperationContext
151
- | undefined,
149
+ | undefined
152
150
  > = ExecutionActions<TAccount, TContext> &
153
151
  ManagementActions<TAccount, TContext> &
154
152
  ReadAndEncodeActions<TAccount>;
@@ -178,7 +176,7 @@ export const MultisigPlugin: Plugin<typeof MultisigPluginAbi> = {
178
176
  },
179
177
  getContract: <C extends Client>(
180
178
  client: C,
181
- address?: Address,
179
+ address?: Address
182
180
  ): GetContractReturnType<typeof MultisigPluginAbi, PublicClient, Address> => {
183
181
  if (!client.chain) throw new ChainNotFoundError();
184
182
 
@@ -202,9 +200,9 @@ export const multisigPluginActions: <
202
200
  | undefined,
203
201
  TContext extends UserOperationContext | undefined =
204
202
  | UserOperationContext
205
- | undefined,
203
+ | undefined
206
204
  >(
207
- client: Client<TTransport, TChain, TAccount>,
205
+ client: Client<TTransport, TChain, TAccount>
208
206
  ) => MultisigPluginActions<TAccount, TContext> = (client) => ({
209
207
  updateOwnership({ args, overrides, context, account = client.account }) {
210
208
  if (!account) {
@@ -214,7 +212,7 @@ export const multisigPluginActions: <
214
212
  throw new IncompatibleClientError(
215
213
  "SmartAccountClient",
216
214
  "updateOwnership",
217
- client,
215
+ client
218
216
  );
219
217
  }
220
218
 
@@ -240,7 +238,7 @@ export const multisigPluginActions: <
240
238
  throw new IncompatibleClientError(
241
239
  "SmartAccountClient",
242
240
  "installMultisigPlugin",
243
- client,
241
+ client
244
242
  );
245
243
  }
246
244
 
@@ -262,7 +260,7 @@ export const multisigPluginActions: <
262
260
  pluginAddress,
263
261
  pluginInitData: encodeAbiParameters(
264
262
  [{ type: "address[]" }, { type: "uint256" }],
265
- params.args,
263
+ params.args
266
264
  ),
267
265
  dependencies,
268
266
  overrides,
@@ -293,7 +291,7 @@ export const multisigPluginActions: <
293
291
  throw new IncompatibleClientError(
294
292
  "SmartAccountClient",
295
293
  "readEip712Domain",
296
- client,
294
+ client
297
295
  );
298
296
  }
299
297
 
@@ -320,7 +318,7 @@ export const multisigPluginActions: <
320
318
  throw new IncompatibleClientError(
321
319
  "SmartAccountClient",
322
320
  "readIsValidSignature",
323
- client,
321
+ client
324
322
  );
325
323
  }
326
324
 
@@ -39,8 +39,7 @@ type ExecutionActions<
39
39
  TContext extends UserOperationContext | undefined =
40
40
  | UserOperationContext
41
41
  | undefined,
42
- TEntryPointVersion extends
43
- GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
42
+ TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
44
43
  > = {
45
44
  executeWithSessionKey: (
46
45
  args: Pick<
@@ -52,7 +51,7 @@ type ExecutionActions<
52
51
  > &
53
52
  UserOperationOverridesParameter<TEntryPointVersion> &
54
53
  GetAccountParameter<TAccount> &
55
- GetContextParameter<TContext>,
54
+ GetContextParameter<TContext>
56
55
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
57
56
 
58
57
  addSessionKey: (
@@ -65,7 +64,7 @@ type ExecutionActions<
65
64
  > &
66
65
  UserOperationOverridesParameter<TEntryPointVersion> &
67
66
  GetAccountParameter<TAccount> &
68
- GetContextParameter<TContext>,
67
+ GetContextParameter<TContext>
69
68
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
70
69
 
71
70
  removeSessionKey: (
@@ -78,7 +77,7 @@ type ExecutionActions<
78
77
  > &
79
78
  UserOperationOverridesParameter<TEntryPointVersion> &
80
79
  GetAccountParameter<TAccount> &
81
- GetContextParameter<TContext>,
80
+ GetContextParameter<TContext>
82
81
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
83
82
 
84
83
  rotateSessionKey: (
@@ -91,7 +90,7 @@ type ExecutionActions<
91
90
  > &
92
91
  UserOperationOverridesParameter<TEntryPointVersion> &
93
92
  GetAccountParameter<TAccount> &
94
- GetContextParameter<TContext>,
93
+ GetContextParameter<TContext>
95
94
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
96
95
 
97
96
  updateKeyPermissions: (
@@ -104,14 +103,14 @@ type ExecutionActions<
104
103
  > &
105
104
  UserOperationOverridesParameter<TEntryPointVersion> &
106
105
  GetAccountParameter<TAccount> &
107
- GetContextParameter<TContext>,
106
+ GetContextParameter<TContext>
108
107
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
109
108
  };
110
109
 
111
110
  type InstallArgs = [
112
111
  { type: "address[]"; name: "initialKeys" },
113
112
  { type: "bytes32[]"; name: "tags" },
114
- { type: "bytes[][]"; name: "initialPermissions" },
113
+ { type: "bytes[][]"; name: "initialPermissions" }
115
114
  ];
116
115
 
117
116
  export type InstallSessionKeyPluginParams = {
@@ -127,14 +126,13 @@ type ManagementActions<
127
126
  TContext extends UserOperationContext | undefined =
128
127
  | Record<string, any>
129
128
  | undefined,
130
- TEntryPointVersion extends
131
- GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
129
+ TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
132
130
  > = {
133
131
  installSessionKeyPlugin: (
134
132
  args: UserOperationOverridesParameter<TEntryPointVersion> &
135
133
  InstallSessionKeyPluginParams &
136
134
  GetAccountParameter<TAccount> &
137
- GetContextParameter<TContext>,
135
+ GetContextParameter<TContext>
138
136
  ) => Promise<SendUserOperationResult<TEntryPointVersion>>;
139
137
  };
140
138
 
@@ -146,7 +144,7 @@ type ReadAndEncodeActions = {
146
144
  "executeWithSessionKey"
147
145
  >,
148
146
  "args"
149
- >,
147
+ >
150
148
  ) => Hex;
151
149
 
152
150
  encodeAddSessionKey: (
@@ -156,7 +154,7 @@ type ReadAndEncodeActions = {
156
154
  "addSessionKey"
157
155
  >,
158
156
  "args"
159
- >,
157
+ >
160
158
  ) => Hex;
161
159
 
162
160
  encodeRemoveSessionKey: (
@@ -166,7 +164,7 @@ type ReadAndEncodeActions = {
166
164
  "removeSessionKey"
167
165
  >,
168
166
  "args"
169
- >,
167
+ >
170
168
  ) => Hex;
171
169
 
172
170
  encodeRotateSessionKey: (
@@ -176,7 +174,7 @@ type ReadAndEncodeActions = {
176
174
  "rotateSessionKey"
177
175
  >,
178
176
  "args"
179
- >,
177
+ >
180
178
  ) => Hex;
181
179
 
182
180
  encodeUpdateKeyPermissions: (
@@ -186,7 +184,7 @@ type ReadAndEncodeActions = {
186
184
  "updateKeyPermissions"
187
185
  >,
188
186
  "args"
189
- >,
187
+ >
190
188
  ) => Hex;
191
189
  };
192
190
 
@@ -196,7 +194,7 @@ export type SessionKeyPluginActions<
196
194
  | undefined,
197
195
  TContext extends UserOperationContext | undefined =
198
196
  | UserOperationContext
199
- | undefined,
197
+ | undefined
200
198
  > = ExecutionActions<TAccount, TContext> &
201
199
  ManagementActions<TAccount, TContext> &
202
200
  ReadAndEncodeActions;
@@ -227,7 +225,7 @@ export const SessionKeyPlugin: Plugin<typeof SessionKeyPluginAbi> = {
227
225
  },
228
226
  getContract: <C extends Client>(
229
227
  client: C,
230
- address?: Address,
228
+ address?: Address
231
229
  ): GetContractReturnType<
232
230
  typeof SessionKeyPluginAbi,
233
231
  PublicClient,
@@ -255,9 +253,9 @@ export const sessionKeyPluginActions: <
255
253
  | undefined,
256
254
  TContext extends UserOperationContext | undefined =
257
255
  | UserOperationContext
258
- | undefined,
256
+ | undefined
259
257
  >(
260
- client: Client<TTransport, TChain, TAccount>,
258
+ client: Client<TTransport, TChain, TAccount>
261
259
  ) => SessionKeyPluginActions<TAccount, TContext> = (client) => ({
262
260
  executeWithSessionKey({
263
261
  args,
@@ -272,7 +270,7 @@ export const sessionKeyPluginActions: <
272
270
  throw new IncompatibleClientError(
273
271
  "SmartAccountClient",
274
272
  "executeWithSessionKey",
275
- client,
273
+ client
276
274
  );
277
275
  }
278
276
 
@@ -292,7 +290,7 @@ export const sessionKeyPluginActions: <
292
290
  throw new IncompatibleClientError(
293
291
  "SmartAccountClient",
294
292
  "addSessionKey",
295
- client,
293
+ client
296
294
  );
297
295
  }
298
296
 
@@ -312,7 +310,7 @@ export const sessionKeyPluginActions: <
312
310
  throw new IncompatibleClientError(
313
311
  "SmartAccountClient",
314
312
  "removeSessionKey",
315
- client,
313
+ client
316
314
  );
317
315
  }
318
316
 
@@ -332,7 +330,7 @@ export const sessionKeyPluginActions: <
332
330
  throw new IncompatibleClientError(
333
331
  "SmartAccountClient",
334
332
  "rotateSessionKey",
335
- client,
333
+ client
336
334
  );
337
335
  }
338
336
 
@@ -352,7 +350,7 @@ export const sessionKeyPluginActions: <
352
350
  throw new IncompatibleClientError(
353
351
  "SmartAccountClient",
354
352
  "updateKeyPermissions",
355
- client,
353
+ client
356
354
  );
357
355
  }
358
356
 
@@ -378,7 +376,7 @@ export const sessionKeyPluginActions: <
378
376
  throw new IncompatibleClientError(
379
377
  "SmartAccountClient",
380
378
  "installSessionKeyPlugin",
381
- client,
379
+ client
382
380
  );
383
381
  }
384
382
 
@@ -392,7 +390,7 @@ export const sessionKeyPluginActions: <
392
390
  const pluginAddress = MultiOwnerPlugin.meta.addresses[chain.id];
393
391
  if (!pluginAddress) {
394
392
  throw new Error(
395
- "missing MultiOwnerPlugin address for chain " + chain.name,
393
+ "missing MultiOwnerPlugin address for chain " + chain.name
396
394
  );
397
395
  }
398
396
 
@@ -403,7 +401,7 @@ export const sessionKeyPluginActions: <
403
401
  const pluginAddress = MultiOwnerPlugin.meta.addresses[chain.id];
404
402
  if (!pluginAddress) {
405
403
  throw new Error(
406
- "missing MultiOwnerPlugin address for chain " + chain.name,
404
+ "missing MultiOwnerPlugin address for chain " + chain.name
407
405
  );
408
406
  }
409
407
 
@@ -416,7 +414,7 @@ export const sessionKeyPluginActions: <
416
414
 
417
415
  if (!pluginAddress) {
418
416
  throw new Error(
419
- "missing SessionKeyPlugin address for chain " + chain.name,
417
+ "missing SessionKeyPlugin address for chain " + chain.name
420
418
  );
421
419
  }
422
420
 
@@ -428,7 +426,7 @@ export const sessionKeyPluginActions: <
428
426
  { type: "bytes32[]", name: "tags" },
429
427
  { type: "bytes[][]", name: "initialPermissions" },
430
428
  ],
431
- params.args,
429
+ params.args
432
430
  ),
433
431
  dependencies,
434
432
  overrides,