@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ANY_BENEFICIARY, ROOT_AUTHORITY } from '@metamask/delegation-core';
|
|
2
2
|
import * as viem from 'viem';
|
|
3
3
|
import { Client, Transport, Chain, Account, Address, Hex } from 'viem';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { f as DecodedRevertReason, g as DelegationStruct } from './decodeRevertReason-CmmCpmZ_.cjs';
|
|
5
|
+
import { P as PermissionContext, E as ExecutionMode, e as ExecutionStruct, D as Delegation } from './resolveCaveats-A9xC29l8.cjs';
|
|
6
6
|
|
|
7
7
|
declare const NAME$1 = "DelegationManager";
|
|
8
8
|
declare const VERSION$1 = "1.3.0";
|
|
@@ -21,18 +21,21 @@ type P256Owner = {
|
|
|
21
21
|
};
|
|
22
22
|
type InitializedClient = Client<Transport, Chain, Account>;
|
|
23
23
|
|
|
24
|
-
type
|
|
25
|
-
|
|
24
|
+
type EncodeRedeemDelegationsParameters = {
|
|
25
|
+
delegations: PermissionContext[];
|
|
26
|
+
modes: ExecutionMode[];
|
|
27
|
+
executions: ExecutionStruct[][];
|
|
26
28
|
};
|
|
27
|
-
type
|
|
29
|
+
type SimulateRedeemDelegationsParameters = {
|
|
28
30
|
client: Client;
|
|
29
31
|
delegationManagerAddress: Address;
|
|
30
|
-
} &
|
|
31
|
-
type
|
|
32
|
+
} & EncodeRedeemDelegationsParameters;
|
|
33
|
+
type ExecuteRedeemDelegationsParameters = {
|
|
32
34
|
client: InitializedClient;
|
|
33
35
|
delegationManagerAddress: Address;
|
|
34
|
-
} &
|
|
35
|
-
|
|
36
|
+
} & EncodeRedeemDelegationsParameters;
|
|
37
|
+
type DecodeRedeemDelegationsErrorReturnType = DecodedRevertReason | undefined;
|
|
38
|
+
declare const simulate$y: ({ client, delegationManagerAddress, delegations, modes, executions, }: SimulateRedeemDelegationsParameters) => Promise<viem.SimulateContractReturnType<readonly [{
|
|
36
39
|
readonly type: "constructor";
|
|
37
40
|
readonly inputs: readonly [{
|
|
38
41
|
readonly name: "_owner";
|
|
@@ -743,70 +746,45 @@ declare const simulate$y: ({ client, delegationManagerAddress, delegation, }: Si
|
|
|
743
746
|
readonly type: "string";
|
|
744
747
|
readonly internalType: "string";
|
|
745
748
|
}];
|
|
746
|
-
}], "
|
|
749
|
+
}], "redeemDelegations", readonly [`0x${string}`[], ExecutionMode[], `0x${string}`[]], viem.Chain | undefined, viem.Account | undefined, undefined, undefined, readonly [{
|
|
747
750
|
readonly type: "function";
|
|
748
|
-
readonly name: "
|
|
751
|
+
readonly name: "redeemDelegations";
|
|
749
752
|
readonly inputs: readonly [{
|
|
750
|
-
readonly name: "
|
|
751
|
-
readonly type: "
|
|
752
|
-
readonly internalType: "
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
}, {
|
|
762
|
-
readonly name: "authority";
|
|
763
|
-
readonly type: "bytes32";
|
|
764
|
-
readonly internalType: "bytes32";
|
|
765
|
-
}, {
|
|
766
|
-
readonly name: "caveats";
|
|
767
|
-
readonly type: "tuple[]";
|
|
768
|
-
readonly internalType: "struct Caveat[]";
|
|
769
|
-
readonly components: readonly [{
|
|
770
|
-
readonly name: "enforcer";
|
|
771
|
-
readonly type: "address";
|
|
772
|
-
readonly internalType: "address";
|
|
773
|
-
}, {
|
|
774
|
-
readonly name: "terms";
|
|
775
|
-
readonly type: "bytes";
|
|
776
|
-
readonly internalType: "bytes";
|
|
777
|
-
}, {
|
|
778
|
-
readonly name: "args";
|
|
779
|
-
readonly type: "bytes";
|
|
780
|
-
readonly internalType: "bytes";
|
|
781
|
-
}];
|
|
782
|
-
}, {
|
|
783
|
-
readonly name: "salt";
|
|
784
|
-
readonly type: "uint256";
|
|
785
|
-
readonly internalType: "uint256";
|
|
786
|
-
}, {
|
|
787
|
-
readonly name: "signature";
|
|
788
|
-
readonly type: "bytes";
|
|
789
|
-
readonly internalType: "bytes";
|
|
790
|
-
}];
|
|
753
|
+
readonly name: "_permissionContexts";
|
|
754
|
+
readonly type: "bytes[]";
|
|
755
|
+
readonly internalType: "bytes[]";
|
|
756
|
+
}, {
|
|
757
|
+
readonly name: "_modes";
|
|
758
|
+
readonly type: "bytes32[]";
|
|
759
|
+
readonly internalType: "ModeCode[]";
|
|
760
|
+
}, {
|
|
761
|
+
readonly name: "_executionCallDatas";
|
|
762
|
+
readonly type: "bytes[]";
|
|
763
|
+
readonly internalType: "bytes[]";
|
|
791
764
|
}];
|
|
792
765
|
readonly outputs: readonly [];
|
|
793
766
|
readonly stateMutability: "nonpayable";
|
|
794
767
|
}], viem.Account | undefined>>;
|
|
795
|
-
declare const execute$k: ({ client, delegationManagerAddress,
|
|
796
|
-
declare const encode$z: ({
|
|
768
|
+
declare const execute$k: ({ client, delegationManagerAddress, delegations, modes, executions, }: ExecuteRedeemDelegationsParameters) => Promise<`0x${string}`>;
|
|
769
|
+
declare const encode$z: ({ delegations, modes, executions, }: EncodeRedeemDelegationsParameters) => `0x${string}`;
|
|
770
|
+
declare const decodeError: (error: unknown) => DecodeRedeemDelegationsErrorReturnType;
|
|
797
771
|
|
|
798
|
-
|
|
772
|
+
declare namespace decode {
|
|
773
|
+
export { decodeError as redeemDelegationsError };
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
type EncodeDisableDelegationParameters$1 = {
|
|
799
777
|
delegation: Delegation;
|
|
800
778
|
};
|
|
801
|
-
type
|
|
779
|
+
type SimulateDisableDelegationParameters$1 = {
|
|
802
780
|
client: Client;
|
|
803
781
|
delegationManagerAddress: Address;
|
|
804
|
-
} &
|
|
805
|
-
type
|
|
782
|
+
} & EncodeDisableDelegationParameters$1;
|
|
783
|
+
type ExecuteDisableDelegationParameters$1 = {
|
|
806
784
|
client: InitializedClient;
|
|
807
785
|
delegationManagerAddress: Address;
|
|
808
|
-
} &
|
|
809
|
-
declare const simulate$x: ({ client, delegationManagerAddress, delegation, }:
|
|
786
|
+
} & EncodeDisableDelegationParameters$1;
|
|
787
|
+
declare const simulate$x: ({ client, delegationManagerAddress, delegation, }: SimulateDisableDelegationParameters$1) => Promise<viem.SimulateContractReturnType<readonly [{
|
|
810
788
|
readonly type: "constructor";
|
|
811
789
|
readonly inputs: readonly [{
|
|
812
790
|
readonly name: "_owner";
|
|
@@ -1517,9 +1495,9 @@ declare const simulate$x: ({ client, delegationManagerAddress, delegation, }: Si
|
|
|
1517
1495
|
readonly type: "string";
|
|
1518
1496
|
readonly internalType: "string";
|
|
1519
1497
|
}];
|
|
1520
|
-
}], "
|
|
1498
|
+
}], "disableDelegation", readonly [DelegationStruct], viem.Chain | undefined, viem.Account | undefined, undefined, undefined, readonly [{
|
|
1521
1499
|
readonly type: "function";
|
|
1522
|
-
readonly name: "
|
|
1500
|
+
readonly name: "disableDelegation";
|
|
1523
1501
|
readonly inputs: readonly [{
|
|
1524
1502
|
readonly name: "_delegation";
|
|
1525
1503
|
readonly type: "tuple";
|
|
@@ -1566,23 +1544,21 @@ declare const simulate$x: ({ client, delegationManagerAddress, delegation, }: Si
|
|
|
1566
1544
|
readonly outputs: readonly [];
|
|
1567
1545
|
readonly stateMutability: "nonpayable";
|
|
1568
1546
|
}], viem.Account | undefined>>;
|
|
1569
|
-
declare const execute$j: ({ client, delegationManagerAddress, delegation, }:
|
|
1570
|
-
declare const encode$y: ({ delegation }:
|
|
1547
|
+
declare const execute$j: ({ client, delegationManagerAddress, delegation, }: ExecuteDisableDelegationParameters$1) => Promise<`0x${string}`>;
|
|
1548
|
+
declare const encode$y: ({ delegation }: EncodeDisableDelegationParameters$1) => `0x${string}`;
|
|
1571
1549
|
|
|
1572
|
-
type
|
|
1573
|
-
|
|
1574
|
-
modes: ExecutionMode[];
|
|
1575
|
-
executions: ExecutionStruct[][];
|
|
1550
|
+
type EncodeEnableDelegationParameters$1 = {
|
|
1551
|
+
delegation: Delegation;
|
|
1576
1552
|
};
|
|
1577
|
-
type
|
|
1553
|
+
type SimulateEnableDelegationParameters$1 = {
|
|
1578
1554
|
client: Client;
|
|
1579
1555
|
delegationManagerAddress: Address;
|
|
1580
|
-
} &
|
|
1581
|
-
type
|
|
1556
|
+
} & EncodeEnableDelegationParameters$1;
|
|
1557
|
+
type ExecuteEnableDelegationParameters$1 = {
|
|
1582
1558
|
client: InitializedClient;
|
|
1583
1559
|
delegationManagerAddress: Address;
|
|
1584
|
-
} &
|
|
1585
|
-
declare const simulate$w: ({ client, delegationManagerAddress,
|
|
1560
|
+
} & EncodeEnableDelegationParameters$1;
|
|
1561
|
+
declare const simulate$w: ({ client, delegationManagerAddress, delegation, }: SimulateEnableDelegationParameters$1) => Promise<viem.SimulateContractReturnType<readonly [{
|
|
1586
1562
|
readonly type: "constructor";
|
|
1587
1563
|
readonly inputs: readonly [{
|
|
1588
1564
|
readonly name: "_owner";
|
|
@@ -2293,34 +2269,64 @@ declare const simulate$w: ({ client, delegationManagerAddress, delegations, mode
|
|
|
2293
2269
|
readonly type: "string";
|
|
2294
2270
|
readonly internalType: "string";
|
|
2295
2271
|
}];
|
|
2296
|
-
}], "
|
|
2272
|
+
}], "enableDelegation", readonly [DelegationStruct], viem.Chain | undefined, viem.Account | undefined, undefined, undefined, readonly [{
|
|
2297
2273
|
readonly type: "function";
|
|
2298
|
-
readonly name: "
|
|
2274
|
+
readonly name: "enableDelegation";
|
|
2299
2275
|
readonly inputs: readonly [{
|
|
2300
|
-
readonly name: "
|
|
2301
|
-
readonly type: "
|
|
2302
|
-
readonly internalType: "
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2276
|
+
readonly name: "_delegation";
|
|
2277
|
+
readonly type: "tuple";
|
|
2278
|
+
readonly internalType: "struct Delegation";
|
|
2279
|
+
readonly components: readonly [{
|
|
2280
|
+
readonly name: "delegate";
|
|
2281
|
+
readonly type: "address";
|
|
2282
|
+
readonly internalType: "address";
|
|
2283
|
+
}, {
|
|
2284
|
+
readonly name: "delegator";
|
|
2285
|
+
readonly type: "address";
|
|
2286
|
+
readonly internalType: "address";
|
|
2287
|
+
}, {
|
|
2288
|
+
readonly name: "authority";
|
|
2289
|
+
readonly type: "bytes32";
|
|
2290
|
+
readonly internalType: "bytes32";
|
|
2291
|
+
}, {
|
|
2292
|
+
readonly name: "caveats";
|
|
2293
|
+
readonly type: "tuple[]";
|
|
2294
|
+
readonly internalType: "struct Caveat[]";
|
|
2295
|
+
readonly components: readonly [{
|
|
2296
|
+
readonly name: "enforcer";
|
|
2297
|
+
readonly type: "address";
|
|
2298
|
+
readonly internalType: "address";
|
|
2299
|
+
}, {
|
|
2300
|
+
readonly name: "terms";
|
|
2301
|
+
readonly type: "bytes";
|
|
2302
|
+
readonly internalType: "bytes";
|
|
2303
|
+
}, {
|
|
2304
|
+
readonly name: "args";
|
|
2305
|
+
readonly type: "bytes";
|
|
2306
|
+
readonly internalType: "bytes";
|
|
2307
|
+
}];
|
|
2308
|
+
}, {
|
|
2309
|
+
readonly name: "salt";
|
|
2310
|
+
readonly type: "uint256";
|
|
2311
|
+
readonly internalType: "uint256";
|
|
2312
|
+
}, {
|
|
2313
|
+
readonly name: "signature";
|
|
2314
|
+
readonly type: "bytes";
|
|
2315
|
+
readonly internalType: "bytes";
|
|
2316
|
+
}];
|
|
2311
2317
|
}];
|
|
2312
2318
|
readonly outputs: readonly [];
|
|
2313
2319
|
readonly stateMutability: "nonpayable";
|
|
2314
2320
|
}], viem.Account | undefined>>;
|
|
2315
|
-
declare const execute$i: ({ client, delegationManagerAddress,
|
|
2316
|
-
declare const encode$x: ({
|
|
2321
|
+
declare const execute$i: ({ client, delegationManagerAddress, delegation, }: ExecuteEnableDelegationParameters$1) => Promise<`0x${string}`>;
|
|
2322
|
+
declare const encode$x: ({ delegation }: EncodeEnableDelegationParameters$1) => `0x${string}`;
|
|
2317
2323
|
|
|
2318
2324
|
declare namespace encode$w {
|
|
2319
|
-
export { encode$
|
|
2325
|
+
export { encode$y as disableDelegation, encode$x as enableDelegation, encode$z as redeemDelegations };
|
|
2320
2326
|
}
|
|
2321
2327
|
|
|
2322
2328
|
declare namespace execute$h {
|
|
2323
|
-
export { execute$
|
|
2329
|
+
export { execute$j as disableDelegation, execute$i as enableDelegation, execute$k as redeemDelegations };
|
|
2324
2330
|
}
|
|
2325
2331
|
|
|
2326
2332
|
type ReadDisabledDelegationsParameters = {
|
|
@@ -2347,11 +2353,12 @@ declare namespace read$X {
|
|
|
2347
2353
|
}
|
|
2348
2354
|
|
|
2349
2355
|
declare namespace simulate$v {
|
|
2350
|
-
export { simulate$
|
|
2356
|
+
export { simulate$x as disableDelegation, simulate$w as enableDelegation, simulate$y as redeemDelegations };
|
|
2351
2357
|
}
|
|
2352
2358
|
|
|
2359
|
+
declare const index$k_decode: typeof decode;
|
|
2353
2360
|
declare namespace index$k {
|
|
2354
|
-
export { constants$2 as constants, encode$w as encode, execute$h as execute, read$X as read, simulate$v as simulate };
|
|
2361
|
+
export { constants$2 as constants, index$k_decode as decode, encode$w as encode, execute$h as execute, read$X as read, simulate$v as simulate };
|
|
2355
2362
|
}
|
|
2356
2363
|
|
|
2357
2364
|
type SimulateDisableDelegationParameters = {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { j as ScopeType, B as Erc20PeriodTransferBuilderConfig, F as Erc20StreamingBuilderConfig, G as Erc20TransferAmountBuilderConfig, J as Erc721TransferBuilderConfig, K as AllowedCalldataBuilderConfig, L as ExactCalldataBuilderConfig, V as ValueLteBuilderConfig, N as AllowedTargetsBuilderConfig, O as AllowedMethodsBuilderConfig, Q as NativeTokenPeriodTransferBuilderConfig, R as NativeTokenStreamingBuilderConfig, U as NativeTokenTransferAmountBuilderConfig, X as OwnershipTransferBuilderConfig } from './resolveCaveats-A9xC29l8.js';
|
|
2
|
+
|
|
3
|
+
type Erc20PeriodicScopeConfig = {
|
|
4
|
+
type: ScopeType.Erc20PeriodTransfer;
|
|
5
|
+
} & Erc20PeriodTransferBuilderConfig;
|
|
6
|
+
|
|
7
|
+
type Erc20StreamingScopeConfig = {
|
|
8
|
+
type: ScopeType.Erc20Streaming;
|
|
9
|
+
} & Erc20StreamingBuilderConfig;
|
|
10
|
+
|
|
11
|
+
type Erc20TransferScopeConfig = {
|
|
12
|
+
type: ScopeType.Erc20TransferAmount;
|
|
13
|
+
} & Erc20TransferAmountBuilderConfig;
|
|
14
|
+
|
|
15
|
+
type Erc721ScopeBaseConfig = {
|
|
16
|
+
type: ScopeType.Erc721Transfer;
|
|
17
|
+
};
|
|
18
|
+
type Erc721ScopeConfig = Erc721ScopeBaseConfig & Erc721TransferBuilderConfig;
|
|
19
|
+
|
|
20
|
+
type FunctionCallScopeBaseConfig = {
|
|
21
|
+
type: ScopeType.FunctionCall;
|
|
22
|
+
allowedCalldata?: AllowedCalldataBuilderConfig[];
|
|
23
|
+
exactCalldata?: ExactCalldataBuilderConfig;
|
|
24
|
+
valueLte?: ValueLteBuilderConfig;
|
|
25
|
+
};
|
|
26
|
+
type FunctionCallScopeConfig = FunctionCallScopeBaseConfig & AllowedTargetsBuilderConfig & AllowedMethodsBuilderConfig;
|
|
27
|
+
|
|
28
|
+
type NativeTokenPeriodicScopeConfig = {
|
|
29
|
+
type: ScopeType.NativeTokenPeriodTransfer;
|
|
30
|
+
allowedCalldata?: AllowedCalldataBuilderConfig[];
|
|
31
|
+
exactCalldata?: ExactCalldataBuilderConfig;
|
|
32
|
+
} & NativeTokenPeriodTransferBuilderConfig;
|
|
33
|
+
|
|
34
|
+
type NativeTokenStreamingScopeConfig = {
|
|
35
|
+
type: ScopeType.NativeTokenStreaming;
|
|
36
|
+
allowedCalldata?: AllowedCalldataBuilderConfig[];
|
|
37
|
+
exactCalldata?: ExactCalldataBuilderConfig;
|
|
38
|
+
} & NativeTokenStreamingBuilderConfig;
|
|
39
|
+
|
|
40
|
+
type NativeTokenTransferScopeConfig = {
|
|
41
|
+
type: ScopeType.NativeTokenTransferAmount;
|
|
42
|
+
allowedCalldata?: AllowedCalldataBuilderConfig[];
|
|
43
|
+
exactCalldata?: ExactCalldataBuilderConfig;
|
|
44
|
+
} & NativeTokenTransferAmountBuilderConfig;
|
|
45
|
+
|
|
46
|
+
type OwnershipScopeBaseConfig = {
|
|
47
|
+
type: ScopeType.OwnershipTransfer;
|
|
48
|
+
};
|
|
49
|
+
type OwnershipScopeConfig = OwnershipScopeBaseConfig & OwnershipTransferBuilderConfig;
|
|
50
|
+
|
|
51
|
+
type ConvertScopeConfigsToInputs<T extends {
|
|
52
|
+
type: ScopeType;
|
|
53
|
+
}> = T extends {
|
|
54
|
+
type: ScopeType;
|
|
55
|
+
} ? Omit<T, 'type'> & {
|
|
56
|
+
type: T['type'] | `${T['type']}`;
|
|
57
|
+
} : never;
|
|
58
|
+
type ScopeConfigBase = Erc20TransferScopeConfig | Erc20StreamingScopeConfig | Erc20PeriodicScopeConfig | NativeTokenTransferScopeConfig | NativeTokenStreamingScopeConfig | NativeTokenPeriodicScopeConfig | Erc721ScopeConfig | OwnershipScopeConfig | FunctionCallScopeConfig;
|
|
59
|
+
type ScopeConfig = ConvertScopeConfigsToInputs<ScopeConfigBase>;
|
|
60
|
+
|
|
61
|
+
export type { ScopeConfig as S };
|
|
@@ -1,9 +1,34 @@
|
|
|
1
|
+
import { Account, Address, Hex, Chain, Client, Transport, WalletClient, RpcSchema, OneOf, SendTransactionRequest, SendTransactionParameters, PublicClient } from 'viem';
|
|
2
|
+
import { S as SmartAccountsEnvironment, P as PermissionContext, c as Caveats, D as Delegation, p as Call } from './resolveCaveats-A9xC29l8.cjs';
|
|
3
|
+
import { S as ScopeConfig } from './index-B1Cmezvh.cjs';
|
|
1
4
|
import { Rule, PermissionRequest as PermissionRequest$1, PermissionTypes as PermissionTypes$1, PermissionResponse as PermissionResponse$1 } from '@metamask/7715-permission-types';
|
|
2
|
-
import {
|
|
5
|
+
import { ApprovalRevocationTerms } from '@metamask/delegation-core';
|
|
3
6
|
import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
|
|
4
|
-
import { l as Call, P as PermissionContext, S as SmartAccountsEnvironment, D as Delegation } from './types-BWaH4KH1.cjs';
|
|
5
7
|
import { U as UserOperationV07 } from './userOp-DKgjzz7B.cjs';
|
|
6
8
|
|
|
9
|
+
type BaseRedelegatePermissionContextParameters = {
|
|
10
|
+
account?: Account | Address;
|
|
11
|
+
environment: SmartAccountsEnvironment;
|
|
12
|
+
permissionContext: PermissionContext;
|
|
13
|
+
chainId?: number;
|
|
14
|
+
scope?: ScopeConfig;
|
|
15
|
+
caveats?: Caveats;
|
|
16
|
+
salt?: Hex;
|
|
17
|
+
};
|
|
18
|
+
type RedelegatePermissionContextParameters = BaseRedelegatePermissionContextParameters & {
|
|
19
|
+
to: Address;
|
|
20
|
+
};
|
|
21
|
+
type RedelegatePermissionContextOpenParameters = BaseRedelegatePermissionContextParameters;
|
|
22
|
+
type RedelegatePermissionContextReturnType = {
|
|
23
|
+
delegation: Delegation;
|
|
24
|
+
permissionContext: Hex;
|
|
25
|
+
};
|
|
26
|
+
type SigningClient<TChain extends Chain | undefined, TAccount extends Account | undefined> = Client<Transport, TChain, TAccount> & {
|
|
27
|
+
signTypedData: WalletClient['signTypedData'];
|
|
28
|
+
};
|
|
29
|
+
declare function redelegatePermissionContextAction<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: SigningClient<TChain, TAccount>, parameters: RedelegatePermissionContextParameters): Promise<RedelegatePermissionContextReturnType>;
|
|
30
|
+
declare function redelegatePermissionContextOpenAction<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: SigningClient<TChain, TAccount>, parameters: RedelegatePermissionContextOpenParameters): Promise<RedelegatePermissionContextReturnType>;
|
|
31
|
+
|
|
7
32
|
type BasePermission = {
|
|
8
33
|
type: string;
|
|
9
34
|
isAdjustmentAllowed: boolean;
|
|
@@ -72,7 +97,13 @@ type Erc20TokenRevocationPermission = BasePermission & {
|
|
|
72
97
|
justification?: string;
|
|
73
98
|
};
|
|
74
99
|
};
|
|
75
|
-
type
|
|
100
|
+
type TokenApprovalRevocationPermission = BasePermission & {
|
|
101
|
+
type: 'token-approval-revocation';
|
|
102
|
+
data: ApprovalRevocationTerms & {
|
|
103
|
+
justification?: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
type PermissionTypes = NativeTokenStreamPermission | NativeTokenPeriodicPermission | NativeTokenAllowancePermission | Erc20TokenStreamPermission | Erc20TokenPeriodicPermission | Erc20TokenAllowancePermission | Erc20TokenRevocationPermission | TokenApprovalRevocationPermission;
|
|
76
107
|
type PermissionRequestParameter = {
|
|
77
108
|
chainId: number;
|
|
78
109
|
permission: PermissionTypes;
|
|
@@ -236,8 +267,11 @@ declare const erc7715ProviderActions: () => (client: Client) => {
|
|
|
236
267
|
getGrantedExecutionPermissions: () => Promise<GetGrantedExecutionPermissionsResult>;
|
|
237
268
|
};
|
|
238
269
|
type Erc7715Client = Client & ReturnType<ReturnType<typeof erc7715ProviderActions>>;
|
|
270
|
+
type Erc7710WalletClient = WalletClient & ReturnType<ReturnType<typeof erc7710WalletActions>>;
|
|
239
271
|
declare const erc7710WalletActions: () => (client: WalletClient) => {
|
|
240
272
|
sendTransactionWithDelegation: (args: SendTransactionWithDelegationParameters) => Promise<`0x${string}`>;
|
|
273
|
+
redelegatePermissionContext: (parameters: RedelegatePermissionContextParameters) => Promise<RedelegatePermissionContextReturnType>;
|
|
274
|
+
redelegatePermissionContextOpen: (parameters: RedelegatePermissionContextOpenParameters) => Promise<RedelegatePermissionContextReturnType>;
|
|
241
275
|
};
|
|
242
276
|
declare const erc7710BundlerActions: () => (client: Client) => {
|
|
243
277
|
sendUserOperationWithDelegation: (args: SendUserOperationWithDelegationParameters) => Promise<`0x${string}`>;
|
|
@@ -249,6 +283,7 @@ type index_Erc20TokenAllowancePermission = Erc20TokenAllowancePermission;
|
|
|
249
283
|
type index_Erc20TokenPeriodicPermission = Erc20TokenPeriodicPermission;
|
|
250
284
|
type index_Erc20TokenRevocationPermission = Erc20TokenRevocationPermission;
|
|
251
285
|
type index_Erc20TokenStreamPermission = Erc20TokenStreamPermission;
|
|
286
|
+
type index_Erc7710WalletClient = Erc7710WalletClient;
|
|
252
287
|
type index_Erc7715Client = Erc7715Client;
|
|
253
288
|
type index_GetGrantedExecutionPermissionsResult = GetGrantedExecutionPermissionsResult;
|
|
254
289
|
type index_GetSupportedExecutionPermissionsResult = GetSupportedExecutionPermissionsResult;
|
|
@@ -260,6 +295,9 @@ type index_NativeTokenStreamPermission = NativeTokenStreamPermission;
|
|
|
260
295
|
type index_PeriodTransferResult = PeriodTransferResult;
|
|
261
296
|
type index_PermissionRequestParameter = PermissionRequestParameter;
|
|
262
297
|
type index_PermissionTypes = PermissionTypes;
|
|
298
|
+
type index_RedelegatePermissionContextOpenParameters = RedelegatePermissionContextOpenParameters;
|
|
299
|
+
type index_RedelegatePermissionContextParameters = RedelegatePermissionContextParameters;
|
|
300
|
+
type index_RedelegatePermissionContextReturnType = RedelegatePermissionContextReturnType;
|
|
263
301
|
type index_RequestExecutionPermissionsParameters = RequestExecutionPermissionsParameters;
|
|
264
302
|
type index_RequestExecutionPermissionsReturnType = RequestExecutionPermissionsReturnType;
|
|
265
303
|
type index_RpcGetGrantedExecutionPermissionsResult = RpcGetGrantedExecutionPermissionsResult;
|
|
@@ -272,6 +310,7 @@ type index_SignUserOperationParameters = SignUserOperationParameters;
|
|
|
272
310
|
type index_SignUserOperationReturnType = SignUserOperationReturnType;
|
|
273
311
|
type index_StreamingResult = StreamingResult;
|
|
274
312
|
type index_SupportedPermissionInfo = SupportedPermissionInfo;
|
|
313
|
+
type index_TokenApprovalRevocationPermission = TokenApprovalRevocationPermission;
|
|
275
314
|
declare const index_caveatEnforcerActions: typeof caveatEnforcerActions;
|
|
276
315
|
declare const index_erc7710BundlerActions: typeof erc7710BundlerActions;
|
|
277
316
|
declare const index_erc7710WalletActions: typeof erc7710WalletActions;
|
|
@@ -282,12 +321,14 @@ declare const index_getMultiTokenPeriodEnforcerAvailableAmount: typeof getMultiT
|
|
|
282
321
|
declare const index_getNativeTokenPeriodTransferEnforcerAvailableAmount: typeof getNativeTokenPeriodTransferEnforcerAvailableAmount;
|
|
283
322
|
declare const index_getNativeTokenStreamingEnforcerAvailableAmount: typeof getNativeTokenStreamingEnforcerAvailableAmount;
|
|
284
323
|
declare const index_isValid7702Implementation: typeof isValid7702Implementation;
|
|
324
|
+
declare const index_redelegatePermissionContextAction: typeof redelegatePermissionContextAction;
|
|
325
|
+
declare const index_redelegatePermissionContextOpenAction: typeof redelegatePermissionContextOpenAction;
|
|
285
326
|
declare const index_signDelegation: typeof signDelegation;
|
|
286
327
|
declare const index_signDelegationActions: typeof signDelegationActions;
|
|
287
328
|
declare const index_signUserOperation: typeof signUserOperation;
|
|
288
329
|
declare const index_signUserOperationActions: typeof signUserOperationActions;
|
|
289
330
|
declare namespace index {
|
|
290
|
-
export { type index_CaveatEnforcerParams as CaveatEnforcerParams, type index_DelegatedCall as DelegatedCall, type index_Erc20TokenAllowancePermission as Erc20TokenAllowancePermission, type index_Erc20TokenPeriodicPermission as Erc20TokenPeriodicPermission, type index_Erc20TokenRevocationPermission as Erc20TokenRevocationPermission, type index_Erc20TokenStreamPermission as Erc20TokenStreamPermission, type index_Erc7715Client as Erc7715Client, type index_GetGrantedExecutionPermissionsResult as GetGrantedExecutionPermissionsResult, type index_GetSupportedExecutionPermissionsResult as GetSupportedExecutionPermissionsResult, type index_MetaMaskExtensionClient as MetaMaskExtensionClient, type index_MetaMaskExtensionSchema as MetaMaskExtensionSchema, type index_NativeTokenAllowancePermission as NativeTokenAllowancePermission, type index_NativeTokenPeriodicPermission as NativeTokenPeriodicPermission, type index_NativeTokenStreamPermission as NativeTokenStreamPermission, type index_PeriodTransferResult as PeriodTransferResult, type index_PermissionRequestParameter as PermissionRequestParameter, type index_PermissionTypes as PermissionTypes, type index_RequestExecutionPermissionsParameters as RequestExecutionPermissionsParameters, type index_RequestExecutionPermissionsReturnType as RequestExecutionPermissionsReturnType, type index_RpcGetGrantedExecutionPermissionsResult as RpcGetGrantedExecutionPermissionsResult, type index_RpcGetSupportedExecutionPermissionsResult as RpcGetSupportedExecutionPermissionsResult, type index_RpcSupportedPermissionInfo as RpcSupportedPermissionInfo, index_Rule as Rule, type index_SignDelegationParameters as SignDelegationParameters, type index_SignDelegationReturnType as SignDelegationReturnType, type index_SignUserOperationParameters as SignUserOperationParameters, type index_SignUserOperationReturnType as SignUserOperationReturnType, type index_StreamingResult as StreamingResult, type index_SupportedPermissionInfo as SupportedPermissionInfo, index_caveatEnforcerActions as caveatEnforcerActions, index_erc7710BundlerActions as erc7710BundlerActions, index_erc7710WalletActions as erc7710WalletActions, index_erc7715ProviderActions as erc7715ProviderActions, index_getErc20PeriodTransferEnforcerAvailableAmount as getErc20PeriodTransferEnforcerAvailableAmount, index_getErc20StreamingEnforcerAvailableAmount as getErc20StreamingEnforcerAvailableAmount, erc7715GetGrantedExecutionPermissionsAction as getGrantedExecutionPermissions, index_getMultiTokenPeriodEnforcerAvailableAmount as getMultiTokenPeriodEnforcerAvailableAmount, index_getNativeTokenPeriodTransferEnforcerAvailableAmount as getNativeTokenPeriodTransferEnforcerAvailableAmount, index_getNativeTokenStreamingEnforcerAvailableAmount as getNativeTokenStreamingEnforcerAvailableAmount, erc7715GetSupportedExecutionPermissionsAction as getSupportedExecutionPermissions, index_isValid7702Implementation as isValid7702Implementation, erc7715RequestExecutionPermissionsAction as requestExecutionPermissions, index_signDelegation as signDelegation, index_signDelegationActions as signDelegationActions, index_signUserOperation as signUserOperation, index_signUserOperationActions as signUserOperationActions };
|
|
331
|
+
export { type index_CaveatEnforcerParams as CaveatEnforcerParams, type index_DelegatedCall as DelegatedCall, type index_Erc20TokenAllowancePermission as Erc20TokenAllowancePermission, type index_Erc20TokenPeriodicPermission as Erc20TokenPeriodicPermission, type index_Erc20TokenRevocationPermission as Erc20TokenRevocationPermission, type index_Erc20TokenStreamPermission as Erc20TokenStreamPermission, type index_Erc7710WalletClient as Erc7710WalletClient, type index_Erc7715Client as Erc7715Client, type index_GetGrantedExecutionPermissionsResult as GetGrantedExecutionPermissionsResult, type index_GetSupportedExecutionPermissionsResult as GetSupportedExecutionPermissionsResult, type index_MetaMaskExtensionClient as MetaMaskExtensionClient, type index_MetaMaskExtensionSchema as MetaMaskExtensionSchema, type index_NativeTokenAllowancePermission as NativeTokenAllowancePermission, type index_NativeTokenPeriodicPermission as NativeTokenPeriodicPermission, type index_NativeTokenStreamPermission as NativeTokenStreamPermission, type index_PeriodTransferResult as PeriodTransferResult, type index_PermissionRequestParameter as PermissionRequestParameter, type index_PermissionTypes as PermissionTypes, type index_RedelegatePermissionContextOpenParameters as RedelegatePermissionContextOpenParameters, type index_RedelegatePermissionContextParameters as RedelegatePermissionContextParameters, type index_RedelegatePermissionContextReturnType as RedelegatePermissionContextReturnType, type index_RequestExecutionPermissionsParameters as RequestExecutionPermissionsParameters, type index_RequestExecutionPermissionsReturnType as RequestExecutionPermissionsReturnType, type index_RpcGetGrantedExecutionPermissionsResult as RpcGetGrantedExecutionPermissionsResult, type index_RpcGetSupportedExecutionPermissionsResult as RpcGetSupportedExecutionPermissionsResult, type index_RpcSupportedPermissionInfo as RpcSupportedPermissionInfo, index_Rule as Rule, type index_SignDelegationParameters as SignDelegationParameters, type index_SignDelegationReturnType as SignDelegationReturnType, type index_SignUserOperationParameters as SignUserOperationParameters, type index_SignUserOperationReturnType as SignUserOperationReturnType, type index_StreamingResult as StreamingResult, type index_SupportedPermissionInfo as SupportedPermissionInfo, type index_TokenApprovalRevocationPermission as TokenApprovalRevocationPermission, index_caveatEnforcerActions as caveatEnforcerActions, index_erc7710BundlerActions as erc7710BundlerActions, index_erc7710WalletActions as erc7710WalletActions, index_erc7715ProviderActions as erc7715ProviderActions, index_getErc20PeriodTransferEnforcerAvailableAmount as getErc20PeriodTransferEnforcerAvailableAmount, index_getErc20StreamingEnforcerAvailableAmount as getErc20StreamingEnforcerAvailableAmount, erc7715GetGrantedExecutionPermissionsAction as getGrantedExecutionPermissions, index_getMultiTokenPeriodEnforcerAvailableAmount as getMultiTokenPeriodEnforcerAvailableAmount, index_getNativeTokenPeriodTransferEnforcerAvailableAmount as getNativeTokenPeriodTransferEnforcerAvailableAmount, index_getNativeTokenStreamingEnforcerAvailableAmount as getNativeTokenStreamingEnforcerAvailableAmount, erc7715GetSupportedExecutionPermissionsAction as getSupportedExecutionPermissions, index_isValid7702Implementation as isValid7702Implementation, index_redelegatePermissionContextAction as redelegatePermissionContextAction, index_redelegatePermissionContextOpenAction as redelegatePermissionContextOpenAction, erc7715RequestExecutionPermissionsAction as requestExecutionPermissions, index_signDelegation as signDelegation, index_signDelegationActions as signDelegationActions, index_signUserOperation as signUserOperation, index_signUserOperationActions as signUserOperationActions };
|
|
291
332
|
}
|
|
292
333
|
|
|
293
|
-
export {
|
|
334
|
+
export { erc7710WalletActions as A, erc7715ProviderActions as B, type CaveatEnforcerParams as C, type DelegatedCall as D, type Erc20TokenAllowancePermission as E, getErc20PeriodTransferEnforcerAvailableAmount as F, type GetGrantedExecutionPermissionsResult as G, getErc20StreamingEnforcerAvailableAmount as H, erc7715GetGrantedExecutionPermissionsAction as I, getMultiTokenPeriodEnforcerAvailableAmount as J, getNativeTokenPeriodTransferEnforcerAvailableAmount as K, getNativeTokenStreamingEnforcerAvailableAmount as L, type MetaMaskExtensionClient as M, type NativeTokenAllowancePermission as N, erc7715GetSupportedExecutionPermissionsAction as O, type PeriodTransferResult as P, isValid7702Implementation as Q, type RedelegatePermissionContextOpenParameters as R, type SignDelegationParameters as S, type TokenApprovalRevocationPermission as T, redelegatePermissionContextAction as U, redelegatePermissionContextOpenAction as V, erc7715RequestExecutionPermissionsAction as W, signDelegation as X, signDelegationActions as Y, signUserOperation as Z, signUserOperationActions as _, type Erc20TokenPeriodicPermission as a, type Erc20TokenRevocationPermission as b, caveatEnforcerActions as c, type Erc20TokenStreamPermission as d, type Erc7710WalletClient as e, type Erc7715Client as f, type GetSupportedExecutionPermissionsResult as g, type MetaMaskExtensionSchema as h, index as i, type NativeTokenPeriodicPermission as j, type NativeTokenStreamPermission as k, type PermissionRequestParameter as l, type PermissionTypes as m, type RedelegatePermissionContextParameters as n, type RedelegatePermissionContextReturnType as o, type RequestExecutionPermissionsParameters as p, type RequestExecutionPermissionsReturnType as q, type RpcGetGrantedExecutionPermissionsResult as r, type RpcGetSupportedExecutionPermissionsResult as s, type RpcSupportedPermissionInfo as t, type SignDelegationReturnType as u, type SignUserOperationParameters as v, type SignUserOperationReturnType as w, type StreamingResult as x, type SupportedPermissionInfo as y, erc7710BundlerActions as z };
|
package/dist/index.cjs
CHANGED
|
@@ -2,28 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk2ZOWIAP3cjs = require('./chunk-2ZOWIAP3.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
8
|
+
var _chunkEPU4O7FYcjs = require('./chunk-EPU4O7FY.cjs');
|
|
9
|
+
require('./chunk-PQPAEHJZ.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkDCI2AN4Ncjs = require('./chunk-DCI2AN4N.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
22
|
-
require('./chunk-
|
|
21
|
+
var _chunk2OS36DVVcjs = require('./chunk-2OS36DVV.cjs');
|
|
22
|
+
require('./chunk-JKVSTPEC.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
|
|
@@ -37,8 +36,7 @@ var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
|
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
var _chunkTMO23YRPcjs = require('./chunk-TMO23YRP.cjs');
|
|
39
|
+
var _chunkW6HPAK4Mcjs = require('./chunk-W6HPAK4M.cjs');
|
|
42
40
|
|
|
43
41
|
// src/toMetaMaskSmartAccount.ts
|
|
44
42
|
|
|
@@ -61,7 +59,7 @@ var signatureTypes = ["ECDSA"];
|
|
|
61
59
|
var aggregateSignature = ({
|
|
62
60
|
signatures
|
|
63
61
|
}) => {
|
|
64
|
-
|
|
62
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "aggregateSignature", {
|
|
65
63
|
signatureCount: signatures.length
|
|
66
64
|
});
|
|
67
65
|
if (signatures.length === 0) {
|
|
@@ -117,7 +115,7 @@ var resolveHybridSigner = (config) => {
|
|
|
117
115
|
if (webAuthnAccount.type !== "webAuthn") {
|
|
118
116
|
throw new Error("Account is not a webAuthn account");
|
|
119
117
|
}
|
|
120
|
-
const encodeSignature = (result) =>
|
|
118
|
+
const encodeSignature = (result) => _chunkDCI2AN4Ncjs.encodeDeleGatorSignature.call(void 0,
|
|
121
119
|
keyId,
|
|
122
120
|
result.signature,
|
|
123
121
|
result.webauthn.clientDataJSON,
|
|
@@ -125,7 +123,7 @@ var resolveHybridSigner = (config) => {
|
|
|
125
123
|
);
|
|
126
124
|
const signMessage = async (args) => webAuthnAccount.signMessage(args).then(encodeSignature);
|
|
127
125
|
const signTypedData = async (typedDataDefinition) => webAuthnAccount.signTypedData(typedDataDefinition).then(encodeSignature);
|
|
128
|
-
const getStubSignature = async () =>
|
|
126
|
+
const getStubSignature = async () => _chunkDCI2AN4Ncjs.createDummyWebAuthnSignature.call(void 0, keyId);
|
|
129
127
|
return {
|
|
130
128
|
signMessage,
|
|
131
129
|
signTypedData,
|
|
@@ -236,7 +234,7 @@ async function toMetaMaskSmartAccount(params) {
|
|
|
236
234
|
implementation,
|
|
237
235
|
nonceKeyManager
|
|
238
236
|
} = params;
|
|
239
|
-
|
|
237
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "toMetaMaskSmartAccount", {
|
|
240
238
|
implementation,
|
|
241
239
|
hasAddress: params.address !== void 0,
|
|
242
240
|
hasEnvironment: params.environment !== void 0,
|
|
@@ -249,7 +247,7 @@ async function toMetaMaskSmartAccount(params) {
|
|
|
249
247
|
implementation,
|
|
250
248
|
signer: params.signer
|
|
251
249
|
});
|
|
252
|
-
const environment = _nullishCoalesce(params.environment, () => (
|
|
250
|
+
const environment = _nullishCoalesce(params.environment, () => ( _chunk2OS36DVVcjs.getSmartAccountsEnvironment.call(void 0, chain.id)));
|
|
253
251
|
let address, factoryData;
|
|
254
252
|
if (params.address) {
|
|
255
253
|
factoryData = void 0;
|
|
@@ -258,7 +256,7 @@ async function toMetaMaskSmartAccount(params) {
|
|
|
258
256
|
if (implementation === "Stateless7702" /* Stateless7702 */) {
|
|
259
257
|
throw new Error("Stateless7702 does not support counterfactual accounts");
|
|
260
258
|
}
|
|
261
|
-
const accountData = await
|
|
259
|
+
const accountData = await _chunkDCI2AN4Ncjs.getCounterfactualAccountData.call(void 0, {
|
|
262
260
|
factory: environment.SimpleFactory,
|
|
263
261
|
implementations: environment.implementations,
|
|
264
262
|
implementation,
|
|
@@ -305,7 +303,7 @@ async function toMetaMaskSmartAccount(params) {
|
|
|
305
303
|
);
|
|
306
304
|
}
|
|
307
305
|
const { delegation, chainId } = delegationParams;
|
|
308
|
-
const delegationStruct =
|
|
306
|
+
const delegationStruct = _chunkW6HPAK4Mcjs.toDelegationStruct.call(void 0, {
|
|
309
307
|
...delegation,
|
|
310
308
|
signature: "0x"
|
|
311
309
|
});
|
|
@@ -316,7 +314,7 @@ async function toMetaMaskSmartAccount(params) {
|
|
|
316
314
|
version: "1",
|
|
317
315
|
verifyingContract: environment.DelegationManager
|
|
318
316
|
},
|
|
319
|
-
types:
|
|
317
|
+
types: _chunkW6HPAK4Mcjs.SIGNABLE_DELEGATION_TYPED_DATA,
|
|
320
318
|
primaryType: "Delegation",
|
|
321
319
|
message: delegationStruct
|
|
322
320
|
});
|
|
@@ -341,14 +339,14 @@ async function toMetaMaskSmartAccount(params) {
|
|
|
341
339
|
version: "1",
|
|
342
340
|
verifyingContract: address
|
|
343
341
|
},
|
|
344
|
-
types:
|
|
342
|
+
types: _chunk2OS36DVVcjs.SIGNABLE_USER_OP_TYPED_DATA,
|
|
345
343
|
primaryType: "PackedUserOperation",
|
|
346
344
|
message: { ...packedUserOp, entryPoint: entryPoint.address }
|
|
347
345
|
});
|
|
348
346
|
return signature;
|
|
349
347
|
};
|
|
350
348
|
const getAddress = async () => address;
|
|
351
|
-
const encodeCalls = async (calls) =>
|
|
349
|
+
const encodeCalls = async (calls) => _chunkDCI2AN4Ncjs.encodeCallsForCaller.call(void 0, address, calls);
|
|
352
350
|
const signerMethods = _nullishCoalesce(signer, () => ( {
|
|
353
351
|
signMessage: async () => {
|
|
354
352
|
throw new Error(
|
|
@@ -382,7 +380,7 @@ async function toMetaMaskSmartAccount(params) {
|
|
|
382
380
|
if (implementation === "Stateless7702" /* Stateless7702 */) {
|
|
383
381
|
return {
|
|
384
382
|
...smartAccount,
|
|
385
|
-
isDeployed: async () =>
|
|
383
|
+
isDeployed: async () => _chunk2ZOWIAP3cjs.isValid7702Implementation.call(void 0, {
|
|
386
384
|
client,
|
|
387
385
|
accountAddress: address,
|
|
388
386
|
environment
|
|
@@ -400,10 +398,10 @@ function createCaveatEnforcerClient({
|
|
|
400
398
|
client,
|
|
401
399
|
environment
|
|
402
400
|
}) {
|
|
403
|
-
|
|
401
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "createCaveatEnforcerClient", {
|
|
404
402
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _2 => _2.chain, 'optionalAccess', _3 => _3.id]), () => ( null))
|
|
405
403
|
});
|
|
406
|
-
return client.extend(
|
|
404
|
+
return client.extend(_chunk2ZOWIAP3cjs.caveatEnforcerActions.call(void 0, { environment }));
|
|
407
405
|
}
|
|
408
406
|
|
|
409
407
|
// src/actions/infuraBundlerClient.ts
|
|
@@ -431,7 +429,7 @@ var infuraBundlerActions = () => (client) => ({
|
|
|
431
429
|
}
|
|
432
430
|
});
|
|
433
431
|
function createInfuraBundlerClient(config) {
|
|
434
|
-
|
|
432
|
+
_chunkW6HPAK4Mcjs.trackSmartAccountsKitFunctionCall.call(void 0, "createInfuraBundlerClient", {
|
|
435
433
|
chainId: _nullishCoalesce(_optionalChain([config, 'access', _4 => _4.chain, 'optionalAccess', _5 => _5.id]), () => ( null))
|
|
436
434
|
});
|
|
437
435
|
const baseBundlerClient = _accountabstraction.createBundlerClient.call(void 0, config);
|
|
@@ -462,5 +460,5 @@ function createInfuraBundlerClient(config) {
|
|
|
462
460
|
|
|
463
461
|
|
|
464
462
|
|
|
465
|
-
exports.ANY_BENEFICIARY =
|
|
463
|
+
exports.ANY_BENEFICIARY = _chunkW6HPAK4Mcjs.ANY_BENEFICIARY; exports.BalanceChangeType = _delegationcore.BalanceChangeType; exports.CaveatType = _chunkW6HPAK4Mcjs.CaveatType; exports.ExecutionMode = _chunkW6HPAK4Mcjs.ExecutionMode; exports.Implementation = _chunkW6HPAK4Mcjs.Implementation; exports.PREFERRED_VERSION = _chunk2OS36DVVcjs.PREFERRED_VERSION; exports.ROOT_AUTHORITY = _chunkW6HPAK4Mcjs.ROOT_AUTHORITY; exports.ScopeType = _chunkW6HPAK4Mcjs.ScopeType; exports.TransferWindow = _chunkW6HPAK4Mcjs.TransferWindow; exports.actions = _chunk2ZOWIAP3cjs.actions_exports; exports.aggregateSignature = aggregateSignature; exports.contracts = _chunkEPU4O7FYcjs.contracts_exports; exports.createCaveat = _chunkW6HPAK4Mcjs.createCaveat; exports.createCaveatEnforcerClient = createCaveatEnforcerClient; exports.createDelegation = _chunkW6HPAK4Mcjs.createDelegation; exports.createExecution = _chunkW6HPAK4Mcjs.createExecution; exports.createInfuraBundlerClient = createInfuraBundlerClient; exports.createOpenDelegation = _chunkW6HPAK4Mcjs.createOpenDelegation; exports.getSmartAccountsEnvironment = _chunk2OS36DVVcjs.getSmartAccountsEnvironment; exports.signDelegation = _chunkW6HPAK4Mcjs.signDelegation; exports.signUserOperation = _chunk2OS36DVVcjs.signUserOperation; exports.toMetaMaskSmartAccount = toMetaMaskSmartAccount;
|
|
466
464
|
//# sourceMappingURL=index.cjs.map
|