@metamask/smart-accounts-kit 1.2.0 → 1.4.0
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.
- package/CHANGELOG.md +17 -1
- package/dist/actions/index.cjs +4 -4
- package/dist/actions/index.d.cts +2 -2
- package/dist/actions/index.d.ts +2 -2
- package/dist/actions/index.mjs +3 -3
- package/dist/{caveats-CQbtzOKm.d.ts → caveats-BhjGBVHX.d.ts} +1 -1
- package/dist/{caveats-Cey0wm33.d.cts → caveats-CeHBbmt_.d.cts} +1 -1
- package/dist/{chunk-T4IAMAB2.cjs → chunk-6CEOFJY5.cjs} +173 -61
- package/dist/chunk-6CEOFJY5.cjs.map +1 -0
- package/dist/{chunk-VJXM3LWA.mjs → chunk-DVJX76J3.mjs} +2 -2
- package/dist/{chunk-ZA2XYCVX.mjs → chunk-EEIIVBNV.mjs} +22 -18
- package/dist/chunk-EEIIVBNV.mjs.map +1 -0
- package/dist/{chunk-G7VZ7E6W.mjs → chunk-FG2CQGSE.mjs} +3 -3
- package/dist/{chunk-L5DLMBDC.mjs → chunk-HQHXGWNJ.mjs} +4 -4
- package/dist/{chunk-UB2FLPP3.cjs → chunk-MVBU3LRV.cjs} +10 -10
- package/dist/{chunk-UB2FLPP3.cjs.map → chunk-MVBU3LRV.cjs.map} +1 -1
- package/dist/{chunk-734MOPHR.mjs → chunk-R2WT54GZ.mjs} +121 -9
- package/dist/chunk-R2WT54GZ.mjs.map +1 -0
- package/dist/{chunk-HFRQNSZE.cjs → chunk-RR2AMG4A.cjs} +102 -102
- package/dist/{chunk-HFRQNSZE.cjs.map → chunk-RR2AMG4A.cjs.map} +1 -1
- package/dist/{chunk-UZO5OYCD.cjs → chunk-SO5JAXGD.cjs} +11 -11
- package/dist/{chunk-UZO5OYCD.cjs.map → chunk-SO5JAXGD.cjs.map} +1 -1
- package/dist/{chunk-7BEEGBA2.cjs → chunk-TMO23YRP.cjs} +19 -15
- package/dist/chunk-TMO23YRP.cjs.map +1 -0
- package/dist/{chunk-3SHZ7PV2.cjs → chunk-XZ7UMCG3.cjs} +12 -12
- package/dist/{chunk-3SHZ7PV2.cjs.map → chunk-XZ7UMCG3.cjs.map} +1 -1
- package/dist/{chunk-YTNCEXUX.mjs → chunk-ZGBFPD4O.mjs} +2 -2
- package/dist/contracts/index.cjs +5 -5
- package/dist/contracts/index.d.cts +2 -2
- package/dist/contracts/index.d.ts +2 -2
- package/dist/contracts/index.mjs +4 -4
- package/dist/{delegation-Bx4FEAIU.d.ts → delegation-CR99q1-n.d.ts} +2 -6
- package/dist/{delegation-KbWHzRxV.d.cts → delegation-DoVULGYE.d.cts} +2 -6
- package/dist/experimental/index.cjs +7 -7
- package/dist/experimental/index.mjs +1 -1
- package/dist/{index-Uj_xXVko.d.cts → index-BToRQKyJ.d.cts} +27 -5
- package/dist/{index-D7fBuNV-.d.ts → index-Cg-JakqA.d.ts} +27 -5
- package/dist/{index-D2THBlfm.d.ts → index-DRKgDSZW.d.ts} +1 -1
- package/dist/{index-DE87r5KY.d.cts → index-DzL9ccjU.d.cts} +1 -1
- package/dist/index.cjs +22 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +9 -7
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.cjs +4 -4
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.mjs +3 -3
- package/package.json +4 -4
- package/dist/chunk-734MOPHR.mjs.map +0 -1
- package/dist/chunk-7BEEGBA2.cjs.map +0 -1
- package/dist/chunk-T4IAMAB2.cjs.map +0 -1
- package/dist/chunk-ZA2XYCVX.mjs.map +0 -1
- /package/dist/{chunk-VJXM3LWA.mjs.map → chunk-DVJX76J3.mjs.map} +0 -0
- /package/dist/{chunk-G7VZ7E6W.mjs.map → chunk-FG2CQGSE.mjs.map} +0 -0
- /package/dist/{chunk-L5DLMBDC.mjs.map → chunk-HQHXGWNJ.mjs.map} +0 -0
- /package/dist/{chunk-YTNCEXUX.mjs.map → chunk-ZGBFPD4O.mjs.map} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkXZ7UMCG3cjs = require('./chunk-XZ7UMCG3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -21,11 +21,11 @@ var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkTMO23YRPcjs = require('./chunk-TMO23YRP.cjs');
|
|
25
25
|
|
|
26
26
|
// src/actions/index.ts
|
|
27
27
|
var actions_exports = {};
|
|
28
|
-
|
|
28
|
+
_chunkTMO23YRPcjs.__export.call(void 0, actions_exports, {
|
|
29
29
|
caveatEnforcerActions: () => caveatEnforcerActions,
|
|
30
30
|
erc7710BundlerActions: () => erc7710BundlerActions,
|
|
31
31
|
erc7710WalletActions: () => erc7710WalletActions,
|
|
@@ -49,7 +49,7 @@ _chunk7BEEGBA2cjs.__export.call(void 0, actions_exports, {
|
|
|
49
49
|
var _delegationabis = require('@metamask/delegation-abis');
|
|
50
50
|
var _viem = require('viem');
|
|
51
51
|
async function sendTransactionWithDelegationAction(client, args) {
|
|
52
|
-
|
|
52
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0, "sendTransactionWithDelegationAction", {
|
|
53
53
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]), () => ( null))
|
|
54
54
|
});
|
|
55
55
|
if (!args.to) {
|
|
@@ -78,7 +78,7 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
78
78
|
abi: _delegationabis.DelegationManager,
|
|
79
79
|
functionName: "redeemDelegations",
|
|
80
80
|
args: [
|
|
81
|
-
[
|
|
81
|
+
[_chunkTMO23YRPcjs.encodeDelegations.call(void 0, args.permissionContext)],
|
|
82
82
|
["0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */],
|
|
83
83
|
_chunkMOHCTPYQcjs.encodeExecutionCalldatas.call(void 0, [executions])
|
|
84
84
|
]
|
|
@@ -97,7 +97,7 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
97
97
|
return hash;
|
|
98
98
|
}
|
|
99
99
|
async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
100
|
-
|
|
100
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0, "sendUserOperationWithDelegationAction", {
|
|
101
101
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _5 => _5.chain, 'optionalAccess', _6 => _6.id]), () => ( null)),
|
|
102
102
|
callCount: parameters.calls.length,
|
|
103
103
|
hasDependencies: parameters.dependencies !== void 0
|
|
@@ -152,7 +152,7 @@ async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
|
152
152
|
}
|
|
153
153
|
return {
|
|
154
154
|
...call,
|
|
155
|
-
permissionContext:
|
|
155
|
+
permissionContext: _chunkTMO23YRPcjs.encodeDelegations.call(void 0, permissionContext)
|
|
156
156
|
};
|
|
157
157
|
});
|
|
158
158
|
return client.sendUserOperation(
|
|
@@ -163,18 +163,55 @@ async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
|
163
163
|
// src/actions/erc7715Mapping.ts
|
|
164
164
|
|
|
165
165
|
function permissionRequestToRpc(parameters) {
|
|
166
|
-
const { chainId, from, expiry } = parameters;
|
|
166
|
+
const { chainId, from, expiry, redeemer, payee } = parameters;
|
|
167
167
|
const converter = getPermissionRequestToRpcConverter(
|
|
168
168
|
parameters.permission.type
|
|
169
169
|
);
|
|
170
|
-
const rules =
|
|
171
|
-
|
|
170
|
+
const rules = [];
|
|
171
|
+
if (_chunkTMO23YRPcjs.isDefined.call(void 0, expiry)) {
|
|
172
|
+
rules.push({
|
|
172
173
|
type: "expiry",
|
|
173
174
|
data: {
|
|
174
175
|
timestamp: expiry
|
|
175
176
|
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (_chunkTMO23YRPcjs.isDefined.call(void 0, redeemer)) {
|
|
180
|
+
if (redeemer.length === 0) {
|
|
181
|
+
throw new Error(
|
|
182
|
+
"Invalid redeemers: must specify at least one redeemer address"
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
const addresses = [];
|
|
186
|
+
for (const addr of redeemer) {
|
|
187
|
+
if (!_viem.isAddress.call(void 0, addr)) {
|
|
188
|
+
throw new Error("Invalid redeemers: must be a valid address");
|
|
189
|
+
}
|
|
190
|
+
addresses.push(_viem.getAddress.call(void 0, addr));
|
|
191
|
+
}
|
|
192
|
+
rules.push({
|
|
193
|
+
type: "redeemer",
|
|
194
|
+
data: { addresses }
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
if (_chunkTMO23YRPcjs.isDefined.call(void 0, payee)) {
|
|
198
|
+
if (payee.length === 0) {
|
|
199
|
+
throw new Error(
|
|
200
|
+
"Invalid payees: must specify at least one payee address"
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
const payeeAddresses = [];
|
|
204
|
+
for (const addr of payee) {
|
|
205
|
+
if (!_viem.isAddress.call(void 0, addr)) {
|
|
206
|
+
throw new Error("Invalid payees: must be a valid address");
|
|
207
|
+
}
|
|
208
|
+
payeeAddresses.push(_viem.getAddress.call(void 0, addr));
|
|
176
209
|
}
|
|
177
|
-
|
|
210
|
+
rules.push({
|
|
211
|
+
type: "payee",
|
|
212
|
+
data: { addresses: payeeAddresses }
|
|
213
|
+
});
|
|
214
|
+
}
|
|
178
215
|
const optionalFields = {
|
|
179
216
|
...from ? { from } : {}
|
|
180
217
|
};
|
|
@@ -200,10 +237,18 @@ function getPermissionRequestToRpcConverter(permissionType) {
|
|
|
200
237
|
return (permission) => nativeTokenPeriodicPermissionToRpc(
|
|
201
238
|
permission
|
|
202
239
|
);
|
|
240
|
+
case "native-token-allowance":
|
|
241
|
+
return (permission) => nativeTokenAllowancePermissionToRpc(
|
|
242
|
+
permission
|
|
243
|
+
);
|
|
203
244
|
case "erc20-token-periodic":
|
|
204
245
|
return (permission) => erc20TokenPeriodicPermissionToRpc(
|
|
205
246
|
permission
|
|
206
247
|
);
|
|
248
|
+
case "erc20-token-allowance":
|
|
249
|
+
return (permission) => erc20TokenAllowancePermissionToRpc(
|
|
250
|
+
permission
|
|
251
|
+
);
|
|
207
252
|
case "erc20-token-revocation":
|
|
208
253
|
return (permission) => erc20TokenRevocationPermissionToRpc(
|
|
209
254
|
permission
|
|
@@ -224,13 +269,13 @@ function nativeTokenStreamPermissionToRpc(permission) {
|
|
|
224
269
|
isAdjustmentAllowed
|
|
225
270
|
} = permission;
|
|
226
271
|
const optionalFields = {
|
|
227
|
-
...
|
|
228
|
-
initialAmount:
|
|
272
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, initialAmount) && {
|
|
273
|
+
initialAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, initialAmount, "initialAmount")
|
|
229
274
|
},
|
|
230
|
-
...
|
|
231
|
-
maxAmount:
|
|
275
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, maxAmount) && {
|
|
276
|
+
maxAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, maxAmount, "maxAmount")
|
|
232
277
|
},
|
|
233
|
-
...
|
|
278
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
234
279
|
startTime: Number(startTime)
|
|
235
280
|
},
|
|
236
281
|
...justification ? { justification } : {}
|
|
@@ -238,7 +283,7 @@ function nativeTokenStreamPermissionToRpc(permission) {
|
|
|
238
283
|
return {
|
|
239
284
|
type: "native-token-stream",
|
|
240
285
|
data: {
|
|
241
|
-
amountPerSecond:
|
|
286
|
+
amountPerSecond: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, amountPerSecond, "amountPerSecond"),
|
|
242
287
|
...optionalFields
|
|
243
288
|
},
|
|
244
289
|
isAdjustmentAllowed
|
|
@@ -257,13 +302,13 @@ function erc20TokenStreamPermissionToRpc(permission) {
|
|
|
257
302
|
isAdjustmentAllowed
|
|
258
303
|
} = permission;
|
|
259
304
|
const optionalFields = {
|
|
260
|
-
...
|
|
261
|
-
initialAmount:
|
|
305
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, initialAmount) && {
|
|
306
|
+
initialAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, initialAmount, "initialAmount")
|
|
262
307
|
},
|
|
263
|
-
...
|
|
264
|
-
maxAmount:
|
|
308
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, maxAmount) && {
|
|
309
|
+
maxAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, maxAmount, "maxAmount")
|
|
265
310
|
},
|
|
266
|
-
...
|
|
311
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
267
312
|
startTime: Number(startTime)
|
|
268
313
|
},
|
|
269
314
|
...justification ? { justification } : {}
|
|
@@ -271,8 +316,8 @@ function erc20TokenStreamPermissionToRpc(permission) {
|
|
|
271
316
|
return {
|
|
272
317
|
type: "erc20-token-stream",
|
|
273
318
|
data: {
|
|
274
|
-
tokenAddress:
|
|
275
|
-
amountPerSecond:
|
|
319
|
+
tokenAddress: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
320
|
+
amountPerSecond: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, amountPerSecond, "amountPerSecond"),
|
|
276
321
|
...optionalFields
|
|
277
322
|
},
|
|
278
323
|
isAdjustmentAllowed
|
|
@@ -284,7 +329,7 @@ function nativeTokenPeriodicPermissionToRpc(permission) {
|
|
|
284
329
|
isAdjustmentAllowed
|
|
285
330
|
} = permission;
|
|
286
331
|
const optionalFields = {
|
|
287
|
-
...
|
|
332
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
288
333
|
startTime: Number(startTime)
|
|
289
334
|
},
|
|
290
335
|
...justification ? { justification } : {}
|
|
@@ -292,7 +337,7 @@ function nativeTokenPeriodicPermissionToRpc(permission) {
|
|
|
292
337
|
return {
|
|
293
338
|
type: "native-token-periodic",
|
|
294
339
|
data: {
|
|
295
|
-
periodAmount:
|
|
340
|
+
periodAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, periodAmount, "periodAmount"),
|
|
296
341
|
periodDuration: Number(periodDuration),
|
|
297
342
|
...optionalFields
|
|
298
343
|
},
|
|
@@ -311,7 +356,7 @@ function erc20TokenPeriodicPermissionToRpc(permission) {
|
|
|
311
356
|
isAdjustmentAllowed
|
|
312
357
|
} = permission;
|
|
313
358
|
const optionalFields = {
|
|
314
|
-
...
|
|
359
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
315
360
|
startTime: Number(startTime)
|
|
316
361
|
},
|
|
317
362
|
...justification ? { justification } : {}
|
|
@@ -319,14 +364,55 @@ function erc20TokenPeriodicPermissionToRpc(permission) {
|
|
|
319
364
|
return {
|
|
320
365
|
type: "erc20-token-periodic",
|
|
321
366
|
data: {
|
|
322
|
-
tokenAddress:
|
|
323
|
-
periodAmount:
|
|
367
|
+
tokenAddress: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
368
|
+
periodAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, periodAmount, "periodAmount"),
|
|
324
369
|
periodDuration: Number(periodDuration),
|
|
325
370
|
...optionalFields
|
|
326
371
|
},
|
|
327
372
|
isAdjustmentAllowed
|
|
328
373
|
};
|
|
329
374
|
}
|
|
375
|
+
function nativeTokenAllowancePermissionToRpc(permission) {
|
|
376
|
+
const {
|
|
377
|
+
data: { allowanceAmount, startTime, justification },
|
|
378
|
+
isAdjustmentAllowed
|
|
379
|
+
} = permission;
|
|
380
|
+
const optionalFields = {
|
|
381
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
382
|
+
startTime: Number(startTime)
|
|
383
|
+
},
|
|
384
|
+
...justification ? { justification } : {}
|
|
385
|
+
};
|
|
386
|
+
return {
|
|
387
|
+
type: "native-token-allowance",
|
|
388
|
+
data: {
|
|
389
|
+
allowanceAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, allowanceAmount, "allowanceAmount"),
|
|
390
|
+
...optionalFields
|
|
391
|
+
},
|
|
392
|
+
isAdjustmentAllowed
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
function erc20TokenAllowancePermissionToRpc(permission) {
|
|
396
|
+
const {
|
|
397
|
+
data: { tokenAddress, allowanceAmount, startTime, justification },
|
|
398
|
+
isAdjustmentAllowed
|
|
399
|
+
} = permission;
|
|
400
|
+
const optionalFields = {
|
|
401
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
402
|
+
startTime: Number(startTime)
|
|
403
|
+
},
|
|
404
|
+
...justification ? { justification } : {}
|
|
405
|
+
};
|
|
406
|
+
return {
|
|
407
|
+
type: "erc20-token-allowance",
|
|
408
|
+
data: {
|
|
409
|
+
tokenAddress: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
410
|
+
allowanceAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, allowanceAmount, "allowanceAmount"),
|
|
411
|
+
...optionalFields
|
|
412
|
+
},
|
|
413
|
+
isAdjustmentAllowed
|
|
414
|
+
};
|
|
415
|
+
}
|
|
330
416
|
function erc20TokenRevocationPermissionToRpc(permission) {
|
|
331
417
|
const {
|
|
332
418
|
data: { justification },
|
|
@@ -345,9 +431,30 @@ function permissionResponsesFromRpc(result) {
|
|
|
345
431
|
return result.map((permission) => ({
|
|
346
432
|
...permission,
|
|
347
433
|
chainId: _viem.hexToNumber.call(void 0, permission.chainId),
|
|
348
|
-
permission: permissionTypeFromRpc(permission.permission)
|
|
434
|
+
permission: permissionTypeFromRpc(permission.permission),
|
|
435
|
+
rules: normalizeRulesFromRpc(permission.rules)
|
|
349
436
|
}));
|
|
350
437
|
}
|
|
438
|
+
function normalizeRulesFromRpc(rules) {
|
|
439
|
+
if (rules === void 0 || rules === null) {
|
|
440
|
+
return rules;
|
|
441
|
+
}
|
|
442
|
+
return rules.map((rule) => {
|
|
443
|
+
if (rule.type !== "redeemer" && rule.type !== "payee") {
|
|
444
|
+
return rule;
|
|
445
|
+
}
|
|
446
|
+
const rawAddresses = _optionalChain([rule, 'access', _9 => _9.data, 'optionalAccess', _10 => _10.addresses]);
|
|
447
|
+
if (!Array.isArray(rawAddresses)) {
|
|
448
|
+
return rule;
|
|
449
|
+
}
|
|
450
|
+
return {
|
|
451
|
+
type: rule.type,
|
|
452
|
+
data: {
|
|
453
|
+
addresses: rawAddresses.map((addr) => _viem.getAddress.call(void 0, addr))
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
});
|
|
457
|
+
}
|
|
351
458
|
function permissionTypeFromRpc(permission) {
|
|
352
459
|
const convertedData = { ...permission.data };
|
|
353
460
|
if ("amountPerSecond" in convertedData && convertedData.amountPerSecond) {
|
|
@@ -368,6 +475,11 @@ function permissionTypeFromRpc(permission) {
|
|
|
368
475
|
if ("maxAmount" in convertedData && convertedData.maxAmount) {
|
|
369
476
|
convertedData.maxAmount = BigInt(convertedData.maxAmount);
|
|
370
477
|
}
|
|
478
|
+
if ("allowanceAmount" in convertedData && convertedData.allowanceAmount) {
|
|
479
|
+
convertedData.allowanceAmount = BigInt(
|
|
480
|
+
convertedData.allowanceAmount
|
|
481
|
+
);
|
|
482
|
+
}
|
|
371
483
|
return {
|
|
372
484
|
...permission,
|
|
373
485
|
data: convertedData
|
|
@@ -386,10 +498,10 @@ function rpcSupportedPermissionsToDeveloper(result) {
|
|
|
386
498
|
|
|
387
499
|
// src/actions/erc7715GetGrantedExecutionPermissionsAction.ts
|
|
388
500
|
async function erc7715GetGrantedExecutionPermissionsAction(client) {
|
|
389
|
-
|
|
501
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
390
502
|
"erc7715GetGrantedExecutionPermissionsAction",
|
|
391
503
|
{
|
|
392
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
504
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]), () => ( null))
|
|
393
505
|
}
|
|
394
506
|
);
|
|
395
507
|
const result = await client.request(
|
|
@@ -407,10 +519,10 @@ async function erc7715GetGrantedExecutionPermissionsAction(client) {
|
|
|
407
519
|
|
|
408
520
|
// src/actions/erc7715GetSupportedExecutionPermissionsAction.ts
|
|
409
521
|
async function erc7715GetSupportedExecutionPermissionsAction(client) {
|
|
410
|
-
|
|
522
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
411
523
|
"erc7715GetSupportedExecutionPermissionsAction",
|
|
412
524
|
{
|
|
413
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
525
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _13 => _13.chain, 'optionalAccess', _14 => _14.id]), () => ( null))
|
|
414
526
|
}
|
|
415
527
|
);
|
|
416
528
|
const result = await client.request(
|
|
@@ -428,10 +540,10 @@ async function erc7715GetSupportedExecutionPermissionsAction(client) {
|
|
|
428
540
|
|
|
429
541
|
// src/actions/erc7715RequestExecutionPermissionsAction.ts
|
|
430
542
|
async function erc7715RequestExecutionPermissionsAction(client, parameters) {
|
|
431
|
-
|
|
543
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
432
544
|
"erc7715RequestExecutionPermissionsAction",
|
|
433
545
|
{
|
|
434
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
546
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _15 => _15.chain, 'optionalAccess', _16 => _16.id]), () => ( null)),
|
|
435
547
|
requestCount: parameters.length
|
|
436
548
|
}
|
|
437
549
|
);
|
|
@@ -489,10 +601,10 @@ function getEnforcerAddress({
|
|
|
489
601
|
return enforcerAddress;
|
|
490
602
|
}
|
|
491
603
|
async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment, params) {
|
|
492
|
-
|
|
604
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
493
605
|
"getErc20PeriodTransferEnforcerAvailableAmount",
|
|
494
606
|
{
|
|
495
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
607
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _17 => _17.chain, 'optionalAccess', _18 => _18.id]), () => ( null))
|
|
496
608
|
}
|
|
497
609
|
);
|
|
498
610
|
const enforcerName = "ERC20PeriodTransferEnforcer";
|
|
@@ -501,13 +613,13 @@ async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment
|
|
|
501
613
|
enforcerName,
|
|
502
614
|
environment
|
|
503
615
|
});
|
|
504
|
-
const delegationHash =
|
|
616
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
505
617
|
const { terms } = findMatchingCaveat({
|
|
506
618
|
delegation: params.delegation,
|
|
507
619
|
enforcerAddress,
|
|
508
620
|
enforcerName
|
|
509
621
|
});
|
|
510
|
-
return
|
|
622
|
+
return _chunkXZ7UMCG3cjs.read_exports.getAvailableAmount({
|
|
511
623
|
client,
|
|
512
624
|
contractAddress: enforcerAddress,
|
|
513
625
|
delegationHash,
|
|
@@ -516,10 +628,10 @@ async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment
|
|
|
516
628
|
});
|
|
517
629
|
}
|
|
518
630
|
async function getErc20StreamingEnforcerAvailableAmount(client, environment, params) {
|
|
519
|
-
|
|
631
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
520
632
|
"getErc20StreamingEnforcerAvailableAmount",
|
|
521
633
|
{
|
|
522
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
634
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _19 => _19.chain, 'optionalAccess', _20 => _20.id]), () => ( null))
|
|
523
635
|
}
|
|
524
636
|
);
|
|
525
637
|
const enforcerName = "ERC20StreamingEnforcer";
|
|
@@ -528,13 +640,13 @@ async function getErc20StreamingEnforcerAvailableAmount(client, environment, par
|
|
|
528
640
|
enforcerName,
|
|
529
641
|
environment
|
|
530
642
|
});
|
|
531
|
-
const delegationHash =
|
|
643
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
532
644
|
const { terms } = findMatchingCaveat({
|
|
533
645
|
delegation: params.delegation,
|
|
534
646
|
enforcerAddress,
|
|
535
647
|
enforcerName
|
|
536
648
|
});
|
|
537
|
-
return
|
|
649
|
+
return _chunkXZ7UMCG3cjs.read_exports2.getAvailableAmount({
|
|
538
650
|
client,
|
|
539
651
|
contractAddress: enforcerAddress,
|
|
540
652
|
delegationManager,
|
|
@@ -543,10 +655,10 @@ async function getErc20StreamingEnforcerAvailableAmount(client, environment, par
|
|
|
543
655
|
});
|
|
544
656
|
}
|
|
545
657
|
async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, params) {
|
|
546
|
-
|
|
658
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
547
659
|
"getMultiTokenPeriodEnforcerAvailableAmount",
|
|
548
660
|
{
|
|
549
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
661
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _21 => _21.chain, 'optionalAccess', _22 => _22.id]), () => ( null))
|
|
550
662
|
}
|
|
551
663
|
);
|
|
552
664
|
const enforcerName = "MultiTokenPeriodEnforcer";
|
|
@@ -555,13 +667,13 @@ async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, p
|
|
|
555
667
|
enforcerName,
|
|
556
668
|
environment
|
|
557
669
|
});
|
|
558
|
-
const delegationHash =
|
|
670
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
559
671
|
const { terms, args } = findMatchingCaveat({
|
|
560
672
|
delegation: params.delegation,
|
|
561
673
|
enforcerAddress,
|
|
562
674
|
enforcerName
|
|
563
675
|
});
|
|
564
|
-
return
|
|
676
|
+
return _chunkXZ7UMCG3cjs.read_exports3.getAvailableAmount({
|
|
565
677
|
client,
|
|
566
678
|
contractAddress: enforcerAddress,
|
|
567
679
|
delegationHash,
|
|
@@ -571,10 +683,10 @@ async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, p
|
|
|
571
683
|
});
|
|
572
684
|
}
|
|
573
685
|
async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, environment, params) {
|
|
574
|
-
|
|
686
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
575
687
|
"getNativeTokenPeriodTransferEnforcerAvailableAmount",
|
|
576
688
|
{
|
|
577
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
689
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _23 => _23.chain, 'optionalAccess', _24 => _24.id]), () => ( null))
|
|
578
690
|
}
|
|
579
691
|
);
|
|
580
692
|
const enforcerName = "NativeTokenPeriodTransferEnforcer";
|
|
@@ -583,13 +695,13 @@ async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, envir
|
|
|
583
695
|
enforcerName,
|
|
584
696
|
environment
|
|
585
697
|
});
|
|
586
|
-
const delegationHash =
|
|
698
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
587
699
|
const { terms } = findMatchingCaveat({
|
|
588
700
|
delegation: params.delegation,
|
|
589
701
|
enforcerAddress,
|
|
590
702
|
enforcerName
|
|
591
703
|
});
|
|
592
|
-
return
|
|
704
|
+
return _chunkXZ7UMCG3cjs.read_exports4.getAvailableAmount({
|
|
593
705
|
client,
|
|
594
706
|
contractAddress: enforcerAddress,
|
|
595
707
|
delegationHash,
|
|
@@ -598,10 +710,10 @@ async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, envir
|
|
|
598
710
|
});
|
|
599
711
|
}
|
|
600
712
|
async function getNativeTokenStreamingEnforcerAvailableAmount(client, environment, params) {
|
|
601
|
-
|
|
713
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
602
714
|
"getNativeTokenStreamingEnforcerAvailableAmount",
|
|
603
715
|
{
|
|
604
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
716
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _25 => _25.chain, 'optionalAccess', _26 => _26.id]), () => ( null))
|
|
605
717
|
}
|
|
606
718
|
);
|
|
607
719
|
const enforcerName = "NativeTokenStreamingEnforcer";
|
|
@@ -610,13 +722,13 @@ async function getNativeTokenStreamingEnforcerAvailableAmount(client, environmen
|
|
|
610
722
|
enforcerName,
|
|
611
723
|
environment
|
|
612
724
|
});
|
|
613
|
-
const delegationHash =
|
|
725
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
614
726
|
const { terms } = findMatchingCaveat({
|
|
615
727
|
delegation: params.delegation,
|
|
616
728
|
enforcerAddress,
|
|
617
729
|
enforcerName
|
|
618
730
|
});
|
|
619
|
-
return
|
|
731
|
+
return _chunkXZ7UMCG3cjs.read_exports5.getAvailableAmount({
|
|
620
732
|
client,
|
|
621
733
|
contractAddress: enforcerAddress,
|
|
622
734
|
delegationManager,
|
|
@@ -697,7 +809,7 @@ var caveatEnforcerActions = ({ environment }) => (client) => ({
|
|
|
697
809
|
var _actions = require('viem/actions');
|
|
698
810
|
var DELEGATION_PREFIX = "0xef0100";
|
|
699
811
|
function extractDelegatedAddress(code) {
|
|
700
|
-
if (_optionalChain([code, 'optionalAccess',
|
|
812
|
+
if (_optionalChain([code, 'optionalAccess', _27 => _27.length]) !== 48) {
|
|
701
813
|
return null;
|
|
702
814
|
}
|
|
703
815
|
if (!code.toLowerCase().startsWith(DELEGATION_PREFIX.toLowerCase())) {
|
|
@@ -746,7 +858,7 @@ async function signDelegation(client, parameters) {
|
|
|
746
858
|
throw new (0, _viem.BaseError)("Account not found. Please provide an account.");
|
|
747
859
|
}
|
|
748
860
|
const account = _accounts.parseAccount.call(void 0, accountParam);
|
|
749
|
-
const typedData =
|
|
861
|
+
const typedData = _chunkTMO23YRPcjs.prepareSignDelegationTypedData.call(void 0, {
|
|
750
862
|
delegation,
|
|
751
863
|
delegationManager,
|
|
752
864
|
chainId,
|
|
@@ -763,7 +875,7 @@ function signDelegationActions() {
|
|
|
763
875
|
return (client) => ({
|
|
764
876
|
signDelegation: async (parameters) => signDelegation(client, {
|
|
765
877
|
chainId: _nullishCoalesce(parameters.chainId, () => ( (() => {
|
|
766
|
-
if (!_optionalChain([client, 'access',
|
|
878
|
+
if (!_optionalChain([client, 'access', _28 => _28.chain, 'optionalAccess', _29 => _29.id])) {
|
|
767
879
|
throw new (0, _viem.BaseError)(
|
|
768
880
|
"Chain ID is required. Either provide it in parameters or configure the client with a chain."
|
|
769
881
|
);
|
|
@@ -809,7 +921,7 @@ function signUserOperationActions() {
|
|
|
809
921
|
return (client) => ({
|
|
810
922
|
signUserOperation: async (parameters) => signUserOperation(client, {
|
|
811
923
|
chainId: _nullishCoalesce(parameters.chainId, () => ( (() => {
|
|
812
|
-
if (!_optionalChain([client, 'access',
|
|
924
|
+
if (!_optionalChain([client, 'access', _30 => _30.chain, 'optionalAccess', _31 => _31.id])) {
|
|
813
925
|
throw new (0, _viem.BaseError)(
|
|
814
926
|
"Chain ID is required. Either provide it in parameters or configure the client with a chain."
|
|
815
927
|
);
|
|
@@ -867,4 +979,4 @@ var erc7710BundlerActions = () => (client) => ({
|
|
|
867
979
|
|
|
868
980
|
|
|
869
981
|
exports.isValid7702Implementation = isValid7702Implementation; exports.erc7715GetGrantedExecutionPermissionsAction = erc7715GetGrantedExecutionPermissionsAction; exports.erc7715GetSupportedExecutionPermissionsAction = erc7715GetSupportedExecutionPermissionsAction; exports.erc7715RequestExecutionPermissionsAction = erc7715RequestExecutionPermissionsAction; exports.getErc20PeriodTransferEnforcerAvailableAmount = getErc20PeriodTransferEnforcerAvailableAmount; exports.getErc20StreamingEnforcerAvailableAmount = getErc20StreamingEnforcerAvailableAmount; exports.getMultiTokenPeriodEnforcerAvailableAmount = getMultiTokenPeriodEnforcerAvailableAmount; exports.getNativeTokenPeriodTransferEnforcerAvailableAmount = getNativeTokenPeriodTransferEnforcerAvailableAmount; exports.getNativeTokenStreamingEnforcerAvailableAmount = getNativeTokenStreamingEnforcerAvailableAmount; exports.caveatEnforcerActions = caveatEnforcerActions; exports.signDelegation = signDelegation; exports.signDelegationActions = signDelegationActions; exports.signUserOperation = signUserOperation; exports.signUserOperationActions = signUserOperationActions; exports.erc7715ProviderActions = erc7715ProviderActions; exports.erc7710WalletActions = erc7710WalletActions; exports.erc7710BundlerActions = erc7710BundlerActions; exports.actions_exports = actions_exports;
|
|
870
|
-
//# sourceMappingURL=chunk-
|
|
982
|
+
//# sourceMappingURL=chunk-6CEOFJY5.cjs.map
|