@account-kit/smart-contracts 4.35.0 → 4.35.1
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/dist/esm/plugindefs/session-key/config.js.map +1 -1
- package/dist/esm/src/light-account/accounts/account.js.map +1 -1
- package/dist/esm/src/light-account/accounts/base.js.map +1 -1
- package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/esm/src/light-account/accounts/predictAddress.js.map +1 -1
- package/dist/esm/src/light-account/actions/transferOwnership.d.ts +1 -1
- package/dist/esm/src/light-account/actions/transferOwnership.js.map +1 -1
- package/dist/esm/src/light-account/actions/updateOwners.js.map +1 -1
- package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/client.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
- package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
- package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
- package/dist/esm/src/light-account/types.js.map +1 -1
- package/dist/esm/src/light-account/utils.d.ts +1 -1
- package/dist/esm/src/light-account/utils.js.map +1 -1
- package/dist/esm/src/ma-v2/account/common/modularAccountV2Base.js.map +1 -1
- package/dist/esm/src/ma-v2/account/modularAccountV2.js.map +1 -1
- package/dist/esm/src/ma-v2/account/nativeSMASigner.d.ts +2 -207
- package/dist/esm/src/ma-v2/account/nativeSMASigner.js +7 -4
- package/dist/esm/src/ma-v2/account/nativeSMASigner.js.map +1 -1
- package/dist/esm/src/ma-v2/account/predictAddress.js.map +1 -1
- package/dist/esm/src/ma-v2/actions/deferralActions.js.map +1 -1
- package/dist/esm/src/ma-v2/actions/install-validation/installValidation.js.map +1 -1
- package/dist/esm/src/ma-v2/client/client.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/allowlist-module/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/native-token-limit-module/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/paymaster-guard-module/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/single-signer-validation/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.d.ts +2 -207
- package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js +7 -4
- package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/time-range-module/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/utils.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/webauthn-validation/module.js.map +1 -1
- package/dist/esm/src/ma-v2/permissionBuilder.js.map +1 -1
- package/dist/esm/src/ma-v2/permissionBuilderErrors.js +1 -1
- package/dist/esm/src/ma-v2/permissionBuilderErrors.js.map +1 -1
- package/dist/esm/src/ma-v2/utils.js.map +1 -1
- package/dist/esm/src/msca/account/multiOwnerAccount.js.map +1 -1
- package/dist/esm/src/msca/account/multisigAccount.d.ts +1 -1
- package/dist/esm/src/msca/account/multisigAccount.js.map +1 -1
- package/dist/esm/src/msca/account-loupe/decorator.js.map +1 -1
- package/dist/esm/src/msca/account-loupe/types.js.map +1 -1
- package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/esm/src/msca/client/client.js.map +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/esm/src/msca/plugin-manager/decorator.js.map +1 -1
- package/dist/esm/src/msca/plugin-manager/installPlugin.js.map +1 -1
- package/dist/esm/src/msca/plugin-manager/uninstallPlugin.js.map +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/extension.js.map +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/plugin.js.map +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/signer.d.ts +3 -208
- package/dist/esm/src/msca/plugins/multi-owner/signer.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/getThreshold.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/isOwnerOf.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/readOwners.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/extension.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/plugin.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/signer.d.ts +3 -208
- package/dist/esm/src/msca/plugins/multisig/signer.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/types.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.d.ts +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/extension.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/plugin.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/signer.d.ts +4 -209
- package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/utils.js.map +1 -1
- package/dist/esm/src/msca/plugins/types.js.map +1 -1
- package/dist/esm/src/msca/utils.js.map +1 -1
- package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
- package/dist/types/src/light-account/actions/transferOwnership.d.ts +1 -1
- package/dist/types/src/light-account/actions/transferOwnership.d.ts.map +1 -1
- package/dist/types/src/light-account/actions/updateOwners.d.ts.map +1 -1
- package/dist/types/src/light-account/types.d.ts.map +1 -1
- package/dist/types/src/light-account/utils.d.ts +1 -1
- package/dist/types/src/light-account/utils.d.ts.map +1 -1
- package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts +2 -207
- package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts.map +1 -1
- package/dist/types/src/ma-v2/modules/allowlist-module/module.d.ts.map +1 -1
- package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts +2 -207
- package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts.map +1 -1
- package/dist/types/src/ma-v2/modules/utils.d.ts.map +1 -1
- package/dist/types/src/ma-v2/permissionBuilderErrors.d.ts.map +1 -1
- package/dist/types/src/ma-v2/utils.d.ts.map +1 -1
- package/dist/types/src/msca/account/multisigAccount.d.ts +1 -1
- package/dist/types/src/msca/account/multisigAccount.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/decorator.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/installPlugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/uninstallPlugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multi-owner/plugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multi-owner/signer.d.ts +3 -208
- package/dist/types/src/msca/plugins/multi-owner/signer.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/actions/proposeUserOperation.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/plugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/signer.d.ts +3 -208
- package/dist/types/src/msca/plugins/multisig/signer.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/types.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/extension.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/plugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts +4 -209
- package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
- package/dist/types/src/msca/utils.d.ts.map +1 -1
- package/package.json +7 -9
- package/plugindefs/session-key/config.ts +1 -1
- package/src/light-account/accounts/account.ts +7 -5
- package/src/light-account/accounts/base.ts +18 -15
- package/src/light-account/accounts/multiOwner.ts +9 -6
- package/src/light-account/accounts/predictAddress.ts +5 -5
- package/src/light-account/actions/transferOwnership.ts +5 -4
- package/src/light-account/actions/updateOwners.ts +6 -5
- package/src/light-account/clients/alchemyClient.ts +3 -3
- package/src/light-account/clients/client.ts +6 -6
- package/src/light-account/clients/multiOwnerAlchemyClient.ts +3 -3
- package/src/light-account/clients/multiOwnerLightAccount.ts +7 -7
- package/src/light-account/decorators/lightAccount.ts +4 -4
- package/src/light-account/decorators/multiOwnerLightAccount.ts +4 -4
- package/src/light-account/types.ts +3 -2
- package/src/light-account/utils.ts +10 -10
- package/src/ma-v2/account/common/modularAccountV2Base.ts +8 -8
- package/src/ma-v2/account/modularAccountV2.ts +4 -4
- package/src/ma-v2/account/nativeSMASigner.ts +16 -13
- package/src/ma-v2/account/predictAddress.ts +13 -13
- package/src/ma-v2/actions/deferralActions.ts +7 -7
- package/src/ma-v2/actions/install-validation/installValidation.ts +14 -14
- package/src/ma-v2/client/client.ts +8 -8
- package/src/ma-v2/modules/allowlist-module/module.ts +5 -5
- package/src/ma-v2/modules/native-token-limit-module/module.ts +1 -1
- package/src/ma-v2/modules/paymaster-guard-module/module.ts +2 -2
- package/src/ma-v2/modules/single-signer-validation/module.ts +2 -2
- package/src/ma-v2/modules/single-signer-validation/signer.ts +14 -11
- package/src/ma-v2/modules/time-range-module/module.ts +6 -6
- package/src/ma-v2/modules/utils.ts +4 -4
- package/src/ma-v2/modules/webauthn-validation/module.ts +2 -2
- package/src/ma-v2/permissionBuilder.ts +14 -14
- package/src/ma-v2/permissionBuilderErrors.ts +9 -7
- package/src/ma-v2/utils.ts +4 -4
- package/src/msca/account/multiOwnerAccount.ts +5 -5
- package/src/msca/account/multisigAccount.ts +6 -6
- package/src/msca/account-loupe/decorator.ts +11 -11
- package/src/msca/account-loupe/types.ts +1 -1
- package/src/msca/client/alchemyClient.ts +4 -4
- package/src/msca/client/client.ts +12 -12
- package/src/msca/client/multiSigAlchemyClient.ts +4 -4
- package/src/msca/plugin-manager/decorator.ts +6 -5
- package/src/msca/plugin-manager/installPlugin.ts +8 -7
- package/src/msca/plugin-manager/uninstallPlugin.ts +6 -5
- package/src/msca/plugins/multi-owner/extension.ts +10 -10
- package/src/msca/plugins/multi-owner/plugin.ts +21 -19
- package/src/msca/plugins/multi-owner/signer.ts +4 -4
- package/src/msca/plugins/multisig/actions/getThreshold.ts +3 -3
- package/src/msca/plugins/multisig/actions/isOwnerOf.ts +2 -2
- package/src/msca/plugins/multisig/actions/proposeUserOperation.ts +4 -3
- package/src/msca/plugins/multisig/actions/readOwners.ts +3 -3
- package/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts +5 -5
- package/src/msca/plugins/multisig/extension.ts +16 -16
- package/src/msca/plugins/multisig/middleware.ts +2 -2
- package/src/msca/plugins/multisig/plugin.ts +21 -19
- package/src/msca/plugins/multisig/signer.ts +5 -5
- package/src/msca/plugins/multisig/types.ts +4 -2
- package/src/msca/plugins/multisig/utils/formatSignatures.ts +1 -1
- package/src/msca/plugins/multisig/utils/getSignerType.ts +2 -2
- package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +7 -6
- package/src/msca/plugins/session-key/extension.ts +16 -14
- package/src/msca/plugins/session-key/permissions.ts +7 -7
- package/src/msca/plugins/session-key/plugin.ts +30 -28
- package/src/msca/plugins/session-key/signer.ts +5 -5
- package/src/msca/plugins/session-key/utils.ts +4 -4
- package/src/msca/plugins/types.ts +1 -1
- package/src/msca/utils.ts +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modularAccountV2.js","sourceRoot":"","sources":["../../../../../src/ma-v2/account/modularAccountV2.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,kBAAkB,GAKnB,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,cAAc,GACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAkCrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAoC;IAEpC,MAAM,EACJ,SAAS,EACT,KAAK,EACL,MAAM,EACN,cAAc,EAAE,eAAe,EAC/B,UAAU,GAAG,aAAa,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EACvD,YAAY,GAAG;QACb,kBAAkB,EAAE,IAAI;QACxB,QAAQ,EAAE,uBAAuB;KAClC,EACD,YAAY,EAAE,EAAE,QAAQ,GAAG,uBAAuB,EAAE,GAAG,EAAE,EACzD,cAAc,GACf,GAAG,MAAM,CAAC;IAEX,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE;QACzC,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;YACpB,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,kBAAkB,GA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,aAAa;qBAC5B,CAAC,CAAC;gBAEL,OAAO;oBACL,kBAAkB;oBAClB,cAAc;iBACf,CAAC;YACJ,CAAC;YACD;gBACE,WAAW,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,cAAc,CAAC;QACpB,MAAM,EAAE,kBAAkB;QAC1B,SAAS;QACT,KAAK;QACL,MAAM;QACN,UAAU;QACV,YAAY;QACZ,cAAc;QACd,GAAG,gBAAgB;KACpB,CAAC,CAAC;AACL,CAAC;AAED,qKAAqK;AACrK,SAAS,WAAW,CAAC,MAAa;IAChC,MAAM,IAAI,2BAA2B,EAAE,CAAC;AAC1C,CAAC","sourcesContent":["import type {\n EntryPointDef,\n SmartAccountSigner,\n ToSmartContractAccountParams,\n} from \"@aa-sdk/core\";\nimport {\n getEntryPoint,\n EntityIdOverrideError,\n InvalidModularAccountV2Mode,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n type Address,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { accountFactoryAbi } from \"../abis/accountFactoryAbi.js\";\nimport {\n getDefaultMAV2FactoryAddress,\n getDefaultSMAV2BytecodeAddress,\n} from \"../utils.js\";\nimport {\n type SignerEntity,\n type ModularAccountV2,\n createMAv2Base,\n} from \"./common/modularAccountV2Base.js\";\nimport { DEFAULT_OWNER_ENTITY_ID } from \"../utils.js\";\nimport { predictModularAccountV2Address } from \"./predictAddress.js\";\n\nexport type CreateModularAccountV2Params<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
1
|
+
{"version":3,"file":"modularAccountV2.js","sourceRoot":"","sources":["../../../../../src/ma-v2/account/modularAccountV2.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,kBAAkB,GAKnB,MAAM,MAAM,CA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AW,CAAC,MAAa;IAChC,MAAM,IAAI,2BAA2B,EAAE,CAAC;AAC1C,CAAC","sourcesContent":["import type {\n EntryPointDef,\n SmartAccountSigner,\n ToSmartContractAccountParams,\n} from \"@aa-sdk/core\";\nimport {\n getEntryPoint,\n EntityIdOverrideError,\n InvalidModularAccountV2Mode,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n type Address,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { accountFactoryAbi } from \"../abis/accountFactoryAbi.js\";\nimport {\n getDefaultMAV2FactoryAddress,\n getDefaultSMAV2BytecodeAddress,\n} from \"../utils.js\";\nimport {\n type SignerEntity,\n type ModularAccountV2,\n createMAv2Base,\n} from \"./common/modularAccountV2Base.js\";\nimport { DEFAULT_OWNER_ENTITY_ID } from \"../utils.js\";\nimport { predictModularAccountV2Address } from \"./predictAddress.js\";\n\nexport type CreateModularAccountV2Params<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n> = (Pick<\n ToSmartContractAccountParams<\"ModularAccountV2\", TTransport, Chain, \"0.7.0\">,\n \"transport\" | \"chain\" | \"accountAddress\"\n> & {\n signer: TSigner;\n entryPoint?: EntryPointDef<\"0.7.0\", Chain>;\n deferredAction?: Hex;\n signerEntity?: SignerEntity;\n}) &\n (\n | {\n mode?: \"default\";\n salt?: bigint;\n factoryAddress?: Address;\n implementationAddress?: Address;\n initCode?: Hex;\n }\n | {\n mode: \"7702\";\n }\n );\n\nexport async function createModularAccountV2<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n>(\n config: CreateModularAccountV2Params<TTransport, TSigner>,\n): Promise<ModularAccountV2<TSigner>>;\n\n/**\n * Creates a ModularAccount V2 account, with the mode depending on the provided \"mode\" field.\n * Possible modes include: \"default\", which is SMA Bytecode, and \"7702\", which is SMA 7702.\n * Handles nonce generation, transaction encoding, and mode variant-specific behavior like initcode construction.\n *\n * @example\n * ```ts twoslash\n * import { createModularAccountV2 } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { alchemy, sepolia } from \"@account-kit/infra\";\n *\n * const MNEMONIC = \"...\";\n * const RPC_URL = \"...\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(MNEMONIC);\n *\n * const chain = sepolia;\n *\n * const transport = alchemy({ rpcUrl: RPC_URL });\n *\n *\n * const modularAccountV2 = await createModularAccountV2({\n * mode: \"default\", // or \"7702\"\n * chain,\n * signer,\n * transport,\n * });\n * ```\n *\n * @param {CreateModularAccountV2Params} config Configuration parameters for creating a Modular Account V2.\n * @returns {Promise<ModularAccountV2>} A promise that resolves to an `ModularAccountV2` providing methods for nonce retrieval, transaction execution, and more.\n */\nexport async function createModularAccountV2(\n config: CreateModularAccountV2Params,\n): Promise<ModularAccountV2> {\n const {\n transport,\n chain,\n signer,\n accountAddress: _accountAddress,\n entryPoint = getEntryPoint(chain, { version: \"0.7.0\" }),\n signerEntity = {\n isGlobalValidation: true,\n entityId: DEFAULT_OWNER_ENTITY_ID,\n },\n signerEntity: { entityId = DEFAULT_OWNER_ENTITY_ID } = {},\n deferredAction,\n } = config;\n\n const accountFunctions = await (async () => {\n switch (config.mode) {\n case \"7702\": {\n const getAccountInitCode = async (): Promise<Hex> => {\n return \"0x\";\n };\n const signerAddress = await signer.getAddress();\n const accountAddress = _accountAddress ?? signerAddress;\n if (\n entityId === DEFAULT_OWNER_ENTITY_ID &&\n signerAddress !== accountAddress\n ) {\n throw new EntityIdOverrideError();\n }\n\n const implementation: Address =\n \"0x69007702764179f14F51cdce752f4f775d74E139\";\n\n const getImplementationAddress = async () => implementation;\n\n return {\n getAccountInitCode,\n accountAddress,\n getImplementationAddress,\n };\n }\n case \"default\":\n case undefined: {\n const {\n salt = 0n,\n factoryAddress = getDefaultMAV2FactoryAddress(chain),\n implementationAddress = getDefaultSMAV2BytecodeAddress(chain),\n initCode,\n } = config;\n\n const signerAddress = await signer.getAddress();\n\n const getAccountInitCode = async () => {\n if (initCode) {\n return initCode;\n }\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: accountFactoryAbi,\n functionName: \"createSemiModularAccount\",\n args: [signerAddress, salt],\n }),\n ]);\n };\n\n const accountAddress =\n _accountAddress ??\n predictModularAccountV2Address({\n factoryAddress,\n implementationAddress,\n salt,\n type: \"SMA\",\n ownerAddress: signerAddress,\n });\n\n return {\n getAccountInitCode,\n accountAddress,\n };\n }\n default:\n assertNever(config);\n }\n })();\n\n return createMAv2Base({\n source: \"ModularAccountV2\",\n transport,\n chain,\n signer,\n entryPoint,\n signerEntity,\n deferredAction,\n ...accountFunctions,\n });\n}\n\n// If we add more valid modes, the switch case branch's mode will no longer be `never`, which will cause a compile time error here and ensure we handle the new type.\nfunction assertNever(_valid: never): never {\n throw new InvalidModularAccountV2Mode();\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Address, type Chain, type Hex, type SignableMessage, type TypedData, type TypedDataDefinition } from "viem";
|
|
3
3
|
/**
|
|
4
4
|
* Creates an object with methods for generating a dummy signature, signing user operation hashes, signing messages, and signing typed data.
|
|
5
5
|
*
|
|
@@ -29,210 +29,5 @@ export declare const nativeSMASigner: (signer: SmartAccountSigner, chain: Chain,
|
|
|
29
29
|
signMessage({ message }: {
|
|
30
30
|
message: SignableMessage;
|
|
31
31
|
}): Promise<Hex>;
|
|
32
|
-
signTypedData: <const typedData extends Record<string, unknown
|
|
33
|
-
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
34
|
-
[x: `string[${string}]`]: undefined;
|
|
35
|
-
[x: `function[${string}]`]: undefined;
|
|
36
|
-
[x: `address[${string}]`]: undefined;
|
|
37
|
-
[x: `uint64[${string}]`]: undefined;
|
|
38
|
-
[x: `bytes32[${string}]`]: undefined;
|
|
39
|
-
[x: `bytes[${string}]`]: undefined;
|
|
40
|
-
[x: `uint256[${string}]`]: undefined;
|
|
41
|
-
[x: `bytes4[${string}]`]: undefined;
|
|
42
|
-
[x: `bool[${string}]`]: undefined;
|
|
43
|
-
[x: `bytes1[${string}]`]: undefined;
|
|
44
|
-
[x: `uint32[${string}]`]: undefined;
|
|
45
|
-
[x: `bytes2[${string}]`]: undefined;
|
|
46
|
-
[x: `bytes3[${string}]`]: undefined;
|
|
47
|
-
[x: `bytes5[${string}]`]: undefined;
|
|
48
|
-
[x: `bytes6[${string}]`]: undefined;
|
|
49
|
-
[x: `bytes11[${string}]`]: undefined;
|
|
50
|
-
[x: `bytes7[${string}]`]: undefined;
|
|
51
|
-
[x: `bytes9[${string}]`]: undefined;
|
|
52
|
-
[x: `bytes27[${string}]`]: undefined;
|
|
53
|
-
[x: `bytes22[${string}]`]: undefined;
|
|
54
|
-
[x: `bytes8[${string}]`]: undefined;
|
|
55
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
56
|
-
[x: `bytes12[${string}]`]: undefined;
|
|
57
|
-
[x: `bytes13[${string}]`]: undefined;
|
|
58
|
-
[x: `bytes14[${string}]`]: undefined;
|
|
59
|
-
[x: `bytes15[${string}]`]: undefined;
|
|
60
|
-
[x: `bytes16[${string}]`]: undefined;
|
|
61
|
-
[x: `bytes17[${string}]`]: undefined;
|
|
62
|
-
[x: `bytes18[${string}]`]: undefined;
|
|
63
|
-
[x: `bytes19[${string}]`]: undefined;
|
|
64
|
-
[x: `bytes20[${string}]`]: undefined;
|
|
65
|
-
[x: `bytes21[${string}]`]: undefined;
|
|
66
|
-
[x: `bytes23[${string}]`]: undefined;
|
|
67
|
-
[x: `bytes24[${string}]`]: undefined;
|
|
68
|
-
[x: `bytes25[${string}]`]: undefined;
|
|
69
|
-
[x: `bytes26[${string}]`]: undefined;
|
|
70
|
-
[x: `bytes28[${string}]`]: undefined;
|
|
71
|
-
[x: `bytes29[${string}]`]: undefined;
|
|
72
|
-
[x: `bytes30[${string}]`]: undefined;
|
|
73
|
-
[x: `bytes31[${string}]`]: undefined;
|
|
74
|
-
[x: `int[${string}]`]: undefined;
|
|
75
|
-
[x: `int8[${string}]`]: undefined;
|
|
76
|
-
[x: `int16[${string}]`]: undefined;
|
|
77
|
-
[x: `int24[${string}]`]: undefined;
|
|
78
|
-
[x: `int32[${string}]`]: undefined;
|
|
79
|
-
[x: `int40[${string}]`]: undefined;
|
|
80
|
-
[x: `int48[${string}]`]: undefined;
|
|
81
|
-
[x: `int56[${string}]`]: undefined;
|
|
82
|
-
[x: `int64[${string}]`]: undefined;
|
|
83
|
-
[x: `int72[${string}]`]: undefined;
|
|
84
|
-
[x: `int80[${string}]`]: undefined;
|
|
85
|
-
[x: `int88[${string}]`]: undefined;
|
|
86
|
-
[x: `int96[${string}]`]: undefined;
|
|
87
|
-
[x: `int104[${string}]`]: undefined;
|
|
88
|
-
[x: `int112[${string}]`]: undefined;
|
|
89
|
-
[x: `int120[${string}]`]: undefined;
|
|
90
|
-
[x: `int128[${string}]`]: undefined;
|
|
91
|
-
[x: `int136[${string}]`]: undefined;
|
|
92
|
-
[x: `int144[${string}]`]: undefined;
|
|
93
|
-
[x: `int152[${string}]`]: undefined;
|
|
94
|
-
[x: `int160[${string}]`]: undefined;
|
|
95
|
-
[x: `int168[${string}]`]: undefined;
|
|
96
|
-
[x: `int176[${string}]`]: undefined;
|
|
97
|
-
[x: `int184[${string}]`]: undefined;
|
|
98
|
-
[x: `int192[${string}]`]: undefined;
|
|
99
|
-
[x: `int200[${string}]`]: undefined;
|
|
100
|
-
[x: `int208[${string}]`]: undefined;
|
|
101
|
-
[x: `int216[${string}]`]: undefined;
|
|
102
|
-
[x: `int224[${string}]`]: undefined;
|
|
103
|
-
[x: `int232[${string}]`]: undefined;
|
|
104
|
-
[x: `int240[${string}]`]: undefined;
|
|
105
|
-
[x: `int248[${string}]`]: undefined;
|
|
106
|
-
[x: `int256[${string}]`]: undefined;
|
|
107
|
-
[x: `uint[${string}]`]: undefined;
|
|
108
|
-
[x: `uint8[${string}]`]: undefined;
|
|
109
|
-
[x: `uint16[${string}]`]: undefined;
|
|
110
|
-
[x: `uint24[${string}]`]: undefined;
|
|
111
|
-
[x: `uint40[${string}]`]: undefined;
|
|
112
|
-
[x: `uint48[${string}]`]: undefined;
|
|
113
|
-
[x: `uint56[${string}]`]: undefined;
|
|
114
|
-
[x: `uint72[${string}]`]: undefined;
|
|
115
|
-
[x: `uint80[${string}]`]: undefined;
|
|
116
|
-
[x: `uint88[${string}]`]: undefined;
|
|
117
|
-
[x: `uint96[${string}]`]: undefined;
|
|
118
|
-
[x: `uint104[${string}]`]: undefined;
|
|
119
|
-
[x: `uint112[${string}]`]: undefined;
|
|
120
|
-
[x: `uint120[${string}]`]: undefined;
|
|
121
|
-
[x: `uint128[${string}]`]: undefined;
|
|
122
|
-
[x: `uint136[${string}]`]: undefined;
|
|
123
|
-
[x: `uint144[${string}]`]: undefined;
|
|
124
|
-
[x: `uint152[${string}]`]: undefined;
|
|
125
|
-
[x: `uint160[${string}]`]: undefined;
|
|
126
|
-
[x: `uint168[${string}]`]: undefined;
|
|
127
|
-
[x: `uint176[${string}]`]: undefined;
|
|
128
|
-
[x: `uint184[${string}]`]: undefined;
|
|
129
|
-
[x: `uint192[${string}]`]: undefined;
|
|
130
|
-
[x: `uint200[${string}]`]: undefined;
|
|
131
|
-
[x: `uint208[${string}]`]: undefined;
|
|
132
|
-
[x: `uint216[${string}]`]: undefined;
|
|
133
|
-
[x: `uint224[${string}]`]: undefined;
|
|
134
|
-
[x: `uint232[${string}]`]: undefined;
|
|
135
|
-
[x: `uint240[${string}]`]: undefined;
|
|
136
|
-
[x: `uint248[${string}]`]: undefined;
|
|
137
|
-
string?: undefined;
|
|
138
|
-
address?: undefined;
|
|
139
|
-
uint64?: undefined;
|
|
140
|
-
bytes32?: undefined;
|
|
141
|
-
bytes?: undefined;
|
|
142
|
-
uint256?: undefined;
|
|
143
|
-
bytes4?: undefined;
|
|
144
|
-
bool?: undefined;
|
|
145
|
-
bytes1?: undefined;
|
|
146
|
-
uint32?: undefined;
|
|
147
|
-
bytes2?: undefined;
|
|
148
|
-
bytes3?: undefined;
|
|
149
|
-
bytes5?: undefined;
|
|
150
|
-
bytes6?: undefined;
|
|
151
|
-
bytes11?: undefined;
|
|
152
|
-
bytes7?: undefined;
|
|
153
|
-
bytes9?: undefined;
|
|
154
|
-
bytes27?: undefined;
|
|
155
|
-
bytes22?: undefined;
|
|
156
|
-
bytes8?: undefined;
|
|
157
|
-
bytes10?: undefined;
|
|
158
|
-
bytes12?: undefined;
|
|
159
|
-
bytes13?: undefined;
|
|
160
|
-
bytes14?: undefined;
|
|
161
|
-
bytes15?: undefined;
|
|
162
|
-
bytes16?: undefined;
|
|
163
|
-
bytes17?: undefined;
|
|
164
|
-
bytes18?: undefined;
|
|
165
|
-
bytes19?: undefined;
|
|
166
|
-
bytes20?: undefined;
|
|
167
|
-
bytes21?: undefined;
|
|
168
|
-
bytes23?: undefined;
|
|
169
|
-
bytes24?: undefined;
|
|
170
|
-
bytes25?: undefined;
|
|
171
|
-
bytes26?: undefined;
|
|
172
|
-
bytes28?: undefined;
|
|
173
|
-
bytes29?: undefined;
|
|
174
|
-
bytes30?: undefined;
|
|
175
|
-
bytes31?: undefined;
|
|
176
|
-
int8?: undefined;
|
|
177
|
-
int16?: undefined;
|
|
178
|
-
int24?: undefined;
|
|
179
|
-
int32?: undefined;
|
|
180
|
-
int40?: undefined;
|
|
181
|
-
int48?: undefined;
|
|
182
|
-
int56?: undefined;
|
|
183
|
-
int64?: undefined;
|
|
184
|
-
int72?: undefined;
|
|
185
|
-
int80?: undefined;
|
|
186
|
-
int88?: undefined;
|
|
187
|
-
int96?: undefined;
|
|
188
|
-
int104?: undefined;
|
|
189
|
-
int112?: undefined;
|
|
190
|
-
int120?: undefined;
|
|
191
|
-
int128?: undefined;
|
|
192
|
-
int136?: undefined;
|
|
193
|
-
int144?: undefined;
|
|
194
|
-
int152?: undefined;
|
|
195
|
-
int160?: undefined;
|
|
196
|
-
int168?: undefined;
|
|
197
|
-
int176?: undefined;
|
|
198
|
-
int184?: undefined;
|
|
199
|
-
int192?: undefined;
|
|
200
|
-
int200?: undefined;
|
|
201
|
-
int208?: undefined;
|
|
202
|
-
int216?: undefined;
|
|
203
|
-
int224?: undefined;
|
|
204
|
-
int232?: undefined;
|
|
205
|
-
int240?: undefined;
|
|
206
|
-
int248?: undefined;
|
|
207
|
-
int256?: undefined;
|
|
208
|
-
uint8?: undefined;
|
|
209
|
-
uint16?: undefined;
|
|
210
|
-
uint24?: undefined;
|
|
211
|
-
uint40?: undefined;
|
|
212
|
-
uint48?: undefined;
|
|
213
|
-
uint56?: undefined;
|
|
214
|
-
uint72?: undefined;
|
|
215
|
-
uint80?: undefined;
|
|
216
|
-
uint88?: undefined;
|
|
217
|
-
uint96?: undefined;
|
|
218
|
-
uint104?: undefined;
|
|
219
|
-
uint112?: undefined;
|
|
220
|
-
uint120?: undefined;
|
|
221
|
-
uint128?: undefined;
|
|
222
|
-
uint136?: undefined;
|
|
223
|
-
uint144?: undefined;
|
|
224
|
-
uint152?: undefined;
|
|
225
|
-
uint160?: undefined;
|
|
226
|
-
uint168?: undefined;
|
|
227
|
-
uint176?: undefined;
|
|
228
|
-
uint184?: undefined;
|
|
229
|
-
uint192?: undefined;
|
|
230
|
-
uint200?: undefined;
|
|
231
|
-
uint208?: undefined;
|
|
232
|
-
uint216?: undefined;
|
|
233
|
-
uint224?: undefined;
|
|
234
|
-
uint232?: undefined;
|
|
235
|
-
uint240?: undefined;
|
|
236
|
-
uint248?: undefined;
|
|
237
|
-
}, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
|
|
32
|
+
signTypedData: <const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
|
|
238
33
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { packUOSignature, pack1271Signature, DEFAULT_OWNER_ENTITY_ID, } from "../utils.js";
|
|
1
|
+
import { concat, concatHex, hashMessage, hashTypedData, } from "viem";
|
|
3
2
|
import { SignatureType } from "../modules/utils.js";
|
|
3
|
+
import { DEFAULT_OWNER_ENTITY_ID, pack1271Signature, packUOSignature, } from "../utils.js";
|
|
4
4
|
/**
|
|
5
5
|
* Creates an object with methods for generating a dummy signature, signing user operation hashes, signing messages, and signing typed data.
|
|
6
6
|
*
|
|
@@ -70,8 +70,11 @@ export const nativeSMASigner = (signer, chain, accountAddress, deferredActionDat
|
|
|
70
70
|
// we don't apply the expected 1271 packing since deferred sigs use typed data sigs and don't expect the 1271 packing
|
|
71
71
|
signTypedData: async (typedDataDefinition) => {
|
|
72
72
|
// the accounts domain already gives replay protection across accounts for deferred actions, so we don't need to apply another wrapping
|
|
73
|
-
const isDeferredAction = typedDataDefinition
|
|
74
|
-
typedDataDefinition
|
|
73
|
+
const isDeferredAction = typedDataDefinition.primaryType === "DeferredAction" &&
|
|
74
|
+
typedDataDefinition.domain != null &&
|
|
75
|
+
// @ts-expect-error the domain type I think changed in viem, so this is not working correctly (TODO: fix this)
|
|
76
|
+
"verifyingContract" in typedDataDefinition.domain &&
|
|
77
|
+
typedDataDefinition.domain.verifyingContract === accountAddress;
|
|
75
78
|
return isDeferredAction
|
|
76
79
|
? concat([
|
|
77
80
|
SignatureType.EOA,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeSMASigner.js","sourceRoot":"","sources":["../../../../../src/ma-v2/account/nativeSMASigner.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"nativeSMASigner.js","sourceRoot":"","sources":["../../../../../src/ma-v2/account/nativeSMASigner.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,EACN,SAAS,EACT,WAAW,EACX,aAAa,GAKd,MAAM,MAAM,CAAC;AAEd,OAA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C;QACT,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n type Address,\n type Chain,\n concat,\n concatHex,\n hashMessage,\n hashTypedData,\n type Hex,\n type SignableMessage,\n type TypedData,\n type TypedDataDefinition,\n} from \"viem\";\n\nimport { SignatureType } from \"../modules/utils.js\";\nimport {\n DEFAULT_OWNER_ENTITY_ID,\n pack1271Signature,\n packUOSignature,\n} from \"../utils.js\";\n/**\n * Creates an object with methods for generating a dummy signature, signing user operation hashes, signing messages, and signing typed data.\n *\n * @example\n * ```ts\n * import { nativeSMASigner } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n *\n * const MNEMONIC = \"...\":\n *\n * const account = createModularAccountV2({ config });\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(MNEMONIC);\n *\n * const messageSigner = nativeSMASigner(signer, chain, account.address);\n * ```\n *\n * @param {SmartAccountSigner} signer Signer to use for signing operations\n * @param {Chain} chain Chain object for the signer\n * @param {Address} accountAddress address of the smart account using this signer\n * @param {Hex} deferredActionData optional deferred action data to prepend to the uo signatures\n * @returns {object} an object with methods for signing operations and managing signatures\n */\nexport const nativeSMASigner = (\n signer: SmartAccountSigner,\n chain: Chain,\n accountAddress: Address,\n deferredActionData?: Hex,\n) => {\n return {\n getDummySignature: (): Hex => {\n const sig = packUOSignature({\n // orderedHookData: [],\n validationSignature:\n \"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c\",\n });\n\n return deferredActionData ? concatHex([deferredActionData, sig]) : sig;\n },\n\n signUserOperationHash: async (uoHash: Hex): Promise<Hex> => {\n let sig = await signer\n .signMessage({ raw: uoHash })\n .then((signature: Hex) =>\n packUOSignature({\n // orderedHookData: [],\n validationSignature: signature,\n }),\n );\n\n if (deferredActionData) {\n sig = concatHex([deferredActionData, sig]);\n deferredActionData = undefined;\n }\n\n return sig;\n },\n\n // we apply the expected 1271 packing here since the account contract will expect it\n async signMessage({ message }: { message: SignableMessage }): Promise<Hex> {\n const hash = hashMessage(message);\n\n return pack1271Signature({\n validationSignature: await signer.signTypedData({\n domain: {\n chainId: Number(chain.id),\n verifyingContract: accountAddress,\n },\n types: {\n ReplaySafeHash: [{ name: \"hash\", type: \"bytes32\" }],\n },\n message: {\n hash,\n },\n primaryType: \"ReplaySafeHash\",\n }),\n entityId: DEFAULT_OWNER_ENTITY_ID,\n });\n },\n\n // TODO: maybe move \"sign deferred actions\" to a separate function?\n // we don't apply the expected 1271 packing since deferred sigs use typed data sigs and don't expect the 1271 packing\n signTypedData: async <\n const typedData extends TypedData | Record<string, unknown>,\n primaryType extends keyof typedData | \"EIP712Domain\" = keyof typedData,\n >(\n typedDataDefinition: TypedDataDefinition<typedData, primaryType>,\n ): Promise<Hex> => {\n // the accounts domain already gives replay protection across accounts for deferred actions, so we don't need to apply another wrapping\n const isDeferredAction =\n typedDataDefinition.primaryType === \"DeferredAction\" &&\n typedDataDefinition.domain != null &&\n // @ts-expect-error the domain type I think changed in viem, so this is not working correctly (TODO: fix this)\n \"verifyingContract\" in typedDataDefinition.domain &&\n typedDataDefinition.domain.verifyingContract === accountAddress;\n\n return isDeferredAction\n ? concat([\n SignatureType.EOA,\n await signer.signTypedData(typedDataDefinition),\n ])\n : pack1271Signature({\n validationSignature: await signer.signTypedData({\n domain: {\n chainId: Number(chain.id),\n verifyingContract: accountAddress,\n },\n types: {\n ReplaySafeHash: [{ name: \"hash\", type: \"bytes32\" }],\n },\n message: {\n hash: await hashTypedData(typedDataDefinition),\n },\n primaryType: \"ReplaySafeHash\",\n }),\n entityId: DEFAULT_OWNER_ENTITY_ID,\n });\n },\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predictAddress.js","sourceRoot":"","sources":["../../../../../src/ma-v2/account/predictAddress.ts"],"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,EAAE,SAAS;QACjB,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CACxB,YAAqB,EACrB,IAAY,EACZ,QAAgB;IAEhB,OAAO,SAAS,CACd,YAAY,CACV,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,EAChC,CAAC,YAAY,EAAE,IAAI,EAAE,QAAQ,CAAC,CAC/B,CACF,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,qBAA8B;IACtD,OAAO,uBAAuB,qBAAqB,CAAC,KAAK,CACvD,CAAC,CACF,sIAAsI,CAAC;AAC1I,CAAC;AAED,SAAS,iCAAiC,CACxC,qBAA8B,EAC9B,aAAkB;IAElB,OAAO,yBAAyB,qBAAqB,CAAC,KAAK,CACzD,CAAC,CACF,uIAAuI,aAAa,CAAC,KAAK,CACzJ,CAAC,CACF,EAAE,CAAC;AACN,CAAC;AAED,SAAS,+BAA+B,CAAC,CAAQ;IAC/C,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;AACJ,CAAC","sourcesContent":["import {\n encodePacked,\n getContractAddress,\n keccak256,\n type Address,\n type Hex,\n} from \"viem\";\n\nexport type PredictModularAccountV2AddressParams = {\n factoryAddress: Address;\n implementationAddress: Address; // Should be the implementation address of the account type you are predicting the address for.\n salt: bigint;\n} & (\n | {\n type: \"MA\";\n ownerAddress: Address;\n entityId: number;\n }\n | {\n type: \"SMA\";\n ownerAddress: Address;\n }\n | {\n type: \"WebAuthn\";\n ownerPublicKey: {\n x: bigint;\n y: bigint;\n };\n entityId: number;\n }\n);\n\nexport function predictModularAccountV2Address(\n params: PredictModularAccountV2AddressParams
|
|
1
|
+
{"version":3,"file":"predictAddress.js","sourceRoot":"","sources":["../../../../../src/ma-v2/account/predictAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,SAAS,GAGV,MAAM,MAAM,CAA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ACL,CAAC;AAED,SAAS,iBAAiB,CACxB,YAAqB,EACrB,IAAY,EACZ,QAAgB;IAEhB,OAAO,SAAS,CACd,YAAY,CACV,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,EAChC,CAAC,YAAY,EAAE,IAAI,EAAE,QAAQ,CAAC,CAC/B,CACF,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,qBAA8B;IACtD,OAAO,uBAAuB,qBAAqB,CAAC,KAAK,CACvD,CAAC,CACF,sIAAsI,CAAC;AAC1I,CAAC;AAED,SAAS,iCAAiC,CACxC,qBAA8B,EAC9B,aAAkB;IAElB,OAAO,yBAAyB,qBAAqB,CAAC,KAAK,CACzD,CAAC,CACF,uIAAuI,aAAa,CAAC,KAAK,CACzJ,CAAC,CACF,EAAE,CAAC;AACN,CAAC;AAED,SAAS,+BAA+B,CAAC,CAAQ;IAC/C,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;AACJ,CAAC","sourcesContent":["import {\n encodePacked,\n getContractAddress,\n keccak256,\n type Address,\n type Hex,\n} from \"viem\";\n\nexport type PredictModularAccountV2AddressParams = {\n factoryAddress: Address;\n implementationAddress: Address; // Should be the implementation address of the account type you are predicting the address for.\n salt: bigint;\n} & (\n | {\n type: \"MA\";\n ownerAddress: Address;\n entityId: number;\n }\n | {\n type: \"SMA\";\n ownerAddress: Address;\n }\n | {\n type: \"WebAuthn\";\n ownerPublicKey: {\n x: bigint;\n y: bigint;\n };\n entityId: number;\n }\n);\n\nexport function predictModularAccountV2Address(\n params: PredictModularAccountV2AddressParams,\n): Address {\n const { factoryAddress, salt, implementationAddress } = params;\n\n let combinedSalt: Hex;\n let initcode: Hex;\n\n // Note: prediction for MA and WebAuthn is currently untested, because they are not supported as an account type yet.\n // Prior to using this prediction logic, ensure that the counterfactual computation is correct by updating `predictAddress.test.ts` to include a test for MA and WebAuthn.\n switch (params.type) {\n case \"SMA\":\n // MAv2 factory uses max uint32 for SMA entityId\n combinedSalt = getCombinedSaltK1(params.ownerAddress, salt, 0xffffffff);\n const immutableArgs = params.ownerAddress;\n initcode = getProxyBytecodeWithImmutableArgs(\n implementationAddress,\n immutableArgs,\n );\n break;\n case \"MA\":\n combinedSalt = getCombinedSaltK1(\n params.ownerAddress,\n salt,\n params.entityId,\n );\n\n initcode = getProxyBytecode(implementationAddress);\n break;\n case \"WebAuthn\":\n const {\n ownerPublicKey: { x, y },\n } = params;\n\n combinedSalt = keccak256(\n encodePacked(\n [\"uint256\", \"uint256\", \"uint256\", \"uint32\"],\n [x, y, salt, params.entityId],\n ),\n );\n\n initcode = getProxyBytecode(implementationAddress);\n\n break;\n default:\n return assertNeverModularAccountV2Type(params);\n }\n\n return getContractAddress({\n from: factoryAddress,\n opcode: \"CREATE2\",\n salt: combinedSalt,\n bytecode: initcode,\n });\n}\n\nfunction getCombinedSaltK1(\n ownerAddress: Address,\n salt: bigint,\n entityId: number,\n): Hex {\n return keccak256(\n encodePacked(\n [\"address\", \"uint256\", \"uint32\"],\n [ownerAddress, salt, entityId],\n ),\n );\n}\n\nfunction getProxyBytecode(implementationAddress: Address): Hex {\n return `0x603d3d8160223d3973${implementationAddress.slice(\n 2,\n )}60095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3`;\n}\n\nfunction getProxyBytecodeWithImmutableArgs(\n implementationAddress: Address,\n immutableArgs: Hex,\n): Hex {\n return `0x6100513d8160233d3973${implementationAddress.slice(\n 2,\n )}60095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3${immutableArgs.slice(\n 2,\n )}`;\n}\n\nfunction assertNeverModularAccountV2Type(_: never): never {\n throw new Error(\n \"Unknown modular account type in predictModularAccountV2Address\",\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferralActions.js","sourceRo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B,iBAAiB,CAAC;oBAChB,QAAQ;oBACR,QAAQ;oBACR,kBAAkB;oBAClB,gBAAgB;iBACjB,CAAC;aACH;SACF,CAAC,CAAC;QAEH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QAED,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC;YACnB,QAAQ,EAAE,WAAW,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;SACjD,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO;QACL,mCAAmC;QACnC,qCAAqC;QACrC,oCAAoC;QACpC,mBAAmB;KACpB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n InvalidNonceKeyError,\n EntryPointNotFoundError,\n type UserOperationCallData,\n type BatchUserOperationCallData,\n type UserOperationRequest_v7,\n} from \"@aa-sdk/core\";\nimport {\n type Address,\n type Hex,\n concatHex,\n maxUint152,\n encodePacked,\n size,\n toHex,\n encodeDeployData,\n hexToNumber,\n} from \"viem\";\nimport { entityIdAndNonceReaderBytecode, buildFullNonceKey } from \"../utils.js\";\nimport { entityIdAndNonceReaderAbi } from \"../abis/entityIdAndNonceReader.js\";\nimport type { ModularAccountV2Client } from \"../client/client.js\";\n\nexport type DeferredActionTypedData = {\n domain: {\n chainId: number;\n verifyingContract: Address;\n };\n types: {\n DeferredAction: [\n { name: \"nonce\"; type: \"uint256\" },\n { name: \"deadline\"; type: \"uint48\" },\n { name: \"call\"; type: \"bytes\" }\n ];\n };\n primaryType: \"DeferredAction\";\n message: {\n nonce: bigint;\n deadline: number;\n call: Hex;\n };\n};\n\nexport type DeferredActionReturnData = {\n typedData: DeferredActionTypedData;\n};\n\nexport type CreateDeferredActionTypedDataParams = {\n callData: Hex;\n deadline: number;\n nonce: bigint;\n};\n\nexport type BuildPreSignatureDeferredActionDigestParams = {\n typedData: DeferredActionTypedData;\n};\n\nexport type BuildUserOperationWithDeferredActionParams = {\n uo: UserOperationCallData | BatchUserOperationCallData;\n signaturePrepend: Hex;\n nonceOverride: bigint;\n};\n\nexport type EntityIdAndNonceParams = {\n entityId?: number;\n nonceKey?: bigint;\n isGlobalValidation: boolean;\n isDeferredAction?: boolean;\n};\n\nexport type DeferralActions = {\n createDeferredActionTypedDataObject: (\n args: CreateDeferredActionTypedDataParams\n ) => Promise<DeferredActionReturnData>;\n buildPreSignatureDeferredActionDigest: (\n args: BuildPreSignatureDeferredActionDigestParams\n ) => Hex;\n buildUserOperationWithDeferredAction: (\n args: BuildUserOperationWithDeferredActionParams\n ) => Promise<UserOperationRequest_v7>;\n getEntityIdAndNonce: (\n args: EntityIdAndNonceParams\n ) => Promise<{ nonce: bigint; entityId: number }>;\n};\n\n/**\n * Provides deferred action functionalities for a MA v2 client, ensuring compatibility with `SmartAccountClient`.\n *\n * @param {ModularAccountV2Client} client - The client instance which provides account and sendUserOperation functionality.\n * @returns {object} - An object containing three methods: `createDeferredActionTypedDataObject`, `buildDeferredActionDigest`, and `buildUserOperationWithDeferredAction`.\n */\nexport const deferralActions: (\n client: ModularAccountV2Client\n) => DeferralActions = (client: ModularAccountV2Client): DeferralActions => {\n const createDeferredActionTypedDataObject = async ({\n callData,\n deadline,\n nonce,\n }: CreateDeferredActionTypedDataParams): Promise<DeferredActionReturnData> => {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n\n const entryPoint = client.account.getEntryPoint();\n if (entryPoint === undefined) {\n throw new EntryPointNotFoundError(client.chain, \"0.7.0\");\n }\n\n return {\n typedData: {\n domain: {\n chainId: await client.getChainId(),\n verifyingContract: client.account.address,\n },\n types: {\n DeferredAction: [\n { name: \"nonce\", type: \"uint256\" },\n { name: \"deadline\", type: \"uint48\" },\n { name: \"call\", type: \"bytes\" },\n ],\n },\n primaryType: \"DeferredAction\",\n message: {\n nonce: nonce,\n deadline: deadline,\n call: callData,\n },\n },\n };\n };\n\n const buildPreSignatureDeferredActionDigest = ({\n typedData,\n }: BuildPreSignatureDeferredActionDigestParams): Hex => {\n const signerEntity = client.account.signerEntity;\n const validationLocator =\n (BigInt(signerEntity.entityId) << 8n) |\n (signerEntity.isGlobalValidation ? 1n : 0n);\n\n const encodedCallData = encodePacked(\n [\"uint168\", \"uint48\", \"bytes\"],\n [validationLocator, typedData.message.deadline, typedData.message.call]\n );\n\n const encodedDataLength = size(encodedCallData);\n const encodedData = concatHex([\n toHex(encodedDataLength, { size: 4 }),\n encodedCallData,\n ]);\n return encodedData;\n };\n\n /**\n * Builds a user operation with a deferred action by wrapping buildUserOperation() with a dummy signature override.\n *\n * @param {object} args The argument object containing the following:\n * @param {UserOperationCallData | BatchUserOperationCallData} args.uo The user operation call data to build\n * @param {Hex} args.signaturePrepend The signature data to prepend to the dummy signature\n * @param {bigint} args.nonceOverride The nonce to override in the user operation, generally given from the typed data builder\n * @returns {Promise<UserOperationRequest_v7>} The unsigned user operation request with the deferred action\n */\n const buildUserOperationWithDeferredAction = async ({\n uo,\n signaturePrepend,\n nonceOverride,\n }: BuildUserOperationWithDeferredActionParams): Promise<UserOperationRequest_v7> => {\n // Check if client.account is defined\n if (client.account === undefined) {\n throw new AccountNotFoundError();\n }\n\n // Pre-fetch the dummy sig so we can override `client.account.getDummySignature()`\n const dummySig = await client.account.getDummySignature();\n\n // Cache the previous dummy signature getter\n const previousDummySigGetter = client.account.getDummySignature;\n\n // Override client.account.getDummySignature() so `client.buildUserOperation()` uses the prepended hex and the dummy signature during gas estimation\n client.account.getDummySignature = () => {\n return concatHex([signaturePrepend, dummySig as Hex]);\n };\n\n const unsignedUo = (await client.buildUserOperation({\n uo: uo,\n overrides: {\n nonce: nonceOverride,\n },\n })) as UserOperationRequest_v7;\n\n // Restore the dummy signature getter\n client.account.getDummySignature = previousDummySigGetter;\n\n return unsignedUo;\n };\n\n const getEntityIdAndNonce = async ({\n entityId = 1,\n nonceKey = 0n,\n isGlobalValidation,\n isDeferredAction = true,\n }: EntityIdAndNonceParams) => {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n\n if (nonceKey > maxUint152) {\n throw new InvalidNonceKeyError(nonceKey);\n }\n\n const entryPoint = client.account.getEntryPoint();\n if (entryPoint === undefined) {\n throw new EntryPointNotFoundError(client.chain, \"0.7.0\");\n }\n\n const bytecode = encodeDeployData({\n abi: entityIdAndNonceReaderAbi,\n bytecode: entityIdAndNonceReaderBytecode,\n args: [\n client.account.address,\n entryPoint.address,\n buildFullNonceKey({\n nonceKey,\n entityId,\n isGlobalValidation,\n isDeferredAction,\n }),\n ],\n });\n\n const { data } = await client.call({ data: bytecode });\n if (!data) {\n throw new Error(\"No data returned from contract call\");\n }\n\n return {\n nonce: BigInt(data),\n entityId: hexToNumber(`0x${data.slice(40, 48)}`),\n };\n };\n\n return {\n createDeferredActionTypedDataObject,\n buildPreSignatureDeferredActionDigest,\n buildUserOperationWithDeferredAction,\n getEntityIdAndNonce,\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"deferralActions.js","sourceRoot":"","sources":["../../../../../src/ma-v2/actions/deferralActions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,GAIxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,IAAI,EACJ,KAAK,EACL,gBAAgB,EAChB,WAAW,GACZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAiE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAEL,CAAC,MAA8B,EAAmB,EAAE;IACzE,MAAM,mCAAmC,GAA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AC;IACJ,CAAC,CAAC;IAEF,OAAO;QACL,mCAAmC;QACnC,qCAAqC;QACrC,oCAAoC;QACpC,mBAAmB;KACpB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n InvalidNonceKeyError,\n EntryPointNotFoundError,\n type UserOperationCallData,\n type BatchUserOperationCallData,\n type UserOperationRequest_v7,\n} from \"@aa-sdk/core\";\nimport {\n type Address,\n type Hex,\n concatHex,\n maxUint152,\n encodePacked,\n size,\n toHex,\n encodeDeployData,\n hexToNumber,\n} from \"viem\";\nimport { entityIdAndNonceReaderBytecode, buildFullNonceKey } from \"../utils.js\";\nimport { entityIdAndNonceReaderAbi } from \"../abis/entityIdAndNonceReader.js\";\nimport type { ModularAccountV2Client } from \"../client/client.js\";\n\nexport type DeferredActionTypedData = {\n domain: {\n chainId: number;\n verifyingContract: Address;\n };\n types: {\n DeferredAction: [\n { name: \"nonce\"; type: \"uint256\" },\n { name: \"deadline\"; type: \"uint48\" },\n { name: \"call\"; type: \"bytes\" },\n ];\n };\n primaryType: \"DeferredAction\";\n message: {\n nonce: bigint;\n deadline: number;\n call: Hex;\n };\n};\n\nexport type DeferredActionReturnData = {\n typedData: DeferredActionTypedData;\n};\n\nexport type CreateDeferredActionTypedDataParams = {\n callData: Hex;\n deadline: number;\n nonce: bigint;\n};\n\nexport type BuildPreSignatureDeferredActionDigestParams = {\n typedData: DeferredActionTypedData;\n};\n\nexport type BuildUserOperationWithDeferredActionParams = {\n uo: UserOperationCallData | BatchUserOperationCallData;\n signaturePrepend: Hex;\n nonceOverride: bigint;\n};\n\nexport type EntityIdAndNonceParams = {\n entityId?: number;\n nonceKey?: bigint;\n isGlobalValidation: boolean;\n isDeferredAction?: boolean;\n};\n\nexport type DeferralActions = {\n createDeferredActionTypedDataObject: (\n args: CreateDeferredActionTypedDataParams,\n ) => Promise<DeferredActionReturnData>;\n buildPreSignatureDeferredActionDigest: (\n args: BuildPreSignatureDeferredActionDigestParams,\n ) => Hex;\n buildUserOperationWithDeferredAction: (\n args: BuildUserOperationWithDeferredActionParams,\n ) => Promise<UserOperationRequest_v7>;\n getEntityIdAndNonce: (\n args: EntityIdAndNonceParams,\n ) => Promise<{ nonce: bigint; entityId: number }>;\n};\n\n/**\n * Provides deferred action functionalities for a MA v2 client, ensuring compatibility with `SmartAccountClient`.\n *\n * @param {ModularAccountV2Client} client - The client instance which provides account and sendUserOperation functionality.\n * @returns {object} - An object containing three methods: `createDeferredActionTypedDataObject`, `buildDeferredActionDigest`, and `buildUserOperationWithDeferredAction`.\n */\nexport const deferralActions: (\n client: ModularAccountV2Client,\n) => DeferralActions = (client: ModularAccountV2Client): DeferralActions => {\n const createDeferredActionTypedDataObject = async ({\n callData,\n deadline,\n nonce,\n }: CreateDeferredActionTypedDataParams): Promise<DeferredActionReturnData> => {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n\n const entryPoint = client.account.getEntryPoint();\n if (entryPoint === undefined) {\n throw new EntryPointNotFoundError(client.chain, \"0.7.0\");\n }\n\n return {\n typedData: {\n domain: {\n chainId: await client.getChainId(),\n verifyingContract: client.account.address,\n },\n types: {\n DeferredAction: [\n { name: \"nonce\", type: \"uint256\" },\n { name: \"deadline\", type: \"uint48\" },\n { name: \"call\", type: \"bytes\" },\n ],\n },\n primaryType: \"DeferredAction\",\n message: {\n nonce: nonce,\n deadline: deadline,\n call: callData,\n },\n },\n };\n };\n\n const buildPreSignatureDeferredActionDigest = ({\n typedData,\n }: BuildPreSignatureDeferredActionDigestParams): Hex => {\n const signerEntity = client.account.signerEntity;\n const validationLocator =\n (BigInt(signerEntity.entityId) << 8n) |\n (signerEntity.isGlobalValidation ? 1n : 0n);\n\n const encodedCallData = encodePacked(\n [\"uint168\", \"uint48\", \"bytes\"],\n [validationLocator, typedData.message.deadline, typedData.message.call],\n );\n\n const encodedDataLength = size(encodedCallData);\n const encodedData = concatHex([\n toHex(encodedDataLength, { size: 4 }),\n encodedCallData,\n ]);\n return encodedData;\n };\n\n /**\n * Builds a user operation with a deferred action by wrapping buildUserOperation() with a dummy signature override.\n *\n * @param {object} args The argument object containing the following:\n * @param {UserOperationCallData | BatchUserOperationCallData} args.uo The user operation call data to build\n * @param {Hex} args.signaturePrepend The signature data to prepend to the dummy signature\n * @param {bigint} args.nonceOverride The nonce to override in the user operation, generally given from the typed data builder\n * @returns {Promise<UserOperationRequest_v7>} The unsigned user operation request with the deferred action\n */\n const buildUserOperationWithDeferredAction = async ({\n uo,\n signaturePrepend,\n nonceOverride,\n }: BuildUserOperationWithDeferredActionParams): Promise<UserOperationRequest_v7> => {\n // Check if client.account is defined\n if (client.account === undefined) {\n throw new AccountNotFoundError();\n }\n\n // Pre-fetch the dummy sig so we can override `client.account.getDummySignature()`\n const dummySig = await client.account.getDummySignature();\n\n // Cache the previous dummy signature getter\n const previousDummySigGetter = client.account.getDummySignature;\n\n // Override client.account.getDummySignature() so `client.buildUserOperation()` uses the prepended hex and the dummy signature during gas estimation\n client.account.getDummySignature = () => {\n return concatHex([signaturePrepend, dummySig as Hex]);\n };\n\n const unsignedUo = (await client.buildUserOperation({\n uo: uo,\n overrides: {\n nonce: nonceOverride,\n },\n })) as UserOperationRequest_v7;\n\n // Restore the dummy signature getter\n client.account.getDummySignature = previousDummySigGetter;\n\n return unsignedUo;\n };\n\n const getEntityIdAndNonce = async ({\n entityId = 1,\n nonceKey = 0n,\n isGlobalValidation,\n isDeferredAction = true,\n }: EntityIdAndNonceParams) => {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n\n if (nonceKey > maxUint152) {\n throw new InvalidNonceKeyError(nonceKey);\n }\n\n const entryPoint = client.account.getEntryPoint();\n if (entryPoint === undefined) {\n throw new EntryPointNotFoundError(client.chain, \"0.7.0\");\n }\n\n const bytecode = encodeDeployData({\n abi: entityIdAndNonceReaderAbi,\n bytecode: entityIdAndNonceReaderBytecode,\n args: [\n client.account.address,\n entryPoint.address,\n buildFullNonceKey({\n nonceKey,\n entityId,\n isGlobalValidation,\n isDeferredAction,\n }),\n ],\n });\n\n const { data } = await client.call({ data: bytecode });\n if (!data) {\n throw new Error(\"No data returned from contract call\");\n }\n\n return {\n nonce: BigInt(data),\n entityId: hexToNumber(`0x${data.slice(40, 48)}`),\n };\n };\n\n return {\n createDeferredActionTypedDataObject,\n buildPreSignatureDeferredActionDigest,\n buildUserOperationWithDeferredAction,\n getEntityIdAndNonce,\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installValidation.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/actions/install-validation/installValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,GAKtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,kBAAkB,EAClB,SAAS,EACT,WAAW,GACZ,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAA+B,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAyB,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AA+CzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAII,CAAC,MAAM,EAAE,EAAE;IAClD,MAAM,uBAAuB,GAAG,KAAK,EAAE,EACrC,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,KAAK,EACL,OAAO,GAAG,MAAM,CAAC,OAAO,GACA,EAAE,EAAE;QAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,u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C;IACJ,CAAC,CAAC;IAEF,OAAO;QACL,uBAAuB;QACvB,yBAAyB;QACzB,iBAAiB,EAAE,KAAK,EAAE,EACxB,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,KAAK,EACL,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,SAAS,GACV,EAAE,EAAE;YACH,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAAC;gBAC7C,gBAAgB;gBAChB,SAAS;gBACT,WAAW;gBACX,KAAK;gBACL,OAAO;aACR,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,iBAAiB,CAAC;gBAC9B,EAAE,EAAE,QAAQ;gBACZ,OAAO;gBACP,SAAS;aACV,CAAC,CAAC;QACL,CAAC;QAED,mBAAmB,EAAE,KAAK,EAAE,EAC1B,aAAa,EACb,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,SAAS,GACV,EAAE,EAAE;YACH,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC;gBAC/C,aAAa;gBACb,QAAQ;gBACR,aAAa;gBACb,kBAAkB;gBAClB,OAAO;aACR,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,iBAAiB,CAAC;gBAC9B,EAAE,EAAE,QAAQ;gBACZ,OAAO;gBACP,SAAS;aACV,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n EntityIdOverrideError,\n type GetEntryPointFromAccount,\n type SendUserOperationResult,\n type UserOperationOverridesParameter,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n type Address,\n type Hex,\n encodeFunctionData,\n concatHex,\n zeroAddress,\n} from \"viem\";\n\nimport { semiModularAccountBytecodeAbi } from \"../../abis/semiModularAccountBytecodeAbi.js\";\nimport type { HookConfig, ValidationConfig } from \"../common/types.js\";\nimport {\n serializeValidationConfig,\n serializeHookConfig,\n serializeModuleEntity,\n} from \"../common/utils.js\";\n\nimport { type ModularAccountV2Client } from \"../../client/client.js\";\nimport { type ModularAccountV2 } from \"../../account/common/modularAccountV2Base.js\";\nimport { DEFAULT_OWNER_ENTITY_ID } from \"../../utils.js\";\n\nexport type InstallValidationParams<\n TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
1
|
+
{"version":3,"file":"installValidation.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/actions/install-validation/installValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,GAKtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,kBAAkB,EAClB,SAAS,EACT,WAAW,GACZ,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAA+B,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAyB,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AA+CzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAII,CAAC,MAAM,EAAE,EAAE;IAClD,MAAM,uBAAuB,GAAG,KAAK,EAAE,EACrC,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,KAAK,EACL,OAAO,GAAG,MAAM,CAAC,OAAO,GACA,EAAE,EAAE;QAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,uBAAuB,CAC/B,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,CACP,CAAC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;QACzB,iBAAiB,EAAE,KAAK,EAAE,EACxB,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,KAAK,EACL,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,SAAS,GACV,EAAE,EAAE;YACH,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAAC;gBAC7C,gBAAgB;gBAChB,SAAS;gBACT,WAAW;gBACX,KAAK;gBACL,OAAO;aACR,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,iBAAiB,CAAC;gBAC9B,EAAE,EAAE,QAAQ;gBACZ,OAAO;gBACP,SAAS;aACV,CAAC,CAAC;QACL,CAAC;QAED,mBAAmB,EAAE,KAAK,EAAE,EAC1B,aAAa,EACb,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,SAAS,GACV,EAAE,EAAE;YACH,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC;gBAC/C,aAAa;gBACb,QAAQ;gBACR,aAAa;gBACb,kBAAkB;gBAClB,OAAO;aACR,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,iBAAiB,CAAC;gBAC9B,EAAE,EAAE,QAAQ;gBACZ,OAAO;gBACP,SAAS;aACV,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n EntityIdOverrideError,\n type GetEntryPointFromAccount,\n type SendUserOperationResult,\n type UserOperationOverridesParameter,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n type Address,\n type Hex,\n encodeFunctionData,\n concatHex,\n zeroAddress,\n} from \"viem\";\n\nimport { semiModularAccountBytecodeAbi } from \"../../abis/semiModularAccountBytecodeAbi.js\";\nimport type { HookConfig, ValidationConfig } from \"../common/types.js\";\nimport {\n serializeValidationConfig,\n serializeHookConfig,\n serializeModuleEntity,\n} from \"../common/utils.js\";\n\nimport { type ModularAccountV2Client } from \"../../client/client.js\";\nimport { type ModularAccountV2 } from \"../../account/common/modularAccountV2Base.js\";\nimport { DEFAULT_OWNER_ENTITY_ID } from \"../../utils.js\";\n\nexport type InstallValidationParams<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n> = {\n validationConfig: ValidationConfig;\n selectors: Hex[];\n installData: Hex;\n hooks: {\n hookConfig: HookConfig;\n initData: Hex;\n }[];\n account?: ModularAccountV2<TSigner> | undefined;\n} & UserOperationOverridesParameter<\n GetEntryPointFromAccount<ModularAccountV2<TSigner>>\n>;\n\nexport type UninstallValidationParams<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n> = {\n moduleAddress: Address;\n entityId: number;\n uninstallData: Hex;\n hookUninstallDatas: Hex[];\n account?: ModularAccountV2<TSigner> | undefined;\n} & UserOperationOverridesParameter<\n GetEntryPointFromAccount<ModularAccountV2<TSigner>>\n>;\n\nexport type InstallValidationActions<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n> = {\n installValidation: (\n args: InstallValidationParams<TSigner>,\n ) => Promise<SendUserOperationResult>;\n encodeInstallValidation: (\n // TODO: omit the user op sending related parameters from this type\n args: InstallValidationParams<TSigner>,\n ) => Promise<Hex>;\n uninstallValidation: (\n args: UninstallValidationParams<TSigner>,\n ) => Promise<SendUserOperationResult>;\n encodeUninstallValidation: (\n args: UninstallValidationParams<TSigner>,\n ) => Promise<Hex>;\n};\n\n/**\n * Provides validation installation and uninstallation functionalities for a MA v2 client, ensuring compatibility with `SmartAccountClient`.\n *\n * @example\n * ```ts\n * import { createModularAccountV2Client, installValidationActions, getDefaultSingleSignerValidationModuleAddress, SingleSignerValidationModule } from \"@account-kit/smart-contracts\";\n * import { Address } from \"viem\";\n *\n * const client = (await createModularAccountV2Client({ ... })).extend(installValidationActions);\n * const sessionKeyAddress: Address = \"0x1234\";\n * const sessionKeyEntityId: number = 1;\n *\n * await client.installValidation({\n * validationConfig: {\n * moduleAddress: getDefaultSingleSignerValidationModuleAddress(\n * client.chain\n * ),\n * entityId: sessionKeyEntityId,\n * isGlobal: true,\n * isSignatureValidation: false,\n * isUserOpValidation: true,\n * },\n * selectors: [],\n * installData: SingleSignerValidationModule.encodeOnInstallData({\n * entityId: sessionKeyEntityId,\n * signer: sessionKeyAddress,\n * }),\n * hooks: [],\n * });\n *\n * await client.uninstallValidation({\n * moduleAddress: sessionKeyAddress,\n * entityId: sessionKeyEntityId,\n * uninstallData: SingleSignerValidationModule.encodeOnUninstallData({\n * entityId: sessionKeyEntityId,\n * }),\n * hookUninstallDatas: [],\n * });\n *\n * ```\n *\n * @param {object} client - The client instance which provides account and sendUserOperation functionality.\n * @returns {object} - An object containing two methods, `installValidation` and `uninstallValidation`.\n */\nexport const installValidationActions: <\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n>(\n client: ModularAccountV2Client<TSigner>,\n) => InstallValidationActions<TSigner> = (client) => {\n const encodeInstallValidation = async ({\n validationConfig,\n selectors,\n installData,\n hooks,\n account = client.account,\n }: InstallValidationParams) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"installValidation\",\n client,\n );\n }\n\n // an entityId of zero is only allowed if we're installing or uninstalling hooks on the fallback validation\n if (\n validationConfig.entityId === DEFAULT_OWNER_ENTITY_ID &&\n validationConfig.moduleAddress !== zeroAddress\n ) {\n throw new EntityIdOverrideError();\n }\n\n return account.encodeCallData(\n encodeFunctionData({\n abi: semiModularAccountBytecodeAbi,\n functionName: \"installValidation\",\n args: [\n serializeValidationConfig(validationConfig),\n selectors,\n installData,\n hooks.map((hook: { hookConfig: HookConfig; initData: Hex }) =>\n concatHex([serializeHookConfig(hook.hookConfig), hook.initData]),\n ),\n ],\n }),\n );\n };\n\n const encodeUninstallValidation = async ({\n moduleAddress,\n entityId,\n uninstallData,\n hookUninstallDatas,\n account = client.account,\n }: UninstallValidationParams) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"uninstallValidation\",\n client,\n );\n }\n\n return account.encodeCallData(\n encodeFunctionData({\n abi: semiModularAccountBytecodeAbi,\n functionName: \"uninstallValidation\",\n args: [\n serializeModuleEntity({\n moduleAddress,\n entityId,\n }),\n uninstallData,\n hookUninstallDatas,\n ],\n }),\n );\n };\n\n return {\n encodeInstallValidation,\n encodeUninstallValidation,\n installValidation: async ({\n validationConfig,\n selectors,\n installData,\n hooks,\n account = client.account,\n overrides,\n }) => {\n const callData = await encodeInstallValidation({\n validationConfig,\n selectors,\n installData,\n hooks,\n account,\n });\n\n return client.sendUserOperation({\n uo: callData,\n account,\n overrides,\n });\n },\n\n uninstallValidation: async ({\n moduleAddress,\n entityId,\n uninstallData,\n hookUninstallDatas,\n account = client.account,\n overrides,\n }) => {\n const callData = await encodeUninstallValidation({\n moduleAddress,\n entityId,\n uninstallData,\n hookUninstallDatas,\n account,\n });\n\n return client.sendUserOperation({\n uo: callData,\n account,\n overrides,\n });\n },\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/ma-v2/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAA8B,MAAM,MAAM,CAAC;AAElD,OAAO,EACL,sBAAsB,GAEvB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,+BAA+B,EAC/B,kBAAkB,GAInB,MAAM,oBAAoB,CAAC;AAsD5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,MAE6C;IAE7C,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEpC,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAErD,MAAM,kBAAkB,GACtB,MAAM,CAAC,IAAI,KAAK,MAAM;QACpB,CAAC,CAAC;YACE,YAAY,EAAE,uBAAuB,CAAC,MAAM,CAAC,YAAY,CAAC;YAC1D,iBAAiB,EAAE,uBAAuB,CAAC,MAAM,CAAC,iBAAiB,CAAC;SACrE;QACH,CAAC,CAAC,EAAE,CAAC;IAET,IAAI,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,+BAA+B,CAAC;YACrC,GAAG,MAAM;YACT,SAAS;YACT,KAAK;YACL,OAAO;YACP,GAAG,kBAAkB;SACtB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,OAAO;QACP,GAAG,kBAAkB;KACtB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n type SmartAccountClient,\n type SmartAccountSigner,\n type SmartAccountClientConfig,\n type NotType,\n createSmartAccountClient,\n default7702GasEstimator,\n default7702UserOpSigner,\n} from \"@aa-sdk/core\";\nimport { type Chain, type Transport } from \"viem\";\n\nimport {\n createModularAccountV2,\n type CreateModularAccountV2Params,\n} from \"../account/modularAccountV2.js\";\n\nimport {\n createAlchemySmartAccountClient,\n isAlchemyTransport,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\nimport type { LightAccount } from \"../../light-account/accounts/account.js\";\n\nimport type { ModularAccountV2 } from \"../account/common/modularAccountV2Base.js\";\n\nexport type ModularAccountV2Client<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TChain extends Chain = Chain,\n TTransport extends Transport | AlchemyTransport = Transport
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/ma-v2/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAA8B,MAAM,MAAM,CAAC;AAElD,OAAO,EACL,sBAAsB,GAEvB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,+BAA+B,EAC/B,kBAAkB,GAInB,MAAM,oBAAoB,CAAC;AAsD5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,MAE6C;IAE7C,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEpC,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAErD,MAAM,kBAAkB,GACtB,MAAM,CAAC,IAAI,KAAK,MAAM;QACpB,CAAC,CAAC;YACE,YAAY,EAAE,uBAAuB,CAAC,MAAM,CAAC,YAAY,CAAC;YAC1D,iBAAiB,EAAE,uBAAuB,CAAC,MAAM,CAAC,iBAAiB,CAAC;SACrE;QACH,CAAC,CAAC,EAAE,CAAC;IAET,IAAI,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,+BAA+B,CAAC;YACrC,GAAG,MAAM;YACT,SAAS;YACT,KAAK;YACL,OAAO;YACP,GAAG,kBAAkB;SACtB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,OAAO;QACP,GAAG,kBAAkB;KACtB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n type SmartAccountClient,\n type SmartAccountSigner,\n type SmartAccountClientConfig,\n type NotType,\n createSmartAccountClient,\n default7702GasEstimator,\n default7702UserOpSigner,\n} from \"@aa-sdk/core\";\nimport { type Chain, type Transport } from \"viem\";\n\nimport {\n createModularAccountV2,\n type CreateModularAccountV2Params,\n} from \"../account/modularAccountV2.js\";\n\nimport {\n createAlchemySmartAccountClient,\n isAlchemyTransport,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\nimport type { LightAccount } from \"../../light-account/accounts/account.js\";\n\nimport type { ModularAccountV2 } from \"../account/common/modularAccountV2Base.js\";\n\nexport type ModularAccountV2Client<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TChain extends Chain = Chain,\n TTransport extends Transport | AlchemyTransport = Transport,\n> = SmartAccountClient<TTransport, TChain, ModularAccountV2<TSigner>>;\n\nexport type CreateModularAccountV2ClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n> = CreateModularAccountV2Params<TTransport, TSigner> &\n Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n >;\n\nexport type CreateModularAccountV2AlchemyClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n> = Omit<\n CreateModularAccountV2ClientParams<TTransport, TChain, TSigner>,\n \"transport\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<TChain, LightAccount<TSigner>>,\n \"account\"\n > & { paymasterAndData?: never; dummyPaymasterAndData?: never };\n\nexport function createModularAccountV2Client<\n TChain extends Chain = Chain,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n>(\n args: CreateModularAccountV2AlchemyClientParams<\n AlchemyTransport,\n TChain,\n TSigner\n >,\n): Promise<ModularAccountV2Client<TSigner, TChain, AlchemyTransport>>;\n\nexport function createModularAccountV2Client<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n>(\n args: CreateModularAccountV2ClientParams<TTransport, TChain, TSigner> &\n NotType<TTransport, AlchemyTransport>,\n): Promise<ModularAccountV2Client<TSigner, TChain>>;\n\n/**\n * Creates a Modular Account V2 client using the provided configuration parameters.\n *\n * @example\n * ```ts twoslash\n * import { createModularAccountV2Client } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { alchemy, sepolia } from \"@account-kit/infra\";\n *\n * const MNEMONIC = \"...\";\n * const RPC_URL = \"...\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(MNEMONIC);\n *\n * const chain = sepolia;\n *\n * const transport = alchemy({ rpcUrl: RPC_URL });\n *\n * const policyId = \"...\";\n *\n * const modularAccountV2Client = await createModularAccountV2Client({\n * chain,\n * signer,\n * transport,\n * policyId, // NOTE: you may only pass in a gas policy ID if you provide an Alchemy transport!\n * });\n * ```\n *\n * @param {CreateModularAccountV2ClientParams} config The configuration parameters required to create the Modular Account v2 account client\n * @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` instance\n */\nexport async function createModularAccountV2Client(\n config:\n | CreateModularAccountV2ClientParams\n | CreateModularAccountV2AlchemyClientParams,\n): Promise<SmartAccountClient | AlchemySmartAccountClient> {\n const { transport, chain } = config;\n\n const account = await createModularAccountV2(config);\n\n const middlewareToAppend =\n config.mode === \"7702\"\n ? {\n gasEstimator: default7702GasEstimator(config.gasEstimator),\n signUserOperation: default7702UserOpSigner(config.signUserOperation),\n }\n : {};\n\n if (isAlchemyTransport(transport, chain)) {\n return createAlchemySmartAccountClient({\n ...config,\n transport,\n chain,\n account,\n ...middlewareToAppend,\n });\n }\n\n return createSmartAccountClient({\n ...config,\n account,\n ...middlewareToAppend,\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/allowlist-module/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,MAAM,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAmB,MAAM,+BAA+B,CAAC;AAE1E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,kBAAkB;IACvB,SAAS,EAAE,CACT,WASC,EACD,OAAgB,EAIhB,EAAE;QACF,MAAM,WAAW,GAAG,e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ChB,EAAE,IAAI,EAAE,MAAM,EAAE;oBAChB,EAAE,IAAI,EAAE,SAAS,EAAE;oBACnB,EAAE,IAAI,EAAE,UAAU,EAAE;iBACrB;aACF;SACF,EACD;YACE,QAAQ;YACR,MAAM,CAAC,GAAG,CACR,CAAC,KAAK,EAAE,EAAE,CACR;gBACE,KAAK,CAAC,MAAM;gBACZ,KAAK,CAAC,oBAAoB;gBAC1B,KAAK,CAAC,kBAAkB;gBACxB,KAAK,CAAC,eAAe;gBACrB,KAAK,CAAC,SAAS;aACP,CACb;SACF,CACF,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Address, type Hex } from \"viem\";\nimport { allowlistModuleAbi } from \"./abis/allowlistModuleAbi.js\";\nimport { HookType, type HookConfig } from \"../../actions/common/types.js\";\n\nexport const AllowlistModule = {\n abi: allowlistModuleAbi,\n buildHook: (\n installArgs: {\n entityId: number;\n inputs: Array<{\n target: Address;\n hasSelectorAllowlist: boolean;\n hasERC20SpendLimit: boolean;\n erc20SpendLimit: bigint;\n selectors: Array<Hex>;\n }>;\n },\n address: Address
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/allowlist-module/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,MAAM,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAmB,MAAM,+BAA+B,CAAC;AAE1E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,kBAAkB;IACvB,SAAS,EAAE,CACT,WASC,EACD,OAAgB,EAIhB,EAAE;QACF,MAAM,WAAW,GAAG,eAAe,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;QACrE,OAAO;YACL,UAAU,EAAE;gBACV,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,QAAQ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M,CAAC,GAAG,CACR,CAAC,KAAK,EAAE,EAAE,CACR;gBACE,KAAK,CAAC,MAAM;gBACZ,KAAK,CAAC,oBAAoB;gBAC1B,KAAK,CAAC,kBAAkB;gBACxB,KAAK,CAAC,eAAe;gBACrB,KAAK,CAAC,SAAS;aACP,CACb;SACF,CACF,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Address, type Hex } from \"viem\";\nimport { allowlistModuleAbi } from \"./abis/allowlistModuleAbi.js\";\nimport { HookType, type HookConfig } from \"../../actions/common/types.js\";\n\nexport const AllowlistModule = {\n abi: allowlistModuleAbi,\n buildHook: (\n installArgs: {\n entityId: number;\n inputs: Array<{\n target: Address;\n hasSelectorAllowlist: boolean;\n hasERC20SpendLimit: boolean;\n erc20SpendLimit: bigint;\n selectors: Array<Hex>;\n }>;\n },\n address: Address,\n ): {\n hookConfig: HookConfig;\n initData: Hex;\n } => {\n const installData = AllowlistModule.encodeOnInstallData(installArgs);\n return {\n hookConfig: {\n address: address,\n entityId: installArgs.entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: installData,\n };\n },\n encodeOnInstallData: (args: {\n entityId: number;\n inputs: Array<{\n target: Address;\n hasSelectorAllowlist: boolean;\n hasERC20SpendLimit: boolean;\n erc20SpendLimit: bigint;\n selectors: Array<Hex>;\n }>;\n }): Hex => {\n const { entityId, inputs } = args;\n return encodeAbiParameters(\n [\n { type: \"uint32\" },\n {\n type: \"tuple[]\",\n components: [\n { type: \"address\" },\n { type: \"bool\" },\n { type: \"bool\" },\n { type: \"uint256\" },\n { type: \"bytes4[]\" },\n ],\n },\n ],\n [\n entityId,\n inputs.map(\n (input) =>\n [\n input.target,\n input.hasSelectorAllowlist,\n input.hasERC20SpendLimit,\n input.erc20SpendLimit,\n input.selectors,\n ] as const,\n ),\n ],\n );\n },\n\n encodeOnUninstallData: (args: {\n entityId: number;\n inputs: Array<{\n target: Address;\n hasSelectorAllowlist: boolean;\n hasERC20SpendLimit: boolean;\n erc20SpendLimit: bigint;\n selectors: Array<Hex>;\n }>;\n }): Hex => {\n const { entityId, inputs } = args;\n return encodeAbiParameters(\n [\n { type: \"uint32\" },\n {\n type: \"tuple[]\",\n components: [\n { type: \"address\" },\n { type: \"bool\" },\n { type: \"bool\" },\n { type: \"uint256\" },\n { type: \"bytes4[]\" },\n ],\n },\n ],\n [\n entityId,\n inputs.map(\n (input) =>\n [\n input.target,\n input.hasSelectorAllowlist,\n input.hasERC20SpendLimit,\n input.erc20SpendLimit,\n input.selectors,\n ] as const,\n ),\n ],\n );\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/native-token-limit-module/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,MAAM,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,GAAG,EAAE,yBAAyB;IAC9B,mBAAmB,EAAE,CAAC,IAGrB,EAAO,EAAE;QACR,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QACtC,OAAO,mBAAmB,CACxB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EACzC,CAAC,QAAQ,EAAE,UAAU,CAAC,CACvB,CAAC;IACJ,CAAC;IAED,qBAAqB,EAAE,CAAC,IAA0B,EAAO,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC1B,OAAO,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Hex } from \"viem\";\nimport { nativeTokenLimitModuleAbi } from \"./abis/nativeTokenLimitModuleAbi.js\";\n\nexport const NativeTokenLimitModule = {\n abi: nativeTokenLimitModuleAbi,\n encodeOnInstallData: (args: {\n entityId: number;\n spendLimit: bigint;\n }): Hex => {\n const { entityId, spendLimit } = args;\n return encodeAbiParameters(\n [{ type: \"uint32\" }, { type: \"uint256\" }],\n [entityId, spendLimit]
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/native-token-limit-module/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,MAAM,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,GAAG,EAAE,yBAAyB;IAC9B,mBAAmB,EAAE,CAAC,IAGrB,EAAO,EAAE;QACR,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QACtC,OAAO,mBAAmB,CACxB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EACzC,CAAC,QAAQ,EAAE,UAAU,CAAC,CACvB,CAAC;IACJ,CAAC;IAED,qBAAqB,EAAE,CAAC,IAA0B,EAAO,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC1B,OAAO,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Hex } from \"viem\";\nimport { nativeTokenLimitModuleAbi } from \"./abis/nativeTokenLimitModuleAbi.js\";\n\nexport const NativeTokenLimitModule = {\n abi: nativeTokenLimitModuleAbi,\n encodeOnInstallData: (args: {\n entityId: number;\n spendLimit: bigint;\n }): Hex => {\n const { entityId, spendLimit } = args;\n return encodeAbiParameters(\n [{ type: \"uint32\" }, { type: \"uint256\" }],\n [entityId, spendLimit],\n );\n },\n\n encodeOnUninstallData: (args: { entityId: number }): Hex => {\n const { entityId } = args;\n return encodeAbiParameters([{ type: \"uint32\" }], [entityId]);\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/paymaster-guard-module/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,MAAM,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,GAAG,EAAE,uBAAuB;IAC5B,mBAAmB,EAAE,CAAC,IAGrB,EAAO,EAAE;QACR,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QACrC,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,SAAS;aAChB;SACF,EACD,CAAC,QAAQ,EAAE,SAAS,CAAC,CACtB,CAAC;IACJ,CAAC;IACD,qBAAqB,EAAE,CAAC,IAA0B,EAAO,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Address, type Hex } from \"viem\";\nimport { paymasterGuardModuleAbi } from \"./abis/paymasterGuardModuleAbi.js\";\n\nexport const PaymasterGuardModule = {\n abi: paymasterGuardModuleAbi,\n encodeOnInstallData: (args: {\n entityId: number;\n paymaster: Address;\n }): Hex => {\n const { entityId, paymaster } = args;\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n {\n type: \"address\",\n },\n ],\n [entityId, paymaster]
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/paymaster-guard-module/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,MAAM,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,GAAG,EAAE,uBAAuB;IAC5B,mBAAmB,EAAE,CAAC,IAGrB,EAAO,EAAE;QACR,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QACrC,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,SAAS;aAChB;SACF,EACD,CAAC,QAAQ,EAAE,SAAS,CAAC,CACtB,CAAC;IACJ,CAAC;IACD,qBAAqB,EAAE,CAAC,IAA0B,EAAO,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Address, type Hex } from \"viem\";\nimport { paymasterGuardModuleAbi } from \"./abis/paymasterGuardModuleAbi.js\";\n\nexport const PaymasterGuardModule = {\n abi: paymasterGuardModuleAbi,\n encodeOnInstallData: (args: {\n entityId: number;\n paymaster: Address;\n }): Hex => {\n const { entityId, paymaster } = args;\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n {\n type: \"address\",\n },\n ],\n [entityId, paymaster],\n );\n },\n encodeOnUninstallData: (args: { entityId: number }): Hex => {\n const { entityId } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n ],\n [entityId],\n );\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/single-signer-validation/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,MAAM,CAAC;AAEnE,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,mBAAmB,EAAE,CAAC,IAA2C,EAAO,EAAE;QACxE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAClC,OAAO,mBAAmB,CACxB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EACzC,CAAC,QAAQ,EAAE,MAAM,CAAC,CACnB,CAAC;IACJ,CAAC;IAED,qBAAqB,EAAE,CAAC,IAA0B,EAAO,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Address, type Hex } from \"viem\";\n\nexport const SingleSignerValidationModule = {\n encodeOnInstallData: (args: { entityId: number; signer: Address }): Hex => {\n const { entityId, signer } = args;\n return encodeAbiParameters(\n [{ type: \"uint32\" }, { type: \"address\" }],\n [entityId, signer]
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/single-signer-validation/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,MAAM,CAAC;AAEnE,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,mBAAmB,EAAE,CAAC,IAA2C,EAAO,EAAE;QACxE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAClC,OAAO,mBAAmB,CACxB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EACzC,CAAC,QAAQ,EAAE,MAAM,CAAC,CACnB,CAAC;IACJ,CAAC;IAED,qBAAqB,EAAE,CAAC,IAA0B,EAAO,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Address, type Hex } from \"viem\";\n\nexport const SingleSignerValidationModule = {\n encodeOnInstallData: (args: { entityId: number; signer: Address }): Hex => {\n const { entityId, signer } = args;\n return encodeAbiParameters(\n [{ type: \"uint32\" }, { type: \"address\" }],\n [entityId, signer],\n );\n },\n\n encodeOnUninstallData: (args: { entityId: number }): Hex => {\n const { entityId } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n ],\n [entityId],\n );\n },\n};\n"]}
|