@metamask/smart-accounts-kit 1.5.0 → 1.7.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 +63 -29
- 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-BEKgygS8.d.cts} +1 -2
- package/dist/{caveats-CaSt_VHs.d.cts → caveats-DPuxVdYU.d.ts} +1 -2
- package/dist/{chunk-SOFB2MXG.cjs → chunk-2OS36DVV.cjs} +8 -1
- package/dist/chunk-2OS36DVV.cjs.map +1 -0
- package/dist/{chunk-FH6HZCHI.cjs → chunk-32RDDE5N.cjs} +200 -18
- package/dist/chunk-32RDDE5N.cjs.map +1 -0
- package/dist/{chunk-MV2KHN75.mjs → chunk-3KWKQ7PV.mjs} +163 -35
- package/dist/chunk-3KWKQ7PV.mjs.map +1 -0
- package/dist/{chunk-DN4O5VOP.cjs → chunk-4GOGI2TA.cjs} +158 -151
- package/dist/chunk-4GOGI2TA.cjs.map +1 -0
- package/dist/{chunk-XEOE25DE.cjs → chunk-6TSLFRJC.cjs} +98 -68
- package/dist/chunk-6TSLFRJC.cjs.map +1 -0
- package/dist/{chunk-W7O2UQL5.mjs → chunk-EMPAUTIV.mjs} +188 -6
- package/dist/chunk-EMPAUTIV.mjs.map +1 -0
- package/dist/{chunk-IBZSNB7D.cjs → chunk-GHGCGV3C.cjs} +202 -74
- package/dist/chunk-GHGCGV3C.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-TBHT26BV.mjs → chunk-IERUQUKJ.mjs} +67 -60
- package/dist/chunk-IERUQUKJ.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-SCS3CFRE.cjs → chunk-KIXYMA7J.cjs} +15 -17
- package/dist/chunk-KIXYMA7J.cjs.map +1 -0
- package/dist/{chunk-YXHUT56Z.mjs → chunk-T6SWQZRX.mjs} +4 -6
- package/dist/{chunk-YXHUT56Z.mjs.map → chunk-T6SWQZRX.mjs.map} +1 -1
- package/dist/{chunk-BGOSYTKV.mjs → chunk-XUBMIW33.mjs} +38 -8
- package/dist/chunk-XUBMIW33.mjs.map +1 -0
- package/dist/{chunk-N66VAWMO.mjs → chunk-YCNLPEPH.mjs} +2 -2
- package/dist/{chunk-7FYDQNJ3.cjs → chunk-YPUEM6YV.cjs} +12 -12
- package/dist/{chunk-7FYDQNJ3.cjs.map → chunk-YPUEM6YV.cjs.map} +1 -1
- 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-CSOClzsa.d.cts} +11 -3
- package/dist/{delegation-BKkEyxZY.d.cts → decodeRevertReason-WjHVQ_Sz.d.ts} +11 -3
- package/dist/experimental/index.cjs +392 -9
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/index.d.cts +41 -3
- package/dist/experimental/index.d.ts +41 -3
- package/dist/experimental/index.mjs +385 -2
- package/dist/experimental/index.mjs.map +1 -1
- package/dist/index-BHm75OFP.d.cts +61 -0
- package/dist/{index-DXdlz7t4.d.ts → index-BNHYZ9iU.d.ts} +99 -93
- package/dist/{index-G78z6nwi.d.ts → index-CgGKjHSr.d.ts} +13 -5
- package/dist/{index-yU3olCJV.d.cts → index-CsjbdUp_.d.cts} +99 -93
- package/dist/index-DWvEgBtg.d.ts +61 -0
- package/dist/{index-DfDAuvr5.d.cts → index-DYJjOeTn.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-aQPEogPk.d.cts} +160 -62
- package/dist/{resolveCaveats-s2snaFEo.d.ts → resolveCaveats-aQPEogPk.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 +13 -12
- 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-YCNLPEPH.mjs.map} +0 -0
|
@@ -36,6 +36,7 @@ var ScopeType = /* @__PURE__ */ ((ScopeType2) => {
|
|
|
36
36
|
var CaveatType = /* @__PURE__ */ ((CaveatType2) => {
|
|
37
37
|
CaveatType2["AllowedMethods"] = "allowedMethods";
|
|
38
38
|
CaveatType2["AllowedTargets"] = "allowedTargets";
|
|
39
|
+
CaveatType2["ApprovalRevocation"] = "approvalRevocation";
|
|
39
40
|
CaveatType2["Deployed"] = "deployed";
|
|
40
41
|
CaveatType2["AllowedCalldata"] = "allowedCalldata";
|
|
41
42
|
CaveatType2["Erc20BalanceChange"] = "erc20BalanceChange";
|
|
@@ -228,6 +229,26 @@ var allowedTargetsBuilder = (environment, config) => {
|
|
|
228
229
|
};
|
|
229
230
|
};
|
|
230
231
|
|
|
232
|
+
// src/caveatBuilder/approvalRevocationBuilder.ts
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
var approvalRevocation = "approvalRevocation";
|
|
237
|
+
var approvalRevocationBuilder = (environment, config) => {
|
|
238
|
+
const terms = _delegationcore.createApprovalRevocationTerms.call(void 0, config);
|
|
239
|
+
const {
|
|
240
|
+
caveatEnforcers: { ApprovalRevocationEnforcer }
|
|
241
|
+
} = environment;
|
|
242
|
+
if (!ApprovalRevocationEnforcer) {
|
|
243
|
+
throw new Error("ApprovalRevocationEnforcer not found in environment");
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
enforcer: ApprovalRevocationEnforcer,
|
|
247
|
+
terms,
|
|
248
|
+
args: "0x00"
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
|
|
231
252
|
// src/caveatBuilder/argsEqualityCheckBuilder.ts
|
|
232
253
|
|
|
233
254
|
|
|
@@ -1041,7 +1062,7 @@ var valueLteBuilder = (environment, config) => {
|
|
|
1041
1062
|
|
|
1042
1063
|
// src/caveatBuilder/coreCaveatBuilder.ts
|
|
1043
1064
|
var createCaveatBuilder = (environment, config) => {
|
|
1044
|
-
const caveatBuilder = new CaveatBuilder(environment, config).extend(allowedMethods, allowedMethodsBuilder).extend(allowedTargets, allowedTargetsBuilder).extend(deployed, deployedBuilder).extend(allowedCalldata, allowedCalldataBuilder).extend(erc20BalanceChange, erc20BalanceChangeBuilder).extend(erc721BalanceChange, erc721BalanceChangeBuilder).extend(erc1155BalanceChange, erc1155BalanceChangeBuilder).extend(valueLte, valueLteBuilder).extend(limitedCalls, limitedCallsBuilder).extend(id, idBuilder).extend(nonce, nonceBuilder).extend(timestamp, timestampBuilder).extend(blockNumber, blockNumberBuilder).extend(erc20TransferAmount, erc20TransferAmountBuilder).extend(erc20Streaming, erc20StreamingBuilder).extend(nativeTokenStreaming, nativeTokenStreamingBuilder).extend(erc721Transfer, erc721TransferBuilder).extend(nativeTokenTransferAmount, nativeTokenTransferAmountBuilder).extend(nativeBalanceChange, nativeBalanceChangeBuilder).extend(redeemer, redeemerBuilder).extend(nativeTokenPayment, nativeTokenPaymentBuilder).extend(argsEqualityCheck, argsEqualityCheckBuilder).extend(
|
|
1065
|
+
const caveatBuilder = new CaveatBuilder(environment, config).extend(allowedMethods, allowedMethodsBuilder).extend(allowedTargets, allowedTargetsBuilder).extend(approvalRevocation, approvalRevocationBuilder).extend(deployed, deployedBuilder).extend(allowedCalldata, allowedCalldataBuilder).extend(erc20BalanceChange, erc20BalanceChangeBuilder).extend(erc721BalanceChange, erc721BalanceChangeBuilder).extend(erc1155BalanceChange, erc1155BalanceChangeBuilder).extend(valueLte, valueLteBuilder).extend(limitedCalls, limitedCallsBuilder).extend(id, idBuilder).extend(nonce, nonceBuilder).extend(timestamp, timestampBuilder).extend(blockNumber, blockNumberBuilder).extend(erc20TransferAmount, erc20TransferAmountBuilder).extend(erc20Streaming, erc20StreamingBuilder).extend(nativeTokenStreaming, nativeTokenStreamingBuilder).extend(erc721Transfer, erc721TransferBuilder).extend(nativeTokenTransferAmount, nativeTokenTransferAmountBuilder).extend(nativeBalanceChange, nativeBalanceChangeBuilder).extend(redeemer, redeemerBuilder).extend(nativeTokenPayment, nativeTokenPaymentBuilder).extend(argsEqualityCheck, argsEqualityCheckBuilder).extend(
|
|
1045
1066
|
specificActionERC20TransferBatch,
|
|
1046
1067
|
specificActionERC20TransferBatchBuilder
|
|
1047
1068
|
).extend(erc20PeriodTransfer, erc20PeriodTransferBuilder).extend(nativeTokenPeriodTransfer, nativeTokenPeriodTransferBuilder).extend(exactCalldataBatch, exactCalldataBatchBuilder).extend(exactCalldata, exactCalldataBuilder).extend(exactExecution, exactExecutionBuilder).extend(exactExecutionBatch, exactExecutionBatchBuilder).extend(multiTokenPeriod, multiTokenPeriodBuilder).extend(ownershipTransfer, ownershipTransferBuilder);
|
|
@@ -1402,6 +1423,7 @@ var resolveCaveats = ({
|
|
|
1402
1423
|
|
|
1403
1424
|
|
|
1404
1425
|
|
|
1426
|
+
|
|
1405
1427
|
|
|
1406
1428
|
|
|
1407
1429
|
var CAVEAT_ABI_TYPE_COMPONENTS = [
|
|
@@ -1425,113 +1447,142 @@ var decodeCaveat = ({
|
|
|
1425
1447
|
}) => {
|
|
1426
1448
|
switch (enforcer.toLowerCase()) {
|
|
1427
1449
|
case _optionalChain([caveatEnforcers, 'access', _2 => _2.AllowedCalldataEnforcer, 'optionalAccess', _3 => _3.toLowerCase, 'call', _4 => _4()]):
|
|
1428
|
-
return {
|
|
1450
|
+
return {
|
|
1451
|
+
type: "allowedCalldata" /* AllowedCalldata */,
|
|
1452
|
+
..._delegationcore.decodeAllowedCalldataTerms.call(void 0, terms)
|
|
1453
|
+
};
|
|
1429
1454
|
case _optionalChain([caveatEnforcers, 'access', _5 => _5.AllowedMethodsEnforcer, 'optionalAccess', _6 => _6.toLowerCase, 'call', _7 => _7()]):
|
|
1430
|
-
return { type: "allowedMethods", ..._delegationcore.decodeAllowedMethodsTerms.call(void 0, terms) };
|
|
1431
|
-
case _optionalChain([caveatEnforcers, 'access', _8 => _8.AllowedTargetsEnforcer, 'optionalAccess', _9 => _9.toLowerCase, 'call', _10 => _10()]):
|
|
1432
|
-
return { type: "allowedTargets", ..._delegationcore.decodeAllowedTargetsTerms.call(void 0, terms) };
|
|
1433
|
-
case _optionalChain([caveatEnforcers, 'access', _11 => _11.ArgsEqualityCheckEnforcer, 'optionalAccess', _12 => _12.toLowerCase, 'call', _13 => _13()]):
|
|
1434
1455
|
return {
|
|
1435
|
-
type: "
|
|
1456
|
+
type: "allowedMethods" /* AllowedMethods */,
|
|
1457
|
+
..._delegationcore.decodeAllowedMethodsTerms.call(void 0, terms)
|
|
1458
|
+
};
|
|
1459
|
+
case _optionalChain([caveatEnforcers, 'access', _8 => _8.ApprovalRevocationEnforcer, 'optionalAccess', _9 => _9.toLowerCase, 'call', _10 => _10()]):
|
|
1460
|
+
return {
|
|
1461
|
+
type: "approvalRevocation" /* ApprovalRevocation */,
|
|
1462
|
+
..._delegationcore.decodeApprovalRevocationTerms.call(void 0, terms)
|
|
1463
|
+
};
|
|
1464
|
+
case _optionalChain([caveatEnforcers, 'access', _11 => _11.AllowedTargetsEnforcer, 'optionalAccess', _12 => _12.toLowerCase, 'call', _13 => _13()]):
|
|
1465
|
+
return {
|
|
1466
|
+
type: "allowedTargets" /* AllowedTargets */,
|
|
1467
|
+
..._delegationcore.decodeAllowedTargetsTerms.call(void 0, terms)
|
|
1468
|
+
};
|
|
1469
|
+
case _optionalChain([caveatEnforcers, 'access', _14 => _14.ArgsEqualityCheckEnforcer, 'optionalAccess', _15 => _15.toLowerCase, 'call', _16 => _16()]):
|
|
1470
|
+
return {
|
|
1471
|
+
type: "argsEqualityCheck" /* ArgsEqualityCheck */,
|
|
1436
1472
|
..._delegationcore.decodeArgsEqualityCheckTerms.call(void 0, terms)
|
|
1437
1473
|
};
|
|
1438
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1439
|
-
return { type: "blockNumber"
|
|
1440
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1441
|
-
return { type: "deployed"
|
|
1442
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1474
|
+
case _optionalChain([caveatEnforcers, 'access', _17 => _17.BlockNumberEnforcer, 'optionalAccess', _18 => _18.toLowerCase, 'call', _19 => _19()]):
|
|
1475
|
+
return { type: "blockNumber" /* BlockNumber */, ..._delegationcore.decodeBlockNumberTerms.call(void 0, terms) };
|
|
1476
|
+
case _optionalChain([caveatEnforcers, 'access', _20 => _20.DeployedEnforcer, 'optionalAccess', _21 => _21.toLowerCase, 'call', _22 => _22()]):
|
|
1477
|
+
return { type: "deployed" /* Deployed */, ..._delegationcore.decodeDeployedTerms.call(void 0, terms) };
|
|
1478
|
+
case _optionalChain([caveatEnforcers, 'access', _23 => _23.ERC20BalanceChangeEnforcer, 'optionalAccess', _24 => _24.toLowerCase, 'call', _25 => _25()]):
|
|
1443
1479
|
return {
|
|
1444
|
-
type: "erc20BalanceChange"
|
|
1480
|
+
type: "erc20BalanceChange" /* Erc20BalanceChange */,
|
|
1445
1481
|
..._delegationcore.decodeERC20BalanceChangeTerms.call(void 0, terms)
|
|
1446
1482
|
};
|
|
1447
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1483
|
+
case _optionalChain([caveatEnforcers, 'access', _26 => _26.ERC20TransferAmountEnforcer, 'optionalAccess', _27 => _27.toLowerCase, 'call', _28 => _28()]):
|
|
1448
1484
|
return {
|
|
1449
|
-
type: "erc20TransferAmount"
|
|
1485
|
+
type: "erc20TransferAmount" /* Erc20TransferAmount */,
|
|
1450
1486
|
..._delegationcore.decodeERC20TransferAmountTerms.call(void 0, terms)
|
|
1451
1487
|
};
|
|
1452
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1453
|
-
return { type: "erc20Streaming", ..._delegationcore.decodeERC20StreamingTerms.call(void 0, terms) };
|
|
1454
|
-
case _optionalChain([caveatEnforcers, 'access', _29 => _29.ERC721BalanceChangeEnforcer, 'optionalAccess', _30 => _30.toLowerCase, 'call', _31 => _31()]):
|
|
1488
|
+
case _optionalChain([caveatEnforcers, 'access', _29 => _29.ERC20StreamingEnforcer, 'optionalAccess', _30 => _30.toLowerCase, 'call', _31 => _31()]):
|
|
1455
1489
|
return {
|
|
1456
|
-
type: "
|
|
1490
|
+
type: "erc20Streaming" /* Erc20Streaming */,
|
|
1491
|
+
..._delegationcore.decodeERC20StreamingTerms.call(void 0, terms)
|
|
1492
|
+
};
|
|
1493
|
+
case _optionalChain([caveatEnforcers, 'access', _32 => _32.ERC721BalanceChangeEnforcer, 'optionalAccess', _33 => _33.toLowerCase, 'call', _34 => _34()]):
|
|
1494
|
+
return {
|
|
1495
|
+
type: "erc721BalanceChange" /* Erc721BalanceChange */,
|
|
1457
1496
|
..._delegationcore.decodeERC721BalanceChangeTerms.call(void 0, terms)
|
|
1458
1497
|
};
|
|
1459
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1460
|
-
return {
|
|
1461
|
-
|
|
1498
|
+
case _optionalChain([caveatEnforcers, 'access', _35 => _35.ERC721TransferEnforcer, 'optionalAccess', _36 => _36.toLowerCase, 'call', _37 => _37()]):
|
|
1499
|
+
return {
|
|
1500
|
+
type: "erc721Transfer" /* Erc721Transfer */,
|
|
1501
|
+
..._delegationcore.decodeERC721TransferTerms.call(void 0, terms)
|
|
1502
|
+
};
|
|
1503
|
+
case _optionalChain([caveatEnforcers, 'access', _38 => _38.ERC1155BalanceChangeEnforcer, 'optionalAccess', _39 => _39.toLowerCase, 'call', _40 => _40()]):
|
|
1462
1504
|
return {
|
|
1463
|
-
type: "erc1155BalanceChange"
|
|
1505
|
+
type: "erc1155BalanceChange" /* Erc1155BalanceChange */,
|
|
1464
1506
|
..._delegationcore.decodeERC1155BalanceChangeTerms.call(void 0, terms)
|
|
1465
1507
|
};
|
|
1466
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1467
|
-
return { type: "id"
|
|
1468
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1469
|
-
return { type: "limitedCalls", ..._delegationcore.decodeLimitedCallsTerms.call(void 0, terms) };
|
|
1470
|
-
case _optionalChain([caveatEnforcers, 'access', _44 => _44.NonceEnforcer, 'optionalAccess', _45 => _45.toLowerCase, 'call', _46 => _46()]):
|
|
1471
|
-
return { type: "nonce", ..._delegationcore.decodeNonceTerms.call(void 0, terms) };
|
|
1472
|
-
case _optionalChain([caveatEnforcers, 'access', _47 => _47.TimestampEnforcer, 'optionalAccess', _48 => _48.toLowerCase, 'call', _49 => _49()]):
|
|
1473
|
-
return { type: "timestamp", ..._delegationcore.decodeTimestampTerms.call(void 0, terms) };
|
|
1474
|
-
case _optionalChain([caveatEnforcers, 'access', _50 => _50.ValueLteEnforcer, 'optionalAccess', _51 => _51.toLowerCase, 'call', _52 => _52()]):
|
|
1475
|
-
return { type: "valueLte", ..._delegationcore.decodeValueLteTerms.call(void 0, terms) };
|
|
1476
|
-
case _optionalChain([caveatEnforcers, 'access', _53 => _53.NativeTokenTransferAmountEnforcer, 'optionalAccess', _54 => _54.toLowerCase, 'call', _55 => _55()]):
|
|
1508
|
+
case _optionalChain([caveatEnforcers, 'access', _41 => _41.IdEnforcer, 'optionalAccess', _42 => _42.toLowerCase, 'call', _43 => _43()]):
|
|
1509
|
+
return { type: "id" /* Id */, ..._delegationcore.decodeIdTerms.call(void 0, terms) };
|
|
1510
|
+
case _optionalChain([caveatEnforcers, 'access', _44 => _44.LimitedCallsEnforcer, 'optionalAccess', _45 => _45.toLowerCase, 'call', _46 => _46()]):
|
|
1477
1511
|
return {
|
|
1478
|
-
type: "
|
|
1512
|
+
type: "limitedCalls" /* LimitedCalls */,
|
|
1513
|
+
..._delegationcore.decodeLimitedCallsTerms.call(void 0, terms)
|
|
1514
|
+
};
|
|
1515
|
+
case _optionalChain([caveatEnforcers, 'access', _47 => _47.NonceEnforcer, 'optionalAccess', _48 => _48.toLowerCase, 'call', _49 => _49()]):
|
|
1516
|
+
return { type: "nonce" /* Nonce */, ..._delegationcore.decodeNonceTerms.call(void 0, terms) };
|
|
1517
|
+
case _optionalChain([caveatEnforcers, 'access', _50 => _50.TimestampEnforcer, 'optionalAccess', _51 => _51.toLowerCase, 'call', _52 => _52()]):
|
|
1518
|
+
return { type: "timestamp" /* Timestamp */, ..._delegationcore.decodeTimestampTerms.call(void 0, terms) };
|
|
1519
|
+
case _optionalChain([caveatEnforcers, 'access', _53 => _53.ValueLteEnforcer, 'optionalAccess', _54 => _54.toLowerCase, 'call', _55 => _55()]):
|
|
1520
|
+
return { type: "valueLte" /* ValueLte */, ..._delegationcore.decodeValueLteTerms.call(void 0, terms) };
|
|
1521
|
+
case _optionalChain([caveatEnforcers, 'access', _56 => _56.NativeTokenTransferAmountEnforcer, 'optionalAccess', _57 => _57.toLowerCase, 'call', _58 => _58()]):
|
|
1522
|
+
return {
|
|
1523
|
+
type: "nativeTokenTransferAmount" /* NativeTokenTransferAmount */,
|
|
1479
1524
|
..._delegationcore.decodeNativeTokenTransferAmountTerms.call(void 0, terms)
|
|
1480
1525
|
};
|
|
1481
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1526
|
+
case _optionalChain([caveatEnforcers, 'access', _59 => _59.NativeBalanceChangeEnforcer, 'optionalAccess', _60 => _60.toLowerCase, 'call', _61 => _61()]):
|
|
1482
1527
|
return {
|
|
1483
|
-
type: "nativeBalanceChange"
|
|
1528
|
+
type: "nativeBalanceChange" /* NativeBalanceChange */,
|
|
1484
1529
|
..._delegationcore.decodeNativeBalanceChangeTerms.call(void 0, terms)
|
|
1485
1530
|
};
|
|
1486
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1531
|
+
case _optionalChain([caveatEnforcers, 'access', _62 => _62.NativeTokenStreamingEnforcer, 'optionalAccess', _63 => _63.toLowerCase, 'call', _64 => _64()]):
|
|
1487
1532
|
return {
|
|
1488
|
-
type: "nativeTokenStreaming"
|
|
1533
|
+
type: "nativeTokenStreaming" /* NativeTokenStreaming */,
|
|
1489
1534
|
..._delegationcore.decodeNativeTokenStreamingTerms.call(void 0, terms)
|
|
1490
1535
|
};
|
|
1491
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1536
|
+
case _optionalChain([caveatEnforcers, 'access', _65 => _65.NativeTokenPaymentEnforcer, 'optionalAccess', _66 => _66.toLowerCase, 'call', _67 => _67()]):
|
|
1492
1537
|
return {
|
|
1493
|
-
type: "nativeTokenPayment"
|
|
1538
|
+
type: "nativeTokenPayment" /* NativeTokenPayment */,
|
|
1494
1539
|
..._delegationcore.decodeNativeTokenPaymentTerms.call(void 0, terms)
|
|
1495
1540
|
};
|
|
1496
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1497
|
-
return { type: "redeemer"
|
|
1498
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1541
|
+
case _optionalChain([caveatEnforcers, 'access', _68 => _68.RedeemerEnforcer, 'optionalAccess', _69 => _69.toLowerCase, 'call', _70 => _70()]):
|
|
1542
|
+
return { type: "redeemer" /* Redeemer */, ..._delegationcore.decodeRedeemerTerms.call(void 0, terms) };
|
|
1543
|
+
case _optionalChain([caveatEnforcers, 'access', _71 => _71.SpecificActionERC20TransferBatchEnforcer, 'optionalAccess', _72 => _72.toLowerCase, 'call', _73 => _73()]):
|
|
1499
1544
|
return {
|
|
1500
|
-
type: "specificActionERC20TransferBatch"
|
|
1545
|
+
type: "specificActionERC20TransferBatch" /* SpecificActionERC20TransferBatch */,
|
|
1501
1546
|
..._delegationcore.decodeSpecificActionERC20TransferBatchTerms.call(void 0, terms)
|
|
1502
1547
|
};
|
|
1503
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1548
|
+
case _optionalChain([caveatEnforcers, 'access', _74 => _74.ERC20PeriodTransferEnforcer, 'optionalAccess', _75 => _75.toLowerCase, 'call', _76 => _76()]):
|
|
1504
1549
|
return {
|
|
1505
|
-
type: "erc20PeriodTransfer"
|
|
1550
|
+
type: "erc20PeriodTransfer" /* Erc20PeriodTransfer */,
|
|
1506
1551
|
..._delegationcore.decodeERC20TokenPeriodTransferTerms.call(void 0, terms)
|
|
1507
1552
|
};
|
|
1508
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1553
|
+
case _optionalChain([caveatEnforcers, 'access', _77 => _77.NativeTokenPeriodTransferEnforcer, 'optionalAccess', _78 => _78.toLowerCase, 'call', _79 => _79()]):
|
|
1509
1554
|
return {
|
|
1510
|
-
type: "nativeTokenPeriodTransfer"
|
|
1555
|
+
type: "nativeTokenPeriodTransfer" /* NativeTokenPeriodTransfer */,
|
|
1511
1556
|
..._delegationcore.decodeNativeTokenPeriodTransferTerms.call(void 0, terms)
|
|
1512
1557
|
};
|
|
1513
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1558
|
+
case _optionalChain([caveatEnforcers, 'access', _80 => _80.ExactCalldataBatchEnforcer, 'optionalAccess', _81 => _81.toLowerCase, 'call', _82 => _82()]):
|
|
1514
1559
|
return {
|
|
1515
|
-
type: "exactCalldataBatch"
|
|
1560
|
+
type: "exactCalldataBatch" /* ExactCalldataBatch */,
|
|
1516
1561
|
..._delegationcore.decodeExactCalldataBatchTerms.call(void 0, terms)
|
|
1517
1562
|
};
|
|
1518
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1519
|
-
return {
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1563
|
+
case _optionalChain([caveatEnforcers, 'access', _83 => _83.ExactCalldataEnforcer, 'optionalAccess', _84 => _84.toLowerCase, 'call', _85 => _85()]):
|
|
1564
|
+
return {
|
|
1565
|
+
type: "exactCalldata" /* ExactCalldata */,
|
|
1566
|
+
..._delegationcore.decodeExactCalldataTerms.call(void 0, terms)
|
|
1567
|
+
};
|
|
1568
|
+
case _optionalChain([caveatEnforcers, 'access', _86 => _86.ExactExecutionEnforcer, 'optionalAccess', _87 => _87.toLowerCase, 'call', _88 => _88()]):
|
|
1523
1569
|
return {
|
|
1524
|
-
type: "
|
|
1570
|
+
type: "exactExecution" /* ExactExecution */,
|
|
1571
|
+
..._delegationcore.decodeExactExecutionTerms.call(void 0, terms)
|
|
1572
|
+
};
|
|
1573
|
+
case _optionalChain([caveatEnforcers, 'access', _89 => _89.ExactExecutionBatchEnforcer, 'optionalAccess', _90 => _90.toLowerCase, 'call', _91 => _91()]):
|
|
1574
|
+
return {
|
|
1575
|
+
type: "exactExecutionBatch" /* ExactExecutionBatch */,
|
|
1525
1576
|
..._delegationcore.decodeExactExecutionBatchTerms.call(void 0, terms)
|
|
1526
1577
|
};
|
|
1527
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1578
|
+
case _optionalChain([caveatEnforcers, 'access', _92 => _92.MultiTokenPeriodEnforcer, 'optionalAccess', _93 => _93.toLowerCase, 'call', _94 => _94()]):
|
|
1528
1579
|
return {
|
|
1529
|
-
type: "multiTokenPeriod"
|
|
1580
|
+
type: "multiTokenPeriod" /* MultiTokenPeriod */,
|
|
1530
1581
|
..._delegationcore.decodeMultiTokenPeriodTerms.call(void 0, terms)
|
|
1531
1582
|
};
|
|
1532
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1583
|
+
case _optionalChain([caveatEnforcers, 'access', _95 => _95.OwnershipTransferEnforcer, 'optionalAccess', _96 => _96.toLowerCase, 'call', _97 => _97()]):
|
|
1533
1584
|
return {
|
|
1534
|
-
type: "ownershipTransfer"
|
|
1585
|
+
type: "ownershipTransfer" /* OwnershipTransfer */,
|
|
1535
1586
|
..._delegationcore.decodeOwnershipTransferTerms.call(void 0, terms)
|
|
1536
1587
|
};
|
|
1537
1588
|
default:
|
|
@@ -1560,7 +1611,7 @@ var _openapifetch = require('openapi-fetch'); var _openapifetch2 = _interopRequi
|
|
|
1560
1611
|
// src/analytics/environment.ts
|
|
1561
1612
|
var session;
|
|
1562
1613
|
function createAnonId() {
|
|
1563
|
-
if (typeof _optionalChain([globalThis, 'access',
|
|
1614
|
+
if (typeof _optionalChain([globalThis, 'access', _98 => _98.crypto, 'optionalAccess', _99 => _99.randomUUID]) === "function") {
|
|
1564
1615
|
return globalThis.crypto.randomUUID();
|
|
1565
1616
|
}
|
|
1566
1617
|
return `00000000-0000-4000-8000-${Math.random().toString(16).slice(2, 14).padEnd(12, "0")}`;
|
|
@@ -1570,7 +1621,7 @@ function inferPlatform() {
|
|
|
1570
1621
|
return "nodejs";
|
|
1571
1622
|
}
|
|
1572
1623
|
const nav = globalThis.navigator;
|
|
1573
|
-
const ua = typeof _optionalChain([nav, 'optionalAccess',
|
|
1624
|
+
const ua = typeof _optionalChain([nav, 'optionalAccess', _100 => _100.userAgent]) === "string" ? nav.userAgent : "";
|
|
1574
1625
|
if (/Mobile|Android|iPhone|iPod|webOS|BlackBerry|IEMobile|Opera Mini/iu.test(ua)) {
|
|
1575
1626
|
return "web-mobile";
|
|
1576
1627
|
}
|
|
@@ -1579,7 +1630,7 @@ function inferPlatform() {
|
|
|
1579
1630
|
function inferDomain() {
|
|
1580
1631
|
if (typeof globalThis !== "undefined" && "window" in globalThis) {
|
|
1581
1632
|
const win = globalThis;
|
|
1582
|
-
const hostname = _optionalChain([win, 'access',
|
|
1633
|
+
const hostname = _optionalChain([win, 'access', _101 => _101.location, 'optionalAccess', _102 => _102.hostname]);
|
|
1583
1634
|
if (typeof hostname === "string" && hostname.length > 0) {
|
|
1584
1635
|
return { domain: hostname };
|
|
1585
1636
|
}
|
|
@@ -1699,7 +1750,7 @@ var Sender = class {
|
|
|
1699
1750
|
};
|
|
1700
1751
|
|
|
1701
1752
|
// package.json
|
|
1702
|
-
var version = "1.
|
|
1753
|
+
var version = "1.7.0";
|
|
1703
1754
|
|
|
1704
1755
|
// src/analytics/index.ts
|
|
1705
1756
|
function isCompleteBase(value) {
|
|
@@ -1826,8 +1877,8 @@ var analytics = new Analytics(METAMASK_ANALYTICS_ENDPOINT);
|
|
|
1826
1877
|
function isAnalyticsDisabled() {
|
|
1827
1878
|
const dntValues = [];
|
|
1828
1879
|
if (typeof process !== "undefined") {
|
|
1829
|
-
dntValues.push(_optionalChain([process, 'access',
|
|
1830
|
-
dntValues.push(_optionalChain([process, 'access',
|
|
1880
|
+
dntValues.push(_optionalChain([process, 'access', _103 => _103.env, 'optionalAccess', _104 => _104.CI]));
|
|
1881
|
+
dntValues.push(_optionalChain([process, 'access', _105 => _105.env, 'optionalAccess', _106 => _106.DO_NOT_TRACK]));
|
|
1831
1882
|
}
|
|
1832
1883
|
if (typeof navigator !== "undefined") {
|
|
1833
1884
|
dntValues.push(navigator.doNotTrack);
|
|
@@ -1836,7 +1887,7 @@ function isAnalyticsDisabled() {
|
|
|
1836
1887
|
dntValues.push(window.doNotTrack);
|
|
1837
1888
|
}
|
|
1838
1889
|
return dntValues.some(
|
|
1839
|
-
(dntValue) => dntValue === "1" || _optionalChain([dntValue, 'optionalAccess',
|
|
1890
|
+
(dntValue) => dntValue === "1" || _optionalChain([dntValue, 'optionalAccess', _107 => _107.toLowerCase, 'call', _108 => _108()]) === "yes" || _optionalChain([dntValue, 'optionalAccess', _109 => _109.toLowerCase, 'call', _110 => _110()]) === "true"
|
|
1840
1891
|
);
|
|
1841
1892
|
}
|
|
1842
1893
|
var hasBootstrapped = false;
|
|
@@ -1969,11 +2020,11 @@ var getCaveatNames = ({
|
|
|
1969
2020
|
([name, address]) => ({ name, address: address.toLowerCase() })
|
|
1970
2021
|
);
|
|
1971
2022
|
return caveats.map((caveat) => {
|
|
1972
|
-
const enforcerAddressLowercase = _optionalChain([caveat, 'access',
|
|
2023
|
+
const enforcerAddressLowercase = _optionalChain([caveat, 'access', _111 => _111.enforcer, 'optionalAccess', _112 => _112.toLowerCase, 'call', _113 => _113()]);
|
|
1973
2024
|
const matchingCaveat = knownEnforcers.find(
|
|
1974
2025
|
({ address }) => address === enforcerAddressLowercase
|
|
1975
2026
|
);
|
|
1976
|
-
return _nullishCoalesce(_optionalChain([matchingCaveat, 'optionalAccess',
|
|
2027
|
+
return _nullishCoalesce(_optionalChain([matchingCaveat, 'optionalAccess', _114 => _114.name]), () => ( "Unknown"));
|
|
1977
2028
|
});
|
|
1978
2029
|
}
|
|
1979
2030
|
return [];
|
|
@@ -2018,7 +2069,7 @@ var createDelegation = (options) => {
|
|
|
2018
2069
|
const { authority, caveats, hasInheritance, salt } = resolveDelegationArgs(options);
|
|
2019
2070
|
trackSmartAccountsKitFunctionCall("createDelegation", {
|
|
2020
2071
|
hasInheritance,
|
|
2021
|
-
scope: _nullishCoalesce(_optionalChain([options, 'access',
|
|
2072
|
+
scope: _nullishCoalesce(_optionalChain([options, 'access', _115 => _115.scope, 'optionalAccess', _116 => _116.type]), () => ( null)),
|
|
2022
2073
|
caveatNames: getCaveatNames({
|
|
2023
2074
|
caveats,
|
|
2024
2075
|
environment: options.environment
|
|
@@ -2037,7 +2088,7 @@ var createOpenDelegation = (options) => {
|
|
|
2037
2088
|
const { authority, caveats, hasInheritance, salt } = resolveDelegationArgs(options);
|
|
2038
2089
|
trackSmartAccountsKitFunctionCall("createOpenDelegation", {
|
|
2039
2090
|
hasInheritance,
|
|
2040
|
-
scope: _nullishCoalesce(_optionalChain([options, 'access',
|
|
2091
|
+
scope: _nullishCoalesce(_optionalChain([options, 'access', _117 => _117.scope, 'optionalAccess', _118 => _118.type]), () => ( null)),
|
|
2041
2092
|
caveatNames: getCaveatNames({
|
|
2042
2093
|
caveats,
|
|
2043
2094
|
environment: options.environment
|
|
@@ -2104,6 +2155,83 @@ var signDelegation = async ({
|
|
|
2104
2155
|
});
|
|
2105
2156
|
};
|
|
2106
2157
|
|
|
2158
|
+
// src/executions.ts
|
|
2159
|
+
|
|
2160
|
+
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
var createExecution = ({
|
|
2164
|
+
target,
|
|
2165
|
+
value = 0n,
|
|
2166
|
+
callData = "0x"
|
|
2167
|
+
}) => {
|
|
2168
|
+
return {
|
|
2169
|
+
target,
|
|
2170
|
+
value,
|
|
2171
|
+
callData
|
|
2172
|
+
};
|
|
2173
|
+
};
|
|
2174
|
+
var ExecutionMode = /* @__PURE__ */ ((ExecutionMode2) => {
|
|
2175
|
+
ExecutionMode2["SingleDefault"] = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
2176
|
+
ExecutionMode2["SingleTry"] = "0x0001000000000000000000000000000000000000000000000000000000000000";
|
|
2177
|
+
ExecutionMode2["BatchDefault"] = "0x0100000000000000000000000000000000000000000000000000000000000000";
|
|
2178
|
+
ExecutionMode2["BatchTry"] = "0x0101000000000000000000000000000000000000000000000000000000000000";
|
|
2179
|
+
return ExecutionMode2;
|
|
2180
|
+
})(ExecutionMode || {});
|
|
2181
|
+
var EXECUTION_ABI_TYPE_COMPONENTS = [
|
|
2182
|
+
{ type: "address", name: "target" },
|
|
2183
|
+
{ type: "uint256", name: "value" },
|
|
2184
|
+
{ type: "bytes", name: "callData" }
|
|
2185
|
+
];
|
|
2186
|
+
var encodeSingleExecution = (execution) => {
|
|
2187
|
+
return _viem.encodePacked.call(void 0,
|
|
2188
|
+
["address", "uint256", "bytes"],
|
|
2189
|
+
[execution.target, execution.value, execution.callData]
|
|
2190
|
+
);
|
|
2191
|
+
};
|
|
2192
|
+
var encodeBatchExecution = (executions) => {
|
|
2193
|
+
return _viem.encodeAbiParameters.call(void 0,
|
|
2194
|
+
[
|
|
2195
|
+
{
|
|
2196
|
+
components: EXECUTION_ABI_TYPE_COMPONENTS,
|
|
2197
|
+
name: "executions",
|
|
2198
|
+
type: "tuple[]"
|
|
2199
|
+
}
|
|
2200
|
+
],
|
|
2201
|
+
[executions]
|
|
2202
|
+
);
|
|
2203
|
+
};
|
|
2204
|
+
var encodeExecutionCalldata = (executions) => {
|
|
2205
|
+
if (executions.length === 0) {
|
|
2206
|
+
throw new Error(
|
|
2207
|
+
"Error while getting the execution calldatas, executions is empty"
|
|
2208
|
+
);
|
|
2209
|
+
}
|
|
2210
|
+
if (executions.length === 1) {
|
|
2211
|
+
const execution = executions[0];
|
|
2212
|
+
if (!execution) {
|
|
2213
|
+
throw new Error("Execution not found");
|
|
2214
|
+
}
|
|
2215
|
+
return encodeSingleExecution(execution);
|
|
2216
|
+
}
|
|
2217
|
+
return encodeBatchExecution(executions);
|
|
2218
|
+
};
|
|
2219
|
+
var encodeExecutionCalldatas = (executionsBatch) => {
|
|
2220
|
+
if (executionsBatch.length === 0) {
|
|
2221
|
+
throw new Error(
|
|
2222
|
+
"Error while getting the execution calldatas, executionsBatch is empty"
|
|
2223
|
+
);
|
|
2224
|
+
}
|
|
2225
|
+
return executionsBatch.map(encodeExecutionCalldata);
|
|
2226
|
+
};
|
|
2227
|
+
|
|
2228
|
+
|
|
2229
|
+
|
|
2230
|
+
|
|
2231
|
+
|
|
2232
|
+
|
|
2233
|
+
|
|
2234
|
+
|
|
2107
2235
|
|
|
2108
2236
|
|
|
2109
2237
|
|
|
@@ -2135,5 +2263,5 @@ var signDelegation = async ({
|
|
|
2135
2263
|
|
|
2136
2264
|
|
|
2137
2265
|
|
|
2138
|
-
exports.__export = __export; exports.trackSmartAccountsKitFunctionCall = trackSmartAccountsKitFunctionCall; exports.Implementation = Implementation; exports.TransferWindow = TransferWindow; exports.ScopeType = ScopeType; exports.CaveatType = CaveatType; exports.CaveatBuilder = CaveatBuilder; exports.createCaveatBuilder = createCaveatBuilder; exports.isDefined = isDefined; exports.toHexOrThrow = toHexOrThrow; exports.createCaveat = createCaveat; exports.decodeCaveat = decodeCaveat; exports.ANY_BENEFICIARY = _delegationcore.ANY_BENEFICIARY; exports.DELEGATION_TYPEHASH = _delegationcore.DELEGATION_TYPEHASH; exports.ROOT_AUTHORITY = _delegationcore.ROOT_AUTHORITY; exports.DELEGATION_ABI_TYPE_COMPONENTS = DELEGATION_ABI_TYPE_COMPONENTS; exports.toDelegationStruct = toDelegationStruct; exports.toDelegation = toDelegation; exports.encodeDelegations = encodeDelegations; exports.encodeDelegation = encodeDelegation; exports.decodeDelegations = decodeDelegations; exports.decodeDelegation = decodeDelegation; exports.SIGNABLE_DELEGATION_TYPED_DATA = SIGNABLE_DELEGATION_TYPED_DATA; exports.DELEGATION_ARRAY_ABI_TYPE = DELEGATION_ARRAY_ABI_TYPE; exports.DELEGATION_ABI_TYPE = DELEGATION_ABI_TYPE; exports.hashDelegation = hashDelegation; exports.createDelegation = createDelegation; exports.createOpenDelegation = createOpenDelegation; exports.prepareSignDelegationTypedData = prepareSignDelegationTypedData; exports.signDelegation = signDelegation;
|
|
2139
|
-
//# sourceMappingURL=chunk-
|
|
2266
|
+
exports.__export = __export; exports.trackSmartAccountsKitFunctionCall = trackSmartAccountsKitFunctionCall; exports.Implementation = Implementation; exports.TransferWindow = TransferWindow; exports.ScopeType = ScopeType; exports.CaveatType = CaveatType; exports.CaveatBuilder = CaveatBuilder; exports.createCaveatBuilder = createCaveatBuilder; exports.isDefined = isDefined; exports.toHexOrThrow = toHexOrThrow; exports.resolveCaveats = resolveCaveats; exports.createCaveat = createCaveat; exports.decodeCaveat = decodeCaveat; exports.ANY_BENEFICIARY = _delegationcore.ANY_BENEFICIARY; exports.DELEGATION_TYPEHASH = _delegationcore.DELEGATION_TYPEHASH; exports.ROOT_AUTHORITY = _delegationcore.ROOT_AUTHORITY; exports.DELEGATION_ABI_TYPE_COMPONENTS = DELEGATION_ABI_TYPE_COMPONENTS; exports.toDelegationStruct = toDelegationStruct; exports.toDelegation = toDelegation; exports.encodeDelegations = encodeDelegations; exports.encodeDelegation = encodeDelegation; exports.decodeDelegations = decodeDelegations; exports.decodeDelegation = decodeDelegation; exports.SIGNABLE_DELEGATION_TYPED_DATA = SIGNABLE_DELEGATION_TYPED_DATA; exports.DELEGATION_ARRAY_ABI_TYPE = DELEGATION_ARRAY_ABI_TYPE; exports.DELEGATION_ABI_TYPE = DELEGATION_ABI_TYPE; exports.hashDelegation = hashDelegation; exports.createDelegation = createDelegation; exports.createOpenDelegation = createOpenDelegation; exports.prepareSignDelegationTypedData = prepareSignDelegationTypedData; exports.signDelegation = signDelegation; exports.createExecution = createExecution; exports.ExecutionMode = ExecutionMode; exports.encodeSingleExecution = encodeSingleExecution; exports.encodeBatchExecution = encodeBatchExecution; exports.encodeExecutionCalldata = encodeExecutionCalldata; exports.encodeExecutionCalldatas = encodeExecutionCalldatas;
|
|
2267
|
+
//# sourceMappingURL=chunk-GHGCGV3C.cjs.map
|