@metamask/smart-accounts-kit 1.5.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 +47 -25
- package/dist/actions/index.cjs +5 -6
- package/dist/actions/index.cjs.map +1 -1
- package/dist/actions/index.d.cts +3 -3
- package/dist/actions/index.d.ts +3 -3
- package/dist/actions/index.mjs +4 -5
- package/dist/{caveats-DQ6HoAHe.d.ts → caveats-B2OssjV4.d.ts} +1 -2
- package/dist/{caveats-CaSt_VHs.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-XEOE25DE.cjs → chunk-2ZOWIAP3.cjs} +98 -68
- package/dist/chunk-2ZOWIAP3.cjs.map +1 -0
- package/dist/{chunk-BGOSYTKV.mjs → chunk-AZYTTGON.mjs} +38 -8
- package/dist/chunk-AZYTTGON.mjs.map +1 -0
- package/dist/{chunk-SCS3CFRE.cjs → chunk-DCI2AN4N.cjs} +15 -17
- package/dist/chunk-DCI2AN4N.cjs.map +1 -0
- package/dist/{chunk-DN4O5VOP.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-FH6HZCHI.cjs → chunk-JKVSTPEC.cjs} +200 -18
- package/dist/chunk-JKVSTPEC.cjs.map +1 -0
- package/dist/{chunk-N66VAWMO.mjs → chunk-K7GTZGKJ.mjs} +2 -2
- package/dist/{chunk-TBHT26BV.mjs → chunk-L3EZCIY6.mjs} +67 -60
- package/dist/chunk-L3EZCIY6.mjs.map +1 -0
- package/dist/{chunk-7FYDQNJ3.cjs → chunk-PQPAEHJZ.cjs} +12 -12
- package/dist/{chunk-7FYDQNJ3.cjs.map → chunk-PQPAEHJZ.cjs.map} +1 -1
- package/dist/{chunk-MV2KHN75.mjs → chunk-TNGQTVSY.mjs} +163 -35
- package/dist/chunk-TNGQTVSY.mjs.map +1 -0
- package/dist/{chunk-YXHUT56Z.mjs → chunk-UJQ3JN3U.mjs} +4 -6
- package/dist/{chunk-YXHUT56Z.mjs.map → chunk-UJQ3JN3U.mjs.map} +1 -1
- package/dist/{chunk-IBZSNB7D.cjs → chunk-W6HPAK4M.cjs} +202 -74
- package/dist/chunk-W6HPAK4M.cjs.map +1 -0
- package/dist/{chunk-W7O2UQL5.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 -4
- package/dist/contracts/index.d.ts +4 -4
- package/dist/contracts/index.mjs +4 -5
- package/dist/{delegation-DbPGWKfP.d.ts → decodeRevertReason-CmmCpmZ_.d.cts} +11 -3
- package/dist/{delegation-BKkEyxZY.d.cts → decodeRevertReason-dOTpJx2h.d.ts} +11 -3
- 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-DXdlz7t4.d.ts → index-BkgdU4LI.d.ts} +99 -93
- package/dist/{index-G78z6nwi.d.ts → index-DUJmm8Wz.d.ts} +13 -5
- package/dist/{index-yU3olCJV.d.cts → index-Dv4jPzhe.d.cts} +99 -93
- package/dist/index-LqiEgBjV.d.ts +61 -0
- package/dist/{index-DfDAuvr5.d.cts → index-X7Qn3JTg.d.cts} +13 -5
- package/dist/index.cjs +22 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.mjs +9 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{resolveCaveats-DiqGB-T5.d.cts → resolveCaveats-A9xC29l8.d.cts} +160 -62
- package/dist/{resolveCaveats-s2snaFEo.d.ts → resolveCaveats-A9xC29l8.d.ts} +160 -62
- package/dist/utils/index.cjs +13 -6
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +8 -5
- package/dist/utils/index.d.ts +8 -5
- 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-BGOSYTKV.mjs.map +0 -1
- package/dist/chunk-DN4O5VOP.cjs.map +0 -1
- package/dist/chunk-FH6HZCHI.cjs.map +0 -1
- package/dist/chunk-IBZSNB7D.cjs.map +0 -1
- package/dist/chunk-MOHCTPYQ.cjs +0 -79
- package/dist/chunk-MOHCTPYQ.cjs.map +0 -1
- package/dist/chunk-MV2KHN75.mjs.map +0 -1
- package/dist/chunk-QCULIK3O.mjs.map +0 -1
- package/dist/chunk-SCS3CFRE.cjs.map +0 -1
- package/dist/chunk-SOFB2MXG.cjs.map +0 -1
- package/dist/chunk-TBHT26BV.mjs.map +0 -1
- package/dist/chunk-W7O2UQL5.mjs.map +0 -1
- package/dist/chunk-XEOE25DE.cjs.map +0 -1
- package/dist/types-BWaH4KH1.d.cts +0 -155
- package/dist/types-BWaH4KH1.d.ts +0 -155
- /package/dist/{chunk-N66VAWMO.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
|
|
|
@@ -24,12 +23,11 @@ var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
|
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
var _chunkIBZSNB7Dcjs = require('./chunk-IBZSNB7D.cjs');
|
|
26
|
+
var _chunkW6HPAK4Mcjs = require('./chunk-W6HPAK4M.cjs');
|
|
29
27
|
|
|
30
28
|
// src/actions/index.ts
|
|
31
29
|
var actions_exports = {};
|
|
32
|
-
|
|
30
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, actions_exports, {
|
|
33
31
|
caveatEnforcerActions: () => caveatEnforcerActions,
|
|
34
32
|
erc7710BundlerActions: () => erc7710BundlerActions,
|
|
35
33
|
erc7710WalletActions: () => erc7710WalletActions,
|
|
@@ -55,7 +53,7 @@ _chunkIBZSNB7Dcjs.__export.call(void 0, actions_exports, {
|
|
|
55
53
|
var _delegationabis = require('@metamask/delegation-abis');
|
|
56
54
|
var _viem = require('viem');
|
|
57
55
|
async function sendTransactionWithDelegationAction(client, args) {
|
|
58
|
-
|
|
56
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "sendTransactionWithDelegationAction", {
|
|
59
57
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]), () => ( null))
|
|
60
58
|
});
|
|
61
59
|
if (!args.to) {
|
|
@@ -67,14 +65,14 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
67
65
|
if (!chainId) {
|
|
68
66
|
throw new Error("Chain ID is not set");
|
|
69
67
|
}
|
|
70
|
-
const { DelegationManager: expectedDelegationManager } =
|
|
68
|
+
const { DelegationManager: expectedDelegationManager } = _chunk2OS36DVVcjs.getSmartAccountsEnvironment.call(void 0, chainId);
|
|
71
69
|
if (!_viem.isAddressEqual.call(void 0, args.delegationManager, expectedDelegationManager)) {
|
|
72
70
|
throw new Error(
|
|
73
71
|
`Invalid DelegationManager: expected ${expectedDelegationManager} for chain ${chainId}, but got ${args.delegationManager}`
|
|
74
72
|
);
|
|
75
73
|
}
|
|
76
74
|
const executions = [
|
|
77
|
-
|
|
75
|
+
_chunkW6HPAK4Mcjs.createExecution.call(void 0, {
|
|
78
76
|
target: args.to,
|
|
79
77
|
value: args.value,
|
|
80
78
|
callData: args.data
|
|
@@ -84,9 +82,9 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
84
82
|
abi: _delegationabis.DelegationManager,
|
|
85
83
|
functionName: "redeemDelegations",
|
|
86
84
|
args: [
|
|
87
|
-
[
|
|
85
|
+
[_chunkW6HPAK4Mcjs.encodeDelegations.call(void 0, args.permissionContext)],
|
|
88
86
|
["0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */],
|
|
89
|
-
|
|
87
|
+
_chunkW6HPAK4Mcjs.encodeExecutionCalldatas.call(void 0, [executions])
|
|
90
88
|
]
|
|
91
89
|
});
|
|
92
90
|
const {
|
|
@@ -103,7 +101,7 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
103
101
|
return hash;
|
|
104
102
|
}
|
|
105
103
|
async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
106
|
-
|
|
104
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "sendUserOperationWithDelegationAction", {
|
|
107
105
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _5 => _5.chain, 'optionalAccess', _6 => _6.id]), () => ( null)),
|
|
108
106
|
callCount: parameters.calls.length,
|
|
109
107
|
hasDependencies: parameters.dependencies !== void 0
|
|
@@ -115,7 +113,7 @@ async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
|
115
113
|
if (!chainId) {
|
|
116
114
|
throw new Error("Chain ID is not set");
|
|
117
115
|
}
|
|
118
|
-
const { SimpleFactory } =
|
|
116
|
+
const { SimpleFactory } = _chunk2OS36DVVcjs.getSmartAccountsEnvironment.call(void 0, chainId);
|
|
119
117
|
const uniqueDependencies = parameters.dependencies.filter((dependency) => {
|
|
120
118
|
if (!_viem.isAddressEqual.call(void 0, dependency.factory, SimpleFactory)) {
|
|
121
119
|
throw new Error(
|
|
@@ -158,7 +156,7 @@ async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
|
158
156
|
}
|
|
159
157
|
return {
|
|
160
158
|
...call,
|
|
161
|
-
permissionContext:
|
|
159
|
+
permissionContext: _chunkW6HPAK4Mcjs.encodeDelegations.call(void 0, permissionContext)
|
|
162
160
|
};
|
|
163
161
|
});
|
|
164
162
|
return client.sendUserOperation(
|
|
@@ -174,7 +172,7 @@ function permissionRequestToRpc(parameters) {
|
|
|
174
172
|
parameters.permission.type
|
|
175
173
|
);
|
|
176
174
|
const rules = [];
|
|
177
|
-
if (
|
|
175
|
+
if (_chunkW6HPAK4Mcjs.isDefined.call(void 0, expiry)) {
|
|
178
176
|
rules.push({
|
|
179
177
|
type: "expiry",
|
|
180
178
|
data: {
|
|
@@ -182,7 +180,7 @@ function permissionRequestToRpc(parameters) {
|
|
|
182
180
|
}
|
|
183
181
|
});
|
|
184
182
|
}
|
|
185
|
-
if (
|
|
183
|
+
if (_chunkW6HPAK4Mcjs.isDefined.call(void 0, redeemer)) {
|
|
186
184
|
if (redeemer.length === 0) {
|
|
187
185
|
throw new Error(
|
|
188
186
|
"Invalid redeemers: must specify at least one redeemer address"
|
|
@@ -200,7 +198,7 @@ function permissionRequestToRpc(parameters) {
|
|
|
200
198
|
data: { addresses }
|
|
201
199
|
});
|
|
202
200
|
}
|
|
203
|
-
if (
|
|
201
|
+
if (_chunkW6HPAK4Mcjs.isDefined.call(void 0, payee)) {
|
|
204
202
|
if (payee.length === 0) {
|
|
205
203
|
throw new Error(
|
|
206
204
|
"Invalid payees: must specify at least one payee address"
|
|
@@ -259,6 +257,10 @@ function getPermissionRequestToRpcConverter(permissionType) {
|
|
|
259
257
|
return (permission) => erc20TokenRevocationPermissionToRpc(
|
|
260
258
|
permission
|
|
261
259
|
);
|
|
260
|
+
case "token-approval-revocation":
|
|
261
|
+
return (permission) => tokenApprovalRevocationPermissionToRpc(
|
|
262
|
+
permission
|
|
263
|
+
);
|
|
262
264
|
default:
|
|
263
265
|
throw new Error(`Unsupported permission type: ${permissionType}`);
|
|
264
266
|
}
|
|
@@ -275,13 +277,13 @@ function nativeTokenStreamPermissionToRpc(permission) {
|
|
|
275
277
|
isAdjustmentAllowed
|
|
276
278
|
} = permission;
|
|
277
279
|
const optionalFields = {
|
|
278
|
-
...
|
|
279
|
-
initialAmount:
|
|
280
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, initialAmount) && {
|
|
281
|
+
initialAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, initialAmount, "initialAmount")
|
|
280
282
|
},
|
|
281
|
-
...
|
|
282
|
-
maxAmount:
|
|
283
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, maxAmount) && {
|
|
284
|
+
maxAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, maxAmount, "maxAmount")
|
|
283
285
|
},
|
|
284
|
-
...
|
|
286
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
285
287
|
startTime: Number(startTime)
|
|
286
288
|
},
|
|
287
289
|
...justification ? { justification } : {}
|
|
@@ -289,7 +291,7 @@ function nativeTokenStreamPermissionToRpc(permission) {
|
|
|
289
291
|
return {
|
|
290
292
|
type: "native-token-stream",
|
|
291
293
|
data: {
|
|
292
|
-
amountPerSecond:
|
|
294
|
+
amountPerSecond: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, amountPerSecond, "amountPerSecond"),
|
|
293
295
|
...optionalFields
|
|
294
296
|
},
|
|
295
297
|
isAdjustmentAllowed
|
|
@@ -308,13 +310,13 @@ function erc20TokenStreamPermissionToRpc(permission) {
|
|
|
308
310
|
isAdjustmentAllowed
|
|
309
311
|
} = permission;
|
|
310
312
|
const optionalFields = {
|
|
311
|
-
...
|
|
312
|
-
initialAmount:
|
|
313
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, initialAmount) && {
|
|
314
|
+
initialAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, initialAmount, "initialAmount")
|
|
313
315
|
},
|
|
314
|
-
...
|
|
315
|
-
maxAmount:
|
|
316
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, maxAmount) && {
|
|
317
|
+
maxAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, maxAmount, "maxAmount")
|
|
316
318
|
},
|
|
317
|
-
...
|
|
319
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
318
320
|
startTime: Number(startTime)
|
|
319
321
|
},
|
|
320
322
|
...justification ? { justification } : {}
|
|
@@ -322,8 +324,8 @@ function erc20TokenStreamPermissionToRpc(permission) {
|
|
|
322
324
|
return {
|
|
323
325
|
type: "erc20-token-stream",
|
|
324
326
|
data: {
|
|
325
|
-
tokenAddress:
|
|
326
|
-
amountPerSecond:
|
|
327
|
+
tokenAddress: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
328
|
+
amountPerSecond: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, amountPerSecond, "amountPerSecond"),
|
|
327
329
|
...optionalFields
|
|
328
330
|
},
|
|
329
331
|
isAdjustmentAllowed
|
|
@@ -335,7 +337,7 @@ function nativeTokenPeriodicPermissionToRpc(permission) {
|
|
|
335
337
|
isAdjustmentAllowed
|
|
336
338
|
} = permission;
|
|
337
339
|
const optionalFields = {
|
|
338
|
-
...
|
|
340
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
339
341
|
startTime: Number(startTime)
|
|
340
342
|
},
|
|
341
343
|
...justification ? { justification } : {}
|
|
@@ -343,7 +345,7 @@ function nativeTokenPeriodicPermissionToRpc(permission) {
|
|
|
343
345
|
return {
|
|
344
346
|
type: "native-token-periodic",
|
|
345
347
|
data: {
|
|
346
|
-
periodAmount:
|
|
348
|
+
periodAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, periodAmount, "periodAmount"),
|
|
347
349
|
periodDuration: Number(periodDuration),
|
|
348
350
|
...optionalFields
|
|
349
351
|
},
|
|
@@ -362,7 +364,7 @@ function erc20TokenPeriodicPermissionToRpc(permission) {
|
|
|
362
364
|
isAdjustmentAllowed
|
|
363
365
|
} = permission;
|
|
364
366
|
const optionalFields = {
|
|
365
|
-
...
|
|
367
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
366
368
|
startTime: Number(startTime)
|
|
367
369
|
},
|
|
368
370
|
...justification ? { justification } : {}
|
|
@@ -370,8 +372,8 @@ function erc20TokenPeriodicPermissionToRpc(permission) {
|
|
|
370
372
|
return {
|
|
371
373
|
type: "erc20-token-periodic",
|
|
372
374
|
data: {
|
|
373
|
-
tokenAddress:
|
|
374
|
-
periodAmount:
|
|
375
|
+
tokenAddress: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
376
|
+
periodAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, periodAmount, "periodAmount"),
|
|
375
377
|
periodDuration: Number(periodDuration),
|
|
376
378
|
...optionalFields
|
|
377
379
|
},
|
|
@@ -384,7 +386,7 @@ function nativeTokenAllowancePermissionToRpc(permission) {
|
|
|
384
386
|
isAdjustmentAllowed
|
|
385
387
|
} = permission;
|
|
386
388
|
const optionalFields = {
|
|
387
|
-
...
|
|
389
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
388
390
|
startTime: Number(startTime)
|
|
389
391
|
},
|
|
390
392
|
...justification ? { justification } : {}
|
|
@@ -392,7 +394,7 @@ function nativeTokenAllowancePermissionToRpc(permission) {
|
|
|
392
394
|
return {
|
|
393
395
|
type: "native-token-allowance",
|
|
394
396
|
data: {
|
|
395
|
-
allowanceAmount:
|
|
397
|
+
allowanceAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, allowanceAmount, "allowanceAmount"),
|
|
396
398
|
...optionalFields
|
|
397
399
|
},
|
|
398
400
|
isAdjustmentAllowed
|
|
@@ -404,7 +406,7 @@ function erc20TokenAllowancePermissionToRpc(permission) {
|
|
|
404
406
|
isAdjustmentAllowed
|
|
405
407
|
} = permission;
|
|
406
408
|
const optionalFields = {
|
|
407
|
-
...
|
|
409
|
+
..._chunkW6HPAK4Mcjs.isDefined.call(void 0, startTime) && {
|
|
408
410
|
startTime: Number(startTime)
|
|
409
411
|
},
|
|
410
412
|
...justification ? { justification } : {}
|
|
@@ -412,8 +414,8 @@ function erc20TokenAllowancePermissionToRpc(permission) {
|
|
|
412
414
|
return {
|
|
413
415
|
type: "erc20-token-allowance",
|
|
414
416
|
data: {
|
|
415
|
-
tokenAddress:
|
|
416
|
-
allowanceAmount:
|
|
417
|
+
tokenAddress: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
418
|
+
allowanceAmount: _chunkW6HPAK4Mcjs.toHexOrThrow.call(void 0, allowanceAmount, "allowanceAmount"),
|
|
417
419
|
...optionalFields
|
|
418
420
|
},
|
|
419
421
|
isAdjustmentAllowed
|
|
@@ -433,6 +435,34 @@ function erc20TokenRevocationPermissionToRpc(permission) {
|
|
|
433
435
|
isAdjustmentAllowed
|
|
434
436
|
};
|
|
435
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
|
+
}
|
|
436
466
|
function permissionResponsesFromRpc(result) {
|
|
437
467
|
return result.map((permission) => ({
|
|
438
468
|
...permission,
|
|
@@ -504,7 +534,7 @@ function rpcSupportedPermissionsToDeveloper(result) {
|
|
|
504
534
|
|
|
505
535
|
// src/actions/erc7715GetGrantedExecutionPermissionsAction.ts
|
|
506
536
|
async function erc7715GetGrantedExecutionPermissionsAction(client) {
|
|
507
|
-
|
|
537
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
508
538
|
"erc7715GetGrantedExecutionPermissionsAction",
|
|
509
539
|
{
|
|
510
540
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]), () => ( null))
|
|
@@ -525,7 +555,7 @@ async function erc7715GetGrantedExecutionPermissionsAction(client) {
|
|
|
525
555
|
|
|
526
556
|
// src/actions/erc7715GetSupportedExecutionPermissionsAction.ts
|
|
527
557
|
async function erc7715GetSupportedExecutionPermissionsAction(client) {
|
|
528
|
-
|
|
558
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
529
559
|
"erc7715GetSupportedExecutionPermissionsAction",
|
|
530
560
|
{
|
|
531
561
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _13 => _13.chain, 'optionalAccess', _14 => _14.id]), () => ( null))
|
|
@@ -546,7 +576,7 @@ async function erc7715GetSupportedExecutionPermissionsAction(client) {
|
|
|
546
576
|
|
|
547
577
|
// src/actions/erc7715RequestExecutionPermissionsAction.ts
|
|
548
578
|
async function erc7715RequestExecutionPermissionsAction(client, parameters) {
|
|
549
|
-
|
|
579
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
550
580
|
"erc7715RequestExecutionPermissionsAction",
|
|
551
581
|
{
|
|
552
582
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _15 => _15.chain, 'optionalAccess', _16 => _16.id]), () => ( null)),
|
|
@@ -588,7 +618,7 @@ async function signDelegation(client, parameters) {
|
|
|
588
618
|
throw new (0, _viem.BaseError)("Account not found. Please provide an account.");
|
|
589
619
|
}
|
|
590
620
|
const account = _accounts.parseAccount.call(void 0, accountParam);
|
|
591
|
-
const typedData =
|
|
621
|
+
const typedData = _chunkW6HPAK4Mcjs.prepareSignDelegationTypedData.call(void 0, {
|
|
592
622
|
delegation,
|
|
593
623
|
delegationManager,
|
|
594
624
|
chainId,
|
|
@@ -636,7 +666,7 @@ async function signAndPrependRedelegation(client, options) {
|
|
|
636
666
|
...unsignedDelegation,
|
|
637
667
|
signature
|
|
638
668
|
};
|
|
639
|
-
const newPermissionContext =
|
|
669
|
+
const newPermissionContext = _chunkW6HPAK4Mcjs.encodeDelegations.call(void 0, [
|
|
640
670
|
signedDelegation,
|
|
641
671
|
...delegations
|
|
642
672
|
]);
|
|
@@ -651,14 +681,14 @@ function resolveRedelegationArgs(client, parameters) {
|
|
|
651
681
|
throw new (0, _viem.BaseError)("Account not found. Please provide an account.");
|
|
652
682
|
}
|
|
653
683
|
const account = _accounts.parseAccount.call(void 0, accountParam);
|
|
654
|
-
const delegations =
|
|
684
|
+
const delegations = _chunkW6HPAK4Mcjs.decodeDelegations.call(void 0, permissionContext);
|
|
655
685
|
const parentDelegation = delegations[0];
|
|
656
686
|
if (!parentDelegation) {
|
|
657
687
|
throw new (0, _viem.BaseError)(
|
|
658
688
|
"Permission context must contain at least one delegation"
|
|
659
689
|
);
|
|
660
690
|
}
|
|
661
|
-
const isParentOpenDelegation = parentDelegation.delegate.toLowerCase() ===
|
|
691
|
+
const isParentOpenDelegation = parentDelegation.delegate.toLowerCase() === _chunkW6HPAK4Mcjs.ANY_BENEFICIARY.toLowerCase();
|
|
662
692
|
const from = isParentOpenDelegation ? account.address : parentDelegation.delegate;
|
|
663
693
|
return { account, delegations, parentDelegation, from };
|
|
664
694
|
}
|
|
@@ -666,12 +696,12 @@ async function redelegatePermissionContextAction(client, parameters) {
|
|
|
666
696
|
const { environment, scope, caveats, salt, to } = parameters;
|
|
667
697
|
const chainId = resolveChainId(client, parameters.chainId);
|
|
668
698
|
const { account, delegations, parentDelegation, from } = resolveRedelegationArgs(client, parameters);
|
|
669
|
-
|
|
699
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "redelegatePermissionContext", {
|
|
670
700
|
chainId,
|
|
671
701
|
hasScope: scope !== void 0,
|
|
672
702
|
hasCaveats: caveats !== void 0
|
|
673
703
|
});
|
|
674
|
-
const unsignedDelegation =
|
|
704
|
+
const unsignedDelegation = _chunkW6HPAK4Mcjs.createDelegation.call(void 0, {
|
|
675
705
|
environment,
|
|
676
706
|
from,
|
|
677
707
|
to,
|
|
@@ -692,12 +722,12 @@ async function redelegatePermissionContextOpenAction(client, parameters) {
|
|
|
692
722
|
const { environment, scope, caveats, salt } = parameters;
|
|
693
723
|
const chainId = resolveChainId(client, parameters.chainId);
|
|
694
724
|
const { account, delegations, parentDelegation, from } = resolveRedelegationArgs(client, parameters);
|
|
695
|
-
|
|
725
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "redelegatePermissionContextOpen", {
|
|
696
726
|
chainId,
|
|
697
727
|
hasScope: scope !== void 0,
|
|
698
728
|
hasCaveats: caveats !== void 0
|
|
699
729
|
});
|
|
700
|
-
const unsignedDelegation =
|
|
730
|
+
const unsignedDelegation = _chunkW6HPAK4Mcjs.createOpenDelegation.call(void 0, {
|
|
701
731
|
environment,
|
|
702
732
|
from,
|
|
703
733
|
scope,
|
|
@@ -765,7 +795,7 @@ function getEnforcerAddress({
|
|
|
765
795
|
return enforcerAddress;
|
|
766
796
|
}
|
|
767
797
|
async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment, params) {
|
|
768
|
-
|
|
798
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
769
799
|
"getErc20PeriodTransferEnforcerAvailableAmount",
|
|
770
800
|
{
|
|
771
801
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _21 => _21.chain, 'optionalAccess', _22 => _22.id]), () => ( null))
|
|
@@ -777,13 +807,13 @@ async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment
|
|
|
777
807
|
enforcerName,
|
|
778
808
|
environment
|
|
779
809
|
});
|
|
780
|
-
const delegationHash =
|
|
810
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
781
811
|
const { terms } = findMatchingCaveat({
|
|
782
812
|
delegation: params.delegation,
|
|
783
813
|
enforcerAddress,
|
|
784
814
|
enforcerName
|
|
785
815
|
});
|
|
786
|
-
return
|
|
816
|
+
return _chunkPQPAEHJZcjs.read_exports.getAvailableAmount({
|
|
787
817
|
client,
|
|
788
818
|
contractAddress: enforcerAddress,
|
|
789
819
|
delegationHash,
|
|
@@ -792,7 +822,7 @@ async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment
|
|
|
792
822
|
});
|
|
793
823
|
}
|
|
794
824
|
async function getErc20StreamingEnforcerAvailableAmount(client, environment, params) {
|
|
795
|
-
|
|
825
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
796
826
|
"getErc20StreamingEnforcerAvailableAmount",
|
|
797
827
|
{
|
|
798
828
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _23 => _23.chain, 'optionalAccess', _24 => _24.id]), () => ( null))
|
|
@@ -804,13 +834,13 @@ async function getErc20StreamingEnforcerAvailableAmount(client, environment, par
|
|
|
804
834
|
enforcerName,
|
|
805
835
|
environment
|
|
806
836
|
});
|
|
807
|
-
const delegationHash =
|
|
837
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
808
838
|
const { terms } = findMatchingCaveat({
|
|
809
839
|
delegation: params.delegation,
|
|
810
840
|
enforcerAddress,
|
|
811
841
|
enforcerName
|
|
812
842
|
});
|
|
813
|
-
return
|
|
843
|
+
return _chunkPQPAEHJZcjs.read_exports2.getAvailableAmount({
|
|
814
844
|
client,
|
|
815
845
|
contractAddress: enforcerAddress,
|
|
816
846
|
delegationManager,
|
|
@@ -819,7 +849,7 @@ async function getErc20StreamingEnforcerAvailableAmount(client, environment, par
|
|
|
819
849
|
});
|
|
820
850
|
}
|
|
821
851
|
async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, params) {
|
|
822
|
-
|
|
852
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
823
853
|
"getMultiTokenPeriodEnforcerAvailableAmount",
|
|
824
854
|
{
|
|
825
855
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _25 => _25.chain, 'optionalAccess', _26 => _26.id]), () => ( null))
|
|
@@ -831,13 +861,13 @@ async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, p
|
|
|
831
861
|
enforcerName,
|
|
832
862
|
environment
|
|
833
863
|
});
|
|
834
|
-
const delegationHash =
|
|
864
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
835
865
|
const { terms, args } = findMatchingCaveat({
|
|
836
866
|
delegation: params.delegation,
|
|
837
867
|
enforcerAddress,
|
|
838
868
|
enforcerName
|
|
839
869
|
});
|
|
840
|
-
return
|
|
870
|
+
return _chunkPQPAEHJZcjs.read_exports3.getAvailableAmount({
|
|
841
871
|
client,
|
|
842
872
|
contractAddress: enforcerAddress,
|
|
843
873
|
delegationHash,
|
|
@@ -847,7 +877,7 @@ async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, p
|
|
|
847
877
|
});
|
|
848
878
|
}
|
|
849
879
|
async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, environment, params) {
|
|
850
|
-
|
|
880
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
851
881
|
"getNativeTokenPeriodTransferEnforcerAvailableAmount",
|
|
852
882
|
{
|
|
853
883
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _27 => _27.chain, 'optionalAccess', _28 => _28.id]), () => ( null))
|
|
@@ -859,13 +889,13 @@ async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, envir
|
|
|
859
889
|
enforcerName,
|
|
860
890
|
environment
|
|
861
891
|
});
|
|
862
|
-
const delegationHash =
|
|
892
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
863
893
|
const { terms } = findMatchingCaveat({
|
|
864
894
|
delegation: params.delegation,
|
|
865
895
|
enforcerAddress,
|
|
866
896
|
enforcerName
|
|
867
897
|
});
|
|
868
|
-
return
|
|
898
|
+
return _chunkPQPAEHJZcjs.read_exports4.getAvailableAmount({
|
|
869
899
|
client,
|
|
870
900
|
contractAddress: enforcerAddress,
|
|
871
901
|
delegationHash,
|
|
@@ -874,7 +904,7 @@ async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, envir
|
|
|
874
904
|
});
|
|
875
905
|
}
|
|
876
906
|
async function getNativeTokenStreamingEnforcerAvailableAmount(client, environment, params) {
|
|
877
|
-
|
|
907
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
878
908
|
"getNativeTokenStreamingEnforcerAvailableAmount",
|
|
879
909
|
{
|
|
880
910
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _29 => _29.chain, 'optionalAccess', _30 => _30.id]), () => ( null))
|
|
@@ -886,13 +916,13 @@ async function getNativeTokenStreamingEnforcerAvailableAmount(client, environmen
|
|
|
886
916
|
enforcerName,
|
|
887
917
|
environment
|
|
888
918
|
});
|
|
889
|
-
const delegationHash =
|
|
919
|
+
const delegationHash = _chunkW6HPAK4Mcjs.hashDelegation.call(void 0, params.delegation);
|
|
890
920
|
const { terms } = findMatchingCaveat({
|
|
891
921
|
delegation: params.delegation,
|
|
892
922
|
enforcerAddress,
|
|
893
923
|
enforcerName
|
|
894
924
|
});
|
|
895
|
-
return
|
|
925
|
+
return _chunkPQPAEHJZcjs.read_exports5.getAvailableAmount({
|
|
896
926
|
client,
|
|
897
927
|
contractAddress: enforcerAddress,
|
|
898
928
|
delegationManager,
|
|
@@ -1022,7 +1052,7 @@ async function signUserOperation(client, parameters) {
|
|
|
1022
1052
|
throw new (0, _viem.BaseError)("Account not found. Please provide an account.");
|
|
1023
1053
|
}
|
|
1024
1054
|
const account = _accounts.parseAccount.call(void 0, accountParam);
|
|
1025
|
-
const typedData =
|
|
1055
|
+
const typedData = _chunk2OS36DVVcjs.prepareSignUserOperationTypedData.call(void 0, {
|
|
1026
1056
|
userOperation,
|
|
1027
1057
|
entryPoint,
|
|
1028
1058
|
chainId,
|
|
@@ -1101,4 +1131,4 @@ var erc7710BundlerActions = () => (client) => ({
|
|
|
1101
1131
|
|
|
1102
1132
|
|
|
1103
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;
|
|
1104
|
-
//# sourceMappingURL=chunk-
|
|
1134
|
+
//# sourceMappingURL=chunk-2ZOWIAP3.cjs.map
|