@metamask/smart-accounts-kit 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +63 -29
  2. package/dist/actions/index.cjs +5 -6
  3. package/dist/actions/index.cjs.map +1 -1
  4. package/dist/actions/index.d.cts +3 -3
  5. package/dist/actions/index.d.ts +3 -3
  6. package/dist/actions/index.mjs +4 -5
  7. package/dist/{caveats-DQ6HoAHe.d.ts → caveats-BEKgygS8.d.cts} +1 -2
  8. package/dist/{caveats-CaSt_VHs.d.cts → caveats-DPuxVdYU.d.ts} +1 -2
  9. package/dist/{chunk-SOFB2MXG.cjs → chunk-2OS36DVV.cjs} +8 -1
  10. package/dist/chunk-2OS36DVV.cjs.map +1 -0
  11. package/dist/{chunk-FH6HZCHI.cjs → chunk-32RDDE5N.cjs} +200 -18
  12. package/dist/chunk-32RDDE5N.cjs.map +1 -0
  13. package/dist/{chunk-MV2KHN75.mjs → chunk-3KWKQ7PV.mjs} +163 -35
  14. package/dist/chunk-3KWKQ7PV.mjs.map +1 -0
  15. package/dist/{chunk-DN4O5VOP.cjs → chunk-4GOGI2TA.cjs} +158 -151
  16. package/dist/chunk-4GOGI2TA.cjs.map +1 -0
  17. package/dist/{chunk-XEOE25DE.cjs → chunk-6TSLFRJC.cjs} +98 -68
  18. package/dist/chunk-6TSLFRJC.cjs.map +1 -0
  19. package/dist/{chunk-W7O2UQL5.mjs → chunk-EMPAUTIV.mjs} +188 -6
  20. package/dist/chunk-EMPAUTIV.mjs.map +1 -0
  21. package/dist/{chunk-IBZSNB7D.cjs → chunk-GHGCGV3C.cjs} +202 -74
  22. package/dist/chunk-GHGCGV3C.cjs.map +1 -0
  23. package/dist/{chunk-QCULIK3O.mjs → chunk-GMGJRC3D.mjs} +8 -1
  24. package/dist/chunk-GMGJRC3D.mjs.map +1 -0
  25. package/dist/{chunk-TBHT26BV.mjs → chunk-IERUQUKJ.mjs} +67 -60
  26. package/dist/chunk-IERUQUKJ.mjs.map +1 -0
  27. package/dist/chunk-IMO6XNDJ.mjs +14 -0
  28. package/dist/chunk-IMO6XNDJ.mjs.map +1 -0
  29. package/dist/chunk-IQT6XFDT.cjs +14 -0
  30. package/dist/chunk-IQT6XFDT.cjs.map +1 -0
  31. package/dist/{chunk-SCS3CFRE.cjs → chunk-KIXYMA7J.cjs} +15 -17
  32. package/dist/chunk-KIXYMA7J.cjs.map +1 -0
  33. package/dist/{chunk-YXHUT56Z.mjs → chunk-T6SWQZRX.mjs} +4 -6
  34. package/dist/{chunk-YXHUT56Z.mjs.map → chunk-T6SWQZRX.mjs.map} +1 -1
  35. package/dist/{chunk-BGOSYTKV.mjs → chunk-XUBMIW33.mjs} +38 -8
  36. package/dist/chunk-XUBMIW33.mjs.map +1 -0
  37. package/dist/{chunk-N66VAWMO.mjs → chunk-YCNLPEPH.mjs} +2 -2
  38. package/dist/{chunk-7FYDQNJ3.cjs → chunk-YPUEM6YV.cjs} +12 -12
  39. package/dist/{chunk-7FYDQNJ3.cjs.map → chunk-YPUEM6YV.cjs.map} +1 -1
  40. package/dist/contracts/index.cjs +5 -6
  41. package/dist/contracts/index.cjs.map +1 -1
  42. package/dist/contracts/index.d.cts +4 -4
  43. package/dist/contracts/index.d.ts +4 -4
  44. package/dist/contracts/index.mjs +4 -5
  45. package/dist/{delegation-DbPGWKfP.d.ts → decodeRevertReason-CSOClzsa.d.cts} +11 -3
  46. package/dist/{delegation-BKkEyxZY.d.cts → decodeRevertReason-WjHVQ_Sz.d.ts} +11 -3
  47. package/dist/experimental/index.cjs +392 -9
  48. package/dist/experimental/index.cjs.map +1 -1
  49. package/dist/experimental/index.d.cts +41 -3
  50. package/dist/experimental/index.d.ts +41 -3
  51. package/dist/experimental/index.mjs +385 -2
  52. package/dist/experimental/index.mjs.map +1 -1
  53. package/dist/index-BHm75OFP.d.cts +61 -0
  54. package/dist/{index-DXdlz7t4.d.ts → index-BNHYZ9iU.d.ts} +99 -93
  55. package/dist/{index-G78z6nwi.d.ts → index-CgGKjHSr.d.ts} +13 -5
  56. package/dist/{index-yU3olCJV.d.cts → index-CsjbdUp_.d.cts} +99 -93
  57. package/dist/index-DWvEgBtg.d.ts +61 -0
  58. package/dist/{index-DfDAuvr5.d.cts → index-DYJjOeTn.d.cts} +13 -5
  59. package/dist/index.cjs +22 -24
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +8 -8
  62. package/dist/index.d.ts +8 -8
  63. package/dist/index.mjs +9 -11
  64. package/dist/index.mjs.map +1 -1
  65. package/dist/{resolveCaveats-DiqGB-T5.d.cts → resolveCaveats-aQPEogPk.d.cts} +160 -62
  66. package/dist/{resolveCaveats-s2snaFEo.d.ts → resolveCaveats-aQPEogPk.d.ts} +160 -62
  67. package/dist/utils/index.cjs +13 -6
  68. package/dist/utils/index.cjs.map +1 -1
  69. package/dist/utils/index.d.cts +8 -5
  70. package/dist/utils/index.d.ts +8 -5
  71. package/dist/utils/index.mjs +16 -9
  72. package/package.json +13 -12
  73. package/dist/chunk-4QXIOE7F.mjs +0 -79
  74. package/dist/chunk-4QXIOE7F.mjs.map +0 -1
  75. package/dist/chunk-BGOSYTKV.mjs.map +0 -1
  76. package/dist/chunk-DN4O5VOP.cjs.map +0 -1
  77. package/dist/chunk-FH6HZCHI.cjs.map +0 -1
  78. package/dist/chunk-IBZSNB7D.cjs.map +0 -1
  79. package/dist/chunk-MOHCTPYQ.cjs +0 -79
  80. package/dist/chunk-MOHCTPYQ.cjs.map +0 -1
  81. package/dist/chunk-MV2KHN75.mjs.map +0 -1
  82. package/dist/chunk-QCULIK3O.mjs.map +0 -1
  83. package/dist/chunk-SCS3CFRE.cjs.map +0 -1
  84. package/dist/chunk-SOFB2MXG.cjs.map +0 -1
  85. package/dist/chunk-TBHT26BV.mjs.map +0 -1
  86. package/dist/chunk-W7O2UQL5.mjs.map +0 -1
  87. package/dist/chunk-XEOE25DE.cjs.map +0 -1
  88. package/dist/types-BWaH4KH1.d.cts +0 -155
  89. package/dist/types-BWaH4KH1.d.ts +0 -155
  90. /package/dist/{chunk-N66VAWMO.mjs.map → chunk-YCNLPEPH.mjs.map} +0 -0
