@metamask/smart-accounts-kit 1.0.0 → 1.2.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 (73) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/README.md +34 -2
  3. package/dist/actions/index.cjs +5 -5
  4. package/dist/actions/index.d.cts +2 -2
  5. package/dist/actions/index.d.ts +2 -2
  6. package/dist/actions/index.mjs +4 -4
  7. package/dist/{smartAccountsEnvironment-Czw9KUYZ.d.cts → caveats-CQbtzOKm.d.ts} +9 -2
  8. package/dist/{smartAccountsEnvironment-u1CcFcGE.d.ts → caveats-Cey0wm33.d.cts} +9 -2
  9. package/dist/{chunk-UUOH2WAW.cjs → chunk-3SHZ7PV2.cjs} +12 -12
  10. package/dist/{chunk-UUOH2WAW.cjs.map → chunk-3SHZ7PV2.cjs.map} +1 -1
  11. package/dist/{chunk-TPBFVDVM.mjs → chunk-4QXIOE7F.mjs} +8 -6
  12. package/dist/chunk-4QXIOE7F.mjs.map +1 -0
  13. package/dist/{chunk-NOCLGZGB.mjs → chunk-734MOPHR.mjs} +63 -5
  14. package/dist/chunk-734MOPHR.mjs.map +1 -0
  15. package/dist/{chunk-YDLLC6PP.cjs → chunk-7BEEGBA2.cjs} +519 -16
  16. package/dist/chunk-7BEEGBA2.cjs.map +1 -0
  17. package/dist/{chunk-45GHWVQA.mjs → chunk-G7VZ7E6W.mjs} +4 -4
  18. package/dist/{chunk-XN36L4RX.cjs → chunk-HFRQNSZE.cjs} +106 -107
  19. package/dist/chunk-HFRQNSZE.cjs.map +1 -0
  20. package/dist/{chunk-33AMUJBJ.mjs → chunk-L5DLMBDC.mjs} +5 -6
  21. package/dist/{chunk-VLKX4BR6.cjs → chunk-MOHCTPYQ.cjs} +8 -6
  22. package/dist/chunk-MOHCTPYQ.cjs.map +1 -0
  23. package/dist/{chunk-QMRKCB7T.cjs → chunk-T4IAMAB2.cjs} +102 -44
  24. package/dist/chunk-T4IAMAB2.cjs.map +1 -0
  25. package/dist/{chunk-BYWRJGSK.cjs → chunk-UB2FLPP3.cjs} +16 -16
  26. package/dist/{chunk-BYWRJGSK.cjs.map → chunk-UB2FLPP3.cjs.map} +1 -1
  27. package/dist/{chunk-23YXLKTX.cjs → chunk-UZO5OYCD.cjs} +14 -14
  28. package/dist/{chunk-23YXLKTX.cjs.map → chunk-UZO5OYCD.cjs.map} +1 -1
  29. package/dist/{chunk-YTELOQ4I.mjs → chunk-VJXM3LWA.mjs} +2 -2
  30. package/dist/{chunk-WV2R7BXP.mjs → chunk-YTNCEXUX.mjs} +3 -3
  31. package/dist/{chunk-C5ZEEH2Z.mjs → chunk-ZA2XYCVX.mjs} +517 -14
  32. package/dist/chunk-ZA2XYCVX.mjs.map +1 -0
  33. package/dist/contracts/index.cjs +6 -6
  34. package/dist/contracts/index.d.cts +3 -3
  35. package/dist/contracts/index.d.ts +3 -3
  36. package/dist/contracts/index.mjs +5 -5
  37. package/dist/{delegation-DIriDFkq.d.cts → delegation-Bx4FEAIU.d.ts} +2 -2
  38. package/dist/{delegation-CvVXs0PO.d.ts → delegation-KbWHzRxV.d.cts} +2 -2
  39. package/dist/experimental/index.cjs +36 -4
  40. package/dist/experimental/index.cjs.map +1 -1
  41. package/dist/experimental/index.d.cts +5 -2
  42. package/dist/experimental/index.d.ts +5 -2
  43. package/dist/experimental/index.mjs +35 -3
  44. package/dist/experimental/index.mjs.map +1 -1
  45. package/dist/{index-ChTryO1-.d.ts → index-D2THBlfm.d.ts} +3 -3
  46. package/dist/{index-5EdxVa_d.d.ts → index-D7fBuNV-.d.ts} +3 -3
  47. package/dist/{index-DC9baw8F.d.cts → index-DE87r5KY.d.cts} +3 -3
  48. package/dist/{index-Dvc4ir4O.d.cts → index-Uj_xXVko.d.cts} +3 -3
  49. package/dist/index.cjs +36 -26
  50. package/dist/index.cjs.map +1 -1
  51. package/dist/index.d.cts +10 -12
  52. package/dist/index.d.ts +10 -12
  53. package/dist/index.mjs +28 -18
  54. package/dist/index.mjs.map +1 -1
  55. package/dist/{types-qdEHxd5Q.d.ts → types-BWaH4KH1.d.cts} +3 -2
  56. package/dist/{types-qdEHxd5Q.d.cts → types-BWaH4KH1.d.ts} +3 -2
  57. package/dist/utils/index.cjs +7 -5
  58. package/dist/utils/index.cjs.map +1 -1
  59. package/dist/utils/index.d.cts +3 -3
  60. package/dist/utils/index.d.ts +3 -3
  61. package/dist/utils/index.mjs +6 -4
  62. package/package.json +5 -4
  63. package/dist/chunk-C5ZEEH2Z.mjs.map +0 -1
  64. package/dist/chunk-NOCLGZGB.mjs.map +0 -1
  65. package/dist/chunk-QMRKCB7T.cjs.map +0 -1
  66. package/dist/chunk-TPBFVDVM.mjs.map +0 -1
  67. package/dist/chunk-VLKX4BR6.cjs.map +0 -1
  68. package/dist/chunk-XN36L4RX.cjs.map +0 -1
  69. package/dist/chunk-YDLLC6PP.cjs.map +0 -1
  70. /package/dist/{chunk-45GHWVQA.mjs.map → chunk-G7VZ7E6W.mjs.map} +0 -0
  71. /package/dist/{chunk-33AMUJBJ.mjs.map → chunk-L5DLMBDC.mjs.map} +0 -0
  72. /package/dist/{chunk-YTELOQ4I.mjs.map → chunk-VJXM3LWA.mjs.map} +0 -0
  73. /package/dist/{chunk-WV2R7BXP.mjs.map → chunk-YTNCEXUX.mjs.map} +0 -0
