@metamask/smart-accounts-kit 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +57 -24
  2. package/dist/actions/index.cjs +9 -6
  3. package/dist/actions/index.cjs.map +1 -1
  4. package/dist/actions/index.d.cts +5 -3
  5. package/dist/actions/index.d.ts +5 -3
  6. package/dist/actions/index.mjs +8 -5
  7. package/dist/{caveats-BhjGBVHX.d.ts → caveats-B2OssjV4.d.ts} +1 -2
  8. package/dist/{caveats-CeHBbmt_.d.cts → caveats-gqMBZKkI.d.cts} +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-6CEOFJY5.cjs → chunk-2ZOWIAP3.cjs} +266 -114
  12. package/dist/chunk-2ZOWIAP3.cjs.map +1 -0
  13. package/dist/{chunk-R2WT54GZ.mjs → chunk-AZYTTGON.mjs} +214 -62
  14. package/dist/chunk-AZYTTGON.mjs.map +1 -0
  15. package/dist/{chunk-MVBU3LRV.cjs → chunk-DCI2AN4N.cjs} +15 -17
  16. package/dist/chunk-DCI2AN4N.cjs.map +1 -0
  17. package/dist/{chunk-RR2AMG4A.cjs → chunk-EPU4O7FY.cjs} +158 -151
  18. package/dist/chunk-EPU4O7FY.cjs.map +1 -0
  19. package/dist/{chunk-QCULIK3O.mjs → chunk-GMGJRC3D.mjs} +8 -1
  20. package/dist/chunk-GMGJRC3D.mjs.map +1 -0
  21. package/dist/chunk-IMO6XNDJ.mjs +14 -0
  22. package/dist/chunk-IMO6XNDJ.mjs.map +1 -0
  23. package/dist/chunk-IQT6XFDT.cjs +14 -0
  24. package/dist/chunk-IQT6XFDT.cjs.map +1 -0
  25. package/dist/{chunk-SO5JAXGD.cjs → chunk-JKVSTPEC.cjs} +200 -18
  26. package/dist/chunk-JKVSTPEC.cjs.map +1 -0
  27. package/dist/{chunk-DVJX76J3.mjs → chunk-K7GTZGKJ.mjs} +2 -2
  28. package/dist/{chunk-HQHXGWNJ.mjs → chunk-L3EZCIY6.mjs} +67 -60
  29. package/dist/chunk-L3EZCIY6.mjs.map +1 -0
  30. package/dist/{chunk-XZ7UMCG3.cjs → chunk-PQPAEHJZ.cjs} +12 -12
  31. package/dist/{chunk-XZ7UMCG3.cjs.map → chunk-PQPAEHJZ.cjs.map} +1 -1
  32. package/dist/{chunk-EEIIVBNV.mjs → chunk-TNGQTVSY.mjs} +225 -53
  33. package/dist/chunk-TNGQTVSY.mjs.map +1 -0
  34. package/dist/{chunk-FG2CQGSE.mjs → chunk-UJQ3JN3U.mjs} +4 -6
  35. package/dist/{chunk-FG2CQGSE.mjs.map → chunk-UJQ3JN3U.mjs.map} +1 -1
  36. package/dist/{chunk-TMO23YRP.cjs → chunk-W6HPAK4M.cjs} +262 -90
  37. package/dist/chunk-W6HPAK4M.cjs.map +1 -0
  38. package/dist/{chunk-ZGBFPD4O.mjs → chunk-YVU66KSH.mjs} +188 -6
  39. package/dist/chunk-YVU66KSH.mjs.map +1 -0
  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 -3
  43. package/dist/contracts/index.d.ts +4 -3
  44. package/dist/contracts/index.mjs +4 -5
  45. package/dist/decodeRevertReason-CmmCpmZ_.d.cts +72 -0
  46. package/dist/decodeRevertReason-dOTpJx2h.d.ts +72 -0
  47. package/dist/experimental/index.cjs +364 -9
  48. package/dist/experimental/index.cjs.map +1 -1
  49. package/dist/experimental/index.d.cts +39 -3
  50. package/dist/experimental/index.d.ts +39 -3
  51. package/dist/experimental/index.mjs +357 -2
  52. package/dist/experimental/index.mjs.map +1 -1
  53. package/dist/index-B1Cmezvh.d.cts +61 -0
  54. package/dist/{index-DRKgDSZW.d.ts → index-BkgdU4LI.d.ts} +99 -92
  55. package/dist/{index-Cg-JakqA.d.ts → index-DUJmm8Wz.d.ts} +46 -5
  56. package/dist/{index-DzL9ccjU.d.cts → index-Dv4jPzhe.d.cts} +99 -92
  57. package/dist/index-LqiEgBjV.d.ts +61 -0
  58. package/dist/{index-BToRQKyJ.d.cts → index-X7Qn3JTg.d.cts} +46 -5
  59. package/dist/index.cjs +22 -24
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +8 -7
  62. package/dist/index.d.ts +8 -7
  63. package/dist/index.mjs +9 -11
  64. package/dist/index.mjs.map +1 -1
  65. package/dist/{delegation-CR99q1-n.d.ts → resolveCaveats-A9xC29l8.d.cts} +160 -111
  66. package/dist/{delegation-DoVULGYE.d.cts → resolveCaveats-A9xC29l8.d.ts} +160 -111
  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 -4
  70. package/dist/utils/index.d.ts +8 -4
  71. package/dist/utils/index.mjs +16 -9
  72. package/package.json +7 -6
  73. package/dist/chunk-4QXIOE7F.mjs +0 -79
  74. package/dist/chunk-4QXIOE7F.mjs.map +0 -1
  75. package/dist/chunk-6CEOFJY5.cjs.map +0 -1
  76. package/dist/chunk-EEIIVBNV.mjs.map +0 -1
  77. package/dist/chunk-HQHXGWNJ.mjs.map +0 -1
  78. package/dist/chunk-MOHCTPYQ.cjs +0 -79
  79. package/dist/chunk-MOHCTPYQ.cjs.map +0 -1
  80. package/dist/chunk-MVBU3LRV.cjs.map +0 -1
  81. package/dist/chunk-QCULIK3O.mjs.map +0 -1
  82. package/dist/chunk-R2WT54GZ.mjs.map +0 -1
  83. package/dist/chunk-RR2AMG4A.cjs.map +0 -1
  84. package/dist/chunk-SO5JAXGD.cjs.map +0 -1
  85. package/dist/chunk-SOFB2MXG.cjs.map +0 -1
  86. package/dist/chunk-TMO23YRP.cjs.map +0 -1
  87. package/dist/chunk-ZGBFPD4O.mjs.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-DVJX76J3.mjs.map → chunk-K7GTZGKJ.mjs.map} +0 -0
@@ -1,10 +1,8 @@
1
- import {
2
- encodeExecutionCalldata
3
- } from "./chunk-4QXIOE7F.mjs";
4
1
  import {
5
2
  __export,
3
+ encodeExecutionCalldata,
6
4
  toDelegationStruct
7
- } from "./chunk-EEIIVBNV.mjs";
5
+ } from "./chunk-TNGQTVSY.mjs";
8
6
 
9
7
  // src/DelegationFramework/utils.ts
10
8
  import { ERC1967Proxy } from "@metamask/delegation-abis";
@@ -157,6 +155,188 @@ var encodeProxyCreationCode = ({
157
155
  bytecode: ERC1967ProxyBytecode
158
156
  });
159
157
 