@@ -4,8 +4,9 @@ import {
4
4
  MultiTokenPeriodEnforcer_exports,
5
5
  NativeTokenPeriodTransferEnforcer_exports,
6
6
  NativeTokenStreamingEnforcer_exports
7
- } from "./chunk-N66VAWMO.mjs";
7
+ } from "./chunk-YCNLPEPH.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-W7O2UQL5.mjs";
42
- import {
43
- encodeExecutionCalldatas
44
- } from "./chunk-4QXIOE7F.mjs";
42
+ } from "./chunk-EMPAUTIV.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-MV2KHN75.mjs";
50
+ } from "./chunk-3KWKQ7PV.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/encode.ts
105
- var encode_exports5 = {};
106
- __export(encode_exports5, {
107
- disableDelegation: () => encode,
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/disableDelegation.ts
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
- delegation
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: "disableDelegation",
126
- args: [delegationStruct]
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
- delegation
135
+ delegations,
136
+ modes,
137
+ executions
133
138
  }) => {
134
139
  const { request } = await simulate19({
135
140
  client,
136
141
  delegationManagerAddress,
137
- delegation
142
+ delegations,
143
+ modes,
144
+ executions
138
145
  });
139
146
  return writeContract(client, request);
140
147
  };
141
- var encode = ({ delegation }) => {
142
- const delegationStruct = toDelegationStruct(delegation);
148
+ var encode = ({
149
+ delegations,
150
+ modes,
151
+ executions
152
+ }) => {
143
153
  return encodeFunctionData({
144
154
  abi: DelegationManager,
145
- functionName: "disableDelegation",
146
- args: [delegationStruct]
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/methods/enableDelegation.ts
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: "enableDelegation",
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: "enableDelegation",
206
+ functionName: "disableDelegation",
184
207
  args: [delegationStruct]
185
208
  });
186
209
  };
187
210
 
188
- // src/DelegationFramework/DelegationManager/methods/redeemDelegations.ts
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
- delegations,
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: "redeemDelegations",
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
- delegations,
214
- modes,
215
- executions
231
+ delegation
216
232
  }) => {
217
233
  const { request } = await simulate21({
218
234
  client,
219
235
  delegationManagerAddress,
220
- delegations,
221
- modes,
222
- executions
236
+ delegation
223
237
  });
224
238
  return writeContract3(client, request);
225
239
  };
