@metamask/smart-accounts-kit 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -25
- package/dist/actions/index.cjs +5 -6
- package/dist/actions/index.cjs.map +1 -1
- package/dist/actions/index.d.cts +3 -3
- package/dist/actions/index.d.ts +3 -3
- package/dist/actions/index.mjs +4 -5
- package/dist/{caveats-DQ6HoAHe.d.ts → caveats-B2OssjV4.d.ts} +1 -2
- package/dist/{caveats-CaSt_VHs.d.cts → caveats-gqMBZKkI.d.cts} +1 -2
- package/dist/{chunk-SOFB2MXG.cjs → chunk-2OS36DVV.cjs} +8 -1
- package/dist/chunk-2OS36DVV.cjs.map +1 -0
- package/dist/{chunk-XEOE25DE.cjs → chunk-2ZOWIAP3.cjs} +98 -68
- package/dist/chunk-2ZOWIAP3.cjs.map +1 -0
- package/dist/{chunk-BGOSYTKV.mjs → chunk-AZYTTGON.mjs} +38 -8
- package/dist/chunk-AZYTTGON.mjs.map +1 -0
- package/dist/{chunk-SCS3CFRE.cjs → chunk-DCI2AN4N.cjs} +15 -17
- package/dist/chunk-DCI2AN4N.cjs.map +1 -0
- package/dist/{chunk-DN4O5VOP.cjs → chunk-EPU4O7FY.cjs} +158 -151
- package/dist/chunk-EPU4O7FY.cjs.map +1 -0
- package/dist/{chunk-QCULIK3O.mjs → chunk-GMGJRC3D.mjs} +8 -1
- package/dist/chunk-GMGJRC3D.mjs.map +1 -0
- package/dist/chunk-IMO6XNDJ.mjs +14 -0
- package/dist/chunk-IMO6XNDJ.mjs.map +1 -0
- package/dist/chunk-IQT6XFDT.cjs +14 -0
- package/dist/chunk-IQT6XFDT.cjs.map +1 -0
- package/dist/{chunk-FH6HZCHI.cjs → chunk-JKVSTPEC.cjs} +200 -18
- package/dist/chunk-JKVSTPEC.cjs.map +1 -0
- package/dist/{chunk-N66VAWMO.mjs → chunk-K7GTZGKJ.mjs} +2 -2
- package/dist/{chunk-TBHT26BV.mjs → chunk-L3EZCIY6.mjs} +67 -60
- package/dist/chunk-L3EZCIY6.mjs.map +1 -0
- package/dist/{chunk-7FYDQNJ3.cjs → chunk-PQPAEHJZ.cjs} +12 -12
- package/dist/{chunk-7FYDQNJ3.cjs.map → chunk-PQPAEHJZ.cjs.map} +1 -1
- package/dist/{chunk-MV2KHN75.mjs → chunk-TNGQTVSY.mjs} +163 -35
- package/dist/chunk-TNGQTVSY.mjs.map +1 -0
- package/dist/{chunk-YXHUT56Z.mjs → chunk-UJQ3JN3U.mjs} +4 -6
- package/dist/{chunk-YXHUT56Z.mjs.map → chunk-UJQ3JN3U.mjs.map} +1 -1
- package/dist/{chunk-IBZSNB7D.cjs → chunk-W6HPAK4M.cjs} +202 -74
- package/dist/chunk-W6HPAK4M.cjs.map +1 -0
- package/dist/{chunk-W7O2UQL5.mjs → chunk-YVU66KSH.mjs} +188 -6
- package/dist/chunk-YVU66KSH.mjs.map +1 -0
- package/dist/contracts/index.cjs +5 -6
- package/dist/contracts/index.cjs.map +1 -1
- package/dist/contracts/index.d.cts +4 -4
- package/dist/contracts/index.d.ts +4 -4
- package/dist/contracts/index.mjs +4 -5
- package/dist/{delegation-DbPGWKfP.d.ts → decodeRevertReason-CmmCpmZ_.d.cts} +11 -3
- package/dist/{delegation-BKkEyxZY.d.cts → decodeRevertReason-dOTpJx2h.d.ts} +11 -3
- package/dist/experimental/index.cjs +364 -9
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/index.d.cts +39 -3
- package/dist/experimental/index.d.ts +39 -3
- package/dist/experimental/index.mjs +357 -2
- package/dist/experimental/index.mjs.map +1 -1
- package/dist/index-B1Cmezvh.d.cts +61 -0
- package/dist/{index-DXdlz7t4.d.ts → index-BkgdU4LI.d.ts} +99 -93
- package/dist/{index-G78z6nwi.d.ts → index-DUJmm8Wz.d.ts} +13 -5
- package/dist/{index-yU3olCJV.d.cts → index-Dv4jPzhe.d.cts} +99 -93
- package/dist/index-LqiEgBjV.d.ts +61 -0
- package/dist/{index-DfDAuvr5.d.cts → index-X7Qn3JTg.d.cts} +13 -5
- package/dist/index.cjs +22 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.mjs +9 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{resolveCaveats-DiqGB-T5.d.cts → resolveCaveats-A9xC29l8.d.cts} +160 -62
- package/dist/{resolveCaveats-s2snaFEo.d.ts → resolveCaveats-A9xC29l8.d.ts} +160 -62
- package/dist/utils/index.cjs +13 -6
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +8 -5
- package/dist/utils/index.d.ts +8 -5
- package/dist/utils/index.mjs +16 -9
- package/package.json +7 -6
- package/dist/chunk-4QXIOE7F.mjs +0 -79
- package/dist/chunk-4QXIOE7F.mjs.map +0 -1
- package/dist/chunk-BGOSYTKV.mjs.map +0 -1
- package/dist/chunk-DN4O5VOP.cjs.map +0 -1
- package/dist/chunk-FH6HZCHI.cjs.map +0 -1
- package/dist/chunk-IBZSNB7D.cjs.map +0 -1
- package/dist/chunk-MOHCTPYQ.cjs +0 -79
- package/dist/chunk-MOHCTPYQ.cjs.map +0 -1
- package/dist/chunk-MV2KHN75.mjs.map +0 -1
- package/dist/chunk-QCULIK3O.mjs.map +0 -1
- package/dist/chunk-SCS3CFRE.cjs.map +0 -1
- package/dist/chunk-SOFB2MXG.cjs.map +0 -1
- package/dist/chunk-TBHT26BV.mjs.map +0 -1
- package/dist/chunk-W7O2UQL5.mjs.map +0 -1
- package/dist/chunk-XEOE25DE.cjs.map +0 -1
- package/dist/types-BWaH4KH1.d.cts +0 -155
- package/dist/types-BWaH4KH1.d.ts +0 -155
- /package/dist/{chunk-N66VAWMO.mjs.map → chunk-K7GTZGKJ.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/counterfactualAccountData.ts","../src/encodeCalls.ts","../src/webAuthn.ts"],"sourcesContent":["import type { Address, Hex } from 'viem';\nimport { getContractAddress, pad } from 'viem';\n\nimport { Implementation } from './constants';\nimport { initializeHybridDeleGator } from './DelegationFramework/HybridDeleGator/encode';\nimport { initializeMultiSigDeleGator } from './DelegationFramework/MultiSigDeleGator/encode';\nimport { create2Deploy as encodeCreate2Deploy } from './DelegationFramework/SimpleFactory/encode';\nimport { encodeProxyCreationCode } from './DelegationFramework/utils';\nimport type {\n SmartAccountsEnvironment,\n HybridDeleGatorDeployParams,\n MultiSigDeleGatorDeployParams,\n DeployParams,\n} from './types';\n\n/**\n * Infers counterfactual account data for a DeleGator smart account.\n *\n * @template TImplementation - The type of implementation, extending Implementation.\n * @template TDeployParams - The type of deployment parameters, defaults to DeployParams<Implementation>.\n * @param options - The options for generating counterfactual account data.\n * @param options.factory - The address of the SimpleFactory contract.\n * @param options.implementations - The DeleGator implementation contracts.\n * @param options.implementation - The implementation type to use.\n * @param options.deployParams - The deployment parameters for the specified implementation.\n * @param options.deploySalt - The salt to use for CREATE2 address computation.\n * @returns An object containing the counterfactual address and factory calldata.\n * @description This function calculates the address a DeleGator contract would have if deployed,\n * and provides the calldata needed to deploy it.\n */\nexport const getCounterfactualAccountData = async <\n TImplementation extends Implementation,\n>({\n factory,\n implementations,\n implementation,\n deployParams,\n deploySalt,\n}: {\n factory: Address;\n implementations: SmartAccountsEnvironment['implementations'];\n implementation: TImplementation;\n deployParams: DeployParams<TImplementation>;\n deploySalt: Hex;\n}): Promise<{ factoryData: Hex; address: Address }> => {\n let implementationAddress: Address;\n let initcode: Hex;\n\n switch (implementation) {\n case Implementation.Hybrid: {\n const [owner, keyIds, xValues, yValues] =\n deployParams as HybridDeleGatorDeployParams;\n\n if (!implementations.HybridDeleGatorImpl) {\n throw new Error(\n 'HybridDeleGatorImpl address not provided in environment',\n );\n }\n\n implementationAddress = implementations.HybridDeleGatorImpl;\n\n const p256Owners = keyIds.map((keyId, index) => {\n const xValue = xValues[index];\n const yValue = yValues[index];\n\n if (!xValue || !yValue) {\n throw new Error(\n `Missing X or Y value for keyId ${keyId} at index ${index}`,\n );\n }\n\n return {\n keyId,\n x: xValue,\n y: yValue,\n };\n });\n\n initcode = initializeHybridDeleGator({ eoaOwner: owner, p256Owners });\n break;\n }\n case Implementation.MultiSig: {\n const [owners, threshold] = deployParams as MultiSigDeleGatorDeployParams;\n\n if (!implementations.MultiSigDeleGatorImpl) {\n throw new Error(\n 'MultiSigDeleGatorImpl address not provided in environment',\n );\n }\n\n implementationAddress = implementations.MultiSigDeleGatorImpl;\n initcode = initializeMultiSigDeleGator({ owners, threshold });\n break;\n }\n case Implementation.Stateless7702:\n default:\n throw new Error(`Implementation type '${implementation}' not supported`);\n }\n\n const salt = pad(deploySalt, { dir: 'left', size: 32 });\n\n const proxyCreationCode = encodeProxyCreationCode({\n implementationAddress,\n initcode,\n });\n\n const address = getContractAddress({\n bytecode: proxyCreationCode,\n from: factory,\n opcode: 'CREATE2',\n salt,\n });\n\n const factoryData = encodeCreate2Deploy(proxyCreationCode, salt);\n\n return {\n factoryData,\n address,\n };\n};\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport { encodeFunctionData } from 'viem';\nimport type { Address, Hex } from 'viem';\n\nimport type { DelegatedCall } from './actions/erc7710RedeemDelegationAction';\nimport { encodeDelegations } from './delegation';\nimport {\n execute,\n executeWithMode,\n} from './DelegationFramework/DeleGatorCore/encode';\nimport {\n ExecutionMode,\n createExecution,\n encodeExecutionCalldatas,\n} from './executions';\nimport type { Call } from './types';\n\n/**\n * Checks if a call is a delegated call by checking for the presence of permissionContext and delegationManager.\n *\n * @param call - The call to check.\n * @returns True if the call is a delegated call, false otherwise.\n */\nconst isDelegatedCall = (call: Call): call is DelegatedCall => {\n return 'permissionContext' in call && 'delegationManager' in call;\n};\n\n/**\n * If there's a single call with permissionContext and delegationManager,\n * processes it as a delegated call.\n *\n * @param call - The call to process.\n * @returns The execution object for the delegated call.\n * @description\n * This function creates an execution that calls redeemDelegations on the delegation manager.\n */\nconst processDelegatedCall = (call: DelegatedCall) => {\n const {\n permissionContext,\n delegationManager,\n to: target,\n value,\n data: callData,\n } = call;\n\n const callAsExecution = createExecution({ target, value, callData });\n\n if (!permissionContext) {\n return callAsExecution;\n }\n\n const encodedPermissionsContext = encodeDelegations(permissionContext);\n\n const redeemCalldata = encodeFunctionData({\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [\n [encodedPermissionsContext],\n [ExecutionMode.SingleDefault],\n encodeExecutionCalldatas([[callAsExecution]]),\n ],\n });\n\n return createExecution({\n target: delegationManager,\n callData: redeemCalldata,\n });\n};\n\n/**\n * If there's a single call, encode the shorthand `execute` function. Otherwise, encode the `executeWithMode` function. Execution type will always be \"default\".\n *\n * @param calls - The calls to execute.\n * @returns The encoded calldata for the DeleGator to execute the calls.\n * @description\n * This function supports both single and batch execution modes.\n * For single calls, it uses the gas-efficient execute function.\n */\nexport const encodeCalls = (calls: readonly Call[]) => {\n if (calls.length === 1) {\n const call = calls[0];\n if (call && !isDelegatedCall(call)) {\n const { to: target, value, data: callData } = call;\n const execution = createExecution({ target, value, callData });\n return execute({ execution });\n }\n }\n\n const executions = calls.map((call) => {\n if (isDelegatedCall(call)) {\n return processDelegatedCall(call);\n }\n const { to: target, value, data: callData } = call;\n return createExecution({ target, value, callData });\n });\n\n const mode =\n calls.length === 1\n ? ExecutionMode.SingleDefault\n : ExecutionMode.BatchDefault;\n return executeWithMode({ mode, executions });\n};\n\n/**\n * Encodes calls for execution by a DeleGator smart contract.\n *\n * @param caller - The address of the DeleGator contract.\n * @param calls - An array of Call objects, each containing 'to', optional 'data', and optional 'value'.\n * @returns A promise that resolves to the encoded function data as a hexadecimal string.\n * @description\n * - If there's a single call directly to the delegator, it returns the call data directly.\n * - For multiple calls or calls to other addresses, it creates executions and encodes them for the DeleGator's execute function.\n * - The execution mode is set to ExecutionMode.SingleDefault for a single call, or ExecutionMode.BatchDefault for multiple calls.\n *\n * todo: This doesn't fully expose the flexibility of the DeleGator's execute function, but it's a start.\n * maybe we add a mechanism where individual calls passed to this function can be encoded batches.\n */\nexport const encodeCallsForCaller = async (\n caller: Address,\n calls: readonly Call[],\n): Promise<Hex> => {\n if (calls.length === 1) {\n const call = calls[0];\n if (call?.to === caller && !isDelegatedCall(call)) {\n // if there's a single call, and it's to the delegator, we can just return the calldata directly.\n return call.data ?? '0x';\n }\n }\n return encodeCalls(calls);\n};\n","import { Signature } from 'ox';\nimport {\n parseAbiParameters,\n encodeAbiParameters,\n type Hex,\n encodePacked,\n keccak256,\n concat,\n hexToBytes,\n} from 'viem';\n\nexport const FIELD_MODULUS =\n 115792089210356248762697446949407573529996955224135760342422259061068512044369n;\nexport const MALLEABILITY_THRESHOLD = FIELD_MODULUS / 2n;\n\nexport const SIGNATURE_ABI_PARAMS = parseAbiParameters(\n 'bytes32, uint256, uint256, bytes, bool, string, string, uint256',\n);\n\n/**\n * This function is used to convert the client data returned from the\n * credentials API into a format that can be consumed by the DeleGator\n * contracts. We need the flattend JSON strings before and after the\n * userOpHash/challenge. This function provides those two client data string\n * slices.\n *\n * @param clientDataJson - The client data JSON string.\n * @returns Returns [clientDataJSONPrefix and clientDataJSONSuffix]\n * ClientDataJSONPrefix contains the client data till the challengeHash\n * ClientDataJSONSuffix contains the client data after the challengeHash.\n */\nexport const splitOnChallenge = (\n clientDataJson: string,\n): [clientDataJSONPrefix: string, clientDataJSONSuffix: string] => {\n /*\n CientData looks like this:\n {\n \"type\": \"webauthn.create\" | \"webauthn.get\",\n \"challenge\": \"{userOpHash}\",\n \"origin\": \"{Domain}\",\n \"crossOrigin\": boolean\n }\n */\n try {\n const { challenge } = JSON.parse(clientDataJson);\n if (challenge === undefined) {\n throw new Error('No \"challenge\" found in the input string');\n }\n return clientDataJson.split(challenge) as [string, string];\n } catch (error) {\n throw new Error('No \"challenge\" found in the input string', {\n cause: error,\n });\n }\n};\n\n/**\n * Returns the index of '\"type\":' in the ClientData.\n *\n * @param clientDataJson - Stringified ClientDataJSON.\n * @returns The index of '\"type\":' in the ClientData.\n */\nexport const getResponseTypeLocation = (clientDataJson: string): bigint => {\n try {\n // Find the index of the `\"type\":` key in the JSON string directly\n const typeIndex = clientDataJson.indexOf('\"type\":');\n\n if (typeIndex === -1) {\n throw new Error('No \"type\" found in the input string');\n }\n // Return the index of the `\"type\":` key\n return BigInt(typeIndex);\n } catch (error) {\n // Handle any errors that occur during the search\n throw new Error('No \"type\" found in the input string', {\n cause: error,\n });\n }\n};\n\n/**\n * Encodes a signature to a hexadecimal signature that will be accepted\n * by the DeleGator contracts.\n *\n * @param keyId - The key used for the signature, represented as a hexadecimal string.\n * @param signature - The signature to convert, as Hex.\n * @param clientDataJSON - The client data used in the creation of the signature.\n * @param authenticatorData - The authenticator data used in the creation of the signature.\n * @returns The signature as a valid DeleGator signature encoded as Hexadecimal string.\n */\nexport function encodeDeleGatorSignature(\n keyId: string,\n signature: Hex,\n clientDataJSON: string,\n authenticatorData: Hex,\n): Hex {\n const keyIdHash = keccak256(encodePacked(['string'], [keyId]));\n\n const { r: rValue, s: sValue } = Signature.fromHex(signature);\n\n let normalizedS = sValue;\n\n while (normalizedS > MALLEABILITY_THRESHOLD) {\n normalizedS = FIELD_MODULUS - normalizedS;\n }\n\n const [clientDataComponent1, clientDataComponent2] =\n splitOnChallenge(clientDataJSON);\n\n const { userVerified } = parseAuthenticatorFlags(authenticatorData);\n\n const responseTypeLocation = getResponseTypeLocation(clientDataJSON);\n\n const encodedSignature = encodeAbiParameters(SIGNATURE_ABI_PARAMS, [\n keyIdHash,\n rValue,\n normalizedS,\n authenticatorData,\n userVerified,\n clientDataComponent1,\n clientDataComponent2,\n responseTypeLocation,\n ]);\n return encodedSignature;\n}\n\nconst AUTHENTICATOR_DATA_FLAGS_OFFSET = 32;\n// We have all of the flag bits defined here for completeness, even though we only extract the userVerified flag.\nenum AuthenticatorDataFlagBitIndex {\n UserPresence = 0,\n UserVerified = 2,\n BackupEligibility = 3,\n BackupState = 4,\n AttestedCredentialData = 6,\n ExtensionData = 7,\n}\n\nexport type AuthenticatorFlags = {\n userVerified: boolean;\n};\n\n/**\n * Parses the authenticator data and returns an authenticator flags object with the `userVerified` flag.\n * See https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/Authenticator_data.\n *\n * @param authenticatorData - The authenticator data to parse.\n * @returns An object representing the parsed authenticator flags.\n */\nexport function parseAuthenticatorFlags(\n authenticatorData: Hex,\n): AuthenticatorFlags {\n const authenticatorDataBuffer = hexToBytes(authenticatorData);\n const dataBufferUint8 = new Uint8Array(authenticatorDataBuffer);\n const flags = dataBufferUint8[AUTHENTICATOR_DATA_FLAGS_OFFSET];\n if (flags === undefined) {\n throw new Error('Authenticator flags not found in authenticator data');\n }\n\n // Bit 0 is the least significant bit in the flags byte, so we left shift 0b1 by the bit index\n // eslint-disable-next-line no-bitwise\n const bitMask = 0b1 << AuthenticatorDataFlagBitIndex.UserVerified;\n\n return {\n // eslint-disable-next-line no-bitwise\n userVerified: (flags & bitMask) !== 0x0,\n };\n}\n\n/**\n * Creates a dummy signature.\n * This must meet all early-failure conditions of the real signature, but does not need to be a valid signature.\n *\n * @param keyId - The key ID to use for the dummy signature.\n * @returns The encoded signature.\n */\nexport const createDummyWebAuthnSignature = (keyId: Hex) => {\n // https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/Authenticator_data#data_structure\n const rpIdHash = keccak256(encodePacked(['string'], ['AuthenticatorData']));\n const flags = '0x05';\n const signCount = '0x00000000';\n const authenticatorData = concat([rpIdHash, flags, signCount]);\n\n const keyIdHash = keccak256(encodePacked(['string'], [keyId]));\n const rs =\n 57896044605178124381348723474703786764998477612067880171211129530534256022184n;\n const userVerification = true;\n const clientDataPrefix = '{\"type\":\"webauthn.get\",\"challenge\":\"';\n const clientDataSuffix = '\",\"origin\":\"passkey-domain\",\"crossOrigin\":false}';\n const responseTypeLocation = 1n;\n\n const encodedSignature = encodeAbiParameters(SIGNATURE_ABI_PARAMS, [\n keyIdHash,\n rs,\n rs,\n authenticatorData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AY,UAAU,aAAa,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,CAAC;AAC7D,QAAM,KACJ;AACF,QAAM,mBAAmB;AACzB,QAAM,mBAAmB;AACzB,QAAM,mBAAmB;AACzB,QAAM,uBAAuB;AAE7B,QAAM,mBAAmB,oBAAoB,sBAAsB;AAAA,IACjE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":["encode","encode"]}
|
|
1
|
+
{"version":3,"sources":["../src/counterfactualAccountData.ts","../src/encodeCalls.ts","../src/webAuthn.ts"],"sourcesContent":["import type { Address, Hex } from 'viem';\nimport { getContractAddress, pad } from 'viem';\n\nimport { Implementation } from './constants';\nimport { initializeHybridDeleGator } from './DelegationFramework/HybridDeleGator/encode';\nimport { initializeMultiSigDeleGator } from './DelegationFramework/MultiSigDeleGator/encode';\nimport { create2Deploy as encodeCreate2Deploy } from './DelegationFramework/SimpleFactory/encode';\nimport { encodeProxyCreationCode } from './DelegationFramework/utils';\nimport type {\n SmartAccountsEnvironment,\n HybridDeleGatorDeployParams,\n MultiSigDeleGatorDeployParams,\n DeployParams,\n} from './types';\n\n/**\n * Infers counterfactual account data for a DeleGator smart account.\n *\n * @template TImplementation - The type of implementation, extending Implementation.\n * @template TDeployParams - The type of deployment parameters, defaults to DeployParams<Implementation>.\n * @param options - The options for generating counterfactual account data.\n * @param options.factory - The address of the SimpleFactory contract.\n * @param options.implementations - The DeleGator implementation contracts.\n * @param options.implementation - The implementation type to use.\n * @param options.deployParams - The deployment parameters for the specified implementation.\n * @param options.deploySalt - The salt to use for CREATE2 address computation.\n * @returns An object containing the counterfactual address and factory calldata.\n * @description This function calculates the address a DeleGator contract would have if deployed,\n * and provides the calldata needed to deploy it.\n */\nexport const getCounterfactualAccountData = async <\n TImplementation extends Implementation,\n>({\n factory,\n implementations,\n implementation,\n deployParams,\n deploySalt,\n}: {\n factory: Address;\n implementations: SmartAccountsEnvironment['implementations'];\n implementation: TImplementation;\n deployParams: DeployParams<TImplementation>;\n deploySalt: Hex;\n}): Promise<{ factoryData: Hex; address: Address }> => {\n let implementationAddress: Address;\n let initcode: Hex;\n\n switch (implementation) {\n case Implementation.Hybrid: {\n const [owner, keyIds, xValues, yValues] =\n deployParams as HybridDeleGatorDeployParams;\n\n if (!implementations.HybridDeleGatorImpl) {\n throw new Error(\n 'HybridDeleGatorImpl address not provided in environment',\n );\n }\n\n implementationAddress = implementations.HybridDeleGatorImpl;\n\n const p256Owners = keyIds.map((keyId, index) => {\n const xValue = xValues[index];\n const yValue = yValues[index];\n\n if (!xValue || !yValue) {\n throw new Error(\n `Missing X or Y value for keyId ${keyId} at index ${index}`,\n );\n }\n\n return {\n keyId,\n x: xValue,\n y: yValue,\n };\n });\n\n initcode = initializeHybridDeleGator({ eoaOwner: owner, p256Owners });\n break;\n }\n case Implementation.MultiSig: {\n const [owners, threshold] = deployParams as MultiSigDeleGatorDeployParams;\n\n if (!implementations.MultiSigDeleGatorImpl) {\n throw new Error(\n 'MultiSigDeleGatorImpl address not provided in environment',\n );\n }\n\n implementationAddress = implementations.MultiSigDeleGatorImpl;\n initcode = initializeMultiSigDeleGator({ owners, threshold });\n break;\n }\n case Implementation.Stateless7702:\n default:\n throw new Error(`Implementation type '${implementation}' not supported`);\n }\n\n const salt = pad(deploySalt, { dir: 'left', size: 32 });\n\n const proxyCreationCode = encodeProxyCreationCode({\n implementationAddress,\n initcode,\n });\n\n const address = getContractAddress({\n bytecode: proxyCreationCode,\n from: factory,\n opcode: 'CREATE2',\n salt,\n });\n\n const factoryData = encodeCreate2Deploy(proxyCreationCode, salt);\n\n return {\n factoryData,\n address,\n };\n};\n","import { DelegationManager } from '@metamask/delegation-abis';\nimport { encodeFunctionData } from 'viem';\nimport type { Address, Hex } from 'viem';\n\nimport type { DelegatedCall } from './actions/erc7710RedeemDelegationAction';\nimport { encodeDelegations } from './delegation';\nimport {\n execute,\n executeWithMode,\n} from './DelegationFramework/DeleGatorCore/encode';\nimport {\n ExecutionMode,\n createExecution,\n encodeExecutionCalldatas,\n} from './executions';\nimport type { Call } from './types';\n\n/**\n * Checks if a call is a delegated call by checking for the presence of permissionContext and delegationManager.\n *\n * @param call - The call to check.\n * @returns True if the call is a delegated call, false otherwise.\n */\nconst isDelegatedCall = (call: Call): call is DelegatedCall => {\n return 'permissionContext' in call && 'delegationManager' in call;\n};\n\n/**\n * If there's a single call with permissionContext and delegationManager,\n * processes it as a delegated call.\n *\n * @param call - The call to process.\n * @returns The execution object for the delegated call.\n * @description\n * This function creates an execution that calls redeemDelegations on the delegation manager.\n */\nconst processDelegatedCall = (call: DelegatedCall) => {\n const {\n permissionContext,\n delegationManager,\n to: target,\n value,\n data: callData,\n } = call;\n\n const callAsExecution = createExecution({ target, value, callData });\n\n if (!permissionContext) {\n return callAsExecution;\n }\n\n const encodedPermissionsContext = encodeDelegations(permissionContext);\n\n const redeemCalldata = encodeFunctionData({\n abi: DelegationManager,\n functionName: 'redeemDelegations',\n args: [\n [encodedPermissionsContext],\n [ExecutionMode.SingleDefault],\n encodeExecutionCalldatas([[callAsExecution]]),\n ],\n });\n\n return createExecution({\n target: delegationManager,\n callData: redeemCalldata,\n });\n};\n\n/**\n * If there's a single call, encode the shorthand `execute` function. Otherwise, encode the `executeWithMode` function. Execution type will always be \"default\".\n *\n * @param calls - The calls to execute.\n * @returns The encoded calldata for the DeleGator to execute the calls.\n * @description\n * This function supports both single and batch execution modes.\n * For single calls, it uses the gas-efficient execute function.\n */\nexport const encodeCalls = (calls: readonly Call[]) => {\n if (calls.length === 1) {\n const call = calls[0];\n if (call && !isDelegatedCall(call)) {\n const { to: target, value, data: callData } = call;\n const execution = createExecution({ target, value, callData });\n return execute({ execution });\n }\n }\n\n const executions = calls.map((call) => {\n if (isDelegatedCall(call)) {\n return processDelegatedCall(call);\n }\n const { to: target, value, data: callData } = call;\n return createExecution({ target, value, callData });\n });\n\n const mode =\n calls.length === 1\n ? ExecutionMode.SingleDefault\n : ExecutionMode.BatchDefault;\n return executeWithMode({ mode, executions });\n};\n\n/**\n * Encodes calls for execution by a DeleGator smart contract.\n *\n * @param caller - The address of the DeleGator contract.\n * @param calls - An array of Call objects, each containing 'to', optional 'data', and optional 'value'.\n * @returns A promise that resolves to the encoded function data as a hexadecimal string.\n * @description\n * - If there's a single call directly to the delegator, it returns the call data directly.\n * - For multiple calls or calls to other addresses, it creates executions and encodes them for the DeleGator's execute function.\n * - The execution mode is set to ExecutionMode.SingleDefault for a single call, or ExecutionMode.BatchDefault for multiple calls.\n *\n * todo: This doesn't fully expose the flexibility of the DeleGator's execute function, but it's a start.\n * maybe we add a mechanism where individual calls passed to this function can be encoded batches.\n */\nexport const encodeCallsForCaller = async (\n caller: Address,\n calls: readonly Call[],\n): Promise<Hex> => {\n if (calls.length === 1) {\n const call = calls[0];\n if (call?.to === caller && !isDelegatedCall(call)) {\n // if there's a single call, and it's to the delegator, we can just return the calldata directly.\n return call.data ?? '0x';\n }\n }\n return encodeCalls(calls);\n};\n","import { Signature } from 'ox';\nimport {\n parseAbiParameters,\n encodeAbiParameters,\n type Hex,\n encodePacked,\n keccak256,\n concat,\n hexToBytes,\n} from 'viem';\n\nexport const FIELD_MODULUS =\n 115792089210356248762697446949407573529996955224135760342422259061068512044369n;\nexport const MALLEABILITY_THRESHOLD = FIELD_MODULUS / 2n;\n\nexport const SIGNATURE_ABI_PARAMS = parseAbiParameters(\n 'bytes32, uint256, uint256, bytes, bool, string, string, uint256',\n);\n\n/**\n * This function is used to convert the client data returned from the\n * credentials API into a format that can be consumed by the DeleGator\n * contracts. We need the flattend JSON strings before and after the\n * userOpHash/challenge. This function provides those two client data string\n * slices.\n *\n * @param clientDataJson - The client data JSON string.\n * @returns Returns [clientDataJSONPrefix and clientDataJSONSuffix]\n * ClientDataJSONPrefix contains the client data till the challengeHash\n * ClientDataJSONSuffix contains the client data after the challengeHash.\n */\nexport const splitOnChallenge = (\n clientDataJson: string,\n): [clientDataJSONPrefix: string, clientDataJSONSuffix: string] => {\n /*\n CientData looks like this:\n {\n \"type\": \"webauthn.create\" | \"webauthn.get\",\n \"challenge\": \"{userOpHash}\",\n \"origin\": \"{Domain}\",\n \"crossOrigin\": boolean\n }\n */\n try {\n const { challenge } = JSON.parse(clientDataJson);\n if (challenge === undefined) {\n throw new Error('No \"challenge\" found in the input string');\n }\n return clientDataJson.split(challenge) as [string, string];\n } catch (error) {\n throw new Error('No \"challenge\" found in the input string', {\n cause: error,\n });\n }\n};\n\n/**\n * Returns the index of '\"type\":' in the ClientData.\n *\n * @param clientDataJson - Stringified ClientDataJSON.\n * @returns The index of '\"type\":' in the ClientData.\n */\nexport const getResponseTypeLocation = (clientDataJson: string): bigint => {\n try {\n // Find the index of the `\"type\":` key in the JSON string directly\n const typeIndex = clientDataJson.indexOf('\"type\":');\n\n if (typeIndex === -1) {\n throw new Error('No \"type\" found in the input string');\n }\n // Return the index of the `\"type\":` key\n return BigInt(typeIndex);\n } catch (error) {\n // Handle any errors that occur during the search\n throw new Error('No \"type\" found in the input string', {\n cause: error,\n });\n }\n};\n\n/**\n * Encodes a signature to a hexadecimal signature that will be accepted\n * by the DeleGator contracts.\n *\n * @param keyId - The key used for the signature, represented as a hexadecimal string.\n * @param signature - The signature to convert, as Hex.\n * @param clientDataJSON - The client data used in the creation of the signature.\n * @param authenticatorData - The authenticator data used in the creation of the signature.\n * @returns The signature as a valid DeleGator signature encoded as Hexadecimal string.\n */\nexport function encodeDeleGatorSignature(\n keyId: string,\n signature: Hex,\n clientDataJSON: string,\n authenticatorData: Hex,\n): Hex {\n const keyIdHash = keccak256(encodePacked(['string'], [keyId]));\n\n const { r: rValue, s: sValue } = Signature.fromHex(signature);\n\n let normalizedS = sValue;\n\n while (normalizedS > MALLEABILITY_THRESHOLD) {\n normalizedS = FIELD_MODULUS - normalizedS;\n }\n\n const [clientDataComponent1, clientDataComponent2] =\n splitOnChallenge(clientDataJSON);\n\n const { userVerified } = parseAuthenticatorFlags(authenticatorData);\n\n const responseTypeLocation = getResponseTypeLocation(clientDataJSON);\n\n const encodedSignature = encodeAbiParameters(SIGNATURE_ABI_PARAMS, [\n keyIdHash,\n rValue,\n normalizedS,\n authenticatorData,\n userVerified,\n clientDataComponent1,\n clientDataComponent2,\n responseTypeLocation,\n ]);\n return encodedSignature;\n}\n\nconst AUTHENTICATOR_DATA_FLAGS_OFFSET = 32;\n// We have all of the flag bits defined here for completeness, even though we only extract the userVerified flag.\nenum AuthenticatorDataFlagBitIndex {\n UserPresence = 0,\n UserVerified = 2,\n BackupEligibility = 3,\n BackupState = 4,\n AttestedCredentialData = 6,\n ExtensionData = 7,\n}\n\nexport type AuthenticatorFlags = {\n userVerified: boolean;\n};\n\n/**\n * Parses the authenticator data and returns an authenticator flags object with the `userVerified` flag.\n * See https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/Authenticator_data.\n *\n * @param authenticatorData - The authenticator data to parse.\n * @returns An object representing the parsed authenticator flags.\n */\nexport function parseAuthenticatorFlags(\n authenticatorData: Hex,\n): AuthenticatorFlags {\n const authenticatorDataBuffer = hexToBytes(authenticatorData);\n const dataBufferUint8 = new Uint8Array(authenticatorDataBuffer);\n const flags = dataBufferUint8[AUTHENTICATOR_DATA_FLAGS_OFFSET];\n if (flags === undefined) {\n throw new Error('Authenticator flags not found in authenticator data');\n }\n\n // Bit 0 is the least significant bit in the flags byte, so we left shift 0b1 by the bit index\n // eslint-disable-next-line no-bitwise\n const bitMask = 0b1 << AuthenticatorDataFlagBitIndex.UserVerified;\n\n return {\n // eslint-disable-next-line no-bitwise\n userVerified: (flags & bitMask) !== 0x0,\n };\n}\n\n/**\n * Creates a dummy signature.\n * This must meet all early-failure conditions of the real signature, but does not need to be a valid signature.\n *\n * @param keyId - The key ID to use for the dummy signature.\n * @returns The encoded signature.\n */\nexport const createDummyWebAuthnSignature = (keyId: Hex) => {\n // https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/Authenticator_data#data_structure\n const rpIdHash = keccak256(encodePacked(['string'], ['AuthenticatorData']));\n const flags = '0x05';\n const signCount = '0x00000000';\n const authenticatorData = concat([rpIdHash, flags, signCount]);\n\n const keyIdHash = keccak256(encodePacked(['string'], [keyId]));\n const rs =\n 57896044605178124381348723474703786764998477612067880171211129530534256022184n;\n const userVerification = true;\n const clientDataPrefix = '{\"type\":\"webauthn.get\",\"challenge\":\"';\n const clientDataSuffix = '\",\"origin\":\"passkey-domain\",\"crossOrigin\":false}';\n const responseTypeLocation = 1n;\n\n const encodedSignature = encodeAbiParameters(SIGNATURE_ABI_PARAMS, [\n keyIdHash,\n rs,\n rs,\n authenticatorData,\n userVerification,\n clientDataPrefix,\n clientDataSuffix,\n responseTypeLocation,\n ]);\n\n return encodedSignature;\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA,SAAS,oBAAoB,WAAW;AA6BjC,IAAM,+BAA+B,OAE1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMuD;AACrD,MAAI;AACJ,MAAI;AAEJ,UAAQ,gBAAgB;AAAA,IACtB,4BAA4B;AAC1B,YAAM,CAAC,OAAO,QAAQ,SAAS,OAAO,IACpC;AAEF,UAAI,CAAC,gBAAgB,qBAAqB;AACxC,cAAM,IAAI;AAAA,UACR;AAAA,QACF;AAAA,MACF;AAEA,8BAAwB,gBAAgB;AAExC,YAAM,aAAa,OAAO,IAAI,CAAC,OAAO,UAAU;AAC9C,cAAM,SAAS,QAAQ,KAAK;AAC5B,cAAM,SAAS,QAAQ,KAAK;AAE5B,YAAI,CAAC,UAAU,CAAC,QAAQ;AACtB,gBAAM,IAAI;AAAA,YACR,kCAAkC,KAAK,aAAa,KAAK;AAAA,UAC3D;AAAA,QACF;AAEA,eAAO;AAAA,UACL;AAAA,UACA,GAAG;AAAA,UACH,GAAG;AAAA,QACL;AAAA,MACF,CAAC;AAED,iBAAW,OAA0B,EAAE,UAAU,OAAO,WAAW,CAAC;AACpE;AA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M,QAAQ,gBAAgB,+BAA+B;AAC7D,MAAI,UAAU,QAAW;AACvB,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AAIA,QAAM,UAAU,KAAO;AAEvB,SAAO;AAAA;AAAA,IAEL,eAAe,QAAQ,aAAa;AAAA,EACtC;AACF;AASO,IAAM,+BAA+B,CAAC,UAAe;AAE1D,QAAM,WAAW,UAAU,aAAa,CAAC,QAAQ,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAC1E,QAAM,QAAQ;AACd,QAAM,YAAY;AAClB,QAAM,oBAAoB,OAAO,CAAC,UAAU,OAAO,SAAS,CAAC;AAE7D,QAAM,YAAY,UAAU,aAAa,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,CAAC;AAC7D,QAAM,KACJ;AACF,QAAM,mBAAmB;AACzB,QAAM,mBAAmB;AACzB,QAAM,mBAAmB;AACzB,QAAM,uBAAuB;AAE7B,QAAM,mBAAmB,oBAAoB,sBAAsB;AAAA,IACjE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":["encode","encode"]}
|
|
@@ -36,6 +36,7 @@ var ScopeType = /* @__PURE__ */ ((ScopeType2) => {
|
|
|
36
36
|
var CaveatType = /* @__PURE__ */ ((CaveatType2) => {
|
|
37
37
|
CaveatType2["AllowedMethods"] = "allowedMethods";
|
|
38
38
|
CaveatType2["AllowedTargets"] = "allowedTargets";
|
|
39
|
+
CaveatType2["ApprovalRevocation"] = "approvalRevocation";
|
|
39
40
|
CaveatType2["Deployed"] = "deployed";
|
|
40
41
|
CaveatType2["AllowedCalldata"] = "allowedCalldata";
|
|
41
42
|
CaveatType2["Erc20BalanceChange"] = "erc20BalanceChange";
|
|
@@ -228,6 +229,26 @@ var allowedTargetsBuilder = (environment, config) => {
|
|
|
228
229
|
};
|
|
229
230
|
};
|
|
230
231
|
|
|
232
|
+
// src/caveatBuilder/approvalRevocationBuilder.ts
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
var approvalRevocation = "approvalRevocation";
|
|
237
|
+
var approvalRevocationBuilder = (environment, config) => {
|
|
238
|
+
const terms = _delegationcore.createApprovalRevocationTerms.call(void 0, config);
|
|
239
|
+
const {
|
|
240
|
+
caveatEnforcers: { ApprovalRevocationEnforcer }
|
|
241
|
+
} = environment;
|
|
242
|
+
if (!ApprovalRevocationEnforcer) {
|
|
243
|
+
throw new Error("ApprovalRevocationEnforcer not found in environment");
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
enforcer: ApprovalRevocationEnforcer,
|
|
247
|
+
terms,
|
|
248
|
+
args: "0x00"
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
|
|
231
252
|
// src/caveatBuilder/argsEqualityCheckBuilder.ts
|
|
232
253
|
|
|
233
254
|
|
|
@@ -1041,7 +1062,7 @@ var valueLteBuilder = (environment, config) => {
|
|
|
1041
1062
|
|
|
1042
1063
|
// src/caveatBuilder/coreCaveatBuilder.ts
|
|
1043
1064
|
var createCaveatBuilder = (environment, config) => {
|
|
1044
|
-
const caveatBuilder = new CaveatBuilder(environment, config).extend(allowedMethods, allowedMethodsBuilder).extend(allowedTargets, allowedTargetsBuilder).extend(deployed, deployedBuilder).extend(allowedCalldata, allowedCalldataBuilder).extend(erc20BalanceChange, erc20BalanceChangeBuilder).extend(erc721BalanceChange, erc721BalanceChangeBuilder).extend(erc1155BalanceChange, erc1155BalanceChangeBuilder).extend(valueLte, valueLteBuilder).extend(limitedCalls, limitedCallsBuilder).extend(id, idBuilder).extend(nonce, nonceBuilder).extend(timestamp, timestampBuilder).extend(blockNumber, blockNumberBuilder).extend(erc20TransferAmount, erc20TransferAmountBuilder).extend(erc20Streaming, erc20StreamingBuilder).extend(nativeTokenStreaming, nativeTokenStreamingBuilder).extend(erc721Transfer, erc721TransferBuilder).extend(nativeTokenTransferAmount, nativeTokenTransferAmountBuilder).extend(nativeBalanceChange, nativeBalanceChangeBuilder).extend(redeemer, redeemerBuilder).extend(nativeTokenPayment, nativeTokenPaymentBuilder).extend(argsEqualityCheck, argsEqualityCheckBuilder).extend(
|
|
1065
|
+
const caveatBuilder = new CaveatBuilder(environment, config).extend(allowedMethods, allowedMethodsBuilder).extend(allowedTargets, allowedTargetsBuilder).extend(approvalRevocation, approvalRevocationBuilder).extend(deployed, deployedBuilder).extend(allowedCalldata, allowedCalldataBuilder).extend(erc20BalanceChange, erc20BalanceChangeBuilder).extend(erc721BalanceChange, erc721BalanceChangeBuilder).extend(erc1155BalanceChange, erc1155BalanceChangeBuilder).extend(valueLte, valueLteBuilder).extend(limitedCalls, limitedCallsBuilder).extend(id, idBuilder).extend(nonce, nonceBuilder).extend(timestamp, timestampBuilder).extend(blockNumber, blockNumberBuilder).extend(erc20TransferAmount, erc20TransferAmountBuilder).extend(erc20Streaming, erc20StreamingBuilder).extend(nativeTokenStreaming, nativeTokenStreamingBuilder).extend(erc721Transfer, erc721TransferBuilder).extend(nativeTokenTransferAmount, nativeTokenTransferAmountBuilder).extend(nativeBalanceChange, nativeBalanceChangeBuilder).extend(redeemer, redeemerBuilder).extend(nativeTokenPayment, nativeTokenPaymentBuilder).extend(argsEqualityCheck, argsEqualityCheckBuilder).extend(
|
|
1045
1066
|
specificActionERC20TransferBatch,
|
|
1046
1067
|
specificActionERC20TransferBatchBuilder
|
|
1047
1068
|
).extend(erc20PeriodTransfer, erc20PeriodTransferBuilder).extend(nativeTokenPeriodTransfer, nativeTokenPeriodTransferBuilder).extend(exactCalldataBatch, exactCalldataBatchBuilder).extend(exactCalldata, exactCalldataBuilder).extend(exactExecution, exactExecutionBuilder).extend(exactExecutionBatch, exactExecutionBatchBuilder).extend(multiTokenPeriod, multiTokenPeriodBuilder).extend(ownershipTransfer, ownershipTransferBuilder);
|
|
@@ -1402,6 +1423,7 @@ var resolveCaveats = ({
|
|
|
1402
1423
|
|
|
1403
1424
|
|
|
1404
1425
|
|
|
1426
|
+
|
|
1405
1427
|
|
|
1406
1428
|
|
|
1407
1429
|
var CAVEAT_ABI_TYPE_COMPONENTS = [
|
|
@@ -1425,113 +1447,142 @@ var decodeCaveat = ({
|
|
|
1425
1447
|
}) => {
|
|
1426
1448
|
switch (enforcer.toLowerCase()) {
|
|
1427
1449
|
case _optionalChain([caveatEnforcers, 'access', _2 => _2.AllowedCalldataEnforcer, 'optionalAccess', _3 => _3.toLowerCase, 'call', _4 => _4()]):
|
|
1428
|
-
return {
|
|
1450
|
+
return {
|
|
1451
|
+
type: "allowedCalldata" /* AllowedCalldata */,
|
|
1452
|
+
..._delegationcore.decodeAllowedCalldataTerms.call(void 0, terms)
|
|
1453
|
+
};
|
|
1429
1454
|
case _optionalChain([caveatEnforcers, 'access', _5 => _5.AllowedMethodsEnforcer, 'optionalAccess', _6 => _6.toLowerCase, 'call', _7 => _7()]):
|
|
1430
|
-
return { type: "allowedMethods", ..._delegationcore.decodeAllowedMethodsTerms.call(void 0, terms) };
|
|
1431
|
-
case _optionalChain([caveatEnforcers, 'access', _8 => _8.AllowedTargetsEnforcer, 'optionalAccess', _9 => _9.toLowerCase, 'call', _10 => _10()]):
|
|
1432
|
-
return { type: "allowedTargets", ..._delegationcore.decodeAllowedTargetsTerms.call(void 0, terms) };
|
|
1433
|
-
case _optionalChain([caveatEnforcers, 'access', _11 => _11.ArgsEqualityCheckEnforcer, 'optionalAccess', _12 => _12.toLowerCase, 'call', _13 => _13()]):
|
|
1434
1455
|
return {
|
|
1435
|
-
type: "
|
|
1456
|
+
type: "allowedMethods" /* AllowedMethods */,
|
|
1457
|
+
..._delegationcore.decodeAllowedMethodsTerms.call(void 0, terms)
|
|
1458
|
+
};
|
|
1459
|
+
case _optionalChain([caveatEnforcers, 'access', _8 => _8.ApprovalRevocationEnforcer, 'optionalAccess', _9 => _9.toLowerCase, 'call', _10 => _10()]):
|
|
1460
|
+
return {
|
|
1461
|
+
type: "approvalRevocation" /* ApprovalRevocation */,
|
|
1462
|
+
..._delegationcore.decodeApprovalRevocationTerms.call(void 0, terms)
|
|
1463
|
+
};
|
|
1464
|
+
case _optionalChain([caveatEnforcers, 'access', _11 => _11.AllowedTargetsEnforcer, 'optionalAccess', _12 => _12.toLowerCase, 'call', _13 => _13()]):
|
|
1465
|
+
return {
|
|
1466
|
+
type: "allowedTargets" /* AllowedTargets */,
|
|
1467
|
+
..._delegationcore.decodeAllowedTargetsTerms.call(void 0, terms)
|
|
1468
|
+
};
|
|
1469
|
+
case _optionalChain([caveatEnforcers, 'access', _14 => _14.ArgsEqualityCheckEnforcer, 'optionalAccess', _15 => _15.toLowerCase, 'call', _16 => _16()]):
|
|
1470
|
+
return {
|
|
1471
|
+
type: "argsEqualityCheck" /* ArgsEqualityCheck */,
|
|
1436
1472
|
..._delegationcore.decodeArgsEqualityCheckTerms.call(void 0, terms)
|
|
1437
1473
|
};
|
|
1438
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1439
|
-
return { type: "blockNumber"
|
|
1440
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1441
|
-
return { type: "deployed"
|
|
1442
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1474
|
+
case _optionalChain([caveatEnforcers, 'access', _17 => _17.BlockNumberEnforcer, 'optionalAccess', _18 => _18.toLowerCase, 'call', _19 => _19()]):
|
|
1475
|
+
return { type: "blockNumber" /* BlockNumber */, ..._delegationcore.decodeBlockNumberTerms.call(void 0, terms) };
|
|
1476
|
+
case _optionalChain([caveatEnforcers, 'access', _20 => _20.DeployedEnforcer, 'optionalAccess', _21 => _21.toLowerCase, 'call', _22 => _22()]):
|
|
1477
|
+
return { type: "deployed" /* Deployed */, ..._delegationcore.decodeDeployedTerms.call(void 0, terms) };
|
|
1478
|
+
case _optionalChain([caveatEnforcers, 'access', _23 => _23.ERC20BalanceChangeEnforcer, 'optionalAccess', _24 => _24.toLowerCase, 'call', _25 => _25()]):
|
|
1443
1479
|
return {
|
|
1444
|
-
type: "erc20BalanceChange"
|
|
1480
|
+
type: "erc20BalanceChange" /* Erc20BalanceChange */,
|
|
1445
1481
|
..._delegationcore.decodeERC20BalanceChangeTerms.call(void 0, terms)
|
|
1446
1482
|
};
|
|
1447
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1483
|
+
case _optionalChain([caveatEnforcers, 'access', _26 => _26.ERC20TransferAmountEnforcer, 'optionalAccess', _27 => _27.toLowerCase, 'call', _28 => _28()]):
|
|
1448
1484
|
return {
|
|
1449
|
-
type: "erc20TransferAmount"
|
|
1485
|
+
type: "erc20TransferAmount" /* Erc20TransferAmount */,
|
|
1450
1486
|
..._delegationcore.decodeERC20TransferAmountTerms.call(void 0, terms)
|
|
1451
1487
|
};
|
|
1452
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1453
|
-
return { type: "erc20Streaming", ..._delegationcore.decodeERC20StreamingTerms.call(void 0, terms) };
|
|
1454
|
-
case _optionalChain([caveatEnforcers, 'access', _29 => _29.ERC721BalanceChangeEnforcer, 'optionalAccess', _30 => _30.toLowerCase, 'call', _31 => _31()]):
|
|
1488
|
+
case _optionalChain([caveatEnforcers, 'access', _29 => _29.ERC20StreamingEnforcer, 'optionalAccess', _30 => _30.toLowerCase, 'call', _31 => _31()]):
|
|
1455
1489
|
return {
|
|
1456
|
-
type: "
|
|
1490
|
+
type: "erc20Streaming" /* Erc20Streaming */,
|
|
1491
|
+
..._delegationcore.decodeERC20StreamingTerms.call(void 0, terms)
|
|
1492
|
+
};
|
|
1493
|
+
case _optionalChain([caveatEnforcers, 'access', _32 => _32.ERC721BalanceChangeEnforcer, 'optionalAccess', _33 => _33.toLowerCase, 'call', _34 => _34()]):
|
|
1494
|
+
return {
|
|
1495
|
+
type: "erc721BalanceChange" /* Erc721BalanceChange */,
|
|
1457
1496
|
..._delegationcore.decodeERC721BalanceChangeTerms.call(void 0, terms)
|
|
1458
1497
|
};
|
|
1459
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1460
|
-
return {
|
|
1461
|
-
|
|
1498
|
+
case _optionalChain([caveatEnforcers, 'access', _35 => _35.ERC721TransferEnforcer, 'optionalAccess', _36 => _36.toLowerCase, 'call', _37 => _37()]):
|
|
1499
|
+
return {
|
|
1500
|
+
type: "erc721Transfer" /* Erc721Transfer */,
|
|
1501
|
+
..._delegationcore.decodeERC721TransferTerms.call(void 0, terms)
|
|
1502
|
+
};
|
|
1503
|
+
case _optionalChain([caveatEnforcers, 'access', _38 => _38.ERC1155BalanceChangeEnforcer, 'optionalAccess', _39 => _39.toLowerCase, 'call', _40 => _40()]):
|
|
1462
1504
|
return {
|
|
1463
|
-
type: "erc1155BalanceChange"
|
|
1505
|
+
type: "erc1155BalanceChange" /* Erc1155BalanceChange */,
|
|
1464
1506
|
..._delegationcore.decodeERC1155BalanceChangeTerms.call(void 0, terms)
|
|
1465
1507
|
};
|
|
1466
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1467
|
-
return { type: "id"
|
|
1468
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1469
|
-
return { type: "limitedCalls", ..._delegationcore.decodeLimitedCallsTerms.call(void 0, terms) };
|
|
1470
|
-
case _optionalChain([caveatEnforcers, 'access', _44 => _44.NonceEnforcer, 'optionalAccess', _45 => _45.toLowerCase, 'call', _46 => _46()]):
|
|
1471
|
-
return { type: "nonce", ..._delegationcore.decodeNonceTerms.call(void 0, terms) };
|
|
1472
|
-
case _optionalChain([caveatEnforcers, 'access', _47 => _47.TimestampEnforcer, 'optionalAccess', _48 => _48.toLowerCase, 'call', _49 => _49()]):
|
|
1473
|
-
return { type: "timestamp", ..._delegationcore.decodeTimestampTerms.call(void 0, terms) };
|
|
1474
|
-
case _optionalChain([caveatEnforcers, 'access', _50 => _50.ValueLteEnforcer, 'optionalAccess', _51 => _51.toLowerCase, 'call', _52 => _52()]):
|
|
1475
|
-
return { type: "valueLte", ..._delegationcore.decodeValueLteTerms.call(void 0, terms) };
|
|
1476
|
-
case _optionalChain([caveatEnforcers, 'access', _53 => _53.NativeTokenTransferAmountEnforcer, 'optionalAccess', _54 => _54.toLowerCase, 'call', _55 => _55()]):
|
|
1508
|
+
case _optionalChain([caveatEnforcers, 'access', _41 => _41.IdEnforcer, 'optionalAccess', _42 => _42.toLowerCase, 'call', _43 => _43()]):
|
|
1509
|
+
return { type: "id" /* Id */, ..._delegationcore.decodeIdTerms.call(void 0, terms) };
|
|
1510
|
+
case _optionalChain([caveatEnforcers, 'access', _44 => _44.LimitedCallsEnforcer, 'optionalAccess', _45 => _45.toLowerCase, 'call', _46 => _46()]):
|
|
1477
1511
|
return {
|
|
1478
|
-
type: "
|
|
1512
|
+
type: "limitedCalls" /* LimitedCalls */,
|
|
1513
|
+
..._delegationcore.decodeLimitedCallsTerms.call(void 0, terms)
|
|
1514
|
+
};
|
|
1515
|
+
case _optionalChain([caveatEnforcers, 'access', _47 => _47.NonceEnforcer, 'optionalAccess', _48 => _48.toLowerCase, 'call', _49 => _49()]):
|
|
1516
|
+
return { type: "nonce" /* Nonce */, ..._delegationcore.decodeNonceTerms.call(void 0, terms) };
|
|
1517
|
+
case _optionalChain([caveatEnforcers, 'access', _50 => _50.TimestampEnforcer, 'optionalAccess', _51 => _51.toLowerCase, 'call', _52 => _52()]):
|
|
1518
|
+
return { type: "timestamp" /* Timestamp */, ..._delegationcore.decodeTimestampTerms.call(void 0, terms) };
|
|
1519
|
+
case _optionalChain([caveatEnforcers, 'access', _53 => _53.ValueLteEnforcer, 'optionalAccess', _54 => _54.toLowerCase, 'call', _55 => _55()]):
|
|
1520
|
+
return { type: "valueLte" /* ValueLte */, ..._delegationcore.decodeValueLteTerms.call(void 0, terms) };
|
|
1521
|
+
case _optionalChain([caveatEnforcers, 'access', _56 => _56.NativeTokenTransferAmountEnforcer, 'optionalAccess', _57 => _57.toLowerCase, 'call', _58 => _58()]):
|
|
1522
|
+
return {
|
|
1523
|
+
type: "nativeTokenTransferAmount" /* NativeTokenTransferAmount */,
|
|
1479
1524
|
..._delegationcore.decodeNativeTokenTransferAmountTerms.call(void 0, terms)
|
|
1480
1525
|
};
|
|
1481
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1526
|
+
case _optionalChain([caveatEnforcers, 'access', _59 => _59.NativeBalanceChangeEnforcer, 'optionalAccess', _60 => _60.toLowerCase, 'call', _61 => _61()]):
|
|
1482
1527
|
return {
|
|
1483
|
-
type: "nativeBalanceChange"
|
|
1528
|
+
type: "nativeBalanceChange" /* NativeBalanceChange */,
|
|
1484
1529
|
..._delegationcore.decodeNativeBalanceChangeTerms.call(void 0, terms)
|
|
1485
1530
|
};
|
|
1486
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1531
|
+
case _optionalChain([caveatEnforcers, 'access', _62 => _62.NativeTokenStreamingEnforcer, 'optionalAccess', _63 => _63.toLowerCase, 'call', _64 => _64()]):
|
|
1487
1532
|
return {
|
|
1488
|
-
type: "nativeTokenStreaming"
|
|
1533
|
+
type: "nativeTokenStreaming" /* NativeTokenStreaming */,
|
|
1489
1534
|
..._delegationcore.decodeNativeTokenStreamingTerms.call(void 0, terms)
|
|
1490
1535
|
};
|
|
1491
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1536
|
+
case _optionalChain([caveatEnforcers, 'access', _65 => _65.NativeTokenPaymentEnforcer, 'optionalAccess', _66 => _66.toLowerCase, 'call', _67 => _67()]):
|
|
1492
1537
|
return {
|
|
1493
|
-
type: "nativeTokenPayment"
|
|
1538
|
+
type: "nativeTokenPayment" /* NativeTokenPayment */,
|
|
1494
1539
|
..._delegationcore.decodeNativeTokenPaymentTerms.call(void 0, terms)
|
|
1495
1540
|
};
|
|
1496
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1497
|
-
return { type: "redeemer"
|
|
1498
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1541
|
+
case _optionalChain([caveatEnforcers, 'access', _68 => _68.RedeemerEnforcer, 'optionalAccess', _69 => _69.toLowerCase, 'call', _70 => _70()]):
|
|
1542
|
+
return { type: "redeemer" /* Redeemer */, ..._delegationcore.decodeRedeemerTerms.call(void 0, terms) };
|
|
1543
|
+
case _optionalChain([caveatEnforcers, 'access', _71 => _71.SpecificActionERC20TransferBatchEnforcer, 'optionalAccess', _72 => _72.toLowerCase, 'call', _73 => _73()]):
|
|
1499
1544
|
return {
|
|
1500
|
-
type: "specificActionERC20TransferBatch"
|
|
1545
|
+
type: "specificActionERC20TransferBatch" /* SpecificActionERC20TransferBatch */,
|
|
1501
1546
|
..._delegationcore.decodeSpecificActionERC20TransferBatchTerms.call(void 0, terms)
|
|
1502
1547
|
};
|
|
1503
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1548
|
+
case _optionalChain([caveatEnforcers, 'access', _74 => _74.ERC20PeriodTransferEnforcer, 'optionalAccess', _75 => _75.toLowerCase, 'call', _76 => _76()]):
|
|
1504
1549
|
return {
|
|
1505
|
-
type: "erc20PeriodTransfer"
|
|
1550
|
+
type: "erc20PeriodTransfer" /* Erc20PeriodTransfer */,
|
|
1506
1551
|
..._delegationcore.decodeERC20TokenPeriodTransferTerms.call(void 0, terms)
|
|
1507
1552
|
};
|
|
1508
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1553
|
+
case _optionalChain([caveatEnforcers, 'access', _77 => _77.NativeTokenPeriodTransferEnforcer, 'optionalAccess', _78 => _78.toLowerCase, 'call', _79 => _79()]):
|
|
1509
1554
|
return {
|
|
1510
|
-
type: "nativeTokenPeriodTransfer"
|
|
1555
|
+
type: "nativeTokenPeriodTransfer" /* NativeTokenPeriodTransfer */,
|
|
1511
1556
|
..._delegationcore.decodeNativeTokenPeriodTransferTerms.call(void 0, terms)
|
|
1512
1557
|
};
|
|
1513
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1558
|
+
case _optionalChain([caveatEnforcers, 'access', _80 => _80.ExactCalldataBatchEnforcer, 'optionalAccess', _81 => _81.toLowerCase, 'call', _82 => _82()]):
|
|
1514
1559
|
return {
|
|
1515
|
-
type: "exactCalldataBatch"
|
|
1560
|
+
type: "exactCalldataBatch" /* ExactCalldataBatch */,
|
|
1516
1561
|
..._delegationcore.decodeExactCalldataBatchTerms.call(void 0, terms)
|
|
1517
1562
|
};
|
|
1518
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1519
|
-
return {
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1563
|
+
case _optionalChain([caveatEnforcers, 'access', _83 => _83.ExactCalldataEnforcer, 'optionalAccess', _84 => _84.toLowerCase, 'call', _85 => _85()]):
|
|
1564
|
+
return {
|
|
1565
|
+
type: "exactCalldata" /* ExactCalldata */,
|
|
1566
|
+
..._delegationcore.decodeExactCalldataTerms.call(void 0, terms)
|
|
1567
|
+
};
|
|
1568
|
+
case _optionalChain([caveatEnforcers, 'access', _86 => _86.ExactExecutionEnforcer, 'optionalAccess', _87 => _87.toLowerCase, 'call', _88 => _88()]):
|
|
1523
1569
|
return {
|
|
1524
|
-
type: "
|
|
1570
|
+
type: "exactExecution" /* ExactExecution */,
|
|
1571
|
+
..._delegationcore.decodeExactExecutionTerms.call(void 0, terms)
|
|
1572
|
+
};
|
|
1573
|
+
case _optionalChain([caveatEnforcers, 'access', _89 => _89.ExactExecutionBatchEnforcer, 'optionalAccess', _90 => _90.toLowerCase, 'call', _91 => _91()]):
|
|
1574
|
+
return {
|
|
1575
|
+
type: "exactExecutionBatch" /* ExactExecutionBatch */,
|
|
1525
1576
|
..._delegationcore.decodeExactExecutionBatchTerms.call(void 0, terms)
|
|
1526
1577
|
};
|
|
1527
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1578
|
+
case _optionalChain([caveatEnforcers, 'access', _92 => _92.MultiTokenPeriodEnforcer, 'optionalAccess', _93 => _93.toLowerCase, 'call', _94 => _94()]):
|
|
1528
1579
|
return {
|
|
1529
|
-
type: "multiTokenPeriod"
|
|
1580
|
+
type: "multiTokenPeriod" /* MultiTokenPeriod */,
|
|
1530
1581
|
..._delegationcore.decodeMultiTokenPeriodTerms.call(void 0, terms)
|
|
1531
1582
|
};
|
|
1532
|
-
case _optionalChain([caveatEnforcers, 'access',
|
|
1583
|
+
case _optionalChain([caveatEnforcers, 'access', _95 => _95.OwnershipTransferEnforcer, 'optionalAccess', _96 => _96.toLowerCase, 'call', _97 => _97()]):
|
|
1533
1584
|
return {
|
|
1534
|
-
type: "ownershipTransfer"
|
|
1585
|
+
type: "ownershipTransfer" /* OwnershipTransfer */,
|
|
1535
1586
|
..._delegationcore.decodeOwnershipTransferTerms.call(void 0, terms)
|
|
1536
1587
|
};
|
|
1537
1588
|
default:
|
|
@@ -1560,7 +1611,7 @@ var _openapifetch = require('openapi-fetch'); var _openapifetch2 = _interopRequi
|
|
|
1560
1611
|
// src/analytics/environment.ts
|
|
1561
1612
|
var session;
|
|
1562
1613
|
function createAnonId() {
|
|
1563
|
-
if (typeof _optionalChain([globalThis, 'access',
|
|
1614
|
+
if (typeof _optionalChain([globalThis, 'access', _98 => _98.crypto, 'optionalAccess', _99 => _99.randomUUID]) === "function") {
|
|
1564
1615
|
return globalThis.crypto.randomUUID();
|
|
1565
1616
|
}
|
|
1566
1617
|
return `00000000-0000-4000-8000-${Math.random().toString(16).slice(2, 14).padEnd(12, "0")}`;
|
|
@@ -1570,7 +1621,7 @@ function inferPlatform() {
|
|
|
1570
1621
|
return "nodejs";
|
|
1571
1622
|
}
|
|
1572
1623
|
const nav = globalThis.navigator;
|
|
1573
|
-
const ua = typeof _optionalChain([nav, 'optionalAccess',
|
|
1624
|
+
const ua = typeof _optionalChain([nav, 'optionalAccess', _100 => _100.userAgent]) === "string" ? nav.userAgent : "";
|
|
1574
1625
|
if (/Mobile|Android|iPhone|iPod|webOS|BlackBerry|IEMobile|Opera Mini/iu.test(ua)) {
|
|
1575
1626
|
return "web-mobile";
|
|
1576
1627
|
}
|
|
@@ -1579,7 +1630,7 @@ function inferPlatform() {
|
|
|
1579
1630
|
function inferDomain() {
|
|
1580
1631
|
if (typeof globalThis !== "undefined" && "window" in globalThis) {
|
|
1581
1632
|
const win = globalThis;
|
|
1582
|
-
const hostname = _optionalChain([win, 'access',
|
|
1633
|
+
const hostname = _optionalChain([win, 'access', _101 => _101.location, 'optionalAccess', _102 => _102.hostname]);
|
|
1583
1634
|
if (typeof hostname === "string" && hostname.length > 0) {
|
|
1584
1635
|
return { domain: hostname };
|
|
1585
1636
|
}
|
|
@@ -1699,7 +1750,7 @@ var Sender = class {
|
|
|
1699
1750
|
};
|
|
1700
1751
|
|
|
1701
1752
|
// package.json
|
|
1702
|
-
var version = "1.
|
|
1753
|
+
var version = "1.6.0";
|
|
1703
1754
|
|
|
1704
1755
|
// src/analytics/index.ts
|
|
1705
1756
|
function isCompleteBase(value) {
|
|
@@ -1826,8 +1877,8 @@ var analytics = new Analytics(METAMASK_ANALYTICS_ENDPOINT);
|
|
|
1826
1877
|
function isAnalyticsDisabled() {
|
|
1827
1878
|
const dntValues = [];
|
|
1828
1879
|
if (typeof process !== "undefined") {
|
|
1829
|
-
dntValues.push(_optionalChain([process, 'access',
|
|
1830
|
-
dntValues.push(_optionalChain([process, 'access',
|
|
1880
|
+
dntValues.push(_optionalChain([process, 'access', _103 => _103.env, 'optionalAccess', _104 => _104.CI]));
|
|
1881
|
+
dntValues.push(_optionalChain([process, 'access', _105 => _105.env, 'optionalAccess', _106 => _106.DO_NOT_TRACK]));
|
|
1831
1882
|
}
|
|
1832
1883
|
if (typeof navigator !== "undefined") {
|
|
1833
1884
|
dntValues.push(navigator.doNotTrack);
|
|
@@ -1836,7 +1887,7 @@ function isAnalyticsDisabled() {
|
|
|
1836
1887
|
dntValues.push(window.doNotTrack);
|
|
1837
1888
|
}
|
|
1838
1889
|
return dntValues.some(
|
|
1839
|
-
(dntValue) => dntValue === "1" || _optionalChain([dntValue, 'optionalAccess',
|
|
1890
|
+
(dntValue) => dntValue === "1" || _optionalChain([dntValue, 'optionalAccess', _107 => _107.toLowerCase, 'call', _108 => _108()]) === "yes" || _optionalChain([dntValue, 'optionalAccess', _109 => _109.toLowerCase, 'call', _110 => _110()]) === "true"
|
|
1840
1891
|
);
|
|
1841
1892
|
}
|
|
1842
1893
|
var hasBootstrapped = false;
|
|
@@ -1969,11 +2020,11 @@ var getCaveatNames = ({
|
|
|
1969
2020
|
([name, address]) => ({ name, address: address.toLowerCase() })
|
|
1970
2021
|
);
|
|
1971
2022
|
return caveats.map((caveat) => {
|
|
1972
|
-
const enforcerAddressLowercase = _optionalChain([caveat, 'access',
|
|
2023
|
+
const enforcerAddressLowercase = _optionalChain([caveat, 'access', _111 => _111.enforcer, 'optionalAccess', _112 => _112.toLowerCase, 'call', _113 => _113()]);
|
|
1973
2024
|
const matchingCaveat = knownEnforcers.find(
|
|
1974
2025
|
({ address }) => address === enforcerAddressLowercase
|
|
1975
2026
|
);
|
|
1976
|
-
return _nullishCoalesce(_optionalChain([matchingCaveat, 'optionalAccess',
|
|
2027
|
+
return _nullishCoalesce(_optionalChain([matchingCaveat, 'optionalAccess', _114 => _114.name]), () => ( "Unknown"));
|
|
1977
2028
|
});
|
|
1978
2029
|
}
|
|
1979
2030
|
return [];
|
|
@@ -2018,7 +2069,7 @@ var createDelegation = (options) => {
|
|
|
2018
2069
|
const { authority, caveats, hasInheritance, salt } = resolveDelegationArgs(options);
|
|
2019
2070
|
trackSmartAccountsKitFunctionCall("createDelegation", {
|
|
2020
2071
|
hasInheritance,
|
|
2021
|
-
scope: _nullishCoalesce(_optionalChain([options, 'access',
|
|
2072
|
+
scope: _nullishCoalesce(_optionalChain([options, 'access', _115 => _115.scope, 'optionalAccess', _116 => _116.type]), () => ( null)),
|
|
2022
2073
|
caveatNames: getCaveatNames({
|
|
2023
2074
|
caveats,
|
|
2024
2075
|
environment: options.environment
|
|
@@ -2037,7 +2088,7 @@ var createOpenDelegation = (options) => {
|
|
|
2037
2088
|
const { authority, caveats, hasInheritance, salt } = resolveDelegationArgs(options);
|
|
2038
2089
|
trackSmartAccountsKitFunctionCall("createOpenDelegation", {
|
|
2039
2090
|
hasInheritance,
|
|
2040
|
-
scope: _nullishCoalesce(_optionalChain([options, 'access',
|
|
2091
|
+
scope: _nullishCoalesce(_optionalChain([options, 'access', _117 => _117.scope, 'optionalAccess', _118 => _118.type]), () => ( null)),
|
|
2041
2092
|
caveatNames: getCaveatNames({
|
|
2042
2093
|
caveats,
|
|
2043
2094
|
environment: options.environment
|
|
@@ -2104,6 +2155,83 @@ var signDelegation = async ({
|
|
|
2104
2155
|
});
|
|
2105
2156
|
};
|
|
2106
2157
|
|
|
2158
|
+
// src/executions.ts
|
|
2159
|
+
|
|
2160
|
+
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
var createExecution = ({
|
|
2164
|
+
target,
|
|
2165
|
+
value = 0n,
|
|
2166
|
+
callData = "0x"
|
|
2167
|
+
}) => {
|
|
2168
|
+
return {
|
|
2169
|
+
target,
|
|
2170
|
+
value,
|
|
2171
|
+
callData
|
|
2172
|
+
};
|
|
2173
|
+
};
|
|
2174
|
+
var ExecutionMode = /* @__PURE__ */ ((ExecutionMode2) => {
|
|
2175
|
+
ExecutionMode2["SingleDefault"] = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
2176
|
+
ExecutionMode2["SingleTry"] = "0x0001000000000000000000000000000000000000000000000000000000000000";
|
|
2177
|
+
ExecutionMode2["BatchDefault"] = "0x0100000000000000000000000000000000000000000000000000000000000000";
|
|
2178
|
+
ExecutionMode2["BatchTry"] = "0x0101000000000000000000000000000000000000000000000000000000000000";
|
|
2179
|
+
return ExecutionMode2;
|
|
2180
|
+
})(ExecutionMode || {});
|
|
2181
|
+
var EXECUTION_ABI_TYPE_COMPONENTS = [
|
|
2182
|
+
{ type: "address", name: "target" },
|
|
2183
|
+
{ type: "uint256", name: "value" },
|
|
2184
|
+
{ type: "bytes", name: "callData" }
|
|
2185
|
+
];
|
|
2186
|
+
var encodeSingleExecution = (execution) => {
|
|
2187
|
+
return _viem.encodePacked.call(void 0,
|
|
2188
|
+
["address", "uint256", "bytes"],
|
|
2189
|
+
[execution.target, execution.value, execution.callData]
|
|
2190
|
+
);
|
|
2191
|
+
};
|
|
2192
|
+
var encodeBatchExecution = (executions) => {
|
|
2193
|
+
return _viem.encodeAbiParameters.call(void 0,
|
|
2194
|
+
[
|
|
2195
|
+
{
|
|
2196
|
+
components: EXECUTION_ABI_TYPE_COMPONENTS,
|
|
2197
|
+
name: "executions",
|
|
2198
|
+
type: "tuple[]"
|
|
2199
|
+
}
|
|
2200
|
+
],
|
|
2201
|
+
[executions]
|
|
2202
|
+
);
|
|
2203
|
+
};
|
|
2204
|
+
var encodeExecutionCalldata = (executions) => {
|
|
2205
|
+
if (executions.length === 0) {
|
|
2206
|
+
throw new Error(
|
|
2207
|
+
"Error while getting the execution calldatas, executions is empty"
|
|
2208
|
+
);
|
|
2209
|
+
}
|
|
2210
|
+
if (executions.length === 1) {
|
|
2211
|
+
const execution = executions[0];
|
|
2212
|
+
if (!execution) {
|
|
2213
|
+
throw new Error("Execution not found");
|
|
2214
|
+
}
|
|
2215
|
+
return encodeSingleExecution(execution);
|
|
2216
|
+
}
|
|
2217
|
+
return encodeBatchExecution(executions);
|
|
2218
|
+
};
|
|
2219
|
+
var encodeExecutionCalldatas = (executionsBatch) => {
|
|
2220
|
+
if (executionsBatch.length === 0) {
|
|
2221
|
+
throw new Error(
|
|
2222
|
+
"Error while getting the execution calldatas, executionsBatch is empty"
|
|
2223
|
+
);
|
|
2224
|
+
}
|
|
2225
|
+
return executionsBatch.map(encodeExecutionCalldata);
|
|
2226
|
+
};
|
|
2227
|
+
|
|
2228
|
+
|
|
2229
|
+
|
|
2230
|
+
|
|
2231
|
+
|
|
2232
|
+
|
|
2233
|
+
|
|
2234
|
+
|
|
2107
2235
|
|
|
2108
2236
|
|
|
2109
2237
|
|
|
@@ -2135,5 +2263,5 @@ var signDelegation = async ({
|
|
|
2135
2263
|
|
|
2136
2264
|
|
|
2137
2265
|
|
|
2138
|
-
exports.__export = __export; exports.trackSmartAccountsKitFunctionCall = trackSmartAccountsKitFunctionCall; exports.Implementation = Implementation; exports.TransferWindow = TransferWindow; exports.ScopeType = ScopeType; exports.CaveatType = CaveatType; exports.CaveatBuilder = CaveatBuilder; exports.createCaveatBuilder = createCaveatBuilder; exports.isDefined = isDefined; exports.toHexOrThrow = toHexOrThrow; exports.createCaveat = createCaveat; exports.decodeCaveat = decodeCaveat; exports.ANY_BENEFICIARY = _delegationcore.ANY_BENEFICIARY; exports.DELEGATION_TYPEHASH = _delegationcore.DELEGATION_TYPEHASH; exports.ROOT_AUTHORITY = _delegationcore.ROOT_AUTHORITY; exports.DELEGATION_ABI_TYPE_COMPONENTS = DELEGATION_ABI_TYPE_COMPONENTS; exports.toDelegationStruct = toDelegationStruct; exports.toDelegation = toDelegation; exports.encodeDelegations = encodeDelegations; exports.encodeDelegation = encodeDelegation; exports.decodeDelegations = decodeDelegations; exports.decodeDelegation = decodeDelegation; exports.SIGNABLE_DELEGATION_TYPED_DATA = SIGNABLE_DELEGATION_TYPED_DATA; exports.DELEGATION_ARRAY_ABI_TYPE = DELEGATION_ARRAY_ABI_TYPE; exports.DELEGATION_ABI_TYPE = DELEGATION_ABI_TYPE; exports.hashDelegation = hashDelegation; exports.createDelegation = createDelegation; exports.createOpenDelegation = createOpenDelegation; exports.prepareSignDelegationTypedData = prepareSignDelegationTypedData; exports.signDelegation = signDelegation;
|
|
2139
|
-
//# sourceMappingURL=chunk-
|
|
2266
|
+
exports.__export = __export; exports.trackSmartAccountsKitFunctionCall = trackSmartAccountsKitFunctionCall; exports.Implementation = Implementation; exports.TransferWindow = TransferWindow; exports.ScopeType = ScopeType; exports.CaveatType = CaveatType; exports.CaveatBuilder = CaveatBuilder; exports.createCaveatBuilder = createCaveatBuilder; exports.isDefined = isDefined; exports.toHexOrThrow = toHexOrThrow; exports.resolveCaveats = resolveCaveats; exports.createCaveat = createCaveat; exports.decodeCaveat = decodeCaveat; exports.ANY_BENEFICIARY = _delegationcore.ANY_BENEFICIARY; exports.DELEGATION_TYPEHASH = _delegationcore.DELEGATION_TYPEHASH; exports.ROOT_AUTHORITY = _delegationcore.ROOT_AUTHORITY; exports.DELEGATION_ABI_TYPE_COMPONENTS = DELEGATION_ABI_TYPE_COMPONENTS; exports.toDelegationStruct = toDelegationStruct; exports.toDelegation = toDelegation; exports.encodeDelegations = encodeDelegations; exports.encodeDelegation = encodeDelegation; exports.decodeDelegations = decodeDelegations; exports.decodeDelegation = decodeDelegation; exports.SIGNABLE_DELEGATION_TYPED_DATA = SIGNABLE_DELEGATION_TYPED_DATA; exports.DELEGATION_ARRAY_ABI_TYPE = DELEGATION_ARRAY_ABI_TYPE; exports.DELEGATION_ABI_TYPE = DELEGATION_ABI_TYPE; exports.hashDelegation = hashDelegation; exports.createDelegation = createDelegation; exports.createOpenDelegation = createOpenDelegation; exports.prepareSignDelegationTypedData = prepareSignDelegationTypedData; exports.signDelegation = signDelegation; exports.createExecution = createExecution; exports.ExecutionMode = ExecutionMode; exports.encodeSingleExecution = encodeSingleExecution; exports.encodeBatchExecution = encodeBatchExecution; exports.encodeExecutionCalldata = encodeExecutionCalldata; exports.encodeExecutionCalldatas = encodeExecutionCalldatas;
|
|
2267
|
+
//# sourceMappingURL=chunk-W6HPAK4M.cjs.map
|