@metamask/smart-accounts-kit 0.4.0-beta.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -1
- package/dist/actions/index.cjs +5 -5
- package/dist/actions/index.d.cts +2 -2
- package/dist/actions/index.d.ts +2 -2
- package/dist/actions/index.mjs +4 -4
- package/dist/{chunk-HBAJRXQB.cjs → chunk-23YXLKTX.cjs} +11 -11
- package/dist/{chunk-HBAJRXQB.cjs.map → chunk-23YXLKTX.cjs.map} +1 -1
- package/dist/{chunk-GH5EK5MB.mjs → chunk-33AMUJBJ.mjs} +7 -7
- package/dist/chunk-33AMUJBJ.mjs.map +1 -0
- package/dist/{chunk-DRVPD5QI.mjs → chunk-45GHWVQA.mjs} +17 -34
- package/dist/chunk-45GHWVQA.mjs.map +1 -0
- package/dist/{chunk-OPJBYTWX.cjs → chunk-BYWRJGSK.cjs} +23 -40
- package/dist/chunk-BYWRJGSK.cjs.map +1 -0
- package/dist/{chunk-TEH426Y4.mjs → chunk-C5ZEEH2Z.mjs} +283 -184
- package/dist/chunk-C5ZEEH2Z.mjs.map +1 -0
- package/dist/{chunk-YYZWHBF2.mjs → chunk-NOCLGZGB.mjs} +173 -128
- package/dist/chunk-NOCLGZGB.mjs.map +1 -0
- package/dist/{chunk-5FLY3IPW.mjs → chunk-QCULIK3O.mjs} +27 -56
- package/dist/chunk-QCULIK3O.mjs.map +1 -0
- package/dist/{chunk-CLBI7P3Z.cjs → chunk-QMRKCB7T.cjs} +203 -158
- package/dist/chunk-QMRKCB7T.cjs.map +1 -0
- package/dist/{chunk-Q4V7BKAG.cjs → chunk-SOFB2MXG.cjs} +27 -56
- package/dist/chunk-SOFB2MXG.cjs.map +1 -0
- package/dist/{chunk-NGZLJAMA.cjs → chunk-UUOH2WAW.cjs} +12 -12
- package/dist/{chunk-NGZLJAMA.cjs.map → chunk-UUOH2WAW.cjs.map} +1 -1
- package/dist/{chunk-ZTGEG2ZA.mjs → chunk-WV2R7BXP.mjs} +2 -2
- package/dist/{chunk-7CVW7JE3.cjs → chunk-XN36L4RX.cjs} +102 -102
- package/dist/chunk-XN36L4RX.cjs.map +1 -0
- package/dist/{chunk-MIP7KJYH.cjs → chunk-YDLLC6PP.cjs} +252 -153
- package/dist/chunk-YDLLC6PP.cjs.map +1 -0
- package/dist/{chunk-XUVEYTD2.mjs → chunk-YTELOQ4I.mjs} +2 -2
- package/dist/contracts/index.cjs +5 -5
- package/dist/contracts/index.d.cts +3 -3
- package/dist/contracts/index.d.ts +3 -3
- package/dist/contracts/index.mjs +4 -4
- package/dist/{delegation-sP7mnAkl.d.ts → delegation-CvVXs0PO.d.ts} +52 -26
- package/dist/{delegation-Bd2v5lF5.d.cts → delegation-DIriDFkq.d.cts} +52 -26
- package/dist/experimental/index.cjs +4 -4
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/index.d.cts +1 -1
- package/dist/experimental/index.d.ts +1 -1
- package/dist/experimental/index.mjs +5 -5
- package/dist/experimental/index.mjs.map +1 -1
- package/dist/{index-Bfcoh3WQ.d.ts → index-5EdxVa_d.d.ts} +92 -62
- package/dist/{index-B9w3fRT-.d.cts → index-ChTryO1-.d.ts} +4 -5
- package/dist/{index-DpokPMZc.d.ts → index-DC9baw8F.d.cts} +4 -5
- package/dist/{index-C8wAvC29.d.cts → index-Dvc4ir4O.d.cts} +92 -62
- package/dist/index.cjs +63 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -11
- package/dist/index.d.ts +9 -11
- package/dist/index.mjs +55 -25
- package/dist/index.mjs.map +1 -1
- package/dist/{smartAccountsEnvironment-YDC3jB33.d.cts → smartAccountsEnvironment-Czw9KUYZ.d.cts} +1 -1
- package/dist/{smartAccountsEnvironment-EW722Cnw.d.ts → smartAccountsEnvironment-u1CcFcGE.d.ts} +1 -1
- package/dist/{types-B9GE5CfG.d.ts → types-qdEHxd5Q.d.cts} +47 -29
- package/dist/{types-B9GE5CfG.d.cts → types-qdEHxd5Q.d.ts} +47 -29
- package/dist/utils/index.cjs +7 -5
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +3 -4
- package/dist/utils/index.d.ts +3 -4
- package/dist/utils/index.mjs +12 -10
- package/package.json +7 -12
- package/dist/chunk-5FLY3IPW.mjs.map +0 -1
- package/dist/chunk-7CVW7JE3.cjs.map +0 -1
- package/dist/chunk-CLBI7P3Z.cjs.map +0 -1
- package/dist/chunk-DRVPD5QI.mjs.map +0 -1
- package/dist/chunk-GH5EK5MB.mjs.map +0 -1
- package/dist/chunk-MIP7KJYH.cjs.map +0 -1
- package/dist/chunk-OPJBYTWX.cjs.map +0 -1
- package/dist/chunk-Q4V7BKAG.cjs.map +0 -1
- package/dist/chunk-TEH426Y4.mjs.map +0 -1
- package/dist/chunk-YYZWHBF2.mjs.map +0 -1
- /package/dist/{chunk-ZTGEG2ZA.mjs.map → chunk-WV2R7BXP.mjs.map} +0 -0
- /package/dist/{chunk-XUVEYTD2.mjs.map → chunk-YTELOQ4I.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/contracts/index.ts","../src/DelegationFramework/DelegationManager/index.ts","../src/DelegationFramework/DelegationManager/constants.ts","../src/DelegationFramework/DelegationManager/encode.ts","../src/DelegationFramework/DelegationManager/methods/disableDelegation.ts","../src/DelegationFramework/DelegationManager/methods/enableDelegation.ts","../src/DelegationFramework/DelegationManager/methods/redeemDelegations.ts","../src/DelegationFramework/DelegationManager/execute.ts","../src/DelegationFramework/DelegationManager/read.ts","../src/DelegationFramework/DelegationManager/methods/disabledDelegations.ts","../src/DelegationFramework/DelegationManager/methods/getAnyDelegate.ts","../src/DelegationFramework/DelegationManager/methods/getRootAuthority.ts","../src/DelegationFramework/DelegationManager/simulate.ts","../src/DelegationFramework/DeleGatorCore/index.ts","../src/DelegationFramework/DeleGatorCore/execute.ts","../src/DelegationFramework/DeleGatorCore/simulate.ts","../src/DelegationFramework/EIP712/index.ts","../src/DelegationFramework/EIP712/read.ts","../src/DelegationFramework/EIP712/methods/getContractName.ts","../src/DelegationFramework/EIP712/methods/getContractVersion.ts","../src/DelegationFramework/EIP712/methods/getDomainVersion.ts","../src/DelegationFramework/EntryPoint/index.ts","../src/DelegationFramework/EntryPoint/read.ts","../src/DelegationFramework/EntryPoint/methods/getNonce.ts","../src/DelegationFramework/ERC20TransferAmountEnforcer/index.ts","../src/DelegationFramework/ERC20TransferAmountEnforcer/read.ts","../src/DelegationFramework/ERC20TransferAmountEnforcer/methods/getSpentAmount.ts","../src/DelegationFramework/ERC20TransferAmountEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/HybridDeleGator/index.ts","../src/DelegationFramework/HybridDeleGator/read.ts","../src/DelegationFramework/HybridDeleGator/methods/getKey.ts","../src/DelegationFramework/HybridDeleGator/methods/getKeyIdHashes.ts","../src/DelegationFramework/HybridDeleGator/methods/getKeyIdHashesCount.ts","../src/DelegationFramework/HybridDeleGator/simulate.ts","../src/DelegationFramework/HybridDeleGator/constants.ts","../src/DelegationFramework/IdEnforcer/index.ts","../src/DelegationFramework/IdEnforcer/read.ts","../src/DelegationFramework/IdEnforcer/methods/getIsUsed.ts","../src/DelegationFramework/IdEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/LimitedCallsEnforcer/index.ts","../src/DelegationFramework/LimitedCallsEnforcer/read.ts","../src/DelegationFramework/LimitedCallsEnforcer/methods/callCounts.ts","../src/DelegationFramework/LimitedCallsEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/MultiSigDeleGator/index.ts","../src/DelegationFramework/MultiSigDeleGator/read.ts","../src/DelegationFramework/MultiSigDeleGator/methods/getMaxNumberOfSigners.ts","../src/DelegationFramework/MultiSigDeleGator/methods/getSigners.ts","../src/DelegationFramework/MultiSigDeleGator/methods/getSignersCount.ts","../src/DelegationFramework/MultiSigDeleGator/methods/getThreshold.ts","../src/DelegationFramework/MultiSigDeleGator/methods/isSigner.ts","../src/DelegationFramework/MultiSigDeleGator/simulate.ts","../src/DelegationFramework/MultiSigDeleGator/constants.ts","../src/DelegationFramework/NativeTokenTransferAmountEnforcer/index.ts","../src/DelegationFramework/NativeTokenTransferAmountEnforcer/read.ts","../src/DelegationFramework/NativeTokenTransferAmountEnforcer/methods/getSpentAmount.ts","../src/DelegationFramework/NativeTokenTransferAmountEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/NonceEnforcer/index.ts","../src/DelegationFramework/NonceEnforcer/encode.ts","../src/DelegationFramework/NonceEnforcer/methods/incrementNonce.ts","../src/DelegationFramework/NonceEnforcer/execute.ts","../src/DelegationFramework/NonceEnforcer/read.ts","../src/DelegationFramework/NonceEnforcer/methods/currentNonce.ts","../src/DelegationFramework/NonceEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/NonceEnforcer/simulate.ts","../src/DelegationFramework/Ownable2Step/index.ts","../src/DelegationFramework/Ownable2Step/read.ts","../src/DelegationFramework/Ownable2Step/methods/getOwner.ts","../src/DelegationFramework/Ownable2Step/methods/getPendingOwner.ts","../src/DelegationFramework/Ownable2Step/execute.ts","../src/DelegationFramework/Ownable2Step/methods/acceptOwnership.ts","../src/DelegationFramework/Ownable2Step/methods/renounceOwnership.ts","../src/DelegationFramework/Ownable2Step/methods/transferOwnership.ts","../src/DelegationFramework/Ownable2Step/encode.ts","../src/DelegationFramework/Ownable2Step/simulate.ts","../src/DelegationFramework/Pausable/index.ts","../src/DelegationFramework/Pausable/read.ts","../src/DelegationFramework/Pausable/methods/isPaused.ts","../src/DelegationFramework/Pausable/execute.ts","../src/DelegationFramework/Pausable/methods/pause.ts","../src/DelegationFramework/Pausable/methods/unpause.ts","../src/DelegationFramework/Pausable/encode.ts","../src/DelegationFramework/Pausable/simulate.ts","../src/DelegationFramework/SimpleFactory/index.ts","../src/DelegationFramework/SimpleFactory/execute.ts","../src/DelegationFramework/SimpleFactory/read.ts","../src/DelegationFramework/SimpleFactory/methods/getCreate2Address.ts","../src/DelegationFramework/SimpleFactory/simulate.ts","../src/DelegationFramework/SpecificActionERC20TransferBatchEnforcer/index.ts","../src/DelegationFramework/SpecificActionERC20TransferBatchEnforcer/read.ts","../src/DelegationFramework/SpecificActionERC20TransferBatchEnforcer/methods/getTermsInfo.ts","../src/DelegationFramework/SpecificActionERC20TransferBatchEnforcer/methods/usedDelegations.ts"],"sourcesContent":["import * as DelegationManager from '../DelegationFramework/DelegationManager';\nimport * as DeleGatorCore from '../DelegationFramework/DeleGatorCore';\nimport * as EIP712 from '../DelegationFramework/EIP712';\nimport * as EntryPoint from '../DelegationFramework/EntryPoint';\nimport * as ERC20PeriodTransferEnforcer from '../DelegationFramework/ERC20PeriodTransferEnforcer';\nimport * as ERC20StreamingEnforcer from '../DelegationFramework/ERC20StreamingEnforcer';\nimport * as ERC20TransferAmountEnforcer from '../DelegationFramework/ERC20TransferAmountEnforcer';\nimport * as HybridDeleGator from '../DelegationFramework/HybridDeleGator';\nimport * as IdEnforcer from '../DelegationFramework/IdEnforcer';\nimport * as LimitedCallsEnforcer from '../DelegationFramework/LimitedCallsEnforcer';\nimport * as MultiSigDeleGator from '../DelegationFramework/MultiSigDeleGator';\nimport * as MultiTokenPeriodEnforcer from '../DelegationFramework/MultiTokenPeriodEnforcer';\nimport * as NativeTokenPeriodTransferEnforcer from '../DelegationFramework/NativeTokenPeriodTransferEnforcer';\nimport * as NativeTokenStreamingEnforcer from '../DelegationFramework/NativeTokenStreamingEnforcer';\nimport * as NativeTokenTransferAmountEnforcer from '../DelegationFramework/NativeTokenTransferAmountEnforcer';\nimport * as NonceEnforcer from '../DelegationFramework/NonceEnforcer';\nimport * as Ownable2Step from '../DelegationFramework/Ownable2Step';\nimport * as Pausable from '../DelegationFramework/Pausable';\nimport * as SimpleFactory from '../DelegationFramework/SimpleFactory';\nimport * as SpecificActionERC20TransferBatchEnforcer from '../DelegationFramework/SpecificActionERC20TransferBatchEnforcer';\n\nexport {\n isContractDeployed,\n isImplementationExpected,\n encodeProxyCreationCode,\n} from '../DelegationFramework/utils';\n\nexport {\n DelegationManager,\n DeleGatorCore,\n EIP712,\n EntryPoint,\n HybridDeleGator,\n IdEnforcer,\n LimitedCallsEnforcer,\n MultiSigDeleGator,\n NonceEnforcer,\n Ownable2Step,\n Pausable,\n SimpleFactory,\n SpecificActionERC20TransferBatchEnforcer,\n ERC20PeriodTransferEnforcer,\n ERC20StreamingEnforcer,\n ERC20TransferAmountEnforcer,\n MultiTokenPeriodEnforcer,\n NativeTokenPeriodTransferEnforcer,\n NativeTokenStreamingEnforcer,\n NativeTokenTransferAmountEnforcer,\n};\n\nexport type {\n P256Owner,\n InitializedClient,\n} from '../DelegationFramework/types';\n","import * as constants from './constants';\nimport * as encode from './encode';\nimport * as execute from './execute';\nimport * as read from './read';\nimport * as simulate from './simulate';\n\nexport { encode, execute, read, simulate, constants };\n","export { ROOT_AUTHORITY, ANY_BENEFICIARY } from '../../delegation';\n\nexport const NAME = 'DelegationManager';\nexport const VERSION = '1.3.0';\nexport const DOMAIN_VERSION = '1';\n","import { encode as disableDelegation } from './methods/disableDelegation';\nimport { encode as enableDelegation } from './methods/enableDelegation';\nimport { encode as redeemDelegations } from './methods/redeemDelegations';\n\nexport { disableDelegation, enableDelegation, redeemDelegations };\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport { toDelegationStruct } from '../../../delegation';\nimport type { Delegation } from '../../../types';\nimport type { InitializedClient } from '../../types';\n\nexport type EncodeDisableDelegationParameters = {\n delegation: Delegation;\n};\n\nexport type SimulateDisableDelegationParameters = {\n client: Client;\n delegationManagerAddress: Address;\n} & EncodeDisableDelegationParameters;\n\nexport type ExecuteDisableDelegationParameters = {\n client: InitializedClient;\n delegationManagerAddress: Address;\n} & EncodeDisableDelegationParameters;\n\nexport const simulate = async ({\n client,\n delegationManagerAddress,\n delegation,\n}: SimulateDisableDelegationParameters) => {\n const delegationStruct = toDelegationStruct(delegation);\n\n return simulateContract(client, {\n address: delegationManagerAddress,\n abi: DelegationManager,\n functionName: 'disableDelegation',\n args: [delegationStruct],\n });\n};\n\nexport const execute = async ({\n client,\n delegationManagerAddress,\n delegation,\n}: ExecuteDisableDelegationParameters) => {\n const { request } = await simulate({\n client,\n delegationManagerAddress,\n delegation,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ delegation }: EncodeDisableDelegationParameters) => {\n const delegationStruct = toDelegationStruct(delegation);\n\n return encodeFunctionData({\n abi: DelegationManager,\n functionName: 'disableDelegation',\n args: [delegationStruct],\n });\n};\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport { toDelegationStruct } from '../../../delegation';\nimport type { Delegation } from '../../../types';\nimport type { InitializedClient } from '../../types';\n\nexport type EncodeEnableDelegationParameters = {\n delegation: Delegation;\n};\n\nexport type SimulateEnableDelegationParameters = {\n client: Client;\n delegationManagerAddress: Address;\n} & EncodeEnableDelegationParameters;\n\nexport type ExecuteEnableDelegationParameters = {\n client: InitializedClient;\n delegationManagerAddress: Address;\n} & EncodeEnableDelegationParameters;\n\nexport const simulate = async ({\n client,\n delegationManagerAddress,\n delegation,\n}: SimulateEnableDelegationParameters) => {\n const delegationStruct = toDelegationStruct(delegation);\n\n return simulateContract(client, {\n address: delegationManagerAddress,\n abi: DelegationManager,\n functionName: 'enableDelegation',\n args: [delegationStruct],\n });\n};\n\nexport const execute = async ({\n client,\n delegationManagerAddress,\n delegation,\n}: ExecuteEnableDelegationParameters) => {\n const { request } = await simulate({\n client,\n delegationManagerAddress,\n delegation,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({ delegation }: EncodeEnableDelegationParameters) => {\n const delegationStruct = toDelegationStruct(delegation);\n\n return encodeFunctionData({\n abi: DelegationManager,\n functionName: 'enableDelegation',\n args: [delegationStruct],\n });\n};\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport { encodeDelegations } from '../../../delegation';\nimport { encodeExecutionCalldatas } from '../../../executions';\nimport type { ExecutionMode, ExecutionStruct } from '../../../executions';\nimport type { PermissionContext } from '../../../types';\nimport type { InitializedClient } from '../../types';\n\nexport type EncodeRedeemDelegationsParameters = {\n delegations: PermissionContext[];\n modes: ExecutionMode[];\n executions: ExecutionStruct[][];\n};\n\nexport type SimulateRedeemDelegationsParameters = {\n client: Client;\n delegationManagerAddress: Address;\n} & EncodeRedeemDelegationsParameters;\n\nexport type ExecuteRedeemDelegationsParameters = {\n client: InitializedClient;\n delegationManagerAddress: Address;\n} & EncodeRedeemDelegationsParameters;\n\nexport const simulate = async ({\n client,\n delegationManagerAddress,\n delegations,\n modes,\n executions,\n}: SimulateRedeemDelegationsParameters) => {\n return simulateContract(client, {\n address: delegationManagerAddress,\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [\n delegations.map((delegationChain) => encodeDelegations(delegationChain)),\n modes,\n encodeExecutionCalldatas(executions),\n ],\n });\n};\n\nexport const execute = async ({\n client,\n delegationManagerAddress,\n delegations,\n modes,\n executions,\n}: ExecuteRedeemDelegationsParameters) => {\n const { request } = await simulate({\n client,\n delegationManagerAddress,\n delegations,\n modes,\n executions,\n });\n\n return writeContract(client, request);\n};\n\nexport const encode = ({\n delegations,\n modes,\n executions,\n}: EncodeRedeemDelegationsParameters) => {\n return encodeFunctionData({\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [\n delegations.map((delegationChain) => encodeDelegations(delegationChain)),\n modes,\n encodeExecutionCalldatas(executions),\n ],\n });\n};\n","import { execute as disableDelegation } from './methods/disableDelegation';\nimport { execute as enableDelegation } from './methods/enableDelegation';\nimport { execute as redeemDelegations } from './methods/redeemDelegations';\n\nexport { disableDelegation, enableDelegation, redeemDelegations };\n","import { read as disabledDelegations } from './methods/disabledDelegations';\nimport { read as getAnyDelegate } from './methods/getAnyDelegate';\nimport { read as getRootAuthority } from './methods/getRootAuthority';\n\nexport { getAnyDelegate, getRootAuthority, disabledDelegations };\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadDisabledDelegationsParameters = {\n client: Client;\n contractAddress: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationHash,\n}: ReadDisabledDelegationsParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DelegationManager,\n functionName: 'disabledDelegations',\n args: [delegationHash],\n });\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetAnyDelegateParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetAnyDelegateParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DelegationManager,\n functionName: 'ANY_DELEGATE',\n });\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetRootAuthorityParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetRootAuthorityParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: DelegationManager,\n functionName: 'ROOT_AUTHORITY',\n });\n","import { simulate as disableDelegation } from './methods/disableDelegation';\nimport { simulate as enableDelegation } from './methods/enableDelegation';\nimport { simulate as redeemDelegations } from './methods/redeemDelegations';\n\nexport { disableDelegation, enableDelegation, redeemDelegations };\n","import * as encode from './encode';\nimport * as execute from './execute';\nimport * as read from './read';\nimport * as simulate from './simulate';\n\nexport { encode, simulate, read, execute };\n","import { execute as disableDelegation } from './methods/disableDelegation';\nimport { execute as enableDelegation } from './methods/enableDelegation';\nimport { execute } from './methods/execute';\nimport { execute as executeWithMode } from './methods/executeWithMode';\nimport { execute as upgradeToAndCall } from './methods/upgradeToAndCall';\n\nexport {\n disableDelegation,\n enableDelegation,\n execute,\n executeWithMode,\n upgradeToAndCall,\n};\n","import { simulate as disableDelegation } from './methods/disableDelegation';\nimport { simulate as enableDelegation } from './methods/enableDelegation';\nimport { simulate as execute } from './methods/execute';\nimport { simulate as executeWithMode } from './methods/executeWithMode';\nimport { simulate as upgradeToAndCall } from './methods/upgradeToAndCall';\n\nexport {\n disableDelegation,\n enableDelegation,\n execute,\n executeWithMode,\n upgradeToAndCall,\n};\n","export * as read from './read';\n","import { read as getContractName } from './methods/getContractName';\nimport { read as getContractVersion } from './methods/getContractVersion';\nimport { read as getDomainVersion } from './methods/getDomainVersion';\n\nexport { getContractName, getContractVersion, getDomainVersion };\n","import type { Client, Address } from 'viem';\nimport { readContract } from 'viem/actions';\n\n// NOTE: ABIs have been extracted and minimized for reuse across contracts. These methods are included in our contracts but are not a part of the EIP712 standard itself.\n\nexport type ReadGetContractNameParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetContractNameParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: [\n {\n type: 'function',\n name: 'NAME',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'string',\n internalType: 'string',\n },\n ],\n stateMutability: 'view',\n },\n ],\n functionName: 'NAME',\n });\n","import type { Client, Address } from 'viem';\nimport { readContract } from 'viem/actions';\n\n// NOTE: ABIs have been extracted and minimized for reuse across contracts. These methods are included in our contracts but are not a part of the EIP712 standard itself.\n\nexport type ReadGetContractVersionParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetContractVersionParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: [\n {\n type: 'function',\n name: 'VERSION',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'string',\n internalType: 'string',\n },\n ],\n stateMutability: 'view',\n },\n ],\n functionName: 'VERSION',\n });\n","import type { Client, Address } from 'viem';\nimport { readContract } from 'viem/actions';\n\n// NOTE: ABIs have been extracted and minimized for reuse across contracts. These methods are included in our contracts but are not a part of the EIP712 standard itself.\n\nexport type ReadGetDomainVersionParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetDomainVersionParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: [\n {\n type: 'function',\n name: 'DOMAIN_VERSION',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'string',\n internalType: 'string',\n },\n ],\n stateMutability: 'view',\n },\n ],\n functionName: 'DOMAIN_VERSION',\n });\n","import * as read from './read';\n\nexport { read };\n","import { read as entryPointGetNonce } from './methods/getNonce';\n\nexport { entryPointGetNonce };\n","import { EntryPoint } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetNonceParameters = {\n client: Client;\n entryPoint: Address;\n contractAddress: Address;\n key: bigint;\n};\n\nexport const read = async ({\n client,\n entryPoint,\n contractAddress,\n key,\n}: ReadGetNonceParameters) =>\n await readContract(client, {\n address: entryPoint,\n abi: EntryPoint,\n functionName: 'getNonce',\n args: [contractAddress, key],\n });\n","import * as read from './read';\n\nexport { read };\n","import { read as getSpentAmount } from './methods/getSpentAmount';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { getTermsInfo, getSpentAmount };\n","import { ERC20TransferAmountEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetSpentAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n}: ReadGetSpentAmountParameters): Promise<bigint> => {\n const amount = await readContract(client, {\n address: contractAddress,\n abi: ERC20TransferAmountEnforcer,\n functionName: 'spentMap',\n args: [delegationManager, delegationHash],\n });\n\n return amount;\n};\n","import { ERC20TransferAmountEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport type TermsData = {\n allowedContract: Address;\n maxTokens: bigint;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<TermsData> => {\n const [allowedContract, maxTokens] = await readContract(client, {\n address: contractAddress,\n abi: ERC20TransferAmountEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return {\n allowedContract,\n maxTokens,\n };\n};\n","export * as read from './read';\nexport * as encode from './encode';\nexport * as simulate from './simulate';\nexport * as constants from './constants';\n","import { read as getKey } from './methods/getKey';\nimport { read as getKeyIdHashes } from './methods/getKeyIdHashes';\nimport { read as getKeyIdHashesCount } from './methods/getKeyIdHashesCount';\n\nexport { getKey, getKeyIdHashes, getKeyIdHashesCount };\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetKeyParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n keyId: string;\n};\n\nexport const read = async ({\n client,\n hybridDeleGatorAddress,\n keyId,\n}: ReadGetKeyParameters) =>\n await readContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'getKey',\n args: [keyId],\n });\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetKeyIdHashesParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n hybridDeleGatorAddress,\n}: ReadGetKeyIdHashesParameters) =>\n await readContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'getKeyIdHashes',\n });\n","import { HybridDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetKeyIdHashesCountParameters = {\n client: Client;\n hybridDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n hybridDeleGatorAddress,\n}: ReadGetKeyIdHashesCountParameters) =>\n await readContract(client, {\n address: hybridDeleGatorAddress,\n abi: HybridDeleGator,\n functionName: 'getKeyIdHashesCount',\n });\n","import { simulate as addKey } from './methods/addKey';\nimport { simulate as initializeHybridDeleGator } from './methods/initialize';\nimport { simulate as reinitializeHybridDeleGator } from './methods/reinitialize';\nimport { simulate as removeKey } from './methods/removeKey';\nimport { simulate as updateSigners } from './methods/updateSigners';\n\nexport {\n addKey,\n initializeHybridDeleGator,\n reinitializeHybridDeleGator,\n removeKey,\n updateSigners,\n};\n","export { ROOT_AUTHORITY, ANY_BENEFICIARY } from '../../delegation';\n\nexport const NAME = 'HybridDeleGator';\nexport const VERSION = '1.3.0';\nexport const DOMAIN_VERSION = '1';\n","import * as read from './read';\n\nexport { read };\n","import { read as getIsUsed } from './methods/getIsUsed';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { getTermsInfo, getIsUsed };\n","import { IdEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetIsUsedParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegator: Address;\n id: bigint;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegator,\n id,\n}: ReadGetIsUsedParameters): Promise<boolean> => {\n const isUsed = await readContract(client, {\n address: contractAddress,\n abi: IdEnforcer,\n functionName: 'getIsUsed',\n args: [delegationManager, delegator, id],\n });\n\n return isUsed;\n};\n","import { IdEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<bigint> => {\n const id = await readContract(client, {\n address: contractAddress,\n abi: IdEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return id;\n};\n","import * as read from './read';\n\nexport { read };\n","import { read as callCounts } from './methods/callCounts';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { callCounts, getTermsInfo };\n","import { LimitedCallsEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadCallCountsParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n}: ReadCallCountsParameters): Promise<bigint> => {\n const count = await readContract(client, {\n address: contractAddress,\n abi: LimitedCallsEnforcer,\n functionName: 'callCounts',\n args: [delegationManager, delegationHash],\n });\n\n return count;\n};\n","import { LimitedCallsEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<bigint> => {\n const limit = await readContract(client, {\n address: contractAddress,\n abi: LimitedCallsEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return limit;\n};\n","export * as read from './read';\nexport * as encode from './encode';\nexport * as simulate from './simulate';\nexport * as constants from './constants';\n","import { read as getMaxNumberOfSigners } from './methods/getMaxNumberOfSigners';\nimport { read as getSigners } from './methods/getSigners';\nimport { read as getSignersCount } from './methods/getSignersCount';\nimport { read as getThreshold } from './methods/getThreshold';\nimport { read as isSigner } from './methods/isSigner';\n\nexport {\n getSigners,\n getSignersCount,\n getThreshold,\n isSigner,\n getMaxNumberOfSigners,\n};\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetMaxNumberOfSignersParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n}: ReadGetMaxNumberOfSignersParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'MAX_NUMBER_OF_SIGNERS',\n });\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetSignersParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n}: ReadGetSignersParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'getSigners',\n });\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetSignersCountParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n}: ReadGetSignersCountParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'getSignersCount',\n });\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetThresholdParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n}: ReadGetThresholdParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'getThreshold',\n });\n","import { MultiSigDeleGator } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadIsSignerParameters = {\n client: Client;\n multiSigDeleGatorAddress: Address;\n signer: Address;\n};\n\nexport const read = async ({\n client,\n multiSigDeleGatorAddress,\n signer,\n}: ReadIsSignerParameters) =>\n await readContract(client, {\n address: multiSigDeleGatorAddress,\n abi: MultiSigDeleGator,\n functionName: 'isSigner',\n args: [signer],\n });\n","import { simulate as addSigner } from './methods/addSigner';\nimport { simulate as initializeMultiSigDeleGator } from './methods/initialize';\nimport { simulate as reinitializeMultiSigDeleGator } from './methods/reinitialize';\nimport { simulate as removeSigner } from './methods/removeSigner';\nimport { simulate as replaceSigner } from './methods/replaceSigner';\nimport { simulate as updateMultiSigParameters } from './methods/updateMultiSigParameters';\nimport { simulate as updateThreshold } from './methods/updateThreshold';\n\nexport {\n addSigner,\n initializeMultiSigDeleGator,\n reinitializeMultiSigDeleGator,\n removeSigner,\n replaceSigner,\n updateMultiSigParameters,\n updateThreshold,\n};\n","export const MAX_NUMBER_OF_SIGNERS = 30;\n","import * as read from './read';\n\nexport { read };\n","import { read as getSpentAmount } from './methods/getSpentAmount';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { getSpentAmount, getTermsInfo };\n","import { NativeTokenTransferAmountEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetSpentAmountParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n}: ReadGetSpentAmountParameters): Promise<bigint> => {\n const amount = await readContract(client, {\n address: contractAddress,\n abi: NativeTokenTransferAmountEnforcer,\n functionName: 'spentMap',\n args: [delegationManager, delegationHash],\n });\n\n return amount;\n};\n","import { NativeTokenTransferAmountEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<bigint> => {\n const allowance = await readContract(client, {\n address: contractAddress,\n abi: NativeTokenTransferAmountEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return allowance;\n};\n","import * as encode from './encode';\nimport * as execute from './execute';\nimport * as read from './read';\nimport * as simulate from './simulate';\n\nexport { encode, execute, read, simulate };\n","import { encode as incrementNonce } from './methods/incrementNonce';\n\nexport { incrementNonce };\n","import { NonceEnforcer } from '@metamask/delegation-abis';\nimport type { Account, Address, Chain, Client, Transport } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nexport type SimulateIncrementNonceParameters = {\n client: Client<Transport, Chain, Account>;\n contractAddress: Address;\n delegationManager: Address;\n};\n\nexport const encode = (delegationManager: Address) => {\n return encodeFunctionData({\n abi: NonceEnforcer,\n functionName: 'incrementNonce',\n args: [delegationManager],\n });\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n delegationManager,\n}: SimulateIncrementNonceParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: NonceEnforcer,\n functionName: 'incrementNonce',\n args: [delegationManager],\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n delegationManager,\n}: SimulateIncrementNonceParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n delegationManager,\n });\n return writeContract(client, request);\n};\n","import { execute as incrementNonce } from './methods/incrementNonce';\n\nexport { incrementNonce };\n","import { read as currentNonce } from './methods/currentNonce';\nimport { read as getTermsInfo } from './methods/getTermsInfo';\n\nexport { currentNonce, getTermsInfo };\n","import { NonceEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadCurrentNonceParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegator: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegator,\n}: ReadCurrentNonceParameters): Promise<bigint> => {\n const nonce = await readContract(client, {\n address: contractAddress,\n abi: NonceEnforcer,\n functionName: 'currentNonce',\n args: [delegationManager, delegator],\n });\n\n return nonce;\n};\n","import { NonceEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<bigint> => {\n const nonce = await readContract(client, {\n address: contractAddress,\n abi: NonceEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return nonce;\n};\n","import { simulate as incrementNonce } from './methods/incrementNonce';\n\nexport { incrementNonce };\n","export * as read from './read';\nexport * as execute from './execute';\nexport * as encode from './encode';\nexport * as simulate from './simulate';\n","import { read as getOwner } from './methods/getOwner';\nimport { read as getPendingOwner } from './methods/getPendingOwner';\n\nexport { getPendingOwner, getOwner };\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetOwnerParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetOwnerParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'owner',\n });\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetPendingOwnerParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadGetPendingOwnerParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'pendingOwner',\n });\n","import { execute as acceptOwnership } from './methods/acceptOwnership';\nimport { execute as renounceOwnership } from './methods/renounceOwnership';\nimport { execute as transferOwnership } from './methods/transferOwnership';\n\nexport { transferOwnership, renounceOwnership, acceptOwnership };\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateAcceptOwnershipParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport type ExecuteAcceptOwnershipParameters = {\n client: InitializedClient;\n contractAddress: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n}: SimulateAcceptOwnershipParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'acceptOwnership',\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n}: ExecuteAcceptOwnershipParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n });\n return writeContract(client, request);\n};\n\nexport const encode = () => {\n return encodeFunctionData({\n abi: Ownable2Step,\n functionName: 'acceptOwnership',\n });\n};\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateRenounceOwnershipParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport type ExecuteRenounceOwnershipParameters = {\n client: InitializedClient;\n contractAddress: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n}: SimulateRenounceOwnershipParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'renounceOwnership',\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n}: ExecuteRenounceOwnershipParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n });\n return writeContract(client, request);\n};\n\nexport const encode = () => {\n return encodeFunctionData({\n abi: Ownable2Step,\n functionName: 'renounceOwnership',\n });\n};\n","import { Ownable2Step } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nexport type SimulateTransferOwnershipParameters = {\n client: Client;\n contractAddress: Address;\n account: Address;\n};\n\nexport type ExecuteTransferOwnershipParameters = {\n client: InitializedClient;\n contractAddress: Address;\n account: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n account,\n}: SimulateTransferOwnershipParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: Ownable2Step,\n functionName: 'transferOwnership',\n args: [account],\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n account,\n}: ExecuteTransferOwnershipParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n account,\n });\n return writeContract(client, request);\n};\n\nexport const encode = (account: Address) => {\n return encodeFunctionData({\n abi: Ownable2Step,\n functionName: 'transferOwnership',\n args: [account],\n });\n};\n","import { encode as acceptOwnership } from './methods/acceptOwnership';\nimport { encode as renounceOwnership } from './methods/renounceOwnership';\nimport { encode as transferOwnership } from './methods/transferOwnership';\n\nexport { transferOwnership, renounceOwnership, acceptOwnership };\n","import { simulate as acceptOwnership } from './methods/acceptOwnership';\nimport { simulate as renounceOwnership } from './methods/renounceOwnership';\nimport { simulate as transferOwnership } from './methods/transferOwnership';\n\nexport { transferOwnership, renounceOwnership, acceptOwnership };\n","export * as read from './read';\nexport * as execute from './execute';\nexport * as encode from './encode';\nexport * as simulate from './simulate';\n","import { read as isPaused } from './methods/isPaused';\n\nexport { isPaused };\n","import { Pausable } from '@metamask/delegation-abis';\nimport type { Address, Client } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadIsPausedParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n}: ReadIsPausedParameters) =>\n await readContract(client, {\n address: contractAddress,\n abi: Pausable,\n functionName: 'paused',\n });\n","import { execute as pause } from './methods/pause';\nimport { execute as unpause } from './methods/unpause';\n\nexport { pause, unpause };\n","import type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nconst PauseAbi = [\n {\n type: 'function',\n name: 'pause',\n inputs: [],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n];\n\nexport type SimulatePauseParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport type ExecutePauseParameters = {\n client: InitializedClient;\n contractAddress: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n}: SimulatePauseParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: PauseAbi,\n functionName: 'pause',\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n}: ExecutePauseParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n });\n return writeContract(client, request);\n};\n\nexport const encode = () => {\n return encodeFunctionData({\n abi: PauseAbi,\n functionName: 'pause',\n });\n};\n","import type { Address, Client } from 'viem';\nimport { encodeFunctionData } from 'viem';\nimport { simulateContract, writeContract } from 'viem/actions';\n\nimport type { InitializedClient } from '../../types';\n\nconst UnpauseAbi = [\n {\n type: 'function',\n name: 'unpause',\n inputs: [],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n];\n\nexport type SimulateUnpauseParameters = {\n client: Client;\n contractAddress: Address;\n};\n\nexport type ExecuteUnpauseParameters = {\n client: InitializedClient;\n contractAddress: Address;\n};\n\nexport const simulate = async ({\n client,\n contractAddress,\n}: SimulateUnpauseParameters) => {\n return simulateContract(client, {\n address: contractAddress,\n abi: UnpauseAbi,\n functionName: 'unpause',\n });\n};\n\nexport const execute = async ({\n client,\n contractAddress,\n}: ExecuteUnpauseParameters) => {\n const { request } = await simulate({\n client,\n contractAddress,\n });\n return writeContract(client, request);\n};\n\nexport const encode = () => {\n return encodeFunctionData({\n abi: UnpauseAbi,\n functionName: 'unpause',\n });\n};\n","import { encode as pause } from './methods/pause';\nimport { encode as unpause } from './methods/unpause';\n\nexport { pause, unpause };\n","import { simulate as pause } from './methods/pause';\nimport { simulate as unpause } from './methods/unpause';\n\nexport { pause, unpause };\n","import * as encode from './encode';\nimport * as execute from './execute';\nimport * as read from './read';\nimport * as simulate from './simulate';\n\nexport { read, simulate, execute, encode };\n","import { execute as create2Deploy } from './methods/create2Deploy';\n\nexport { create2Deploy };\n","import { read as getCreate2Address } from './methods/getCreate2Address';\n\nexport { getCreate2Address };\n","import { SimpleFactory } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport const read = async (\n client: Client,\n factoryAddress: Address,\n creationCode: Hex,\n salt: Hex,\n) => {\n return readContract(client, {\n address: factoryAddress,\n abi: SimpleFactory,\n functionName: 'computeAddress',\n args: [creationCode, salt],\n });\n};\n","import { simulate as create2Deploy } from './methods/create2Deploy';\n\nexport { create2Deploy };\n","import * as read from './read';\n\nexport { read };\n","import { read as getTermsInfo } from './methods/getTermsInfo';\nimport { read as usedDelegations } from './methods/usedDelegations';\n\nexport { getTermsInfo, usedDelegations };\n","import { SpecificActionERC20TransferBatchEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadGetTermsInfoParameters = {\n client: Client;\n contractAddress: Address;\n terms: Hex;\n};\n\nexport type TermsData = {\n tokenAddress: Address;\n recipient: Address;\n amount: bigint;\n firstTarget: Address;\n firstCalldata: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n terms,\n}: ReadGetTermsInfoParameters): Promise<TermsData> => {\n const termsData = await readContract(client, {\n address: contractAddress,\n abi: SpecificActionERC20TransferBatchEnforcer,\n functionName: 'getTermsInfo',\n args: [terms],\n });\n\n return termsData as TermsData;\n};\n","import { SpecificActionERC20TransferBatchEnforcer } from '@metamask/delegation-abis';\nimport type { Address, Client, Hex } from 'viem';\nimport { readContract } from 'viem/actions';\n\nexport type ReadUsedDelegationsParameters = {\n client: Client;\n contractAddress: Address;\n delegationManager: Address;\n delegationHash: Hex;\n};\n\nexport const read = async ({\n client,\n contractAddress,\n delegationManager,\n delegationHash,\n}: ReadUsedDelegationsParameters): Promise<boolean> => {\n const isUsed = await readContract(client, {\n address: contractAddress,\n abi: SpecificActionERC20TransferBatchEnforcer,\n functionName: 'usedDelegations',\n args: [delegationManager, delegationHash],\n });\n\n return isUsed;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAM,OAAO;AACb,IAAM,UAAU;AAChB,IAAM,iBAAiB;;;ACJ9B,IAAAC,kBAAA;AAAA,SAAAA,iBAAA;AAAA;AAAA,0BAAAC;AAAA,EAAA,yBAAAA;AAAA;;;ACAA,SAAS,yBAAyB;AAElC,SAAS,0BAA0B;AACnC,SAAS,kBAAkB,qBAAqB;AAoBzC,IAAMC,aAAW,OAAO;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AACF,MAA2C;AACzC,QAAM,mBAAmB,mBAAmB,UAAU;AAEtD,SAAO,iBAAiB,QAAQ;AAAA,IAC9B,SAAS;AAAA,IACT,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,gBAAgB;AAAA,EACzB,CAAC;AACH;AAEO,IAAMC,WAAU,OAAO;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AACF,MAA0C;AACxC,QAAM,EAAE,QAAQ,IAAI,MAAMD,WAAS;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO,cAAc,QAAQ,OAAO;AACtC;AAEO,IAAM,SAAS,CAAC,EAAE,WAAW,MAAyC;AAC3E,QA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AA;;;ACAA,SAAS,gDAAgD;AAEzD,SAAS,gBAAAC,sBAAoB;AAgBtB,IAAMC,SAAO,OAAO;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,MAAsD;AACpD,QAAM,YAAY,MAAMD,eAAa,QAAQ;AAAA,IAC3C,SAAS;AAAA,IACT,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,KAAK;AAAA,EACd,CAAC;AAED,SAAO;AACT;;;AC/BA,SAAS,4CAAAE,iDAAgD;AAEzD,SAAS,gBAAAC,sBAAoB;AAStB,IAAMC,SAAO,OAAO;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuD;AACrD,QAAM,SAAS,MAAMD,eAAa,QAAQ;AAAA,IACxC,SAAS;AAAA,IACT,KAAKD;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,mBAAmB,cAAc;AAAA,EAC1C,CAAC;AAED,SAAO;AACT;","names":["encode_exports","read_exports","encode_exports","encode","simulate","execute","DelegationManager","encodeFunctionData","simulateContract","writeContract","simulate","simulateContract","DelegationManager","execute","writeContract","encode","encodeFunctionData","DelegationManager","encodeFunctionData","simulateContract","writeContract","simulate","simulateContract","DelegationManager","execute","writeContract","encode","encodeFunctionData","execute","read_exports","read","DelegationManager","DelegationManager","readContract","read","DelegationManager","readContract","read","simulate","encode_exports","execute_exports","simulate_exports","execute_exports","execute","simulate_exports","simulate","read_exports","read_exports","read","readContract","read","readContract","read","readContract","read","read_exports","read_exports","read","readContract","read","read_exports","read_exports","read","readContract","read","ERC20TransferAmountEnforcer","readContract","read","constants_exports","read_exports","simulate_exports","read_exports","read","readContract","read","HybridDeleGator","readContract","read","HybridDeleGator","readContract","read","simulate_exports","simulate","constants_exports","DOMAIN_VERSION","NAME","VERSION","NAME","VERSION","DOMAIN_VERSION","read_exports","read_exports","read","readContract","read","IdEnforcer","readContract","read","read_exports","read_exports","read","readContract","read","LimitedCallsEnforcer","readContract","read","constants_exports","encode_exports","read_exports","simulate_exports","read_exports","read","readContract","read","MultiSigDeleGator","readContract","read","MultiSigDeleGator","readContract","read","MultiSigDeleGator","readContract","read","MultiSigDeleGator","readContract","read","simulate_exports","simulate","constants_exports","read_exports","read_exports","read","readContract","read","NativeTokenTransferAmountEnforcer","readContract","read","encode_exports","execute_exports","read_exports","simulate_exports","encode_exports","encode","encodeFunctionData","simulateContract","writeContract","encode","simulate","execute","execute_exports","execute","read_exports","read","NonceEnforcer","readContract","read","NonceEnforcer","readContract","read","simulate_exports","simulate","encode_exports","execute_exports","read_exports","simulate_exports","read_exports","read","readContract","read","Ownable2Step","readContract","read","execute_exports","execute","Ownable2Step","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","Ownable2Step","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","Ownable2Step","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","encode_exports","encode","simulate_exports","simulate","encode_exports","execute_exports","read_exports","simulate_exports","read_exports","read","readContract","read","execute_exports","execute","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","encodeFunctionData","simulateContract","writeContract","simulate","execute","encode","encode_exports","encode","simulate_exports","simulate","encode_exports","execute_exports","read_exports","simulate_exports","execute_exports","read_exports","read","readContract","read","simulate_exports","simulate","read_exports","read_exports","read","readContract","read","SpecificActionERC20TransferBatchEnforcer","readContract","read"]}
|
|
@@ -5,29 +5,14 @@ import {
|
|
|
5
5
|
encode4,
|
|
6
6
|
encode5,
|
|
7
7
|
encodeProxyCreationCode
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WV2R7BXP.mjs";
|
|
9
9
|
import {
|
|
10
10
|
createExecution,
|
|
11
11
|
encodeExecutionCalldatas
|
|
12
12
|
} from "./chunk-TPBFVDVM.mjs";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Implementation2["MultiSig"] = "MultiSig";
|
|
17
|
-
Implementation2["Hybrid"] = "Hybrid";
|
|
18
|
-
Implementation2["Stateless7702"] = "Stateless7702";
|
|
19
|
-
return Implementation2;
|
|
20
|
-
})(Implementation || {});
|
|
21
|
-
var TransferWindow = /* @__PURE__ */ ((TransferWindow2) => {
|
|
22
|
-
TransferWindow2[TransferWindow2["Hourly"] = 3600] = "Hourly";
|
|
23
|
-
TransferWindow2[TransferWindow2["Daily"] = 86400] = "Daily";
|
|
24
|
-
TransferWindow2[TransferWindow2["Weekly"] = 604800] = "Weekly";
|
|
25
|
-
TransferWindow2[TransferWindow2["BiWeekly"] = 1209600] = "BiWeekly";
|
|
26
|
-
TransferWindow2[TransferWindow2["Monthly"] = 2592e3] = "Monthly";
|
|
27
|
-
TransferWindow2[TransferWindow2["Quarterly"] = 7776e3] = "Quarterly";
|
|
28
|
-
TransferWindow2[TransferWindow2["Yearly"] = 31536e3] = "Yearly";
|
|
29
|
-
return TransferWindow2;
|
|
30
|
-
})(TransferWindow || {});
|
|
13
|
+
import {
|
|
14
|
+
encodeDelegations
|
|
15
|
+
} from "./chunk-C5ZEEH2Z.mjs";
|
|
31
16
|
|
|
32
17
|
// src/counterfactualAccountData.ts
|
|
33
18
|
import { getContractAddress, pad } from "viem";
|
|
@@ -103,25 +88,26 @@ var getCounterfactualAccountData = async ({
|
|
|
103
88
|
import { DelegationManager } from "@metamask/delegation-abis";
|
|
104
89
|
import { encodeFunctionData } from "viem";
|
|
105
90
|
var isDelegatedCall = (call) => {
|
|
106
|
-
return "
|
|
91
|
+
return "permissionContext" in call && "delegationManager" in call;
|
|
107
92
|
};
|
|
108
93
|
var processDelegatedCall = (call) => {
|
|
109
94
|
const {
|
|
110
|
-
|
|
95
|
+
permissionContext,
|
|
111
96
|
delegationManager,
|
|
112
97
|
to: target,
|
|
113
98
|
value,
|
|
114
99
|
data: callData
|
|
115
100
|
} = call;
|
|
116
101
|
const callAsExecution = createExecution({ target, value, callData });
|
|
117
|
-
if (!
|
|
102
|
+
if (!permissionContext) {
|
|
118
103
|
return callAsExecution;
|
|
119
104
|
}
|
|
105
|
+
const encodedPermissionsContext = encodeDelegations(permissionContext);
|
|
120
106
|
const redeemCalldata = encodeFunctionData({
|
|
121
107
|
abi: DelegationManager,
|
|
122
108
|
functionName: "redeemDelegations",
|
|
123
109
|
args: [
|
|
124
|
-
[
|
|
110
|
+
[encodedPermissionsContext],
|
|
125
111
|
["0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */],
|
|
126
112
|
encodeExecutionCalldatas([[callAsExecution]])
|
|
127
113
|
]
|
|
@@ -161,6 +147,7 @@ var encodeCallsForCaller = async (caller, calls) => {
|
|
|
161
147
|
};
|
|
162
148
|
|
|
163
149
|
// src/webAuthn.ts
|
|
150
|
+
import { Signature } from "ox";
|
|
164
151
|
import {
|
|
165
152
|
parseAbiParameters,
|
|
166
153
|
encodeAbiParameters,
|
|
@@ -169,7 +156,6 @@ import {
|
|
|
169
156
|
concat,
|
|
170
157
|
hexToBytes
|
|
171
158
|
} from "viem";
|
|
172
|
-
import { parseSignature } from "webauthn-p256";
|
|
173
159
|
var FIELD_MODULUS = 115792089210356248762697446949407573529996955224135760342422259061068512044369n;
|
|
174
160
|
var MALLEABILITY_THRESHOLD = FIELD_MODULUS / 2n;
|
|
175
161
|
var SIGNATURE_ABI_PARAMS = parseAbiParameters(
|
|
@@ -203,19 +189,18 @@ var getResponseTypeLocation = (clientDataJson) => {
|
|
|
203
189
|
};
|
|
204
190
|
function encodeDeleGatorSignature(keyId, signature, clientDataJSON, authenticatorData) {
|
|
205
191
|
const keyIdHash = keccak256(encodePacked(["string"], [keyId]));
|
|
206
|
-
const
|
|
207
|
-
let
|
|
208
|
-
while (
|
|
209
|
-
|
|
192
|
+
const { r: rValue, s: sValue } = Signature.fromHex(signature);
|
|
193
|
+
let normalizedS = sValue;
|
|
194
|
+
while (normalizedS > MALLEABILITY_THRESHOLD) {
|
|
195
|
+
normalizedS = FIELD_MODULUS - normalizedS;
|
|
210
196
|
}
|
|
211
|
-
const { r } = parsedSignature;
|
|
212
197
|
const [clientDataComponent1, clientDataComponent2] = splitOnChallenge(clientDataJSON);
|
|
213
198
|
const { userVerified } = parseAuthenticatorFlags(authenticatorData);
|
|
214
199
|
const responseTypeLocation = getResponseTypeLocation(clientDataJSON);
|
|
215
200
|
const encodedSignature = encodeAbiParameters(SIGNATURE_ABI_PARAMS, [
|
|
216
201
|
keyIdHash,
|
|
217
|
-
|
|
218
|
-
|
|
202
|
+
rValue,
|
|
203
|
+
normalizedS,
|
|
219
204
|
authenticatorData,
|
|
220
205
|
userVerified,
|
|
221
206
|
clientDataComponent1,
|
|
@@ -263,8 +248,6 @@ var createDummyWebAuthnSignature = (keyId) => {
|
|
|
263
248
|
};
|
|
264
249
|
|
|
265
250
|
export {
|
|
266
|
-
Implementation,
|
|
267
|
-
TransferWindow,
|
|
268
251
|
getCounterfactualAccountData,
|
|
269
252
|
encodeCalls,
|
|
270
253
|
encodeCallsForCaller,
|
|
@@ -272,4 +255,4 @@ export {
|
|
|
272
255
|
encodeDeleGatorSignature,
|
|
273
256
|
createDummyWebAuthnSignature
|
|
274
257
|
};
|
|
275
|
-
//# sourceMappingURL=chunk-
|
|
258
|
+
//# sourceMappingURL=chunk-45GHWVQA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/counterfactualAccountData.ts","../src/encodeCalls.ts","../src/webAuthn.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;AACA,SAAS,oBAAoB,WAAW;AA6BjC,IAAM,+BAA+B,OAE1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMuD;AACrD,MAAI;AACJ,MAAI;AAEJ,UAAQ,gBAAgB;AAAA,IACtB,4BAA4B;AAC1B,YAAM,CAAC,OAAO,QAAQ,SAAS,OAAO,IACpC;AAEF,UAAI,CAAC,gBAAgB,qBAAqB;AACxC,cAAM,IAAI;AAAA,UACR;AA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|
|
8
|
+
var _chunk23YXLKTXcjs = require('./chunk-23YXLKTX.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkVLKX4BR6cjs = require('./chunk-VLKX4BR6.cjs');
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
Implementation2["MultiSig"] = "MultiSig";
|
|
17
|
-
Implementation2["Hybrid"] = "Hybrid";
|
|
18
|
-
Implementation2["Stateless7702"] = "Stateless7702";
|
|
19
|
-
return Implementation2;
|
|
20
|
-
})(Implementation || {});
|
|
21
|
-
var TransferWindow = /* @__PURE__ */ ((TransferWindow2) => {
|
|
22
|
-
TransferWindow2[TransferWindow2["Hourly"] = 3600] = "Hourly";
|
|
23
|
-
TransferWindow2[TransferWindow2["Daily"] = 86400] = "Daily";
|
|
24
|
-
TransferWindow2[TransferWindow2["Weekly"] = 604800] = "Weekly";
|
|
25
|
-
TransferWindow2[TransferWindow2["BiWeekly"] = 1209600] = "BiWeekly";
|
|
26
|
-
TransferWindow2[TransferWindow2["Monthly"] = 2592e3] = "Monthly";
|
|
27
|
-
TransferWindow2[TransferWindow2["Quarterly"] = 7776e3] = "Quarterly";
|
|
28
|
-
TransferWindow2[TransferWindow2["Yearly"] = 31536e3] = "Yearly";
|
|
29
|
-
return TransferWindow2;
|
|
30
|
-
})(TransferWindow || {});
|
|
14
|
+
|
|
15
|
+
var _chunkYDLLC6PPcjs = require('./chunk-YDLLC6PP.cjs');
|
|
31
16
|
|
|
32
17
|
// src/counterfactualAccountData.ts
|
|
33
18
|
var _viem = require('viem');
|
|
@@ -63,7 +48,7 @@ var getCounterfactualAccountData = async ({
|
|
|
63
48
|
y: yValue
|
|
64
49
|
};
|
|
65
50
|
});
|
|
66
|
-
initcode =
|
|
51
|
+
initcode = _chunk23YXLKTXcjs.encode.call(void 0, { eoaOwner: owner, p256Owners });
|
|
67
52
|
break;
|
|
68
53
|
}
|
|
69
54
|
case "MultiSig" /* MultiSig */: {
|
|
@@ -74,7 +59,7 @@ var getCounterfactualAccountData = async ({
|
|
|
74
59
|
);
|
|
75
60
|
}
|
|
76
61
|
implementationAddress = implementations.MultiSigDeleGatorImpl;
|
|
77
|
-
initcode =
|
|
62
|
+
initcode = _chunk23YXLKTXcjs.encode2.call(void 0, { owners, threshold });
|
|
78
63
|
break;
|
|
79
64
|
}
|
|
80
65
|
case "Stateless7702" /* Stateless7702 */:
|
|
@@ -82,7 +67,7 @@ var getCounterfactualAccountData = async ({
|
|
|
82
67
|
throw new Error(`Implementation type '${implementation}' not supported`);
|
|
83
68
|
}
|
|
84
69
|
const salt = _viem.pad.call(void 0, deploySalt, { dir: "left", size: 32 });
|
|
85
|
-
const proxyCreationCode =
|
|
70
|
+
const proxyCreationCode = _chunk23YXLKTXcjs.encodeProxyCreationCode.call(void 0, {
|
|
86
71
|
implementationAddress,
|
|
87
72
|
initcode
|
|
88
73
|
});
|
|
@@ -92,7 +77,7 @@ var getCounterfactualAccountData = async ({
|
|
|
92
77
|
opcode: "CREATE2",
|
|
93
78
|
salt
|
|
94
79
|
});
|
|
95
|
-
const factoryData =
|
|
80
|
+
const factoryData = _chunk23YXLKTXcjs.encode3.call(void 0, proxyCreationCode, salt);
|
|
96
81
|
return {
|
|
97
82
|
factoryData,
|
|
98
83
|
address
|
|
@@ -103,25 +88,26 @@ var getCounterfactualAccountData = async ({
|
|
|
103
88
|
var _delegationabis = require('@metamask/delegation-abis');
|
|
104
89
|
|
|
105
90
|
var isDelegatedCall = (call) => {
|
|
106
|
-
return "
|
|
91
|
+
return "permissionContext" in call && "delegationManager" in call;
|
|
107
92
|
};
|
|
108
93
|
var processDelegatedCall = (call) => {
|
|
109
94
|
const {
|
|
110
|
-
|
|
95
|
+
permissionContext,
|
|
111
96
|
delegationManager,
|
|
112
97
|
to: target,
|
|
113
98
|
value,
|
|
114
99
|
data: callData
|
|
115
100
|
} = call;
|
|
116
101
|
const callAsExecution = _chunkVLKX4BR6cjs.createExecution.call(void 0, { target, value, callData });
|
|
117
|
-
if (!
|
|
102
|
+
if (!permissionContext) {
|
|
118
103
|
return callAsExecution;
|
|
119
104
|
}
|
|
105
|
+
const encodedPermissionsContext = _chunkYDLLC6PPcjs.encodeDelegations.call(void 0, permissionContext);
|
|
120
106
|
const redeemCalldata = _viem.encodeFunctionData.call(void 0, {
|
|
121
107
|
abi: _delegationabis.DelegationManager,
|
|
122
108
|
functionName: "redeemDelegations",
|
|
123
109
|
args: [
|
|
124
|
-
[
|
|
110
|
+
[encodedPermissionsContext],
|
|
125
111
|
["0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */],
|
|
126
112
|
_chunkVLKX4BR6cjs.encodeExecutionCalldatas.call(void 0, [[callAsExecution]])
|
|
127
113
|
]
|
|
@@ -137,7 +123,7 @@ var encodeCalls = (calls) => {
|
|
|
137
123
|
if (call && !isDelegatedCall(call)) {
|
|
138
124
|
const { to: target, value, data: callData } = call;
|
|
139
125
|
const execution = _chunkVLKX4BR6cjs.createExecution.call(void 0, { target, value, callData });
|
|
140
|
-
return
|
|
126
|
+
return _chunk23YXLKTXcjs.encode4.call(void 0, { execution });
|
|
141
127
|
}
|
|
142
128
|
}
|
|
143
129
|
const executions = calls.map((call) => {
|
|
@@ -148,7 +134,7 @@ var encodeCalls = (calls) => {
|
|
|
148
134
|
return _chunkVLKX4BR6cjs.createExecution.call(void 0, { target, value, callData });
|
|
149
135
|
});
|
|
150
136
|
const mode = calls.length === 1 ? "0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */ : "0x0100000000000000000000000000000000000000000000000000000000000000" /* BatchDefault */;
|
|
151
|
-
return
|
|
137
|
+
return _chunk23YXLKTXcjs.encode5.call(void 0, { mode, executions });
|
|
152
138
|
};
|
|
153
139
|
var encodeCallsForCaller = async (caller, calls) => {
|
|
154
140
|
if (calls.length === 1) {
|
|
@@ -161,6 +147,7 @@ var encodeCallsForCaller = async (caller, calls) => {
|
|
|
161
147
|
};
|
|
162
148
|
|
|
163
149
|
// src/webAuthn.ts
|
|
150
|
+
var _ox = require('ox');
|
|
164
151
|
|
|
165
152
|
|
|
166
153
|
|
|
@@ -169,7 +156,6 @@ var encodeCallsForCaller = async (caller, calls) => {
|
|
|
169
156
|
|
|
170
157
|
|
|
171
158
|
|
|
172
|
-
var _webauthnp256 = require('webauthn-p256');
|
|
173
159
|
var FIELD_MODULUS = 115792089210356248762697446949407573529996955224135760342422259061068512044369n;
|
|
174
160
|
var MALLEABILITY_THRESHOLD = FIELD_MODULUS / 2n;
|
|
175
161
|
var SIGNATURE_ABI_PARAMS = _viem.parseAbiParameters.call(void 0,
|
|
@@ -203,19 +189,18 @@ var getResponseTypeLocation = (clientDataJson) => {
|
|
|
203
189
|
};
|
|
204
190
|
function encodeDeleGatorSignature(keyId, signature, clientDataJSON, authenticatorData) {
|
|
205
191
|
const keyIdHash = _viem.keccak256.call(void 0, _viem.encodePacked.call(void 0, ["string"], [keyId]));
|
|
206
|
-
const
|
|
207
|
-
let
|
|
208
|
-
while (
|
|
209
|
-
|
|
192
|
+
const { r: rValue, s: sValue } = _ox.Signature.fromHex(signature);
|
|
193
|
+
let normalizedS = sValue;
|
|
194
|
+
while (normalizedS > MALLEABILITY_THRESHOLD) {
|
|
195
|
+
normalizedS = FIELD_MODULUS - normalizedS;
|
|
210
196
|
}
|
|
211
|
-
const { r } = parsedSignature;
|
|
212
197
|
const [clientDataComponent1, clientDataComponent2] = splitOnChallenge(clientDataJSON);
|
|
213
198
|
const { userVerified } = parseAuthenticatorFlags(authenticatorData);
|
|
214
199
|
const responseTypeLocation = getResponseTypeLocation(clientDataJSON);
|
|
215
200
|
const encodedSignature = _viem.encodeAbiParameters.call(void 0, SIGNATURE_ABI_PARAMS, [
|
|
216
201
|
keyIdHash,
|
|
217
|
-
|
|
218
|
-
|
|
202
|
+
rValue,
|
|
203
|
+
normalizedS,
|
|
219
204
|
authenticatorData,
|
|
220
205
|
userVerified,
|
|
221
206
|
clientDataComponent1,
|
|
@@ -269,7 +254,5 @@ var createDummyWebAuthnSignature = (keyId) => {
|
|
|
269
254
|
|
|
270
255
|
|
|
271
256
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
exports.Implementation = Implementation; exports.TransferWindow = TransferWindow; exports.getCounterfactualAccountData = getCounterfactualAccountData; exports.encodeCalls = encodeCalls; exports.encodeCallsForCaller = encodeCallsForCaller; exports.SIGNATURE_ABI_PARAMS = SIGNATURE_ABI_PARAMS; exports.encodeDeleGatorSignature = encodeDeleGatorSignature; exports.createDummyWebAuthnSignature = createDummyWebAuthnSignature;
|
|
275
|
-
//# sourceMappingURL=chunk-OPJBYTWX.cjs.map
|
|
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
|
|
@@ -0,0 +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,EA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AACA,EAAA;AACE,IAAA;AAAqE,EAAA;AAKvE,EAAA;AAEA,EAAA;AAAO;AAAA,IAAA;AAE+B,EAAA;AAExC;AASO;AAEL,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AAEA,EAAA;AACA,EAAA;AAEA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AAEA,EAAA;AAAmE,IAAA;AACjE,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AAGF,EAAA;AACF;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"]}
|