158
+ // src/decodeRevertReason.ts
159
+ import * as delegationAbis from "@metamask/delegation-abis";
160
+ import { BaseError, ContractFunctionRevertedError, isHex } from "viem";
161
+ import { decodeErrorResult, formatAbiItemWithArgs } from "viem/utils";
162
+ var knownRevertAbis = Object.values(delegationAbis).filter(
163
+ (abi) => abi.length > 0
164
+ );
165
+ var standardSolidityErrorAbi = [];
166
+ var revertReasonAbis = [
167
+ standardSolidityErrorAbi,
168
+ ...knownRevertAbis
169
+ ];
170
+ var MAX_ERROR_TRAVERSAL_DEPTH = 8;
171
+ var panicReasons = {
172
+ "1": "An `assert` condition failed.",
173
+ "17": "Arithmetic operation resulted in underflow or overflow.",
174
+ "18": "Division or modulo by zero.",
175
+ "33": "Attempted to convert to an invalid type.",
176
+ "34": "Attempted to access a storage byte array that is incorrectly encoded.",
177
+ "49": "Performed `.pop()` on an empty array.",
178
+ "50": "Array index is out of bounds.",
179
+ "65": "Allocated too much memory or created an array which is too large.",
180
+ "81": "Attempted to call a zero-initialized variable of internal function type."
181
+ };
182
+ function decodeRevertReason(error) {
183
+ const decodedViemError = decodeViemContractRevert(error);
184
+ if (decodedViemError) {
185
+ return decodedViemError;
186
+ }
187
+ for (const rawData of getRevertDataCandidates(error)) {
188
+ const decoded = decodeRevertData(rawData);
189
+ if (decoded) {
190
+ return decoded;
191
+ }
192
+ }
193
+ return void 0;
194
+ }
195
+ function decodeViemContractRevert(error) {
196
+ if (!(error instanceof BaseError)) {
197
+ return void 0;
198
+ }
199
+ const revertError = error.walk(
200
+ (cause) => cause instanceof ContractFunctionRevertedError
201
+ );
202
+ if (!(revertError instanceof ContractFunctionRevertedError)) {
203
+ return void 0;
204
+ }
205
+ if (!revertError.raw) {
206
+ return void 0;
207
+ }
208
+ if (revertError.data) {
209
+ const { abiItem, args, errorName } = revertError.data;
210
+ return {
211
+ errorName,
212
+ message: formatDecodedError(errorName, args, abiItem),
213
+ rawData: revertError.raw
214
+ };
215
+ }
216
+ return decodeRevertData(revertError.raw);
217
+ }
218
+ function decodeRevertData(rawData) {
219
+ for (const abi of revertReasonAbis) {
220
+ try {
221
+ const { abiItem, args, errorName } = decodeErrorResult({
222
+ abi,
223
+ data: rawData
224
+ });
225
+ return {
226
+ errorName,
227
+ message: formatDecodedError(errorName, args, abiItem),
228
+ rawData
229
+ };
230
+ } catch {
231
+ }
232
+ }
233
+ const decodedString = decodeRawString(rawData);
234
+ if (decodedString) {
235
+ return {
236
+ errorName: "Error",
237
+ message: decodedString,
238
+ rawData
239
+ };
240
+ }
241
+ return void 0;
242
+ }
243
+ function formatDecodedError(errorName, args, abiItem) {
244
+ const [firstArg] = args ?? [];
245
+ if (errorName === "Error") {
246
+ return typeof firstArg === "string" ? firstArg : errorName;
247
+ }
248
+ if (errorName === "Panic") {
249
+ const panicCode = String(firstArg);
250
+ return panicReasons[panicCode] ?? `Panic(${panicCode})`;
251
+ }
252
+ const formattedArgs = formatAbiItemWithArgs({
253
+ abiItem,
254
+ args: args ?? [],
255
+ includeFunctionName: false,
256
+ includeName: false
257
+ });
258
+ return `${errorName}${formattedArgs ?? ""}`;
259
+ }
260
+ function decodeRawString(rawData) {
261
+ const bytes = rawData.slice(2);
262
+ if (bytes.length === 0 || bytes.length % 2 !== 0) {
263
+ return void 0;
264
+ }
265
+ let value = "";
266
+ for (let index = 0; index < bytes.length; index += 2) {
267
+ const charCode = Number.parseInt(bytes.slice(index, index + 2), 16);
268
+ if (Number.isNaN(charCode) || charCode < 32 || charCode > 126) {
269
+ return void 0;
270
+ }
271
+ value += String.fromCharCode(charCode);
272
+ }
273
+ return value;
274
+ }
275
+ function getRevertDataCandidates(error) {
276
+ const candidates = [];
277
+ const seen = /* @__PURE__ */ new Set();
278
+ const seenCandidates = /* @__PURE__ */ new Set();
279
+ const addHexCandidate = (candidate) => {
280
+ if (candidate.length < 10 || candidate.length % 2 !== 0 || !isHex(candidate)) {
281
+ return;
282
+ }
283
+ if (!seenCandidates.has(candidate)) {
284
+ seenCandidates.add(candidate);
285
+ candidates.push(candidate);
286
+ }
287
+ };
288
+ const addLabeledHexCandidates = (value) => {
289
+ for (const match of value.matchAll(
290
+ /\b(?:reason|revertData|raw|data):\s*(0x[0-9a-fA-F]+)/giu
291
+ )) {
292
+ const [, candidate] = match;
293
+ if (candidate) {
294
+ addHexCandidate(candidate);
295
+ }
296
+ }
297
+ };
298
+ const addHexCandidates = (value) => {
299
+ if (typeof value !== "string") {
300
+ return;
301
+ }
302
+ addLabeledHexCandidates(value);
303
+ for (const [candidate] of value.matchAll(/0x[0-9a-fA-F]+/gu)) {
304
+ addHexCandidate(candidate);
305
+ }
306
+ };
307
+ const visit = (value, depth = 0) => {
308
+ if (value === null || value === void 0 || seen.has(value) || depth > MAX_ERROR_TRAVERSAL_DEPTH) {
309
+ return;
310
+ }
311
+ addHexCandidates(value);
312
+ if (Array.isArray(value)) {
313
+ seen.add(value);
314
+ value.forEach((item) => visit(item, depth + 1));
315
+ return;
316
+ }
317
+ if (typeof value !== "object") {
318
+ return;
319
+ }
320
+ seen.add(value);
321
+ const record = value;
322
+ addHexCandidates(record.revertData);
323
+ addHexCandidates(record.raw);
324
+ addHexCandidates(record.data);
325
+ addHexCandidates(record.details);
326
+ addHexCandidates(record.reason);
327
+ addHexCandidates(record.shortMessage);
328
+ addHexCandidates(record.message);
329
+ visit(record.data, depth + 1);
330
+ visit(record.details, depth + 1);
331
+ visit(record.error, depth + 1);
332
+ visit(record.metaMessages, depth + 1);
333
+ visit(record.originalError, depth + 1);
334
+ visit(record.cause, depth + 1);
335
+ };
336
+ visit(error);
337
+ return candidates;
338
+ }
339
+
160
340
  // src/DelegationFramework/HybridDeleGator/methods/initialize.ts
161
341
  import { HybridDeleGator } from "@metamask/delegation-abis";
162
342
  import { encodeFunctionData as encodeFunctionData2 } from "viem";
@@ -825,6 +1005,8 @@ export {
825
1005
  encode16 as encode5,
826
1006
  simulate18,
827
1007
  execute6,
828
- encode_exports4
1008
+ encode_exports4,
1009
+ decodeRevertReason,
1010
+ decodeRevertData
829
1011
  };
