@metamask/smart-accounts-kit 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -24
- package/dist/actions/index.cjs +9 -6
- package/dist/actions/index.cjs.map +1 -1
- package/dist/actions/index.d.cts +5 -3
- package/dist/actions/index.d.ts +5 -3
- package/dist/actions/index.mjs +8 -5
- package/dist/{caveats-BhjGBVHX.d.ts → caveats-B2OssjV4.d.ts} +1 -2
- package/dist/{caveats-CeHBbmt_.d.cts → caveats-gqMBZKkI.d.cts} +1 -2
- package/dist/{chunk-SOFB2MXG.cjs → chunk-2OS36DVV.cjs} +8 -1
- package/dist/chunk-2OS36DVV.cjs.map +1 -0
- package/dist/{chunk-6CEOFJY5.cjs → chunk-2ZOWIAP3.cjs} +266 -114
- package/dist/chunk-2ZOWIAP3.cjs.map +1 -0
- package/dist/{chunk-R2WT54GZ.mjs → chunk-AZYTTGON.mjs} +214 -62
- package/dist/chunk-AZYTTGON.mjs.map +1 -0
- package/dist/{chunk-MVBU3LRV.cjs → chunk-DCI2AN4N.cjs} +15 -17
- package/dist/chunk-DCI2AN4N.cjs.map +1 -0
- package/dist/{chunk-RR2AMG4A.cjs → chunk-EPU4O7FY.cjs} +158 -151
- package/dist/chunk-EPU4O7FY.cjs.map +1 -0
- package/dist/{chunk-QCULIK3O.mjs → chunk-GMGJRC3D.mjs} +8 -1
- package/dist/chunk-GMGJRC3D.mjs.map +1 -0
- package/dist/chunk-IMO6XNDJ.mjs +14 -0
- package/dist/chunk-IMO6XNDJ.mjs.map +1 -0
- package/dist/chunk-IQT6XFDT.cjs +14 -0
- package/dist/chunk-IQT6XFDT.cjs.map +1 -0
- package/dist/{chunk-SO5JAXGD.cjs → chunk-JKVSTPEC.cjs} +200 -18
- package/dist/chunk-JKVSTPEC.cjs.map +1 -0
- package/dist/{chunk-DVJX76J3.mjs → chunk-K7GTZGKJ.mjs} +2 -2
- package/dist/{chunk-HQHXGWNJ.mjs → chunk-L3EZCIY6.mjs} +67 -60
- package/dist/chunk-L3EZCIY6.mjs.map +1 -0
- package/dist/{chunk-XZ7UMCG3.cjs → chunk-PQPAEHJZ.cjs} +12 -12
- package/dist/{chunk-XZ7UMCG3.cjs.map → chunk-PQPAEHJZ.cjs.map} +1 -1
- package/dist/{chunk-EEIIVBNV.mjs → chunk-TNGQTVSY.mjs} +225 -53
- package/dist/chunk-TNGQTVSY.mjs.map +1 -0
- package/dist/{chunk-FG2CQGSE.mjs → chunk-UJQ3JN3U.mjs} +4 -6
- package/dist/{chunk-FG2CQGSE.mjs.map → chunk-UJQ3JN3U.mjs.map} +1 -1
- package/dist/{chunk-TMO23YRP.cjs → chunk-W6HPAK4M.cjs} +262 -90
- package/dist/chunk-W6HPAK4M.cjs.map +1 -0
- package/dist/{chunk-ZGBFPD4O.mjs → chunk-YVU66KSH.mjs} +188 -6
- package/dist/chunk-YVU66KSH.mjs.map +1 -0
- package/dist/contracts/index.cjs +5 -6
- package/dist/contracts/index.cjs.map +1 -1
- package/dist/contracts/index.d.cts +4 -3
- package/dist/contracts/index.d.ts +4 -3
- package/dist/contracts/index.mjs +4 -5
- package/dist/decodeRevertReason-CmmCpmZ_.d.cts +72 -0
- package/dist/decodeRevertReason-dOTpJx2h.d.ts +72 -0
- package/dist/experimental/index.cjs +364 -9
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/index.d.cts +39 -3
- package/dist/experimental/index.d.ts +39 -3
- package/dist/experimental/index.mjs +357 -2
- package/dist/experimental/index.mjs.map +1 -1
- package/dist/index-B1Cmezvh.d.cts +61 -0
- package/dist/{index-DRKgDSZW.d.ts → index-BkgdU4LI.d.ts} +99 -92
- package/dist/{index-Cg-JakqA.d.ts → index-DUJmm8Wz.d.ts} +46 -5
- package/dist/{index-DzL9ccjU.d.cts → index-Dv4jPzhe.d.cts} +99 -92
- package/dist/index-LqiEgBjV.d.ts +61 -0
- package/dist/{index-BToRQKyJ.d.cts → index-X7Qn3JTg.d.cts} +46 -5
- package/dist/index.cjs +22 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.mjs +9 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{delegation-CR99q1-n.d.ts → resolveCaveats-A9xC29l8.d.cts} +160 -111
- package/dist/{delegation-DoVULGYE.d.cts → resolveCaveats-A9xC29l8.d.ts} +160 -111
- package/dist/utils/index.cjs +13 -6
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +8 -4
- package/dist/utils/index.d.ts +8 -4
- package/dist/utils/index.mjs +16 -9
- package/package.json +7 -6
- package/dist/chunk-4QXIOE7F.mjs +0 -79
- package/dist/chunk-4QXIOE7F.mjs.map +0 -1
- package/dist/chunk-6CEOFJY5.cjs.map +0 -1
- package/dist/chunk-EEIIVBNV.mjs.map +0 -1
- package/dist/chunk-HQHXGWNJ.mjs.map +0 -1
- package/dist/chunk-MOHCTPYQ.cjs +0 -79
- package/dist/chunk-MOHCTPYQ.cjs.map +0 -1
- package/dist/chunk-MVBU3LRV.cjs.map +0 -1
- package/dist/chunk-QCULIK3O.mjs.map +0 -1
- package/dist/chunk-R2WT54GZ.mjs.map +0 -1
- package/dist/chunk-RR2AMG4A.cjs.map +0 -1
- package/dist/chunk-SO5JAXGD.cjs.map +0 -1
- package/dist/chunk-SOFB2MXG.cjs.map +0 -1
- package/dist/chunk-TMO23YRP.cjs.map +0 -1
- package/dist/chunk-ZGBFPD4O.mjs.map +0 -1
- package/dist/types-BWaH4KH1.d.cts +0 -155
- package/dist/types-BWaH4KH1.d.ts +0 -155
- /package/dist/{chunk-DVJX76J3.mjs.map → chunk-K7GTZGKJ.mjs.map} +0 -0
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
MultiTokenPeriodEnforcer_exports,
|
|
5
5
|
NativeTokenPeriodTransferEnforcer_exports,
|
|
6
6
|
NativeTokenStreamingEnforcer_exports
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-K7GTZGKJ.mjs";
|
|
8
8
|
import {
|
|
9
|
+
decodeRevertReason,
|
|
9
10
|
encodeProxyCreationCode,
|
|
10
11
|
encode_exports,
|
|
11
12
|
encode_exports2,
|
|
@@ -38,17 +39,15 @@ import {
|
|
|
38
39
|
simulate7,
|
|
39
40
|
simulate8,
|
|
40
41
|
simulate9
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import {
|
|
43
|
-
encodeExecutionCalldatas
|
|
44
|
-
} from "./chunk-4QXIOE7F.mjs";
|
|
42
|
+
} from "./chunk-YVU66KSH.mjs";
|
|
45
43
|
import {
|
|
46
44
|
ANY_BENEFICIARY,
|
|
47
45
|
ROOT_AUTHORITY,
|
|
48
46
|
__export,
|
|
49
47
|
encodeDelegations,
|
|
48
|
+
encodeExecutionCalldatas,
|
|
50
49
|
toDelegationStruct
|
|
51
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-TNGQTVSY.mjs";
|
|
52
51
|
|
|
53
52
|
// src/contracts/index.ts
|
|
54
53
|
var contracts_exports = {};
|
|
@@ -82,6 +81,7 @@ __export(contracts_exports, {
|
|
|
82
81
|
var DelegationManager_exports = {};
|
|
83
82
|
__export(DelegationManager_exports, {
|
|
84
83
|
constants: () => constants_exports,
|
|
84
|
+
decode: () => decode_exports,
|
|
85
85
|
encode: () => encode_exports5,
|
|
86
86
|
execute: () => execute_exports,
|
|
87
87
|
read: () => read_exports2,
|
|
@@ -101,53 +101,76 @@ var NAME = "DelegationManager";
|
|
|
101
101
|
var VERSION = "1.3.0";
|
|
102
102
|
var DOMAIN_VERSION = "1";
|
|
103
103
|
|
|
104
|
-
// src/DelegationFramework/DelegationManager/
|
|
105
|
-
var
|
|
106
|
-
__export(
|
|
107
|
-
|
|
108
|
-
enableDelegation: () => encode2,
|
|
109
|
-
redeemDelegations: () => encode3
|
|
104
|
+
// src/DelegationFramework/DelegationManager/decode.ts
|
|
105
|
+
var decode_exports = {};
|
|
106
|
+
__export(decode_exports, {
|
|
107
|
+
redeemDelegationsError: () => decodeError
|
|
110
108
|
});
|
|
111
109
|
|
|
112
|
-
// src/DelegationFramework/DelegationManager/methods/
|
|
110
|
+
// src/DelegationFramework/DelegationManager/methods/redeemDelegations.ts
|
|
113
111
|
import { DelegationManager } from "@metamask/delegation-abis";
|
|
114
112
|
import { encodeFunctionData } from "viem";
|
|
115
113
|
import { simulateContract, writeContract } from "viem/actions";
|
|
116
114
|
var simulate19 = async ({
|
|
117
115
|
client,
|
|
118
116
|
delegationManagerAddress,
|
|
119
|
-
|
|
117
|
+
delegations,
|
|
118
|
+
modes,
|
|
119
|
+
executions
|
|
120
120
|
}) => {
|
|
121
|
-
const delegationStruct = toDelegationStruct(delegation);
|
|
122
121
|
return simulateContract(client, {
|
|
123
122
|
address: delegationManagerAddress,
|
|
124
123
|
abi: DelegationManager,
|
|
125
|
-
functionName: "
|
|
126
|
-
args: [
|
|
124
|
+
functionName: "redeemDelegations",
|
|
125
|
+
args: [
|
|
126
|
+
delegations.map((delegationChain) => encodeDelegations(delegationChain)),
|
|
127
|
+
modes,
|
|
128
|
+
encodeExecutionCalldatas(executions)
|
|
129
|
+
]
|
|
127
130
|
});
|
|
128
131
|
};
|
|
129
132
|
var execute7 = async ({
|
|
130
133
|
client,
|
|
131
134
|
delegationManagerAddress,
|
|
132
|
-
|
|
135
|
+
delegations,
|
|
136
|
+
modes,
|
|
137
|
+
executions
|
|
133
138
|
}) => {
|
|
134
139
|
const { request } = await simulate19({
|
|
135
140
|
client,
|
|
136
141
|
delegationManagerAddress,
|
|
137
|
-
|
|
142
|
+
delegations,
|
|
143
|
+
modes,
|
|
144
|
+
executions
|
|
138
145
|
});
|
|
139
146
|
return writeContract(client, request);
|
|
140
147
|
};
|
|
141
|
-
var encode = ({
|
|
142
|
-
|
|
148
|
+
var encode = ({
|
|
149
|
+
delegations,
|
|
150
|
+
modes,
|
|
151
|
+
executions
|
|
152
|
+
}) => {
|
|
143
153
|
return encodeFunctionData({
|
|
144
154
|
abi: DelegationManager,
|
|
145
|
-
functionName: "
|
|
146
|
-
args: [
|
|
155
|
+
functionName: "redeemDelegations",
|
|
156
|
+
args: [
|
|
157
|
+
delegations.map((delegationChain) => encodeDelegations(delegationChain)),
|
|
158
|
+
modes,
|
|
159
|
+
encodeExecutionCalldatas(executions)
|
|
160
|
+
]
|
|
147
161
|
});
|
|
148
162
|
};
|
|
163
|
+
var decodeError = (error) => decodeRevertReason(error);
|
|
149
164
|
|
|
150
|
-
// src/DelegationFramework/DelegationManager/
|
|
165
|
+
// src/DelegationFramework/DelegationManager/encode.ts
|
|
166
|
+
var encode_exports5 = {};
|
|
167
|
+
__export(encode_exports5, {
|
|
168
|
+
disableDelegation: () => encode2,
|
|
169
|
+
enableDelegation: () => encode3,
|
|
170
|
+
redeemDelegations: () => encode
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// src/DelegationFramework/DelegationManager/methods/disableDelegation.ts
|
|
151
174
|
import { DelegationManager as DelegationManager2 } from "@metamask/delegation-abis";
|
|
152
175
|
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
153
176
|
import { simulateContract as simulateContract2, writeContract as writeContract2 } from "viem/actions";
|
|
@@ -160,7 +183,7 @@ var simulate20 = async ({
|
|
|
160
183
|
return simulateContract2(client, {
|
|
161
184
|
address: delegationManagerAddress,
|
|
162
185
|
abi: DelegationManager2,
|
|
163
|
-
functionName: "
|
|
186
|
+
functionName: "disableDelegation",
|
|
164
187
|
args: [delegationStruct]
|
|
165
188
|
});
|
|
166
189
|
};
|
|
@@ -180,71 +203,55 @@ var encode2 = ({ delegation }) => {
|
|
|
180
203
|
const delegationStruct = toDelegationStruct(delegation);
|
|
181
204
|
return encodeFunctionData2({
|
|
182
205
|
abi: DelegationManager2,
|
|
183
|
-
functionName: "
|
|
206
|
+
functionName: "disableDelegation",
|
|
184
207
|
args: [delegationStruct]
|
|
185
208
|
});
|
|
186
209
|
};
|
|
187
210
|
|
|
188
|
-
// src/DelegationFramework/DelegationManager/methods/
|
|
211
|
+
// src/DelegationFramework/DelegationManager/methods/enableDelegation.ts
|
|
189
212
|
import { DelegationManager as DelegationManager3 } from "@metamask/delegation-abis";
|
|
190
213
|
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
191
214
|
import { simulateContract as simulateContract3, writeContract as writeContract3 } from "viem/actions";
|
|
192
215
|
var simulate21 = async ({
|
|
193
216
|
client,
|
|
194
217
|
delegationManagerAddress,
|
|
195
|
-
|
|
196
|
-
modes,
|
|
197
|
-
executions
|
|
218
|
+
delegation
|
|
198
219
|
}) => {
|
|
220
|
+
const delegationStruct = toDelegationStruct(delegation);
|
|
199
221
|
return simulateContract3(client, {
|
|
200
222
|
address: delegationManagerAddress,
|
|
201
223
|
abi: DelegationManager3,
|
|
202
|
-
functionName: "
|
|
203
|
-
args: [
|
|
204
|
-
delegations.map((delegationChain) => encodeDelegations(delegationChain)),
|
|
205
|
-
modes,
|
|
206
|
-
encodeExecutionCalldatas(executions)
|
|
207
|
-
]
|
|
224
|
+
functionName: "enableDelegation",
|
|
225
|
+
args: [delegationStruct]
|
|
208
226
|
});
|
|
209
227
|
};
|
|
210
228
|
var execute9 = async ({
|
|
211
229
|
client,
|
|
212
230
|
delegationManagerAddress,
|
|
213
|
-
|
|
214
|
-
modes,
|
|
215
|
-
executions
|
|
231
|
+
delegation
|
|
216
232
|
}) => {
|
|
217
233
|
const { request } = await simulate21({
|
|
218
234
|
client,
|
|
219
235
|
delegationManagerAddress,
|
|
220
|
-
|
|
221
|
-
modes,
|
|
222
|
-
executions
|
|
236
|
+
delegation
|
|
223
237
|
});
|
|
224
238
|
return writeContract3(client, request);
|
|
225
239
|
};
|
|
226
|
-
var encode3 = ({
|
|
227
|
-
|
|
228
|
-
modes,
|
|
229
|
-
executions
|
|
230
|
-
}) => {
|
|
240
|
+
var encode3 = ({ delegation }) => {
|
|
241
|
+
const delegationStruct = toDelegationStruct(delegation);
|
|
231
242
|
return encodeFunctionData3({
|
|
232
243
|
abi: DelegationManager3,
|
|
233
|
-
functionName: "
|
|
234
|
-
args: [
|
|
235
|
-
delegations.map((delegationChain) => encodeDelegations(delegationChain)),
|
|
236
|
-
modes,
|
|
237
|
-
encodeExecutionCalldatas(executions)
|
|
238
|
-
]
|
|
244
|
+
functionName: "enableDelegation",
|
|
245
|
+
args: [delegationStruct]
|
|
239
246
|
});
|
|
240
247
|
};
|
|
241
248
|
|
|
242
249
|
// src/DelegationFramework/DelegationManager/execute.ts
|
|
243
250
|
var execute_exports = {};
|
|
244
251
|
__export(execute_exports, {
|
|
245
|
-
disableDelegation: () =>
|
|
246
|
-
enableDelegation: () =>
|
|
247
|
-
redeemDelegations: () =>
|
|
252
|
+
disableDelegation: () => execute8,
|
|
253
|
+
enableDelegation: () => execute9,
|
|
254
|
+
redeemDelegations: () => execute7
|
|
248
255
|
});
|
|
249
256
|
|
|
250
257
|
// src/DelegationFramework/DelegationManager/read.ts
|
|
@@ -296,9 +303,9 @@ var read3 = async ({
|
|
|
296
303
|
// src/DelegationFramework/DelegationManager/simulate.ts
|
|
297
304
|
var simulate_exports = {};
|
|
298
305
|
__export(simulate_exports, {
|
|
299
|
-
disableDelegation: () =>
|
|
300
|
-
enableDelegation: () =>
|
|
301
|
-
redeemDelegations: () =>
|
|
306
|
+
disableDelegation: () => simulate20,
|
|
307
|
+
enableDelegation: () => simulate21,
|
|
308
|
+
redeemDelegations: () => simulate19
|
|
302
309
|
});
|
|
303
310
|
|
|
304
311
|
// src/DelegationFramework/DeleGatorCore/index.ts
|
|
@@ -1318,4 +1325,4 @@ export {
|
|
|
1318
1325
|
SpecificActionERC20TransferBatchEnforcer_exports,
|
|
1319
1326
|
contracts_exports
|
|
1320
1327
|
};
|
|
1321
|
-
//# sourceMappingURL=chunk-
|
|
1328
|
+
//# sourceMappingURL=chunk-L3EZCIY6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/contracts/index.ts","../src/DelegationFramework/DelegationManager/index.ts","../src/DelegationFramework/DelegationManager/constants.ts","../src/DelegationFramework/DelegationManager/decode.ts","../src/DelegationFramework/DelegationManager/methods/redeemDelegations.ts","../src/DelegationFramework/DelegationManager/encode.ts","../src/DelegationFramework/DelegationManager/methods/disableDelegation.ts","../src/DelegationFramework/DelegationManager/methods/enableDelegation.ts","../src/DelegationFramework/DelegationManager/execute.ts","../src/DelegationFramework/DelegationManager/read.ts","../src/DelegationFramework/DelegationManager/methods/disabledDelegations.ts","../src/DelegationFramework/DelegationManager/methods/getAnyDelegate.ts","../src/DelegationFramework/DelegationManager/methods/getRootAuthority.ts","../src/DelegationFramework/DelegationManager/simulate.ts","../src/DelegationFramework/DeleGatorCore/index.ts","../src/DelegationFramework/DeleGatorCore/execute.ts","../src/DelegationFramework/DeleGatorCore/simulate.ts","../src/DelegationFramework/EIP712/index.ts","../src/DelegationFramework/EIP712/read.ts","../src/DelegationFramework/EIP712/methods/getContractName.ts","../src/DelegationFramework/EIP712/methods/getContractVersion.ts","../src/DelegationFramework/EIP712/methods/getDomainVersion.ts","../src/DelegationFramework/EntryPoint/index.ts","../src/DelegationFramework/EntryPoint/read.ts","../src/DelegationFramework/EntryPoint/methods/getNonce.ts","../src/DelegationFramework/ERC20TransferAmountEnforcer/index.ts","../src/DelegationFramework/ERC20TransferAmountEnforcer/read.ts","../src/DelegationFramework/ERC20TransferAmountEnforcer/methods/getSpentAmount.ts","../src/DelegationFramework/ERC20TransferAmountEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/HybridDeleGator/index.ts","../src/DelegationFramework/HybridDeleGator/read.ts","../src/DelegationFramework/HybridDeleGator/methods/getKey.ts","../src/DelegationFramework/HybridDeleGator/methods/getKeyIdHashes.ts","../src/DelegationFramework/HybridDeleGator/methods/getKeyIdHashesCount.ts","../src/DelegationFramework/HybridDeleGator/simulate.ts","../src/DelegationFramework/HybridDeleGator/constants.ts","../src/DelegationFramework/IdEnforcer/index.ts","../src/DelegationFramework/IdEnforcer/read.ts","../src/DelegationFramework/IdEnforcer/methods/getIsUsed.ts","../src/DelegationFramework/IdEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/LimitedCallsEnforcer/index.ts","../src/DelegationFramework/LimitedCallsEnforcer/read.ts","../src/DelegationFramework/LimitedCallsEnforcer/methods/callCounts.ts","../src/DelegationFramework/LimitedCallsEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/MultiSigDeleGator/index.ts","../src/DelegationFramework/MultiSigDeleGator/read.ts","../src/DelegationFramework/MultiSigDeleGator/methods/getMaxNumberOfSigners.ts","../src/DelegationFramework/MultiSigDeleGator/methods/getSigners.ts","../src/DelegationFramework/MultiSigDeleGator/methods/getSignersCount.ts","../src/DelegationFramework/MultiSigDeleGator/methods/getThreshold.ts","../src/DelegationFramework/MultiSigDeleGator/methods/isSigner.ts","../src/DelegationFramework/MultiSigDeleGator/simulate.ts","../src/DelegationFramework/MultiSigDeleGator/constants.ts","../src/DelegationFramework/NativeTokenTransferAmountEnforcer/index.ts","../src/DelegationFramework/NativeTokenTransferAmountEnforcer/read.ts","../src/DelegationFramework/NativeTokenTransferAmountEnforcer/methods/getSpentAmount.ts","../src/DelegationFramework/NativeTokenTransferAmountEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/NonceEnforcer/index.ts","../src/DelegationFramework/NonceEnforcer/encode.ts","../src/DelegationFramework/NonceEnforcer/methods/incrementNonce.ts","../src/DelegationFramework/NonceEnforcer/execute.ts","../src/DelegationFramework/NonceEnforcer/read.ts","../src/DelegationFramework/NonceEnforcer/methods/currentNonce.ts","../src/DelegationFramework/NonceEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/NonceEnforcer/simulate.ts","../src/DelegationFramework/Ownable2Step/index.ts","../src/DelegationFramework/Ownable2Step/read.ts","../src/DelegationFramework/Ownable2Step/methods/getOwner.ts","../src/DelegationFramework/Ownable2Step/methods/getPendingOwner.ts","../src/DelegationFramework/Ownable2Step/execute.ts","../src/DelegationFramework/Ownable2Step/methods/acceptOwnership.ts","../src/DelegationFramework/Ownable2Step/methods/renounceOwnership.ts","../src/DelegationFramework/Ownable2Step/methods/transferOwnership.ts","../src/DelegationFramework/Ownable2Step/encode.ts","../src/DelegationFramework/Ownable2Step/simulate.ts","../src/DelegationFramework/Pausable/index.ts","../src/DelegationFramework/Pausable/read.ts","../src/DelegationFramework/Pausable/methods/isPaused.ts","../src/DelegationFramework/Pausable/execute.ts","../src/DelegationFramework/Pausable/methods/pause.ts","../src/DelegationFramework/Pausable/methods/unpause.ts","../src/DelegationFramework/Pausable/encode.ts","../src/DelegationFramework/Pausable/simulate.ts","../src/DelegationFramework/SimpleFactory/index.ts","../src/DelegationFramework/SimpleFactory/execute.ts","../src/DelegationFramework/SimpleFactory/read.ts","../src/DelegationFramework/SimpleFactory/methods/getCreate2Address.ts","../src/DelegationFramework/SimpleFactory/simulate.ts","../src/DelegationFramework/SpecificActionERC20TransferBatchEnforcer/index.ts","../src/DelegationFramework/SpecificActionERC20TransferBatchEnforcer/read.ts","../src/DelegationFramework/SpecificActionERC20TransferBatchEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/SpecificActionERC20TransferBatchEnforcer/methods/usedDelegations.ts"],"sourcesContent":["import * as DelegationManager from '../DelegationFramework/DelegationManager';\nimport * as DeleGatorCore from '../DelegationFramework/DeleGatorCore';\nimport * as EIP712 from '../DelegationFramework/EIP712';\nimport * as EntryPoint from '../DelegationFramework/EntryPoint';\nimport * as ERC20PeriodTransferEnforcer from '../DelegationFramework/ERC20PeriodTransferEnforcer';\nimport * as ERC20StreamingEnforcer from '../DelegationFramework/ERC20StreamingEnforcer';\nimport * as ERC20TransferAmountEnforcer from '../DelegationFramework/ERC20TransferAmountEnforcer';\nimport * as HybridDeleGator from '../DelegationFramework/HybridDeleGator';\nimport * as IdEnforcer from '../DelegationFramework/IdEnforcer';\nimport * as LimitedCallsEnforcer from '../DelegationFramework/LimitedCallsEnforcer';\nimport * as MultiSigDeleGator from '../DelegationFramework/MultiSigDeleGator';\nimport * as MultiTokenPeriodEnforcer from '../DelegationFramework/MultiTokenPeriodEnforcer';\nimport * as NativeTokenPeriodTransferEnforcer from '../DelegationFramework/NativeTokenPeriodTransferEnforcer';\nimport * as NativeTokenStreamingEnforcer from '../DelegationFramework/NativeTokenStreamingEnforcer';\nimport * as NativeTokenTransferAmountEnforcer from '../DelegationFramework/NativeTokenTransferAmountEnforcer';\nimport * as NonceEnforcer from '../DelegationFramework/NonceEnforcer';\nimport * as Ownable2Step from '../DelegationFramework/Ownable2Step';\nimport * as Pausable from '../DelegationFramework/Pausable';\nimport * as SimpleFactory from '../DelegationFramework/SimpleFactory';\nimport * as SpecificActionERC20TransferBatchEnforcer from '../DelegationFramework/SpecificActionERC20TransferBatchEnforcer';\n\nexport {\n isContractDeployed,\n isImplementationExpected,\n encodeProxyCreationCode,\n} from '../DelegationFramework/utils';\n\nexport {\n DelegationManager,\n DeleGatorCore,\n EIP712,\n EntryPoint,\n HybridDeleGator,\n IdEnforcer,\n LimitedCallsEnforcer,\n MultiSigDeleGator,\n NonceEnforcer,\n Ownable2Step,\n Pausable,\n SimpleFactory,\n SpecificActionERC20TransferBatchEnforcer,\n ERC20PeriodTransferEnforcer,\n ERC20StreamingEnforcer,\n ERC20TransferAmountEnforcer,\n MultiTokenPeriodEnforcer,\n NativeTokenPeriodTransferEnforcer,\n NativeTokenStreamingEnforcer,\n NativeTokenTransferAmountEnforcer,\n};\n\nexport type {\n P256Owner,\n InitializedClient,\n} from '../DelegationFramework/types';\n","import * as constants from './constants';\nimport * as decode from './decode';\nimport * as encode from './encode';\nimport * as execute from './execute';\nimport * as read from './read';\nimport * as simulate from './simulate';\n\nexport { decode, encode, execute, read, simulate, constants };\n","export { ROOT_AUTHORITY, ANY_BENEFICIARY } from '../../delegation';\n\nexport const NAME = 'DelegationManager';\nexport const VERSION = '1.3.0';\nexport const DOMAIN_VERSION = '1';\n","import { decodeError as redeemDelegationsError } from './methods/redeemDelegations';\n\nexport { redeemDelegationsError };\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport {\n decodeRevertReason,\n type DecodedRevertReason,\n} from '../../../decodeRevertReason';\nimport { encodeDelegations } from '../../../delegation';\nimport { encodeExecutionCalldatas } from '../../../executions';\nimport type { ExecutionMode, ExecutionStruct } from '../../../executions';\nimport type { PermissionContext } from '../../../types';\nimport type { InitializedClient } from '../../types';\n\nexport type EncodeRedeemDelegationsParameters = {\n delegations: PermissionContext[];\n modes: ExecutionMode[];\n executions: ExecutionStruct[][];\n};\n\nexport type SimulateRedeemDelegationsParameters = {\n client: Client;\n delegationManagerAddress: Address;\n} & EncodeRedeemDelegationsParameters;\n\nexport type ExecuteRedeemDelegationsParameters = {\n client: InitializedClient;\n delegationManagerAddress: Address;\n} & EncodeRedeemDelegationsParameters;\n\nexport type DecodeRedeemDelegationsErrorReturnType =\n | DecodedRevertReason\n | undefined;\n\nexport const simulate = async ({\n client,\n delegationManagerAddress,\n delegations,\n modes,\n executions,\n}: SimulateRedeemDelegationsParameters) => {\n return simulateContract(client, {\n address: delegationManagerAddress,\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [\n delegations.map((delegationChain) => encodeDelegations(delegationChain)),\n modes,\n encodeExecutionCalldatas(executions),\n ],\n });\n};\n\nexport const execute = async ({\n client,\n delegationManagerAddress,\n delegations,\n modes,\n executions,\n}: ExecuteRedeemDelegationsParameters) => {\n const { request } = await simulate({\n client,\n delegationManagerAddress,\n delegations,\n modes,\n executions,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n delegations,\n modes,\n executions,\n}: EncodeRedeemDelegationsParameters) => {\n return encodeFunctionData({\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [\n delegations.map((delegationChain) => encodeDelegations(delegationChain)),\n modes,\n encodeExecutionCalldatas(executions),\n ],\n });\n};\n\n/**\n * Decodes revert data from errors thrown by `simulate` or `execute`.\n *\n * @param error - The original error thrown by viem or an RPC provider.\n * @returns A decoded revert reason, if one can be recognized.\n */\nexport const decodeError = (\n error: unknown,\n): DecodeRedeemDelegationsErrorReturnType => decodeRevertReason(error);\n","import { encode as disableDelegation } from './methods/disableDelegation';\nimport { encode as enableDelegation } from './methods/enableDelegation';\nimport { encode as redeemDelegations } from './methods/redeemDelegations';\n\nexport { disableDelegation, enableDelegation, redeemDelegations };\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport { toDelegationStruct } from '../../../delegation';\nimport type { Delegation } from '../../../types';\nimport type { InitializedClient } from '../../types';\n\nexport type EncodeDisableDelegationParameters = {\n delegation: Delegation;\n};\n\nexport type SimulateDisableDelegationParameters = {\n client: Client;\n delegationManagerAddress: Address;\n} & EncodeDisableDelegationParameters;\n\nexport type ExecuteDisableDelegationParameters = {\n client: InitializedClient;\n delegationManagerAddress: Address;\n} & EncodeDisableDelegationParameters;\n\nexport const simulate = async ({\n client,\n delegationManagerAddress,\n delegation,\n}: SimulateDisableDelegationParameters) => {\n const delegationStruct = toDelegationStruct(delegation);\n\n return simulateContract(client, {\n address: delegationManagerAddress,\n abi: DelegationManager,\n functionName: 'disableDelegation',\n args: [delegationStruct],\n });\n};\n\nexport const execute = async ({\n client,\n delegationManagerAddress,\n delegation,\n}: ExecuteDisableDelegationParameters) => {\n const { request } = await simulate({\n client,\n delegationManagerAddress,\n delegation,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ delegation }: EncodeDisableDelegationParameters) => {\n const delegationStruct = toDelegationStruct(delegation);\n\n return encodeFunctionData({\n abi: DelegationManager,\n functionName: 'disableDelegation',\n args: [delegationStruct],\n });\n};\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport { toDelegationStruct } from '../../../delegation';\nimport type { Delegation } from '../../../types';\nimport type { InitializedClient } from '../../types';\n\nexport type EncodeEnableDelegationParameters = {\n delegation: Delegation;\n};\n\nexport type SimulateEnableDelegationParameters = {\n client: Client;\n delegationManagerAddress: Address;\n} & EncodeEnableDelegationParameters;\n\nexport type ExecuteEnableDelegationParameters = {\n client: InitializedClient;\n delegationManagerAddress: Address;\n} & EncodeEnableDelegationParameters;\n\nexport const simulate = async ({\n client,\n delegationManagerAddress,\n delegation,\n}: SimulateEnableDelegationParameters) => {\n const delegationStruct = toDelegationStruct(delegation);\n\n return simulateContract(client, {\n address: delegationManagerAddress,\n abi: DelegationManager,\n functionName: 'enableDelegation',\n args: [delegationStruct],\n });\n};\n\nexport const execute = async ({\n client,\n delegationManagerAddress,\n delegation,\n}: ExecuteEnableDelegationParameters) => {\n const { request } = await simulate({\n client,\n delegationManagerAddress,\n delegation,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ delegation }: EncodeEnableDelegationParameters) => {\n const delegationStruct = toDelegationStruct(delegation);\n\n return encodeFunctionData({\n abi: DelegationManager,\n functionName: 'enableDelegation',\n args: [delegationStruct],\n });\n};\n","import { execute as disableDelegation } from './methods/disableDelegation';\nimport { execute as enableDelegation } from './methods/enableDelegation';\nimport { execute as redeemDelegations } from './methods/redeemDelegations';\n\nexport { disableDelegation, enableDelegation, redeemDelegations };\n","import { read as disabledDelegations } from './methods/disabledDelegations';\nimport { read as getAnyDelegate } from './methods/getAnyDelegate';\nimport { read as getRootAuthority } from './methods/getRootAuthority';\n\nexport { getAnyDelegate, getRootAuthority, disabledDelegations };\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadDisabledDelegationsParameters = {\n client: Client;\n contractAddress: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationHash,\n}: ReadDisabledDelegationsParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DelegationManager,\n functionName: 'disabledDelegations',\n args: [delegationHash],\n });\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetAnyDelegateParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetAnyDelegateParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DelegationManager,\n functionName: 'ANY_DELEGATE',\n });\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetRootAuthorityParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetRootAuthorityParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DelegationManager,\n functionName: 'ROOT_AUTHORITY',\n });\n","import { simulate as disableDelegation } from './methods/disableDelegation';\nimport { simulate as enableDelegation } from './methods/enableDelegation';\nimport { simulate as redeemDelegations } from './methods/redeemDelegations';\n\nexport { disableDelegation, enableDelegation, redeemDelegations };\n","import * as encode from './encode';\nimport * as execute from './execute';\nimport * as read from './read';\nimport * as simulate from './simulate';\n\nexport { encode, simulate, read, execute };\n","import { execute as disableDelegation } from './methods/disableDelegation';\nimport { execute as enableDelegation } from './methods/enableDelegation';\nimport { execute } from './methods/execute';\nimport { execute as executeWithMode } from './methods/executeWithMode';\nimport { execute as upgradeToAndCall } from './methods/upgradeToAndCall';\n\nexport {\n disableDelegation,\n enableDelegation,\n execute,\n executeWithMode,\n upgradeToAndCall,\n};\n","import { simulate as disableDelegation } from './methods/disableDelegation';\nimport { simulate as enableDelegation } from './methods/enableDelegation';\nimport { simulate as execute } from './methods/execute';\nimport { simulate as executeWithMode } from './methods/executeWithMode';\nimport { simulate as upgradeToAndCall } from './methods/upgradeToAndCall';\n\nexport {\n disableDelegation,\n enableDelegation,\n execute,\n executeWithMode,\n upgradeToAndCall,\n};\n","export * as read from './read';\n","import { read as getContractName } from './methods/getContractName';\nimport { read as getContractVersion } from './methods/getContractVersion';\nimport { read as getDomainVersion } from './methods/getDomainVersion';\n\nexport { getContractName, getContractVersion, getDomainVersion };\n","import type { Client, Address } from 'viem';\nimport { readContract } from 'viem/actions';\n\n// NOTE: ABIs have been extracted and minimized for reuse across contracts. These methods are included in our contracts but are not a part of the EIP712 standard itself.\n\nexport type ReadGetContractNameParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetContractNameParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: [\n {\n type: 'function',\n name: 'NAME',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'string',\n internalType: 'string',\n },\n ],\n stateMutability: 'view',\n },\n ],\n functionName: 'NAME',\n });\n","import type { Client, Address } from 'viem';\nimport { readContract } from 'viem/actions';\n\n// NOTE: ABIs have been extracted and minimized for reuse across contracts. These methods are included in our contracts but are not a part of the EIP712 standard itself.\n\nexport type ReadGetContractVersionParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetContractVersionParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: [\n {\n type: 'function',\n name: 'VERSION',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'string',\n internalType: 'string',\n },\n ],\n stateMutability: 'view',\n },\n ],\n functionName: 'VERSION',\n });\n","import type { Client, Address } from 'viem';\nimport { readContract } from 'viem/actions';\n\n// NOTE: ABIs have been extracted and minimized for reuse across contracts. These methods are included in our contracts but are not a part of the EIP712 standard itself.\n\nexport type ReadGetDomainVersionParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetDomainVersionParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: [\n {\n type: 'function',\n name: 'DOMAIN_VERSION',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'string',\n internalType: 'string',\n },\n ],\n stateMutability: 'view',\n },\n ],\n functionName: 'DOMAIN_VERSION',\n });\n","import * as read from './read';\n\nexport { read };\n","import { read as entryPointGetNonce } from './methods/getNonce';\n\nexport { entryPointGetNonce };\n","import { EntryPoint } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetNonceParameters = {\n client: Client;\n entryPoint: Address;\n contractAddress: Address;\n key: bigint;\n};\n\nexport const read = async ({\n client,\n entryPoint,\n contractAddress,\n key,\n}: ReadGetNonceParameters) =>\n await readContract(client, {\n address: entryPoint,\n abi: EntryPoint,\n functionName: 'getNonce',\n args: [contractAddress, key],\n });\n","import * as read from './read';\n\nexport { read };\n","import { read as getSpentAmount } from './methods/getSpentAmount';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { getTermsInfo, getSpentAmount };\n","import { ERC20TransferAmountEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetSpentAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n}: ReadGetSpentAmountParameters): Promise<bigint> => {\n const amount = await readContract(client, {\n address: contractAddress,\n abi: ERC20TransferAmountEnforcer,\n functionName: 'spentMap',\n args: [delegationManager, delegationHash],\n });\n\n return amount;\n};\n","import { ERC20TransferAmountEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport type TermsData = {\n allowedContract: Address;\n maxTokens: bigint;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<TermsData> => {\n const [allowedContract, maxTokens] = await readContract(client, {\n address: contractAddress,\n abi: ERC20TransferAmountEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return {\n allowedContract,\n maxTokens,\n };\n};\n","export * as read from './read';\nexport * as encode from './encode';\nexport * as simulate from './simulate';\nexport * as constants from './constants';\n","import { read as getKey } from './methods/getKey';\nimport { read as getKeyIdHashes } from './methods/getKeyIdHashes';\nimport { read as getKeyIdHashesCount } from './methods/getKeyIdHashesCount';\n\nexport { getKey, getKeyIdHashes, getKeyIdHashesCount };\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetKeyParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n keyId: string;\n};\n\nexport const read = async ({\n client,\n hybridDeleGatorAddress,\n keyId,\n}: ReadGetKeyParameters) =>\n await readContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'getKey',\n args: [keyId],\n });\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetKeyIdHashesParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n hybridDeleGatorAddress,\n}: ReadGetKeyIdHashesParameters) =>\n await readContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'getKeyIdHashes',\n });\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetKeyIdHashesCountParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n hybridDeleGatorAddress,\n}: ReadGetKeyIdHashesCountParameters) =>\n await readContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'getKeyIdHashesCount',\n });\n","import { simulate as addKey } from './methods/addKey';\nimport { simulate as initializeHybridDeleGator } from './methods/initialize';\nimport { simulate as reinitializeHybridDeleGator } from './methods/reinitialize';\nimport { simulate as removeKey } from './methods/removeKey';\nimport { simulate as updateSigners } from './methods/updateSigners';\n\nexport {\n addKey,\n initializeHybridDeleGator,\n reinitializeHybridDeleGator,\n removeKey,\n updateSigners,\n};\n","export { ROOT_AUTHORITY, ANY_BENEFICIARY } from '../../delegation';\n\nexport const NAME = 'HybridDeleGator';\nexport const VERSION = '1.3.0';\nexport const DOMAIN_VERSION = '1';\n","import * as read from './read';\n\nexport { read };\n","import { read as getIsUsed } from './methods/getIsUsed';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { getTermsInfo, getIsUsed };\n","import { IdEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetIsUsedParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegator: Address;\n id: bigint;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegator,\n id,\n}: ReadGetIsUsedParameters): Promise<boolean> => {\n const isUsed = await readContract(client, {\n address: contractAddress,\n abi: IdEnforcer,\n functionName: 'getIsUsed',\n args: [delegationManager, delegator, id],\n });\n\n return isUsed;\n};\n","import { IdEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<bigint> => {\n const id = await readContract(client, {\n address: contractAddress,\n abi: IdEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return id;\n};\n","import * as read from './read';\n\nexport { read };\n","import { read as callCounts } from './methods/callCounts';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { callCounts, getTermsInfo };\n","import { LimitedCallsEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadCallCountsParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n}: ReadCallCountsParameters): Promise<bigint> => {\n const count = await readContract(client, {\n address: contractAddress,\n abi: LimitedCallsEnforcer,\n functionName: 'callCounts',\n args: [delegationManager, delegationHash],\n });\n\n return count;\n};\n","import { LimitedCallsEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<bigint> => {\n const limit = await readContract(client, {\n address: contractAddress,\n abi: LimitedCallsEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return limit;\n};\n","export * as read from './read';\nexport * as encode from './encode';\nexport * as simulate from './simulate';\nexport * as constants from './constants';\n","import { read as getMaxNumberOfSigners } from './methods/getMaxNumberOfSigners';\nimport { read as getSigners } from './methods/getSigners';\nimport { read as getSignersCount } from './methods/getSignersCount';\nimport { read as getThreshold } from './methods/getThreshold';\nimport { read as isSigner } from './methods/isSigner';\n\nexport {\n getSigners,\n getSignersCount,\n getThreshold,\n isSigner,\n getMaxNumberOfSigners,\n};\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetMaxNumberOfSignersParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n}: ReadGetMaxNumberOfSignersParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'MAX_NUMBER_OF_SIGNERS',\n });\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetSignersParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n}: ReadGetSignersParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'getSigners',\n });\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetSignersCountParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n}: ReadGetSignersCountParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'getSignersCount',\n });\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetThresholdParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n}: ReadGetThresholdParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'getThreshold',\n });\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadIsSignerParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n signer: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n signer,\n}: ReadIsSignerParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'isSigner',\n args: [signer],\n });\n","import { simulate as addSigner } from './methods/addSigner';\nimport { simulate as initializeMultiSigDeleGator } from './methods/initialize';\nimport { simulate as reinitializeMultiSigDeleGator } from './methods/reinitialize';\nimport { simulate as removeSigner } from './methods/removeSigner';\nimport { simulate as replaceSigner } from './methods/replaceSigner';\nimport { simulate as updateMultiSigParameters } from './methods/updateMultiSigParameters';\nimport { simulate as updateThreshold } from './methods/updateThreshold';\n\nexport {\n addSigner,\n initializeMultiSigDeleGator,\n reinitializeMultiSigDeleGator,\n removeSigner,\n replaceSigner,\n updateMultiSigParameters,\n updateThreshold,\n};\n","export const MAX_NUMBER_OF_SIGNERS = 30;\n","import * as read from './read';\n\nexport { read };\n","import { read as getSpentAmount } from './methods/getSpentAmount';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { getSpentAmount, getTermsInfo };\n","import { NativeTokenTransferAmountEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetSpentAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n}: ReadGetSpentAmountParameters): Promise<bigint> => {\n const amount = await readContract(client, {\n address: contractAddress,\n abi: NativeTokenTransferAmountEnforcer,\n functionName: 'spentMap',\n args: [delegationManager, delegationHash],\n });\n\n return amount;\n};\n","import { NativeTokenTransferAmountEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<bigint> => {\n const allowance = await readContract(client, {\n address: contractAddress,\n abi: NativeTokenTransferAmountEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return allowance;\n};\n","import * as encode from './encode';\nimport * as execute from './execute';\nimport * as read from './read';\nimport * as simulate from './simulate';\n\nexport { encode, execute, read, simulate };\n","import { encode as incrementNonce } from './methods/incrementNonce';\n\nexport { incrementNonce };\n","import { NonceEnforcer } from '@metamask/delegation-abis';\nimport type { Account, Address, Chain, Client, Transport } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nexport type SimulateIncrementNonceParameters = {\n client: Client<Transport, Chain, Account>;\n contractAddress: Address;\n delegationManager: Address;\n};\n\nexport const encode = (delegationManager: Address) => {\n return encodeFunctionData({\n abi: NonceEnforcer,\n functionName: 'incrementNonce',\n args: [delegationManager],\n });\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n delegationManager,\n}: SimulateIncrementNonceParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: NonceEnforcer,\n functionName: 'incrementNonce',\n args: [delegationManager],\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n delegationManager,\n}: SimulateIncrementNonceParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n delegationManager,\n });\n return writeContract(client, request);\n};\n","import { execute as incrementNonce } from './methods/incrementNonce';\n\nexport { incrementNonce };\n","import { read as currentNonce } from './methods/currentNonce';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { currentNonce, getTermsInfo };\n","import { NonceEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadCurrentNonceParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegator: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegator,\n}: ReadCurrentNonceParameters): Promise<bigint> => {\n const nonce = await readContract(client, {\n address: contractAddress,\n abi: NonceEnforcer,\n functionName: 'currentNonce',\n args: [delegationManager, delegator],\n });\n\n return nonce;\n};\n","import { NonceEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<bigint> => {\n const nonce = await readContract(client, {\n address: contractAddress,\n abi: NonceEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return nonce;\n};\n","import { simulate as incrementNonce } from './methods/incrementNonce';\n\nexport { incrementNonce };\n","export * as read from './read';\nexport * as execute from './execute';\nexport * as encode from './encode';\nexport * as simulate from './simulate';\n","import { read as getOwner } from './methods/getOwner';\nimport { read as getPendingOwner } from './methods/getPendingOwner';\n\nexport { getPendingOwner, getOwner };\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetOwnerParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetOwnerParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'owner',\n });\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetPendingOwnerParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetPendingOwnerParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'pendingOwner',\n });\n","import { execute as acceptOwnership } from './methods/acceptOwnership';\nimport { execute as renounceOwnership } from './methods/renounceOwnership';\nimport { execute as transferOwnership } from './methods/transferOwnership';\n\nexport { transferOwnership, renounceOwnership, acceptOwnership };\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateAcceptOwnershipParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport type ExecuteAcceptOwnershipParameters = {\n client: InitializedClient;\n contractAddress: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n}: SimulateAcceptOwnershipParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'acceptOwnership',\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n}: ExecuteAcceptOwnershipParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n });\n return writeContract(client, request);\n};\n\nexport const encode = () => {\n return encodeFunctionData({\n abi: Ownable2Step,\n functionName: 'acceptOwnership',\n });\n};\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateRenounceOwnershipParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport type ExecuteRenounceOwnershipParameters = {\n client: InitializedClient;\n contractAddress: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n}: SimulateRenounceOwnershipParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'renounceOwnership',\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n}: ExecuteRenounceOwnershipParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n });\n return writeContract(client, request);\n};\n\nexport const encode = () => {\n return encodeFunctionData({\n abi: Ownable2Step,\n functionName: 'renounceOwnership',\n });\n};\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateTransferOwnershipParameters = {\n client: Client;\n contractAddress: Address;\n account: Address;\n};\n\nexport type ExecuteTransferOwnershipParameters = {\n client: InitializedClient;\n contractAddress: Address;\n account: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n account,\n}: SimulateTransferOwnershipParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'transferOwnership',\n args: [account],\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n account,\n}: ExecuteTransferOwnershipParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n account,\n });\n return writeContract(client, request);\n};\n\nexport const encode = (account: Address) => {\n return encodeFunctionData({\n abi: Ownable2Step,\n functionName: 'transferOwnership',\n args: [account],\n });\n};\n","import { encode as acceptOwnership } from './methods/acceptOwnership';\nimport { encode as renounceOwnership } from './methods/renounceOwnership';\nimport { encode as transferOwnership } from './methods/transferOwnership';\n\nexport { transferOwnership, renounceOwnership, acceptOwnership };\n","import { simulate as acceptOwnership } from './methods/acceptOwnership';\nimport { simulate as renounceOwnership } from './methods/renounceOwnership';\nimport { simulate as transferOwnership } from './methods/transferOwnership';\n\nexport { transferOwnership, renounceOwnership, acceptOwnership };\n","export * as read from './read';\nexport * as execute from './execute';\nexport * as encode from './encode';\nexport * as simulate from './simulate';\n","import { read as isPaused } from './methods/isPaused';\n\nexport { isPaused };\n","import { Pausable } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadIsPausedParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadIsPausedParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: Pausable,\n functionName: 'paused',\n });\n","import { execute as pause } from './methods/pause';\nimport { execute as unpause } from './methods/unpause';\n\nexport { pause, unpause };\n","import type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nconst PauseAbi = [\n {\n type: 'function',\n name: 'pause',\n inputs: [],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n];\n\nexport type SimulatePauseParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport type ExecutePauseParameters = {\n client: InitializedClient;\n contractAddress: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n}: SimulatePauseParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: PauseAbi,\n functionName: 'pause',\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n}: ExecutePauseParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n });\n return writeContract(client, request);\n};\n\nexport const encode = () => {\n return encodeFunctionData({\n abi: PauseAbi,\n functionName: 'pause',\n });\n};\n","import type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nconst UnpauseAbi = [\n {\n type: 'function',\n name: 'unpause',\n inputs: [],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n];\n\nexport type SimulateUnpauseParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport type ExecuteUnpauseParameters = {\n client: InitializedClient;\n contractAddress: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n}: SimulateUnpauseParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: UnpauseAbi,\n functionName: 'unpause',\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n}: ExecuteUnpauseParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n });\n return writeContract(client, request);\n};\n\nexport const encode = () => {\n return encodeFunctionData({\n abi: UnpauseAbi,\n functionName: 'unpause',\n });\n};\n","import { encode as pause } from './methods/pause';\nimport { encode as unpause } from './methods/unpause';\n\nexport { pause, unpause };\n","import { simulate as pause } from './methods/pause';\nimport { simulate as unpause } from './methods/unpause';\n\nexport { pause, unpause };\n","import * as encode from './encode';\nimport * as execute from './execute';\nimport * as read from './read';\nimport * as simulate from './simulate';\n\nexport { read, simulate, execute, encode };\n","import { execute as create2Deploy } from './methods/create2Deploy';\n\nexport { create2Deploy };\n","import { read as getCreate2Address } from './methods/getCreate2Address';\n\nexport { getCreate2Address };\n","import { SimpleFactory } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport const read = async (\n client: Client,\n factoryAddress: Address,\n creationCode: Hex,\n salt: Hex,\n) => {\n return readContract(client, {\n address: factoryAddress,\n abi: SimpleFactory,\n functionName: 'computeAddress',\n args: [creationCode, salt],\n });\n};\n","import { simulate as create2Deploy } from './methods/create2Deploy';\n\nexport { create2Deploy };\n","import * as read from './read';\n\nexport { read };\n","import { read as getTermsInfo } from './methods/getTermsInfo';\nimport { read as usedDelegations } from './methods/usedDelegations';\n\nexport { getTermsInfo, usedDelegations };\n","import { SpecificActionERC20TransferBatchEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport type TermsData = {\n tokenAddress: Address;\n recipient: Address;\n amount: bigint;\n firstTarget: Address;\n firstCalldata: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<TermsData> => {\n const termsData = await readContract(client, {\n address: contractAddress,\n abi: SpecificActionERC20TransferBatchEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return termsData as TermsData;\n};\n","import { SpecificActionERC20TransferBatchEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadUsedDelegationsParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n}: ReadUsedDelegationsParameters): Promise<boolean> => {\n const isUsed = await readContract(client, {\n address: contractAddress,\n abi: SpecificActionERC20TransferBatchEnforcer,\n functionName: 'usedDelegations',\n args: [delegationManager, delegationHash],\n });\n\n return isUsed;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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;AAED,SAAO;AACT;;;AC/BA,SAAS,4CAAAE,iDAAgD;AAEzD,SAAS,gBAAAC,sBAAoB;AAStB,IAAMC,SAAO,OAAO;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuD;AACrD,QAAM,SAAS,MAAMD,eAAa,QAAQ;AAAA,IACxC,SAAS;AAAA,IACT,KAAKD;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,mBAAmB,cAAc;AAAA,EAC1C,CAAC;AAED,SAAO;AACT;","names":["encode_exports","read_exports","simulate","execute","encode_exports","encode","DelegationManager","encodeFunctionData","simulateContract","writeContract","simulate","simulateContract","DelegationManager","execute","writeContract","encode","encodeFunctionData","DelegationManager","encodeFunctionData","simulateContract","writeContract","simulate","simulateContract","DelegationManager","execute","writeContract","encode","encodeFunctionData","execute","read_exports","read","DelegationManager","DelegationManager","readContract","read","DelegationManager","readContract","read","simulate","encode_exports","execute_exports","simulate_exports","execute_exports","execute","simulate_exports","simulate","read_exports","read_exports","read","readContract","read","readContract","read","readContract","read","read_exports","read_exports","read","readContract","read","read_exports","read_exports","read","readContract","read","ERC20TransferAmountEnforcer","readContract","read","constants_exports","read_exports","simulate_exports","read_exports","read","readContract","read","HybridDeleGator","readContract","read","HybridDeleGator","readContract","read","simulate_exports","simulate","constants_exports","DOMAIN_VERSION","NAME","VERSION","NAME","VERSION","DOMAIN_VERSION","read_exports","read_exports","read","readContract","read","IdEnforcer","readContract","read","read_exports","read_exports","read","readContract","read","LimitedCallsEnforcer","readContract","read","constants_exports","encode_exports","read_exports","simulate_exports","read_exports","read","readContract","read","MultiSigDeleGator","readContract","read","MultiSigDeleGator","readContract","read","MultiSigDeleGator","readContract","read","MultiSigDeleGator","readContract","read","simulate_exports","simulate","constants_exports","read_exports","read_exports","read","readContract","read","NativeTokenTransferAmountEnforcer","readContract","read","encode_exports","execute_exports","read_exports","simulate_exports","encode_exports","encode","encodeFunctionData","simulateContract","writeContract","encode","simulate","execute","execute_exports","execute","read_exports","read","NonceEnforcer","readContract","read","NonceEnforcer","readContract","read","simulate_exports","simulate","encode_exports","execute_exports","read_exports","simulate_exports","read_exports","read","readContract","read","Ownable2Step","readContract","read","execute_exports","execute","Ownable2Step","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","Ownable2Step","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","Ownable2Step","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","encode_exports","encode","simulate_exports","simulate","encode_exports","execute_exports","read_exports","simulate_exports","read_exports","read","readContract","read","execute_exports","execute","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","encode_exports","encode","simulate_exports","simulate","encode_exports","execute_exports","read_exports","simulate_exports","execute_exports","read_exports","read","readContract","read","simulate_exports","simulate","read_exports","read_exports","read","readContract","read","SpecificActionERC20TransferBatchEnforcer","readContract","read"]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkW6HPAK4Mcjs = require('./chunk-W6HPAK4M.cjs');
|
|
4
4
|
|
|
5
5
|
// src/DelegationFramework/ERC20PeriodTransferEnforcer/index.ts
|
|
6
6
|
var ERC20PeriodTransferEnforcer_exports = {};
|
|
7
|
-
|
|
7
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, ERC20PeriodTransferEnforcer_exports, {
|
|
8
8
|
read: () => read_exports
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
// src/DelegationFramework/ERC20PeriodTransferEnforcer/read.ts
|
|
12
12
|
var read_exports = {};
|
|
13
|
-
|
|
13
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, read_exports, {
|
|
14
14
|
getAvailableAmount: () => read
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -42,13 +42,13 @@ var read = async ({
|
|
|
42
42
|
|
|
43
43
|
// src/DelegationFramework/ERC20StreamingEnforcer/index.ts
|
|
44
44
|
var ERC20StreamingEnforcer_exports = {};
|
|
45
|
-
|
|
45
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, ERC20StreamingEnforcer_exports, {
|
|
46
46
|
read: () => read_exports2
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
// src/DelegationFramework/ERC20StreamingEnforcer/read.ts
|
|
50
50
|
var read_exports2 = {};
|
|
51
|
-
|
|
51
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, read_exports2, {
|
|
52
52
|
getAvailableAmount: () => read2
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -126,13 +126,13 @@ function getAvailableAmount(allowance) {
|
|
|
126
126
|
|
|
127
127
|
// src/DelegationFramework/MultiTokenPeriodEnforcer/index.ts
|
|
128
128
|
var MultiTokenPeriodEnforcer_exports = {};
|
|
129
|
-
|
|
129
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, MultiTokenPeriodEnforcer_exports, {
|
|
130
130
|
read: () => read_exports3
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
// src/DelegationFramework/MultiTokenPeriodEnforcer/read.ts
|
|
134
134
|
var read_exports3 = {};
|
|
135
|
-
|
|
135
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, read_exports3, {
|
|
136
136
|
getAvailableAmount: () => read3
|
|
137
137
|
});
|
|
138
138
|
|
|
@@ -165,13 +165,13 @@ var read3 = async ({
|
|
|
165
165
|
|
|
166
166
|
// src/DelegationFramework/NativeTokenPeriodTransferEnforcer/index.ts
|
|
167
167
|
var NativeTokenPeriodTransferEnforcer_exports = {};
|
|
168
|
-
|
|
168
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, NativeTokenPeriodTransferEnforcer_exports, {
|
|
169
169
|
read: () => read_exports4
|
|
170
170
|
});
|
|
171
171
|
|
|
172
172
|
// src/DelegationFramework/NativeTokenPeriodTransferEnforcer/read.ts
|
|
173
173
|
var read_exports4 = {};
|
|
174
|
-
|
|
174
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, read_exports4, {
|
|
175
175
|
getAvailableAmount: () => read4
|
|
176
176
|
});
|
|
177
177
|
|
|
@@ -203,13 +203,13 @@ var read4 = async ({
|
|
|
203
203
|
|
|
204
204
|
// src/DelegationFramework/NativeTokenStreamingEnforcer/index.ts
|
|
205
205
|
var NativeTokenStreamingEnforcer_exports = {};
|
|
206
|
-
|
|
206
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, NativeTokenStreamingEnforcer_exports, {
|
|
207
207
|
read: () => read_exports5
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
// src/DelegationFramework/NativeTokenStreamingEnforcer/read.ts
|
|
211
211
|
var read_exports5 = {};
|
|
212
|
-
|
|
212
|
+
_chunkW6HPAK4Mcjs.__export.call(void 0, read_exports5, {
|
|
213
213
|
getAvailableAmount: () => read5
|
|
214
214
|
});
|
|
215
215
|
|
|
@@ -296,4 +296,4 @@ function getAvailableAmount2(allowance) {
|
|
|
296
296
|
|
|
297
297
|
|
|
298
298
|
exports.read_exports = read_exports; exports.ERC20PeriodTransferEnforcer_exports = ERC20PeriodTransferEnforcer_exports; exports.read_exports2 = read_exports2; exports.ERC20StreamingEnforcer_exports = ERC20StreamingEnforcer_exports; exports.read_exports3 = read_exports3; exports.MultiTokenPeriodEnforcer_exports = MultiTokenPeriodEnforcer_exports; exports.read_exports4 = read_exports4; exports.NativeTokenPeriodTransferEnforcer_exports = NativeTokenPeriodTransferEnforcer_exports; exports.read_exports5 = read_exports5; exports.NativeTokenStreamingEnforcer_exports = NativeTokenStreamingEnforcer_exports;
|
|
299
|
-
//# sourceMappingURL=chunk-
|
|
299
|
+
//# sourceMappingURL=chunk-PQPAEHJZ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-XZ7UMCG3.cjs","../src/DelegationFramework/ERC20PeriodTransferEnforcer/index.ts","../src/DelegationFramework/ERC20PeriodTransferEnforcer/read.ts","../src/DelegationFramework/ERC20PeriodTransferEnforcer/methods/getAvailableAmount.ts","../src/DelegationFramework/ERC20StreamingEnforcer/index.ts","../src/DelegationFramework/ERC20StreamingEnforcer/read.ts","../src/DelegationFramework/ERC20StreamingEnforcer/methods/getAvailableAmount.ts","../src/DelegationFramework/MultiTokenPeriodEnforcer/index.ts","../src/DelegationFramework/MultiTokenPeriodEnforcer/read.ts","../src/DelegationFramework/MultiTokenPeriodEnforcer/methods/getAvailableAmount.ts","../src/DelegationFramework/NativeTokenPeriodTransferEnforcer/index.ts","../src/DelegationFramework/NativeTokenPeriodTransferEnforcer/read.ts","../src/DelegationFramework/NativeTokenPeriodTransferEnforcer/methods/getAvailableAmount.ts","../src/DelegationFramework/NativeTokenStreamingEnforcer/index.ts","../src/DelegationFramework/NativeTokenStreamingEnforcer/read.ts","../src/DelegationFramework/NativeTokenStreamingEnforcer/methods/getAvailableAmount.ts"],"names":["read_exports","read","readContract","availableAmount","getBlock","getAvailableAmount"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACJA,IAAA,oCAAA,EAAA,CAAA,CAAA;AAAA,wCAAA,mCAAA,EAAA;AAAA,EAAA,IAAA,EAAA,CAAA,EAAA,GAAA;AAAA,CAAA,CAAA;ADSA;AACA;AEVA,IAAA,aAAA,EAAA,CAAA,CAAA;AAAA,wCAAA,YAAA,EAAA;AAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,GAAA;AAAA,CAAA,CAAA;AFeA;AACA;AGhBA,2DAA4C;AAE5C,uCAA6B;AAUtB,IAAM,KAAA,EAAO,MAAA,CAAO;AAAA,EACzB,MAAA;AAAA,EACA,eAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAA,EAAA,GAAwC;AACtC,EAAA,MAAM,CAAC,eAAA,EAAiB,WAAA,EAAa,aAAa,EAAA,EAAI,MAAM,mCAAA;AAAA,I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EAOjB;AAET,EAAA,GAAA,CAAI,SAAA,CAAU,iBAAA,EAAmB,SAAA,CAAU,SAAA,EAAW;AACpD,IAAA,OAAO,EAAA;AAAA,EACT;AAGA,EAAA,MAAM,QAAA,EAAU,SAAA,CAAU,iBAAA,EAAmB,SAAA,CAAU,SAAA;AAGvD,EAAA,IAAI,SAAA,EAAW,SAAA,CAAU,cAAA,EAAgB,SAAA,CAAU,gBAAA,EAAkB,OAAA;AAGrE,EAAA,GAAA,CAAI,SAAA,EAAW,SAAA,CAAU,SAAA,EAAW;AAClC,IAAA,SAAA,EAAW,SAAA,CAAU,SAAA;AAAA,EACvB;AAGA,EAAA,GAAA,CAAI,SAAA,CAAU,MAAA,GAAS,QAAA,EAAU;AAC/B,IAAA,OAAO,EAAA;AAAA,EACT;AAGA,EAAA,OAAO,SAAA,EAAW,SAAA,CAAU,KAAA;AAC9B;AfiKA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6lBAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-XZ7UMCG3.cjs","sourcesContent":[null,"import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { ERC20PeriodTransferEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationHash: Hex;\n delegationManager: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationHash,\n delegationManager,\n terms,\n}: ReadGetAvailableAmountParameters) => {\n const [availableAmount, isNewPeriod, currentPeriod] = await readContract(\n client,\n {\n address: contractAddress,\n abi: ERC20PeriodTransferEnforcer,\n functionName: 'getAvailableAmount',\n args: [delegationHash, delegationManager, terms],\n },\n );\n\n return {\n availableAmount,\n isNewPeriod,\n currentPeriod,\n };\n};\n","import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { ERC20StreamingEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract, getBlock } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n terms,\n}: ReadGetAvailableAmountParameters) => {\n // Get current block timestamp from blockchain\n const currentBlock = await getBlock(client);\n const currentTimestamp = currentBlock.timestamp;\n\n // First, get the current state from the contract\n const allowanceState = await readContract(client, {\n address: contractAddress,\n abi: ERC20StreamingEnforcer,\n functionName: 'streamingAllowances',\n args: [delegationManager, delegationHash],\n });\n\n const [initialAmount, maxAmount, amountPerSecond, startTime, spent] =\n allowanceState;\n\n // Check if state exists (startTime != 0)\n if (startTime !== 0n) {\n // State exists, calculate available amount using the stored state\n const availableAmount = getAvailableAmount({\n initialAmount,\n maxAmount,\n amountPerSecond,\n startTime,\n spent,\n currentTimestamp,\n });\n\n return {\n availableAmount,\n };\n }\n\n // State doesn't exist, decode terms and simulate with spent = 0\n const decodedTerms = await readContract(client, {\n address: contractAddress,\n abi: ERC20StreamingEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n const [\n ,\n decodedInitialAmount,\n decodedMaxAmount,\n decodedAmountPerSecond,\n decodedStartTime,\n ] = decodedTerms;\n\n // Simulate using decoded terms with spent = 0\n const availableAmount = getAvailableAmount({\n initialAmount: decodedInitialAmount,\n maxAmount: decodedMaxAmount,\n amountPerSecond: decodedAmountPerSecond,\n startTime: decodedStartTime,\n spent: 0n,\n currentTimestamp,\n });\n\n return {\n availableAmount,\n };\n};\n\n/**\n * Replicates the internal _getAvailableAmount logic from the smart contract.\n *\n * @param allowance - The allowance object containing all parameters.\n * @param allowance.initialAmount - The initial amount available.\n * @param allowance.maxAmount - The maximum amount allowed.\n * @param allowance.amountPerSecond - The amount streamed per second.\n * @param allowance.startTime - The start time of the streaming.\n * @param allowance.spent - The amount already spent.\n * @param allowance.currentTimestamp - The current timestamp.\n * @returns The available amount that can be spent.\n */\nfunction getAvailableAmount(allowance: {\n initialAmount: bigint;\n maxAmount: bigint;\n amountPerSecond: bigint;\n startTime: bigint;\n spent: bigint;\n currentTimestamp: bigint;\n}): bigint {\n // If current time is before start time, nothing is available\n if (allowance.currentTimestamp < allowance.startTime) {\n return 0n;\n }\n\n // Calculate elapsed time since start\n const elapsed = allowance.currentTimestamp - allowance.startTime;\n\n // Calculate total unlocked amount\n let unlocked = allowance.initialAmount + allowance.amountPerSecond * elapsed;\n\n // Cap by max amount\n if (unlocked > allowance.maxAmount) {\n unlocked = allowance.maxAmount;\n }\n\n // If spent >= unlocked, nothing available\n if (allowance.spent >= unlocked) {\n return 0n;\n }\n\n // Return available amount\n return unlocked - allowance.spent;\n}\n","import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { MultiTokenPeriodEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationHash: Hex;\n delegationManager: Address;\n terms: Hex;\n args: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationHash,\n delegationManager,\n terms,\n args,\n}: ReadGetAvailableAmountParameters) => {\n const [availableAmount, isNewPeriod, currentPeriod] = await readContract(\n client,\n {\n address: contractAddress,\n abi: MultiTokenPeriodEnforcer,\n functionName: 'getAvailableAmount',\n args: [delegationHash, delegationManager, terms, args],\n },\n );\n\n return {\n availableAmount,\n isNewPeriod,\n currentPeriod,\n };\n};\n","import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { NativeTokenPeriodTransferEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationHash: Hex;\n delegationManager: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationHash,\n delegationManager,\n terms,\n}: ReadGetAvailableAmountParameters) => {\n const [availableAmount, isNewPeriod, currentPeriod] = await readContract(\n client,\n {\n address: contractAddress,\n abi: NativeTokenPeriodTransferEnforcer,\n functionName: 'getAvailableAmount',\n args: [delegationHash, delegationManager, terms],\n },\n );\n\n return {\n availableAmount,\n isNewPeriod,\n currentPeriod,\n };\n};\n","import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { NativeTokenStreamingEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract, getBlock } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n terms,\n}: ReadGetAvailableAmountParameters) => {\n // Get current block timestamp from blockchain\n const currentBlock = await getBlock(client);\n const currentTimestamp = currentBlock.timestamp;\n\n // First, get the current state from the contract\n const allowanceState = await readContract(client, {\n address: contractAddress,\n abi: NativeTokenStreamingEnforcer,\n functionName: 'streamingAllowances',\n args: [delegationManager, delegationHash],\n });\n\n const [initialAmount, maxAmount, amountPerSecond, startTime, spent] =\n allowanceState;\n\n // Check if state exists (startTime != 0)\n if (startTime !== 0n) {\n // State exists, calculate available amount using the stored state\n const availableAmount = getAvailableAmount({\n initialAmount,\n maxAmount,\n amountPerSecond,\n startTime,\n spent,\n currentTimestamp,\n });\n\n return {\n availableAmount,\n };\n }\n\n // State doesn't exist, decode terms and simulate with spent = 0\n const decodedTerms = await readContract(client, {\n address: contractAddress,\n abi: NativeTokenStreamingEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n const [\n decodedInitialAmount,\n decodedMaxAmount,\n decodedAmountPerSecond,\n decodedStartTime,\n ] = decodedTerms;\n\n // Simulate using decoded terms with spent = 0\n const availableAmount = getAvailableAmount({\n initialAmount: decodedInitialAmount,\n maxAmount: decodedMaxAmount,\n amountPerSecond: decodedAmountPerSecond,\n startTime: decodedStartTime,\n spent: 0n,\n currentTimestamp,\n });\n\n return {\n availableAmount,\n };\n};\n\n/**\n * Replicates the internal _getAvailableAmount logic from the smart contract.\n *\n * @param allowance - The allowance object containing all parameters.\n * @param allowance.initialAmount - The initial amount available.\n * @param allowance.maxAmount - The maximum amount allowed.\n * @param allowance.amountPerSecond - The amount streamed per second.\n * @param allowance.startTime - The start time of the streaming.\n * @param allowance.spent - The amount already spent.\n * @param allowance.currentTimestamp - The current timestamp.\n * @returns The available amount that can be spent.\n */\nfunction getAvailableAmount(allowance: {\n initialAmount: bigint;\n maxAmount: bigint;\n amountPerSecond: bigint;\n startTime: bigint;\n spent: bigint;\n currentTimestamp: bigint;\n}): bigint {\n // If current time is before start time, nothing is available\n if (allowance.currentTimestamp < allowance.startTime) {\n return 0n;\n }\n\n // Calculate elapsed time since start\n const elapsed = allowance.currentTimestamp - allowance.startTime;\n\n // Calculate total unlocked amount\n let unlocked = allowance.initialAmount + allowance.amountPerSecond * elapsed;\n\n // Cap by max amount\n if (unlocked > allowance.maxAmount) {\n unlocked = allowance.maxAmount;\n }\n\n // If spent >= unlocked, nothing available\n if (allowance.spent >= unlocked) {\n return 0n;\n }\n\n // Return available amount\n return unlocked - allowance.spent;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-PQPAEHJZ.cjs","../src/DelegationFramework/ERC20PeriodTransferEnforcer/index.ts","../src/DelegationFramework/ERC20PeriodTransferEnforcer/read.ts","../src/DelegationFramework/ERC20PeriodTransferEnforcer/methods/getAvailableAmount.ts","../src/DelegationFramework/ERC20StreamingEnforcer/index.ts","../src/DelegationFramework/ERC20StreamingEnforcer/read.ts","../src/DelegationFramework/ERC20StreamingEnforcer/methods/getAvailableAmount.ts","../src/DelegationFramework/MultiTokenPeriodEnforcer/index.ts","../src/DelegationFramework/MultiTokenPeriodEnforcer/read.ts","../src/DelegationFramework/MultiTokenPeriodEnforcer/methods/getAvailableAmount.ts","../src/DelegationFramework/NativeTokenPeriodTransferEnforcer/index.ts","../src/DelegationFramework/NativeTokenPeriodTransferEnforcer/read.ts","../src/DelegationFramework/NativeTokenPeriodTransferEnforcer/methods/getAvailableAmount.ts","../src/DelegationFramework/NativeTokenStreamingEnforcer/index.ts","../src/DelegationFramework/NativeTokenStreamingEnforcer/read.ts","../src/DelegationFramework/NativeTokenStreamingEnforcer/methods/getAvailableAmount.ts"],"names":["read_exports","read","readContract","availableAmount","getBlock","getAvailableAmount"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACJA,IAAA,oCAAA,EAAA,CAAA,CAAA;AAAA,wCAAA,mCAAA,EAAA;AAAA,EAAA,IAAA,EAAA,CAAA,EAAA,GAAA;AAAA,CAAA,CAAA;ADSA;AACA;AEVA,IAAA,aAAA,EAAA,CAAA,CAAA;AAAA,wCAAA,YAAA,EAAA;AAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,GAAA;AAAA,CAAA,CAAA;AFeA;AACA;AGhBA,2DAA4C;AAE5C,uCAA6B;AAUtB,IAAM,KAAA,EAAO,MAAA,CAAO;AAAA,EACzB,MAAA;AAAA,EACA,eAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAA,EAAA,GAAwC;AACtC,EAAA,MAAM,CAAC,eAAA,EAAiB,WAAA,EAAa,aAAa,EAAA,EAAI,MAAM,mCAAA;AAAA,IAC1D,MAAA;AAAA,IACA;AAAA,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,SAAA,CAAU,iBAAA,EAAmB,SAAA,CAAU,SAAA,EAAW;AACpD,IAAA,OAAO,EAAA;AAAA,EACT;AAGA,EAAA,MAAM,QAAA,EAAU,SAAA,CAAU,iBAAA,EAAmB,SAAA,CAAU,SAAA;AAGvD,EAAA,IAAI,SAAA,EAAW,SAAA,CAAU,cAAA,EAAgB,SAAA,CAAU,gBAAA,EAAkB,OAAA;AAGrE,EAAA,GAAA,CAAI,SAAA,EAAW,SAAA,CAAU,SAAA,EAAW;AAClC,IAAA,SAAA,EAAW,SAAA,CAAU,SAAA;AAAA,EACvB;AAGA,EAAA,GAAA,CAAI,SAAA,CAAU,MAAA,GAAS,QAAA,EAAU;AAC/B,IAAA,OAAO,EAAA;AAAA,EACT;AAGA,EAAA,OAAO,SAAA,EAAW,SAAA,CAAU,KAAA;AAC9B;AfiKA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6lBAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-PQPAEHJZ.cjs","sourcesContent":[null,"import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { ERC20PeriodTransferEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationHash: Hex;\n delegationManager: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationHash,\n delegationManager,\n terms,\n}: ReadGetAvailableAmountParameters) => {\n const [availableAmount, isNewPeriod, currentPeriod] = await readContract(\n client,\n {\n address: contractAddress,\n abi: ERC20PeriodTransferEnforcer,\n functionName: 'getAvailableAmount',\n args: [delegationHash, delegationManager, terms],\n },\n );\n\n return {\n availableAmount,\n isNewPeriod,\n currentPeriod,\n };\n};\n","import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { ERC20StreamingEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract, getBlock } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n terms,\n}: ReadGetAvailableAmountParameters) => {\n // Get current block timestamp from blockchain\n const currentBlock = await getBlock(client);\n const currentTimestamp = currentBlock.timestamp;\n\n // First, get the current state from the contract\n const allowanceState = await readContract(client, {\n address: contractAddress,\n abi: ERC20StreamingEnforcer,\n functionName: 'streamingAllowances',\n args: [delegationManager, delegationHash],\n });\n\n const [initialAmount, maxAmount, amountPerSecond, startTime, spent] =\n allowanceState;\n\n // Check if state exists (startTime != 0)\n if (startTime !== 0n) {\n // State exists, calculate available amount using the stored state\n const availableAmount = getAvailableAmount({\n initialAmount,\n maxAmount,\n amountPerSecond,\n startTime,\n spent,\n currentTimestamp,\n });\n\n return {\n availableAmount,\n };\n }\n\n // State doesn't exist, decode terms and simulate with spent = 0\n const decodedTerms = await readContract(client, {\n address: contractAddress,\n abi: ERC20StreamingEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n const [\n ,\n decodedInitialAmount,\n decodedMaxAmount,\n decodedAmountPerSecond,\n decodedStartTime,\n ] = decodedTerms;\n\n // Simulate using decoded terms with spent = 0\n const availableAmount = getAvailableAmount({\n initialAmount: decodedInitialAmount,\n maxAmount: decodedMaxAmount,\n amountPerSecond: decodedAmountPerSecond,\n startTime: decodedStartTime,\n spent: 0n,\n currentTimestamp,\n });\n\n return {\n availableAmount,\n };\n};\n\n/**\n * Replicates the internal _getAvailableAmount logic from the smart contract.\n *\n * @param allowance - The allowance object containing all parameters.\n * @param allowance.initialAmount - The initial amount available.\n * @param allowance.maxAmount - The maximum amount allowed.\n * @param allowance.amountPerSecond - The amount streamed per second.\n * @param allowance.startTime - The start time of the streaming.\n * @param allowance.spent - The amount already spent.\n * @param allowance.currentTimestamp - The current timestamp.\n * @returns The available amount that can be spent.\n */\nfunction getAvailableAmount(allowance: {\n initialAmount: bigint;\n maxAmount: bigint;\n amountPerSecond: bigint;\n startTime: bigint;\n spent: bigint;\n currentTimestamp: bigint;\n}): bigint {\n // If current time is before start time, nothing is available\n if (allowance.currentTimestamp < allowance.startTime) {\n return 0n;\n }\n\n // Calculate elapsed time since start\n const elapsed = allowance.currentTimestamp - allowance.startTime;\n\n // Calculate total unlocked amount\n let unlocked = allowance.initialAmount + allowance.amountPerSecond * elapsed;\n\n // Cap by max amount\n if (unlocked > allowance.maxAmount) {\n unlocked = allowance.maxAmount;\n }\n\n // If spent >= unlocked, nothing available\n if (allowance.spent >= unlocked) {\n return 0n;\n }\n\n // Return available amount\n return unlocked - allowance.spent;\n}\n","import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { MultiTokenPeriodEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationHash: Hex;\n delegationManager: Address;\n terms: Hex;\n args: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationHash,\n delegationManager,\n terms,\n args,\n}: ReadGetAvailableAmountParameters) => {\n const [availableAmount, isNewPeriod, currentPeriod] = await readContract(\n client,\n {\n address: contractAddress,\n abi: MultiTokenPeriodEnforcer,\n functionName: 'getAvailableAmount',\n args: [delegationHash, delegationManager, terms, args],\n },\n );\n\n return {\n availableAmount,\n isNewPeriod,\n currentPeriod,\n };\n};\n","import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { NativeTokenPeriodTransferEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationHash: Hex;\n delegationManager: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationHash,\n delegationManager,\n terms,\n}: ReadGetAvailableAmountParameters) => {\n const [availableAmount, isNewPeriod, currentPeriod] = await readContract(\n client,\n {\n address: contractAddress,\n abi: NativeTokenPeriodTransferEnforcer,\n functionName: 'getAvailableAmount',\n args: [delegationHash, delegationManager, terms],\n },\n );\n\n return {\n availableAmount,\n isNewPeriod,\n currentPeriod,\n };\n};\n","import * as read from './read';\n\nexport { read };\n","import { read as getAvailableAmount } from './methods/getAvailableAmount';\n\nexport { getAvailableAmount };\n","import { NativeTokenStreamingEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract, getBlock } from 'viem/actions';\n\nexport type ReadGetAvailableAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n terms,\n}: ReadGetAvailableAmountParameters) => {\n // Get current block timestamp from blockchain\n const currentBlock = await getBlock(client);\n const currentTimestamp = currentBlock.timestamp;\n\n // First, get the current state from the contract\n const allowanceState = await readContract(client, {\n address: contractAddress,\n abi: NativeTokenStreamingEnforcer,\n functionName: 'streamingAllowances',\n args: [delegationManager, delegationHash],\n });\n\n const [initialAmount, maxAmount, amountPerSecond, startTime, spent] =\n allowanceState;\n\n // Check if state exists (startTime != 0)\n if (startTime !== 0n) {\n // State exists, calculate available amount using the stored state\n const availableAmount = getAvailableAmount({\n initialAmount,\n maxAmount,\n amountPerSecond,\n startTime,\n spent,\n currentTimestamp,\n });\n\n return {\n availableAmount,\n };\n }\n\n // State doesn't exist, decode terms and simulate with spent = 0\n const decodedTerms = await readContract(client, {\n address: contractAddress,\n abi: NativeTokenStreamingEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n const [\n decodedInitialAmount,\n decodedMaxAmount,\n decodedAmountPerSecond,\n decodedStartTime,\n ] = decodedTerms;\n\n // Simulate using decoded terms with spent = 0\n const availableAmount = getAvailableAmount({\n initialAmount: decodedInitialAmount,\n maxAmount: decodedMaxAmount,\n amountPerSecond: decodedAmountPerSecond,\n startTime: decodedStartTime,\n spent: 0n,\n currentTimestamp,\n });\n\n return {\n availableAmount,\n };\n};\n\n/**\n * Replicates the internal _getAvailableAmount logic from the smart contract.\n *\n * @param allowance - The allowance object containing all parameters.\n * @param allowance.initialAmount - The initial amount available.\n * @param allowance.maxAmount - The maximum amount allowed.\n * @param allowance.amountPerSecond - The amount streamed per second.\n * @param allowance.startTime - The start time of the streaming.\n * @param allowance.spent - The amount already spent.\n * @param allowance.currentTimestamp - The current timestamp.\n * @returns The available amount that can be spent.\n */\nfunction getAvailableAmount(allowance: {\n initialAmount: bigint;\n maxAmount: bigint;\n amountPerSecond: bigint;\n startTime: bigint;\n spent: bigint;\n currentTimestamp: bigint;\n}): bigint {\n // If current time is before start time, nothing is available\n if (allowance.currentTimestamp < allowance.startTime) {\n return 0n;\n }\n\n // Calculate elapsed time since start\n const elapsed = allowance.currentTimestamp - allowance.startTime;\n\n // Calculate total unlocked amount\n let unlocked = allowance.initialAmount + allowance.amountPerSecond * elapsed;\n\n // Cap by max amount\n if (unlocked > allowance.maxAmount) {\n unlocked = allowance.maxAmount;\n }\n\n // If spent >= unlocked, nothing available\n if (allowance.spent >= unlocked) {\n return 0n;\n }\n\n // Return available amount\n return unlocked - allowance.spent;\n}\n"]}
|