@metamask/smart-accounts-kit 0.4.0-beta.1 → 0.4.0-beta.2
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 +38 -1
- package/dist/actions/index.cjs +5 -5
- package/dist/actions/index.d.cts +2 -2
- package/dist/actions/index.d.ts +2 -2
- package/dist/actions/index.mjs +4 -4
- package/dist/{chunk-HBAJRXQB.cjs → chunk-23YXLKTX.cjs} +11 -11
- package/dist/{chunk-HBAJRXQB.cjs.map → chunk-23YXLKTX.cjs.map} +1 -1
- package/dist/{chunk-GH5EK5MB.mjs → chunk-33AMUJBJ.mjs} +7 -7
- package/dist/chunk-33AMUJBJ.mjs.map +1 -0
- package/dist/{chunk-TEH426Y4.mjs → chunk-C5ZEEH2Z.mjs} +283 -184
- package/dist/chunk-C5ZEEH2Z.mjs.map +1 -0
- package/dist/{chunk-OPJBYTWX.cjs → chunk-DLD377CN.cjs} +16 -32
- package/dist/chunk-DLD377CN.cjs.map +1 -0
- package/dist/{chunk-YYZWHBF2.mjs → chunk-NOCLGZGB.mjs} +173 -128
- package/dist/chunk-NOCLGZGB.mjs.map +1 -0
- package/dist/{chunk-5FLY3IPW.mjs → chunk-QCULIK3O.mjs} +27 -56
- package/dist/chunk-QCULIK3O.mjs.map +1 -0
- package/dist/{chunk-CLBI7P3Z.cjs → chunk-QMRKCB7T.cjs} +203 -158
- package/dist/chunk-QMRKCB7T.cjs.map +1 -0
- package/dist/{chunk-Q4V7BKAG.cjs → chunk-SOFB2MXG.cjs} +27 -56
- package/dist/chunk-SOFB2MXG.cjs.map +1 -0
- package/dist/{chunk-NGZLJAMA.cjs → chunk-UUOH2WAW.cjs} +12 -12
- package/dist/{chunk-NGZLJAMA.cjs.map → chunk-UUOH2WAW.cjs.map} +1 -1
- package/dist/{chunk-DRVPD5QI.mjs → chunk-WPVSFOQM.mjs} +10 -26
- package/dist/chunk-WPVSFOQM.mjs.map +1 -0
- package/dist/{chunk-ZTGEG2ZA.mjs → chunk-WV2R7BXP.mjs} +2 -2
- package/dist/{chunk-7CVW7JE3.cjs → chunk-XN36L4RX.cjs} +102 -102
- package/dist/chunk-XN36L4RX.cjs.map +1 -0
- package/dist/{chunk-MIP7KJYH.cjs → chunk-YDLLC6PP.cjs} +252 -153
- package/dist/chunk-YDLLC6PP.cjs.map +1 -0
- package/dist/{chunk-XUVEYTD2.mjs → chunk-YTELOQ4I.mjs} +2 -2
- package/dist/contracts/index.cjs +5 -5
- package/dist/contracts/index.d.cts +3 -3
- package/dist/contracts/index.d.ts +3 -3
- package/dist/contracts/index.mjs +4 -4
- package/dist/{delegation-sP7mnAkl.d.ts → delegation-DGUfyX-C.d.ts} +52 -26
- package/dist/{delegation-Bd2v5lF5.d.cts → delegation-D_TY-tAq.d.cts} +52 -26
- package/dist/experimental/index.cjs +4 -4
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/index.d.cts +1 -1
- package/dist/experimental/index.d.ts +1 -1
- package/dist/experimental/index.mjs +5 -5
- package/dist/experimental/index.mjs.map +1 -1
- package/dist/{index-B9w3fRT-.d.cts → index-B9bsjGqI.d.ts} +4 -5
- package/dist/{index-C8wAvC29.d.cts → index-CZes99jV.d.cts} +92 -62
- package/dist/{index-DpokPMZc.d.ts → index-DvcKJcXi.d.cts} +4 -5
- package/dist/{index-Bfcoh3WQ.d.ts → index-FpCh2419.d.ts} +92 -62
- package/dist/index.cjs +23 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -11
- package/dist/index.d.ts +9 -11
- package/dist/index.mjs +14 -12
- package/dist/index.mjs.map +1 -1
- package/dist/{smartAccountsEnvironment-YDC3jB33.d.cts → smartAccountsEnvironment-BU8kjlEv.d.cts} +1 -1
- package/dist/{smartAccountsEnvironment-EW722Cnw.d.ts → smartAccountsEnvironment-egxuflDO.d.ts} +1 -1
- package/dist/{types-B9GE5CfG.d.ts → types-BLYWtcR3.d.cts} +46 -28
- package/dist/{types-B9GE5CfG.d.cts → types-BLYWtcR3.d.ts} +46 -28
- package/dist/utils/index.cjs +7 -5
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +3 -4
- package/dist/utils/index.d.ts +3 -4
- package/dist/utils/index.mjs +12 -10
- package/package.json +5 -10
- package/dist/chunk-5FLY3IPW.mjs.map +0 -1
- package/dist/chunk-7CVW7JE3.cjs.map +0 -1
- package/dist/chunk-CLBI7P3Z.cjs.map +0 -1
- package/dist/chunk-DRVPD5QI.mjs.map +0 -1
- package/dist/chunk-GH5EK5MB.mjs.map +0 -1
- package/dist/chunk-MIP7KJYH.cjs.map +0 -1
- package/dist/chunk-OPJBYTWX.cjs.map +0 -1
- package/dist/chunk-Q4V7BKAG.cjs.map +0 -1
- package/dist/chunk-TEH426Y4.mjs.map +0 -1
- package/dist/chunk-YYZWHBF2.mjs.map +0 -1
- /package/dist/{chunk-ZTGEG2ZA.mjs.map → chunk-WV2R7BXP.mjs.map} +0 -0
- /package/dist/{chunk-XUVEYTD2.mjs.map → chunk-YTELOQ4I.mjs.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HybridDeleGator, MultiSigDeleGator, EIP7702StatelessDeleGator } from '@metamask/delegation-abis';
|
|
2
|
-
import {
|
|
2
|
+
import { PublicClient, WalletClient, Transport, Chain, Account, Hex, OneOf, Address } from 'viem';
|
|
3
3
|
import { WebAuthnAccount, SmartAccount, SmartAccountImplementation, entryPoint07Abi } from 'viem/account-abstraction';
|
|
4
4
|
import { Prettify } from 'viem/chains';
|
|
5
5
|
|
|
@@ -17,28 +17,50 @@ declare enum TransferWindow {
|
|
|
17
17
|
Quarterly = 7776000,
|
|
18
18
|
Yearly = 31536000
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
declare
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
declare enum ScopeType {
|
|
21
|
+
Erc20TransferAmount = "erc20TransferAmount",
|
|
22
|
+
Erc20Streaming = "erc20Streaming",
|
|
23
|
+
Erc20PeriodTransfer = "erc20PeriodTransfer",
|
|
24
|
+
NativeTokenTransferAmount = "nativeTokenTransferAmount",
|
|
25
|
+
NativeTokenStreaming = "nativeTokenStreaming",
|
|
26
|
+
NativeTokenPeriodTransfer = "nativeTokenPeriodTransfer",
|
|
27
|
+
Erc721Transfer = "erc721Transfer",
|
|
28
|
+
OwnershipTransfer = "ownershipTransfer",
|
|
29
|
+
FunctionCall = "functionCall"
|
|
30
|
+
}
|
|
31
|
+
declare enum CaveatType {
|
|
32
|
+
AllowedMethods = "allowedMethods",
|
|
33
|
+
AllowedTargets = "allowedTargets",
|
|
34
|
+
Deployed = "deployed",
|
|
35
|
+
AllowedCalldata = "allowedCalldata",
|
|
36
|
+
Erc20BalanceChange = "erc20BalanceChange",
|
|
37
|
+
Erc721BalanceChange = "erc721BalanceChange",
|
|
38
|
+
Erc1155BalanceChange = "erc1155BalanceChange",
|
|
39
|
+
ValueLte = "valueLte",
|
|
40
|
+
LimitedCalls = "limitedCalls",
|
|
41
|
+
Id = "id",
|
|
42
|
+
Nonce = "nonce",
|
|
43
|
+
Timestamp = "timestamp",
|
|
44
|
+
BlockNumber = "blockNumber",
|
|
45
|
+
Erc20TransferAmount = "erc20TransferAmount",
|
|
46
|
+
Erc20Streaming = "erc20Streaming",
|
|
47
|
+
NativeTokenStreaming = "nativeTokenStreaming",
|
|
48
|
+
Erc721Transfer = "erc721Transfer",
|
|
49
|
+
NativeTokenTransferAmount = "nativeTokenTransferAmount",
|
|
50
|
+
NativeBalanceChange = "nativeBalanceChange",
|
|
51
|
+
Redeemer = "redeemer",
|
|
52
|
+
NativeTokenPayment = "nativeTokenPayment",
|
|
53
|
+
ArgsEqualityCheck = "argsEqualityCheck",
|
|
54
|
+
SpecificActionERC20TransferBatch = "specificActionERC20TransferBatch",
|
|
55
|
+
Erc20PeriodTransfer = "erc20PeriodTransfer",
|
|
56
|
+
NativeTokenPeriodTransfer = "nativeTokenPeriodTransfer",
|
|
57
|
+
ExactCalldataBatch = "exactCalldataBatch",
|
|
58
|
+
ExactCalldata = "exactCalldata",
|
|
59
|
+
ExactExecution = "exactExecution",
|
|
60
|
+
ExactExecutionBatch = "exactExecutionBatch",
|
|
61
|
+
MultiTokenPeriod = "multiTokenPeriod",
|
|
62
|
+
OwnershipTransfer = "ownershipTransfer"
|
|
37
63
|
}
|
|
38
|
-
declare const encodeSingleExecution: (execution: ExecutionStruct) => Hex;
|
|
39
|
-
declare const encodeBatchExecution: (executions: ExecutionStruct[]) => Hex;
|
|
40
|
-
declare const encodeExecutionCalldata: (executions: ExecutionStruct[]) => Hex;
|
|
41
|
-
declare const encodeExecutionCalldatas: (executionsBatch: ExecutionStruct[][]) => Hex[];
|
|
42
64
|
|
|
43
65
|
type Caveat = {
|
|
44
66
|
enforcer: Hex;
|
|
@@ -53,6 +75,7 @@ type Delegation = {
|
|
|
53
75
|
salt: Hex;
|
|
54
76
|
signature: Hex;
|
|
55
77
|
};
|
|
78
|
+
type PermissionContext = Delegation[] | Hex;
|
|
56
79
|
type SmartAccountsEnvironment = {
|
|
57
80
|
DelegationManager: Hex;
|
|
58
81
|
EntryPoint: Hex;
|
|
@@ -71,11 +94,6 @@ type HybridDeleGatorDeployParams = [
|
|
|
71
94
|
xValues: bigint[],
|
|
72
95
|
yValues: bigint[]
|
|
73
96
|
];
|
|
74
|
-
type Redemption = {
|
|
75
|
-
permissionContext: Delegation[];
|
|
76
|
-
executions: ExecutionStruct[];
|
|
77
|
-
mode: ExecutionMode;
|
|
78
|
-
};
|
|
79
97
|
type DeployParams<TImplementation extends Implementation> = {
|
|
80
98
|
[Implementation.MultiSig]: MultiSigDeleGatorDeployParams;
|
|
81
99
|
[Implementation.Hybrid]: HybridDeleGatorDeployParams;
|
|
@@ -133,4 +151,4 @@ type Call = {
|
|
|
133
151
|
value?: bigint | undefined;
|
|
134
152
|
};
|
|
135
153
|
|
|
136
|
-
export { type AccountSignerConfig as A, type Caveat as C, type Delegation as D,
|
|
154
|
+
export { type AccountSignerConfig as A, type Caveat as C, type Delegation as D, type HybridDeleGatorDeployParams as H, Implementation as I, type MultiSigDeleGatorDeployParams as M, type PermissionContext as P, type SmartAccountsEnvironment as S, type ToMetaMaskSmartAccountParameters as T, type WalletSignerConfig as W, type ToMetaMaskSmartAccountReturnType as a, type SignUserOperationParams as b, type SignDelegationParams as c, type MetaMaskSmartAccountImplementation as d, type MetaMaskSmartAccount as e, type WebAuthnSignerConfig as f, type HybridSignerConfig as g, type MultiSigSignerConfig as h, TransferWindow as i, ScopeType as j, CaveatType as k, type Call as l, type DeployParams as m };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HybridDeleGator, MultiSigDeleGator, EIP7702StatelessDeleGator } from '@metamask/delegation-abis';
|
|
2
|
-
import {
|
|
2
|
+
import { PublicClient, WalletClient, Transport, Chain, Account, Hex, OneOf, Address } from 'viem';
|
|
3
3
|
import { WebAuthnAccount, SmartAccount, SmartAccountImplementation, entryPoint07Abi } from 'viem/account-abstraction';
|
|
4
4
|
import { Prettify } from 'viem/chains';
|
|
5
5
|
|
|
@@ -17,28 +17,50 @@ declare enum TransferWindow {
|
|
|
17
17
|
Quarterly = 7776000,
|
|
18
18
|
Yearly = 31536000
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
declare
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
declare enum ScopeType {
|
|
21
|
+
Erc20TransferAmount = "erc20TransferAmount",
|
|
22
|
+
Erc20Streaming = "erc20Streaming",
|
|
23
|
+
Erc20PeriodTransfer = "erc20PeriodTransfer",
|
|
24
|
+
NativeTokenTransferAmount = "nativeTokenTransferAmount",
|
|
25
|
+
NativeTokenStreaming = "nativeTokenStreaming",
|
|
26
|
+
NativeTokenPeriodTransfer = "nativeTokenPeriodTransfer",
|
|
27
|
+
Erc721Transfer = "erc721Transfer",
|
|
28
|
+
OwnershipTransfer = "ownershipTransfer",
|
|
29
|
+
FunctionCall = "functionCall"
|
|
30
|
+
}
|
|
31
|
+
declare enum CaveatType {
|
|
32
|
+
AllowedMethods = "allowedMethods",
|
|
33
|
+
AllowedTargets = "allowedTargets",
|
|
34
|
+
Deployed = "deployed",
|
|
35
|
+
AllowedCalldata = "allowedCalldata",
|
|
36
|
+
Erc20BalanceChange = "erc20BalanceChange",
|
|
37
|
+
Erc721BalanceChange = "erc721BalanceChange",
|
|
38
|
+
Erc1155BalanceChange = "erc1155BalanceChange",
|
|
39
|
+
ValueLte = "valueLte",
|
|
40
|
+
LimitedCalls = "limitedCalls",
|
|
41
|
+
Id = "id",
|
|
42
|
+
Nonce = "nonce",
|
|
43
|
+
Timestamp = "timestamp",
|
|
44
|
+
BlockNumber = "blockNumber",
|
|
45
|
+
Erc20TransferAmount = "erc20TransferAmount",
|
|
46
|
+
Erc20Streaming = "erc20Streaming",
|
|
47
|
+
NativeTokenStreaming = "nativeTokenStreaming",
|
|
48
|
+
Erc721Transfer = "erc721Transfer",
|
|
49
|
+
NativeTokenTransferAmount = "nativeTokenTransferAmount",
|
|
50
|
+
NativeBalanceChange = "nativeBalanceChange",
|
|
51
|
+
Redeemer = "redeemer",
|
|
52
|
+
NativeTokenPayment = "nativeTokenPayment",
|
|
53
|
+
ArgsEqualityCheck = "argsEqualityCheck",
|
|
54
|
+
SpecificActionERC20TransferBatch = "specificActionERC20TransferBatch",
|
|
55
|
+
Erc20PeriodTransfer = "erc20PeriodTransfer",
|
|
56
|
+
NativeTokenPeriodTransfer = "nativeTokenPeriodTransfer",
|
|
57
|
+
ExactCalldataBatch = "exactCalldataBatch",
|
|
58
|
+
ExactCalldata = "exactCalldata",
|
|
59
|
+
ExactExecution = "exactExecution",
|
|
60
|
+
ExactExecutionBatch = "exactExecutionBatch",
|
|
61
|
+
MultiTokenPeriod = "multiTokenPeriod",
|
|
62
|
+
OwnershipTransfer = "ownershipTransfer"
|
|
37
63
|
}
|
|
38
|
-
declare const encodeSingleExecution: (execution: ExecutionStruct) => Hex;
|
|
39
|
-
declare const encodeBatchExecution: (executions: ExecutionStruct[]) => Hex;
|
|
40
|
-
declare const encodeExecutionCalldata: (executions: ExecutionStruct[]) => Hex;
|
|
41
|
-
declare const encodeExecutionCalldatas: (executionsBatch: ExecutionStruct[][]) => Hex[];
|
|
42
64
|
|
|
43
65
|
type Caveat = {
|
|
44
66
|
enforcer: Hex;
|
|
@@ -53,6 +75,7 @@ type Delegation = {
|
|
|
53
75
|
salt: Hex;
|
|
54
76
|
signature: Hex;
|
|
55
77
|
};
|
|
78
|
+
type PermissionContext = Delegation[] | Hex;
|
|
56
79
|
type SmartAccountsEnvironment = {
|
|
57
80
|
DelegationManager: Hex;
|
|
58
81
|
EntryPoint: Hex;
|
|
@@ -71,11 +94,6 @@ type HybridDeleGatorDeployParams = [
|
|
|
71
94
|
xValues: bigint[],
|
|
72
95
|
yValues: bigint[]
|
|
73
96
|
];
|
|
74
|
-
type Redemption = {
|
|
75
|
-
permissionContext: Delegation[];
|
|
76
|
-
executions: ExecutionStruct[];
|
|
77
|
-
mode: ExecutionMode;
|
|
78
|
-
};
|
|
79
97
|
type DeployParams<TImplementation extends Implementation> = {
|
|
80
98
|
[Implementation.MultiSig]: MultiSigDeleGatorDeployParams;
|
|
81
99
|
[Implementation.Hybrid]: HybridDeleGatorDeployParams;
|
|
@@ -133,4 +151,4 @@ type Call = {
|
|
|
133
151
|
value?: bigint | undefined;
|
|
134
152
|
};
|
|
135
153
|
|
|
136
|
-
export { type AccountSignerConfig as A, type Caveat as C, type Delegation as D,
|
|
154
|
+
export { type AccountSignerConfig as A, type Caveat as C, type Delegation as D, type HybridDeleGatorDeployParams as H, Implementation as I, type MultiSigDeleGatorDeployParams as M, type PermissionContext as P, type SmartAccountsEnvironment as S, type ToMetaMaskSmartAccountParameters as T, type WalletSignerConfig as W, type ToMetaMaskSmartAccountReturnType as a, type SignUserOperationParams as b, type SignDelegationParams as c, type MetaMaskSmartAccountImplementation as d, type MetaMaskSmartAccount as e, type WebAuthnSignerConfig as f, type HybridSignerConfig as g, type MultiSigSignerConfig as h, TransferWindow as i, ScopeType as j, CaveatType as k, type Call as l, type DeployParams as m };
|
package/dist/utils/index.cjs
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkDLD377CNcjs = require('../chunk-DLD377CN.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('../chunk-
|
|
11
|
+
var _chunkSOFB2MXGcjs = require('../chunk-SOFB2MXG.cjs');
|
|
12
|
+
require('../chunk-23YXLKTX.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -30,8 +30,8 @@ var _chunkVLKX4BR6cjs = require('../chunk-VLKX4BR6.cjs');
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var _chunkMIP7KJYHcjs = require('../chunk-MIP7KJYH.cjs');
|
|
34
33
|
|
|
34
|
+
var _chunkYDLLC6PPcjs = require('../chunk-YDLLC6PP.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -56,5 +56,7 @@ var _chunkMIP7KJYHcjs = require('../chunk-MIP7KJYH.cjs');
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
exports.CaveatBuilder = _chunkYDLLC6PPcjs.CaveatBuilder; exports.DELEGATION_ABI_TYPE = _chunkYDLLC6PPcjs.DELEGATION_ABI_TYPE; exports.DELEGATION_ABI_TYPE_COMPONENTS = _chunkYDLLC6PPcjs.DELEGATION_ABI_TYPE_COMPONENTS; exports.DELEGATION_ARRAY_ABI_TYPE = _chunkYDLLC6PPcjs.DELEGATION_ARRAY_ABI_TYPE; exports.DELEGATION_TYPEHASH = _chunkYDLLC6PPcjs.DELEGATION_TYPEHASH; exports.SIGNABLE_DELEGATION_TYPED_DATA = _chunkYDLLC6PPcjs.SIGNABLE_DELEGATION_TYPED_DATA; exports.SIGNABLE_USER_OP_TYPED_DATA = _chunkSOFB2MXGcjs.SIGNABLE_USER_OP_TYPED_DATA; exports.SIGNATURE_ABI_PARAMS = _chunkDLD377CNcjs.SIGNATURE_ABI_PARAMS; exports.createCaveatBuilder = _chunkYDLLC6PPcjs.createCaveatBuilder; exports.decodeDelegation = _chunkYDLLC6PPcjs.decodeDelegation; exports.decodeDelegations = _chunkYDLLC6PPcjs.decodeDelegations; exports.deploySmartAccountsEnvironment = _chunkSOFB2MXGcjs.deploySmartAccountsEnvironment; exports.encodeBatchExecution = _chunkVLKX4BR6cjs.encodeBatchExecution; exports.encodeCalls = _chunkDLD377CNcjs.encodeCalls; exports.encodeCallsForCaller = _chunkDLD377CNcjs.encodeCallsForCaller; exports.encodeDelegation = _chunkYDLLC6PPcjs.encodeDelegation; exports.encodeDelegations = _chunkYDLLC6PPcjs.encodeDelegations; exports.encodeExecutionCalldata = _chunkVLKX4BR6cjs.encodeExecutionCalldata; exports.encodeExecutionCalldatas = _chunkVLKX4BR6cjs.encodeExecutionCalldatas; exports.encodeSingleExecution = _chunkVLKX4BR6cjs.encodeSingleExecution; exports.getCounterfactualAccountData = _chunkDLD377CNcjs.getCounterfactualAccountData; exports.hashDelegation = _chunkYDLLC6PPcjs.hashDelegation; exports.overrideDeployedEnvironment = _chunkSOFB2MXGcjs.overrideDeployedEnvironment; exports.toDelegation = _chunkYDLLC6PPcjs.toDelegation; exports.toDelegationStruct = _chunkYDLLC6PPcjs.toDelegationStruct;
|
|
60
62
|
//# sourceMappingURL=index.cjs.map
|
package/dist/utils/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/utils/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/utils/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,8wDAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/utils/index.cjs"}
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import { m as Call, I as Implementation, S as SmartAccountsEnvironment, n as DeployParams } from '../types-B9GE5CfG.cjs';
|
|
3
|
-
export { k as ExecutionStruct, r as encodeBatchExecution, o as encodeExecutionCalldata, p as encodeExecutionCalldatas, q as encodeSingleExecution } from '../types-B9GE5CfG.cjs';
|
|
1
|
+
export { z as CaveatBuilder, x as CaveatBuilderConfig, w as CoreCaveatBuilder, m as DELEGATION_ABI_TYPE, n as DELEGATION_ABI_TYPE_COMPONENTS, D as DELEGATION_ARRAY_ABI_TYPE, p as DelegationStruct, e as ExecutionStruct, S as SIGNABLE_DELEGATION_TYPED_DATA, y as createCaveatBuilder, k as decodeDelegation, i as decodeDelegations, v as encodeBatchExecution, j as encodeDelegation, h as encodeDelegations, q as encodeExecutionCalldata, r as encodeExecutionCalldatas, u as encodeSingleExecution, o as hashDelegation, l as toDelegation, t as toDelegationStruct } from '../delegation-D_TY-tAq.cjs';
|
|
4
2
|
export { S as SIGNABLE_USER_OP_TYPED_DATA } from '../userOp-DKgjzz7B.cjs';
|
|
5
3
|
import { Address, Hex } from 'viem';
|
|
6
|
-
|
|
4
|
+
import { l as Call, I as Implementation, S as SmartAccountsEnvironment, m as DeployParams } from '../types-BLYWtcR3.cjs';
|
|
5
|
+
export { d as deploySmartAccountsEnvironment, o as overrideDeployedEnvironment } from '../smartAccountsEnvironment-BU8kjlEv.cjs';
|
|
7
6
|
export { DELEGATION_TYPEHASH } from '@metamask/delegation-core';
|
|
8
7
|
import '@metamask/delegation-abis';
|
|
9
8
|
import 'viem/account-abstraction';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import { m as Call, I as Implementation, S as SmartAccountsEnvironment, n as DeployParams } from '../types-B9GE5CfG.js';
|
|
3
|
-
export { k as ExecutionStruct, r as encodeBatchExecution, o as encodeExecutionCalldata, p as encodeExecutionCalldatas, q as encodeSingleExecution } from '../types-B9GE5CfG.js';
|
|
1
|
+
export { z as CaveatBuilder, x as CaveatBuilderConfig, w as CoreCaveatBuilder, m as DELEGATION_ABI_TYPE, n as DELEGATION_ABI_TYPE_COMPONENTS, D as DELEGATION_ARRAY_ABI_TYPE, p as DelegationStruct, e as ExecutionStruct, S as SIGNABLE_DELEGATION_TYPED_DATA, y as createCaveatBuilder, k as decodeDelegation, i as decodeDelegations, v as encodeBatchExecution, j as encodeDelegation, h as encodeDelegations, q as encodeExecutionCalldata, r as encodeExecutionCalldatas, u as encodeSingleExecution, o as hashDelegation, l as toDelegation, t as toDelegationStruct } from '../delegation-DGUfyX-C.js';
|
|
4
2
|
export { S as SIGNABLE_USER_OP_TYPED_DATA } from '../userOp-DKgjzz7B.js';
|
|
5
3
|
import { Address, Hex } from 'viem';
|
|
6
|
-
|
|
4
|
+
import { l as Call, I as Implementation, S as SmartAccountsEnvironment, m as DeployParams } from '../types-BLYWtcR3.js';
|
|
5
|
+
export { d as deploySmartAccountsEnvironment, o as overrideDeployedEnvironment } from '../smartAccountsEnvironment-egxuflDO.js';
|
|
7
6
|
export { DELEGATION_TYPEHASH } from '@metamask/delegation-core';
|
|
8
7
|
import '@metamask/delegation-abis';
|
|
9
8
|
import 'viem/account-abstraction';
|
package/dist/utils/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
encodeCalls,
|
|
4
4
|
encodeCallsForCaller,
|
|
5
5
|
getCounterfactualAccountData
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-WPVSFOQM.mjs";
|
|
7
7
|
import {
|
|
8
8
|
SIGNABLE_USER_OP_TYPED_DATA,
|
|
9
9
|
deploySmartAccountsEnvironment,
|
|
10
10
|
overrideDeployedEnvironment
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-QCULIK3O.mjs";
|
|
12
|
+
import "../chunk-WV2R7BXP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
encodeBatchExecution,
|
|
15
15
|
encodeExecutionCalldata,
|
|
@@ -18,21 +18,23 @@ import {
|
|
|
18
18
|
} from "../chunk-TPBFVDVM.mjs";
|
|
19
19
|
import {
|
|
20
20
|
CaveatBuilder,
|
|
21
|
+
DELEGATION_ABI_TYPE,
|
|
21
22
|
DELEGATION_ABI_TYPE_COMPONENTS,
|
|
22
23
|
DELEGATION_ARRAY_ABI_TYPE,
|
|
23
24
|
DELEGATION_TYPEHASH,
|
|
24
25
|
SIGNABLE_DELEGATION_TYPED_DATA,
|
|
25
26
|
createCaveatBuilder,
|
|
27
|
+
decodeDelegation,
|
|
26
28
|
decodeDelegations,
|
|
27
|
-
|
|
29
|
+
encodeDelegation,
|
|
28
30
|
encodeDelegations,
|
|
29
|
-
|
|
30
|
-
getDelegationHashOffchain,
|
|
31
|
+
hashDelegation,
|
|
31
32
|
toDelegation,
|
|
32
33
|
toDelegationStruct
|
|
33
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-C5ZEEH2Z.mjs";
|
|
34
35
|
export {
|
|
35
36
|
CaveatBuilder,
|
|
37
|
+
DELEGATION_ABI_TYPE,
|
|
36
38
|
DELEGATION_ABI_TYPE_COMPONENTS,
|
|
37
39
|
DELEGATION_ARRAY_ABI_TYPE,
|
|
38
40
|
DELEGATION_TYPEHASH,
|
|
@@ -40,19 +42,19 @@ export {
|
|
|
40
42
|
SIGNABLE_USER_OP_TYPED_DATA,
|
|
41
43
|
SIGNATURE_ABI_PARAMS,
|
|
42
44
|
createCaveatBuilder,
|
|
45
|
+
decodeDelegation,
|
|
43
46
|
decodeDelegations,
|
|
44
|
-
decodePermissionContexts,
|
|
45
47
|
deploySmartAccountsEnvironment,
|
|
46
48
|
encodeBatchExecution,
|
|
47
49
|
encodeCalls,
|
|
48
50
|
encodeCallsForCaller,
|
|
51
|
+
encodeDelegation,
|
|
49
52
|
encodeDelegations,
|
|
50
53
|
encodeExecutionCalldata,
|
|
51
54
|
encodeExecutionCalldatas,
|
|
52
|
-
encodePermissionContexts,
|
|
53
55
|
encodeSingleExecution,
|
|
54
56
|
getCounterfactualAccountData,
|
|
55
|
-
|
|
57
|
+
hashDelegation,
|
|
56
58
|
overrideDeployedEnvironment,
|
|
57
59
|
toDelegation,
|
|
58
60
|
toDelegationStruct
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/smart-accounts-kit",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Toolkit for managing and interacting with MetaMask Smart Accounts, built on Viem",
|
|
6
6
|
"license": "(MIT-0 OR Apache-2.0)",
|
|
@@ -106,13 +106,8 @@
|
|
|
106
106
|
"test:watch": "vitest watch",
|
|
107
107
|
"format": "prettier --write \"src/**/*.{ts,tsx}\" --ignore-path .prettierignore",
|
|
108
108
|
"lint": "yarn lint:eslint",
|
|
109
|
-
"lint:complete": "yarn lint:eslint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog",
|
|
110
|
-
"lint:changelog": "auto-changelog validate --prettier",
|
|
111
|
-
"lint:constraints": "yarn constraints",
|
|
112
|
-
"lint:dependencies": "depcheck && yarn dedupe",
|
|
113
109
|
"lint:eslint": "eslint . --cache --ext js,ts",
|
|
114
|
-
"lint:fix": "yarn lint:eslint --fix
|
|
115
|
-
"lint:misc": "prettier '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern"
|
|
110
|
+
"lint:fix": "yarn lint:eslint --fix"
|
|
116
111
|
},
|
|
117
112
|
"publishConfig": {
|
|
118
113
|
"access": "public",
|
|
@@ -131,8 +126,8 @@
|
|
|
131
126
|
"dependencies": {
|
|
132
127
|
"@metamask/7715-permission-types": "^0.5.0",
|
|
133
128
|
"@metamask/delegation-abis": "^0.12.0-beta.0",
|
|
134
|
-
"@metamask/delegation-core": "^0.
|
|
135
|
-
"@metamask/delegation-deployments": "^0.
|
|
129
|
+
"@metamask/delegation-core": "^0.4.0",
|
|
130
|
+
"@metamask/delegation-deployments": "^0.17.0",
|
|
136
131
|
"buffer": "^6.0.3",
|
|
137
132
|
"webauthn-p256": "^0.0.10"
|
|
138
133
|
},
|
|
@@ -147,7 +142,7 @@
|
|
|
147
142
|
"@types/sinon": "^17.0.3",
|
|
148
143
|
"@vitest/coverage-v8": "3.2.4",
|
|
149
144
|
"dotenv": "^16.3.1",
|
|
150
|
-
"eslint": "^9.
|
|
145
|
+
"eslint": "^9.39.2",
|
|
151
146
|
"eslint-config-prettier": "^9.1.0",
|
|
152
147
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
153
148
|
"eslint-plugin-import-x": "^4.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/write.ts","../src/smartAccountsEnvironment.ts","../src/userOp.ts"],"sourcesContent":["import { SimpleFactory, DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Chain, Hex, PublicClient, WalletClient } from 'viem';\n\nimport { encodePermissionContexts } from './delegation';\nimport type { ExecutionStruct, ExecutionMode } from './executions';\nimport { encodeExecutionCalldatas } from './executions';\nimport type { Delegation, ContractMetaData, Redemption } from './types';\n\n/**\n * Deploys a contract using the SimpleFactory contract.\n *\n * @param walletClient - The wallet client to use for deployment.\n * @param publicClient - The public client to use for simulation.\n * @param simpleFactoryAddress - The address of the SimpleFactory contract.\n * @param creationCode - The creation code for the contract to deploy.\n * @param salt - The salt to use for deterministic deployment.\n * @returns The transaction hash of the deployment.\n */\nexport const deployWithSimpleFactory = async (\n walletClient: WalletClient,\n publicClient: PublicClient,\n simpleFactoryAddress: Address,\n creationCode: Hex,\n salt: Hex,\n) => {\n const { request } = await publicClient.simulateContract({\n account: walletClient.account,\n address: simpleFactoryAddress,\n abi: SimpleFactory,\n functionName: 'deploy',\n args: [creationCode, salt],\n });\n return await walletClient.writeContract(request);\n};\n\n/**\n * Redeems a delegation to execute the provided executions.\n *\n * @param walletClient - The wallet client to use for redemption.\n * @param publicClient - The public client to use for simulation.\n * @param delegationManagerAddress - The address of the DelegationManager contract.\n * @param redemptions - The redemptions to execute, containing permission contexts, executions, and modes.\n * @returns The transaction hash of the redemption.\n */\nexport const redeemDelegations = async (\n walletClient: WalletClient,\n publicClient: PublicClient,\n delegationManagerAddress: Address,\n redemptions: Redemption[],\n) => {\n if (redemptions.length === 0) {\n throw new Error('RedeemDelegations invalid zero redemptions');\n }\n\n const permissionContexts: Delegation[][] = [];\n const executionsBatch: ExecutionStruct[][] = [];\n const executionModes: ExecutionMode[] = [];\n\n redemptions.forEach((redemption) => {\n permissionContexts.push(redemption.permissionContext);\n executionsBatch.push(redemption.executions);\n executionModes.push(redemption.mode);\n });\n\n const encodedPermissionContexts =\n encodePermissionContexts(permissionContexts);\n const executionCalldatas = encodeExecutionCalldatas(executionsBatch);\n\n const { request } = await publicClient.simulateContract({\n account: walletClient.account,\n address: delegationManagerAddress,\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [encodedPermissionContexts, executionModes, executionCalldatas],\n });\n return await walletClient.writeContract(request);\n};\n\n/**\n * Deploys a contract to the blockchain.\n *\n * @param walletClient - The wallet client to use for deployment.\n * @param publicClient - The public client to use for transaction receipt.\n * @param chain - The chain to deploy on.\n * @param contractMetadata - The metadata of the contract to deploy.\n * @param contractMetadata.bytecode - The bytecode of the contract to deploy.\n * @param contractMetadata.abi - The ABI of the contract to deploy.\n * @param args - The constructor arguments for the contract.\n * @returns An object containing the deployed contract address, transaction hash, and receipt.\n */\nexport async function deployContract(\n walletClient: WalletClient,\n publicClient: PublicClient,\n chain: Chain,\n { bytecode, abi }: ContractMetaData,\n args: any[] = [],\n) {\n if (!walletClient.account) {\n throw new Error('Wallet client account is required');\n }\n\n const hash = await walletClient.deployContract({\n abi,\n bytecode,\n args,\n account: walletClient.account,\n chain,\n });\n\n const receipt = await publicClient.waitForTransactionReceipt({\n hash,\n });\n\n if (!receipt.contractAddress) {\n throw new Error('No contract address in receipt');\n }\n\n return { address: receipt.contractAddress, hash, receipt };\n}\n","import {\n EntryPoint,\n SimpleFactory,\n DelegationManager,\n MultiSigDeleGator,\n HybridDeleGator,\n EIP7702StatelessDeleGator,\n SCL_RIP7212,\n AllowedTargetsEnforcer,\n AllowedMethodsEnforcer,\n DeployedEnforcer,\n TimestampEnforcer,\n NonceEnforcer,\n AllowedCalldataEnforcer,\n BlockNumberEnforcer,\n LimitedCallsEnforcer,\n ERC20BalanceChangeEnforcer,\n ERC20StreamingEnforcer,\n IdEnforcer,\n ERC20TransferAmountEnforcer,\n ValueLteEnforcer,\n NativeTokenTransferAmountEnforcer,\n NativeBalanceChangeEnforcer,\n NativeTokenStreamingEnforcer,\n NativeTokenPaymentEnforcer,\n RedeemerEnforcer,\n ArgsEqualityCheckEnforcer,\n ERC721BalanceChangeEnforcer,\n ERC721TransferEnforcer,\n ERC1155BalanceChangeEnforcer,\n OwnershipTransferEnforcer,\n SpecificActionERC20TransferBatchEnforcer,\n ERC20PeriodTransferEnforcer,\n NativeTokenPeriodTransferEnforcer,\n ExactCalldataBatchEnforcer,\n ExactCalldataEnforcer,\n ExactExecutionEnforcer,\n ExactExecutionBatchEnforcer,\n MultiTokenPeriodEnforcer,\n} from '@metamask/delegation-abis';\nimport {\n EntryPoint as EntryPointBytecode,\n SimpleFactory as SimpleFactoryBytecode,\n DelegationManager as DelegationManagerBytecode,\n MultiSigDeleGator as MultiSigDeleGatorBytecode,\n HybridDeleGator as HybridDeleGatorBytecode,\n EIP7702StatelessDeleGator as EIP7702StatelessDeleGatorBytecode,\n SCL_RIP7212 as SCLRIP7212Bytecode,\n AllowedTargetsEnforcer as AllowedTargetsEnforcerBytecode,\n AllowedMethodsEnforcer as AllowedMethodsEnforcerBytecode,\n DeployedEnforcer as DeployedEnforcerBytecode,\n TimestampEnforcer as TimestampEnforcerBytecode,\n NonceEnforcer as NonceEnforcerBytecode,\n AllowedCalldataEnforcer as AllowedCalldataEnforcerBytecode,\n BlockNumberEnforcer as BlockNumberEnforcerBytecode,\n LimitedCallsEnforcer as LimitedCallsEnforcerBytecode,\n ERC20BalanceChangeEnforcer as ERC20BalanceChangeEnforcerBytecode,\n ERC20StreamingEnforcer as ERC20StreamingEnforcerBytecode,\n IdEnforcer as IdEnforcerBytecode,\n ERC20TransferAmountEnforcer as ERC20TransferAmountEnforcerBytecode,\n ValueLteEnforcer as ValueLteEnforcerBytecode,\n NativeTokenTransferAmountEnforcer as NativeTokenTransferAmountEnforcerBytecode,\n NativeBalanceChangeEnforcer as NativeBalanceChangeEnforcerBytecode,\n NativeTokenStreamingEnforcer as NativeTokenStreamingEnforcerBytecode,\n NativeTokenPaymentEnforcer as NativeTokenPaymentEnforcerBytecode,\n RedeemerEnforcer as RedeemerEnforcerBytecode,\n ArgsEqualityCheckEnforcer as ArgsEqualityCheckEnforcerBytecode,\n ERC721BalanceChangeEnforcer as ERC721BalanceChangeEnforcerBytecode,\n ERC721TransferEnforcer as ERC721TransferEnforcerBytecode,\n ERC1155BalanceChangeEnforcer as ERC1155BalanceChangeEnforcerBytecode,\n OwnershipTransferEnforcer as OwnershipTransferEnforcerBytecode,\n SpecificActionERC20TransferBatchEnforcer as SpecificActionERC20TransferBatchEnforcerBytecode,\n ERC20PeriodTransferEnforcer as ERC20PeriodTransferEnforcerBytecode,\n NativeTokenPeriodTransferEnforcer as NativeTokenPeriodTransferEnforcerBytecode,\n ExactCalldataBatchEnforcer as ExactCalldataBatchEnforcerBytecode,\n ExactCalldataEnforcer as ExactCalldataEnforcerBytecode,\n ExactExecutionEnforcer as ExactExecutionEnforcerBytecode,\n ExactExecutionBatchEnforcer as ExactExecutionBatchEnforcerBytecode,\n MultiTokenPeriodEnforcer as MultiTokenPeriodEnforcerBytecode,\n} from '@metamask/delegation-abis/bytecode';\nimport { DELEGATOR_CONTRACTS } from '@metamask/delegation-deployments';\nimport type { Chain, Hex, PublicClient, WalletClient } from 'viem';\n\nimport type { ContractMetaData, SmartAccountsEnvironment } from './types';\nimport { deployContract } from './write';\n\ntype SupportedVersion = '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0';\nexport const PREFERRED_VERSION: SupportedVersion = '1.3.0';\n\nconst contractOverrideMap: Map<string, SmartAccountsEnvironment> = new Map();\n\nconst getContractOverrideKey = (chainId: number, version: SupportedVersion) =>\n `${version}:${chainId}`;\n\n/**\n * Overrides the default environment for a specific chain and version.\n *\n * @param chainId - The chain ID to override.\n * @param version - The version of the environment to override.\n * @param environment - The environment to use as override.\n */\nexport function overrideDeployedEnvironment(\n chainId: number,\n version: SupportedVersion,\n environment: SmartAccountsEnvironment,\n) {\n contractOverrideMap.set(\n getContractOverrideKey(chainId, version),\n environment,\n );\n}\n\n/**\n * Gets the SmartAccountsEnvironment for the specified chain and version.\n *\n * @param chainId - The chain ID to get the environment for.\n * @param version - The version of the environment to get.\n * @returns The SmartAccountsEnvironment.\n */\nexport function getSmartAccountsEnvironment(\n chainId: number,\n version: SupportedVersion = PREFERRED_VERSION,\n): SmartAccountsEnvironment {\n const overrideKey = getContractOverrideKey(chainId, version);\n\n const overriddenContracts = contractOverrideMap.get(overrideKey);\n if (overriddenContracts) {\n return overriddenContracts;\n }\n\n const contracts = DELEGATOR_CONTRACTS[version]?.[chainId];\n if (!contracts) {\n throw new Error(\n `No contracts found for version ${version} chain ${chainId}`,\n );\n }\n return getSmartAccountsEnvironmentV1(contracts);\n}\n\n/**\n * Creates a SmartAccountsEnvironment from contract addresses.\n *\n * @param contracts - The contract addresses to create the environment from.\n * @returns The created SmartAccountsEnvironment.\n */\nexport function getSmartAccountsEnvironmentV1(contracts: {\n [contract: string]: Hex;\n}) {\n return {\n DelegationManager: contracts.DelegationManager,\n EntryPoint: contracts.EntryPoint,\n SimpleFactory: contracts.SimpleFactory,\n implementations: {\n MultiSigDeleGatorImpl: contracts.MultiSigDeleGatorImpl,\n HybridDeleGatorImpl: contracts.HybridDeleGatorImpl,\n EIP7702StatelessDeleGatorImpl: contracts.EIP7702StatelessDeleGatorImpl,\n },\n caveatEnforcers: {\n AllowedCalldataEnforcer: contracts.AllowedCalldataEnforcer,\n AllowedMethodsEnforcer: contracts.AllowedMethodsEnforcer,\n AllowedTargetsEnforcer: contracts.AllowedTargetsEnforcer,\n ArgsEqualityCheckEnforcer: contracts.ArgsEqualityCheckEnforcer,\n BlockNumberEnforcer: contracts.BlockNumberEnforcer,\n DeployedEnforcer: contracts.DeployedEnforcer,\n ERC20BalanceChangeEnforcer: contracts.ERC20BalanceChangeEnforcer,\n ERC20TransferAmountEnforcer: contracts.ERC20TransferAmountEnforcer,\n ERC20StreamingEnforcer: contracts.ERC20StreamingEnforcer,\n ERC721BalanceChangeEnforcer: contracts.ERC721BalanceChangeEnforcer,\n ERC721TransferEnforcer: contracts.ERC721TransferEnforcer,\n ERC1155BalanceChangeEnforcer: contracts.ERC1155BalanceChangeEnforcer,\n IdEnforcer: contracts.IdEnforcer,\n LimitedCallsEnforcer: contracts.LimitedCallsEnforcer,\n NonceEnforcer: contracts.NonceEnforcer,\n TimestampEnforcer: contracts.TimestampEnforcer,\n ValueLteEnforcer: contracts.ValueLteEnforcer,\n NativeTokenTransferAmountEnforcer:\n contracts.NativeTokenTransferAmountEnforcer,\n NativeBalanceChangeEnforcer: contracts.NativeBalanceChangeEnforcer,\n NativeTokenStreamingEnforcer: contracts.NativeTokenStreamingEnforcer,\n NativeTokenPaymentEnforcer: contracts.NativeTokenPaymentEnforcer,\n OwnershipTransferEnforcer: contracts.OwnershipTransferEnforcer,\n RedeemerEnforcer: contracts.RedeemerEnforcer,\n SpecificActionERC20TransferBatchEnforcer:\n contracts.SpecificActionERC20TransferBatchEnforcer,\n ERC20PeriodTransferEnforcer: contracts.ERC20PeriodTransferEnforcer,\n NativeTokenPeriodTransferEnforcer:\n contracts.NativeTokenPeriodTransferEnforcer,\n ExactCalldataBatchEnforcer: contracts.ExactCalldataBatchEnforcer,\n ExactCalldataEnforcer: contracts.ExactCalldataEnforcer,\n ExactExecutionEnforcer: contracts.ExactExecutionEnforcer,\n ExactExecutionBatchEnforcer: contracts.ExactExecutionBatchEnforcer,\n MultiTokenPeriodEnforcer: contracts.MultiTokenPeriodEnforcer,\n },\n } as SmartAccountsEnvironment;\n}\n\nexport type DeployedContract = {\n name: string;\n address: string;\n};\n\n/**\n * Deploys the contracts needed for the Delegation Framework and MetaMask SCA to be functional as well as all Caveat Enforcers.\n *\n * @param walletClient - The wallet client to use for deployment.\n * @param publicClient - The public client to use for deployment.\n * @param chain - The chain to deploy to.\n * @param deployedContracts - Optional map of already deployed contracts.\n * @returns A promise that resolves to the SmartAccountsEnvironment.\n */\nexport async function deploySmartAccountsEnvironment(\n walletClient: WalletClient,\n publicClient: PublicClient,\n chain: Chain,\n deployedContracts: { [contract: string]: Hex } = {},\n) {\n const deployContractCurried = async (\n name: string,\n contract: ContractMetaData,\n params: any[] = [],\n ) => {\n const existingAddress = deployedContracts[name];\n if (existingAddress) {\n return {\n address: existingAddress,\n name,\n };\n }\n\n const deployedContract = await deployContract(\n walletClient,\n publicClient,\n chain,\n contract,\n params,\n );\n\n const newDeployedContracts = { ...deployedContracts };\n newDeployedContracts[name] = deployedContract.address;\n Object.assign(deployedContracts, newDeployedContracts);\n\n return { ...deployedContract, name };\n };\n\n // Deploy v1.3.0 DeleGator contracts\n // - deploy standalone contracts\n const standaloneContracts = {\n SimpleFactory: {\n abi: SimpleFactory,\n bytecode: SimpleFactoryBytecode,\n },\n AllowedCalldataEnforcer: {\n abi: AllowedCalldataEnforcer,\n bytecode: AllowedCalldataEnforcerBytecode,\n },\n AllowedTargetsEnforcer: {\n abi: AllowedTargetsEnforcer,\n bytecode: AllowedTargetsEnforcerBytecode,\n },\n AllowedMethodsEnforcer: {\n abi: AllowedMethodsEnforcer,\n bytecode: AllowedMethodsEnforcerBytecode,\n },\n ArgsEqualityCheckEnforcer: {\n abi: ArgsEqualityCheckEnforcer,\n bytecode: ArgsEqualityCheckEnforcerBytecode,\n },\n DeployedEnforcer: {\n abi: DeployedEnforcer,\n bytecode: DeployedEnforcerBytecode,\n },\n TimestampEnforcer: {\n abi: TimestampEnforcer,\n bytecode: TimestampEnforcerBytecode,\n },\n BlockNumberEnforcer: {\n abi: BlockNumberEnforcer,\n bytecode: BlockNumberEnforcerBytecode,\n },\n LimitedCallsEnforcer: {\n abi: LimitedCallsEnforcer,\n bytecode: LimitedCallsEnforcerBytecode,\n },\n ERC20BalanceChangeEnforcer: {\n abi: ERC20BalanceChangeEnforcer,\n bytecode: ERC20BalanceChangeEnforcerBytecode,\n },\n ERC20TransferAmountEnforcer: {\n abi: ERC20TransferAmountEnforcer,\n bytecode: ERC20TransferAmountEnforcerBytecode,\n },\n ERC20StreamingEnforcer: {\n abi: ERC20StreamingEnforcer,\n bytecode: ERC20StreamingEnforcerBytecode,\n },\n ERC721BalanceChangeEnforcer: {\n abi: ERC721BalanceChangeEnforcer,\n bytecode: ERC721BalanceChangeEnforcerBytecode,\n },\n ERC721TransferEnforcer: {\n abi: ERC721TransferEnforcer,\n bytecode: ERC721TransferEnforcerBytecode,\n },\n ERC1155BalanceChangeEnforcer: {\n abi: ERC1155BalanceChangeEnforcer,\n bytecode: ERC1155BalanceChangeEnforcerBytecode,\n },\n IdEnforcer: { abi: IdEnforcer, bytecode: IdEnforcerBytecode },\n NonceEnforcer: {\n abi: NonceEnforcer,\n bytecode: NonceEnforcerBytecode,\n },\n ValueLteEnforcer: {\n abi: ValueLteEnforcer,\n bytecode: ValueLteEnforcerBytecode,\n },\n NativeTokenTransferAmountEnforcer: {\n abi: NativeTokenTransferAmountEnforcer,\n bytecode: NativeTokenTransferAmountEnforcerBytecode,\n },\n NativeBalanceChangeEnforcer: {\n abi: NativeBalanceChangeEnforcer,\n bytecode: NativeBalanceChangeEnforcerBytecode,\n },\n NativeTokenStreamingEnforcer: {\n abi: NativeTokenStreamingEnforcer,\n bytecode: NativeTokenStreamingEnforcerBytecode,\n },\n OwnershipTransferEnforcer: {\n abi: OwnershipTransferEnforcer,\n bytecode: OwnershipTransferEnforcerBytecode,\n },\n RedeemerEnforcer: {\n abi: RedeemerEnforcer,\n bytecode: RedeemerEnforcerBytecode,\n },\n SpecificActionERC20TransferBatchEnforcer: {\n abi: SpecificActionERC20TransferBatchEnforcer,\n bytecode: SpecificActionERC20TransferBatchEnforcerBytecode,\n },\n ERC20PeriodTransferEnforcer: {\n abi: ERC20PeriodTransferEnforcer,\n bytecode: ERC20PeriodTransferEnforcerBytecode,\n },\n NativeTokenPeriodTransferEnforcer: {\n abi: NativeTokenPeriodTransferEnforcer,\n bytecode: NativeTokenPeriodTransferEnforcerBytecode,\n },\n ExactCalldataBatchEnforcer: {\n abi: ExactCalldataBatchEnforcer,\n bytecode: ExactCalldataBatchEnforcerBytecode,\n },\n ExactCalldataEnforcer: {\n abi: ExactCalldataEnforcer,\n bytecode: ExactCalldataEnforcerBytecode,\n },\n ExactExecutionEnforcer: {\n abi: ExactExecutionEnforcer,\n bytecode: ExactExecutionEnforcerBytecode,\n },\n ExactExecutionBatchEnforcer: {\n abi: ExactExecutionBatchEnforcer,\n bytecode: ExactExecutionBatchEnforcerBytecode,\n },\n MultiTokenPeriodEnforcer: {\n abi: MultiTokenPeriodEnforcer,\n bytecode: MultiTokenPeriodEnforcerBytecode,\n },\n };\n for (const [name, contract] of Object.entries(standaloneContracts)) {\n await deployContractCurried(name, contract);\n }\n\n // - deploy dependencies\n const delegationManager = await deployContractCurried(\n 'DelegationManager',\n { abi: DelegationManager, bytecode: DelegationManagerBytecode },\n [walletClient.account?.address],\n );\n\n // - NativeTokenPaymentEnforcer DelegationManager and ArgsEqualityCheckEnforcer as constructor args\n await deployContractCurried(\n 'NativeTokenPaymentEnforcer',\n {\n abi: NativeTokenPaymentEnforcer,\n bytecode: NativeTokenPaymentEnforcerBytecode,\n },\n [delegationManager.address, deployedContracts.ArgsEqualityCheckEnforcer],\n );\n\n const entryPoint = await deployContractCurried('EntryPoint', {\n abi: EntryPoint,\n bytecode: EntryPointBytecode,\n });\n\n // This is a hack to work around the SCL_RIP7212 being deployed as a library.\n // Forge handles this gracefully, but in the tests we need to manually link\n // the library.\n // We don't use the curried function here because we don't need it added to\n // the environment.\n const { address: sclRIP7212 } = await deployContract(\n walletClient,\n publicClient,\n chain,\n { abi: SCL_RIP7212, bytecode: SCLRIP7212Bytecode },\n [],\n );\n\n // replace linked library address in bytecode https://docs.soliditylang.org/en/latest/using-the-compiler.html#library-linking\n const hybridDeleGatorWithLinkedLibrary = {\n abi: HybridDeleGator,\n bytecode: HybridDeleGatorBytecode.replace(\n /__\\$b8f96b288d4d0429e38b8ed50fd423070f\\$__/gu,\n sclRIP7212.slice(2),\n ) as Hex,\n };\n\n // - deploy DeleGator implementations\n await deployContractCurried(\n 'HybridDeleGatorImpl',\n hybridDeleGatorWithLinkedLibrary,\n [delegationManager.address, entryPoint.address],\n );\n\n await deployContractCurried(\n 'MultiSigDeleGatorImpl',\n {\n abi: MultiSigDeleGator,\n bytecode: MultiSigDeleGatorBytecode,\n },\n [delegationManager.address, entryPoint.address],\n );\n\n await deployContractCurried(\n 'EIP7702StatelessDeleGatorImpl',\n {\n abi: EIP7702StatelessDeleGator,\n bytecode: EIP7702StatelessDeleGatorBytecode,\n },\n [delegationManager.address, entryPoint.address],\n );\n\n // Format deployments\n return getSmartAccountsEnvironmentV1(deployedContracts);\n}\n","import { concat, encodeAbiParameters, keccak256, pad, toHex } from 'viem';\nimport type { Address, Hex, TypedData } from 'viem';\nimport { toPackedUserOperation } from 'viem/account-abstraction';\nimport { signTypedData } from 'viem/accounts';\n\nimport type { OptionalUserOpProps, PackedUserOperationStruct } from './types';\n\n// v7 off-chain user operation, hexlified incoming data from rpc call\nexport type UserOperationV07Hexlify = {\n sender: Hex;\n nonce: Hex;\n factory?: Hex;\n factoryData?: Hex;\n callData: Hex;\n callGasLimit: Hex;\n\n verificationGasLimit: Hex;\n preVerificationGas: Hex;\n maxFeePerGas: Hex;\n maxPriorityFeePerGas: Hex;\n\n paymaster?: Hex;\n paymasterVerificationGasLimit?: Hex;\n paymasterPostOpGasLimit?: Hex;\n paymasterData?: Hex;\n\n signature: Hex;\n};\n\n// v7 off-chain user operation with BigInt fields\nexport type UserOperationV07 = {\n sender: Hex;\n nonce: bigint;\n factory?: Hex;\n factoryData?: Hex;\n callData: Hex;\n\n callGasLimit: bigint;\n verificationGasLimit: bigint;\n preVerificationGas: bigint;\n maxFeePerGas: bigint;\n maxPriorityFeePerGas: bigint;\n\n paymaster?: Hex;\n paymasterVerificationGasLimit?: bigint;\n paymasterPostOpGasLimit?: bigint;\n paymasterData?: Hex;\n\n signature: Hex;\n};\n\n/**\n * Creates a raw user operation data structure.\n *\n * @param sender - The smart account taking some action.\n * @param nonce - A nonce, ideally fetched from the Entry Point.\n * @param callData - Calldata to invoke on some contract.\n * @param signature - The signature for the user operation.\n * @param options - Optional properties for the user operation.\n * @returns The created raw user operation data structure.\n */\nexport const createRawUserOp = (\n sender: Hex,\n nonce: bigint,\n callData: Hex,\n signature: Hex = '0x',\n options?: OptionalUserOpProps,\n): UserOperationV07 => ({\n sender,\n nonce,\n callData,\n factory: options?.factory,\n factoryData: options?.factoryData,\n callGasLimit: options?.callGasLimit ?? 0n,\n verificationGasLimit: options?.verificationGasLimit ?? 0n,\n preVerificationGas: options?.preVerificationGas ?? 0n,\n maxFeePerGas: options?.maxFeePerGas ?? 0n,\n maxPriorityFeePerGas: options?.maxPriorityFeePerGas ?? 0n,\n paymaster: options?.paymaster,\n paymasterVerificationGasLimit: options?.paymasterVerificationGasLimit,\n paymasterPostOpGasLimit: options?.paymasterPostOpGasLimit,\n paymasterData: options?.paymasterData,\n signature,\n});\n\n// //////////////////////////////////////////////////////////////////////////////////////\n\n// TODO: These userOp functions are duplicated in ./apps/ew-client/src/utils/userOpBuilder.ts. We should move them to a shared location along with test(./apps/ew-client/test/UserOpBuilder.test.ts) to avoid duplication\n/**\n * Generates a salt value for address derivation.\n *\n * @param salt - Optional salt value.\n * @returns The chosen salt value.\n */\nexport const getSalt = (salt?: Hex): Hex => {\n return salt ?? '0x0';\n};\n\nexport const getPaymasterAndData = (userOp: UserOperationV07): Hex => {\n let paymasterAndData: Hex;\n if (userOp.paymaster) {\n paymasterAndData = concat([\n userOp.paymaster,\n pad(toHex(userOp.paymasterVerificationGasLimit ?? 0n), {\n size: 16,\n }),\n pad(toHex(userOp.paymasterPostOpGasLimit ?? 0n), {\n size: 16,\n }),\n userOp.paymasterData ?? '0x',\n ]);\n } else {\n paymasterAndData = '0x';\n }\n\n return paymasterAndData;\n};\n\nexport const getInitCode = (userOp: UserOperationV07): Hex => {\n return userOp.factory\n ? concat([userOp.factory, userOp.factoryData ?? ('0x' as Hex)])\n : '0x';\n};\n\nexport const getAccountGasLimits = (userOp: UserOperationV07): Hex => {\n return concat([\n pad(toHex(userOp.verificationGasLimit), {\n size: 16,\n }),\n pad(toHex(userOp.callGasLimit), { size: 16 }),\n ]);\n};\n\nexport const getGasFees = (userOp: UserOperationV07): Hex => {\n return concat([\n pad(toHex(userOp.maxPriorityFeePerGas), {\n size: 16,\n }),\n pad(toHex(userOp.maxFeePerGas), { size: 16 }),\n ]);\n};\n\n/**\n * Packs a user operation into a `PackedUserOperationStruct` object.\n *\n * @param userOp - The user operation to pack.\n * @returns The packed user operation.\n */\nexport const packUserOp = (\n userOp: UserOperationV07,\n): PackedUserOperationStruct => {\n const packedOp = {\n sender: userOp.sender,\n nonce: BigInt(userOp.nonce),\n initCode: getInitCode(userOp),\n callData: userOp.callData,\n accountGasLimits: getAccountGasLimits(userOp),\n preVerificationGas: BigInt(userOp.preVerificationGas),\n gasFees: getGasFees(userOp),\n paymasterAndData: getPaymasterAndData(userOp),\n signature: userOp.signature,\n };\n\n return packedOp;\n};\n\n/**\n * Calculates the user operation hash for a given packed user operation.\n *\n * @param packedOp - The packed user operation.\n * @param entryPoint - The entry point address.\n * @param chainId - The chain ID.\n * @returns The user operation hash.\n */\nexport const createUserOpHashV07 = (\n packedOp: PackedUserOperationStruct,\n entryPoint: Hex,\n chainId: bigint,\n) => {\n const hash = keccak256(\n encodeAbiParameters(\n [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'nonce',\n type: 'uint256',\n },\n {\n name: 'initCodeHash',\n type: 'bytes32',\n },\n {\n name: 'callDataHash',\n type: 'bytes32',\n },\n {\n name: 'accountGasLimits',\n type: 'bytes32',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n {\n name: 'gasFees',\n type: 'bytes32',\n },\n {\n name: 'paymasterAndDataHash',\n type: 'bytes32',\n },\n ],\n [\n packedOp.sender,\n packedOp.nonce,\n keccak256(packedOp.initCode),\n keccak256(packedOp.callData),\n packedOp.accountGasLimits,\n packedOp.preVerificationGas,\n packedOp.gasFees,\n keccak256(packedOp.paymasterAndData),\n ],\n ),\n );\n\n return keccak256(\n encodeAbiParameters(\n [\n {\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n name: 'entryPointAddress',\n type: 'address',\n },\n {\n name: 'chainId',\n type: 'uint256',\n },\n ],\n [hash, entryPoint, chainId],\n ),\n );\n};\n\nexport const SIGNABLE_USER_OP_TYPED_DATA: TypedData = {\n PackedUserOperation: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n { name: 'accountGasLimits', type: 'bytes32' },\n { name: 'preVerificationGas', type: 'uint256' },\n { name: 'gasFees', type: 'bytes32' },\n { name: 'paymasterAndData', type: 'bytes' },\n { name: 'entryPoint', type: 'address' },\n ],\n} as const;\n\n/**\n * Prepares typed data for user operation signing.\n * This is an internal helper function that's not exposed in the public API.\n *\n * @param params - The parameters for preparing the typed data.\n * @param params.userOperation - The user operation to prepare for signing.\n * @param params.entryPoint - The entry point contract address.\n * @param params.entryPoint.address - The address of the entry point contract.\n * @param params.chainId - The chain ID that the entry point is deployed on.\n * @param params.name - The name of the domain of the implementation contract.\n * @param params.version - The version of the domain of the implementation contract.\n * @param params.address - The address of the smart account.\n * @returns The prepared typed data for signing.\n */\nexport const prepareSignUserOperationTypedData = ({\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version = '1',\n}: {\n userOperation: Omit<UserOperationV07, 'signature'>;\n entryPoint: { address: Address };\n chainId: number;\n name: 'HybridDeleGator' | 'MultiSigDeleGator';\n address: Address;\n version?: string;\n}) => {\n const packedUserOp = toPackedUserOperation({\n ...userOperation,\n signature: '0x',\n });\n\n return {\n domain: {\n chainId,\n name,\n version,\n verifyingContract: address,\n },\n types: SIGNABLE_USER_OP_TYPED_DATA,\n primaryType: 'PackedUserOperation' as const,\n message: { ...packedUserOp, entryPoint: entryPoint.address },\n };\n};\n\n/**\n * Signs a user operation using a private key.\n *\n * @param params - The parameters for signing the user operation.\n * @param params.privateKey - The private key to use for signing.\n * @param params.userOperation - The user operation to sign.\n * @param params.entryPoint - The entry point contract address.\n * @param params.chainId - The chain ID that the entry point is deployed on.\n * @param params.name - The name of the domain of the implementation contract.\n * @param params.version - The version of the domain of the implementation contract.\n * @param params.address - The address of the smart account.\n * @param params.entryPoint.address - The address of the entry point contract.\n * @returns The signature of the user operation.\n */\nexport const signUserOperation = async ({\n privateKey,\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version = '1',\n}: {\n privateKey: Hex;\n userOperation: Omit<UserOperationV07, 'signature'>;\n entryPoint: { address: Address };\n chainId: number;\n address: Address;\n name: 'HybridDeleGator' | 'MultiSigDeleGator';\n version?: string;\n}) => {\n const typedData = prepareSignUserOperationTypedData({\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version,\n });\n\n return signTypedData({\n privateKey,\n ...typedData,\n });\n};\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe,yBAAyB;AA4C1C,IAAM,oBAAoB,OAC/B,cACA,cACA,0BACA,gBACG;AACH,MAAI,YAAY,WAAW,GAAG;AAC5B,UAAM,IAAI,MAAM,4CAA4C;AAAA,EAC9D;AAEA,QAAM,qBAAqC,CAAC;AAC5C,QAAM,kBAAuC,CAAC;AAC9C,QAAM,iBAAkC,CAAC;AAEzC,cAAY,QAAQ,CAAC,eAAe;AAClC,uBAAmB,KAAK,WAAW,iBAAiB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