830
- //# sourceMappingURL=chunk-ZGBFPD4O.mjs.map
1012
+ //# sourceMappingURL=chunk-YVU66KSH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/DelegationFramework/utils.ts","../src/DelegationFramework/DeleGatorCore/read.ts","../src/DelegationFramework/DeleGatorCore/methods/getDelegationManager.ts","../src/DelegationFramework/DeleGatorCore/methods/getDeposit.ts","../src/DelegationFramework/DeleGatorCore/methods/getEntryPoint.ts","../src/DelegationFramework/DeleGatorCore/methods/getNonce.ts","../src/DelegationFramework/DeleGatorCore/methods/getProxyImplementation.ts","../src/DelegationFramework/DeleGatorCore/methods/getProxyVersion.ts","../src/DelegationFramework/DeleGatorCore/methods/isValidSignature.ts","../src/decodeRevertReason.ts","../src/DelegationFramework/HybridDeleGator/methods/initialize.ts","../src/DelegationFramework/HybridDeleGator/encode.ts","../src/DelegationFramework/HybridDeleGator/methods/addKey.ts","../src/DelegationFramework/HybridDeleGator/methods/reinitialize.ts","../src/DelegationFramework/HybridDeleGator/methods/removeKey.ts","../src/DelegationFramework/HybridDeleGator/methods/updateSigners.ts","../src/DelegationFramework/MultiSigDeleGator/methods/initialize.ts","../src/DelegationFramework/MultiSigDeleGator/encode.ts","../src/DelegationFramework/MultiSigDeleGator/methods/addSigner.ts","../src/DelegationFramework/MultiSigDeleGator/methods/reinitialize.ts","../src/DelegationFramework/MultiSigDeleGator/methods/removeSigner.ts","../src/DelegationFramework/MultiSigDeleGator/methods/replaceSigner.ts","../src/DelegationFramework/MultiSigDeleGator/methods/updateMultiSigParameters.ts","../src/DelegationFramework/MultiSigDeleGator/methods/updateThreshold.ts","../src/DelegationFramework/SimpleFactory/methods/create2Deploy.ts","../src/DelegationFramework/SimpleFactory/encode.ts","../src/DelegationFramework/DeleGatorCore/methods/execute.ts","../src/DelegationFramework/DeleGatorCore/methods/executeWithMode.ts","../src/DelegationFramework/DeleGatorCore/encode.ts","../src/DelegationFramework/DeleGatorCore/methods/disableDelegation.ts","../src/DelegationFramework/DeleGatorCore/methods/enableDelegation.ts","../src/DelegationFramework/DeleGatorCore/methods/upgradeToAndCall.ts"],"sourcesContent":["import { ERC1967Proxy } from '@metamask/delegation-abis';\nimport { ERC1967Proxy as ERC1967ProxyBytecode } from '@metamask/delegation-abis/bytecode';\nimport type { Address, Client, Hex } from 'viem';\nimport { encodeDeployData } from 'viem';\nimport { getCode } from 'viem/actions';\n\nimport { getProxyImplementation } from './DeleGatorCore/read';\n\n/**\n * Checks if a contract is deployed at the given address.\n *\n * @param options - The options for checking contract deployment.\n * @param options.client - The client to use for the query.\n * @param options.contractAddress - The address to check for contract deployment.\n * @returns A boolean indicating whether a contract is deployed at the address.\n * @description This function checks if there is actual bytecode at the provided contract address.\n */\nexport async function isContractDeployed({\n client,\n contractAddress,\n}: {\n client: Client;\n contractAddress: Address;\n}): Promise<boolean> {\n const code = await getCode(client, {\n address: contractAddress,\n });\n return Boolean(code) && code !== '0x';\n}\n\n/**\n * Checks if a proxy contract at the given address points to the expected implementation.\n *\n * @param options - The options for checking the implementation.\n * @param options.client - The client to use for the query.\n * @param options.contractAddress - The address of the proxy contract.\n * @param options.expectedImplementationAddress - The address that the implementation should match.\n * @returns A boolean indicating whether the implementation matches the expected one.\n * @description This function verifies both that the contract exists and that its implementation address matches.\n */\nexport async function isImplementationExpected({\n client,\n contractAddress,\n expectedImplementationAddress,\n}: {\n client: Client;\n contractAddress: Address;\n expectedImplementationAddress: Address;\n}): Promise<boolean> {\n if (!(await isContractDeployed({ client, contractAddress }))) {\n return false;\n }\n\n const implementationAddress = await getProxyImplementation({\n client,\n contractAddress,\n });\n\n return implementationAddress === expectedImplementationAddress;\n}\n\n/**\n * Encodes the \"creation code\" for an ERC1967Proxy contract that will be deployed via CREATE2 with the given implementation and initialization code.\n *\n * @param options - The options for encoding the proxy creation code.\n * @param options.implementationAddress - The address of the implementation contract for the proxy to use.\n * @param options.initcode - The calldata for the initialization function of the implementation contract.\n * @returns The encoded creation code for the proxy.\n * @description This function prepares the deployment bytecode for an ERC1967 proxy pointing to the given implementation.\n */\nexport const encodeProxyCreationCode = ({\n implementationAddress,\n initcode,\n}: {\n implementationAddress: Address;\n initcode: Hex;\n}): Hex =>\n encodeDeployData({\n abi: ERC1967Proxy,\n args: [implementationAddress, initcode],\n bytecode: ERC1967ProxyBytecode,\n });\n","import { read as getDelegationManager } from './methods/getDelegationManager';\nimport { read as getDeposit } from './methods/getDeposit';\nimport { read as getEntryPoint } from './methods/getEntryPoint';\nimport { read as getNonce } from './methods/getNonce';\nimport { read as getProxyImplementation } from './methods/getProxyImplementation';\nimport { read as getProxyVersion } from './methods/getProxyVersion';\nimport { read as isValidSignature } from './methods/isValidSignature';\n\nexport {\n getDelegationManager,\n getDeposit,\n getEntryPoint,\n getNonce,\n getProxyImplementation,\n getProxyVersion,\n isValidSignature,\n};\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetDelegationManagerParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetDelegationManagerParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'delegationManager',\n });\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetDepositParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetDepositParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'getDeposit',\n });\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetEntryPointParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetEntryPointParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'entryPoint',\n });\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetNonceParameters = {\n client: Client;\n contractAddress: Address;\n key?: bigint;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n key,\n}: ReadGetNonceParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'getNonce',\n args: key ? [key] : undefined,\n });\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetProxyImplementationParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetProxyImplementationParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'getImplementation',\n });\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetProxyVersionParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetProxyVersionParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'getInitializedVersion',\n });\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport type { Address, Hex, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type IsValidSignatureParameters = {\n client: Client;\n contractAddress: Address;\n hash: Hex;\n signature: Hex;\n};\n\nexport type EncodeIsValidSignatureParameters = {\n hash: Hex;\n signature: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n hash,\n signature,\n}: IsValidSignatureParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'isValidSignature',\n args: [hash, signature],\n });\n\nexport const encode = ({\n hash,\n signature,\n}: EncodeIsValidSignatureParameters) => {\n return encodeFunctionData({\n abi: DeleGatorCore,\n functionName: 'isValidSignature',\n args: [hash, signature],\n });\n};\n","import * as delegationAbis from '@metamask/delegation-abis';\nimport { BaseError, ContractFunctionRevertedError, isHex } from 'viem';\nimport type { Abi, AbiItem, Hex } from 'viem';\nimport { decodeErrorResult, formatAbiItemWithArgs } from 'viem/utils';\n\nconst knownRevertAbis = (Object.values(delegationAbis) as Abi[]).filter(\n (abi) => abi.length > 0,\n);\n\n// viem decodes standard Solidity Error(string) and Panic(uint256) with an empty ABI.\nconst standardSolidityErrorAbi: Abi = [] as const;\nconst revertReasonAbis: readonly Abi[] = [\n standardSolidityErrorAbi,\n ...knownRevertAbis,\n];\n\nconst MAX_ERROR_TRAVERSAL_DEPTH = 8;\n\nconst panicReasons: Record<string, string> = {\n '1': 'An `assert` condition failed.',\n '17': 'Arithmetic operation resulted in underflow or overflow.',\n '18': 'Division or modulo by zero.',\n '33': 'Attempted to convert to an invalid type.',\n '34': 'Attempted to access a storage byte array that is incorrectly encoded.',\n '49': 'Performed `.pop()` on an empty array.',\n '50': 'Array index is out of bounds.',\n '65': 'Allocated too much memory or created an array which is too large.',\n '81': 'Attempted to call a zero-initialized variable of internal function type.',\n};\n\nexport type DecodedRevertReason = {\n readonly errorName: string;\n readonly message: string;\n readonly rawData: Hex;\n};\n\n/**\n * Decodes the first recognized revert data candidate in an error chain.\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 function decodeRevertReason(\n error: unknown,\n): DecodedRevertReason | undefined {\n const decodedViemError = decodeViemContractRevert(error);\n\n if (decodedViemError) {\n return decodedViemError;\n }\n\n for (const rawData of getRevertDataCandidates(error)) {\n const decoded = decodeRevertData(rawData);\n\n if (decoded) {\n return decoded;\n }\n }\n\n return undefined;\n}\n\n/**\n * Extracts revert information that viem has already identified in its error\n * chain before falling back to provider-specific string/object shapes.\n *\n * @param error - The original error thrown by viem.\n * @returns A decoded revert reason, if viem exposed enough revert data.\n */\nfunction decodeViemContractRevert(\n error: unknown,\n): DecodedRevertReason | undefined {\n if (!(error instanceof BaseError)) {\n return undefined;\n }\n\n const revertError = error.walk(\n (cause) => cause instanceof ContractFunctionRevertedError,\n );\n\n if (!(revertError instanceof ContractFunctionRevertedError)) {\n return undefined;\n }\n\n if (!revertError.raw) {\n return undefined;\n }\n\n if (revertError.data) {\n const { abiItem, args, errorName } = revertError.data;\n return {\n errorName,\n message: formatDecodedError(errorName, args, abiItem),\n rawData: revertError.raw,\n };\n }\n\n return decodeRevertData(revertError.raw);\n}\n\n/**\n * Decodes raw revert data against standard Solidity errors and known SDK ABIs.\n *\n * @param rawData - ABI-encoded revert data.\n * @returns A decoded revert reason, if the data matches a known error.\n */\nexport function decodeRevertData(\n rawData: Hex,\n): DecodedRevertReason | undefined {\n for (const abi of revertReasonAbis) {\n try {\n const { abiItem, args, errorName } = decodeErrorResult({\n abi,\n data: rawData,\n });\n\n return {\n errorName,\n message: formatDecodedError(errorName, args, abiItem),\n rawData,\n };\n } catch {\n // Try the next ABI until one can decode the revert data.\n }\n }\n\n const decodedString = decodeRawString(rawData);\n\n if (decodedString) {\n return {\n errorName: 'Error',\n message: decodedString,\n rawData,\n };\n }\n\n return undefined;\n}\n\n/**\n * Formats a decoded error into compact user-facing text.\n *\n * @param errorName - The decoded Solidity error name.\n * @param args - The decoded Solidity error arguments.\n * @param abiItem - The ABI item used to decode the error.\n * @returns Human-readable revert text.\n */\nfunction formatDecodedError(\n errorName: string,\n args: readonly unknown[] | undefined,\n abiItem: AbiItem,\n): string {\n const [firstArg] = args ?? [];\n\n if (errorName === 'Error') {\n return typeof firstArg === 'string' ? firstArg : errorName;\n }\n\n if (errorName === 'Panic') {\n const panicCode = String(firstArg);\n return panicReasons[panicCode] ?? `Panic(${panicCode})`;\n }\n\n const formattedArgs = formatAbiItemWithArgs({\n abiItem,\n args: args ?? [],\n includeFunctionName: false,\n includeName: false,\n });\n\n return `${errorName}${formattedArgs ?? ''}`;\n}\n\n/**\n * Decodes revert payloads surfaced by some clients as raw printable ASCII bytes.\n *\n * @param rawData - Hex-encoded bytes that may represent a printable ASCII string.\n * @returns The decoded string when it looks like readable text.\n */\nfunction decodeRawString(rawData: Hex): string | undefined {\n const bytes = rawData.slice(2);\n\n if (bytes.length === 0 || bytes.length % 2 !== 0) {\n return undefined;\n }\n\n let value = '';\n\n for (let index = 0; index < bytes.length; index += 2) {\n const charCode = Number.parseInt(bytes.slice(index, index + 2), 16);\n\n if (Number.isNaN(charCode) || charCode < 0x20 || charCode > 0x7e) {\n return undefined;\n }\n\n value += String.fromCharCode(charCode);\n }\n\n return value;\n}\n\n/**\n * Extracts hex revert data candidates from common viem and JSON-RPC error shapes.\n *\n * @param error - The error object to inspect.\n * @returns Candidate revert data values.\n */\nfunction getRevertDataCandidates(error: unknown): Hex[] {\n const candidates: Hex[] = [];\n const seen = new Set<unknown>();\n const seenCandidates = new Set<Hex>();\n\n const addHexCandidate = (candidate: string): void => {\n if (\n candidate.length < 10 ||\n candidate.length % 2 !== 0 ||\n !isHex(candidate)\n ) {\n return;\n }\n\n if (!seenCandidates.has(candidate)) {\n seenCandidates.add(candidate);\n candidates.push(candidate);\n }\n };\n\n const addLabeledHexCandidates = (value: string): void => {\n for (const match of value.matchAll(\n /\\b(?:reason|revertData|raw|data):\\s*(0x[0-9a-fA-F]+)/giu,\n )) {\n const [, candidate] = match;\n\n if (candidate) {\n addHexCandidate(candidate);\n }\n }\n };\n\n const addHexCandidates = (value: unknown): void => {\n if (typeof value !== 'string') {\n return;\n }\n\n addLabeledHexCandidates(value);\n\n for (const [candidate] of value.matchAll(/0x[0-9a-fA-F]+/gu)) {\n addHexCandidate(candidate);\n }\n };\n\n const visit = (value: unknown, depth = 0): void => {\n if (\n value === null ||\n value === undefined ||\n seen.has(value) ||\n depth > MAX_ERROR_TRAVERSAL_DEPTH\n ) {\n return;\n }\n\n addHexCandidates(value);\n\n if (Array.isArray(value)) {\n seen.add(value);\n value.forEach((item) => visit(item, depth + 1));\n return;\n }\n\n if (typeof value !== 'object') {\n return;\n }\n\n seen.add(value);\n\n const record = value as Record<string, unknown>;\n\n addHexCandidates(record.revertData);\n addHexCandidates(record.raw);\n addHexCandidates(record.data);\n addHexCandidates(record.details);\n addHexCandidates(record.reason);\n addHexCandidates(record.shortMessage);\n addHexCandidates(record.message);\n\n visit(record.data, depth + 1);\n visit(record.details, depth + 1);\n visit(record.error, depth + 1);\n visit(record.metaMessages, depth + 1);\n visit(record.originalError, depth + 1);\n visit(record.cause, depth + 1);\n };\n\n visit(error);\n\n return candidates;\n}\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { P256Owner, InitializedClient } from '../../types';\n\nexport type EncodeInitializeParameters = {\n eoaOwner: Address;\n p256Owners: P256Owner[];\n};\n\nexport type SimulateInitializeParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n} & EncodeInitializeParameters;\n\nexport type ExecuteInitializeParameters = {\n client: InitializedClient;\n hybridDeleGatorAddress: Address;\n} & EncodeInitializeParameters;\n\nexport const simulate = async ({\n client,\n hybridDeleGatorAddress,\n eoaOwner,\n p256Owners,\n}: SimulateInitializeParameters) => {\n return simulateContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'initialize',\n args: [\n eoaOwner,\n p256Owners.map((p256Owner) => p256Owner.keyId),\n p256Owners.map((p256Owner) => p256Owner.x),\n p256Owners.map((p256Owner) => p256Owner.y),\n ],\n });\n};\n\nexport const execute = async ({\n client,\n hybridDeleGatorAddress,\n eoaOwner,\n p256Owners,\n}: ExecuteInitializeParameters) => {\n const { request } = await simulate({\n client,\n hybridDeleGatorAddress,\n eoaOwner,\n p256Owners,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n eoaOwner,\n p256Owners,\n}: EncodeInitializeParameters) => {\n return encodeFunctionData({\n abi: HybridDeleGator,\n functionName: 'initialize',\n args: [\n eoaOwner,\n p256Owners.map((p256Owner) => p256Owner.keyId),\n p256Owners.map((p256Owner) => p256Owner.x),\n p256Owners.map((p256Owner) => p256Owner.y),\n ],\n });\n};\n","import { encode as addKey } from './methods/addKey';\nimport { encode as initializeHybridDeleGator } from './methods/initialize';\nimport { encode as reinitializeHybridDeleGator } from './methods/reinitialize';\nimport { encode as removeKey } from './methods/removeKey';\nimport { encode as updateSigners } from './methods/updateSigners';\n\nexport {\n addKey,\n initializeHybridDeleGator,\n reinitializeHybridDeleGator,\n removeKey,\n updateSigners,\n};\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { P256Owner, InitializedClient } from '../../types';\n\nexport type EncodeAddKeyParameters = {\n p256Owner: P256Owner;\n};\n\nexport type SimulateAddKeyParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n} & EncodeAddKeyParameters;\n\nexport type ExecuteAddKeyParameters = {\n client: InitializedClient;\n hybridDeleGatorAddress: Address;\n} & EncodeAddKeyParameters;\n\nexport const simulate = async ({\n client,\n hybridDeleGatorAddress,\n p256Owner,\n}: SimulateAddKeyParameters) => {\n return simulateContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'addKey',\n args: [p256Owner.keyId, p256Owner.x, p256Owner.y],\n });\n};\n\nexport const execute = async ({\n client,\n hybridDeleGatorAddress,\n p256Owner,\n}: ExecuteAddKeyParameters) => {\n const { request } = await simulate({\n client,\n hybridDeleGatorAddress,\n p256Owner,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ p256Owner }: EncodeAddKeyParameters) => {\n return encodeFunctionData({\n abi: HybridDeleGator,\n functionName: 'addKey',\n args: [p256Owner.keyId, p256Owner.x, p256Owner.y],\n });\n};\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { P256Owner, InitializedClient } from '../../types';\n\nexport type EncodeReinitializeParameters = {\n version: number;\n eoaOwner: Address;\n p256Owners: P256Owner[];\n removeExistingP256Owners: boolean;\n};\n\nexport type SimulateReinitializeParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n} & EncodeReinitializeParameters;\n\nexport type ExecuteReinitializeParameters = {\n client: InitializedClient;\n hybridDeleGatorAddress: Address;\n} & EncodeReinitializeParameters;\n\nexport const simulate = async ({\n client,\n hybridDeleGatorAddress,\n version,\n eoaOwner,\n p256Owners,\n removeExistingP256Owners,\n}: SimulateReinitializeParameters) => {\n return simulateContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'reinitialize',\n args: [\n version,\n eoaOwner,\n p256Owners.map((p256Owner) => p256Owner.keyId),\n p256Owners.map((p256Owner) => p256Owner.x),\n p256Owners.map((p256Owner) => p256Owner.y),\n removeExistingP256Owners,\n ],\n });\n};\n\nexport const execute = async ({\n client,\n hybridDeleGatorAddress,\n version,\n eoaOwner,\n p256Owners,\n removeExistingP256Owners,\n}: ExecuteReinitializeParameters) => {\n const { request } = await simulate({\n client,\n hybridDeleGatorAddress,\n version,\n eoaOwner,\n p256Owners,\n removeExistingP256Owners,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n version,\n eoaOwner,\n p256Owners,\n removeExistingP256Owners,\n}: EncodeReinitializeParameters) => {\n return encodeFunctionData({\n abi: HybridDeleGator,\n functionName: 'reinitialize',\n args: [\n version,\n eoaOwner,\n p256Owners.map((p256Owner) => p256Owner.keyId),\n p256Owners.map((p256Owner) => p256Owner.x),\n p256Owners.map((p256Owner) => p256Owner.y),\n removeExistingP256Owners,\n ],\n });\n};\n","import { HybridDeleGator } 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 EncodeRemoveKeyParameters = {\n keyId: string;\n};\n\nexport type SimulateRemoveKeyParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n} & EncodeRemoveKeyParameters;\n\nexport type ExecuteRemoveKeyParameters = {\n client: InitializedClient;\n hybridDeleGatorAddress: Address;\n} & EncodeRemoveKeyParameters;\n\nexport const simulate = async ({\n client,\n hybridDeleGatorAddress,\n keyId,\n}: SimulateRemoveKeyParameters) => {\n return simulateContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'removeKey',\n args: [keyId],\n });\n};\n\nexport const execute = async ({\n client,\n hybridDeleGatorAddress,\n keyId,\n}: ExecuteRemoveKeyParameters) => {\n const { request } = await simulate({\n client,\n hybridDeleGatorAddress,\n keyId,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ keyId }: EncodeRemoveKeyParameters) => {\n return encodeFunctionData({\n abi: HybridDeleGator,\n functionName: 'removeKey',\n args: [keyId],\n });\n};\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { P256Owner, InitializedClient } from '../../types';\n\nexport type EncodeUpdateSignersParameters = {\n eoaOwner: Address;\n p256Owners: P256Owner[];\n};\n\nexport type SimulateUpdateSignersParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n} & EncodeUpdateSignersParameters;\n\nexport type ExecuteUpdateSignersParameters = {\n client: InitializedClient;\n hybridDeleGatorAddress: Address;\n} & EncodeUpdateSignersParameters;\n\nexport const simulate = async ({\n client,\n hybridDeleGatorAddress,\n eoaOwner,\n p256Owners,\n}: SimulateUpdateSignersParameters) => {\n return simulateContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'updateSigners',\n args: [\n eoaOwner,\n p256Owners.map((p256Owner) => p256Owner.keyId),\n p256Owners.map((p256Owner) => p256Owner.x),\n p256Owners.map((p256Owner) => p256Owner.y),\n ],\n });\n};\n\nexport const execute = async ({\n client,\n hybridDeleGatorAddress,\n eoaOwner,\n p256Owners,\n}: ExecuteUpdateSignersParameters) => {\n const { request } = await simulate({\n client,\n hybridDeleGatorAddress,\n eoaOwner,\n p256Owners,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n eoaOwner,\n p256Owners,\n}: EncodeUpdateSignersParameters) => {\n return encodeFunctionData({\n abi: HybridDeleGator,\n functionName: 'updateSigners',\n args: [\n eoaOwner,\n p256Owners.map((p256Owner) => p256Owner.keyId),\n p256Owners.map((p256Owner) => p256Owner.x),\n p256Owners.map((p256Owner) => p256Owner.y),\n ],\n });\n};\n","import { MultiSigDeleGator } 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 EncodeInitializeParameters = {\n owners: Address[];\n threshold: bigint;\n};\n\nexport type SimulateInitializeParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n} & EncodeInitializeParameters;\n\nexport type ExecuteInitializeParameters = {\n client: InitializedClient;\n multiSigDeleGatorAddress: Address;\n} & EncodeInitializeParameters;\n\nexport const simulate = async ({\n client,\n multiSigDeleGatorAddress,\n owners,\n threshold,\n}: SimulateInitializeParameters) => {\n return simulateContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'initialize',\n args: [owners, threshold],\n });\n};\n\nexport const execute = async ({\n client,\n multiSigDeleGatorAddress,\n owners,\n threshold,\n}: ExecuteInitializeParameters) => {\n const { request } = await simulate({\n client,\n multiSigDeleGatorAddress,\n owners,\n threshold,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ owners, threshold }: EncodeInitializeParameters) => {\n return encodeFunctionData({\n abi: MultiSigDeleGator,\n functionName: 'initialize',\n args: [owners, threshold],\n });\n};\n","import { encode as addSigner } from './methods/addSigner';\nimport { encode as initializeMultiSigDeleGator } from './methods/initialize';\nimport { encode as reinitializeMultiSigDeleGator } from './methods/reinitialize';\nimport { encode as removeSigner } from './methods/removeSigner';\nimport { encode as replaceSigner } from './methods/replaceSigner';\nimport { encode as updateMultiSigParameters } from './methods/updateMultiSigParameters';\nimport { encode as updateThreshold } from './methods/updateThreshold';\n\nexport {\n addSigner,\n initializeMultiSigDeleGator,\n reinitializeMultiSigDeleGator,\n removeSigner,\n replaceSigner,\n updateThreshold,\n updateMultiSigParameters,\n};\n","import { MultiSigDeleGator } 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 EncodeAddSignerParameters = {\n signer: Address;\n};\n\nexport type SimulateAddSignerParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n} & EncodeAddSignerParameters;\n\nexport type ExecuteAddSignerParameters = {\n client: InitializedClient;\n multiSigDeleGatorAddress: Address;\n} & EncodeAddSignerParameters;\n\nexport const simulate = async ({\n client,\n multiSigDeleGatorAddress,\n signer,\n}: SimulateAddSignerParameters) => {\n return simulateContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'addSigner',\n args: [signer],\n });\n};\n\nexport const execute = async ({\n client,\n multiSigDeleGatorAddress,\n signer,\n}: ExecuteAddSignerParameters) => {\n const { request } = await simulate({\n client,\n multiSigDeleGatorAddress,\n signer,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ signer }: EncodeAddSignerParameters) => {\n return encodeFunctionData({\n abi: MultiSigDeleGator,\n functionName: 'addSigner',\n args: [signer],\n });\n};\n","import { MultiSigDeleGator } 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 EncodeReinitializeParameters = {\n version: bigint;\n owners: Address[];\n threshold: bigint;\n removeExistingOwners: boolean;\n};\n\nexport type SimulateReinitializeParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n} & EncodeReinitializeParameters;\n\nexport type ExecuteReinitializeParameters = {\n client: InitializedClient;\n multiSigDeleGatorAddress: Address;\n} & EncodeReinitializeParameters;\n\nexport const simulate = async ({\n client,\n multiSigDeleGatorAddress,\n version,\n owners,\n threshold,\n removeExistingOwners,\n}: SimulateReinitializeParameters) => {\n return simulateContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'reinitialize',\n args: [version, owners, threshold, removeExistingOwners],\n });\n};\n\nexport const execute = async ({\n client,\n multiSigDeleGatorAddress,\n version,\n owners,\n threshold,\n removeExistingOwners,\n}: ExecuteReinitializeParameters) => {\n const { request } = await simulate({\n client,\n multiSigDeleGatorAddress,\n version,\n owners,\n threshold,\n removeExistingOwners,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n version,\n owners,\n threshold,\n removeExistingOwners,\n}: EncodeReinitializeParameters) => {\n return encodeFunctionData({\n abi: MultiSigDeleGator,\n functionName: 'reinitialize',\n args: [version, owners, threshold, removeExistingOwners],\n });\n};\n","import { MultiSigDeleGator } 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 EncodeRemoveSignerParameters = {\n signer: Address;\n};\n\nexport type SimulateRemoveSignerParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n} & EncodeRemoveSignerParameters;\n\nexport type ExecuteRemoveSignerParameters = {\n client: InitializedClient;\n multiSigDeleGatorAddress: Address;\n} & EncodeRemoveSignerParameters;\n\nexport const simulate = async ({\n client,\n multiSigDeleGatorAddress,\n signer,\n}: SimulateRemoveSignerParameters) => {\n return simulateContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'removeSigner',\n args: [signer],\n });\n};\n\nexport const execute = async ({\n client,\n multiSigDeleGatorAddress,\n signer,\n}: ExecuteRemoveSignerParameters) => {\n const { request } = await simulate({\n client,\n multiSigDeleGatorAddress,\n signer,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ signer }: EncodeRemoveSignerParameters) => {\n return encodeFunctionData({\n abi: MultiSigDeleGator,\n functionName: 'removeSigner',\n args: [signer],\n });\n};\n","import { MultiSigDeleGator } 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 EncodeReplaceSignerParameters = {\n oldSigner: Address;\n newSigner: Address;\n};\n\nexport type SimulateReplaceSignerParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n} & EncodeReplaceSignerParameters;\n\nexport type ExecuteReplaceSignerParameters = {\n client: InitializedClient;\n multiSigDeleGatorAddress: Address;\n} & EncodeReplaceSignerParameters;\n\nexport const simulate = async ({\n client,\n multiSigDeleGatorAddress,\n oldSigner,\n newSigner,\n}: SimulateReplaceSignerParameters) => {\n return simulateContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'replaceSigner',\n args: [oldSigner, newSigner],\n });\n};\n\nexport const execute = async ({\n client,\n multiSigDeleGatorAddress,\n oldSigner,\n newSigner,\n}: ExecuteReplaceSignerParameters) => {\n const { request } = await simulate({\n client,\n multiSigDeleGatorAddress,\n oldSigner,\n newSigner,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n oldSigner,\n newSigner,\n}: EncodeReplaceSignerParameters) => {\n return encodeFunctionData({\n abi: MultiSigDeleGator,\n functionName: 'replaceSigner',\n args: [oldSigner, newSigner],\n });\n};\n","import { MultiSigDeleGator } 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 EncodeUpdateMultiSigParametersParameters = {\n owners: Address[];\n threshold: bigint;\n removeExistingOwners: boolean;\n};\n\nexport type SimulateUpdateMultiSigParametersParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n} & EncodeUpdateMultiSigParametersParameters;\n\nexport type ExecuteUpdateMultiSigParametersParameters = {\n client: InitializedClient;\n multiSigDeleGatorAddress: Address;\n} & EncodeUpdateMultiSigParametersParameters;\n\nexport const simulate = async ({\n client,\n multiSigDeleGatorAddress,\n owners,\n threshold,\n removeExistingOwners,\n}: SimulateUpdateMultiSigParametersParameters) => {\n return simulateContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'updateMultiSigParameters',\n args: [owners, threshold, removeExistingOwners],\n });\n};\n\nexport const execute = async ({\n client,\n multiSigDeleGatorAddress,\n owners,\n threshold,\n removeExistingOwners,\n}: ExecuteUpdateMultiSigParametersParameters) => {\n const { request } = await simulate({\n client,\n multiSigDeleGatorAddress,\n owners,\n threshold,\n removeExistingOwners,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n owners,\n threshold,\n removeExistingOwners,\n}: EncodeUpdateMultiSigParametersParameters) => {\n return encodeFunctionData({\n abi: MultiSigDeleGator,\n functionName: 'updateMultiSigParameters',\n args: [owners, threshold, removeExistingOwners],\n });\n};\n","import { MultiSigDeleGator } 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 EncodeUpdateThresholdParameters = {\n threshold: bigint;\n};\n\nexport type SimulateUpdateThresholdParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n} & EncodeUpdateThresholdParameters;\n\nexport type ExecuteUpdateThresholdParameters = {\n client: InitializedClient;\n multiSigDeleGatorAddress: Address;\n} & EncodeUpdateThresholdParameters;\n\nexport const simulate = async ({\n client,\n multiSigDeleGatorAddress,\n threshold,\n}: SimulateUpdateThresholdParameters) => {\n return simulateContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'updateThreshold',\n args: [threshold],\n });\n};\n\nexport const execute = async ({\n client,\n multiSigDeleGatorAddress,\n threshold,\n}: ExecuteUpdateThresholdParameters) => {\n const { request } = await simulate({\n client,\n multiSigDeleGatorAddress,\n threshold,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ threshold }: EncodeUpdateThresholdParameters) => {\n return encodeFunctionData({\n abi: MultiSigDeleGator,\n functionName: 'updateThreshold',\n args: [threshold],\n });\n};\n","import { SimpleFactory } from '@metamask/delegation-abis';\nimport type { Address, Hex, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateCreate2DeployParameters = {\n client: Client;\n factoryAddress: Address;\n creationCode: Hex;\n salt: Hex;\n};\n\nexport type ExecuteCreate2DeployParameters = {\n client: InitializedClient;\n factoryAddress: Address;\n creationCode: Hex;\n salt: Hex;\n};\n\nexport const simulate = async ({\n client,\n factoryAddress,\n creationCode,\n salt,\n}: SimulateCreate2DeployParameters) => {\n return simulateContract(client, {\n address: factoryAddress,\n abi: SimpleFactory,\n functionName: 'deploy',\n args: [creationCode, salt],\n });\n};\n\nexport const encode = (creationCode: Hex, salt: Hex) => {\n return encodeFunctionData({\n abi: SimpleFactory,\n functionName: 'deploy',\n args: [creationCode, salt],\n });\n};\n\nexport const execute = async ({\n client,\n factoryAddress,\n creationCode,\n salt,\n}: ExecuteCreate2DeployParameters) => {\n const { request } = await simulate({\n client,\n factoryAddress,\n creationCode,\n salt,\n });\n return writeContract(client, request);\n};\n","import { encode as create2Deploy } from './methods/create2Deploy';\n\nexport { create2Deploy };\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { ExecutionStruct } from '../../../executions';\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateExecuteParameters = {\n client: Client;\n contractAddress: Address;\n execution: ExecutionStruct;\n};\n\nexport type EncodeExecuteParameters = {\n execution: ExecutionStruct;\n};\n\nexport type ExecuteExecuteParameters = {\n client: InitializedClient;\n contractAddress: Address;\n execution: ExecutionStruct;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n execution,\n}: SimulateExecuteParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'execute',\n args: [execution],\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n execution,\n}: ExecuteExecuteParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n execution,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ execution }: EncodeExecuteParameters) => {\n return encodeFunctionData({\n abi: DeleGatorCore,\n functionName: 'execute',\n args: [execution],\n });\n};\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport { encodeFunctionData } from 'viem';\nimport type { Address, Client } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport { encodeExecutionCalldata } from '../../../executions';\nimport type { ExecutionStruct, ExecutionMode } from '../../../executions';\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateExecuteWithModeParameters = {\n client: Client;\n contractAddress: Address;\n} & EncodeExecuteWithModeParameters;\nexport type EncodeExecuteWithModeParameters = {\n mode: ExecutionMode;\n executions: ExecutionStruct[];\n};\n\nexport type ExecuteExecuteWithModeParameters = {\n client: InitializedClient;\n contractAddress: Address;\n} & EncodeExecuteWithModeParameters;\n\nexport const simulate = async ({\n client,\n contractAddress,\n mode,\n executions,\n}: SimulateExecuteWithModeParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'execute',\n args: [mode, encodeExecutionCalldata(executions)],\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n mode,\n executions,\n}: ExecuteExecuteWithModeParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n mode,\n executions,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n mode,\n executions,\n}: EncodeExecuteWithModeParameters) => {\n return encodeFunctionData({\n abi: DeleGatorCore,\n functionName: 'execute',\n args: [mode, encodeExecutionCalldata(executions)],\n });\n};\n","import { encode as disableDelegation } from './methods/disableDelegation';\nimport { encode as enableDelegation } from './methods/enableDelegation';\nimport { encode as execute } from './methods/execute';\nimport { encode as executeWithMode } from './methods/executeWithMode';\nimport { encode as isValidSignature } from './methods/isValidSignature';\nimport { encode as upgradeToAndCall } from './methods/upgradeToAndCall';\n\nexport {\n disableDelegation,\n enableDelegation,\n execute,\n executeWithMode,\n upgradeToAndCall,\n isValidSignature,\n};\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport { encodeFunctionData } from 'viem';\nimport type { Address, Client } 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 SimulateDisableDelegationParameters = {\n client: Client;\n delegationManagerAddress: Address;\n delegation: Delegation;\n};\n\nexport type EncodeDisableDelegationParameters = {\n delegation: Delegation;\n};\n\nexport type ExecuteDisableDelegationParameters = {\n client: InitializedClient;\n delegationManagerAddress: Address;\n delegation: Delegation;\n};\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: DeleGatorCore,\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: DeleGatorCore,\n functionName: 'disableDelegation',\n args: [delegationStruct],\n });\n};\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport { encodeFunctionData } from 'viem';\nimport type { Address, Client } 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 SimulateEnableDelegationParameters = {\n client: Client;\n delegationManagerAddress: Address;\n delegation: Delegation;\n};\n\nexport type EncodeEnableDelegationParameters = {\n delegation: Delegation;\n};\n\nexport type ExecuteEnableDelegationParameters = {\n client: InitializedClient;\n delegationManagerAddress: Address;\n delegation: Delegation;\n};\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: DeleGatorCore,\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: DeleGatorCore,\n functionName: 'enableDelegation',\n args: [delegationStruct],\n });\n};\n","import { DeleGatorCore } from '@metamask/delegation-abis';\nimport type { Address, Hex, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateUpgradeToAndCallParameters = {\n client: Client;\n contractAddress: Address;\n} & EncodeUpgradeToAndCallParameters;\n\nexport type EncodeUpgradeToAndCallParameters = {\n implementation: Address;\n data: Hex;\n};\n\nexport type ExecuteUpgradeToAndCallParameters = {\n client: InitializedClient;\n contractAddress: Address;\n} & EncodeUpgradeToAndCallParameters;\n\nexport const simulate = async ({\n client,\n contractAddress,\n implementation,\n data,\n}: SimulateUpgradeToAndCallParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: DeleGatorCore,\n functionName: 'upgradeToAndCall',\n args: [implementation, data],\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n implementation,\n data,\n}: ExecuteUpgradeToAndCallParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n implementation,\n data,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n implementation,\n data,\n}: EncodeUpgradeToAndCallParameters) => {\n return encodeFunctionData({\n abi: DeleGatorCore,\n functionName: 'upgradeToAndCall',\n args: [implementation, data],\n });\n};\n"],"mappings":";;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB,4BAA4B;AAErD,SAAS,wBAAwB;AACjC,SAAS,eAAe;;;ACJxB;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA,qBAAAA;AAAA,EAAA,gBAAAA;AAAA,EAAA,8BAAAA;AAAA,EAAA,uBAAAA;AAAA,EAAA,wBAAAA;AAAA;;;ACAA,SAAS,qBAAqB;AAE9B,SAAS,oBAAoB;AAOtB,I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C5B;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AACvC,QAAM,EAAE,QAAQ,IAAI,MAAMH,WAAS;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAOI,gBAAc,QAAQ,OAAO;AACtC;AAEO,IAAMC,WAAS,CAAC,EAAE,WAAW,MAAwC;AAC1E,QAAM,mBAAmB,mBAAmB,UAAU;AAEtD,SAAOC,qBAAmB;AAAA,IACxB,KAAKJ;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,gBAAgB;AAAA,EACzB,CAAC;AACH;;;AC9DA,SAAS,iBAAAK,uBAAqB;AAE9B,SAAS,sBAAAC,4BAA0B;AACnC,SAAS,oBAAAC,oBAAkB,iBAAAC,uBAAqB;AAmBzC,IAAMC,aAAW,OAAO;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA0C;AACxC,SAAOF,mBAAiB,QAAQ;AAAA,IAC9B,SAAS;AAAA,IACT,KAAKF;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,gBAAgB,IAAI;AAAA,EAC7B,CAAC;AACH;AAEO,IAAMK,WAAU,OAAO;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AACvC,QAAM,EAAE,QAAQ,IAAI,MAAMD,WAAS;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAOD,gBAAc,QAAQ,OAAO;AACtC;AAEO,IAAMG,WAAS,CAAC;AAAA,EACrB;AAAA,EACA;AACF,MAAwC;AACtC,SAAOL,qBAAmB;AAAA,IACxB,KAAKD;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,gBAAgB,IAAI;AAAA,EAC7B,CAAC;AACH;","names":["read","DeleGatorCore","readContract","read","DeleGatorCore","readContract","read","DeleGatorCore","readContract","read","DeleGatorCore","readContract","read","DeleGatorCore","readContract","read","DeleGatorCore","readContract","read","read","encodeFunctionData","encode","encodeFunctionData","encode","HybridDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","HybridDeleGator","HybridDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","HybridDeleGator","HybridDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","HybridDeleGator","HybridDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","HybridDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","encode_exports","encode","MultiSigDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","MultiSigDeleGator","MultiSigDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","MultiSigDeleGator","MultiSigDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","MultiSigDeleGator","MultiSigDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","MultiSigDeleGator","MultiSigDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","MultiSigDeleGator","MultiSigDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encodeFunctionData","MultiSigDeleGator","encodeFunctionData","simulateContract","writeContract","simulate","encode","encode_exports","encode","DeleGatorCore","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","DeleGatorCore","encodeFunctionData","simulateContract","writeContract","simulate","simulateContract","DeleGatorCore","execute","writeContract","encode","encodeFunctionData","encode_exports","encode","DeleGatorCore","encodeFunctionData","simulateContract","writeContract","simulate","simulateContract","DeleGatorCore","execute","writeContract","encode","encodeFunctionData","DeleGatorCore","encodeFunctionData","simulateContract","writeContract","simulate","simulateContract","DeleGatorCore","execute","writeContract","encode","encodeFunctionData","DeleGatorCore","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode"]}
@@ -14,21 +14,20 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkRR2AMG4Acjs = require('../chunk-RR2AMG4A.cjs');
17
+ var _chunkEPU4O7FYcjs = require('../chunk-EPU4O7FY.cjs');
18
18
 