226
- var encode3 = ({
227
- delegations,
228
- modes,
229
- executions
230
- }) => {
240
+ var encode3 = ({ delegation }) => {
241
+ const delegationStruct = toDelegationStruct(delegation);
231
242
  return encodeFunctionData3({
232
243
  abi: DelegationManager3,
233
- functionName: "redeemDelegations",
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: () => execute7,
246
- enableDelegation: () => execute8,
247
- redeemDelegations: () => execute9
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: () => simulate19,
300
- enableDelegation: () => simulate20,
301
- redeemDelegations: () => simulate21
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-TBHT26BV.mjs.map
1328
+ //# sourceMappingURL=chunk-IERUQUKJ.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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IACT,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,KAAK;AAAA,EACd,CAAC;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"]}
@@ -0,0 +1,14 @@
1
+ // src/utils/index.ts
2
+ import { toHex } from "viem";
3
+ function generateSalt() {
4
+ if (typeof globalThis.crypto?.getRandomValues !== "function") {
5
+ throw new Error("Secure randomness is unavailable in this runtime");
6
+ }
7
+ const randomValues = globalThis.crypto.getRandomValues(new Uint8Array(32));
8
+ return toHex(randomValues);
9
+ }
10
+
11
+ export {
12
+ generateSalt
13
+ };
14
+ //# sourceMappingURL=chunk-IMO6XNDJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["import { toHex } from 'viem';\n\nexport { decodeCaveat } from '../caveats';\n\nexport {\n decodeRevertData,\n decodeRevertReason,\n type DecodedRevertReason,\n} from '../decodeRevertReason';\n\nexport {\n encodeDelegations,\n decodeDelegations,\n encodeDelegation,\n decodeDelegation,\n hashDelegation,\n toDelegationStruct,\n toDelegation,\n DELEGATION_ARRAY_ABI_TYPE,\n DELEGATION_ABI_TYPE,\n DELEGATION_ABI_TYPE_COMPONENTS,\n DELEGATION_TYPEHASH,\n SIGNABLE_DELEGATION_TYPED_DATA,\n} from '../delegation';\n\nexport type { DelegationStruct } from '../delegation';\n\nexport {\n encodeExecutionCalldata,\n encodeExecutionCalldatas,\n encodeSingleExecution,\n encodeBatchExecution,\n} from '../executions';\n\nexport type { ExecutionStruct } from '../executions';\n\nexport type { AuthenticatorFlags } from '../webAuthn';\n\nexport { SIGNATURE_ABI_PARAMS } from '../webAuthn';\n\nexport { SIGNABLE_USER_OP_TYPED_DATA } from '../userOp';\n\nexport { encodeCalls, encodeCallsForCaller } from '../encodeCalls';\n\nexport { getCounterfactualAccountData } from '../counterfactualAccountData';\n\nexport {\n overrideDeployedEnvironment,\n deploySmartAccountsEnvironment,\n} from '../smartAccountsEnvironment';\n\nexport type { CoreCaveatBuilder, CaveatBuilderConfig } from '../caveatBuilder';\n\nexport { createCaveatBuilder, CaveatBuilder } from '../caveatBuilder';\n\n/**\n * Generates a cryptographically secure random salt.\n *\n * @returns A 32-byte hex salt.\n */\nexport function generateSalt() {\n if (typeof globalThis.crypto?.getRandomValues !== 'function') {\n throw new Error('Secure randomness is unavailable in this runtime');\n }\n\n const randomValues = globalThis.crypto.getRandomValues(new Uint8Array(32));\n return toHex(randomValues);\n}\n"],"mappings":";AAAA,SAAS,aAAa;AA4Df,SAAS,eAAe;AAC7B,MAAI,OAAO,WAAW,QAAQ,oBAAoB,YAAY;AAC5D,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AAEA,QAAM,eAAe,WAAW,OAAO,gBAAgB,IAAI,WAAW,EAAE,CAAC;AACzE,SAAO,MAAM,YAAY;AAC3B;","names":[]}
@@ -0,0 +1,14 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/utils/index.ts
2
+ var _viem = require('viem');
3
+ function generateSalt() {
4
+ if (typeof _optionalChain([globalThis, 'access', _ => _.crypto, 'optionalAccess', _2 => _2.getRandomValues]) !== "function") {
5
+ throw new Error("Secure randomness is unavailable in this runtime");
6
+ }
7
+ const randomValues = globalThis.crypto.getRandomValues(new Uint8Array(32));
8
+ return _viem.toHex.call(void 0, randomValues);
9
+ }
10
+
11
+
12
+
13
+ exports.generateSalt = generateSalt;
14
+ //# sourceMappingURL=chunk-IQT6XFDT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-IQT6XFDT.cjs","../src/utils/index.ts"],"names":[],"mappings":"AAAA;ACAA,4BAAsB;AA4Df,SAAS,YAAA,CAAA,EAAe;AAC7B,EAAA,GAAA,CAAI,uBAAO,UAAA,mBAAW,MAAA,6BAAQ,kBAAA,IAAoB,UAAA,EAAY;AAC5D,IAAA,MAAM,IAAI,KAAA,CAAM,kDAAkD,CAAA;AAAA,EACpE;AAEA,EAAA,MAAM,aAAA,EAAe,UAAA,CAAW,MAAA,CAAO,eAAA,CAAgB,IAAI,UAAA,CAAW,EAAE,CAAC,CAAA;AACzE,EAAA,OAAO,yBAAA,YAAkB,CAAA;AAC3B;AD1DA;AACA;AACE;AACF,oCAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-IQT6XFDT.cjs","sourcesContent":[null,"import { toHex } from 'viem';\n\nexport { decodeCaveat } from '../caveats';\n\nexport {\n decodeRevertData,\n decodeRevertReason,\n type DecodedRevertReason,\n} from '../decodeRevertReason';\n\nexport {\n encodeDelegations,\n decodeDelegations,\n encodeDelegation,\n decodeDelegation,\n hashDelegation,\n toDelegationStruct,\n toDelegation,\n DELEGATION_ARRAY_ABI_TYPE,\n DELEGATION_ABI_TYPE,\n DELEGATION_ABI_TYPE_COMPONENTS,\n DELEGATION_TYPEHASH,\n SIGNABLE_DELEGATION_TYPED_DATA,\n} from '../delegation';\n\nexport type { DelegationStruct } from '../delegation';\n\nexport {\n encodeExecutionCalldata,\n encodeExecutionCalldatas,\n encodeSingleExecution,\n encodeBatchExecution,\n} from '../executions';\n\nexport type { ExecutionStruct } from '../executions';\n\nexport type { AuthenticatorFlags } from '../webAuthn';\n\nexport { SIGNATURE_ABI_PARAMS } from '../webAuthn';\n\nexport { SIGNABLE_USER_OP_TYPED_DATA } from '../userOp';\n\nexport { encodeCalls, encodeCallsForCaller } from '../encodeCalls';\n\nexport { getCounterfactualAccountData } from '../counterfactualAccountData';\n\nexport {\n overrideDeployedEnvironment,\n deploySmartAccountsEnvironment,\n} from '../smartAccountsEnvironment';\n\nexport type { CoreCaveatBuilder, CaveatBuilderConfig } from '../caveatBuilder';\n\nexport { createCaveatBuilder, CaveatBuilder } from '../caveatBuilder';\n\n/**\n * Generates a cryptographically secure random salt.\n *\n * @returns A 32-byte hex salt.\n */\nexport function generateSalt() {\n if (typeof globalThis.crypto?.getRandomValues !== 'function') {\n throw new Error('Secure randomness is unavailable in this runtime');\n }\n\n const randomValues = globalThis.crypto.getRandomValues(new Uint8Array(32));\n return toHex(randomValues);\n}\n"]}
@@ -5,14 +5,12 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkFH6HZCHIcjs = require('./chunk-FH6HZCHI.cjs');
8
+ var _chunk32RDDE5Ncjs = require('./chunk-32RDDE5N.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
13
12
 
14
-
15
- var _chunkIBZSNB7Dcjs = require('./chunk-IBZSNB7D.cjs');
13
+ var _chunkGHGCGV3Ccjs = require('./chunk-GHGCGV3C.cjs');
16
14
 
17
15
  // src/counterfactualAccountData.ts
18
16
  var _viem = require('viem');
@@ -48,7 +46,7 @@ var getCounterfactualAccountData = async ({
48
46
  y: yValue
49
47
  };
50
48
  });
51
- initcode = _chunkFH6HZCHIcjs.encode.call(void 0, { eoaOwner: owner, p256Owners });
49
+ initcode = _chunk32RDDE5Ncjs.encode.call(void 0, { eoaOwner: owner, p256Owners });
52
50
  break;
53
51
  }
54
52
  case "MultiSig" /* MultiSig */: {
@@ -59,7 +57,7 @@ var getCounterfactualAccountData = async ({
59
57
  );
60
58
  }
61
59
  implementationAddress = implementations.MultiSigDeleGatorImpl;
62
- initcode = _chunkFH6HZCHIcjs.encode2.call(void 0, { owners, threshold });
60
+ initcode = _chunk32RDDE5Ncjs.encode2.call(void 0, { owners, threshold });
63
61
  break;
64
62
  }
65
63
  case "Stateless7702" /* Stateless7702 */:
@@ -67,7 +65,7 @@ var getCounterfactualAccountData = async ({
67
65
  throw new Error(`Implementation type '${implementation}' not supported`);
68
66
  }
69
67
  const salt = _viem.pad.call(void 0, deploySalt, { dir: "left", size: 32 });
70
- const proxyCreationCode = _chunkFH6HZCHIcjs.encodeProxyCreationCode.call(void 0, {
68
+ const proxyCreationCode = _chunk32RDDE5Ncjs.encodeProxyCreationCode.call(void 0, {
71
69
  implementationAddress,
72
70
  initcode
73
71
  });
@@ -77,7 +75,7 @@ var getCounterfactualAccountData = async ({
77
75
  opcode: "CREATE2",
78
76
  salt
79
77
  });
80
- const factoryData = _chunkFH6HZCHIcjs.encode3.call(void 0, proxyCreationCode, salt);
78
+ const factoryData = _chunk32RDDE5Ncjs.encode3.call(void 0, proxyCreationCode, salt);
81
79
  return {
82
80
  factoryData,
83
81
  address
@@ -98,21 +96,21 @@ var processDelegatedCall = (call) => {
98
96
  value,
99
97
  data: callData
100
98
  } = call;
101
- const callAsExecution = _chunkMOHCTPYQcjs.createExecution.call(void 0, { target, value, callData });
99
+ const callAsExecution = _chunkGHGCGV3Ccjs.createExecution.call(void 0, { target, value, callData });
102
100
  if (!permissionContext) {
103
101
  return callAsExecution;
104
102
  }
105
- const encodedPermissionsContext = _chunkIBZSNB7Dcjs.encodeDelegations.call(void 0, permissionContext);
103
+ const encodedPermissionsContext = _chunkGHGCGV3Ccjs.encodeDelegations.call(void 0, permissionContext);
106
104
  const redeemCalldata = _viem.encodeFunctionData.call(void 0, {
107
105
  abi: _delegationabis.DelegationManager,
108
106
  functionName: "redeemDelegations",
109
107
  args: [
110
108
  [encodedPermissionsContext],
111
109
  ["0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */],
112
- _chunkMOHCTPYQcjs.encodeExecutionCalldatas.call(void 0, [[callAsExecution]])
110
+ _chunkGHGCGV3Ccjs.encodeExecutionCalldatas.call(void 0, [[callAsExecution]])
113
111
  ]
114
112
  });
115
- return _chunkMOHCTPYQcjs.createExecution.call(void 0, {
113
+ return _chunkGHGCGV3Ccjs.createExecution.call(void 0, {
116
114
  target: delegationManager,
117
115
  callData: redeemCalldata
118
116
  });
@@ -122,8 +120,8 @@ var encodeCalls = (calls) => {
122
120
  const call = calls[0];
123
121
  if (call && !isDelegatedCall(call)) {
124
122
  const { to: target, value, data: callData } = call;
125
- const execution = _chunkMOHCTPYQcjs.createExecution.call(void 0, { target, value, callData });
126
- return _chunkFH6HZCHIcjs.encode4.call(void 0, { execution });
123
+ const execution = _chunkGHGCGV3Ccjs.createExecution.call(void 0, { target, value, callData });
124
+ return _chunk32RDDE5Ncjs.encode4.call(void 0, { execution });
127
125
  }
128
126
  }
129
127
  const executions = calls.map((call) => {
@@ -131,10 +129,10 @@ var encodeCalls = (calls) => {
131
129
  return processDelegatedCall(call);
132
130
  }
133
131
  const { to: target, value, data: callData } = call;
134
- return _chunkMOHCTPYQcjs.createExecution.call(void 0, { target, value, callData });
132
+ return _chunkGHGCGV3Ccjs.createExecution.call(void 0, { target, value, callData });
135
133
  });
136
134
  const mode = calls.length === 1 ? "0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */ : "0x0100000000000000000000000000000000000000000000000000000000000000" /* BatchDefault */;
137
- return _chunkFH6HZCHIcjs.encode5.call(void 0, { mode, executions });
135
+ return _chunk32RDDE5Ncjs.encode5.call(void 0, { mode, executions });
138
136
  };
139
137
  var encodeCallsForCaller = async (caller, calls) => {
140
138
  if (calls.length === 1) {
@@ -255,4 +253,4 @@ var createDummyWebAuthnSignature = (keyId) => {
255
253
 
256
254
 
257
255
  exports.getCounterfactualAccountData = getCounterfactualAccountData; exports.encodeCalls = encodeCalls; exports.encodeCallsForCaller = encodeCallsForCaller; exports.SIGNATURE_ABI_PARAMS = SIGNATURE_ABI_PARAMS; exports.encodeDeleGatorSignature = encodeDeleGatorSignature; exports.createDummyWebAuthnSignature = createDummyWebAuthnSignature;
258
- //# sourceMappingURL=chunk-SCS3CFRE.cjs.map
256
+ //# sourceMappingURL=chunk-KIXYMA7J.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-KIXYMA7J.cjs","../src/counterfactualAccountData.ts","../src/encodeCalls.ts","../src/webAuthn.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACbA,4BAAwC;AA6BjC,IAAM,6BAAA,EAA+B,MAAA,CAE1C;AAAA,EACA,OAAA;AAAA,EACA,eAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAA,EAAA,GAMuD;AACrD,EAAA,IAAI,qBAAA;AACJ,EAAA,IAAI,QAAA;AAEJ,EAAA,OAAA,CAAQ,cAAA,EAAgB;AAAA,IACtB,KAAA,qBAAA,EAA4B;AAC1B,MAAA,MAAM,CAAC,KAAA,EAAO,MAAA,EAAQ,OAAA,EAAS,OAAO,EAAA,EACpC,YAAA;AAEF,MAAA,GAAA,CAAI,CAAC,eAAA,CAAgB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A;AACA,EAAA;AAEA,EAAA;AACA,EAAA;AAEA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AAEA,EAAA;AAAmE,IAAA;AACjE,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AAGF,EAAA;AACF;AH4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-KIXYMA7J.cjs","sourcesContent":[null,"import type { Address, Hex } from 'viem';\nimport { getContractAddress, pad } from 'viem';\n\nimport { Implementation } from './constants';\nimport { initializeHybridDeleGator } from './DelegationFramework/HybridDeleGator/encode';\nimport { initializeMultiSigDeleGator } from './DelegationFramework/MultiSigDeleGator/encode';\nimport { create2Deploy as encodeCreate2Deploy } from './DelegationFramework/SimpleFactory/encode';\nimport { encodeProxyCreationCode } from './DelegationFramework/utils';\nimport type {\n SmartAccountsEnvironment,\n HybridDeleGatorDeployParams,\n MultiSigDeleGatorDeployParams,\n DeployParams,\n} from './types';\n\n/**\n * Infers counterfactual account data for a DeleGator smart account.\n *\n * @template TImplementation - The type of implementation, extending Implementation.\n * @template TDeployParams - The type of deployment parameters, defaults to DeployParams<Implementation>.\n * @param options - The options for generating counterfactual account data.\n * @param options.factory - The address of the SimpleFactory contract.\n * @param options.implementations - The DeleGator implementation contracts.\n * @param options.implementation - The implementation type to use.\n * @param options.deployParams - The deployment parameters for the specified implementation.\n * @param options.deploySalt - The salt to use for CREATE2 address computation.\n * @returns An object containing the counterfactual address and factory calldata.\n * @description This function calculates the address a DeleGator contract would have if deployed,\n * and provides the calldata needed to deploy it.\n */\nexport const getCounterfactualAccountData = async <\n TImplementation extends Implementation,\n>({\n factory,\n implementations,\n implementation,\n deployParams,\n deploySalt,\n}: {\n factory: Address;\n implementations: SmartAccountsEnvironment['implementations'];\n implementation: TImplementation;\n deployParams: DeployParams<TImplementation>;\n deploySalt: Hex;\n}): Promise<{ factoryData: Hex; address: Address }> => {\n let implementationAddress: Address;\n let initcode: Hex;\n\n switch (implementation) {\n case Implementation.Hybrid: {\n const [owner, keyIds, xValues, yValues] =\n deployParams as HybridDeleGatorDeployParams;\n\n if (!implementations.HybridDeleGatorImpl) {\n throw new Error(\n 'HybridDeleGatorImpl address not provided in environment',\n );\n }\n\n implementationAddress = implementations.HybridDeleGatorImpl;\n\n const p256Owners = keyIds.map((keyId, index) => {\n const xValue = xValues[index];\n const yValue = yValues[index];\n\n if (!xValue || !yValue) {\n throw new Error(\n `Missing X or Y value for keyId ${keyId} at index ${index}`,\n );\n }\n\n return {\n keyId,\n x: xValue,\n y: yValue,\n };\n });\n\n initcode = initializeHybridDeleGator({ eoaOwner: owner, p256Owners });\n break;\n }\n case Implementation.MultiSig: {\n const [owners, threshold] = deployParams as MultiSigDeleGatorDeployParams;\n\n if (!implementations.MultiSigDeleGatorImpl) {\n throw new Error(\n 'MultiSigDeleGatorImpl address not provided in environment',\n );\n }\n\n implementationAddress = implementations.MultiSigDeleGatorImpl;\n initcode = initializeMultiSigDeleGator({ owners, threshold });\n break;\n }\n case Implementation.Stateless7702:\n default:\n throw new Error(`Implementation type '${implementation}' not supported`);\n }\n\n const salt = pad(deploySalt, { dir: 'left', size: 32 });\n\n const proxyCreationCode = encodeProxyCreationCode({\n implementationAddress,\n initcode,\n });\n\n const address = getContractAddress({\n bytecode: proxyCreationCode,\n from: factory,\n opcode: 'CREATE2',\n salt,\n });\n\n const factoryData = encodeCreate2Deploy(proxyCreationCode, salt);\n\n return {\n factoryData,\n address,\n };\n};\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport { encodeFunctionData } from 'viem';\nimport type { Address, Hex } from 'viem';\n\nimport type { DelegatedCall } from './actions/erc7710RedeemDelegationAction';\nimport { encodeDelegations } from './delegation';\nimport {\n execute,\n executeWithMode,\n} from './DelegationFramework/DeleGatorCore/encode';\nimport {\n ExecutionMode,\n createExecution,\n encodeExecutionCalldatas,\n} from './executions';\nimport type { Call } from './types';\n\n/**\n * Checks if a call is a delegated call by checking for the presence of permissionContext and delegationManager.\n *\n * @param call - The call to check.\n * @returns True if the call is a delegated call, false otherwise.\n */\nconst isDelegatedCall = (call: Call): call is DelegatedCall => {\n return 'permissionContext' in call && 'delegationManager' in call;\n};\n\n/**\n * If there's a single call with permissionContext and delegationManager,\n * processes it as a delegated call.\n *\n * @param call - The call to process.\n * @returns The execution object for the delegated call.\n * @description\n * This function creates an execution that calls redeemDelegations on the delegation manager.\n */\nconst processDelegatedCall = (call: DelegatedCall) => {\n const {\n permissionContext,\n delegationManager,\n to: target,\n value,\n data: callData,\n } = call;\n\n const callAsExecution = createExecution({ target, value, callData });\n\n if (!permissionContext) {\n return callAsExecution;\n }\n\n const encodedPermissionsContext = encodeDelegations(permissionContext);\n\n const redeemCalldata = encodeFunctionData({\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [\n [encodedPermissionsContext],\n [ExecutionMode.SingleDefault],\n encodeExecutionCalldatas([[callAsExecution]]),\n ],\n });\n\n return createExecution({\n target: delegationManager,\n callData: redeemCalldata,\n });\n};\n\n/**\n * If there's a single call, encode the shorthand `execute` function. Otherwise, encode the `executeWithMode` function. Execution type will always be \"default\".\n *\n * @param calls - The calls to execute.\n * @returns The encoded calldata for the DeleGator to execute the calls.\n * @description\n * This function supports both single and batch execution modes.\n * For single calls, it uses the gas-efficient execute function.\n */\nexport const encodeCalls = (calls: readonly Call[]) => {\n if (calls.length === 1) {\n const call = calls[0];\n if (call && !isDelegatedCall(call)) {\n const { to: target, value, data: callData } = call;\n const execution = createExecution({ target, value, callData });\n return execute({ execution });\n }\n }\n\n const executions = calls.map((call) => {\n if (isDelegatedCall(call)) {\n return processDelegatedCall(call);\n }\n const { to: target, value, data: callData } = call;\n return createExecution({ target, value, callData });\n });\n\n const mode =\n calls.length === 1\n ? ExecutionMode.SingleDefault\n : ExecutionMode.BatchDefault;\n return executeWithMode({ mode, executions });\n};\n\n/**\n * Encodes calls for execution by a DeleGator smart contract.\n *\n * @param caller - The address of the DeleGator contract.\n * @param calls - An array of Call objects, each containing 'to', optional 'data', and optional 'value'.\n * @returns A promise that resolves to the encoded function data as a hexadecimal string.\n * @description\n * - If there's a single call directly to the delegator, it returns the call data directly.\n * - For multiple calls or calls to other addresses, it creates executions and encodes them for the DeleGator's execute function.\n * - The execution mode is set to ExecutionMode.SingleDefault for a single call, or ExecutionMode.BatchDefault for multiple calls.\n *\n * todo: This doesn't fully expose the flexibility of the DeleGator's execute function, but it's a start.\n * maybe we add a mechanism where individual calls passed to this function can be encoded batches.\n */\nexport const encodeCallsForCaller = async (\n caller: Address,\n calls: readonly Call[],\n): Promise<Hex> => {\n if (calls.length === 1) {\n const call = calls[0];\n if (call?.to === caller && !isDelegatedCall(call)) {\n // if there's a single call, and it's to the delegator, we can just return the calldata directly.\n return call.data ?? '0x';\n }\n }\n return encodeCalls(calls);\n};\n","import { Signature } from 'ox';\nimport {\n parseAbiParameters,\n encodeAbiParameters,\n type Hex,\n encodePacked,\n keccak256,\n concat,\n hexToBytes,\n} from 'viem';\n\nexport const FIELD_MODULUS =\n 115792089210356248762697446949407573529996955224135760342422259061068512044369n;\nexport const MALLEABILITY_THRESHOLD = FIELD_MODULUS / 2n;\n\nexport const SIGNATURE_ABI_PARAMS = parseAbiParameters(\n 'bytes32, uint256, uint256, bytes, bool, string, string, uint256',\n);\n\n/**\n * This function is used to convert the client data returned from the\n * credentials API into a format that can be consumed by the DeleGator\n * contracts. We need the flattend JSON strings before and after the\n * userOpHash/challenge. This function provides those two client data string\n * slices.\n *\n * @param clientDataJson - The client data JSON string.\n * @returns Returns [clientDataJSONPrefix and clientDataJSONSuffix]\n * ClientDataJSONPrefix contains the client data till the challengeHash\n * ClientDataJSONSuffix contains the client data after the challengeHash.\n */\nexport const splitOnChallenge = (\n clientDataJson: string,\n): [clientDataJSONPrefix: string, clientDataJSONSuffix: string] => {\n /*\n CientData looks like this:\n {\n \"type\": \"webauthn.create\" | \"webauthn.get\",\n \"challenge\": \"{userOpHash}\",\n \"origin\": \"{Domain}\",\n \"crossOrigin\": boolean\n }\n */\n try {\n const { challenge } = JSON.parse(clientDataJson);\n if (challenge === undefined) {\n throw new Error('No \"challenge\" found in the input string');\n }\n return clientDataJson.split(challenge) as [string, string];\n } catch (error) {\n throw new Error('No \"challenge\" found in the input string', {\n cause: error,\n });\n }\n};\n\n/**\n * Returns the index of '\"type\":' in the ClientData.\n *\n * @param clientDataJson - Stringified ClientDataJSON.\n * @returns The index of '\"type\":' in the ClientData.\n */\nexport const getResponseTypeLocation = (clientDataJson: string): bigint => {\n try {\n // Find the index of the `\"type\":` key in the JSON string directly\n const typeIndex = clientDataJson.indexOf('\"type\":');\n\n if (typeIndex === -1) {\n throw new Error('No \"type\" found in the input string');\n }\n // Return the index of the `\"type\":` key\n return BigInt(typeIndex);\n } catch (error) {\n // Handle any errors that occur during the search\n throw new Error('No \"type\" found in the input string', {\n cause: error,\n });\n }\n};\n\n/**\n * Encodes a signature to a hexadecimal signature that will be accepted\n * by the DeleGator contracts.\n *\n * @param keyId - The key used for the signature, represented as a hexadecimal string.\n * @param signature - The signature to convert, as Hex.\n * @param clientDataJSON - The client data used in the creation of the signature.\n * @param authenticatorData - The authenticator data used in the creation of the signature.\n * @returns The signature as a valid DeleGator signature encoded as Hexadecimal string.\n */\nexport function encodeDeleGatorSignature(\n keyId: string,\n signature: Hex,\n clientDataJSON: string,\n authenticatorData: Hex,\n): Hex {\n const keyIdHash = keccak256(encodePacked(['string'], [keyId]));\n\n const { r: rValue, s: sValue } = Signature.fromHex(signature);\n\n let normalizedS = sValue;\n\n while (normalizedS > MALLEABILITY_THRESHOLD) {\n normalizedS = FIELD_MODULUS - normalizedS;\n }\n\n const [clientDataComponent1, clientDataComponent2] =\n splitOnChallenge(clientDataJSON);\n\n const { userVerified } = parseAuthenticatorFlags(authenticatorData);\n\n const responseTypeLocation = getResponseTypeLocation(clientDataJSON);\n\n const encodedSignature = encodeAbiParameters(SIGNATURE_ABI_PARAMS, [\n keyIdHash,\n rValue,\n normalizedS,\n authenticatorData,\n userVerified,\n clientDataComponent1,\n clientDataComponent2,\n responseTypeLocation,\n ]);\n return encodedSignature;\n}\n\nconst AUTHENTICATOR_DATA_FLAGS_OFFSET = 32;\n// We have all of the flag bits defined here for completeness, even though we only extract the userVerified flag.\nenum AuthenticatorDataFlagBitIndex {\n UserPresence = 0,\n UserVerified = 2,\n BackupEligibility = 3,\n BackupState = 4,\n AttestedCredentialData = 6,\n ExtensionData = 7,\n}\n\nexport type AuthenticatorFlags = {\n userVerified: boolean;\n};\n\n/**\n * Parses the authenticator data and returns an authenticator flags object with the `userVerified` flag.\n * See https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/Authenticator_data.\n *\n * @param authenticatorData - The authenticator data to parse.\n * @returns An object representing the parsed authenticator flags.\n */\nexport function parseAuthenticatorFlags(\n authenticatorData: Hex,\n): AuthenticatorFlags {\n const authenticatorDataBuffer = hexToBytes(authenticatorData);\n const dataBufferUint8 = new Uint8Array(authenticatorDataBuffer);\n const flags = dataBufferUint8[AUTHENTICATOR_DATA_FLAGS_OFFSET];\n if (flags === undefined) {\n throw new Error('Authenticator flags not found in authenticator data');\n }\n\n // Bit 0 is the least significant bit in the flags byte, so we left shift 0b1 by the bit index\n // eslint-disable-next-line no-bitwise\n const bitMask = 0b1 << AuthenticatorDataFlagBitIndex.UserVerified;\n\n return {\n // eslint-disable-next-line no-bitwise\n userVerified: (flags & bitMask) !== 0x0,\n };\n}\n\n/**\n * Creates a dummy signature.\n * This must meet all early-failure conditions of the real signature, but does not need to be a valid signature.\n *\n * @param keyId - The key ID to use for the dummy signature.\n * @returns The encoded signature.\n */\nexport const createDummyWebAuthnSignature = (keyId: Hex) => {\n // https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/Authenticator_data#data_structure\n const rpIdHash = keccak256(encodePacked(['string'], ['AuthenticatorData']));\n const flags = '0x05';\n const signCount = '0x00000000';\n const authenticatorData = concat([rpIdHash, flags, signCount]);\n\n const keyIdHash = keccak256(encodePacked(['string'], [keyId]));\n const rs =\n 57896044605178124381348723474703786764998477612067880171211129530534256022184n;\n const userVerification = true;\n const clientDataPrefix = '{\"type\":\"webauthn.get\",\"challenge\":\"';\n const clientDataSuffix = '\",\"origin\":\"passkey-domain\",\"crossOrigin\":false}';\n const responseTypeLocation = 1n;\n\n const encodedSignature = encodeAbiParameters(SIGNATURE_ABI_PARAMS, [\n keyIdHash,\n rs,\n rs,\n authenticatorData,\n userVerification,\n clientDataPrefix,\n clientDataSuffix,\n responseTypeLocation,\n ]);\n\n return encodedSignature;\n};\n"]}