@metamask/smart-accounts-kit 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -1
- package/README.md +34 -2
- 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/{smartAccountsEnvironment-Czw9KUYZ.d.cts → caveats-CQbtzOKm.d.ts} +9 -2
- package/dist/{smartAccountsEnvironment-u1CcFcGE.d.ts → caveats-Cey0wm33.d.cts} +9 -2
- package/dist/{chunk-UUOH2WAW.cjs → chunk-3SHZ7PV2.cjs} +12 -12
- package/dist/{chunk-UUOH2WAW.cjs.map → chunk-3SHZ7PV2.cjs.map} +1 -1
- package/dist/{chunk-TPBFVDVM.mjs → chunk-4QXIOE7F.mjs} +8 -6
- package/dist/chunk-4QXIOE7F.mjs.map +1 -0
- package/dist/{chunk-NOCLGZGB.mjs → chunk-734MOPHR.mjs} +63 -5
- package/dist/chunk-734MOPHR.mjs.map +1 -0
- package/dist/{chunk-YDLLC6PP.cjs → chunk-7BEEGBA2.cjs} +519 -16
- package/dist/chunk-7BEEGBA2.cjs.map +1 -0
- package/dist/{chunk-45GHWVQA.mjs → chunk-G7VZ7E6W.mjs} +4 -4
- package/dist/{chunk-XN36L4RX.cjs → chunk-HFRQNSZE.cjs} +106 -107
- package/dist/chunk-HFRQNSZE.cjs.map +1 -0
- package/dist/{chunk-33AMUJBJ.mjs → chunk-L5DLMBDC.mjs} +5 -6
- package/dist/{chunk-VLKX4BR6.cjs → chunk-MOHCTPYQ.cjs} +8 -6
- package/dist/chunk-MOHCTPYQ.cjs.map +1 -0
- package/dist/{chunk-QMRKCB7T.cjs → chunk-T4IAMAB2.cjs} +102 -44
- package/dist/chunk-T4IAMAB2.cjs.map +1 -0
- package/dist/{chunk-BYWRJGSK.cjs → chunk-UB2FLPP3.cjs} +16 -16
- package/dist/{chunk-BYWRJGSK.cjs.map → chunk-UB2FLPP3.cjs.map} +1 -1
- package/dist/{chunk-23YXLKTX.cjs → chunk-UZO5OYCD.cjs} +14 -14
- package/dist/{chunk-23YXLKTX.cjs.map → chunk-UZO5OYCD.cjs.map} +1 -1
- package/dist/{chunk-YTELOQ4I.mjs → chunk-VJXM3LWA.mjs} +2 -2
- package/dist/{chunk-WV2R7BXP.mjs → chunk-YTNCEXUX.mjs} +3 -3
- package/dist/{chunk-C5ZEEH2Z.mjs → chunk-ZA2XYCVX.mjs} +517 -14
- package/dist/chunk-ZA2XYCVX.mjs.map +1 -0
- package/dist/contracts/index.cjs +6 -6
- package/dist/contracts/index.d.cts +3 -3
- package/dist/contracts/index.d.ts +3 -3
- package/dist/contracts/index.mjs +5 -5
- package/dist/{delegation-DIriDFkq.d.cts → delegation-Bx4FEAIU.d.ts} +2 -2
- package/dist/{delegation-CvVXs0PO.d.ts → delegation-KbWHzRxV.d.cts} +2 -2
- package/dist/experimental/index.cjs +36 -4
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/index.d.cts +5 -2
- package/dist/experimental/index.d.ts +5 -2
- package/dist/experimental/index.mjs +35 -3
- package/dist/experimental/index.mjs.map +1 -1
- package/dist/{index-ChTryO1-.d.ts → index-D2THBlfm.d.ts} +3 -3
- package/dist/{index-5EdxVa_d.d.ts → index-D7fBuNV-.d.ts} +3 -3
- package/dist/{index-DC9baw8F.d.cts → index-DE87r5KY.d.cts} +3 -3
- package/dist/{index-Dvc4ir4O.d.cts → index-Uj_xXVko.d.cts} +3 -3
- package/dist/index.cjs +36 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -12
- package/dist/index.d.ts +10 -12
- package/dist/index.mjs +28 -18
- package/dist/index.mjs.map +1 -1
- package/dist/{types-qdEHxd5Q.d.ts → types-BWaH4KH1.d.cts} +3 -2
- package/dist/{types-qdEHxd5Q.d.cts → types-BWaH4KH1.d.ts} +3 -2
- package/dist/utils/index.cjs +7 -5
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +3 -3
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.mjs +6 -4
- package/package.json +5 -4
- package/dist/chunk-C5ZEEH2Z.mjs.map +0 -1
- package/dist/chunk-NOCLGZGB.mjs.map +0 -1
- package/dist/chunk-QMRKCB7T.cjs.map +0 -1
- package/dist/chunk-TPBFVDVM.mjs.map +0 -1
- package/dist/chunk-VLKX4BR6.cjs.map +0 -1
- package/dist/chunk-XN36L4RX.cjs.map +0 -1
- package/dist/chunk-YDLLC6PP.cjs.map +0 -1
- /package/dist/{chunk-45GHWVQA.mjs.map → chunk-G7VZ7E6W.mjs.map} +0 -0
- /package/dist/{chunk-33AMUJBJ.mjs.map → chunk-L5DLMBDC.mjs.map} +0 -0
- /package/dist/{chunk-YTELOQ4I.mjs.map → chunk-VJXM3LWA.mjs.map} +0 -0
- /package/dist/{chunk-WV2R7BXP.mjs.map → chunk-YTNCEXUX.mjs.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/actions/index.ts","../src/actions/erc7710RedeemDelegationAction.ts","../src/actions/erc7715Mapping.ts","../src/actions/erc7715GetGrantedExecutionPermissionsAction.ts","../src/actions/erc7715GetSupportedExecutionPermissionsAction.ts","../src/actions/erc7715RequestExecutionPermissionsAction.ts","../src/actions/getCaveatAvailableAmount.ts","../src/actions/isValid7702Implementation.ts","../src/actions/signDelegation.ts","../src/actions/signUserOperation.ts"],"sourcesContent":["import type { Client, WalletClient } from 'viem';\nimport type { BundlerClient } from 'viem/account-abstraction';\n\nimport type {\n SendTransactionWithDelegationParameters,\n SendUserOperationWithDelegationParameters,\n} from './erc7710RedeemDelegationAction';\nimport {\n sendTransactionWithDelegationAction,\n sendUserOperationWithDelegationAction,\n} from './erc7710RedeemDelegationAction';\nimport { erc7715GetGrantedExecutionPermissionsAction } from './erc7715GetGrantedExecutionPermissionsAction';\nimport { erc7715GetSupportedExecutionPermissionsAction } from './erc7715GetSupportedExecutionPermissionsAction';\nimport { erc7715RequestExecutionPermissionsAction } from './erc7715RequestExecutionPermissionsAction';\nimport type {\n MetaMaskExtensionClient,\n RequestExecutionPermissionsParameters,\n} from './erc7715RequestExecutionPermissionsAction';\n\nexport {\n // Individual action functions\n getErc20PeriodTransferEnforcerAvailableAmount,\n getErc20StreamingEnforcerAvailableAmount,\n getMultiTokenPeriodEnforcerAvailableAmount,\n getNativeTokenPeriodTransferEnforcerAvailableAmount,\n getNativeTokenStreamingEnforcerAvailableAmount,\n // Action builder\n caveatEnforcerActions,\n // Parameter types\n type CaveatEnforcerParams,\n // Result types\n type PeriodTransferResult,\n type StreamingResult,\n} from './getCaveatAvailableAmount';\n\nexport { isValid7702Implementation } from './isValid7702Implementation';\n\n// Signing actions\nexport {\n signDelegation,\n signDelegationActions,\n type SignDelegationParameters,\n type SignDelegationReturnType,\n} from './signDelegation';\n\nexport {\n signUserOperation,\n signUserOperationActions,\n type SignUserOperationParameters,\n type SignUserOperationReturnType,\n} from './signUserOperation';\n\nexport {\n erc7715RequestExecutionPermissionsAction as requestExecutionPermissions,\n type MetaMaskExtensionClient,\n type MetaMaskExtensionSchema,\n type RequestExecutionPermissionsParameters,\n type RequestExecutionPermissionsReturnType,\n} from './erc7715RequestExecutionPermissionsAction';\n\nexport type { PermissionRequestParameter } from './erc7715Types';\n\nexport { erc7715GetSupportedExecutionPermissionsAction as getSupportedExecutionPermissions } from './erc7715GetSupportedExecutionPermissionsAction';\n\nexport { erc7715GetGrantedExecutionPermissionsAction as getGrantedExecutionPermissions } from './erc7715GetGrantedExecutionPermissionsAction';\n\nexport {\n type GetSupportedExecutionPermissionsResult,\n type GetGrantedExecutionPermissionsResult,\n type SupportedPermissionInfo,\n type PermissionTypes,\n type NativeTokenStreamPermission,\n type NativeTokenPeriodicPermission,\n type Erc20TokenStreamPermission,\n type Erc20TokenPeriodicPermission,\n type Erc20TokenRevocationPermission,\n type RpcGetSupportedExecutionPermissionsResult,\n type RpcGetGrantedExecutionPermissionsResult,\n type RpcSupportedPermissionInfo,\n} from './erc7715Types';\n\nexport type { DelegatedCall } from './erc7710RedeemDelegationAction';\n\nexport const erc7715ProviderActions = () => (client: Client) => ({\n requestExecutionPermissions: async (\n parameters: RequestExecutionPermissionsParameters,\n ) => {\n return erc7715RequestExecutionPermissionsAction(\n client as MetaMaskExtensionClient,\n parameters,\n );\n },\n getSupportedExecutionPermissions: async () => {\n return erc7715GetSupportedExecutionPermissionsAction(\n client as MetaMaskExtensionClient,\n );\n },\n getGrantedExecutionPermissions: async () => {\n return erc7715GetGrantedExecutionPermissionsAction(\n client as MetaMaskExtensionClient,\n );\n },\n});\n\n/**\n * Type for a viem Client extended with ERC-7715 provider actions.\n * Use this to type variables that will be assigned an extended client later.\n *\n * @example\n * ```typescript\n * let client: Erc7715Client | null = null;\n *\n * function setupClient() {\n * client = createWalletClient({\n * chain: sepolia,\n * transport: custom(window.ethereum),\n * }).extend(erc7715ProviderActions());\n * }\n * ```\n */\nexport type Erc7715Client = Client &\n ReturnType<ReturnType<typeof erc7715ProviderActions>>;\n\nexport const erc7710WalletActions = () => (client: WalletClient) => ({\n sendTransactionWithDelegation: async (\n args: SendTransactionWithDelegationParameters,\n ) => sendTransactionWithDelegationAction(client, args),\n});\n\nexport const erc7710BundlerActions = () => (client: Client) => ({\n sendUserOperationWithDelegation: async (\n args: SendUserOperationWithDelegationParameters,\n ) => sendUserOperationWithDelegationAction(client as BundlerClient, args),\n});\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type {\n Account,\n Chain,\n Hex,\n OneOf,\n PublicClient,\n SendTransactionParameters,\n SendTransactionRequest,\n Transport,\n WalletClient,\n} from 'viem';\nimport { concat, encodeFunctionData, isAddressEqual } from 'viem';\nimport type {\n BundlerClient,\n SendUserOperationParameters,\n SmartAccount,\n} from 'viem/account-abstraction';\n\nimport { encodeDelegations } from '../delegation';\nimport {\n createExecution,\n encodeExecutionCalldatas,\n ExecutionMode,\n} from '../executions';\nimport { getSmartAccountsEnvironment } from '../smartAccountsEnvironment';\nimport type { Call, PermissionContext } from '../types';\n\nexport type DelegatedCall = Call &\n OneOf<\n { permissionContext: PermissionContext; delegationManager: Hex } | object\n >;\n\nexport type SendTransactionWithDelegationParameters<\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends Account | undefined = Account | undefined,\n TChainOverride extends Chain | undefined = Chain | undefined,\n TRequest extends SendTransactionRequest<TChain, TChainOverride> =\n SendTransactionRequest<TChain, TChainOverride>,\n> = SendTransactionParameters<TChain, TAccount, TChainOverride, TRequest> & {\n permissionContext: PermissionContext;\n delegationManager: Hex;\n};\n\n/**\n * Sends a transaction using delegation to execute operations on behalf of another account.\n *\n * @param client - The wallet client to use for sending the transaction.\n * @param args - Transaction parameters with delegation details.\n * @returns Transaction hash of the executed transaction.\n */\nexport async function sendTransactionWithDelegationAction<\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n>(\n client: WalletClient<Transport, TChain, TAccount>,\n args: SendTransactionWithDelegationParameters<TChain, TAccount>,\n) {\n if (!args.to) {\n throw new Error(\n '`to` is required. `sendTransactionWithDelegation` cannot be used to deploy contracts.',\n );\n }\n\n // Validate DelegationManager address\n const chainId = client.chain?.id;\n if (!chainId) {\n throw new Error('Chain ID is not set');\n }\n\n const { DelegationManager: expectedDelegationManager } =\n getSmartAccountsEnvironment(chainId);\n if (!isAddressEqual(args.delegationManager, expectedDelegationManager)) {\n throw new Error(\n `Invalid DelegationManager: expected ${expectedDelegationManager} for chain ${chainId}, but got ${args.delegationManager}`,\n );\n }\n\n const executions = [\n createExecution({\n target: args.to,\n value: args.value,\n callData: args.data,\n }),\n ];\n\n const calldata = encodeFunctionData({\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [\n [encodeDelegations(args.permissionContext)],\n [ExecutionMode.SingleDefault],\n encodeExecutionCalldatas([executions]),\n ],\n });\n\n const {\n value: _value,\n permissionContext: _permissionContext,\n delegationManager: _delegationManager,\n ...rest\n } = args;\n\n const hash = await client.sendTransaction({\n ...rest,\n to: args.delegationManager,\n data: calldata,\n } as unknown as SendTransactionParameters);\n\n return hash;\n}\n\nexport type SendUserOperationWithDelegationParameters<\n TAccount extends SmartAccount | undefined = SmartAccount | undefined,\n TAccountOverride extends SmartAccount | undefined = SmartAccount | undefined,\n> = SendUserOperationParameters<TAccount, TAccountOverride, DelegatedCall[]> & {\n dependencies?: { factory: Hex; factoryData: Hex }[];\n calls: DelegatedCall[];\n publicClient: PublicClient<Transport, Chain>;\n};\n\n/**\n * Broadcasts a User Operation with delegation to the Bundler.\n *\n * @param client - Client to use for sending the user operation.\n * @param parameters - Parameters for the user operation with delegation.\n * @returns The User Operation hash of the broadcasted operation.\n * @example\n * import { createBundlerClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const bundlerClient = createBundlerClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const userOpHash = await sendUserOperationWithDelegationAction(bundlerClient, {\n * account: bobSmartAccount,\n * calls: [\n * {\n * to: aliceCounterContractAddress,\n * data: encodeFunctionData({\n * abi: CounterMetadata.abi,\n * functionName: 'increment',\n * }),\n * value: 0n,\n * permissionContext: '0x...',\n * delegationManager: '0x...',\n * },\n * ],\n * dependencies: [{ factory: '0x...', factoryData: '0x...' }], // Optional: for deploying accounts\n * })\n */\nexport async function sendUserOperationWithDelegationAction<\n TAccount extends SmartAccount | undefined,\n TAccountOverride extends SmartAccount | undefined = undefined,\n>(\n client: BundlerClient<Transport, Chain | undefined, TAccount>,\n parameters: SendUserOperationWithDelegationParameters<\n TAccount,\n TAccountOverride\n >,\n) {\n if (parameters.dependencies) {\n const { publicClient } = parameters;\n\n const includedAccountKeys: Record<Hex, boolean> = {};\n\n const chainId = publicClient.chain?.id;\n\n if (!chainId) {\n throw new Error('Chain ID is not set');\n }\n\n const { SimpleFactory } = getSmartAccountsEnvironment(chainId);\n\n const uniqueDependencies = parameters.dependencies.filter((dependency) => {\n if (!isAddressEqual(dependency.factory, SimpleFactory)) {\n throw new Error(\n `Invalid dependency: ${dependency.factory} is not allowed.`,\n );\n }\n\n // ensure that factory calls are not duplicated\n const accountKey = concat([dependency.factory, dependency.factoryData]);\n const isDuplicate = includedAccountKeys[accountKey];\n\n includedAccountKeys[accountKey] = true;\n return !isDuplicate;\n });\n\n const factoryCalls = (\n await Promise.all(\n uniqueDependencies.map(async ({ factory, factoryData }) => {\n const isDeployed = await publicClient\n .call({\n to: factory,\n data: factoryData,\n })\n .then(() => false)\n .catch(() => true);\n\n if (isDeployed) {\n return undefined;\n }\n return {\n to: factory,\n value: 0n,\n data: factoryData,\n };\n }),\n )\n ).filter((call: Call | undefined) => call !== undefined) as Call[];\n\n parameters.calls = [\n ...(factoryCalls as DelegatedCall[]),\n ...parameters.calls,\n ];\n }\n\n parameters.calls = parameters.calls.map((call) => {\n if (!('permissionContext' in call)) {\n return call;\n }\n\n const { permissionContext } = call;\n if (!permissionContext) {\n return call;\n }\n\n return {\n ...call,\n permissionContext: encodeDelegations(permissionContext),\n };\n });\n\n return client.sendUserOperation(\n parameters as unknown as SendUserOperationParameters,\n );\n}\n","import type {\n Erc20TokenPeriodicPermission as RpcErc20TokenPeriodicPermission,\n Erc20TokenStreamPermission as RpcErc20TokenStreamPermission,\n Erc20TokenRevocationPermission as RpcErc20TokenRevocationPermission,\n NativeTokenPeriodicPermission as RpcNativeTokenPeriodicPermission,\n NativeTokenStreamPermission as RpcNativeTokenStreamPermission,\n PermissionRequest,\n PermissionTypes as RpcPermissionTypes,\n Rule,\n} from '@metamask/7715-permission-types';\nimport { hexToNumber, toHex } from 'viem';\n\nimport { isDefined, toHexOrThrow } from '../utils';\nimport type {\n Erc20TokenPeriodicPermission,\n Erc20TokenRevocationPermission,\n Erc20TokenStreamPermission,\n GetGrantedExecutionPermissionsResult,\n GetSupportedExecutionPermissionsResult,\n NativeTokenPeriodicPermission,\n NativeTokenStreamPermission,\n PermissionRequestParameter,\n PermissionTypes as DeveloperPermissionTypes,\n RpcGetGrantedExecutionPermissionsResult,\n RpcGetSupportedExecutionPermissionsResult,\n} from './erc7715Types';\n\n// =============================================================================\n// Developer → RPC (request formatting)\n// =============================================================================\n\n/**\n * Converts a developer permission request to RPC format for wallet submission.\n *\n * @param parameters the permission request parameters\n * @returns the permission request in RPC format\n */\nexport function permissionRequestToRpc(\n parameters: PermissionRequestParameter,\n): PermissionRequest<RpcPermissionTypes> {\n const { chainId, from, expiry } = parameters;\n\n const converter = getPermissionRequestToRpcConverter(\n parameters.permission.type,\n );\n\n const rules: Rule[] = isDefined(expiry)\n ? [\n {\n type: 'expiry',\n data: {\n timestamp: expiry,\n },\n },\n ]\n : [];\n\n const optionalFields = {\n ...(from ? { from } : {}),\n };\n\n return {\n ...optionalFields,\n chainId: toHex(chainId),\n permission: converter(parameters.permission),\n to: parameters.to,\n rules,\n };\n}\n\ntype PermissionRequestToRpcConverter = (\n permission: DeveloperPermissionTypes,\n) => RpcPermissionTypes;\n\n/**\n * Get the permission request to RPC converter for the given permission type.\n *\n * @param permissionType the permission type\n * @returns the permission request to RPC converter for the given permission type\n */\nfunction getPermissionRequestToRpcConverter(\n permissionType: string,\n): PermissionRequestToRpcConverter {\n switch (permissionType) {\n case 'native-token-stream':\n return (permission) =>\n nativeTokenStreamPermissionToRpc(\n permission as NativeTokenStreamPermission,\n );\n case 'erc20-token-stream':\n return (permission) =>\n erc20TokenStreamPermissionToRpc(\n permission as Erc20TokenStreamPermission,\n );\n case 'native-token-periodic':\n return (permission) =>\n nativeTokenPeriodicPermissionToRpc(\n permission as NativeTokenPeriodicPermission,\n );\n case 'erc20-token-periodic':\n return (permission) =>\n erc20TokenPeriodicPermissionToRpc(\n permission as Erc20TokenPeriodicPermission,\n );\n case 'erc20-token-revocation':\n return (permission) =>\n erc20TokenRevocationPermissionToRpc(\n permission as Erc20TokenRevocationPermission,\n );\n default:\n throw new Error(`Unsupported permission type: ${permissionType}`);\n }\n}\n\n/**\n * Convert native token stream permission to RPC format.\n *\n * @param permission the native token stream permission\n * @returns the native token stream permission in RPC format\n */\nfunction nativeTokenStreamPermissionToRpc(\n permission: NativeTokenStreamPermission,\n): RpcNativeTokenStreamPermission {\n const {\n data: {\n initialAmount,\n justification,\n maxAmount,\n startTime,\n amountPerSecond,\n },\n isAdjustmentAllowed,\n } = permission;\n\n const optionalFields = {\n ...(isDefined(initialAmount) && {\n initialAmount: toHexOrThrow(initialAmount, 'initialAmount'),\n }),\n ...(isDefined(maxAmount) && {\n maxAmount: toHexOrThrow(maxAmount, 'maxAmount'),\n }),\n ...(isDefined(startTime) && {\n startTime: Number(startTime),\n }),\n ...(justification ? { justification } : {}),\n };\n\n return {\n type: 'native-token-stream',\n data: {\n amountPerSecond: toHexOrThrow(amountPerSecond, 'amountPerSecond'),\n ...optionalFields,\n },\n isAdjustmentAllowed,\n };\n}\n\n/**\n * Convert ERC20 token stream permission to RPC format.\n *\n * @param permission the erc20 token stream permission\n * @returns the erc20 token stream permission in RPC format\n */\nfunction erc20TokenStreamPermissionToRpc(\n permission: Erc20TokenStreamPermission,\n): RpcErc20TokenStreamPermission {\n const {\n data: {\n tokenAddress,\n amountPerSecond,\n initialAmount,\n startTime,\n maxAmount,\n justification,\n },\n isAdjustmentAllowed,\n } = permission;\n\n const optionalFields = {\n ...(isDefined(initialAmount) && {\n initialAmount: toHexOrThrow(initialAmount, 'initialAmount'),\n }),\n ...(isDefined(maxAmount) && {\n maxAmount: toHexOrThrow(maxAmount, 'maxAmount'),\n }),\n ...(isDefined(startTime) && {\n startTime: Number(startTime),\n }),\n ...(justification ? { justification } : {}),\n };\n\n return {\n type: 'erc20-token-stream',\n data: {\n tokenAddress: toHexOrThrow(tokenAddress, 'tokenAddress'),\n amountPerSecond: toHexOrThrow(amountPerSecond, 'amountPerSecond'),\n ...optionalFields,\n },\n isAdjustmentAllowed,\n };\n}\n\n/**\n * Convert native token periodic permission to RPC format.\n *\n * @param permission the native token periodic permission\n * @returns the native token periodic permission in RPC format\n */\nfunction nativeTokenPeriodicPermissionToRpc(\n permission: NativeTokenPeriodicPermission,\n): RpcNativeTokenPeriodicPermission {\n const {\n data: { periodAmount, periodDuration, startTime, justification },\n isAdjustmentAllowed,\n } = permission;\n\n const optionalFields = {\n ...(isDefined(startTime) && {\n startTime: Number(startTime),\n }),\n ...(justification ? { justification } : {}),\n };\n\n return {\n type: 'native-token-periodic',\n data: {\n periodAmount: toHexOrThrow(periodAmount, 'periodAmount'),\n periodDuration: Number(periodDuration),\n ...optionalFields,\n },\n isAdjustmentAllowed,\n };\n}\n\n/**\n * Convert ERC20 token periodic permission to RPC format.\n *\n * @param permission the erc20 token periodic permission\n * @returns the erc20 token periodic permission in RPC format\n */\nfunction erc20TokenPeriodicPermissionToRpc(\n permission: Erc20TokenPeriodicPermission,\n): RpcErc20TokenPeriodicPermission {\n const {\n data: {\n tokenAddress,\n periodAmount,\n periodDuration,\n startTime,\n justification,\n },\n isAdjustmentAllowed,\n } = permission;\n\n const optionalFields = {\n ...(isDefined(startTime) && {\n startTime: Number(startTime),\n }),\n ...(justification ? { justification } : {}),\n };\n\n return {\n type: 'erc20-token-periodic',\n data: {\n tokenAddress: toHexOrThrow(tokenAddress, 'tokenAddress'),\n periodAmount: toHexOrThrow(periodAmount, 'periodAmount'),\n periodDuration: Number(periodDuration),\n ...optionalFields,\n },\n isAdjustmentAllowed,\n };\n}\n\n/**\n * Convert ERC20 token revocation permission to RPC format.\n *\n * @param permission the erc20 token revocation permission\n * @returns the erc20 token revocation permission in RPC format\n */\nfunction erc20TokenRevocationPermissionToRpc(\n permission: Erc20TokenRevocationPermission,\n): RpcErc20TokenRevocationPermission {\n const {\n data: { justification },\n isAdjustmentAllowed,\n } = permission;\n\n const data = {\n ...(justification ? { justification } : {}),\n };\n return {\n type: 'erc20-token-revocation',\n data,\n isAdjustmentAllowed,\n };\n}\n\n// =============================================================================\n// RPC → Developer friendly types (response conversion)\n// =============================================================================\n\n/**\n * Converts RPC permission responses to developer-friendly types.\n * Converts chainId from hex to number, and token amounts from hex to bigint.\n *\n * @param result the RPC permission responses\n * @returns the developer-friendly permission responses\n */\nexport function permissionResponsesFromRpc(\n result: RpcGetGrantedExecutionPermissionsResult,\n): GetGrantedExecutionPermissionsResult {\n return result.map((permission) => ({\n ...permission,\n chainId: hexToNumber(permission.chainId),\n permission: permissionTypeFromRpc(permission.permission),\n }));\n}\n\n/**\n * Converts RPC permission type data to developer-friendly types.\n * Converts hex amount fields to bigint.\n *\n * @param permission the RPC permission\n * @returns the developer-friendly permission\n */\nexport function permissionTypeFromRpc(\n permission: RpcPermissionTypes,\n): DeveloperPermissionTypes {\n const convertedData: Record<string, unknown> = { ...permission.data };\n\n if ('amountPerSecond' in convertedData && convertedData.amountPerSecond) {\n convertedData.amountPerSecond = BigInt(\n convertedData.amountPerSecond as `0x${string}`,\n );\n }\n\n if ('periodAmount' in convertedData && convertedData.periodAmount) {\n convertedData.periodAmount = BigInt(\n convertedData.periodAmount as `0x${string}`,\n );\n }\n\n if ('initialAmount' in convertedData && convertedData.initialAmount) {\n convertedData.initialAmount = BigInt(\n convertedData.initialAmount as `0x${string}`,\n );\n }\n\n if ('maxAmount' in convertedData && convertedData.maxAmount) {\n convertedData.maxAmount = BigInt(convertedData.maxAmount as `0x${string}`);\n }\n\n return {\n ...permission,\n data: convertedData,\n } as DeveloperPermissionTypes;\n}\n\n/**\n * Converts RPC supported permissions result to developer-friendly types.\n * Converts chain IDs from hex to numbers.\n *\n * @param result the RPC supported permissions result\n * @returns the developer-friendly supported permissions result\n */\nexport function rpcSupportedPermissionsToDeveloper(\n result: RpcGetSupportedExecutionPermissionsResult,\n): GetSupportedExecutionPermissionsResult {\n const converted: GetSupportedExecutionPermissionsResult = {};\n\n for (const [permissionType, permissionInfo] of Object.entries(result)) {\n converted[permissionType] = {\n chainIds: permissionInfo.chainIds.map((chainId) => hexToNumber(chainId)),\n ruleTypes: permissionInfo.ruleTypes,\n };\n }\n\n return converted;\n}\n","import { permissionResponsesFromRpc } from './erc7715Mapping';\nimport type {\n GetGrantedExecutionPermissionsResult,\n MetaMaskExtensionClient,\n} from './erc7715Types';\n\nexport type { GetGrantedExecutionPermissionsResult } from './erc7715Types';\n\n/**\n * Retrieves all previously granted execution permissions from the wallet according to EIP-7715 specification.\n *\n * @param client - The client to use for the request.\n * @returns A promise that resolves to an array of granted permission responses.\n * @description\n * This function queries the wallet for all granted permissions that are not yet revoked.\n * Each permission response includes the chain ID, address, signer, permission details,\n * context, and dependency information.\n * @example\n * ```typescript\n * const grantedPermissions = await erc7715GetGrantedExecutionPermissionsAction(client);\n * // Returns an array of PermissionResponse objects with user-friendly types\n * ```\n */\nexport async function erc7715GetGrantedExecutionPermissionsAction(\n client: MetaMaskExtensionClient,\n): Promise<GetGrantedExecutionPermissionsResult> {\n const result = await client.request(\n {\n method: 'wallet_getGrantedExecutionPermissions',\n params: [],\n },\n { retryCount: 0 },\n );\n\n if (!result) {\n throw new Error('Failed to get granted execution permissions');\n }\n\n return permissionResponsesFromRpc(result);\n}\n","import { rpcSupportedPermissionsToDeveloper } from './erc7715Mapping';\nimport type {\n GetSupportedExecutionPermissionsResult,\n MetaMaskExtensionClient,\n} from './erc7715Types';\n\nexport type { GetSupportedExecutionPermissionsResult } from './erc7715Types';\n\n/**\n * Retrieves the supported execution permission types from the wallet according to EIP-7715 specification.\n *\n * @param client - The client to use for the request.\n * @returns A promise that resolves to a record of supported permission types with their chain IDs and rule types.\n * @description\n * This function queries the wallet for the permission types it supports.\n * The result is keyed by permission type and includes the supported chain IDs and rule types.\n * @example\n * ```typescript\n * const supported = await erc7715GetSupportedExecutionPermissionsAction(client);\n * // Returns:\n * // {\n * // \"native-token-allowance\": {\n * // \"chainIds\": [1, 137],\n * // \"ruleTypes\": [\"expiry\"]\n * // },\n * // \"erc20-token-allowance\": {\n * // \"chainIds\": [1],\n * // \"ruleTypes\": []\n * // }\n * // }\n * ```\n */\nexport async function erc7715GetSupportedExecutionPermissionsAction(\n client: MetaMaskExtensionClient,\n): Promise<GetSupportedExecutionPermissionsResult> {\n const result = await client.request(\n {\n method: 'wallet_getSupportedExecutionPermissions',\n params: [],\n },\n { retryCount: 0 },\n );\n\n if (!result) {\n throw new Error('Failed to get supported execution permissions');\n }\n\n return rpcSupportedPermissionsToDeveloper(result);\n}\n","import {\n permissionRequestToRpc,\n permissionResponsesFromRpc,\n} from './erc7715Mapping';\nimport type {\n GetGrantedExecutionPermissionsResult,\n MetaMaskExtensionClient,\n PermissionRequestParameter,\n} from './erc7715Types';\n\nexport type {\n GetGrantedExecutionPermissionsResult,\n GetSupportedExecutionPermissionsResult,\n MetaMaskExtensionClient,\n MetaMaskExtensionSchema,\n SupportedPermissionInfo,\n PermissionTypes,\n PermissionRequestParameter,\n} from './erc7715Types';\n\n/**\n * Parameters for the RequestExecutionPermissions action.\n *\n * @template Signer - The type of the signer, either an Address or Account.\n */\nexport type RequestExecutionPermissionsParameters =\n PermissionRequestParameter[];\n\n/**\n * Return type for the request execution permissions action.\n */\nexport type RequestExecutionPermissionsReturnType =\n GetGrantedExecutionPermissionsResult;\n\n/**\n * Grants permissions according to EIP-7715 specification.\n *\n * @template Signer - The type of the signer, either an Address or Account.\n * @param client - The client to use for the request.\n * @param parameters - The permissions requests to grant.\n * @returns A promise that resolves to the permission responses.\n * @description\n * This function formats the permissions requests and invokes the wallet method to grant permissions.\n * It will throw an error if the permissions could not be granted.\n */\nexport async function erc7715RequestExecutionPermissionsAction(\n client: MetaMaskExtensionClient,\n parameters: RequestExecutionPermissionsParameters,\n): Promise<RequestExecutionPermissionsReturnType> {\n const formattedPermissionRequest = parameters.map(permissionRequestToRpc);\n\n const result = await client.request(\n {\n method: 'wallet_requestExecutionPermissions',\n params: formattedPermissionRequest,\n },\n { retryCount: 0 },\n );\n\n if (!result) {\n throw new Error('Failed to grant permissions');\n }\n\n return permissionResponsesFromRpc(result);\n}\n","import type { Address, Hex, Client } from 'viem';\n\nimport { hashDelegation } from '../delegation';\nimport * as ERC20PeriodTransferEnforcer from '../DelegationFramework/ERC20PeriodTransferEnforcer';\nimport * as ERC20StreamingEnforcer from '../DelegationFramework/ERC20StreamingEnforcer';\nimport * as MultiTokenPeriodEnforcer from '../DelegationFramework/MultiTokenPeriodEnforcer';\nimport * as NativeTokenPeriodTransferEnforcer from '../DelegationFramework/NativeTokenPeriodTransferEnforcer';\nimport * as NativeTokenStreamingEnforcer from '../DelegationFramework/NativeTokenStreamingEnforcer';\nimport type { SmartAccountsEnvironment, Delegation } from '../types';\n\n/**\n * Parameters for all caveat enforcer actions.\n */\nexport type CaveatEnforcerParams = {\n delegation: Delegation;\n};\n\n/**\n * Return type for period-based transfer enforcers\n */\nexport type PeriodTransferResult = {\n availableAmount: bigint;\n isNewPeriod: boolean;\n currentPeriod: bigint;\n};\n\n/**\n * Return type for streaming enforcers\n */\nexport type StreamingResult = {\n availableAmount: bigint;\n};\n\n/**\n * Finds a caveat that matches the specified enforcer address.\n *\n * @param config - The configuration object.\n * @param config.delegation - The delegation to search.\n * @param config.enforcerAddress - The enforcer address to match.\n * @param config.enforcerName - The name of the enforcer.\n * @returns The matching caveat.\n * @throws Error if no matching caveat is found.\n * @throws Error if multiple matching caveats are found.\n */\nfunction findMatchingCaveat({\n delegation,\n enforcerAddress,\n enforcerName,\n}: {\n delegation: Delegation;\n enforcerAddress: Address;\n enforcerName: keyof SmartAccountsEnvironment['caveatEnforcers'];\n}): { terms: Hex; args: Hex } {\n const matchingCaveats = delegation.caveats.filter(\n (caveat) => caveat.enforcer.toLowerCase() === enforcerAddress.toLowerCase(),\n );\n\n if (matchingCaveats.length === 0) {\n throw new Error(`No caveat found with enforcer matching ${enforcerName}`);\n }\n\n if (matchingCaveats.length > 1) {\n throw new Error(\n `Multiple caveats found with enforcer matching ${enforcerName}`,\n );\n }\n\n const [{ terms, args }] = matchingCaveats as unknown as [\n { terms: Hex; args: Hex },\n ];\n\n return {\n terms,\n args,\n };\n}\n\n/**\n * Gets the delegation manager address from environment.\n *\n * @param environment - The SmartAccountsEnvironment.\n * @returns The delegation manager address.\n */\nfunction getDelegationManager(environment: SmartAccountsEnvironment): Address {\n if (!environment.DelegationManager) {\n throw new Error('Delegation manager address not found');\n }\n\n return environment.DelegationManager;\n}\n\n/**\n * Gets the enforcer address from environment.\n *\n * @param config - The configuration object.\n * @param config.enforcerName - The name of the enforcer.\n * @param config.environment - The SmartAccountsEnvironment.\n * @returns The enforcer address.\n */\nfunction getEnforcerAddress({\n enforcerName,\n environment,\n}: {\n enforcerName: keyof SmartAccountsEnvironment['caveatEnforcers'];\n environment: SmartAccountsEnvironment;\n}): Address {\n const enforcerAddress = environment.caveatEnforcers[enforcerName];\n if (!enforcerAddress) {\n throw new Error(`${enforcerName} not found in environment`);\n }\n\n return enforcerAddress;\n}\n\n/**\n * Get available amount for ERC20 period transfer enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the ERC20 period transfer enforcer.\n * @returns Promise resolving to the period transfer result.\n */\nexport async function getErc20PeriodTransferEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<PeriodTransferResult> {\n const enforcerName = 'ERC20PeriodTransferEnforcer';\n\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return ERC20PeriodTransferEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationHash,\n delegationManager,\n terms,\n });\n}\n\n/**\n * Get available amount for ERC20 streaming enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the ERC20 streaming enforcer.\n * @returns Promise resolving to the streaming result.\n */\nexport async function getErc20StreamingEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<StreamingResult> {\n const enforcerName = 'ERC20StreamingEnforcer';\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return ERC20StreamingEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationManager,\n delegationHash,\n terms,\n });\n}\n\n/**\n * Get available amount for multi-token period enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the multi-token period enforcer.\n * @returns Promise resolving to the period transfer result.\n */\nexport async function getMultiTokenPeriodEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<PeriodTransferResult> {\n const enforcerName = 'MultiTokenPeriodEnforcer';\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms, args } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return MultiTokenPeriodEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationHash,\n delegationManager,\n terms,\n args,\n });\n}\n\n/**\n * Get available amount for native token period transfer enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the native token period transfer enforcer.\n * @returns Promise resolving to the period transfer result.\n */\nexport async function getNativeTokenPeriodTransferEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<PeriodTransferResult> {\n const enforcerName = 'NativeTokenPeriodTransferEnforcer';\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return NativeTokenPeriodTransferEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationHash,\n delegationManager,\n terms,\n });\n}\n\n/**\n * Get available amount for native token streaming enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the native token streaming enforcer.\n * @returns Promise resolving to the streaming result.\n */\nexport async function getNativeTokenStreamingEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<StreamingResult> {\n const enforcerName = 'NativeTokenStreamingEnforcer';\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return NativeTokenStreamingEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationManager,\n delegationHash,\n terms,\n });\n}\n\n/**\n * Caveat enforcer actions for extending viem clients.\n *\n * @param params - The parameters object.\n * @param params.environment - The SmartAccountsEnvironment.\n * @returns A function that takes a client and returns the client extension with caveat enforcer actions.\n */\nexport const caveatEnforcerActions =\n ({ environment }: { environment: SmartAccountsEnvironment }) =>\n (client: Client) => ({\n /**\n * Get available amount for ERC20 period transfer enforcer.\n *\n * @param params - The parameters for the ERC20 period transfer enforcer.\n * @returns Promise resolving to the period transfer result.\n */\n getErc20PeriodTransferEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<PeriodTransferResult> => {\n return getErc20PeriodTransferEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n\n /**\n * Get available amount for ERC20 streaming enforcer.\n *\n * @param params - The parameters for the ERC20 streaming enforcer.\n * @returns Promise resolving to the streaming result.\n */\n getErc20StreamingEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<StreamingResult> => {\n return getErc20StreamingEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n\n /**\n * Get available amount for multi-token period enforcer.\n *\n * @param params - The parameters for the multi-token period enforcer.\n * @returns Promise resolving to the period transfer result.\n */\n getMultiTokenPeriodEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<PeriodTransferResult> => {\n return getMultiTokenPeriodEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n\n /**\n * Get available amount for native token period transfer enforcer.\n *\n * @param params - The parameters for the native token period transfer enforcer.\n * @returns Promise resolving to the period transfer result.\n */\n getNativeTokenPeriodTransferEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<PeriodTransferResult> => {\n return getNativeTokenPeriodTransferEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n\n /**\n * Get available amount for native token streaming enforcer.\n *\n * @param params - The parameters for the native token streaming enforcer.\n * @returns Promise resolving to the streaming result.\n */\n getNativeTokenStreamingEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<StreamingResult> => {\n return getNativeTokenStreamingEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n });\n","import type { Client, Address, Hex } from 'viem';\nimport { isAddressEqual } from 'viem';\nimport { getCode } from 'viem/actions';\n\nimport type { SmartAccountsEnvironment } from '../types';\n\n// EIP-7702 delegation prefix (0xef0100)\nconst DELEGATION_PREFIX = '0xef0100' as const;\n\n/**\n * Parameters for checking if an account is delegated to the EIP-7702 implementation.\n */\nexport type IsValid7702ImplementationParameters = {\n /** The client to use for the query. */\n client: Client;\n /** The address to check for proper delegation. */\n accountAddress: Address;\n /** The SmartAccountsEnvironment containing contract addresses. */\n environment: SmartAccountsEnvironment;\n};\n\n/**\n * Extracts the delegated contract address from EIP-7702 delegation code.\n *\n * @param code - The code returned from getCode for a delegated account.\n * @returns The delegated contract address or null if not a valid delegation.\n */\nfunction extractDelegatedAddress(code: Hex | undefined): Address | null {\n if (code?.length !== 48) {\n // 0x (2 chars) + ef0100 (6 chars) + address (40 chars) = 48 chars\n return null;\n }\n\n if (!code.toLowerCase().startsWith(DELEGATION_PREFIX.toLowerCase())) {\n return null;\n }\n\n // Extract the 20-byte address after the delegation prefix\n const addressHex = code.slice(8); // Remove '0xef0100' prefix (8 chars)\n return `0x${addressHex}`;\n}\n\n/**\n * Checks if an account is properly delegated to the EIP-7702 implementation.\n *\n * This function validates EIP-7702 delegations by checking if the EOA has a 7702\n * contract assigned to it and comparing the delegated address against the 7702\n * implementation found in the environment.\n *\n * @param params - The parameters for checking the delegation.\n * @param params.client - The client to use for the query.\n * @param params.accountAddress - The address to check for proper delegation.\n * @param params.environment - The SmartAccountsEnvironment containing contract addresses.\n * @returns A promise that resolves to true if the account is properly delegated to the 7702 implementation, false otherwise.\n * @example\n * ```typescript\n * const isValid = await isValid7702Implementation({\n * client: publicClient,\n * accountAddress: '0x...',\n * environment: smartAccountEnvironment,\n * });\n *\n * if (isValid) {\n * console.log('Account is properly delegated to EIP-7702 implementation');\n * } else {\n * console.log('Account is not properly delegated');\n * }\n * ```\n */\nexport async function isValid7702Implementation({\n client,\n accountAddress,\n environment,\n}: IsValid7702ImplementationParameters): Promise<boolean> {\n try {\n // Get the code at the account address\n const code = await getCode(client, {\n address: accountAddress,\n });\n\n // Extract the delegated contract address from the EIP-7702 delegation code\n const delegatedAddress = extractDelegatedAddress(code);\n\n // If no valid delegation found, return false\n if (!delegatedAddress) {\n return false;\n }\n\n // Compare the delegated address with the 7702 implementation in the environment\n const expectedImplementation =\n environment.implementations.EIP7702StatelessDeleGatorImpl;\n if (!expectedImplementation) {\n return false;\n }\n\n return isAddressEqual(delegatedAddress, expectedImplementation);\n } catch {\n // If the call fails (e.g., no code at address, network error),\n // then it's not properly delegated to our implementation\n return false;\n }\n}\n","import type {\n Account,\n Address,\n Chain,\n Client,\n Hex,\n Transport,\n WalletClient,\n} from 'viem';\nimport { BaseError } from 'viem';\nimport { parseAccount } from 'viem/accounts';\n\nimport { prepareSignDelegationTypedData } from '../delegation';\nimport type { Delegation } from '../types';\n\nexport type SignDelegationParameters = {\n /** Account to sign with */\n account?: Account | Address;\n /** The delegation to sign */\n delegation: Omit<Delegation, 'signature'>;\n /** The address of the delegation manager contract */\n delegationManager: Address;\n /** The chain ID for the signature */\n chainId: number;\n /** The name of the contract */\n name?: string;\n /** The version of the contract */\n version?: string;\n /** Whether to allow insecure unrestricted delegation */\n allowInsecureUnrestrictedDelegation?: boolean;\n};\n\nexport type SignDelegationReturnType = Hex;\n\n/**\n * Signs a delegation using a wallet client.\n *\n * @param client - The wallet client to use for signing.\n * @param parameters - The parameters for signing the delegation.\n * @returns The signature of the delegation.\n * @example\n * ```ts\n * const signature = await signDelegation(walletClient, {\n * delegation: {\n * delegate: '0x...',\n * delegator: '0x...',\n * authority: '0x...',\n * caveats: [],\n * salt: '0x'\n * },\n * delegationManager: '0x...',\n * chainId: 1\n * });\n * ```\n */\nexport async function signDelegation<\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n>(\n client: Client<Transport, TChain, TAccount> & {\n signTypedData: WalletClient['signTypedData'];\n },\n parameters: SignDelegationParameters,\n): Promise<SignDelegationReturnType> {\n const {\n account: accountParam = client.account,\n delegation,\n delegationManager,\n chainId,\n name = 'DelegationManager',\n version = '1',\n allowInsecureUnrestrictedDelegation = false,\n } = parameters;\n\n if (!accountParam) {\n throw new BaseError('Account not found. Please provide an account.');\n }\n\n const account = parseAccount(accountParam);\n\n const typedData = prepareSignDelegationTypedData({\n delegation,\n delegationManager,\n chainId,\n name,\n version,\n allowInsecureUnrestrictedDelegation,\n });\n\n return client.signTypedData({\n account,\n ...typedData,\n });\n}\n\n/**\n * Creates a sign delegation action that can be used to extend a wallet client.\n *\n * @returns A function that can be used with wallet client extend method.\n * @example\n * ```ts\n * const walletClient = createWalletClient({\n * chain: mainnet,\n * transport: http()\n * }).extend(signDelegationActions());\n * ```\n */\nexport function signDelegationActions() {\n return <\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n >(\n client: Client<Transport, TChain, TAccount> & {\n signTypedData: WalletClient['signTypedData'];\n },\n ) => ({\n signDelegation: async (\n parameters: Omit<SignDelegationParameters, 'chainId'> & {\n chainId?: number;\n },\n ) =>\n signDelegation(client, {\n chainId:\n parameters.chainId ??\n (() => {\n if (!client.chain?.id) {\n throw new BaseError(\n 'Chain ID is required. Either provide it in parameters or configure the client with a chain.',\n );\n }\n return client.chain.id;\n })(),\n ...parameters,\n }),\n });\n}\n","import type {\n Account,\n Address,\n Chain,\n Client,\n Hex,\n Transport,\n WalletClient,\n} from 'viem';\nimport { BaseError } from 'viem';\nimport { parseAccount } from 'viem/accounts';\n\nimport { prepareSignUserOperationTypedData } from '../userOp';\nimport type { UserOperationV07 } from '../userOp';\n\nexport type SignUserOperationParameters = {\n /** Account to sign with */\n account?: Account | Address;\n /** The user operation to sign */\n userOperation: Omit<UserOperationV07, 'signature'>;\n /** The entry point contract address */\n entryPoint: { address: Address };\n /** The chain ID that the entry point is deployed on */\n chainId: number;\n /** The address of the smart account */\n address: Address;\n /** The name of the domain of the implementation contract */\n name: 'HybridDeleGator' | 'MultiSigDeleGator';\n /** The version of the domain of the implementation contract */\n version?: string;\n};\n\nexport type SignUserOperationReturnType = Hex;\n\n/**\n * Signs a user operation using a wallet client.\n *\n * @param client - The wallet client to use for signing.\n * @param parameters - The parameters for signing the user operation.\n * @returns The signature of the user operation.\n * @example\n * ```ts\n * const signature = await signUserOperation(walletClient, {\n * userOperation: {\n * sender: '0x...',\n * nonce: 0n,\n * callData: '0x',\n * callGasLimit: 1000000n,\n * verificationGasLimit: 1000000n,\n * preVerificationGas: 21000n,\n * maxFeePerGas: 1000000000n,\n * maxPriorityFeePerGas: 1000000000n\n * },\n * entryPoint: { address: '0x...' },\n * chainId: 1,\n * address: '0x...',\n * name: 'HybridDeleGator'\n * });\n * ```\n */\nexport async function signUserOperation<\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n>(\n client: Client<Transport, TChain, TAccount> & {\n signTypedData: WalletClient['signTypedData'];\n },\n parameters: SignUserOperationParameters,\n): Promise<SignUserOperationReturnType> {\n const {\n account: accountParam = client.account,\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version = '1',\n } = parameters;\n\n if (!accountParam) {\n throw new BaseError('Account not found. Please provide an account.');\n }\n\n const account = parseAccount(accountParam);\n\n const typedData = prepareSignUserOperationTypedData({\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version,\n });\n\n return client.signTypedData({\n account,\n ...typedData,\n });\n}\n\n/**\n * Creates a sign user operation action that can be used to extend a wallet client.\n *\n * @returns A function that can be used with wallet client extend method.\n * @example\n * ```ts\n * const walletClient = createWalletClient({\n * chain: mainnet,\n * transport: http()\n * }).extend(signUserOperationActions());\n * ```\n */\nexport function signUserOperationActions() {\n return <\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n >(\n client: Client<Transport, TChain, TAccount> & {\n signTypedData: WalletClient['signTypedData'];\n },\n ) => ({\n signUserOperation: async (\n parameters: Omit<SignUserOperationParameters, 'chainId'> & {\n chainId?: number;\n },\n ) =>\n signUserOperation(client, {\n chainId:\n parameters.chainId ??\n (() => {\n if (!client.chain?.id) {\n throw new BaseError(\n 'Chain ID is required. Either provide it in parameters or configure the client with a chain.',\n );\n }\n return client.chain.id;\n })(),\n ...parameters,\n }),\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAS,yBAAyB;AAYlC,SAAS,QAAQ,oBAAoB,sBAAsB;AAuC3D,eAAsB,oCAIpB,QACA,MACA;AACA,MAAI,CAAC,KAAK,IAAI;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAGA,QAAM,UAAU,OAAO,OAAO;AAC9B,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qBAAqB;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A,EAC/D,6BAA6B,OAC3B,eACG;AACH,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,kCAAkC,YAAY;AAC5C,WAAO;AAAA,MACL;AAAA,IACF;AAAA,EACF;AAAA,EACA,gCAAgC,YAAY;AAC1C,WAAO;AAAA,MACL;AAAA,IACF;AAAA,EACF;AACF;AAqBO,IAAM,uBAAuB,MAAM,CAAC,YAA0B;AAAA,EACnE,+BAA+B,OAC7B,SACG,oCAAoC,QAAQ,IAAI;AACvD;AAEO,IAAM,wBAAwB,MAAM,CAAC,YAAoB;AAAA,EAC9D,iCAAiC,OAC/B,SACG,sCAAsC,QAAyB,IAAI;AAC1E;","names":["read_exports","isAddressEqual","BaseError","parseAccount","BaseError","parseAccount"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-QMRKCB7T.cjs","../src/actions/index.ts","../src/actions/erc7710RedeemDelegationAction.ts","../src/actions/erc7715Mapping.ts","../src/actions/erc7715GetGrantedExecutionPermissionsAction.ts","../src/actions/erc7715GetSupportedExecutionPermissionsAction.ts","../src/actions/erc7715RequestExecutionPermissionsAction.ts","../src/actions/getCaveatAvailableAmount.ts","../src/actions/isValid7702Implementation.ts","../src/actions/signDelegation.ts","../src/actions/signUserOperation.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACxBA,IAAA,gBAAA,EAAA,CAAA,CAAA;AAAA,wCAAA,eAAA,EAAA;AAAA,EAAA,qBAAA,EAAA,CAAA,EAAA,GAAA,qBAAA;AAAA,EAAA,qBAAA,EAAA,CAAA,EAAA,GAAA,qBAAA;AAAA,EAAA,oBAAA,EA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AC2B,IAAA;AAC/B,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACU,EAAA;AAGZ,EAAA;AACE,IAAA;AAAmE,EAAA;AAGrE,EAAA;AAEA,EAAA;AAAoD,IAAA;AAClD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AAGF,EAAA;AAA4B,IAAA;AAC1B,IAAA;AACG,EAAA;AAEP;AAcO;AACL,EAAA;AAOM,IAAA;AAMwB,MAAA;AAIpB,QAAA;AACE,UAAA;AAAU,YAAA;AACR,UAAA;AACF,QAAA;AAEF,QAAA;AAAoB,MAAA;AACnB,MAAA;AACF,IAAA;AACJ,EAAA;AAEP;AVgnBA;AACA;AC1qBO;AAA0D,EAAA;AAI7D,IAAA;AAAO,MAAA;AACL,MAAA;AACA,IAAA;AACF,EAAA;AACF,EAAA;AAEE,IAAA;AAAO,MAAA;AACL,IAAA;AACF,EAAA;AACF,EAAA;AAEE,IAAA;AAAO,MAAA;AACL,IAAA;AACF,EAAA;AAEJ;AAqBO;AAA8D,EAAA;AAIrE;AAEO;AAAyD,EAAA;AAIhE;ADipBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-QMRKCB7T.cjs","sourcesContent":[null,"import type { Client, WalletClient } from 'viem';\nimport type { BundlerClient } from 'viem/account-abstraction';\n\nimport type {\n SendTransactionWithDelegationParameters,\n SendUserOperationWithDelegationParameters,\n} from './erc7710RedeemDelegationAction';\nimport {\n sendTransactionWithDelegationAction,\n sendUserOperationWithDelegationAction,\n} from './erc7710RedeemDelegationAction';\nimport { erc7715GetGrantedExecutionPermissionsAction } from './erc7715GetGrantedExecutionPermissionsAction';\nimport { erc7715GetSupportedExecutionPermissionsAction } from './erc7715GetSupportedExecutionPermissionsAction';\nimport { erc7715RequestExecutionPermissionsAction } from './erc7715RequestExecutionPermissionsAction';\nimport type {\n MetaMaskExtensionClient,\n RequestExecutionPermissionsParameters,\n} from './erc7715RequestExecutionPermissionsAction';\n\nexport {\n // Individual action functions\n getErc20PeriodTransferEnforcerAvailableAmount,\n getErc20StreamingEnforcerAvailableAmount,\n getMultiTokenPeriodEnforcerAvailableAmount,\n getNativeTokenPeriodTransferEnforcerAvailableAmount,\n getNativeTokenStreamingEnforcerAvailableAmount,\n // Action builder\n caveatEnforcerActions,\n // Parameter types\n type CaveatEnforcerParams,\n // Result types\n type PeriodTransferResult,\n type StreamingResult,\n} from './getCaveatAvailableAmount';\n\nexport { isValid7702Implementation } from './isValid7702Implementation';\n\n// Signing actions\nexport {\n signDelegation,\n signDelegationActions,\n type SignDelegationParameters,\n type SignDelegationReturnType,\n} from './signDelegation';\n\nexport {\n signUserOperation,\n signUserOperationActions,\n type SignUserOperationParameters,\n type SignUserOperationReturnType,\n} from './signUserOperation';\n\nexport {\n erc7715RequestExecutionPermissionsAction as requestExecutionPermissions,\n type MetaMaskExtensionClient,\n type MetaMaskExtensionSchema,\n type RequestExecutionPermissionsParameters,\n type RequestExecutionPermissionsReturnType,\n} from './erc7715RequestExecutionPermissionsAction';\n\nexport type { PermissionRequestParameter } from './erc7715Types';\n\nexport { erc7715GetSupportedExecutionPermissionsAction as getSupportedExecutionPermissions } from './erc7715GetSupportedExecutionPermissionsAction';\n\nexport { erc7715GetGrantedExecutionPermissionsAction as getGrantedExecutionPermissions } from './erc7715GetGrantedExecutionPermissionsAction';\n\nexport {\n type GetSupportedExecutionPermissionsResult,\n type GetGrantedExecutionPermissionsResult,\n type SupportedPermissionInfo,\n type PermissionTypes,\n type NativeTokenStreamPermission,\n type NativeTokenPeriodicPermission,\n type Erc20TokenStreamPermission,\n type Erc20TokenPeriodicPermission,\n type Erc20TokenRevocationPermission,\n type RpcGetSupportedExecutionPermissionsResult,\n type RpcGetGrantedExecutionPermissionsResult,\n type RpcSupportedPermissionInfo,\n} from './erc7715Types';\n\nexport type { DelegatedCall } from './erc7710RedeemDelegationAction';\n\nexport const erc7715ProviderActions = () => (client: Client) => ({\n requestExecutionPermissions: async (\n parameters: RequestExecutionPermissionsParameters,\n ) => {\n return erc7715RequestExecutionPermissionsAction(\n client as MetaMaskExtensionClient,\n parameters,\n );\n },\n getSupportedExecutionPermissions: async () => {\n return erc7715GetSupportedExecutionPermissionsAction(\n client as MetaMaskExtensionClient,\n );\n },\n getGrantedExecutionPermissions: async () => {\n return erc7715GetGrantedExecutionPermissionsAction(\n client as MetaMaskExtensionClient,\n );\n },\n});\n\n/**\n * Type for a viem Client extended with ERC-7715 provider actions.\n * Use this to type variables that will be assigned an extended client later.\n *\n * @example\n * ```typescript\n * let client: Erc7715Client | null = null;\n *\n * function setupClient() {\n * client = createWalletClient({\n * chain: sepolia,\n * transport: custom(window.ethereum),\n * }).extend(erc7715ProviderActions());\n * }\n * ```\n */\nexport type Erc7715Client = Client &\n ReturnType<ReturnType<typeof erc7715ProviderActions>>;\n\nexport const erc7710WalletActions = () => (client: WalletClient) => ({\n sendTransactionWithDelegation: async (\n args: SendTransactionWithDelegationParameters,\n ) => sendTransactionWithDelegationAction(client, args),\n});\n\nexport const erc7710BundlerActions = () => (client: Client) => ({\n sendUserOperationWithDelegation: async (\n args: SendUserOperationWithDelegationParameters,\n ) => sendUserOperationWithDelegationAction(client as BundlerClient, args),\n});\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport type {\n Account,\n Chain,\n Hex,\n OneOf,\n PublicClient,\n SendTransactionParameters,\n SendTransactionRequest,\n Transport,\n WalletClient,\n} from 'viem';\nimport { concat, encodeFunctionData, isAddressEqual } from 'viem';\nimport type {\n BundlerClient,\n SendUserOperationParameters,\n SmartAccount,\n} from 'viem/account-abstraction';\n\nimport { encodeDelegations } from '../delegation';\nimport {\n createExecution,\n encodeExecutionCalldatas,\n ExecutionMode,\n} from '../executions';\nimport { getSmartAccountsEnvironment } from '../smartAccountsEnvironment';\nimport type { Call, PermissionContext } from '../types';\n\nexport type DelegatedCall = Call &\n OneOf<\n { permissionContext: PermissionContext; delegationManager: Hex } | object\n >;\n\nexport type SendTransactionWithDelegationParameters<\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends Account | undefined = Account | undefined,\n TChainOverride extends Chain | undefined = Chain | undefined,\n TRequest extends SendTransactionRequest<TChain, TChainOverride> =\n SendTransactionRequest<TChain, TChainOverride>,\n> = SendTransactionParameters<TChain, TAccount, TChainOverride, TRequest> & {\n permissionContext: PermissionContext;\n delegationManager: Hex;\n};\n\n/**\n * Sends a transaction using delegation to execute operations on behalf of another account.\n *\n * @param client - The wallet client to use for sending the transaction.\n * @param args - Transaction parameters with delegation details.\n * @returns Transaction hash of the executed transaction.\n */\nexport async function sendTransactionWithDelegationAction<\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n>(\n client: WalletClient<Transport, TChain, TAccount>,\n args: SendTransactionWithDelegationParameters<TChain, TAccount>,\n) {\n if (!args.to) {\n throw new Error(\n '`to` is required. `sendTransactionWithDelegation` cannot be used to deploy contracts.',\n );\n }\n\n // Validate DelegationManager address\n const chainId = client.chain?.id;\n if (!chainId) {\n throw new Error('Chain ID is not set');\n }\n\n const { DelegationManager: expectedDelegationManager } =\n getSmartAccountsEnvironment(chainId);\n if (!isAddressEqual(args.delegationManager, expectedDelegationManager)) {\n throw new Error(\n `Invalid DelegationManager: expected ${expectedDelegationManager} for chain ${chainId}, but got ${args.delegationManager}`,\n );\n }\n\n const executions = [\n createExecution({\n target: args.to,\n value: args.value,\n callData: args.data,\n }),\n ];\n\n const calldata = encodeFunctionData({\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [\n [encodeDelegations(args.permissionContext)],\n [ExecutionMode.SingleDefault],\n encodeExecutionCalldatas([executions]),\n ],\n });\n\n const {\n value: _value,\n permissionContext: _permissionContext,\n delegationManager: _delegationManager,\n ...rest\n } = args;\n\n const hash = await client.sendTransaction({\n ...rest,\n to: args.delegationManager,\n data: calldata,\n } as unknown as SendTransactionParameters);\n\n return hash;\n}\n\nexport type SendUserOperationWithDelegationParameters<\n TAccount extends SmartAccount | undefined = SmartAccount | undefined,\n TAccountOverride extends SmartAccount | undefined = SmartAccount | undefined,\n> = SendUserOperationParameters<TAccount, TAccountOverride, DelegatedCall[]> & {\n dependencies?: { factory: Hex; factoryData: Hex }[];\n calls: DelegatedCall[];\n publicClient: PublicClient<Transport, Chain>;\n};\n\n/**\n * Broadcasts a User Operation with delegation to the Bundler.\n *\n * @param client - Client to use for sending the user operation.\n * @param parameters - Parameters for the user operation with delegation.\n * @returns The User Operation hash of the broadcasted operation.\n * @example\n * import { createBundlerClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const bundlerClient = createBundlerClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const userOpHash = await sendUserOperationWithDelegationAction(bundlerClient, {\n * account: bobSmartAccount,\n * calls: [\n * {\n * to: aliceCounterContractAddress,\n * data: encodeFunctionData({\n * abi: CounterMetadata.abi,\n * functionName: 'increment',\n * }),\n * value: 0n,\n * permissionContext: '0x...',\n * delegationManager: '0x...',\n * },\n * ],\n * dependencies: [{ factory: '0x...', factoryData: '0x...' }], // Optional: for deploying accounts\n * })\n */\nexport async function sendUserOperationWithDelegationAction<\n TAccount extends SmartAccount | undefined,\n TAccountOverride extends SmartAccount | undefined = undefined,\n>(\n client: BundlerClient<Transport, Chain | undefined, TAccount>,\n parameters: SendUserOperationWithDelegationParameters<\n TAccount,\n TAccountOverride\n >,\n) {\n if (parameters.dependencies) {\n const { publicClient } = parameters;\n\n const includedAccountKeys: Record<Hex, boolean> = {};\n\n const chainId = publicClient.chain?.id;\n\n if (!chainId) {\n throw new Error('Chain ID is not set');\n }\n\n const { SimpleFactory } = getSmartAccountsEnvironment(chainId);\n\n const uniqueDependencies = parameters.dependencies.filter((dependency) => {\n if (!isAddressEqual(dependency.factory, SimpleFactory)) {\n throw new Error(\n `Invalid dependency: ${dependency.factory} is not allowed.`,\n );\n }\n\n // ensure that factory calls are not duplicated\n const accountKey = concat([dependency.factory, dependency.factoryData]);\n const isDuplicate = includedAccountKeys[accountKey];\n\n includedAccountKeys[accountKey] = true;\n return !isDuplicate;\n });\n\n const factoryCalls = (\n await Promise.all(\n uniqueDependencies.map(async ({ factory, factoryData }) => {\n const isDeployed = await publicClient\n .call({\n to: factory,\n data: factoryData,\n })\n .then(() => false)\n .catch(() => true);\n\n if (isDeployed) {\n return undefined;\n }\n return {\n to: factory,\n value: 0n,\n data: factoryData,\n };\n }),\n )\n ).filter((call: Call | undefined) => call !== undefined) as Call[];\n\n parameters.calls = [\n ...(factoryCalls as DelegatedCall[]),\n ...parameters.calls,\n ];\n }\n\n parameters.calls = parameters.calls.map((call) => {\n if (!('permissionContext' in call)) {\n return call;\n }\n\n const { permissionContext } = call;\n if (!permissionContext) {\n return call;\n }\n\n return {\n ...call,\n permissionContext: encodeDelegations(permissionContext),\n };\n });\n\n return client.sendUserOperation(\n parameters as unknown as SendUserOperationParameters,\n );\n}\n","import type {\n Erc20TokenPeriodicPermission as RpcErc20TokenPeriodicPermission,\n Erc20TokenStreamPermission as RpcErc20TokenStreamPermission,\n Erc20TokenRevocationPermission as RpcErc20TokenRevocationPermission,\n NativeTokenPeriodicPermission as RpcNativeTokenPeriodicPermission,\n NativeTokenStreamPermission as RpcNativeTokenStreamPermission,\n PermissionRequest,\n PermissionTypes as RpcPermissionTypes,\n Rule,\n} from '@metamask/7715-permission-types';\nimport { hexToNumber, toHex } from 'viem';\n\nimport { isDefined, toHexOrThrow } from '../utils';\nimport type {\n Erc20TokenPeriodicPermission,\n Erc20TokenRevocationPermission,\n Erc20TokenStreamPermission,\n GetGrantedExecutionPermissionsResult,\n GetSupportedExecutionPermissionsResult,\n NativeTokenPeriodicPermission,\n NativeTokenStreamPermission,\n PermissionRequestParameter,\n PermissionTypes as DeveloperPermissionTypes,\n RpcGetGrantedExecutionPermissionsResult,\n RpcGetSupportedExecutionPermissionsResult,\n} from './erc7715Types';\n\n// =============================================================================\n// Developer → RPC (request formatting)\n// =============================================================================\n\n/**\n * Converts a developer permission request to RPC format for wallet submission.\n *\n * @param parameters the permission request parameters\n * @returns the permission request in RPC format\n */\nexport function permissionRequestToRpc(\n parameters: PermissionRequestParameter,\n): PermissionRequest<RpcPermissionTypes> {\n const { chainId, from, expiry } = parameters;\n\n const converter = getPermissionRequestToRpcConverter(\n parameters.permission.type,\n );\n\n const rules: Rule[] = isDefined(expiry)\n ? [\n {\n type: 'expiry',\n data: {\n timestamp: expiry,\n },\n },\n ]\n : [];\n\n const optionalFields = {\n ...(from ? { from } : {}),\n };\n\n return {\n ...optionalFields,\n chainId: toHex(chainId),\n permission: converter(parameters.permission),\n to: parameters.to,\n rules,\n };\n}\n\ntype PermissionRequestToRpcConverter = (\n permission: DeveloperPermissionTypes,\n) => RpcPermissionTypes;\n\n/**\n * Get the permission request to RPC converter for the given permission type.\n *\n * @param permissionType the permission type\n * @returns the permission request to RPC converter for the given permission type\n */\nfunction getPermissionRequestToRpcConverter(\n permissionType: string,\n): PermissionRequestToRpcConverter {\n switch (permissionType) {\n case 'native-token-stream':\n return (permission) =>\n nativeTokenStreamPermissionToRpc(\n permission as NativeTokenStreamPermission,\n );\n case 'erc20-token-stream':\n return (permission) =>\n erc20TokenStreamPermissionToRpc(\n permission as Erc20TokenStreamPermission,\n );\n case 'native-token-periodic':\n return (permission) =>\n nativeTokenPeriodicPermissionToRpc(\n permission as NativeTokenPeriodicPermission,\n );\n case 'erc20-token-periodic':\n return (permission) =>\n erc20TokenPeriodicPermissionToRpc(\n permission as Erc20TokenPeriodicPermission,\n );\n case 'erc20-token-revocation':\n return (permission) =>\n erc20TokenRevocationPermissionToRpc(\n permission as Erc20TokenRevocationPermission,\n );\n default:\n throw new Error(`Unsupported permission type: ${permissionType}`);\n }\n}\n\n/**\n * Convert native token stream permission to RPC format.\n *\n * @param permission the native token stream permission\n * @returns the native token stream permission in RPC format\n */\nfunction nativeTokenStreamPermissionToRpc(\n permission: NativeTokenStreamPermission,\n): RpcNativeTokenStreamPermission {\n const {\n data: {\n initialAmount,\n justification,\n maxAmount,\n startTime,\n amountPerSecond,\n },\n isAdjustmentAllowed,\n } = permission;\n\n const optionalFields = {\n ...(isDefined(initialAmount) && {\n initialAmount: toHexOrThrow(initialAmount, 'initialAmount'),\n }),\n ...(isDefined(maxAmount) && {\n maxAmount: toHexOrThrow(maxAmount, 'maxAmount'),\n }),\n ...(isDefined(startTime) && {\n startTime: Number(startTime),\n }),\n ...(justification ? { justification } : {}),\n };\n\n return {\n type: 'native-token-stream',\n data: {\n amountPerSecond: toHexOrThrow(amountPerSecond, 'amountPerSecond'),\n ...optionalFields,\n },\n isAdjustmentAllowed,\n };\n}\n\n/**\n * Convert ERC20 token stream permission to RPC format.\n *\n * @param permission the erc20 token stream permission\n * @returns the erc20 token stream permission in RPC format\n */\nfunction erc20TokenStreamPermissionToRpc(\n permission: Erc20TokenStreamPermission,\n): RpcErc20TokenStreamPermission {\n const {\n data: {\n tokenAddress,\n amountPerSecond,\n initialAmount,\n startTime,\n maxAmount,\n justification,\n },\n isAdjustmentAllowed,\n } = permission;\n\n const optionalFields = {\n ...(isDefined(initialAmount) && {\n initialAmount: toHexOrThrow(initialAmount, 'initialAmount'),\n }),\n ...(isDefined(maxAmount) && {\n maxAmount: toHexOrThrow(maxAmount, 'maxAmount'),\n }),\n ...(isDefined(startTime) && {\n startTime: Number(startTime),\n }),\n ...(justification ? { justification } : {}),\n };\n\n return {\n type: 'erc20-token-stream',\n data: {\n tokenAddress: toHexOrThrow(tokenAddress, 'tokenAddress'),\n amountPerSecond: toHexOrThrow(amountPerSecond, 'amountPerSecond'),\n ...optionalFields,\n },\n isAdjustmentAllowed,\n };\n}\n\n/**\n * Convert native token periodic permission to RPC format.\n *\n * @param permission the native token periodic permission\n * @returns the native token periodic permission in RPC format\n */\nfunction nativeTokenPeriodicPermissionToRpc(\n permission: NativeTokenPeriodicPermission,\n): RpcNativeTokenPeriodicPermission {\n const {\n data: { periodAmount, periodDuration, startTime, justification },\n isAdjustmentAllowed,\n } = permission;\n\n const optionalFields = {\n ...(isDefined(startTime) && {\n startTime: Number(startTime),\n }),\n ...(justification ? { justification } : {}),\n };\n\n return {\n type: 'native-token-periodic',\n data: {\n periodAmount: toHexOrThrow(periodAmount, 'periodAmount'),\n periodDuration: Number(periodDuration),\n ...optionalFields,\n },\n isAdjustmentAllowed,\n };\n}\n\n/**\n * Convert ERC20 token periodic permission to RPC format.\n *\n * @param permission the erc20 token periodic permission\n * @returns the erc20 token periodic permission in RPC format\n */\nfunction erc20TokenPeriodicPermissionToRpc(\n permission: Erc20TokenPeriodicPermission,\n): RpcErc20TokenPeriodicPermission {\n const {\n data: {\n tokenAddress,\n periodAmount,\n periodDuration,\n startTime,\n justification,\n },\n isAdjustmentAllowed,\n } = permission;\n\n const optionalFields = {\n ...(isDefined(startTime) && {\n startTime: Number(startTime),\n }),\n ...(justification ? { justification } : {}),\n };\n\n return {\n type: 'erc20-token-periodic',\n data: {\n tokenAddress: toHexOrThrow(tokenAddress, 'tokenAddress'),\n periodAmount: toHexOrThrow(periodAmount, 'periodAmount'),\n periodDuration: Number(periodDuration),\n ...optionalFields,\n },\n isAdjustmentAllowed,\n };\n}\n\n/**\n * Convert ERC20 token revocation permission to RPC format.\n *\n * @param permission the erc20 token revocation permission\n * @returns the erc20 token revocation permission in RPC format\n */\nfunction erc20TokenRevocationPermissionToRpc(\n permission: Erc20TokenRevocationPermission,\n): RpcErc20TokenRevocationPermission {\n const {\n data: { justification },\n isAdjustmentAllowed,\n } = permission;\n\n const data = {\n ...(justification ? { justification } : {}),\n };\n return {\n type: 'erc20-token-revocation',\n data,\n isAdjustmentAllowed,\n };\n}\n\n// =============================================================================\n// RPC → Developer friendly types (response conversion)\n// =============================================================================\n\n/**\n * Converts RPC permission responses to developer-friendly types.\n * Converts chainId from hex to number, and token amounts from hex to bigint.\n *\n * @param result the RPC permission responses\n * @returns the developer-friendly permission responses\n */\nexport function permissionResponsesFromRpc(\n result: RpcGetGrantedExecutionPermissionsResult,\n): GetGrantedExecutionPermissionsResult {\n return result.map((permission) => ({\n ...permission,\n chainId: hexToNumber(permission.chainId),\n permission: permissionTypeFromRpc(permission.permission),\n }));\n}\n\n/**\n * Converts RPC permission type data to developer-friendly types.\n * Converts hex amount fields to bigint.\n *\n * @param permission the RPC permission\n * @returns the developer-friendly permission\n */\nexport function permissionTypeFromRpc(\n permission: RpcPermissionTypes,\n): DeveloperPermissionTypes {\n const convertedData: Record<string, unknown> = { ...permission.data };\n\n if ('amountPerSecond' in convertedData && convertedData.amountPerSecond) {\n convertedData.amountPerSecond = BigInt(\n convertedData.amountPerSecond as `0x${string}`,\n );\n }\n\n if ('periodAmount' in convertedData && convertedData.periodAmount) {\n convertedData.periodAmount = BigInt(\n convertedData.periodAmount as `0x${string}`,\n );\n }\n\n if ('initialAmount' in convertedData && convertedData.initialAmount) {\n convertedData.initialAmount = BigInt(\n convertedData.initialAmount as `0x${string}`,\n );\n }\n\n if ('maxAmount' in convertedData && convertedData.maxAmount) {\n convertedData.maxAmount = BigInt(convertedData.maxAmount as `0x${string}`);\n }\n\n return {\n ...permission,\n data: convertedData,\n } as DeveloperPermissionTypes;\n}\n\n/**\n * Converts RPC supported permissions result to developer-friendly types.\n * Converts chain IDs from hex to numbers.\n *\n * @param result the RPC supported permissions result\n * @returns the developer-friendly supported permissions result\n */\nexport function rpcSupportedPermissionsToDeveloper(\n result: RpcGetSupportedExecutionPermissionsResult,\n): GetSupportedExecutionPermissionsResult {\n const converted: GetSupportedExecutionPermissionsResult = {};\n\n for (const [permissionType, permissionInfo] of Object.entries(result)) {\n converted[permissionType] = {\n chainIds: permissionInfo.chainIds.map((chainId) => hexToNumber(chainId)),\n ruleTypes: permissionInfo.ruleTypes,\n };\n }\n\n return converted;\n}\n","import { permissionResponsesFromRpc } from './erc7715Mapping';\nimport type {\n GetGrantedExecutionPermissionsResult,\n MetaMaskExtensionClient,\n} from './erc7715Types';\n\nexport type { GetGrantedExecutionPermissionsResult } from './erc7715Types';\n\n/**\n * Retrieves all previously granted execution permissions from the wallet according to EIP-7715 specification.\n *\n * @param client - The client to use for the request.\n * @returns A promise that resolves to an array of granted permission responses.\n * @description\n * This function queries the wallet for all granted permissions that are not yet revoked.\n * Each permission response includes the chain ID, address, signer, permission details,\n * context, and dependency information.\n * @example\n * ```typescript\n * const grantedPermissions = await erc7715GetGrantedExecutionPermissionsAction(client);\n * // Returns an array of PermissionResponse objects with user-friendly types\n * ```\n */\nexport async function erc7715GetGrantedExecutionPermissionsAction(\n client: MetaMaskExtensionClient,\n): Promise<GetGrantedExecutionPermissionsResult> {\n const result = await client.request(\n {\n method: 'wallet_getGrantedExecutionPermissions',\n params: [],\n },\n { retryCount: 0 },\n );\n\n if (!result) {\n throw new Error('Failed to get granted execution permissions');\n }\n\n return permissionResponsesFromRpc(result);\n}\n","import { rpcSupportedPermissionsToDeveloper } from './erc7715Mapping';\nimport type {\n GetSupportedExecutionPermissionsResult,\n MetaMaskExtensionClient,\n} from './erc7715Types';\n\nexport type { GetSupportedExecutionPermissionsResult } from './erc7715Types';\n\n/**\n * Retrieves the supported execution permission types from the wallet according to EIP-7715 specification.\n *\n * @param client - The client to use for the request.\n * @returns A promise that resolves to a record of supported permission types with their chain IDs and rule types.\n * @description\n * This function queries the wallet for the permission types it supports.\n * The result is keyed by permission type and includes the supported chain IDs and rule types.\n * @example\n * ```typescript\n * const supported = await erc7715GetSupportedExecutionPermissionsAction(client);\n * // Returns:\n * // {\n * // \"native-token-allowance\": {\n * // \"chainIds\": [1, 137],\n * // \"ruleTypes\": [\"expiry\"]\n * // },\n * // \"erc20-token-allowance\": {\n * // \"chainIds\": [1],\n * // \"ruleTypes\": []\n * // }\n * // }\n * ```\n */\nexport async function erc7715GetSupportedExecutionPermissionsAction(\n client: MetaMaskExtensionClient,\n): Promise<GetSupportedExecutionPermissionsResult> {\n const result = await client.request(\n {\n method: 'wallet_getSupportedExecutionPermissions',\n params: [],\n },\n { retryCount: 0 },\n );\n\n if (!result) {\n throw new Error('Failed to get supported execution permissions');\n }\n\n return rpcSupportedPermissionsToDeveloper(result);\n}\n","import {\n permissionRequestToRpc,\n permissionResponsesFromRpc,\n} from './erc7715Mapping';\nimport type {\n GetGrantedExecutionPermissionsResult,\n MetaMaskExtensionClient,\n PermissionRequestParameter,\n} from './erc7715Types';\n\nexport type {\n GetGrantedExecutionPermissionsResult,\n GetSupportedExecutionPermissionsResult,\n MetaMaskExtensionClient,\n MetaMaskExtensionSchema,\n SupportedPermissionInfo,\n PermissionTypes,\n PermissionRequestParameter,\n} from './erc7715Types';\n\n/**\n * Parameters for the RequestExecutionPermissions action.\n *\n * @template Signer - The type of the signer, either an Address or Account.\n */\nexport type RequestExecutionPermissionsParameters =\n PermissionRequestParameter[];\n\n/**\n * Return type for the request execution permissions action.\n */\nexport type RequestExecutionPermissionsReturnType =\n GetGrantedExecutionPermissionsResult;\n\n/**\n * Grants permissions according to EIP-7715 specification.\n *\n * @template Signer - The type of the signer, either an Address or Account.\n * @param client - The client to use for the request.\n * @param parameters - The permissions requests to grant.\n * @returns A promise that resolves to the permission responses.\n * @description\n * This function formats the permissions requests and invokes the wallet method to grant permissions.\n * It will throw an error if the permissions could not be granted.\n */\nexport async function erc7715RequestExecutionPermissionsAction(\n client: MetaMaskExtensionClient,\n parameters: RequestExecutionPermissionsParameters,\n): Promise<RequestExecutionPermissionsReturnType> {\n const formattedPermissionRequest = parameters.map(permissionRequestToRpc);\n\n const result = await client.request(\n {\n method: 'wallet_requestExecutionPermissions',\n params: formattedPermissionRequest,\n },\n { retryCount: 0 },\n );\n\n if (!result) {\n throw new Error('Failed to grant permissions');\n }\n\n return permissionResponsesFromRpc(result);\n}\n","import type { Address, Hex, Client } from 'viem';\n\nimport { hashDelegation } from '../delegation';\nimport * as ERC20PeriodTransferEnforcer from '../DelegationFramework/ERC20PeriodTransferEnforcer';\nimport * as ERC20StreamingEnforcer from '../DelegationFramework/ERC20StreamingEnforcer';\nimport * as MultiTokenPeriodEnforcer from '../DelegationFramework/MultiTokenPeriodEnforcer';\nimport * as NativeTokenPeriodTransferEnforcer from '../DelegationFramework/NativeTokenPeriodTransferEnforcer';\nimport * as NativeTokenStreamingEnforcer from '../DelegationFramework/NativeTokenStreamingEnforcer';\nimport type { SmartAccountsEnvironment, Delegation } from '../types';\n\n/**\n * Parameters for all caveat enforcer actions.\n */\nexport type CaveatEnforcerParams = {\n delegation: Delegation;\n};\n\n/**\n * Return type for period-based transfer enforcers\n */\nexport type PeriodTransferResult = {\n availableAmount: bigint;\n isNewPeriod: boolean;\n currentPeriod: bigint;\n};\n\n/**\n * Return type for streaming enforcers\n */\nexport type StreamingResult = {\n availableAmount: bigint;\n};\n\n/**\n * Finds a caveat that matches the specified enforcer address.\n *\n * @param config - The configuration object.\n * @param config.delegation - The delegation to search.\n * @param config.enforcerAddress - The enforcer address to match.\n * @param config.enforcerName - The name of the enforcer.\n * @returns The matching caveat.\n * @throws Error if no matching caveat is found.\n * @throws Error if multiple matching caveats are found.\n */\nfunction findMatchingCaveat({\n delegation,\n enforcerAddress,\n enforcerName,\n}: {\n delegation: Delegation;\n enforcerAddress: Address;\n enforcerName: keyof SmartAccountsEnvironment['caveatEnforcers'];\n}): { terms: Hex; args: Hex } {\n const matchingCaveats = delegation.caveats.filter(\n (caveat) => caveat.enforcer.toLowerCase() === enforcerAddress.toLowerCase(),\n );\n\n if (matchingCaveats.length === 0) {\n throw new Error(`No caveat found with enforcer matching ${enforcerName}`);\n }\n\n if (matchingCaveats.length > 1) {\n throw new Error(\n `Multiple caveats found with enforcer matching ${enforcerName}`,\n );\n }\n\n const [{ terms, args }] = matchingCaveats as unknown as [\n { terms: Hex; args: Hex },\n ];\n\n return {\n terms,\n args,\n };\n}\n\n/**\n * Gets the delegation manager address from environment.\n *\n * @param environment - The SmartAccountsEnvironment.\n * @returns The delegation manager address.\n */\nfunction getDelegationManager(environment: SmartAccountsEnvironment): Address {\n if (!environment.DelegationManager) {\n throw new Error('Delegation manager address not found');\n }\n\n return environment.DelegationManager;\n}\n\n/**\n * Gets the enforcer address from environment.\n *\n * @param config - The configuration object.\n * @param config.enforcerName - The name of the enforcer.\n * @param config.environment - The SmartAccountsEnvironment.\n * @returns The enforcer address.\n */\nfunction getEnforcerAddress({\n enforcerName,\n environment,\n}: {\n enforcerName: keyof SmartAccountsEnvironment['caveatEnforcers'];\n environment: SmartAccountsEnvironment;\n}): Address {\n const enforcerAddress = environment.caveatEnforcers[enforcerName];\n if (!enforcerAddress) {\n throw new Error(`${enforcerName} not found in environment`);\n }\n\n return enforcerAddress;\n}\n\n/**\n * Get available amount for ERC20 period transfer enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the ERC20 period transfer enforcer.\n * @returns Promise resolving to the period transfer result.\n */\nexport async function getErc20PeriodTransferEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<PeriodTransferResult> {\n const enforcerName = 'ERC20PeriodTransferEnforcer';\n\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return ERC20PeriodTransferEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationHash,\n delegationManager,\n terms,\n });\n}\n\n/**\n * Get available amount for ERC20 streaming enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the ERC20 streaming enforcer.\n * @returns Promise resolving to the streaming result.\n */\nexport async function getErc20StreamingEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<StreamingResult> {\n const enforcerName = 'ERC20StreamingEnforcer';\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return ERC20StreamingEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationManager,\n delegationHash,\n terms,\n });\n}\n\n/**\n * Get available amount for multi-token period enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the multi-token period enforcer.\n * @returns Promise resolving to the period transfer result.\n */\nexport async function getMultiTokenPeriodEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<PeriodTransferResult> {\n const enforcerName = 'MultiTokenPeriodEnforcer';\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms, args } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return MultiTokenPeriodEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationHash,\n delegationManager,\n terms,\n args,\n });\n}\n\n/**\n * Get available amount for native token period transfer enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the native token period transfer enforcer.\n * @returns Promise resolving to the period transfer result.\n */\nexport async function getNativeTokenPeriodTransferEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<PeriodTransferResult> {\n const enforcerName = 'NativeTokenPeriodTransferEnforcer';\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return NativeTokenPeriodTransferEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationHash,\n delegationManager,\n terms,\n });\n}\n\n/**\n * Get available amount for native token streaming enforcer.\n *\n * @param client - The viem client.\n * @param environment - The SmartAccountsEnvironment.\n * @param params - The parameters for the native token streaming enforcer.\n * @returns Promise resolving to the streaming result.\n */\nexport async function getNativeTokenStreamingEnforcerAvailableAmount(\n client: Client,\n environment: SmartAccountsEnvironment,\n params: CaveatEnforcerParams,\n): Promise<StreamingResult> {\n const enforcerName = 'NativeTokenStreamingEnforcer';\n const delegationManager = getDelegationManager(environment);\n const enforcerAddress = getEnforcerAddress({\n enforcerName,\n environment,\n });\n\n const delegationHash = hashDelegation(params.delegation);\n const { terms } = findMatchingCaveat({\n delegation: params.delegation,\n enforcerAddress,\n enforcerName,\n });\n\n return NativeTokenStreamingEnforcer.read.getAvailableAmount({\n client,\n contractAddress: enforcerAddress,\n delegationManager,\n delegationHash,\n terms,\n });\n}\n\n/**\n * Caveat enforcer actions for extending viem clients.\n *\n * @param params - The parameters object.\n * @param params.environment - The SmartAccountsEnvironment.\n * @returns A function that takes a client and returns the client extension with caveat enforcer actions.\n */\nexport const caveatEnforcerActions =\n ({ environment }: { environment: SmartAccountsEnvironment }) =>\n (client: Client) => ({\n /**\n * Get available amount for ERC20 period transfer enforcer.\n *\n * @param params - The parameters for the ERC20 period transfer enforcer.\n * @returns Promise resolving to the period transfer result.\n */\n getErc20PeriodTransferEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<PeriodTransferResult> => {\n return getErc20PeriodTransferEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n\n /**\n * Get available amount for ERC20 streaming enforcer.\n *\n * @param params - The parameters for the ERC20 streaming enforcer.\n * @returns Promise resolving to the streaming result.\n */\n getErc20StreamingEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<StreamingResult> => {\n return getErc20StreamingEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n\n /**\n * Get available amount for multi-token period enforcer.\n *\n * @param params - The parameters for the multi-token period enforcer.\n * @returns Promise resolving to the period transfer result.\n */\n getMultiTokenPeriodEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<PeriodTransferResult> => {\n return getMultiTokenPeriodEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n\n /**\n * Get available amount for native token period transfer enforcer.\n *\n * @param params - The parameters for the native token period transfer enforcer.\n * @returns Promise resolving to the period transfer result.\n */\n getNativeTokenPeriodTransferEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<PeriodTransferResult> => {\n return getNativeTokenPeriodTransferEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n\n /**\n * Get available amount for native token streaming enforcer.\n *\n * @param params - The parameters for the native token streaming enforcer.\n * @returns Promise resolving to the streaming result.\n */\n getNativeTokenStreamingEnforcerAvailableAmount: async (\n params: CaveatEnforcerParams,\n ): Promise<StreamingResult> => {\n return getNativeTokenStreamingEnforcerAvailableAmount(\n client,\n environment,\n params,\n );\n },\n });\n","import type { Client, Address, Hex } from 'viem';\nimport { isAddressEqual } from 'viem';\nimport { getCode } from 'viem/actions';\n\nimport type { SmartAccountsEnvironment } from '../types';\n\n// EIP-7702 delegation prefix (0xef0100)\nconst DELEGATION_PREFIX = '0xef0100' as const;\n\n/**\n * Parameters for checking if an account is delegated to the EIP-7702 implementation.\n */\nexport type IsValid7702ImplementationParameters = {\n /** The client to use for the query. */\n client: Client;\n /** The address to check for proper delegation. */\n accountAddress: Address;\n /** The SmartAccountsEnvironment containing contract addresses. */\n environment: SmartAccountsEnvironment;\n};\n\n/**\n * Extracts the delegated contract address from EIP-7702 delegation code.\n *\n * @param code - The code returned from getCode for a delegated account.\n * @returns The delegated contract address or null if not a valid delegation.\n */\nfunction extractDelegatedAddress(code: Hex | undefined): Address | null {\n if (code?.length !== 48) {\n // 0x (2 chars) + ef0100 (6 chars) + address (40 chars) = 48 chars\n return null;\n }\n\n if (!code.toLowerCase().startsWith(DELEGATION_PREFIX.toLowerCase())) {\n return null;\n }\n\n // Extract the 20-byte address after the delegation prefix\n const addressHex = code.slice(8); // Remove '0xef0100' prefix (8 chars)\n return `0x${addressHex}`;\n}\n\n/**\n * Checks if an account is properly delegated to the EIP-7702 implementation.\n *\n * This function validates EIP-7702 delegations by checking if the EOA has a 7702\n * contract assigned to it and comparing the delegated address against the 7702\n * implementation found in the environment.\n *\n * @param params - The parameters for checking the delegation.\n * @param params.client - The client to use for the query.\n * @param params.accountAddress - The address to check for proper delegation.\n * @param params.environment - The SmartAccountsEnvironment containing contract addresses.\n * @returns A promise that resolves to true if the account is properly delegated to the 7702 implementation, false otherwise.\n * @example\n * ```typescript\n * const isValid = await isValid7702Implementation({\n * client: publicClient,\n * accountAddress: '0x...',\n * environment: smartAccountEnvironment,\n * });\n *\n * if (isValid) {\n * console.log('Account is properly delegated to EIP-7702 implementation');\n * } else {\n * console.log('Account is not properly delegated');\n * }\n * ```\n */\nexport async function isValid7702Implementation({\n client,\n accountAddress,\n environment,\n}: IsValid7702ImplementationParameters): Promise<boolean> {\n try {\n // Get the code at the account address\n const code = await getCode(client, {\n address: accountAddress,\n });\n\n // Extract the delegated contract address from the EIP-7702 delegation code\n const delegatedAddress = extractDelegatedAddress(code);\n\n // If no valid delegation found, return false\n if (!delegatedAddress) {\n return false;\n }\n\n // Compare the delegated address with the 7702 implementation in the environment\n const expectedImplementation =\n environment.implementations.EIP7702StatelessDeleGatorImpl;\n if (!expectedImplementation) {\n return false;\n }\n\n return isAddressEqual(delegatedAddress, expectedImplementation);\n } catch {\n // If the call fails (e.g., no code at address, network error),\n // then it's not properly delegated to our implementation\n return false;\n }\n}\n","import type {\n Account,\n Address,\n Chain,\n Client,\n Hex,\n Transport,\n WalletClient,\n} from 'viem';\nimport { BaseError } from 'viem';\nimport { parseAccount } from 'viem/accounts';\n\nimport { prepareSignDelegationTypedData } from '../delegation';\nimport type { Delegation } from '../types';\n\nexport type SignDelegationParameters = {\n /** Account to sign with */\n account?: Account | Address;\n /** The delegation to sign */\n delegation: Omit<Delegation, 'signature'>;\n /** The address of the delegation manager contract */\n delegationManager: Address;\n /** The chain ID for the signature */\n chainId: number;\n /** The name of the contract */\n name?: string;\n /** The version of the contract */\n version?: string;\n /** Whether to allow insecure unrestricted delegation */\n allowInsecureUnrestrictedDelegation?: boolean;\n};\n\nexport type SignDelegationReturnType = Hex;\n\n/**\n * Signs a delegation using a wallet client.\n *\n * @param client - The wallet client to use for signing.\n * @param parameters - The parameters for signing the delegation.\n * @returns The signature of the delegation.\n * @example\n * ```ts\n * const signature = await signDelegation(walletClient, {\n * delegation: {\n * delegate: '0x...',\n * delegator: '0x...',\n * authority: '0x...',\n * caveats: [],\n * salt: '0x'\n * },\n * delegationManager: '0x...',\n * chainId: 1\n * });\n * ```\n */\nexport async function signDelegation<\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n>(\n client: Client<Transport, TChain, TAccount> & {\n signTypedData: WalletClient['signTypedData'];\n },\n parameters: SignDelegationParameters,\n): Promise<SignDelegationReturnType> {\n const {\n account: accountParam = client.account,\n delegation,\n delegationManager,\n chainId,\n name = 'DelegationManager',\n version = '1',\n allowInsecureUnrestrictedDelegation = false,\n } = parameters;\n\n if (!accountParam) {\n throw new BaseError('Account not found. Please provide an account.');\n }\n\n const account = parseAccount(accountParam);\n\n const typedData = prepareSignDelegationTypedData({\n delegation,\n delegationManager,\n chainId,\n name,\n version,\n allowInsecureUnrestrictedDelegation,\n });\n\n return client.signTypedData({\n account,\n ...typedData,\n });\n}\n\n/**\n * Creates a sign delegation action that can be used to extend a wallet client.\n *\n * @returns A function that can be used with wallet client extend method.\n * @example\n * ```ts\n * const walletClient = createWalletClient({\n * chain: mainnet,\n * transport: http()\n * }).extend(signDelegationActions());\n * ```\n */\nexport function signDelegationActions() {\n return <\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n >(\n client: Client<Transport, TChain, TAccount> & {\n signTypedData: WalletClient['signTypedData'];\n },\n ) => ({\n signDelegation: async (\n parameters: Omit<SignDelegationParameters, 'chainId'> & {\n chainId?: number;\n },\n ) =>\n signDelegation(client, {\n chainId:\n parameters.chainId ??\n (() => {\n if (!client.chain?.id) {\n throw new BaseError(\n 'Chain ID is required. Either provide it in parameters or configure the client with a chain.',\n );\n }\n return client.chain.id;\n })(),\n ...parameters,\n }),\n });\n}\n","import type {\n Account,\n Address,\n Chain,\n Client,\n Hex,\n Transport,\n WalletClient,\n} from 'viem';\nimport { BaseError } from 'viem';\nimport { parseAccount } from 'viem/accounts';\n\nimport { prepareSignUserOperationTypedData } from '../userOp';\nimport type { UserOperationV07 } from '../userOp';\n\nexport type SignUserOperationParameters = {\n /** Account to sign with */\n account?: Account | Address;\n /** The user operation to sign */\n userOperation: Omit<UserOperationV07, 'signature'>;\n /** The entry point contract address */\n entryPoint: { address: Address };\n /** The chain ID that the entry point is deployed on */\n chainId: number;\n /** The address of the smart account */\n address: Address;\n /** The name of the domain of the implementation contract */\n name: 'HybridDeleGator' | 'MultiSigDeleGator';\n /** The version of the domain of the implementation contract */\n version?: string;\n};\n\nexport type SignUserOperationReturnType = Hex;\n\n/**\n * Signs a user operation using a wallet client.\n *\n * @param client - The wallet client to use for signing.\n * @param parameters - The parameters for signing the user operation.\n * @returns The signature of the user operation.\n * @example\n * ```ts\n * const signature = await signUserOperation(walletClient, {\n * userOperation: {\n * sender: '0x...',\n * nonce: 0n,\n * callData: '0x',\n * callGasLimit: 1000000n,\n * verificationGasLimit: 1000000n,\n * preVerificationGas: 21000n,\n * maxFeePerGas: 1000000000n,\n * maxPriorityFeePerGas: 1000000000n\n * },\n * entryPoint: { address: '0x...' },\n * chainId: 1,\n * address: '0x...',\n * name: 'HybridDeleGator'\n * });\n * ```\n */\nexport async function signUserOperation<\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n>(\n client: Client<Transport, TChain, TAccount> & {\n signTypedData: WalletClient['signTypedData'];\n },\n parameters: SignUserOperationParameters,\n): Promise<SignUserOperationReturnType> {\n const {\n account: accountParam = client.account,\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version = '1',\n } = parameters;\n\n if (!accountParam) {\n throw new BaseError('Account not found. Please provide an account.');\n }\n\n const account = parseAccount(accountParam);\n\n const typedData = prepareSignUserOperationTypedData({\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version,\n });\n\n return client.signTypedData({\n account,\n ...typedData,\n });\n}\n\n/**\n * Creates a sign user operation action that can be used to extend a wallet client.\n *\n * @returns A function that can be used with wallet client extend method.\n * @example\n * ```ts\n * const walletClient = createWalletClient({\n * chain: mainnet,\n * transport: http()\n * }).extend(signUserOperationActions());\n * ```\n */\nexport function signUserOperationActions() {\n return <\n TChain extends Chain | undefined,\n TAccount extends Account | undefined,\n >(\n client: Client<Transport, TChain, TAccount> & {\n signTypedData: WalletClient['signTypedData'];\n },\n ) => ({\n signUserOperation: async (\n parameters: Omit<SignUserOperationParameters, 'chainId'> & {\n chainId?: number;\n },\n ) =>\n signUserOperation(client, {\n chainId:\n parameters.chainId ??\n (() => {\n if (!client.chain?.id) {\n throw new BaseError(\n 'Chain ID is required. Either provide it in parameters or configure the client with a chain.',\n );\n }\n return client.chain.id;\n })(),\n ...parameters,\n }),\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/executions.ts"],"sourcesContent":["import {\n type Address,\n type Hex,\n encodeAbiParameters,\n encodePacked,\n} from 'viem';\n\nexport type ExecutionStruct = {\n target: Address;\n value: bigint;\n callData: Hex;\n};\n\nexport type CreateExecutionArgs = {\n target: Address;\n value?: bigint;\n callData?: Hex;\n};\n\n/**\n * Creates an execution data structure.\n *\n * @param args - The arguments for creating an execution.\n * @param args.target - The address to invoke some calldata on.\n * @param args.value - ETH to send to the address.\n * @param args.callData - The calldata to invoke on the address.\n * @returns The created execution data structure.\n */\nexport const createExecution = ({\n target,\n value = 0n,\n callData = '0x',\n}: CreateExecutionArgs): ExecutionStruct => ({\n target,\n value,\n callData,\n});\n\n// Encoded modes\n// https://github.com/erc7579/erc7579-implementation/blob/main/src/lib/ModeLib.sol\nexport enum ExecutionMode {\n SingleDefault = '0x0000000000000000000000000000000000000000000000000000000000000000',\n SingleTry = '0x0001000000000000000000000000000000000000000000000000000000000000',\n BatchDefault = '0x0100000000000000000000000000000000000000000000000000000000000000',\n BatchTry = '0x0101000000000000000000000000000000000000000000000000000000000000',\n}\n\n/**\n * The ABI type components of an Execution.\n */\nexport const EXECUTION_ABI_TYPE_COMPONENTS = [\n { type: 'address', name: 'target' },\n { type: 'uint256', name: 'value' },\n { type: 'bytes', name: 'callData' },\n];\n\n/**\n * Encodes a single Execution. Used for executing a single Execution in a DeleGator SCA.\n *\n * @param execution - The execution to encode.\n * @returns The encoded execution.\n */\nexport const encodeSingleExecution = (execution: ExecutionStruct): Hex => {\n return encodePacked(\n ['address', 'uint256', 'bytes'],\n [execution.target, execution.value, execution.callData],\n );\n};\n\n/**\n * Encodes a batch of Executions. Used for executing a batch of Executions in a DeleGator SCA.\n *\n * @param executions - The executions to encode.\n * @returns The encoded executions.\n */\nexport const encodeBatchExecution = (executions: ExecutionStruct[]): Hex => {\n return encodeAbiParameters(\n [\n {\n components: EXECUTION_ABI_TYPE_COMPONENTS,\n name: 'executions',\n type: 'tuple[]',\n },\n ],\n [executions],\n );\n};\n\n/**\n * Encodes the calldata for interacting with the advanced `execute` DeleGator method.\n *\n * @param executions - The execution(s) to encode.\n * @returns The encoded execution(s).\n */\nexport const encodeExecutionCalldata = (executions: ExecutionStruct[]): Hex => {\n if (executions.length === 0) {\n throw new Error(\n 'Error while getting the execution calldatas, executions is empty',\n );\n }\n if (executions.length === 1) {\n const execution = executions[0];\n if (!execution) {\n throw new Error('Execution not found');\n }\n return encodeSingleExecution(execution);\n }\n\n return encodeBatchExecution(executions);\n};\n\n/**\n * Encodes the calldata for interacting with `redeemDelegations`.\n *\n * @param executionsBatch - The executions to encode.\n * @returns The encoded executions.\n */\nexport const encodeExecutionCalldatas = (\n executionsBatch: ExecutionStruct[][],\n): Hex[] => {\n if (executionsBatch.length === 0) {\n throw new Error(\n 'Error while getting the execution calldatas, executionsBatch is empty',\n );\n }\n return executionsBatch.map(encodeExecutionCalldata);\n};\n"],"mappings":";AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAuBA,IAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA,QAAQ;AAAA,EACR,WAAW;AACb,OAA6C;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AACF;AAIO,IAAK,gBAAL,kBAAKA,mBAAL;AACL,EAAAA,eAAA,mBAAgB;AAChB,EAAAA,eAAA,eAAY;AACZ,EAAAA,eAAA,kBAAe;AACf,EAAAA,eAAA,cAAW;AAJD,SAAAA;AAAA,GAAA;AAUL,IAAM,gCAAgC;AAAA,EAC3C,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,EAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,EACjC,EAAE,MAAM,SAAS,MAAM,WAAW;AACpC;AAQO,IAAM,wBAAwB,CAAC,cAAoC;AACxE,SAAO;AAAA,IACL,CAAC,WAAW,WAAW,OAAO;AAAA,IAC9B,CAAC,UAAU,QAAQ,UAAU,OAAO,UAAU,QAAQ;AAAA,EACxD;AACF;AAQO,IAAM,uBAAuB,CAAC,eAAuC;AAC1E,SAAO;AAAA,IACL;AAAA,MACE;AAAA,QACE,YAAY;AAAA,QACZ,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,CAAC,UAAU;AAAA,EACb;AACF;AAQO,IAAM,0BAA0B,CAAC,eAAuC;AAC7E,MAAI,WAAW,WAAW,GAAG;AAC3B,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,MAAI,WAAW,WAAW,GAAG;AAC3B,UAAM,YAAY,WAAW,CAAC;AAC9B,QAAI,CAAC,WAAW;AACd,YAAM,IAAI,MAAM,qBAAqB;AAAA,IACvC;AACA,WAAO,sBAAsB,SAAS;AAAA,EACxC;AAEA,SAAO,qBAAqB,UAAU;AACxC;AAQO,IAAM,2BAA2B,CACtC,oBACU;AACV,MAAI,gBAAgB,WAAW,GAAG;AAChC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO,gBAAgB,IAAI,uBAAuB;AACpD;","names":["ExecutionMode"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-VLKX4BR6.cjs","../src/executions.ts"],"names":["ExecutionMode"],"mappings":"AAAA;ACAA;AAGE;AACA;AAAA,4BACK;AAuBA,IAAM,gBAAA,EAAkB,CAAC;AAAA,EAC9B,MAAA;AAAA,EACA,MAAA,EAAQ,EAAA;AAAA,EACR,SAAA,EAAW;AACb,CAAA,EAAA,GAAA,CAA6C;AAAA,EAC3C,MAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,CAAA;AAIO,IAAK,cAAA,kBAAL,CAAA,CAAKA,cAAAA,EAAAA,GAAL;AACL,EAAAA,cAAAA,CAAA,eAAA,EAAA,EAAgB,oEAAA;AAChB,EAAAA,cAAAA,CAAA,WAAA,EAAA,EAAY,oEAAA;AACZ,EAAAA,cAAAA,CAAA,cAAA,EAAA,EAAe,oEAAA;AACf,EAAAA,cAAAA,CAAA,UAAA,EAAA,EAAW,oEAAA;AAJD,EAAA,OAAAA,cAAAA;AAAA,CAAA,CAAA,CAAA,cAAA,GAAA,CAAA,CAAA,CAAA;AAUL,IAAM,8BAAA,EAAgC;AAAA,EAC3C,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,SAAS,CAAA;AAAA,EAClC,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,QAAQ,CAAA;AAAA,EACjC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,WAAW;AACpC,CAAA;AAQO,IAAM,sBAAA,EAAwB,CAAC,SA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;AD3DA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,qTAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-VLKX4BR6.cjs","sourcesContent":[null,"import {\n type Address,\n type Hex,\n encodeAbiParameters,\n encodePacked,\n} from 'viem';\n\nexport type ExecutionStruct = {\n target: Address;\n value: bigint;\n callData: Hex;\n};\n\nexport type CreateExecutionArgs = {\n target: Address;\n value?: bigint;\n callData?: Hex;\n};\n\n/**\n * Creates an execution data structure.\n *\n * @param args - The arguments for creating an execution.\n * @param args.target - The address to invoke some calldata on.\n * @param args.value - ETH to send to the address.\n * @param args.callData - The calldata to invoke on the address.\n * @returns The created execution data structure.\n */\nexport const createExecution = ({\n target,\n value = 0n,\n callData = '0x',\n}: CreateExecutionArgs): ExecutionStruct => ({\n target,\n value,\n callData,\n});\n\n// Encoded modes\n// https://github.com/erc7579/erc7579-implementation/blob/main/src/lib/ModeLib.sol\nexport enum ExecutionMode {\n SingleDefault = '0x0000000000000000000000000000000000000000000000000000000000000000',\n SingleTry = '0x0001000000000000000000000000000000000000000000000000000000000000',\n BatchDefault = '0x0100000000000000000000000000000000000000000000000000000000000000',\n BatchTry = '0x0101000000000000000000000000000000000000000000000000000000000000',\n}\n\n/**\n * The ABI type components of an Execution.\n */\nexport const EXECUTION_ABI_TYPE_COMPONENTS = [\n { type: 'address', name: 'target' },\n { type: 'uint256', name: 'value' },\n { type: 'bytes', name: 'callData' },\n];\n\n/**\n * Encodes a single Execution. Used for executing a single Execution in a DeleGator SCA.\n *\n * @param execution - The execution to encode.\n * @returns The encoded execution.\n */\nexport const encodeSingleExecution = (execution: ExecutionStruct): Hex => {\n return encodePacked(\n ['address', 'uint256', 'bytes'],\n [execution.target, execution.value, execution.callData],\n );\n};\n\n/**\n * Encodes a batch of Executions. Used for executing a batch of Executions in a DeleGator SCA.\n *\n * @param executions - The executions to encode.\n * @returns The encoded executions.\n */\nexport const encodeBatchExecution = (executions: ExecutionStruct[]): Hex => {\n return encodeAbiParameters(\n [\n {\n components: EXECUTION_ABI_TYPE_COMPONENTS,\n name: 'executions',\n type: 'tuple[]',\n },\n ],\n [executions],\n );\n};\n\n/**\n * Encodes the calldata for interacting with the advanced `execute` DeleGator method.\n *\n * @param executions - The execution(s) to encode.\n * @returns The encoded execution(s).\n */\nexport const encodeExecutionCalldata = (executions: ExecutionStruct[]): Hex => {\n if (executions.length === 0) {\n throw new Error(\n 'Error while getting the execution calldatas, executions is empty',\n );\n }\n if (executions.length === 1) {\n const execution = executions[0];\n if (!execution) {\n throw new Error('Execution not found');\n }\n return encodeSingleExecution(execution);\n }\n\n return encodeBatchExecution(executions);\n};\n\n/**\n * Encodes the calldata for interacting with `redeemDelegations`.\n *\n * @param executionsBatch - The executions to encode.\n * @returns The encoded executions.\n */\nexport const encodeExecutionCalldatas = (\n executionsBatch: ExecutionStruct[][],\n): Hex[] => {\n if (executionsBatch.length === 0) {\n throw new Error(\n 'Error while getting the execution calldatas, executionsBatch is empty',\n );\n }\n return executionsBatch.map(encodeExecutionCalldata);\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-XN36L4RX.cjs","../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"],"names":["encode_exports","read_exports","encode","simulate","execute","simulateContract","DelegationManager","writeContract","encodeFunctionData","read","readContract","execute_exports","simulate_exports","ERC20TransferAmountEnforcer","constants_exports","HybridDeleGator","DOMAIN_VERSION","NAME","VERSION","IdEnforcer","LimitedCallsEnforcer","MultiSigDeleGator","NativeTokenTransferAmountEnforcer","NonceEnforcer","Ownable2Step","SpecificActionERC20TransferBatchEnforcer"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACpDA,IAAA,kBAAA,EAAA,CAAA,CAAA;AAAA,wCAAA,iBAAA,EAAA;AAAA,EAAA,aAAA,EAAA,CAAA,EAAA,GAAA,qBAAA;AAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,GAAA,yBAAA;AAAA,EAAA,MAAA,EAAA,CAAA,EAAA,GAAA,cAAA;AAAA,EAAA,2BAAA,EAAA,CAAA,EAAA,GAAA,qDAAA;AAAA,EAAA,sBAAA,EAAA,CAAA,EAAA,GAAA,gDAAA;AAAA,EAAA,2BAAA,EAAA,CAAA,EAAA,GAAA,mCA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;AAAA,EAAA,eAAA,EAAA,CAAA,EAAA,GAAAA;AAAA,CAAA,CAAA;AzFkvCA;AACA;A0FnvCA;AAEA;AAgBO,IAAMA,OAAAA,EAAO,MAAA,CAAO;AAAA,EACzB,MAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAA,EAAA,GAAsD;AACpD,EAAA,MAAM,UAAA,EAAY,MAAMC,mCAAAA,MAAa,EAAQ;AAAA,IAC3C,OAAA,EAAS,eAAA;AAAA,IACT,GAAA,EAAK,wDAAA;AAAA,IACL,YAAA,EAAc,cAAA;AAAA,IACd,IAAA,EAAM,CAAC,KAAK;AAAA,EACd,CAAC,CAAA;AAED,EAAA,OAAO,SAAA;AACT,CAAA;A1FouCA;AACA;A2FpwCA;AAEA;AASO,IAAMD,OAAAA,EAAO,MAAA,CAAO;AAAA,EACzB,MAAA;AAAA,EACA,eAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAA,EAAA,GAAuD;AACrD,EAAA,MAAM,OAAA,EAAS,MAAMC,mCAAAA,MAAa,EAAQ;AAAA,IACxC,OAAA,EAAS,eAAA;AAAA,IACT,GAAA,EAAKe,wDAAAA;AAAA,IACL,YAAA,EAAc,iBAAA;AAAA,IACd,IAAA,EAAM,CAAC,iBAAA,EAAmB,cAAc;AAAA,EAC1C,CAAC,CAAA;AAED,EAAA,OAAO,MAAA;AACT,CAAA;A3F4vCA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,m/BAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-XN36L4RX.cjs","sourcesContent":[null,"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"]}
|