19
19
 
20
20
 
21
21
 
22
22
 
23
23
 
24
- var _chunkXZ7UMCG3cjs = require('../chunk-XZ7UMCG3.cjs');
24
+ var _chunkPQPAEHJZcjs = require('../chunk-PQPAEHJZ.cjs');
25
25
 
26
26
 
27
27
 
28
28
 
29
- var _chunkSO5JAXGDcjs = require('../chunk-SO5JAXGD.cjs');
30
- require('../chunk-MOHCTPYQ.cjs');
31
- require('../chunk-TMO23YRP.cjs');
29
+ var _chunkJKVSTPECcjs = require('../chunk-JKVSTPEC.cjs');
30
+ require('../chunk-W6HPAK4M.cjs');
32
31
 
33
32
 
34
33
 
@@ -53,5 +52,5 @@ require('../chunk-TMO23YRP.cjs');
53
52
 
54
53
 
55
54
 
56
- exports.DeleGatorCore = _chunkRR2AMG4Acjs.DeleGatorCore_exports; exports.DelegationManager = _chunkRR2AMG4Acjs.DelegationManager_exports; exports.EIP712 = _chunkRR2AMG4Acjs.EIP712_exports; exports.ERC20PeriodTransferEnforcer = _chunkXZ7UMCG3cjs.ERC20PeriodTransferEnforcer_exports; exports.ERC20StreamingEnforcer = _chunkXZ7UMCG3cjs.ERC20StreamingEnforcer_exports; exports.ERC20TransferAmountEnforcer = _chunkRR2AMG4Acjs.ERC20TransferAmountEnforcer_exports; exports.EntryPoint = _chunkRR2AMG4Acjs.EntryPoint_exports; exports.HybridDeleGator = _chunkRR2AMG4Acjs.HybridDeleGator_exports; exports.IdEnforcer = _chunkRR2AMG4Acjs.IdEnforcer_exports; exports.LimitedCallsEnforcer = _chunkRR2AMG4Acjs.LimitedCallsEnforcer_exports; exports.MultiSigDeleGator = _chunkRR2AMG4Acjs.MultiSigDeleGator_exports; exports.MultiTokenPeriodEnforcer = _chunkXZ7UMCG3cjs.MultiTokenPeriodEnforcer_exports; exports.NativeTokenPeriodTransferEnforcer = _chunkXZ7UMCG3cjs.NativeTokenPeriodTransferEnforcer_exports; exports.NativeTokenStreamingEnforcer = _chunkXZ7UMCG3cjs.NativeTokenStreamingEnforcer_exports; exports.NativeTokenTransferAmountEnforcer = _chunkRR2AMG4Acjs.NativeTokenTransferAmountEnforcer_exports; exports.NonceEnforcer = _chunkRR2AMG4Acjs.NonceEnforcer_exports; exports.Ownable2Step = _chunkRR2AMG4Acjs.Ownable2Step_exports; exports.Pausable = _chunkRR2AMG4Acjs.Pausable_exports; exports.SimpleFactory = _chunkRR2AMG4Acjs.SimpleFactory_exports; exports.SpecificActionERC20TransferBatchEnforcer = _chunkRR2AMG4Acjs.SpecificActionERC20TransferBatchEnforcer_exports; exports.encodeProxyCreationCode = _chunkSO5JAXGDcjs.encodeProxyCreationCode; exports.isContractDeployed = _chunkSO5JAXGDcjs.isContractDeployed; exports.isImplementationExpected = _chunkSO5JAXGDcjs.isImplementationExpected;
55
+ exports.DeleGatorCore = _chunkEPU4O7FYcjs.DeleGatorCore_exports; exports.DelegationManager = _chunkEPU4O7FYcjs.DelegationManager_exports; exports.EIP712 = _chunkEPU4O7FYcjs.EIP712_exports; exports.ERC20PeriodTransferEnforcer = _chunkPQPAEHJZcjs.ERC20PeriodTransferEnforcer_exports; exports.ERC20StreamingEnforcer = _chunkPQPAEHJZcjs.ERC20StreamingEnforcer_exports; exports.ERC20TransferAmountEnforcer = _chunkEPU4O7FYcjs.ERC20TransferAmountEnforcer_exports; exports.EntryPoint = _chunkEPU4O7FYcjs.EntryPoint_exports; exports.HybridDeleGator = _chunkEPU4O7FYcjs.HybridDeleGator_exports; exports.IdEnforcer = _chunkEPU4O7FYcjs.IdEnforcer_exports; exports.LimitedCallsEnforcer = _chunkEPU4O7FYcjs.LimitedCallsEnforcer_exports; exports.MultiSigDeleGator = _chunkEPU4O7FYcjs.MultiSigDeleGator_exports; exports.MultiTokenPeriodEnforcer = _chunkPQPAEHJZcjs.MultiTokenPeriodEnforcer_exports; exports.NativeTokenPeriodTransferEnforcer = _chunkPQPAEHJZcjs.NativeTokenPeriodTransferEnforcer_exports; exports.NativeTokenStreamingEnforcer = _chunkPQPAEHJZcjs.NativeTokenStreamingEnforcer_exports; exports.NativeTokenTransferAmountEnforcer = _chunkEPU4O7FYcjs.NativeTokenTransferAmountEnforcer_exports; exports.NonceEnforcer = _chunkEPU4O7FYcjs.NonceEnforcer_exports; exports.Ownable2Step = _chunkEPU4O7FYcjs.Ownable2Step_exports; exports.Pausable = _chunkEPU4O7FYcjs.Pausable_exports; exports.SimpleFactory = _chunkEPU4O7FYcjs.SimpleFactory_exports; exports.SpecificActionERC20TransferBatchEnforcer = _chunkEPU4O7FYcjs.SpecificActionERC20TransferBatchEnforcer_exports; exports.encodeProxyCreationCode = _chunkJKVSTPECcjs.encodeProxyCreationCode; exports.isContractDeployed = _chunkJKVSTPECcjs.isContractDeployed; exports.isImplementationExpected = _chunkJKVSTPECcjs.isImplementationExpected;
57
56
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/contracts/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,kvDAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/contracts/index.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/contracts/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,kvDAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/contracts/index.cjs"}
@@ -1,8 +1,9 @@
1
- export { a as DeleGatorCore, b as DelegationManager, c as EIP712, d as ERC20PeriodTransferEnforcer, e as ERC20StreamingEnforcer, f as ERC20TransferAmountEnforcer, g as EntryPoint, h as HybridDeleGator, j as IdEnforcer, I as InitializedClient, k as LimitedCallsEnforcer, l as MultiSigDeleGator, m as MultiTokenPeriodEnforcer, n as NativeTokenPeriodTransferEnforcer, o as NativeTokenStreamingEnforcer, p as NativeTokenTransferAmountEnforcer, q as NonceEnforcer, r as Ownable2Step, P as P256Owner, s as Pausable, t as SimpleFactory, u as SpecificActionERC20TransferBatchEnforcer, v as encodeProxyCreationCode, w as isContractDeployed, x as isImplementationExpected } from '../index-DzL9ccjU.cjs';
1
+ export { a as DeleGatorCore, b as DelegationManager, c as EIP712, d as ERC20PeriodTransferEnforcer, e as ERC20StreamingEnforcer, f as ERC20TransferAmountEnforcer, g as EntryPoint, h as HybridDeleGator, j as IdEnforcer, I as InitializedClient, k as LimitedCallsEnforcer, l as MultiSigDeleGator, m as MultiTokenPeriodEnforcer, n as NativeTokenPeriodTransferEnforcer, o as NativeTokenStreamingEnforcer, p as NativeTokenTransferAmountEnforcer, q as NonceEnforcer, r as Ownable2Step, P as P256Owner, s as Pausable, t as SimpleFactory, u as SpecificActionERC20TransferBatchEnforcer, v as encodeProxyCreationCode, w as isContractDeployed, x as isImplementationExpected } from '../index-Dv4jPzhe.cjs';
2
2
  import '@metamask/delegation-core';