@@ -5,14 +5,14 @@
5
5
 
6
6
 
7
7
 
8
- var _chunk23YXLKTXcjs = require('./chunk-23YXLKTX.cjs');
8
+ var _chunkUZO5OYCDcjs = require('./chunk-UZO5OYCD.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkVLKX4BR6cjs = require('./chunk-VLKX4BR6.cjs');
12
+ var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
13
13
 
14
14
 
15
- var _chunkYDLLC6PPcjs = require('./chunk-YDLLC6PP.cjs');
15
+ var _chunk7BEEGBA2cjs = require('./chunk-7BEEGBA2.cjs');
16
16
 
17
17
  // src/counterfactualAccountData.ts
18
18
  var _viem = require('viem');
@@ -48,7 +48,7 @@ var getCounterfactualAccountData = async ({
48
48
  y: yValue
49
49
  };
50
50
  });
51
- initcode = _chunk23YXLKTXcjs.encode.call(void 0, { eoaOwner: owner, p256Owners });
51
+ initcode = _chunkUZO5OYCDcjs.encode.call(void 0, { eoaOwner: owner, p256Owners });
52
52
  break;
53
53
  }
54
54
  case "MultiSig" /* MultiSig */: {
@@ -59,7 +59,7 @@ var getCounterfactualAccountData = async ({
59
59
  );
60
60
  }
61
61
  implementationAddress = implementations.MultiSigDeleGatorImpl;
62
- initcode = _chunk23YXLKTXcjs.encode2.call(void 0, { owners, threshold });
62
+ initcode = _chunkUZO5OYCDcjs.encode2.call(void 0, { owners, threshold });
63
63
  break;
64
64
  }
65
65
  case "Stateless7702" /* Stateless7702 */:
