@metamask/smart-accounts-kit 1.4.0 → 1.6.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 +57 -24
- package/dist/actions/index.cjs +9 -6
- package/dist/actions/index.cjs.map +1 -1
- package/dist/actions/index.d.cts +5 -3
- package/dist/actions/index.d.ts +5 -3
- package/dist/actions/index.mjs +8 -5
- package/dist/{caveats-BhjGBVHX.d.ts → caveats-B2OssjV4.d.ts} +1 -2
- package/dist/{caveats-CeHBbmt_.d.cts → caveats-gqMBZKkI.d.cts} +1 -2
- package/dist/{chunk-SOFB2MXG.cjs → chunk-2OS36DVV.cjs} +8 -1
- package/dist/chunk-2OS36DVV.cjs.map +1 -0
- package/dist/{chunk-6CEOFJY5.cjs → chunk-2ZOWIAP3.cjs} +266 -114
- package/dist/chunk-2ZOWIAP3.cjs.map +1 -0
- package/dist/{chunk-R2WT54GZ.mjs → chunk-AZYTTGON.mjs} +214 -62
- package/dist/chunk-AZYTTGON.mjs.map +1 -0
- package/dist/{chunk-MVBU3LRV.cjs → chunk-DCI2AN4N.cjs} +15 -17
- package/dist/chunk-DCI2AN4N.cjs.map +1 -0
- package/dist/{chunk-RR2AMG4A.cjs → chunk-EPU4O7FY.cjs} +158 -151
- package/dist/chunk-EPU4O7FY.cjs.map +1 -0
- package/dist/{chunk-QCULIK3O.mjs → chunk-GMGJRC3D.mjs} +8 -1
- package/dist/chunk-GMGJRC3D.mjs.map +1 -0
- package/dist/chunk-IMO6XNDJ.mjs +14 -0
- package/dist/chunk-IMO6XNDJ.mjs.map +1 -0
- package/dist/chunk-IQT6XFDT.cjs +14 -0
- package/dist/chunk-IQT6XFDT.cjs.map +1 -0
- package/dist/{chunk-SO5JAXGD.cjs → chunk-JKVSTPEC.cjs} +200 -18
- package/dist/chunk-JKVSTPEC.cjs.map +1 -0
- package/dist/{chunk-DVJX76J3.mjs → chunk-K7GTZGKJ.mjs} +2 -2
- package/dist/{chunk-HQHXGWNJ.mjs → chunk-L3EZCIY6.mjs} +67 -60
- package/dist/chunk-L3EZCIY6.mjs.map +1 -0
- package/dist/{chunk-XZ7UMCG3.cjs → chunk-PQPAEHJZ.cjs} +12 -12
- package/dist/{chunk-XZ7UMCG3.cjs.map → chunk-PQPAEHJZ.cjs.map} +1 -1
- package/dist/{chunk-EEIIVBNV.mjs → chunk-TNGQTVSY.mjs} +225 -53
- package/dist/chunk-TNGQTVSY.mjs.map +1 -0
- package/dist/{chunk-FG2CQGSE.mjs → chunk-UJQ3JN3U.mjs} +4 -6
- package/dist/{chunk-FG2CQGSE.mjs.map → chunk-UJQ3JN3U.mjs.map} +1 -1
- package/dist/{chunk-TMO23YRP.cjs → chunk-W6HPAK4M.cjs} +262 -90
- package/dist/chunk-W6HPAK4M.cjs.map +1 -0
- package/dist/{chunk-ZGBFPD4O.mjs → chunk-YVU66KSH.mjs} +188 -6
- package/dist/chunk-YVU66KSH.mjs.map +1 -0
- package/dist/contracts/index.cjs +5 -6
- package/dist/contracts/index.cjs.map +1 -1
- package/dist/contracts/index.d.cts +4 -3
- package/dist/contracts/index.d.ts +4 -3
- package/dist/contracts/index.mjs +4 -5
- package/dist/decodeRevertReason-CmmCpmZ_.d.cts +72 -0
- package/dist/decodeRevertReason-dOTpJx2h.d.ts +72 -0
- package/dist/experimental/index.cjs +364 -9
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/index.d.cts +39 -3
- package/dist/experimental/index.d.ts +39 -3
- package/dist/experimental/index.mjs +357 -2
- package/dist/experimental/index.mjs.map +1 -1
- package/dist/index-B1Cmezvh.d.cts +61 -0
- package/dist/{index-DRKgDSZW.d.ts → index-BkgdU4LI.d.ts} +99 -92
- package/dist/{index-Cg-JakqA.d.ts → index-DUJmm8Wz.d.ts} +46 -5
- package/dist/{index-DzL9ccjU.d.cts → index-Dv4jPzhe.d.cts} +99 -92
- package/dist/index-LqiEgBjV.d.ts +61 -0
- package/dist/{index-BToRQKyJ.d.cts → index-X7Qn3JTg.d.cts} +46 -5
- package/dist/index.cjs +22 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.mjs +9 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{delegation-CR99q1-n.d.ts → resolveCaveats-A9xC29l8.d.cts} +160 -111
- package/dist/{delegation-DoVULGYE.d.cts → resolveCaveats-A9xC29l8.d.ts} +160 -111
- package/dist/utils/index.cjs +13 -6
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +8 -4
- package/dist/utils/index.d.ts +8 -4
- package/dist/utils/index.mjs +16 -9
- package/package.json +7 -6
- package/dist/chunk-4QXIOE7F.mjs +0 -79
- package/dist/chunk-4QXIOE7F.mjs.map +0 -1
- package/dist/chunk-6CEOFJY5.cjs.map +0 -1
- package/dist/chunk-EEIIVBNV.mjs.map +0 -1
- package/dist/chunk-HQHXGWNJ.mjs.map +0 -1
- package/dist/chunk-MOHCTPYQ.cjs +0 -79
- package/dist/chunk-MOHCTPYQ.cjs.map +0 -1
- package/dist/chunk-MVBU3LRV.cjs.map +0 -1
- package/dist/chunk-QCULIK3O.mjs.map +0 -1
- package/dist/chunk-R2WT54GZ.mjs.map +0 -1
- package/dist/chunk-RR2AMG4A.cjs.map +0 -1
- package/dist/chunk-SO5JAXGD.cjs.map +0 -1
- package/dist/chunk-SOFB2MXG.cjs.map +0 -1
- package/dist/chunk-TMO23YRP.cjs.map +0 -1
- package/dist/chunk-ZGBFPD4O.mjs.map +0 -1
- package/dist/types-BWaH4KH1.d.cts +0 -155
- package/dist/types-BWaH4KH1.d.ts +0 -155
- /package/dist/{chunk-DVJX76J3.mjs.map → chunk-K7GTZGKJ.mjs.map} +0 -0
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkPQPAEHJZcjs = require('./chunk-PQPAEHJZ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk2OS36DVVcjs = require('./chunk-2OS36DVV.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
|
|
@@ -21,11 +20,14 @@ var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
|
|
|
21
20
|
|
|
22
21
|
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
var _chunkW6HPAK4Mcjs = require('./chunk-W6HPAK4M.cjs');
|
|
25
27
|
|
|
26
28
|
// src/actions/index.ts
|
|
27
29
|
var actions_exports = {};
|
|
28
|
-
|
|
30
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, actions_exports, {
|
|
29
31
|
caveatEnforcerActions: () => caveatEnforcerActions,
|
|
30
32
|
erc7710BundlerActions: () => erc7710BundlerActions,
|
|
31
33
|
erc7710WalletActions: () => erc7710WalletActions,
|
|
@@ -38,6 +40,8 @@ _chunkTMO23YRPcjs.__export.call(void 0, actions_exports, {
|
|
|
38
40
|
getNativeTokenStreamingEnforcerAvailableAmount: () => getNativeTokenStreamingEnforcerAvailableAmount,
|
|
39
41
|
getSupportedExecutionPermissions: () => erc7715GetSupportedExecutionPermissionsAction,
|
|
40
42
|
isValid7702Implementation: () => isValid7702Implementation,
|
|
43
|
+
redelegatePermissionContextAction: () => redelegatePermissionContextAction,
|
|
44
|
+
redelegatePermissionContextOpenAction: () => redelegatePermissionContextOpenAction,
|
|
41
45
|
requestExecutionPermissions: () => erc7715RequestExecutionPermissionsAction,
|
|
42
46
|
signDelegation: () => signDelegation,
|
|
43
47
|
signDelegationActions: () => signDelegationActions,
|
|
@@ -49,7 +53,7 @@ _chunkTMO23YRPcjs.__export.call(void 0, actions_exports, {
|
|
|
49
53
|
var _delegationabis = require('@metamask/delegation-abis');
|
|
50
54
|
var _viem = require('viem');
|
|
51
55
|
async function sendTransactionWithDelegationAction(client, args) {
|
|
52
|
-
|
|
56
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "sendTransactionWithDelegationAction", {
|
|
53
57
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]), () => ( null))
|
|
54
58
|
});
|
|
55
59
|
if (!args.to) {
|
|
@@ -61,14 +65,14 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
61
65
|
if (!chainId) {
|
|
62
66
|
throw new Error("Chain ID is not set");
|
|
63
67
|
}
|
|
64
|
-
const { DelegationManager: expectedDelegationManager } =
|
|
68
|
+
const { DelegationManager: expectedDelegationManager } = _chunk2OS36DVVcjs.getSmartAccountsEnvironment.call(void 0, chainId);
|
|
65
69
|
if (!_viem.isAddressEqual.call(void 0, args.delegationManager, expectedDelegationManager)) {
|
|
66
70
|
throw new Error(
|
|
67
71
|
`Invalid DelegationManager: expected ${expectedDelegationManager} for chain ${chainId}, but got ${args.delegationManager}`
|
|
68
72
|
);
|
|
69
73
|
}
|
|
70
74
|
const executions = [
|
|
71
|
-
|
|
75
|
+
_chunkW6HPAK4Mcjs.createExecution.call(void 0, {
|
|
72
76
|
target: args.to,
|
|
73
77
|
value: args.value,
|
|
74
78
|
callData: args.data
|
|
@@ -78,9 +82,9 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
78
82
|
abi: _delegationabis.DelegationManager,
|
|
79
83
|
functionName: "redeemDelegations",
|
|
80
84
|
args: [
|
|
81
|
-
[
|
|
85
|
+
[_chunkW6HPAK4Mcjs.encodeDelegations.call(void 0, args.permissionContext)],
|
|
82
86
|
["0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */],
|
|
83
|
-
|
|
87
|
+
_chunkW6HPAK4Mcjs.encodeExecutionCalldatas.call(void 0, [executions])
|
|
84
88
|
]
|
|
85
89
|
});
|
|
86
90
|
const {
|
|
@@ -97,7 +101,7 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
97
101
|
return hash;
|
|
98
102
|
}
|
|
99
103
|
async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
100
|
-
|
|
104
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "sendUserOperationWithDelegationAction", {
|
|
101
105
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _5 => _5.chain, 'optionalAccess', _6 => _6.id]), () => ( null)),
|
|
102
106
|
callCount: parameters.calls.length,
|
|
103
107
|
hasDependencies: parameters.dependencies !== void 0
|
|
@@ -109,7 +113,7 @@ async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
|
109
113
|
if (!chainId) {
|
|
110
114
|
throw new Error("Chain ID is not set");
|
|
111
115
|
}
|
|
112
|
-
const { SimpleFactory } =
|
|
116
|
+
const { SimpleFactory } = _chunk2OS36DVVcjs.getSmartAccountsEnvironment.call(void 0, chainId);
|
|
113
117
|
const uniqueDependencies = parameters.dependencies.filter((dependency) => {
|
|
114
118
|
if (!_viem.isAddressEqual.call(void 0, dependency.factory, SimpleFactory)) {
|
|
115
119
|
throw new Error(
|
|
@@ -152,7 +156,7 @@ async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
|
152
156
|
}
|
|
153
157
|
return {
|
|
154
158
|
...call,
|
|
155
|
-
permissionContext:
|
|
159
|
+
permissionContext: _chunkW6HPAK4Mcjs.encodeDelegations.call(void 0, permissionContext)
|
|
156
160
|
};
|
|
157
161
|
});
|
|
158
162
|
return client.sendUserOperation(
|
|
@@ -168,7 +172,7 @@ function permissionRequestToRpc(parameters) {
|
|
|
168
172
|
parameters.permission.type
|
|
169
173
|
);
|
|
170
174
|
const rules = [];
|
|
171
|
-
if (
|
|
175
|
+
if (_chunkW6HPAK4Mcjs.isDefined.call(void 0, expiry)) {
|
|
172
176
|
rules.push({
|
|
173
177
|
type: "expiry",
|
|
174
178
|
data: {
|
|
@@ -176,7 +180,7 @@ function permissionRequestToRpc(parameters) {
|
|
|
176
180
|
}
|
|
177
181
|
});
|
|
178
182
|
}
|
|
179
|
-
if (
|
|
183
|
+
if (_chunkW6HPAK4Mcjs.isDefined.call(void 0, redeemer)) {
|
|
180
184
|
if (redeemer.length === 0) {
|
|
181
185
|
throw new Error(
|
|
182
186
|
"Invalid redeemers: must specify at least one redeemer address"
|
|
@@ -194,7 +198,7 @@ function permissionRequestToRpc(parameters) {
|
|
|
194
198
|
data: { addresses }
|
|
195
199
|
});
|
|
196
200
|
}
|
|
197
|
-
if (
|
|
201
|
+
if (_chunkW6HPAK4Mcjs.isDefined.call(void 0, payee)) {
|
|
198
202
|
if (payee.length === 0) {
|
|
199
203
|
throw new Error(
|
|
200
204
|
"Invalid payees: must specify at least one payee address"
|
|
@@ -253,6 +257,10 @@ function getPermissionRequestToRpcConverter(permissionType) {
|
|
|
253
257
|
return (permission) => erc20TokenRevocationPermissionToRpc(
|
|
254
258
|
permission
|
|
255
259
|
);
|
|
260
|
+
case "token-approval-revocation":
|
|
261
|
+
return (permission) => tokenApprovalRevocationPermissionToRpc(
|
|
262
|
+
permission
|
|
263
|
+
);
|
|
256
264
|
default:
|
|
257
265
|
throw new Error(`Unsupported permission type: ${permissionType}`);
|
|
258
266
|
}
|
|
@@ -269,13 +277,13 @@ function nativeTokenStreamPermissionToRpc(permission) {
|
|
|
269
277
|
isAdjustmentAllowed
|
|
270
278
|
} = permission;
|
|
271
279
|
const optionalFields = {
|
|
272
|
-
...
|
|
273
|
-
initialAmount:
|
|
280
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, initialAmount) && {
|
|
281
|
+
initialAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, initialAmount, "initialAmount")
|
|
274
282
|
},
|
|
275
|
-
...
|
|
276
|
-
maxAmount:
|
|
283
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, maxAmount) && {
|
|
284
|
+
maxAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, maxAmount, "maxAmount")
|
|
277
285
|
},
|
|
278
|
-
...
|
|
286
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
279
287
|
startTime: Number(startTime)
|
|
280
288
|
},
|
|
281
289
|
...justification ? { justification } : {}
|
|
@@ -283,7 +291,7 @@ function nativeTokenStreamPermissionToRpc(permission) {
|
|
|
283
291
|
return {
|
|
284
292
|
type: "native-token-stream",
|
|
285
293
|
data: {
|
|
286
|
-
amountPerSecond:
|
|
294
|
+
amountPerSecond: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, amountPerSecond, "amountPerSecond"),
|
|
287
295
|
...optionalFields
|
|
288
296
|
},
|
|
289
297
|
isAdjustmentAllowed
|
|
@@ -302,13 +310,13 @@ function erc20TokenStreamPermissionToRpc(permission) {
|
|
|
302
310
|
isAdjustmentAllowed
|
|
303
311
|
} = permission;
|
|
304
312
|
const optionalFields = {
|
|
305
|
-
...
|
|
306
|
-
initialAmount:
|
|
313
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, initialAmount) && {
|
|
314
|
+
initialAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, initialAmount, "initialAmount")
|
|
307
315
|
},
|
|
308
|
-
...
|
|
309
|
-
maxAmount:
|
|
316
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, maxAmount) && {
|
|
317
|
+
maxAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, maxAmount, "maxAmount")
|
|
310
318
|
},
|
|
311
|
-
...
|
|
319
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
312
320
|
startTime: Number(startTime)
|
|
313
321
|
},
|
|
314
322
|
...justification ? { justification } : {}
|
|
@@ -316,8 +324,8 @@ function erc20TokenStreamPermissionToRpc(permission) {
|
|
|
316
324
|
return {
|
|
317
325
|
type: "erc20-token-stream",
|
|
318
326
|
data: {
|
|
319
|
-
tokenAddress:
|
|
320
|
-
amountPerSecond:
|
|
327
|
+
tokenAddress: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
328
|
+
amountPerSecond: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, amountPerSecond, "amountPerSecond"),
|
|
321
329
|
...optionalFields
|
|
322
330
|
},
|
|
323
331
|
isAdjustmentAllowed
|
|
@@ -329,7 +337,7 @@ function nativeTokenPeriodicPermissionToRpc(permission) {
|
|
|
329
337
|
isAdjustmentAllowed
|
|
330
338
|
} = permission;
|
|
331
339
|
const optionalFields = {
|
|
332
|
-
...
|
|
340
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
333
341
|
startTime: Number(startTime)
|
|
334
342
|
},
|
|
335
343
|
...justification ? { justification } : {}
|
|
@@ -337,7 +345,7 @@ function nativeTokenPeriodicPermissionToRpc(permission) {
|
|
|
337
345
|
return {
|
|
338
346
|
type: "native-token-periodic",
|
|
339
347
|
data: {
|
|
340
|
-
periodAmount:
|
|
348
|
+
periodAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, periodAmount, "periodAmount"),
|
|
341
349
|
periodDuration: Number(periodDuration),
|
|
342
350
|
...optionalFields
|
|
343
351
|
},
|
|
@@ -356,7 +364,7 @@ function erc20TokenPeriodicPermissionToRpc(permission) {
|
|
|
356
364
|
isAdjustmentAllowed
|
|
357
365
|
} = permission;
|
|
358
366
|
const optionalFields = {
|
|
359
|
-
...
|
|
367
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
360
368
|
startTime: Number(startTime)
|
|
361
369
|
},
|
|
362
370
|
...justification ? { justification } : {}
|
|
@@ -364,8 +372,8 @@ function erc20TokenPeriodicPermissionToRpc(permission) {
|
|
|
364
372
|
return {
|
|
365
373
|
type: "erc20-token-periodic",
|
|
366
374
|
data: {
|
|
367
|
-
tokenAddress:
|
|
368
|
-
periodAmount:
|
|
375
|
+
tokenAddress: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
376
|
+
periodAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, periodAmount, "periodAmount"),
|
|
369
377
|
periodDuration: Number(periodDuration),
|
|
370
378
|
...optionalFields
|
|
371
379
|
},
|
|
@@ -378,7 +386,7 @@ function nativeTokenAllowancePermissionToRpc(permission) {
|
|
|
378
386
|
isAdjustmentAllowed
|
|
379
387
|
} = permission;
|
|
380
388
|
const optionalFields = {
|
|
381
|
-
...
|
|
389
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
382
390
|
startTime: Number(startTime)
|
|
383
391
|
},
|
|
384
392
|
...justification ? { justification } : {}
|
|
@@ -386,7 +394,7 @@ function nativeTokenAllowancePermissionToRpc(permission) {
|
|
|
386
394
|
return {
|
|
387
395
|
type: "native-token-allowance",
|
|
388
396
|
data: {
|
|
389
|
-
allowanceAmount:
|
|
397
|
+
allowanceAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, allowanceAmount, "allowanceAmount"),
|
|
390
398
|
...optionalFields
|
|
391
399
|
},
|
|
392
400
|
isAdjustmentAllowed
|
|
@@ -398,7 +406,7 @@ function erc20TokenAllowancePermissionToRpc(permission) {
|
|
|
398
406
|
isAdjustmentAllowed
|
|
399
407
|
} = permission;
|
|
400
408
|
const optionalFields = {
|
|
401
|
-
...
|
|
409
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
402
410
|
startTime: Number(startTime)
|
|
403
411
|
},
|
|
404
412
|
...justification ? { justification } : {}
|
|
@@ -406,8 +414,8 @@ function erc20TokenAllowancePermissionToRpc(permission) {
|
|
|
406
414
|
return {
|
|
407
415
|
type: "erc20-token-allowance",
|
|
408
416
|
data: {
|
|
409
|
-
tokenAddress:
|
|
410
|
-
allowanceAmount:
|
|
417
|
+
tokenAddress: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
418
|
+
allowanceAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, allowanceAmount, "allowanceAmount"),
|
|
411
419
|
...optionalFields
|
|
412
420
|
},
|
|
413
421
|
isAdjustmentAllowed
|
|
@@ -427,6 +435,34 @@ function erc20TokenRevocationPermissionToRpc(permission) {
|
|
|
427
435
|
isAdjustmentAllowed
|
|
428
436
|
};
|
|
429
437
|
}
|
|
438
|
+
function tokenApprovalRevocationPermissionToRpc(permission) {
|
|
439
|
+
const {
|
|
440
|
+
data: {
|
|
441
|
+
erc20Approve,
|
|
442
|
+
erc721Approve,
|
|
443
|
+
erc721SetApprovalForAll,
|
|
444
|
+
permit2Approve,
|
|
445
|
+
permit2Lockdown,
|
|
446
|
+
permit2InvalidateNonces,
|
|
447
|
+
justification
|
|
448
|
+
},
|
|
449
|
+
isAdjustmentAllowed
|
|
450
|
+
} = permission;
|
|
451
|
+
const data = {
|
|
452
|
+
erc20Approve,
|
|
453
|
+
erc721Approve,
|
|
454
|
+
erc721SetApprovalForAll,
|
|
455
|
+
permit2Approve,
|
|
456
|
+
permit2Lockdown,
|
|
457
|
+
permit2InvalidateNonces,
|
|
458
|
+
...justification ? { justification } : {}
|
|
459
|
+
};
|
|
460
|
+
return {
|
|
461
|
+
type: "token-approval-revocation",
|
|
462
|
+
data,
|
|
463
|
+
isAdjustmentAllowed
|
|
464
|
+
};
|
|
465
|
+
}
|
|
430
466
|
function permissionResponsesFromRpc(result) {
|
|
431
467
|
return result.map((permission) => ({
|
|
432
468
|
...permission,
|
|
@@ -498,7 +534,7 @@ function rpcSupportedPermissionsToDeveloper(result) {
|
|
|
498
534
|
|
|
499
535
|
// src/actions/erc7715GetGrantedExecutionPermissionsAction.ts
|
|
500
536
|
async function erc7715GetGrantedExecutionPermissionsAction(client) {
|
|
501
|
-
|
|
537
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
502
538
|
"erc7715GetGrantedExecutionPermissionsAction",
|
|
503
539
|
{
|
|
504
540
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]), () => ( null))
|
|
@@ -519,7 +555,7 @@ async function erc7715GetGrantedExecutionPermissionsAction(client) {
|
|
|
519
555
|
|
|
520
556
|
// src/actions/erc7715GetSupportedExecutionPermissionsAction.ts
|
|
521
557
|
async function erc7715GetSupportedExecutionPermissionsAction(client) {
|
|
522
|
-
|
|
558
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
523
559
|
"erc7715GetSupportedExecutionPermissionsAction",
|
|
524
560
|
{
|
|
525
561
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _13 => _13.chain, 'optionalAccess', _14 => _14.id]), () => ( null))
|
|
@@ -540,7 +576,7 @@ async function erc7715GetSupportedExecutionPermissionsAction(client) {
|
|
|
540
576
|
|
|
541
577
|
// src/actions/erc7715RequestExecutionPermissionsAction.ts
|
|
542
578
|
async function erc7715RequestExecutionPermissionsAction(client, parameters) {
|
|
543
|
-
|
|
579
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
544
580
|
"erc7715RequestExecutionPermissionsAction",
|
|
545
581
|
{
|
|
546
582
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _15 => _15.chain, 'optionalAccess', _16 => _16.id]), () => ( null)),
|
|
@@ -561,6 +597,164 @@ async function erc7715RequestExecutionPermissionsAction(client, parameters) {
|
|
|
561
597
|
return permissionResponsesFromRpc(result);
|
|
562
598
|
}
|
|
563
599
|
|
|
600
|
+
// src/actions/redelegatePermissionContext.ts
|
|
601
|
+
|
|
602
|
+
var _accounts = require('viem/accounts');
|
|
603
|
+
|
|
604
|
+
// src/actions/signDelegation.ts
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
async function signDelegation(client, parameters) {
|
|
608
|
+
const {
|
|
609
|
+
account: accountParam = client.account,
|
|
610
|
+
delegation,
|
|
611
|
+
delegationManager,
|
|
612
|
+
chainId,
|
|
613
|
+
name = "DelegationManager",
|
|
614
|
+
version = "1",
|
|
615
|
+
allowInsecureUnrestrictedDelegation = false
|
|
616
|
+
} = parameters;
|
|
617
|
+
if (!accountParam) {
|
|
618
|
+
throw new (0, _viem.BaseError)("Account not found. Please provide an account.");
|
|
619
|
+
}
|
|
620
|
+
const account = _accounts.parseAccount.call(void 0, accountParam);
|
|
621
|
+
const typedData = _chunkW6HPAK4Mcjs.prepareSignDelegationTypedData.call(void 0, {
|
|
622
|
+
delegation,
|
|
623
|
+
delegationManager,
|
|
624
|
+
chainId,
|
|
625
|
+
name,
|
|
626
|
+
version,
|
|
627
|
+
allowInsecureUnrestrictedDelegation
|
|
628
|
+
});
|
|
629
|
+
return client.signTypedData({
|
|
630
|
+
account,
|
|
631
|
+
...typedData
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
function signDelegationActions() {
|
|
635
|
+
return (client) => ({
|
|
636
|
+
signDelegation: async (parameters) => signDelegation(client, {
|
|
637
|
+
chainId: _nullishCoalesce(parameters.chainId, () => ( (() => {
|
|
638
|
+
if (!_optionalChain([client, 'access', _17 => _17.chain, 'optionalAccess', _18 => _18.id])) {
|
|
639
|
+
throw new (0, _viem.BaseError)(
|
|
640
|
+
"Chain ID is required. Either provide it in parameters or configure the client with a chain."
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
return client.chain.id;
|
|
644
|
+
})())),
|
|
645
|
+
...parameters
|
|
646
|
+
})
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
// src/actions/redelegatePermissionContext.ts
|
|
651
|
+
async function signAndPrependRedelegation(client, options) {
|
|
652
|
+
const { account, environment, delegations, unsignedDelegation, chainId } = options;
|
|
653
|
+
const signature = await signDelegation(client, {
|
|
654
|
+
account,
|
|
655
|
+
delegation: unsignedDelegation,
|
|
656
|
+
delegationManager: environment.DelegationManager,
|
|
657
|
+
chainId,
|
|
658
|
+
// Redelegations always inherit from a parent delegation (enforced by
|
|
659
|
+
// `resolveRedelegationArgs`), so the parent's caveats provide the
|
|
660
|
+
// restriction even when the redelegation itself adds no extra caveats.
|
|
661
|
+
// This mirrors `resolveCaveats`, which also allows empty caveats in this
|
|
662
|
+
// case.
|
|
663
|
+
allowInsecureUnrestrictedDelegation: true
|
|
664
|
+
});
|
|
665
|
+
const signedDelegation = {
|
|
666
|
+
...unsignedDelegation,
|
|
667
|
+
signature
|
|
668
|
+
};
|
|
669
|
+
const newPermissionContext = _chunkW6HPAK4Mcjs.encodeDelegations.call(void 0, [
|
|
670
|
+
signedDelegation,
|
|
671
|
+
...delegations
|
|
672
|
+
]);
|
|
673
|
+
return {
|
|
674
|
+
delegation: signedDelegation,
|
|
675
|
+
permissionContext: newPermissionContext
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
function resolveRedelegationArgs(client, parameters) {
|
|
679
|
+
const { account: accountParam = client.account, permissionContext } = parameters;
|
|
680
|
+
if (!accountParam) {
|
|
681
|
+
throw new (0, _viem.BaseError)("Account not found. Please provide an account.");
|
|
682
|
+
}
|
|
683
|
+
const account = _accounts.parseAccount.call(void 0, accountParam);
|
|
684
|
+
const delegations = _chunkW6HPAK4Mcjs.decodeDelegations.call(void 0, permissionContext);
|
|
685
|
+
const parentDelegation = delegations[0];
|
|
686
|
+
if (!parentDelegation) {
|
|
687
|
+
throw new (0, _viem.BaseError)(
|
|
688
|
+
"Permission context must contain at least one delegation"
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
const isParentOpenDelegation = parentDelegation.delegate.toLowerCase() === _chunkW6HPAK4Mcjs.ANY_BENEFICIARY.toLowerCase();
|
|
692
|
+
const from = isParentOpenDelegation ? account.address : parentDelegation.delegate;
|
|
693
|
+
return { account, delegations, parentDelegation, from };
|
|
694
|
+
}
|
|
695
|
+
async function redelegatePermissionContextAction(client, parameters) {
|
|
696
|
+
const { environment, scope, caveats, salt, to } = parameters;
|
|
697
|
+
const chainId = resolveChainId(client, parameters.chainId);
|
|
698
|
+
const { account, delegations, parentDelegation, from } = resolveRedelegationArgs(client, parameters);
|
|
699
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "redelegatePermissionContext", {
|
|
700
|
+
chainId,
|
|
701
|
+
hasScope: scope !== void 0,
|
|
702
|
+
hasCaveats: caveats !== void 0
|
|
703
|
+
});
|
|
704
|
+
const unsignedDelegation = _chunkW6HPAK4Mcjs.createDelegation.call(void 0, {
|
|
705
|
+
environment,
|
|
706
|
+
from,
|
|
707
|
+
to,
|
|
708
|
+
scope,
|
|
709
|
+
caveats,
|
|
710
|
+
parentDelegation,
|
|
711
|
+
salt
|
|
712
|
+
});
|
|
713
|
+
return signAndPrependRedelegation(client, {
|
|
714
|
+
account,
|
|
715
|
+
environment,
|
|
716
|
+
delegations,
|
|
717
|
+
unsignedDelegation,
|
|
718
|
+
chainId
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
async function redelegatePermissionContextOpenAction(client, parameters) {
|
|
722
|
+
const { environment, scope, caveats, salt } = parameters;
|
|
723
|
+
const chainId = resolveChainId(client, parameters.chainId);
|
|
724
|
+
const { account, delegations, parentDelegation, from } = resolveRedelegationArgs(client, parameters);
|
|
725
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "redelegatePermissionContextOpen", {
|
|
726
|
+
chainId,
|
|
727
|
+
hasScope: scope !== void 0,
|
|
728
|
+
hasCaveats: caveats !== void 0
|
|
729
|
+
});
|
|
730
|
+
const unsignedDelegation = _chunkW6HPAK4Mcjs.createOpenDelegation.call(void 0, {
|
|
731
|
+
environment,
|
|
732
|
+
from,
|
|
733
|
+
scope,
|
|
734
|
+
caveats,
|
|
735
|
+
parentDelegation,
|
|
736
|
+
salt
|
|
737
|
+
});
|
|
738
|
+
return signAndPrependRedelegation(client, {
|
|
739
|
+
account,
|
|
740
|
+
environment,
|
|
741
|
+
delegations,
|
|
742
|
+
unsignedDelegation,
|
|
743
|
+
chainId
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
function resolveChainId(client, chainId) {
|
|
747
|
+
if (chainId !== void 0) {
|
|
748
|
+
return chainId;
|
|
749
|
+
}
|
|
750
|
+
if (!_optionalChain([client, 'access', _19 => _19.chain, 'optionalAccess', _20 => _20.id])) {
|
|
751
|
+
throw new (0, _viem.BaseError)(
|
|
752
|
+
"Chain ID is required. Either provide it in parameters or configure the client with a chain."
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
return client.chain.id;
|
|
756
|
+
}
|
|
757
|
+
|
|
564
758
|
// src/actions/getCaveatAvailableAmount.ts
|
|
565
759
|
function findMatchingCaveat({
|
|
566
760
|
delegation,
|
|
@@ -601,10 +795,10 @@ function getEnforcerAddress({
|
|
|
601
795
|
return enforcerAddress;
|
|
602
796
|
}
|
|
603
797
|
async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment, params) {
|
|
604
|
-
|
|
798
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
605
799
|
"getErc20PeriodTransferEnforcerAvailableAmount",
|
|
606
800
|
{
|
|
607
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
801
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _21 => _21.chain, 'optionalAccess', _22 => _22.id]), () => ( null))
|
|
608
802
|
}
|
|
609
803
|
);
|
|
610
804
|
const enforcerName = "ERC20PeriodTransferEnforcer";
|
|
@@ -613,13 +807,13 @@ async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment
|
|
|
613
807
|
enforcerName,
|
|
614
808
|
environment
|
|
615
809
|
});
|
|
616
|
-
const delegationHash =
|
|
810
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
617
811
|
const { terms } = findMatchingCaveat({
|
|
618
812
|
delegation: params.delegation,
|
|
619
813
|
enforcerAddress,
|
|
620
814
|
enforcerName
|
|
621
815
|
});
|
|
622
|
-
return
|
|
816
|
+
return _chunkPQPAEHJZcjs.read_exports.getAvailableAmount({
|
|
623
817
|
client,
|
|
624
818
|
contractAddress: enforcerAddress,
|
|
625
819
|
delegationHash,
|
|
@@ -628,10 +822,10 @@ async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment
|
|
|
628
822
|
});
|
|
629
823
|
}
|
|
630
824
|
async function getErc20StreamingEnforcerAvailableAmount(client, environment, params) {
|
|
631
|
-
|
|
825
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
632
826
|
"getErc20StreamingEnforcerAvailableAmount",
|
|
633
827
|
{
|
|
634
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
828
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _23 => _23.chain, 'optionalAccess', _24 => _24.id]), () => ( null))
|
|
635
829
|
}
|
|
636
830
|
);
|
|
637
831
|
const enforcerName = "ERC20StreamingEnforcer";
|
|
@@ -640,13 +834,13 @@ async function getErc20StreamingEnforcerAvailableAmount(client, environment, par
|
|
|
640
834
|
enforcerName,
|
|
641
835
|
environment
|
|
642
836
|
});
|
|
643
|
-
const delegationHash =
|
|
837
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
644
838
|
const { terms } = findMatchingCaveat({
|
|
645
839
|
delegation: params.delegation,
|
|
646
840
|
enforcerAddress,
|
|
647
841
|
enforcerName
|
|
648
842
|
});
|
|
649
|
-
return
|
|
843
|
+
return _chunkPQPAEHJZcjs.read_exports2.getAvailableAmount({
|
|
650
844
|
client,
|
|
651
845
|
contractAddress: enforcerAddress,
|
|
652
846
|
delegationManager,
|
|
@@ -655,10 +849,10 @@ async function getErc20StreamingEnforcerAvailableAmount(client, environment, par
|
|
|
655
849
|
});
|
|
656
850
|
}
|
|
657
851
|
async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, params) {
|
|
658
|
-
|
|
852
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
659
853
|
"getMultiTokenPeriodEnforcerAvailableAmount",
|
|
660
854
|
{
|
|
661
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
855
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _25 => _25.chain, 'optionalAccess', _26 => _26.id]), () => ( null))
|
|
662
856
|
}
|
|
663
857
|
);
|
|
664
858
|
const enforcerName = "MultiTokenPeriodEnforcer";
|
|
@@ -667,13 +861,13 @@ async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, p
|
|
|
667
861
|
enforcerName,
|
|
668
862
|
environment
|
|
669
863
|
});
|
|
670
|
-
const delegationHash =
|
|
864
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
671
865
|
const { terms, args } = findMatchingCaveat({
|
|
672
866
|
delegation: params.delegation,
|
|
673
867
|
enforcerAddress,
|
|
674
868
|
enforcerName
|
|
675
869
|
});
|
|
676
|
-
return
|
|
870
|
+
return _chunkPQPAEHJZcjs.read_exports3.getAvailableAmount({
|
|
677
871
|
client,
|
|
678
872
|
contractAddress: enforcerAddress,
|
|
679
873
|
delegationHash,
|
|
@@ -683,10 +877,10 @@ async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, p
|
|
|
683
877
|
});
|
|
684
878
|
}
|
|
685
879
|
async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, environment, params) {
|
|
686
|
-
|
|
880
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
687
881
|
"getNativeTokenPeriodTransferEnforcerAvailableAmount",
|
|
688
882
|
{
|
|
689
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
883
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _27 => _27.chain, 'optionalAccess', _28 => _28.id]), () => ( null))
|
|
690
884
|
}
|
|
691
885
|
);
|
|
692
886
|
const enforcerName = "NativeTokenPeriodTransferEnforcer";
|
|
@@ -695,13 +889,13 @@ async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, envir
|
|
|
695
889
|
enforcerName,
|
|
696
890
|
environment
|
|
697
891
|
});
|
|
698
|
-
const delegationHash =
|
|
892
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
699
893
|
const { terms } = findMatchingCaveat({
|
|
700
894
|
delegation: params.delegation,
|
|
701
895
|
enforcerAddress,
|
|
702
896
|
enforcerName
|
|
703
897
|
});
|
|
704
|
-
return
|
|
898
|
+
return _chunkPQPAEHJZcjs.read_exports4.getAvailableAmount({
|
|
705
899
|
client,
|
|
706
900
|
contractAddress: enforcerAddress,
|
|
707
901
|
delegationHash,
|
|
@@ -710,10 +904,10 @@ async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, envir
|
|
|
710
904
|
});
|
|
711
905
|
}
|
|
712
906
|
async function getNativeTokenStreamingEnforcerAvailableAmount(client, environment, params) {
|
|
713
|
-
|
|
907
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
714
908
|
"getNativeTokenStreamingEnforcerAvailableAmount",
|
|
715
909
|
{
|
|
716
|
-
chainId: _nullishCoalesce(_optionalChain([client, 'access',
|
|
910
|
+
chainId: _nullishCoalesce(_optionalChain([client, 'access', _29 => _29.chain, 'optionalAccess', _30 => _30.id]), () => ( null))
|
|
717
911
|
}
|
|
718
912
|
);
|
|
719
913
|
const enforcerName = "NativeTokenStreamingEnforcer";
|
|
@@ -722,13 +916,13 @@ async function getNativeTokenStreamingEnforcerAvailableAmount(client, environmen
|
|
|
722
916
|
enforcerName,
|
|
723
917
|
environment
|
|
724
918
|
});
|
|
725
|
-
const delegationHash =
|
|
919
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
726
920
|
const { terms } = findMatchingCaveat({
|
|
727
921
|
delegation: params.delegation,
|
|
728
922
|
enforcerAddress,
|
|
729
923
|
enforcerName
|
|
730
924
|
});
|
|
731
|
-
return
|
|
925
|
+
return _chunkPQPAEHJZcjs.read_exports5.getAvailableAmount({
|
|
732
926
|
client,
|
|
733
927
|
contractAddress: enforcerAddress,
|
|
734
928
|
delegationManager,
|
|
@@ -809,7 +1003,7 @@ var caveatEnforcerActions = ({ environment }) => (client) => ({
|
|
|
809
1003
|
var _actions = require('viem/actions');
|
|
810
1004
|
var DELEGATION_PREFIX = "0xef0100";
|
|
811
1005
|
function extractDelegatedAddress(code) {
|
|
812
|
-
if (_optionalChain([code, 'optionalAccess',
|
|
1006
|
+
if (_optionalChain([code, 'optionalAccess', _31 => _31.length]) !== 48) {
|
|
813
1007
|
return null;
|
|
814
1008
|
}
|
|
815
1009
|
if (!code.toLowerCase().startsWith(DELEGATION_PREFIX.toLowerCase())) {
|
|
@@ -841,52 +1035,6 @@ async function isValid7702Implementation({
|
|
|
841
1035
|
}
|
|
842
1036
|
}
|
|
843
1037
|
|
|
844
|
-
// src/actions/signDelegation.ts
|
|
845
|
-
|
|
846
|
-
var _accounts = require('viem/accounts');
|
|
847
|
-
async function signDelegation(client, parameters) {
|
|
848
|
-
const {
|
|
849
|
-
account: accountParam = client.account,
|
|
850
|
-
delegation,
|
|
851
|
-
delegationManager,
|
|
852
|
-
chainId,
|
|
853
|
-
name = "DelegationManager",
|
|
854
|
-
version = "1",
|
|
855
|
-
allowInsecureUnrestrictedDelegation = false
|
|
856
|
-
} = parameters;
|
|
857
|
-
if (!accountParam) {
|
|
858
|
-
throw new (0, _viem.BaseError)("Account not found. Please provide an account.");
|
|
859
|
-
}
|
|
860
|
-
const account = _accounts.parseAccount.call(void 0, accountParam);
|
|
861
|
-
const typedData = _chunkTMO23YRPcjs.prepareSignDelegationTypedData.call(void 0, {
|
|
862
|
-
delegation,
|
|
863
|
-
delegationManager,
|
|
864
|
-
chainId,
|
|
865
|
-
name,
|
|
866
|
-
version,
|
|
867
|
-
allowInsecureUnrestrictedDelegation
|
|
868
|
-
});
|
|
869
|
-
return client.signTypedData({
|
|
870
|
-
account,
|
|
871
|
-
...typedData
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
|
-
function signDelegationActions() {
|
|
875
|
-
return (client) => ({
|
|
876
|
-
signDelegation: async (parameters) => signDelegation(client, {
|
|
877
|
-
chainId: _nullishCoalesce(parameters.chainId, () => ( (() => {
|
|
878
|
-
if (!_optionalChain([client, 'access', _28 => _28.chain, 'optionalAccess', _29 => _29.id])) {
|
|
879
|
-
throw new (0, _viem.BaseError)(
|
|
880
|
-
"Chain ID is required. Either provide it in parameters or configure the client with a chain."
|
|
881
|
-
);
|
|
882
|
-
}
|
|
883
|
-
return client.chain.id;
|
|
884
|
-
})())),
|
|
885
|
-
...parameters
|
|
886
|
-
})
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
|
|
890
1038
|
// src/actions/signUserOperation.ts
|
|
891
1039
|
|
|
892
1040
|
|
|
@@ -904,7 +1052,7 @@ async function signUserOperation(client, parameters) {
|
|
|
904
1052
|
throw new (0, _viem.BaseError)("Account not found. Please provide an account.");
|
|
905
1053
|
}
|
|
906
1054
|
const account = _accounts.parseAccount.call(void 0, accountParam);
|
|
907
|
-
const typedData =
|
|
1055
|
+
const typedData = _chunk2OS36DVVcjs.prepareSignUserOperationTypedData.call(void 0, {
|
|
908
1056
|
userOperation,
|
|
909
1057
|
entryPoint,
|
|
910
1058
|
chainId,
|
|
@@ -921,7 +1069,7 @@ function signUserOperationActions() {
|
|
|
921
1069
|
return (client) => ({
|
|
922
1070
|
signUserOperation: async (parameters) => signUserOperation(client, {
|
|
923
1071
|
chainId: _nullishCoalesce(parameters.chainId, () => ( (() => {
|
|
924
|
-
if (!_optionalChain([client, 'access',
|
|
1072
|
+
if (!_optionalChain([client, 'access', _32 => _32.chain, 'optionalAccess', _33 => _33.id])) {
|
|
925
1073
|
throw new (0, _viem.BaseError)(
|
|
926
1074
|
"Chain ID is required. Either provide it in parameters or configure the client with a chain."
|
|
927
1075
|
);
|
|
@@ -953,7 +1101,9 @@ var erc7715ProviderActions = () => (client) => ({
|
|
|
953
1101
|
}
|
|
954
1102
|
});
|
|
955
1103
|
var erc7710WalletActions = () => (client) => ({
|
|
956
|
-
sendTransactionWithDelegation: async (args) => sendTransactionWithDelegationAction(client, args)
|
|
1104
|
+
sendTransactionWithDelegation: async (args) => sendTransactionWithDelegationAction(client, args),
|
|
1105
|
+
redelegatePermissionContext: async (parameters) => redelegatePermissionContextAction(client, parameters),
|
|
1106
|
+
redelegatePermissionContextOpen: async (parameters) => redelegatePermissionContextOpenAction(client, parameters)
|
|
957
1107
|
});
|
|
958
1108
|
var erc7710BundlerActions = () => (client) => ({
|
|
959
1109
|
sendUserOperationWithDelegation: async (args) => sendUserOperationWithDelegationAction(client, args)
|
|
@@ -978,5 +1128,7 @@ var erc7710BundlerActions = () => (client) => ({
|
|
|
978
1128
|
|
|
979
1129
|
|
|
980
1130
|
|
|
981
|
-
|
|
982
|
-
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
exports.isValid7702Implementation = isValid7702Implementation; exports.erc7715GetGrantedExecutionPermissionsAction = erc7715GetGrantedExecutionPermissionsAction; exports.erc7715GetSupportedExecutionPermissionsAction = erc7715GetSupportedExecutionPermissionsAction; exports.erc7715RequestExecutionPermissionsAction = erc7715RequestExecutionPermissionsAction; exports.signDelegation = signDelegation; exports.signDelegationActions = signDelegationActions; exports.redelegatePermissionContextAction = redelegatePermissionContextAction; exports.redelegatePermissionContextOpenAction = redelegatePermissionContextOpenAction; exports.getErc20PeriodTransferEnforcerAvailableAmount = getErc20PeriodTransferEnforcerAvailableAmount; exports.getErc20StreamingEnforcerAvailableAmount = getErc20StreamingEnforcerAvailableAmount; exports.getMultiTokenPeriodEnforcerAvailableAmount = getMultiTokenPeriodEnforcerAvailableAmount; exports.getNativeTokenPeriodTransferEnforcerAvailableAmount = getNativeTokenPeriodTransferEnforcerAvailableAmount; exports.getNativeTokenStreamingEnforcerAvailableAmount = getNativeTokenStreamingEnforcerAvailableAmount; exports.caveatEnforcerActions = caveatEnforcerActions; exports.signUserOperation = signUserOperation; exports.signUserOperationActions = signUserOperationActions; exports.erc7715ProviderActions = erc7715ProviderActions; exports.erc7710WalletActions = erc7710WalletActions; exports.erc7710BundlerActions = erc7710BundlerActions; exports.actions_exports = actions_exports;
|
|
1134
|
+
//# sourceMappingURL=chunk-2ZOWIAP3.cjs.map
|