3
3
  import 'viem';
4
- import '../delegation-DoVULGYE.cjs';
5
- import '../types-BWaH4KH1.cjs';
4
+ import '../decodeRevertReason-CmmCpmZ_.cjs';
5
+ import '../resolveCaveats-A9xC29l8.cjs';
6
6
  import '@metamask/delegation-abis';
7
7
  import 'viem/account-abstraction';
8
8
  import 'viem/chains';
9
+ import '../index-B1Cmezvh.cjs';
@@ -1,8 +1,9 @@
1
- export { a as DeleGatorCore, b as DelegationManager, c as EIP712, d as ERC20PeriodTransferEnforcer, e as ERC20StreamingEnforcer, f as ERC20TransferAmountEnforcer, g as EntryPoint, h as HybridDeleGator, j as IdEnforcer, I as InitializedClient, k as LimitedCallsEnforcer, l as MultiSigDeleGator, m as MultiTokenPeriodEnforcer, n as NativeTokenPeriodTransferEnforcer, o as NativeTokenStreamingEnforcer, p as NativeTokenTransferAmountEnforcer, q as NonceEnforcer, r as Ownable2Step, P as P256Owner, s as Pausable, t as SimpleFactory, u as SpecificActionERC20TransferBatchEnforcer, v as encodeProxyCreationCode, w as isContractDeployed, x as isImplementationExpected } from '../index-DRKgDSZW.js';
1
+ export { a as DeleGatorCore, b as DelegationManager, c as EIP712, d as ERC20PeriodTransferEnforcer, e as ERC20StreamingEnforcer, f as ERC20TransferAmountEnforcer, g as EntryPoint, h as HybridDeleGator, j as IdEnforcer, I as InitializedClient, k as LimitedCallsEnforcer, l as MultiSigDeleGator, m as MultiTokenPeriodEnforcer, n as NativeTokenPeriodTransferEnforcer, o as NativeTokenStreamingEnforcer, p as NativeTokenTransferAmountEnforcer, q as NonceEnforcer, r as Ownable2Step, P as P256Owner, s as Pausable, t as SimpleFactory, u as SpecificActionERC20TransferBatchEnforcer, v as encodeProxyCreationCode, w as isContractDeployed, x as isImplementationExpected } from '../index-BkgdU4LI.js';
2
2
  import '@metamask/delegation-core';