@@ -67,7 +67,7 @@ var getCounterfactualAccountData = async ({
67
67
  throw new Error(`Implementation type '${implementation}' not supported`);
68
68
  }
69
69
  const salt = _viem.pad.call(void 0, deploySalt, { dir: "left", size: 32 });
70
- const proxyCreationCode = _chunk23YXLKTXcjs.encodeProxyCreationCode.call(void 0, {
70
+ const proxyCreationCode = _chunkUZO5OYCDcjs.encodeProxyCreationCode.call(void 0, {
71
71
  implementationAddress,
72
72
  initcode
73
73
  });
@@ -77,7 +77,7 @@ var getCounterfactualAccountData = async ({
77
77
  opcode: "CREATE2",
78
78
  salt
79
79
  });
80
- const factoryData = _chunk23YXLKTXcjs.encode3.call(void 0, proxyCreationCode, salt);
80
+ const factoryData = _chunkUZO5OYCDcjs.encode3.call(void 0, proxyCreationCode, salt);
81
81
  return {
82
82
  factoryData,
83
83
  address
@@ -98,21 +98,21 @@ var processDelegatedCall = (call) => {
98
98
  value,
99
99
  data: callData
100
100
  } = call;
101
- const callAsExecution = _chunkVLKX4BR6cjs.createExecution.call(void 0, { target, value, callData });
101
+ const callAsExecution = _chunkMOHCTPYQcjs.createExecution.call(void 0, { target, value, callData });
102
102
  if (!permissionContext) {
103
103
  return callAsExecution;
104
104
  }
105
- const encodedPermissionsContext = _chunkYDLLC6PPcjs.encodeDelegations.call(void 0, permissionContext);
105
+ const encodedPermissionsContext = _chunk7BEEGBA2cjs.encodeDelegations.call(void 0, permissionContext);
106
106
  const redeemCalldata = _viem.encodeFunctionData.call(void 0, {
107
107
  abi: _delegationabis.DelegationManager,
108
108
  functionName: "redeemDelegations",
109
109
  args: [
110
110
  [encodedPermissionsContext],
111
111
  ["0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */],
112
- _chunkVLKX4BR6cjs.encodeExecutionCalldatas.call(void 0, [[callAsExecution]])
112
+ _chunkMOHCTPYQcjs.encodeExecutionCalldatas.call(void 0, [[callAsExecution]])
113
113
  ]
114
114
  });
115
- return _chunkVLKX4BR6cjs.createExecution.call(void 0, {
115
+ return _chunkMOHCTPYQcjs.createExecution.call(void 0, {
116
116
  target: delegationManager,
117
117
  callData: redeemCalldata
118
118
  });
@@ -122,8 +122,8 @@ var encodeCalls = (calls) => {
122
122
  const call = calls[0];
123
123
  if (call && !isDelegatedCall(call)) {
124
124
  const { to: target, value, data: callData } = call;
125
- const execution = _chunkVLKX4BR6cjs.createExecution.call(void 0, { target, value, callData });
126
- return _chunk23YXLKTXcjs.encode4.call(void 0, { execution });
125
+ const execution = _chunkMOHCTPYQcjs.createExecution.call(void 0, { target, value, callData });
126
+ return _chunkUZO5OYCDcjs.encode4.call(void 0, { execution });
127
127
  }
128
128
  }
129
129
  const executions = calls.map((call) => {
@@ -131,10 +131,10 @@ var encodeCalls = (calls) => {
131
131
  return processDelegatedCall(call);
132
132
  }
133
133
  const { to: target, value, data: callData } = call;
134
- return _chunkVLKX4BR6cjs.createExecution.call(void 0, { target, value, callData });
134
+ return _chunkMOHCTPYQcjs.createExecution.call(void 0, { target, value, callData });
135
135
  });
136
136
  const mode = calls.length === 1 ? "0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */ : "0x0100000000000000000000000000000000000000000000000000000000000000" /* BatchDefault */;
137
- return _chunk23YXLKTXcjs.encode5.call(void 0, { mode, executions });
137
+ return _chunkUZO5OYCDcjs.encode5.call(void 0, { mode, executions });
138
138
  };
139
139
  var encodeCallsForCaller = async (caller, calls) => {
140
140
  if (calls.length === 1) {
@@ -255,4 +255,4 @@ var createDummyWebAuthnSignature = (keyId) => {
255
255
 
256
256
 
257
257
  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-BYWRJGSK.cjs.map
258
+ //# sourceMappingURL=chunk-UB2FLPP3.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-BYWRJGSK.cjs","../src/counterfactualAccountData.ts","../src/encodeCalls.ts","../src/webAuthn.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACfA,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,mBAAA,EAAqB;AACxC,QAAA,MAAM,IAAI,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A,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;AH8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-BYWRJGSK.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"]}
1
+ {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-UB2FLPP3.cjs","../src/counterfactualAccountData.ts","../src/encodeCalls.ts","../src/webAuthn.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACfA,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,mBAAA,EAAqB;AACxC,QAAA,MAAM,IAAI,KAAA;AAAA,UACR;AAAA,QACF,CAAA;AAAA,MACF;AAEA,MAAA,sBAAA,EAAwB,eAAA,CAAgB,mBAAA;AAExC,MAAA,MAAM,WAAA,EAAa,MAAA,CAAO,GAA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IAAA;AACA,EAAA;AAGF,EAAA;AACF;AH8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-UB2FLPP3.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"]}
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkVLKX4BR6cjs = require('./chunk-VLKX4BR6.cjs');
3
+ var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunkYDLLC6PPcjs = require('./chunk-YDLLC6PP.cjs');
7
+ var _chunk7BEEGBA2cjs = require('./chunk-7BEEGBA2.cjs');
8
8
 
9
9
  // src/DelegationFramework/utils.ts
10
10
  var _delegationabis = require('@metamask/delegation-abis');
@@ -14,7 +14,7 @@ var _actions = require('viem/actions');
14
14
 
15
15
  // src/DelegationFramework/DeleGatorCore/read.ts
16
16
  var read_exports = {};
17
- _chunkYDLLC6PPcjs.__export.call(void 0, read_exports, {
17
+ _chunk7BEEGBA2cjs.__export.call(void 0, read_exports, {
18
18
  getDelegationManager: () => read,
19
19
  getDeposit: () => read2,
20
20
  getEntryPoint: () => read3,
@@ -197,7 +197,7 @@ var encode2 = ({
197
197
 
198
198
  // src/DelegationFramework/HybridDeleGator/encode.ts
199
199
  var encode_exports = {};
200
- _chunkYDLLC6PPcjs.__export.call(void 0, encode_exports, {
200
+ _chunk7BEEGBA2cjs.__export.call(void 0, encode_exports, {
201
201
  addKey: () => encode3,
202
202
  initializeHybridDeleGator: () => encode2,
203
203
  reinitializeHybridDeleGator: () => encode4,
@@ -364,7 +364,7 @@ var encode7 = ({ owners, threshold }) => {
364
364
 
365
365
  // src/DelegationFramework/MultiSigDeleGator/encode.ts
366
366
  var encode_exports2 = {};
367
- _chunkYDLLC6PPcjs.__export.call(void 0, encode_exports2, {
367
+ _chunk7BEEGBA2cjs.__export.call(void 0, encode_exports2, {
368
368
  addSigner: () => encode8,
369
369
  initializeMultiSigDeleGator: () => encode7,
370
370
  reinitializeMultiSigDeleGator: () => encode9,
@@ -577,7 +577,7 @@ var execute = async ({
577
577
 
578
578
  // src/DelegationFramework/SimpleFactory/encode.ts
579
579
  var encode_exports3 = {};
580
- _chunkYDLLC6PPcjs.__export.call(void 0, encode_exports3, {
580
+ _chunk7BEEGBA2cjs.__export.call(void 0, encode_exports3, {
581
581
  create2Deploy: () => encode14
582
582
  });
583
583
 
@@ -631,7 +631,7 @@ var simulate15 = async ({
631
631
  address: contractAddress,
632
632
  abi: _delegationabis.DeleGatorCore,
633
633
  functionName: "execute",
634
- args: [mode, _chunkVLKX4BR6cjs.encodeExecutionCalldata.call(void 0, executions)]
634
+ args: [mode, _chunkMOHCTPYQcjs.encodeExecutionCalldata.call(void 0, executions)]
635
635
  });
636
636
  };
637
637
  var execute3 = async ({
@@ -655,13 +655,13 @@ var encode16 = ({
655
655
  return _viem.encodeFunctionData.call(void 0, {
656
656
  abi: _delegationabis.DeleGatorCore,
657
657
  functionName: "execute",
658
- args: [mode, _chunkVLKX4BR6cjs.encodeExecutionCalldata.call(void 0, executions)]
658
+ args: [mode, _chunkMOHCTPYQcjs.encodeExecutionCalldata.call(void 0, executions)]
659
659
  });
660
660
  };
661
661
 
662
662
  // src/DelegationFramework/DeleGatorCore/encode.ts
663
663
  var encode_exports4 = {};
664
- _chunkYDLLC6PPcjs.__export.call(void 0, encode_exports4, {
664
+ _chunk7BEEGBA2cjs.__export.call(void 0, encode_exports4, {
665
665
  disableDelegation: () => encode17,
666
666
  enableDelegation: () => encode18,
667
667
  execute: () => encode15,
@@ -679,7 +679,7 @@ var simulate16 = async ({
679
679
  delegationManagerAddress,
680
680
  delegation
681
681
  }) => {
682
- const delegationStruct = _chunkYDLLC6PPcjs.toDelegationStruct.call(void 0, delegation);
682
+ const delegationStruct = _chunk7BEEGBA2cjs.toDelegationStruct.call(void 0, delegation);
683
683
  return _actions.simulateContract.call(void 0, client, {
684
684
  address: delegationManagerAddress,
685
685
  abi: _delegationabis.DeleGatorCore,
@@ -700,7 +700,7 @@ var execute4 = async ({
700
700
  return _actions.writeContract.call(void 0, client, request);
701
701
  };
702
702
  var encode17 = ({ delegation }) => {
703
- const delegationStruct = _chunkYDLLC6PPcjs.toDelegationStruct.call(void 0, delegation);
703
+ const delegationStruct = _chunk7BEEGBA2cjs.toDelegationStruct.call(void 0, delegation);
704
704
  return _viem.encodeFunctionData.call(void 0, {
705
705
  abi: _delegationabis.DeleGatorCore,
706
706
  functionName: "disableDelegation",
@@ -717,7 +717,7 @@ var simulate17 = async ({
717
717
  delegationManagerAddress,
718
718
  delegation
719
719
  }) => {
720
- const delegationStruct = _chunkYDLLC6PPcjs.toDelegationStruct.call(void 0, delegation);
720
+ const delegationStruct = _chunk7BEEGBA2cjs.toDelegationStruct.call(void 0, delegation);
721
721
  return _actions.simulateContract.call(void 0, client, {
722
722
  address: delegationManagerAddress,
723
723
  abi: _delegationabis.DeleGatorCore,
@@ -738,7 +738,7 @@ var execute5 = async ({
738
738
  return _actions.writeContract.call(void 0, client, request);
739
739
  };
740
740
  var encode18 = ({ delegation }) => {
741
- const delegationStruct = _chunkYDLLC6PPcjs.toDelegationStruct.call(void 0, delegation);
741
+ const delegationStruct = _chunk7BEEGBA2cjs.toDelegationStruct.call(void 0, delegation);
742
742
  return _viem.encodeFunctionData.call(void 0, {
743
743
  abi: _delegationabis.DeleGatorCore,
744
744
  functionName: "enableDelegation",
@@ -827,4 +827,4 @@ var encode19 = ({
827
827
 
828
828
 
829
829
  exports.simulate = simulate2; exports.simulate2 = simulate; exports.encode = encode2; exports.simulate3 = simulate3; exports.simulate4 = simulate4; exports.simulate5 = simulate5; exports.encode_exports = encode_exports; exports.simulate6 = simulate7; exports.simulate7 = simulate6; exports.encode2 = encode7; exports.simulate8 = simulate8; exports.simulate9 = simulate9; exports.simulate10 = simulate10; exports.simulate11 = simulate11; exports.simulate12 = simulate12; exports.encode_exports2 = encode_exports2; exports.simulate13 = simulate13; exports.encode3 = encode14; exports.execute = execute; exports.encode_exports3 = encode_exports3; exports.read_exports = read_exports; exports.isContractDeployed = isContractDeployed; exports.isImplementationExpected = isImplementationExpected; exports.encodeProxyCreationCode = encodeProxyCreationCode; exports.simulate14 = simulate16; exports.execute2 = execute4; exports.simulate15 = simulate17; exports.execute3 = execute5; exports.simulate16 = simulate14; exports.execute4 = execute2; exports.encode4 = encode15; exports.simulate17 = simulate15; exports.execute5 = execute3; exports.encode5 = encode16; exports.simulate18 = simulate18; exports.execute6 = execute6; exports.encode_exports4 = encode_exports4;
830
- //# sourceMappingURL=chunk-23YXLKTX.cjs.map
830
+ //# sourceMappingURL=chunk-UZO5OYCD.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-23YXLKTX.cjs","../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/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"],"names":["read","readContract","DeleGatorCore","encode","encodeFunctionData","simulate","simulateContract","HybridDeleGator","encode_exports","MultiSigDeleGator","writeContract","execute"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACRA,2DAA6B;AAC7B,8DAAqD;AAErD,4BAAiC;AACjC,uCAAwB;ADSxB;AACA;AEdA,IAAA,aAAA,EAAA,CAAA,CAAA;AAAA,wCAAA,YAAA,EAAA;AAAA,EAAA,oBAAA,EAAA,CAAA,EAAA,GAAA,IAAA;AAAA,EAAA,UAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,aAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,QAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,sBAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,eAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,gBAAA,EAAA,CAAA,EAAA,GAAAA;AAAA,CAAA,CAAA;AFyB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/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-23YXLKTX.cjs","sourcesContent":[null,"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 { 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"]}
1
+ {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-UZO5OYCD.cjs","../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/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"],"names":["read","readContract","DeleGatorCore","encode","encodeFunctionData","simulate","simulateContract","HybridDeleGator","encode_exports","MultiSigDeleGator","writeContract","execute"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACRA,2DAA6B;AAC7B,8DAAqD;AAErD,4BAAiC;AACjC,uCAAwB;ADSxB;AACA;AEdA,IAAA,aAAA,EAAA,CAAA,CAAA;AAAA,wCAAA,YAAA,EAAA;AAAA,EAAA,oBAAA,EAAA,CAAA,EAAA,GAAA,IAAA;AAAA,EAAA,UAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,aAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,QAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,sBAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,eAAA,EAAA,CAAA,EAAA,GAAAA,KAAAA;AAAA,EAAA,gBAAA,EAAA,CAAA,EAAA,GAAAA;AAAA,CAAA,CAAA;AFyBA;AACA;AG1BA;AAEA;AAOO,IAAM,KAAA,EAAO,MAAA,CAAO;AAAA,EACzB,MAAA;AAAA,EACA;AACF,CAAA,EAAA,GACE,MAAM,mCAAA,MAAa,EAAQ;AAAA,EACzB,OAAA,EAAS,eAAA;AAAA,EACT,GAAA,EAAK,6BAAA;AAAA,EACL,YAAA,EAAc;AAChB,CAAC,CAAA;AHoBH;AACA;AItCA;AAEA;AAOO,IAAMA,MAAAA,EAAO,MAAA,CAAO;AAAA,EACzB,MAAA;AAAA,EACA;AACF,CAAA,EAAA,GACE,MA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,EAAgB,IAAI;AAAA,EAC7B,CAAC,CAAA;AACH,CAAA;AAEO,IAAMS,SAAAA,EAAU,MAAA,CAAO;AAAA,EAC5B,MAAA;AAAA,EACA,eAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA,EAAA,GAAyC;AACvC,EAAA,MAAM,EAAE,QAAQ,EAAA,EAAI,MAAMN,UAAAA,CAAS;AAAA,IACjC,MAAA;AAAA,IACA,eAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,EACF,CAAC,CAAA;AAED,EAAA,OAAOK,oCAAAA,MAAc,EAAQ,OAAO,CAAA;AACtC,CAAA;AAEO,IAAMP,SAAAA,EAAS,CAAC;AAAA,EACrB,cAAA;AAAA,EACA;AACF,CAAA,EAAA,GAAwC;AACtC,EAAA,OAAOC,sCAAAA;AAAmB,IACxB,GAAA,EAAKF,6BAAAA;AAAA,IACL,YAAA,EAAc,kBAAA;AAAA,IACd,IAAA,EAAM,CAAC,cAAA,EAAgB,IAAI;AAAA,EAC7B,CAAC,CAAA;AACH,CAAA;A/BwtBA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,0uCAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-UZO5OYCD.cjs","sourcesContent":[null,"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 { 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"]}