3
3
  import 'viem';
4
- import '../delegation-CR99q1-n.js';
5
- import '../types-BWaH4KH1.js';
4
+ import '../decodeRevertReason-dOTpJx2h.js';
5
+ import '../resolveCaveats-A9xC29l8.js';
6
6
  import '@metamask/delegation-abis';
7
7
  import 'viem/account-abstraction';
8
8
  import 'viem/chains';
9
+ import '../index-LqiEgBjV.js';
@@ -14,21 +14,20 @@ import {
14
14
  Pausable_exports,
15
15
  SimpleFactory_exports,
16
16
  SpecificActionERC20TransferBatchEnforcer_exports
17
- } from "../chunk-HQHXGWNJ.mjs";
17
+ } from "../chunk-L3EZCIY6.mjs";
18
18
  import {
19
19
  ERC20PeriodTransferEnforcer_exports,
20
20
  ERC20StreamingEnforcer_exports,
21
21
  MultiTokenPeriodEnforcer_exports,
22
22
  NativeTokenPeriodTransferEnforcer_exports,
23
23
  NativeTokenStreamingEnforcer_exports
24
- } from "../chunk-DVJX76J3.mjs";
24
+ } from "../chunk-K7GTZGKJ.mjs";
25
25
  import {
26
26
  encodeProxyCreationCode,
27
27
  isContractDeployed,
28
28
  isImplementationExpected
29
- } from "../chunk-ZGBFPD4O.mjs";
30
- import "../chunk-4QXIOE7F.mjs";
31
- import "../chunk-EEIIVBNV.mjs";
29
+ } from "../chunk-YVU66KSH.mjs";
30
+ import "../chunk-TNGQTVSY.mjs";
32
31
  export {
33
32
  DeleGatorCore_exports as DeleGatorCore,
34
33
  DelegationManager_exports as DelegationManager,
@@ -0,0 +1,72 @@
1
+ import { Hex, Address, AbiParameter, TypedData } from 'viem';
2
+ import { S as SmartAccountsEnvironment, c as Caveats, D as Delegation, P as PermissionContext } from './resolveCaveats-A9xC29l8.cjs';
3
+ import { S as ScopeConfig } from './index-B1Cmezvh.cjs';
4
+
5
+ declare const DELEGATION_ABI_TYPE_COMPONENTS: ({
6
+ type: string;
7
+ name: string;
8
+ components?: undefined;
9
+ } | {
10
+ type: string;
11
+ name: string;
12
+ components: {
13
+ type: string;
14
+ name: string;
15
+ }[];
16
+ })[];
17
+ declare const toDelegationStruct: (delegation: Delegation) => DelegationStruct;
18
+ declare const toDelegation: (delegationStruct: DelegationStruct) => Delegation;
19
+ type DelegationStruct = Omit<Delegation, 'salt'> & {
20
+ salt: bigint;
21
+ };
22
+ declare const encodeDelegations: (delegations: PermissionContext) => Hex;
23
+ declare const encodeDelegation: (delegation: Delegation) => Hex;
24
+ declare const decodeDelegations: (delegations: PermissionContext) => Delegation[];
25
+ declare const decodeDelegation: (encoded: Hex) => Delegation;
26
+ declare const SIGNABLE_DELEGATION_TYPED_DATA: TypedData;
27
+ declare const DELEGATION_ARRAY_ABI_TYPE: AbiParameter;
28
+ declare const DELEGATION_ABI_TYPE: AbiParameter;
29
+ declare const hashDelegation: (input: Delegation) => Hex;
30
+ type BaseCreateDelegationOptions = {
31
+ environment: SmartAccountsEnvironment;
32
+ from: Hex;
33
+ caveats?: Caveats;
34
+ salt?: Hex;
35
+ } & ({
36
+ scope: ScopeConfig;
37
+ parentDelegation?: never;
38
+ parentPermissionContext?: never;
39
+ } | {
40
+ scope?: ScopeConfig;
41
+ parentDelegation: Delegation | Hex;
42
+ parentPermissionContext?: never;
43
+ } | {
44
+ scope?: ScopeConfig;
45
+ parentDelegation?: never;
46
+ parentPermissionContext: PermissionContext;
47
+ });
48
+ type CreateDelegationOptions = BaseCreateDelegationOptions & {
49
+ to: Hex;
50
+ };
51
+ type CreateOpenDelegationOptions = BaseCreateDelegationOptions;
52
+ declare const createDelegation: (options: CreateDelegationOptions) => Delegation;
53
+ declare const createOpenDelegation: (options: CreateOpenDelegationOptions) => Delegation;
54
+ declare const signDelegation: ({ privateKey, delegation, delegationManager, chainId, name, version, allowInsecureUnrestrictedDelegation, }: {
55
+ privateKey: Hex;
56
+ delegation: Omit<Delegation, "signature">;
57
+ delegationManager: Address;
58
+ chainId: number;
59
+ name?: string;
60
+ version?: string;
61
+ allowInsecureUnrestrictedDelegation?: boolean;
62
+ }) => Promise<`0x${string}`>;
63
+
64
+ type DecodedRevertReason = {
65
+ readonly errorName: string;
66
+ readonly message: string;
67
+ readonly rawData: Hex;
68
+ };
69
+ declare function decodeRevertReason(error: unknown): DecodedRevertReason | undefined;
70
+ declare function decodeRevertData(rawData: Hex): DecodedRevertReason | undefined;
71
+
72
+ export { type CreateDelegationOptions as C, DELEGATION_ABI_TYPE as D, SIGNABLE_DELEGATION_TYPED_DATA as S, type CreateOpenDelegationOptions as a, createOpenDelegation as b, createDelegation as c, DELEGATION_ABI_TYPE_COMPONENTS as d, DELEGATION_ARRAY_ABI_TYPE as e, type DecodedRevertReason as f, type DelegationStruct as g, decodeDelegation as h, decodeDelegations as i, decodeRevertData as j, decodeRevertReason as k, encodeDelegation as l, encodeDelegations as m, hashDelegation as n, toDelegationStruct as o, signDelegation as s, toDelegation as t };
@@ -0,0 +1,72 @@
1
+ import { Hex, Address, AbiParameter, TypedData } from 'viem';
2
+ import { S as SmartAccountsEnvironment, c as Caveats, D as Delegation, P as PermissionContext } from './resolveCaveats-A9xC29l8.js';
3
+ import { S as ScopeConfig } from './index-LqiEgBjV.js';
4
+
5
+ declare const DELEGATION_ABI_TYPE_COMPONENTS: ({
6
+ type: string;
7
+ name: string;
8
+ components?: undefined;
9
+ } | {
10
+ type: string;
11
+ name: string;
12
+ components: {
13
+ type: string;
14
+ name: string;
15
+ }[];
16
+ })[];
17
+ declare const toDelegationStruct: (delegation: Delegation) => DelegationStruct;
18
+ declare const toDelegation: (delegationStruct: DelegationStruct) => Delegation;
19
+ type DelegationStruct = Omit<Delegation, 'salt'> & {
20
+ salt: bigint;
21
+ };
22
+ declare const encodeDelegations: (delegations: PermissionContext) => Hex;
23
+ declare const encodeDelegation: (delegation: Delegation) => Hex;
24
+ declare const decodeDelegations: (delegations: PermissionContext) => Delegation[];
25
+ declare const decodeDelegation: (encoded: Hex) => Delegation;
26
+ declare const SIGNABLE_DELEGATION_TYPED_DATA: TypedData;
27
+ declare const DELEGATION_ARRAY_ABI_TYPE: AbiParameter;
28
+ declare const DELEGATION_ABI_TYPE: AbiParameter;
29
+ declare const hashDelegation: (input: Delegation) => Hex;
30
+ type BaseCreateDelegationOptions = {
31
+ environment: SmartAccountsEnvironment;
32
+ from: Hex;
33
+ caveats?: Caveats;
34
+ salt?: Hex;
35
+ } & ({
36
+ scope: ScopeConfig;
37
+ parentDelegation?: never;
38
+ parentPermissionContext?: never;
39
+ } | {
40
+ scope?: ScopeConfig;
41
+ parentDelegation: Delegation | Hex;
42
+ parentPermissionContext?: never;
43
+ } | {
44
+ scope?: ScopeConfig;
45
+ parentDelegation?: never;
46
+ parentPermissionContext: PermissionContext;
47
+ });
48
+ type CreateDelegationOptions = BaseCreateDelegationOptions & {
49
+ to: Hex;
50
+ };
51
+ type CreateOpenDelegationOptions = BaseCreateDelegationOptions;
52
+ declare const createDelegation: (options: CreateDelegationOptions) => Delegation;
53
+ declare const createOpenDelegation: (options: CreateOpenDelegationOptions) => Delegation;
54
+ declare const signDelegation: ({ privateKey, delegation, delegationManager, chainId, name, version, allowInsecureUnrestrictedDelegation, }: {
55
+ privateKey: Hex;
56
+ delegation: Omit<Delegation, "signature">;
57
+ delegationManager: Address;
58
+ chainId: number;
59
+ name?: string;
60
+ version?: string;
61
+ allowInsecureUnrestrictedDelegation?: boolean;
62
+ }) => Promise<`0x${string}`>;
63
+
64
+ type DecodedRevertReason = {
65
+ readonly errorName: string;
66
+ readonly message: string;
67
+ readonly rawData: Hex;
68
+ };
69
+ declare function decodeRevertReason(error: unknown): DecodedRevertReason | undefined;
70
+ declare function decodeRevertData(rawData: Hex): DecodedRevertReason | undefined;
71
+
72
+ export { type CreateDelegationOptions as C, DELEGATION_ABI_TYPE as D, SIGNABLE_DELEGATION_TYPED_DATA as S, type CreateOpenDelegationOptions as a, createOpenDelegation as b, createDelegation as c, DELEGATION_ABI_TYPE_COMPONENTS as d, DELEGATION_ARRAY_ABI_TYPE as e, type DecodedRevertReason as f, type DelegationStruct as g, decodeDelegation as h, decodeDelegations as i, decodeRevertData as j, decodeRevertReason as k, encodeDelegation as l, encodeDelegations as m, hashDelegation as n, toDelegationStruct as o, signDelegation as s, toDelegation as t };