@account-kit/smart-contracts 4.0.0-alpha.1 → 4.0.0-alpha.10
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/cjs/plugindefs/multi-owner/config.js +16 -17
- package/dist/cjs/plugindefs/multi-owner/config.js.map +1 -1
- package/dist/cjs/plugindefs/multisig/config.js +15 -15
- package/dist/cjs/plugindefs/multisig/config.js.map +1 -1
- package/dist/cjs/plugindefs/session-key/config.js +17 -17
- package/dist/cjs/plugindefs/session-key/config.js.map +1 -1
- package/dist/cjs/src/index.d.ts +1 -1
- package/dist/cjs/src/index.js +2 -2
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/account.d.ts +5 -6
- package/dist/cjs/src/light-account/accounts/account.js +3 -2
- package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/base.d.ts +7 -6
- package/dist/cjs/src/light-account/accounts/base.js +8 -8
- package/dist/cjs/src/light-account/accounts/base.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/cjs/src/light-account/accounts/multiOwner.js +3 -2
- package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/cjs/src/light-account/clients/alchemyClient.d.ts +1 -1
- package/dist/cjs/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
- package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/cjs/src/light-account/decorators/lightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/types.d.ts +23 -31
- package/dist/cjs/src/light-account/types.js.map +1 -1
- package/dist/cjs/src/light-account/utils.d.ts +7 -10
- package/dist/cjs/src/light-account/utils.js +59 -87
- package/dist/cjs/src/light-account/utils.js.map +1 -1
- package/dist/cjs/src/msca/client/alchemyClient.d.ts +1 -1
- package/dist/cjs/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.js +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/cjs/src/msca/utils.js +11 -10
- package/dist/cjs/src/msca/utils.js.map +1 -1
- package/dist/esm/plugindefs/multi-owner/config.js +1 -2
- package/dist/esm/plugindefs/multi-owner/config.js.map +1 -1
- package/dist/esm/plugindefs/multisig/config.js +1 -1
- package/dist/esm/plugindefs/multisig/config.js.map +1 -1
- package/dist/esm/plugindefs/session-key/config.js +1 -1
- package/dist/esm/plugindefs/session-key/config.js.map +1 -1
- package/dist/esm/src/index.d.ts +1 -1
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/light-account/accounts/account.d.ts +5 -6
- package/dist/esm/src/light-account/accounts/account.js +3 -2
- package/dist/esm/src/light-account/accounts/account.js.map +1 -1
- package/dist/esm/src/light-account/accounts/base.d.ts +7 -6
- package/dist/esm/src/light-account/accounts/base.js +8 -8
- package/dist/esm/src/light-account/accounts/base.js.map +1 -1
- package/dist/esm/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/esm/src/light-account/accounts/multiOwner.js +4 -3
- package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/esm/src/light-account/clients/alchemyClient.d.ts +1 -1
- package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.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.d.ts +23 -31
- package/dist/esm/src/light-account/types.js.map +1 -1
- package/dist/esm/src/light-account/utils.d.ts +7 -10
- package/dist/esm/src/light-account/utils.js +57 -84
- package/dist/esm/src/light-account/utils.js.map +1 -1
- package/dist/esm/src/msca/client/alchemyClient.d.ts +1 -1
- package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.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/splitAggregatedSignature.d.ts +3 -2
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.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/signer.js.map +1 -1
- package/dist/esm/src/msca/utils.js +2 -1
- package/dist/esm/src/msca/utils.js.map +1 -1
- package/dist/types/plugindefs/multi-owner/config.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/account.d.ts +5 -6
- package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/base.d.ts +7 -6
- package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/alchemyClient.d.ts +1 -1
- package/dist/types/src/light-account/clients/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/decorators/lightAccount.d.ts +1 -1
- package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts +1 -1
- package/dist/types/src/light-account/types.d.ts +23 -118
- package/dist/types/src/light-account/types.d.ts.map +1 -1
- package/dist/types/src/light-account/utils.d.ts +19 -48
- package/dist/types/src/light-account/utils.d.ts.map +1 -1
- package/dist/types/src/msca/client/alchemyClient.d.ts +1 -1
- package/dist/types/src/msca/client/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/middleware.d.ts +6 -6
- package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts +3 -3
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +13 -12
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts +147 -1
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts +71 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
- package/dist/types/src/msca/utils.d.ts +6 -6
- package/dist/types/src/msca/utils.d.ts.map +1 -1
- package/package.json +7 -6
- package/plugindefs/multi-owner/config.ts +1 -2
- package/plugindefs/multisig/config.ts +1 -1
- package/plugindefs/session-key/config.ts +1 -1
- package/src/index.ts +1 -1
- package/src/light-account/accounts/account.ts +24 -45
- package/src/light-account/accounts/base.ts +39 -68
- package/src/light-account/accounts/multiOwner.ts +29 -43
- package/src/light-account/clients/alchemyClient.ts +2 -2
- package/src/light-account/clients/multiOwnerAlchemyClient.ts +3 -3
- package/src/light-account/decorators/lightAccount.ts +1 -1
- package/src/light-account/decorators/multiOwnerLightAccount.ts +1 -1
- package/src/light-account/types.ts +31 -188
- package/src/light-account/utils.ts +91 -246
- package/src/msca/client/alchemyClient.ts +2 -2
- package/src/msca/client/multiSigAlchemyClient.ts +5 -5
- package/src/msca/plugins/multisig/middleware.ts +6 -6
- package/src/msca/plugins/multisig/utils/formatSignatures.ts +3 -3
- package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +15 -12
- package/src/msca/plugins/session-key/permissions.ts +147 -1
- package/src/msca/plugins/session-key/signer.ts +71 -1
- package/src/msca/utils.ts +15 -13
- package/dist/cjs/src/light-account/schema.d.ts +0 -21
- package/dist/cjs/src/light-account/schema.js +0 -30
- package/dist/cjs/src/light-account/schema.js.map +0 -1
- package/dist/esm/src/light-account/schema.d.ts +0 -21
- package/dist/esm/src/light-account/schema.js +0 -27
- package/dist/esm/src/light-account/schema.js.map +0 -1
- package/dist/types/src/light-account/schema.d.ts +0 -22
- package/dist/types/src/light-account/schema.d.ts.map +0 -1
- package/src/light-account/schema.ts +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/msca/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,OAAO,GAOR,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,kBAAkB,GACnB,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/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AAU;QACf,OAAO,EAAE,iBAAiB;QAC1B,YAAY,EAAE,gBAAgB;KAC/B,CAAC,CAAC;IAEH,MAAM,8BAA8B,GAAG,SAAS,CAC9C,oBAAoB,CAAC;QACnB,GAAG,EAAE,UAAU;QACf,YAAY,EAAE,gBAAgB;QAC9B,MAAM,EAAE,gBAAgB;KACzB,CAAC,CACH,CAAC;IAEF,MAAM,YAAY,GAAG,mBAAmB,CACtC,kBAAkB,CAAC,WAAW,CAAC,EAC/B,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CACnE,CAAC;IAEF,MAAM,qBAAqB,GAAG,mBAAmB,CAC/C,kBAAkB,CAAC,oBAAoB,CAAC,EACxC,CAAC,CAAC,8BAA8B,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CACnD,CAAC;IAEF,MAAM,yBAAyB,GAAG,kBAAkB,CAAC;QACnD,GAAG,EAAE,4BAA4B;QACjC,YAAY,EAAE,YAAY;QAC1B,IAAI,EAAE,CAAC,CAAC,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;KACnD,CAAC,CAAC;IAEH,OAAO;QACL,WAAW;QACX,kBAAkB,EAAE,yBAAyB;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n ChainNotFoundError,\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n sepolia,\n type GetAccountParameter,\n type SmartAccountClient,\n type SmartAccountSigner,\n type SmartContractAccount,\n type SmartContractAccountWithSigner,\n type UpgradeToData,\n} from \"@aa-sdk/core\";\nimport type { Address, Chain, Transport } from \"viem\";\nimport {\n custom,\n encodeAbiParameters,\n encodeFunctionData,\n encodeFunctionResult,\n keccak256,\n parseAbiParameters,\n} from \"viem\";\nimport { IPluginAbi } from \"./abis/IPlugin.js\";\nimport { MultiOwnerModularAccountFactoryAbi } from \"./abis/MultiOwnerModularAccountFactory.js\";\nimport { UpgradeableModularAccountAbi } from \"./abis/UpgradeableModularAccount.js\";\nimport {\n createMultiOwnerModularAccount,\n type MultiOwnerModularAccount,\n} from \"./account/multiOwnerAccount.js\";\nimport { MultiOwnerPlugin } from \"./plugins/multi-owner/plugin.js\";\n\n/**\n * Utility method returning the default multi sig msca factory address given a {@link Chain} object\n *\n * @param chain a {@link Chain} object\n * @returns a {@link Address} for the given chain\n * @throws if the chain doesn't have an address currently deployed\n */\nexport const getDefaultMultisigModularAccountFactoryAddress = (\n chain: Chain\n): Address => {\n switch (chain.id) {\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x000000000000204327E6669f00901a57CE15aE15\";\n }\n};\n\n/**\n * Utility method returning the default multi owner msca factory address given a {@link Chain} object\n *\n * @param chain - a {@link Chain} object\n * @returns a {@link Address} for the given chain\n * @throws if the chain doesn't have an address currently deployed\n */\nexport const getDefaultMultiOwnerModularAccountFactoryAddress = (\n chain: Chain\n): Address => {\n switch (chain.id) {\n default:\n return \"0x000000e92D78D90000007F0082006FDA09BD5f11\";\n }\n};\n\nexport type GetMSCAUpgradeToData<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends\n | SmartContractAccountWithSigner<string, TSigner>\n | undefined = SmartContractAccountWithSigner<string, TSigner> | undefined\n> = {\n multiOwnerPluginAddress?: Address;\n} & GetAccountParameter<TAccount>;\n\n/**\n * Retrieves the data necessary to upgrade to a Multi-Signature Contract Account (MSCA) and provides a method to create a Multi-Owner Modular Account.\n *\n * @example\n * ```ts\n * import { createLightAccountClient, getMSCAUpgradeToData } from \"@account-kit/smart-contracts\";\n *\n * const client = createLightAccountClient(...);\n * const upgradeData = await getMSCAUpgradeToData(client, {});\n * ```\n *\n * @param {SmartAccountClient<TTransport, TChain, TAccount>} client The smart account client\n * @param {GetMSCAUpgradeToData<TSigner, TAccount>} args The arguments required for the upgrade\n * @returns {Promise<UpgradeToData & { createMAAccount: () => Promise<MultiOwnerModularAccount<TSigner>>}>} A promise that resolves to upgrade data augmented with a function to create a Multi-Owner Modular Account\n */\nexport async function getMSCAUpgradeToData<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends\n | SmartContractAccountWithSigner<string, TSigner>\n | undefined = SmartContractAccountWithSigner<string, TSigner> | undefined\n>(\n client: SmartAccountClient<TTransport, TChain, TAccount>,\n args: GetMSCAUpgradeToData<TSigner, TAccount>\n): Promise<\n UpgradeToData & {\n createMAAccount: () => Promise<MultiOwnerModularAccount<TSigner>>;\n }\n> {\n const { account: account_ = client.account, multiOwnerPluginAddress } = args;\n\n if (!account_) {\n throw new AccountNotFoundError();\n }\n const account = account_ as SmartContractAccountWithSigner<string, TSigner>;\n\n const chain = client.chain;\n if (!chain) {\n throw new ChainNotFoundError();\n }\n\n const initData = await getMAInitializationData({\n client,\n multiOwnerPluginAddress,\n signerAddress: await account.getSigner().getAddress(),\n });\n\n return {\n ...initData,\n createMAAccount: async () =>\n createMultiOwnerModularAccount({\n transport: custom(client.transport),\n chain: chain as Chain,\n signer: account.getSigner(),\n accountAddress: account.address,\n }),\n };\n}\n\nexport type GetMAInitializationDataParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = {\n multiOwnerPluginAddress?: Address;\n client: SmartAccountClient<TTransport, TChain, TAccount>;\n signerAddress: Address | Address[];\n};\n\n/**\n * Retrieves the initialization data for a multi-owner modular account. Throws an error if the client's chain is not found or if the multi-owner plugin address is not retrievable.\n *\n * @example\n * ```ts\n * import { getMAInitializationData } from \"@account-kit/smart-contracts\";\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * const client = createSmartAccountClient(...);\n * const initializationData = await getMAInitializationData({\n * client,\n * signerAddress: \"0x...\", // or array of signers\n * });\n * ```\n *\n * @param {GetMAInitializationDataParams<TTransport, TChain, TAccount>} params the parameters for getting initialization data\n * @param {SmartAccountClient<TTransport, TChain, TAccount>} params.client the smart account client\n * @param {Address | Address[]} params.signerAddress the address of the signer or an array of signer addresses\n * @param {Address} [params.multiOwnerPluginAddress] optional address of the multi-owner plugin\n * @returns {Promise<UpgradeToData>} a promise that resolves to the initialization data required for upgrading to a multi-owner modular account\n */\nexport async function getMAInitializationData<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>({\n client,\n multiOwnerPluginAddress,\n signerAddress,\n}: GetMAInitializationDataParams<\n TTransport,\n TChain,\n TAccount\n>): Promise<UpgradeToData> {\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n\n const factoryAddress = getDefaultMultiOwnerModularAccountFactoryAddress(\n client.chain\n );\n\n const implAddress = await client.readContract({\n abi: MultiOwnerModularAccountFactoryAbi,\n address: factoryAddress,\n functionName: \"IMPL\",\n });\n\n const multiOwnerAddress =\n multiOwnerPluginAddress ?? MultiOwnerPlugin.meta.addresses[client.chain.id];\n\n if (!multiOwnerAddress) {\n throw new Error(\"could not get multi owner plugin address\");\n }\n\n const moPluginManifest = await client.readContract({\n abi: IPluginAbi,\n address: multiOwnerAddress,\n functionName: \"pluginManifest\",\n });\n\n const hashedMultiOwnerPluginManifest = keccak256(\n encodeFunctionResult({\n abi: IPluginAbi,\n functionName: \"pluginManifest\",\n result: moPluginManifest,\n })\n );\n\n const encodedOwner = encodeAbiParameters(\n parseAbiParameters(\"address[]\"),\n Array.isArray(signerAddress) ? [signerAddress] : [[signerAddress]]\n );\n\n const encodedPluginInitData = encodeAbiParameters(\n parseAbiParameters(\"bytes32[], bytes[]\"),\n [[hashedMultiOwnerPluginManifest], [encodedOwner]]\n );\n\n const encodedMSCAInitializeData = encodeFunctionData({\n abi: UpgradeableModularAccountAbi,\n functionName: \"initialize\",\n args: [[multiOwnerAddress], encodedPluginInitData],\n });\n\n return {\n implAddress,\n initializationData: encodedMSCAInitializeData,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/msca/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GAOnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,OAAO,GACR,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,kBAAkB,GACnB,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,kCAAkC,EAAE,MAAM,2CAA2C,CAAC;AAC/F,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EACL,8BAA8B,GAE/B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AASnE,MAAM,CAAC,MAAM,8CAA8C,GAAG,CAC5D,KAAY,EACH,EAAE;IACX,QAAQ,KAAK,CAAC,EAAE,EAAE,CAAC;QACjB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,QAAQ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F,MAAM,yBAAyB,GAAG,kBAAkB,CAAC;QACnD,GAAG,EAAE,4BAA4B;QACjC,YAAY,EAAE,YAAY;QAC1B,IAAI,EAAE,CAAC,CAAC,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;KACnD,CAAC,CAAC;IAEH,OAAO;QACL,WAAW;QACX,kBAAkB,EAAE,yBAAyB;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n ChainNotFoundError,\n type GetAccountParameter,\n type SmartAccountClient,\n type SmartAccountSigner,\n type SmartContractAccount,\n type SmartContractAccountWithSigner,\n type UpgradeToData,\n} from \"@aa-sdk/core\";\nimport {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n sepolia,\n} from \"@account-kit/infra\";\nimport type { Address, Chain, Transport } from \"viem\";\nimport {\n custom,\n encodeAbiParameters,\n encodeFunctionData,\n encodeFunctionResult,\n keccak256,\n parseAbiParameters,\n} from \"viem\";\nimport { IPluginAbi } from \"./abis/IPlugin.js\";\nimport { MultiOwnerModularAccountFactoryAbi } from \"./abis/MultiOwnerModularAccountFactory.js\";\nimport { UpgradeableModularAccountAbi } from \"./abis/UpgradeableModularAccount.js\";\nimport {\n createMultiOwnerModularAccount,\n type MultiOwnerModularAccount,\n} from \"./account/multiOwnerAccount.js\";\nimport { MultiOwnerPlugin } from \"./plugins/multi-owner/plugin.js\";\n\n/**\n * Utility method returning the default multi sig msca factory address given a chain\n *\n * @param {Chain} chain the chain object for which to get the address\n * @returns {Address} the address for the given chain\n * @throws if the chain doesn't have an address currently deployed\n */\nexport const getDefaultMultisigModularAccountFactoryAddress = (\n chain: Chain\n): Address => {\n switch (chain.id) {\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x000000000000204327E6669f00901a57CE15aE15\";\n }\n};\n\n/**\n * Utility method returning the default multi owner msca factory address given a chain\n *\n * @param {Chain} chain the chain object for which to get the address\n * @returns {Address} the address for the given chain\n * @throws if the chain doesn't have an address currently deployed\n */\nexport const getDefaultMultiOwnerModularAccountFactoryAddress = (\n chain: Chain\n): Address => {\n switch (chain.id) {\n default:\n return \"0x000000e92D78D90000007F0082006FDA09BD5f11\";\n }\n};\n\nexport type GetMSCAUpgradeToData<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends\n | SmartContractAccountWithSigner<string, TSigner>\n | undefined = SmartContractAccountWithSigner<string, TSigner> | undefined\n> = {\n multiOwnerPluginAddress?: Address;\n} & GetAccountParameter<TAccount>;\n\n/**\n * Retrieves the data necessary to upgrade to a Multi-Signature Contract Account (MSCA) and provides a method to create a Multi-Owner Modular Account.\n *\n * @example\n * ```ts\n * import { createLightAccountClient, getMSCAUpgradeToData } from \"@account-kit/smart-contracts\";\n *\n * const client = createLightAccountClient(...);\n * const upgradeData = await getMSCAUpgradeToData(client, {});\n * ```\n *\n * @param {SmartAccountClient<TTransport, TChain, TAccount>} client The smart account client\n * @param {GetMSCAUpgradeToData<TSigner, TAccount>} args The arguments required for the upgrade\n * @returns {Promise<UpgradeToData & { createMAAccount: () => Promise<MultiOwnerModularAccount<TSigner>>}>} A promise that resolves to upgrade data augmented with a function to create a Multi-Owner Modular Account\n */\nexport async function getMSCAUpgradeToData<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends\n | SmartContractAccountWithSigner<string, TSigner>\n | undefined = SmartContractAccountWithSigner<string, TSigner> | undefined\n>(\n client: SmartAccountClient<TTransport, TChain, TAccount>,\n args: GetMSCAUpgradeToData<TSigner, TAccount>\n): Promise<\n UpgradeToData & {\n createMAAccount: () => Promise<MultiOwnerModularAccount<TSigner>>;\n }\n> {\n const { account: account_ = client.account, multiOwnerPluginAddress } = args;\n\n if (!account_) {\n throw new AccountNotFoundError();\n }\n const account = account_ as SmartContractAccountWithSigner<string, TSigner>;\n\n const chain = client.chain;\n if (!chain) {\n throw new ChainNotFoundError();\n }\n\n const initData = await getMAInitializationData({\n client,\n multiOwnerPluginAddress,\n signerAddress: await account.getSigner().getAddress(),\n });\n\n return {\n ...initData,\n createMAAccount: async () =>\n createMultiOwnerModularAccount({\n transport: custom(client.transport),\n chain: chain as Chain,\n signer: account.getSigner(),\n accountAddress: account.address,\n }),\n };\n}\n\nexport type GetMAInitializationDataParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = {\n multiOwnerPluginAddress?: Address;\n client: SmartAccountClient<TTransport, TChain, TAccount>;\n signerAddress: Address | Address[];\n};\n\n/**\n * Retrieves the initialization data for a multi-owner modular account. Throws an error if the client's chain is not found or if the multi-owner plugin address is not retrievable.\n *\n * @example\n * ```ts\n * import { getMAInitializationData } from \"@account-kit/smart-contracts\";\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * const client = createSmartAccountClient(...);\n * const initializationData = await getMAInitializationData({\n * client,\n * signerAddress: \"0x...\", // or array of signers\n * });\n * ```\n *\n * @param {GetMAInitializationDataParams<TTransport, TChain, TAccount>} params the parameters for getting initialization data\n * @param {SmartAccountClient<TTransport, TChain, TAccount>} params.client the smart account client\n * @param {Address | Address[]} params.signerAddress the address of the signer or an array of signer addresses\n * @param {Address} [params.multiOwnerPluginAddress] optional address of the multi-owner plugin\n * @returns {Promise<UpgradeToData>} a promise that resolves to the initialization data required for upgrading to a multi-owner modular account\n */\nexport async function getMAInitializationData<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>({\n client,\n multiOwnerPluginAddress,\n signerAddress,\n}: GetMAInitializationDataParams<\n TTransport,\n TChain,\n TAccount\n>): Promise<UpgradeToData> {\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n\n const factoryAddress = getDefaultMultiOwnerModularAccountFactoryAddress(\n client.chain\n );\n\n const implAddress = await client.readContract({\n abi: MultiOwnerModularAccountFactoryAbi,\n address: factoryAddress,\n functionName: \"IMPL\",\n });\n\n const multiOwnerAddress =\n multiOwnerPluginAddress ?? MultiOwnerPlugin.meta.addresses[client.chain.id];\n\n if (!multiOwnerAddress) {\n throw new Error(\"could not get multi owner plugin address\");\n }\n\n const moPluginManifest = await client.readContract({\n abi: IPluginAbi,\n address: multiOwnerAddress,\n functionName: \"pluginManifest\",\n });\n\n const hashedMultiOwnerPluginManifest = keccak256(\n encodeFunctionResult({\n abi: IPluginAbi,\n functionName: \"pluginManifest\",\n result: moPluginManifest,\n })\n );\n\n const encodedOwner = encodeAbiParameters(\n parseAbiParameters(\"address[]\"),\n Array.isArray(signerAddress) ? [signerAddress] : [[signerAddress]]\n );\n\n const encodedPluginInitData = encodeAbiParameters(\n parseAbiParameters(\"bytes32[], bytes[]\"),\n [[hashedMultiOwnerPluginManifest], [encodedOwner]]\n );\n\n const encodedMSCAInitializeData = encodeFunctionData({\n abi: UpgradeableModularAccountAbi,\n functionName: \"initialize\",\n args: [[multiOwnerAddress], encodedPluginInitData],\n });\n\n return {\n implAddress,\n initializationData: encodedMSCAInitializeData,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../plugindefs/multi-owner/config.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D,eAAO,MAAM,yBAAyB,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../plugindefs/multi-owner/config.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D,eAAO,MAAM,yBAAyB,EAAE,YAuBvC,CAAC"}
|
|
@@ -7,7 +7,7 @@ export { createMultiOwnerLightAccountAlchemyClient, type AlchemyMultiOwnerLightA
|
|
|
7
7
|
export type * from "./light-account/decorators/lightAccount.js";
|
|
8
8
|
export { lightAccountClientActions } from "./light-account/decorators/lightAccount.js";
|
|
9
9
|
export type * from "./light-account/types.js";
|
|
10
|
-
export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress,
|
|
10
|
+
export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, getLightAccountVersionForAccount, } from "./light-account/utils.js";
|
|
11
11
|
export type * from "./light-account/accounts/multiOwner.js";
|
|
12
12
|
export { createMultiOwnerLightAccount } from "./light-account/accounts/multiOwner.js";
|
|
13
13
|
export { updateOwners as updateMultiOwnerLightAccountOwners } from "./light-account/actions/updateOwners.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,mBAAmB,qCAAqC,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,iBAAiB,IAAI,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAClH,OAAO,EACL,+BAA+B,EAC/B,KAAK,+BAA+B,GACrC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EACL,yCAAyC,EACzC,KAAK,yCAAyC,GAC/C,MAAM,oDAAoD,CAAC;AAC5D,mBAAmB,4CAA4C,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,mBAAmB,0BAA0B,CAAC;AAE9C,OAAO,EACL,sBAAsB,EACtB,oCAAoC,EACpC,gCAAgC,EA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B,EAChB,aAAa,EACb,wBAAwB,GACzB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,2CAA2C,CAAC;AAC/D,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oCAAoC,GACrC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,mBAAmB,yBAAyB,CAAC;AAC7C,OAAO,EACL,gDAAgD,EAChD,8CAA8C,EAC9C,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { type Address, type EntryPointDef, type SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import { type Chain, type Hex, type Transport } from "viem";
|
|
3
|
-
import type {
|
|
3
|
+
import type { LightAccountEntryPointVersion, LightAccountVersion } from "../types.js";
|
|
4
4
|
import { type CreateLightAccountBaseParams, type LightAccountBase } from "./base.js";
|
|
5
|
-
export type LightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends
|
|
5
|
+
export type LightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"LightAccount"> = LightAccountVersion<"LightAccount">> = LightAccountBase<TSigner, "LightAccount", TLightAccountVersion> & {
|
|
6
6
|
encodeTransferOwnership: (newOwner: Address) => Hex;
|
|
7
7
|
getOwnerAddress: () => Promise<Address>;
|
|
8
8
|
};
|
|
9
|
-
export type CreateLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends
|
|
9
|
+
export type CreateLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"LightAccount"> = LightAccountVersion<"LightAccount">> = Omit<CreateLightAccountBaseParams<"LightAccount", TLightAccountVersion, TTransport, TSigner>, "getAccountInitCode" | "entryPoint" | "version" | "abi" | "accountAddress" | "type"> & {
|
|
10
10
|
salt?: bigint;
|
|
11
11
|
initCode?: Hex;
|
|
12
12
|
accountAddress?: Address;
|
|
13
13
|
factoryAddress?: Address;
|
|
14
14
|
version?: TLightAccountVersion;
|
|
15
|
-
entryPoint?: EntryPointDef<
|
|
15
|
+
entryPoint?: EntryPointDef<LightAccountEntryPointVersion<"LightAccount", TLightAccountVersion>, Chain>;
|
|
16
16
|
};
|
|
17
|
-
export declare function createLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends
|
|
18
|
-
export declare function createLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends GetLightAccountVersion<"LightAccount"> = GetLightAccountVersion<"LightAccount">, TEntryPointVersion extends GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion> = GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion>>(config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion, TEntryPointVersion>): Promise<LightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>>;
|
|
17
|
+
export declare function createLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"LightAccount"> = "v2.0.0">(config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>): Promise<LightAccount<TSigner, TLightAccountVersion>>;
|
|
19
18
|
//# sourceMappingURL=account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAKd,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAKd,OAAO,KAAK,EACV,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAOrB,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,gBAAgB,EACtB,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,YAAY,CACtB,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,cAAc,CAAC,GAAG,mBAAmB,CAAC,cAAc,CAAC,IACpG,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,oBAAoB,CAAC,GAAG;IACpE,uBAAuB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,GAAG,CAAC;IACpD,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACzC,CAAC;AAGF,MAAM,MAAM,wBAAwB,CAClC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,cAAc,CAAC,GAAG,mBAAmB,CAAC,cAAc,CAAC,IACpG,IAAI,CACN,4BAA4B,CAC1B,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,OAAO,CACR,EACC,oBAAoB,GACpB,YAAY,GACZ,SAAS,GACT,KAAK,GACL,gBAAgB,GAChB,MAAM,CACT,GAAG;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,UAAU,CAAC,EAAE,aAAa,CACxB,6BAA6B,CAAC,cAAc,EAAE,oBAAoB,CAAC,EACnE,KAAK,CACN,CAAC;CACH,CAAC;AAGF,wBAAsB,kBAAkB,CACtC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,cAAc,CAAC,GAAG,QAAQ,EAE3E,MAAM,EAAE,wBAAwB,CAAC,UAAU,EAAE,OAAO,EAAE,oBAAoB,CAAC,GAC1E,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { type Abi, type EntryPointDef, type SmartAccountSigner, type SmartContractAccountWithSigner, type ToSmartContractAccountParams } from "@aa-sdk/core";
|
|
2
2
|
import { type Address, type Chain, type Transport } from "viem";
|
|
3
|
-
import type {
|
|
4
|
-
export type LightAccountBase<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends
|
|
3
|
+
import type { LightAccountEntryPointVersion, LightAccountType, LightAccountVersion } from "../types.js";
|
|
4
|
+
export type LightAccountBase<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>> = SmartContractAccountWithSigner<TLightAccountType, TSigner, LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>> & {
|
|
5
5
|
getLightAccountVersion: () => TLightAccountVersion;
|
|
6
6
|
};
|
|
7
|
-
export type CreateLightAccountBaseParams<
|
|
7
|
+
export type CreateLightAccountBaseParams<TLightAccountType extends LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>, TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> = Pick<ToSmartContractAccountParams<TLightAccountType, TTransport, Chain>, "transport" | "chain" | "getAccountInitCode"> & {
|
|
8
8
|
abi: Abi;
|
|
9
9
|
signer: TSigner;
|
|
10
10
|
accountAddress: Address;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
type: TLightAccountType;
|
|
12
|
+
version: TLightAccountVersion;
|
|
13
|
+
entryPoint: EntryPointDef<LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>, Chain>;
|
|
13
14
|
};
|
|
14
|
-
export declare function createLightAccountBase<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
15
|
+
export declare function createLightAccountBase<TLightAccountType extends LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType>, TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner>({ transport, chain, signer, abi, version, type, entryPoint, accountAddress, getAccountInitCode, }: CreateLightAccountBaseParams<TLightAccountType, TLightAccountVersion, TTransport, TSigner>): Promise<LightAccountBase<TSigner, TLightAccountType, TLightAccountVersion>>;
|
|
15
16
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EAElC,MAAM,cAAc,CAAC;AACtB,OAAO,EAOL,KAAK,OAAO,EACZ,KAAK,KAAK,EAGV,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EAElC,MAAM,cAAc,CAAC;AACtB,OAAO,EAOL,KAAK,OAAO,EACZ,KAAK,KAAK,EAGV,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AASrB,MAAM,MAAM,gBAAgB,CAC1B,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,iBAAiB,SAAS,gBAAgB,GAAG,gBAAgB,EAC7D,oBAAoB,SAAS,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,IAC1G,8BAA8B,CAChC,iBAAiB,EACjB,OAAO,EACP,6BAA6B,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CACvE,GAAG;IACF,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;CACpD,CAAC;AAGF,MAAM,MAAM,4BAA4B,CACtC,iBAAiB,SAAS,gBAAgB,EAC1C,oBAAoB,SAAS,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,EAC5G,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,4BAA4B,CAAC,iBAAiB,EAAE,UAAU,EAAE,KAAK,CAAC,EAClE,WAAW,GAAG,OAAO,GAAG,oBAAoB,CAC7C,GAAG;IACF,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,UAAU,EAAE,aAAa,CACvB,6BAA6B,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,EACtE,KAAK,CACN,CAAC;CACH,CAAC;AAGF,wBAAsB,sBAAsB,CAC1C,iBAAiB,SAAS,gBAAgB,EAC1C,oBAAoB,SAAS,mBAAmB,CAAC,iBAAiB,CAAC,EACnE,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,EACA,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,EACP,IAAI,EACJ,UAAU,EACV,cAAc,EACd,kBAAkB,GACnB,EAAE,4BAA4B,CAC7B,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,OAAO,CACR,GAAG,OAAO,CACT,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,CACnE,CAwKA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { type EntryPointDef, type SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import { type Address, type Chain, type Hex, type Transport } from "viem";
|
|
3
|
-
import type {
|
|
3
|
+
import type { LightAccountEntryPointVersion, LightAccountVersion } from "../types.js";
|
|
4
4
|
import { type CreateLightAccountBaseParams, type LightAccountBase } from "./base.js";
|
|
5
|
-
export type MultiOwnerLightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends
|
|
5
|
+
export type MultiOwnerLightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">> = LightAccountBase<TSigner, "MultiOwnerLightAccount", TLightAccountVersion> & {
|
|
6
6
|
encodeUpdateOwners: (ownersToAdd: Address[], ownersToRemove: Address[]) => Hex;
|
|
7
7
|
getOwnerAddresses: () => Promise<readonly Address[]>;
|
|
8
8
|
};
|
|
9
|
-
export type CreateMultiOwnerLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends
|
|
9
|
+
export type CreateMultiOwnerLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">> = Omit<CreateLightAccountBaseParams<"MultiOwnerLightAccount", TLightAccountVersion, TTransport, TSigner>, "getAccountInitCode" | "entryPoint" | "version" | "abi" | "accountAddress" | "type"> & {
|
|
10
10
|
salt?: bigint;
|
|
11
11
|
initCode?: Hex;
|
|
12
12
|
accountAddress?: Address;
|
|
13
13
|
factoryAddress?: Address;
|
|
14
14
|
version?: TLightAccountVersion;
|
|
15
|
-
entryPoint?: EntryPointDef<
|
|
15
|
+
entryPoint?: EntryPointDef<LightAccountEntryPointVersion<"MultiOwnerLightAccount", TLightAccountVersion>, Chain>;
|
|
16
16
|
owners?: Address[];
|
|
17
17
|
};
|
|
18
|
-
export declare function createMultiOwnerLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends
|
|
18
|
+
export declare function createMultiOwnerLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">>(config: CreateMultiOwnerLightAccountParams<TTransport, TSigner, TLightAccountVersion>): Promise<MultiOwnerLightAccount<TSigner, TLightAccountVersion>>;
|
|
19
19
|
//# sourceMappingURL=multiOwner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiOwner.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/multiOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"multiOwner.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/multiOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,gBAAgB,EACtB,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,sBAAsB,CAChC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,wBAAwB,CAAC,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,IACxH,gBAAgB,CAClB,OAAO,EACP,wBAAwB,EACxB,oBAAoB,CACrB,GAAG;IACF,kBAAkB,EAAE,CAClB,WAAW,EAAE,OAAO,EAAE,EACtB,cAAc,EAAE,OAAO,EAAE,KACtB,GAAG,CAAC;IACT,iBAAiB,EAAE,MAAM,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,kCAAkC,CAC5C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,wBAAwB,CAAC,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,IACxH,IAAI,CACN,4BAA4B,CAC1B,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,OAAO,CACR,EACC,oBAAoB,GACpB,YAAY,GACZ,SAAS,GACT,KAAK,GACL,gBAAgB,GAChB,MAAM,CACT,GAAG;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,UAAU,CAAC,EAAE,aAAa,CACxB,6BAA6B,CAC3B,wBAAwB,EACxB,oBAAoB,CACrB,EACD,KAAK,CACN,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;CACpB,CAAC;AAEF,wBAAsB,4BAA4B,CAChD,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,wBAAwB,CAAC,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,EAE1H,MAAM,EAAE,kCAAkC,CACxC,UAAU,EACV,OAAO,EACP,oBAAoB,CACrB,GACA,OAAO,CAAC,sBAAsB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
|
|
1
2
|
import { type AlchemySmartAccountClient, type AlchemySmartAccountClientConfig } from "@account-kit/infra";
|
|
2
3
|
import { type CreateLightAccountParams, type LightAccount, type LightAccountClientActions } from "@account-kit/smart-contracts";
|
|
3
|
-
import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
|
|
4
4
|
import { type Chain, type CustomTransport, type Transport } from "viem";
|
|
5
5
|
export type AlchemyLightAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateLightAccountParams<HttpTransport, TSigner>, "transport" | "chain"> & Omit<AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>>, "account">;
|
|
6
6
|
export declare function createLightAccountAlchemyClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyLightAccountClientConfig<TSigner>): Promise<AlchemySmartAccountClient<CustomTransport, Chain | undefined, LightAccount<TSigner>, LightAccountClientActions<TSigner>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"alchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAU,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AAEhF,MAAM,MAAM,+BAA+B,CACzC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,wBAAwB,CAAC,aAAa,EAAE,OAAO,CAAC,EAChD,WAAW,GAAG,OAAO,CACtB,GACC,IAAI,CACF,+BAA+B,CAAC,SAAS,EAAE,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,EACxE,SAAS,CACV,CAAC;AAEJ,wBAAsB,+BAA+B,CACnD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EAEvD,MAAM,EAAE,+BAA+B,CAAC,OAAO,CAAC,GAC/C,OAAO,CACR,yBAAyB,CACvB,eAAe,EACf,KAAK,GAAG,SAAS,EACjB,YAAY,CAAC,OAAO,CAAC,EACrB,yBAAyB,CAAC,OAAO,CAAC,CACnC,CACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
|
|
1
2
|
import { type AlchemySmartAccountClient, type AlchemySmartAccountClientConfig } from "@account-kit/infra";
|
|
2
3
|
import { type CreateMultiOwnerLightAccountParams, type MultiOwnerLightAccount, type MultiOwnerLightAccountClientActions } from "@account-kit/smart-contracts";
|
|
3
|
-
import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
|
|
4
4
|
import { type Chain, type CustomTransport, type Transport } from "viem";
|
|
5
|
-
export type AlchemyMultiOwnerLightAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>, "transport" | "chain"> & Omit<AlchemySmartAccountClientConfig<Transport, Chain, MultiOwnerLightAccount<TSigner>>, "account">;
|
|
5
|
+
export type AlchemyMultiOwnerLightAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>, "transport" | "chain" | "type"> & Omit<AlchemySmartAccountClientConfig<Transport, Chain, MultiOwnerLightAccount<TSigner>>, "account">;
|
|
6
6
|
export declare function createMultiOwnerLightAccountAlchemyClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyMultiOwnerLightAccountClientConfig<TSigner>): Promise<AlchemySmartAccountClient<CustomTransport, Chain | undefined, MultiOwnerLightAccount<TSigner>, MultiOwnerLightAccountClientActions<TSigner>>>;
|
|
7
7
|
//# sourceMappingURL=multiOwnerAlchemyClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiOwnerAlchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,kCAAkC,EACvC,KAAK,sBAAsB,EAC3B,KAAK,mCAAmC,EACzC,MAAM,8BAA8B,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"multiOwnerAlchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,kCAAkC,EACvC,KAAK,sBAAsB,EAC3B,KAAK,mCAAmC,EACzC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAU,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AAEhF,MAAM,MAAM,yCAAyC,CACnD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,kCAAkC,CAAC,aAAa,EAAE,OAAO,CAAC,EAC1D,WAAW,GAAG,OAAO,GAAG,MAAM,CAC/B,GACC,IAAI,CACF,+BAA+B,CAC7B,SAAS,EACT,KAAK,EACL,sBAAsB,CAAC,OAAO,CAAC,CAChC,EACD,SAAS,CACV,CAAC;AAEJ,wBAAsB,yCAAyC,CAC7D,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EAEvD,MAAM,EAAE,yCAAyC,CAAC,OAAO,CAAC,GACzD,OAAO,CACR,yBAAyB,CACvB,eAAe,EACf,KAAK,GAAG,SAAS,EACjB,sBAAsB,CAAC,OAAO,CAAC,EAC/B,mCAAmC,CAAC,OAAO,CAAC,CAC7C,CACF,CAAC"}
|
|
@@ -12,7 +12,7 @@ export type LightAccountClientActions<TSigner extends SmartAccountSigner = Smart
|
|
|
12
12
|
* ```ts
|
|
13
13
|
* import { lightAccountClientActions, createLightAccount } from "@account-kit/smart-contracts";
|
|
14
14
|
* import { createAlchemySmartAccountClient } from "@account-kit/infra";
|
|
15
|
-
* import { sepolia } from "@account-kit/infra
|
|
15
|
+
* import { sepolia } from "@account-kit/infra";
|
|
16
16
|
*
|
|
17
17
|
* const smartAccountClient = createAlchemySmartAccountClient({
|
|
18
18
|
* account: await createLightAccount(...),
|
|
@@ -12,7 +12,7 @@ export type MultiOwnerLightAccountClientActions<TSigner extends SmartAccountSign
|
|
|
12
12
|
* ```ts
|
|
13
13
|
* import { multiOwnerLightAccountClientActions, createMultiOwnerLightAccount } from "@account-kit/smart-contracts";
|
|
14
14
|
* import { createAlchemySmartAccountClient } from "@account-kit/infra";
|
|
15
|
-
* import { sepolia } from "@account-kit/infra
|
|
15
|
+
* import { sepolia } from "@account-kit/infra";
|
|
16
16
|
*
|
|
17
17
|
* const smartAccountClient = createAlchemySmartAccountClient({
|
|
18
18
|
* account: await createMultiOwnerLightAccount(...),
|
|
@@ -1,131 +1,36 @@
|
|
|
1
|
-
import { type EntryPointVersion
|
|
1
|
+
import { type EntryPointVersion } from "@aa-sdk/core";
|
|
2
2
|
import { type Address, type Chain } from "viem";
|
|
3
3
|
import type { LightAccountBase } from "./accounts/base";
|
|
4
4
|
/**
|
|
5
5
|
* Light account types supported: LightAccount, MultiOwnerLightAccount
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export type LightAccountType =
|
|
9
|
-
|
|
10
|
-
* Account version definition, which is the base type defining the LightAccountVersionDef interface
|
|
11
|
-
*
|
|
12
|
-
* @template {LightAccountType} TLightAccountType type
|
|
13
|
-
* @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion version
|
|
14
|
-
* @template {EntryPointVersion} TEntryPointVersion entryPointVersion
|
|
15
|
-
*/
|
|
16
|
-
export type AccountVersionDef<TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = {
|
|
17
|
-
type: TLightAccountType;
|
|
18
|
-
version: TLightAccountVersion;
|
|
8
|
+
export type LightAccountType = "LightAccount" | "MultiOwnerLightAccount";
|
|
9
|
+
export type LightAccountVersionConfig<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = {
|
|
19
10
|
entryPointVersion: TEntryPointVersion;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
addresses: {
|
|
12
|
+
default: {
|
|
13
|
+
factory: Address;
|
|
14
|
+
impl: Address;
|
|
15
|
+
};
|
|
16
|
+
overrides?: Record<Chain["id"], {
|
|
17
|
+
factory: Address;
|
|
18
|
+
impl: Address;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
24
21
|
};
|
|
25
|
-
|
|
26
|
-
* Light account version type defs for tightly coupled types for smart accounts
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
export type LightAccountVersion = keyof IAccountVersionRegistry["LightAccount"] | keyof IAccountVersionRegistry["MultiOwnerLightAccount"];
|
|
30
|
-
/**
|
|
31
|
-
* Get the light account versions available for the given light account type
|
|
32
|
-
*
|
|
33
|
-
* @template {LightAccountType} TLightAccountType
|
|
34
|
-
*/
|
|
35
|
-
export type GetLightAccountVersion<TLightAccountType extends LightAccountType = LightAccountType> = keyof IAccountVersionRegistry[TLightAccountType];
|
|
36
|
-
/**
|
|
37
|
-
* Light account version definition type based on the light account type and version
|
|
38
|
-
*
|
|
39
|
-
* @template {LightAccountType} TLightAccountType
|
|
40
|
-
* @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion
|
|
41
|
-
*/
|
|
42
|
-
export type LightAccountVersionDef<TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>> = IAccountVersionRegistry[TLightAccountType][TLightAccountVersion];
|
|
43
|
-
/**
|
|
44
|
-
* Light account version registry interface defining the supported light account versions
|
|
45
|
-
*
|
|
46
|
-
*/
|
|
47
|
-
export interface IAccountVersionRegistry {
|
|
22
|
+
export type LightAccountVersionConfigs = {
|
|
48
23
|
LightAccount: {
|
|
49
|
-
|
|
50
|
-
"v1.0.
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"v1.1.0": AccountVersionDef<"LightAccount", "v1.1.0", "0.6.0">;
|
|
54
|
-
/**
|
|
55
|
-
* LightAccount v2 Changelog.
|
|
56
|
-
* It is recommended to use v2.0.0
|
|
57
|
-
* https://alchemotion.notion.site/External-Light-Account-v2-Changelog-725b306ab1e04eb0a3e596521dd8f0bd
|
|
58
|
-
*/
|
|
59
|
-
"v2.0.0": AccountVersionDef<"LightAccount", "v2.0.0", "0.7.0">;
|
|
24
|
+
"v1.0.1": LightAccountVersionConfig<"0.6.0">;
|
|
25
|
+
"v1.0.2": LightAccountVersionConfig<"0.6.0">;
|
|
26
|
+
"v1.1.0": LightAccountVersionConfig<"0.6.0">;
|
|
27
|
+
"v2.0.0": LightAccountVersionConfig<"0.7.0">;
|
|
60
28
|
};
|
|
61
29
|
MultiOwnerLightAccount: {
|
|
62
|
-
|
|
63
|
-
* MultiOwnerLightAccount v2 Changelog
|
|
64
|
-
* It is recommended to use v2.0.0
|
|
65
|
-
* https://alchemotion.notion.site/External-Light-Account-v2-Changelog-725b306ab1e04eb0a3e596521dd8f0bd
|
|
66
|
-
*/
|
|
67
|
-
"v2.0.0": AccountVersionDef<"MultiOwnerLightAccount", "v2.0.0", "0.7.0">;
|
|
30
|
+
"v2.0.0": LightAccountVersionConfig<"0.7.0">;
|
|
68
31
|
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* @template {LightAccountType} TLightAccountType
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* type T1 = GetLightAccountVersionsForType<"LightAccount">;
|
|
77
|
-
* const t1: T1 = AccountVersionRegistry.LightAccount["v1.0.2"];
|
|
78
|
-
*/
|
|
79
|
-
export type GetLightAccountVersionDefsForType<TType extends LightAccountType> = Extract<IAccountVersionRegistry[TType][keyof IAccountVersionRegistry[TType]], {
|
|
80
|
-
type: TType;
|
|
81
|
-
}>;
|
|
82
|
-
/**
|
|
83
|
-
* Get the light account version definition for the given light account type and version
|
|
84
|
-
*
|
|
85
|
-
* @template {LightAccountType} TType
|
|
86
|
-
* @template {GetLightAccountVersion<TType>} TLightAccountVersion
|
|
87
|
-
*/
|
|
88
|
-
export type GetLightAccountVersionDef<TType extends LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TType>> = IAccountVersionRegistry[TType][TLightAccountVersion];
|
|
89
|
-
/**
|
|
90
|
-
* @example
|
|
91
|
-
* type T = GetLightAccountVersionDefsForEntryPoint<"LightAccount", "0.6.0">;
|
|
92
|
-
* const t_1: T = AccountVersionRegistry.LightAccount["v1.0.2"]; // compiles
|
|
93
|
-
* const t_2: T = AccountVersionRegistry.LightAccount["v2.0.0"]; // errors
|
|
94
|
-
*/
|
|
95
|
-
export type GetLightAccountVersionDefsForEntryPoint<TType extends LightAccountType, TEntryPointVersion extends EntryPointVersion> = Extract<GetLightAccountVersionDefsForType<TType>, {
|
|
96
|
-
entryPointVersion: TEntryPointVersion;
|
|
97
|
-
}>;
|
|
98
|
-
/**
|
|
99
|
-
* Get the light account type for the given light account by inferring from its type definition
|
|
100
|
-
*
|
|
101
|
-
* @template {SmartContractAccount | undefined} TAccount
|
|
102
|
-
* @template {SmartContractAccount} TAccountOverride
|
|
103
|
-
*/
|
|
104
|
-
export type GetLightAccountType<TAccount extends SmartContractAccount | undefined, TAccountOverride extends SmartContractAccount = SmartContractAccount> = GetAccountParameter<TAccount, TAccountOverride> extends LightAccountBase<SmartAccountSigner, infer TLightAccountType> ? OneOf<TLightAccountType, LightAccountType> : LightAccountType;
|
|
105
|
-
/**
|
|
106
|
-
* Get the light account version for the given light account by inferring from its type definition
|
|
107
|
-
*
|
|
108
|
-
* @template {LightAccountBase | undefined} TAccount
|
|
109
|
-
* @template {LightAccountBase} TAccountOverride
|
|
110
|
-
*/
|
|
111
|
-
export type GetLightAccountVersionFromAccount<TAccount extends LightAccountBase | undefined, TAccountOverride extends LightAccountBase = LightAccountBase> = GetAccountParameter<TAccount, TAccountOverride> extends LightAccountBase<SmartAccountSigner, LightAccountType, infer TLightAccountVersion> ? OneOf<TLightAccountVersion, LightAccountVersion> : LightAccountVersion;
|
|
112
|
-
/**
|
|
113
|
-
* Get the entry point version supported for the given light account type and version
|
|
114
|
-
*
|
|
115
|
-
* @template {LightAccountType} TLightAccountType
|
|
116
|
-
* @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion
|
|
117
|
-
*/
|
|
118
|
-
export type GetEntryPointForLightAccountVersion<TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>> = GetLightAccountVersionDef<TLightAccountType, TLightAccountVersion> extends AccountVersionDef<TLightAccountType, TLightAccountVersion, infer TEntryPointVersion> ? TEntryPointVersion : EntryPointVersion;
|
|
119
|
-
/**
|
|
120
|
-
* Get the light account type for the given light account version by inferring from its type definition
|
|
121
|
-
*
|
|
122
|
-
* @template {LightAccountVersion} TLightAccountVersion
|
|
123
|
-
*/
|
|
124
|
-
export type GetLightAccountTypesForVersion<TLightAccountVersion extends LightAccountVersion = LightAccountVersion> = TLightAccountVersion extends GetLightAccountVersion<infer TLightAccountType> ? TLightAccountType : LightAccountType;
|
|
125
|
-
/**
|
|
126
|
-
* Get default light account version for the given light account type
|
|
127
|
-
*
|
|
128
|
-
* @template {LightAccountType} TLightAccountType
|
|
129
|
-
*/
|
|
130
|
-
export type GetDefaultLightAccountVersion<TLightAccountType extends LightAccountType = LightAccountType> = TLightAccountType extends "MultiOwnerLightAccount" ? "v2.0.0" & LightAccountVersion : "v1.1.0" & LightAccountVersion;
|
|
32
|
+
};
|
|
33
|
+
export type LightAccountVersion<TAccountType extends LightAccountType> = keyof LightAccountVersionConfigs[TAccountType];
|
|
34
|
+
export type GetLightAccountType<TAccount extends LightAccountBase> = TAccount["source"] extends LightAccountType ? TAccount["source"] : never;
|
|
35
|
+
export type LightAccountEntryPointVersion<TLightAccountType extends LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>> = LightAccountVersionConfigs[TLightAccountType][TLightAccountVersion] extends LightAccountVersionConfig ? LightAccountVersionConfigs[TLightAccountType][TLightAccountVersion]["entryPointVersion"] : never;
|
|
131
36
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/light-account/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/light-account/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,wBAAwB,CAAC;AAEzE,MAAM,MAAM,yBAAyB,CACnC,kBAAkB,SAAS,iBAAiB,GAAG,iBAAiB,IAC9D;IACF,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,SAAS,EAAE;QACT,OAAO,EAAE;YACP,OAAO,EAAE,OAAO,CAAC;YACjB,IAAI,EAAE,OAAO,CAAC;SACf,CAAC;QACF,SAAS,CAAC,EAAE,MAAM,CAChB,KAAK,CAAC,IAAI,CAAC,EACX;YACE,OAAO,EAAE,OAAO,CAAC;YACjB,IAAI,EAAE,OAAO,CAAC;SACf,CACF,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,YAAY,EAAE;QACZ,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;KAC9C,CAAC;IACF,sBAAsB,EAAE;QACtB,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;KAC9C,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,YAAY,SAAS,gBAAgB,IACnE,MAAM,0BAA0B,CAAC,YAAY,CAAC,CAAC;AAEjD,MAAM,MAAM,mBAAmB,CAAC,QAAQ,SAAS,gBAAgB,IAC/D,QAAQ,CAAC,QAAQ,CAAC,SAAS,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;AAE3E,MAAM,MAAM,6BAA6B,CACvC,iBAAiB,SAAS,gBAAgB,EAC1C,oBAAoB,SAAS,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,IAC1G,0BAA0B,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,SAAS,yBAAyB,GACrG,0BAA0B,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,CAAC,mBAAmB,CAAC,GACxF,KAAK,CAAC"}
|
|
@@ -1,50 +1,43 @@
|
|
|
1
1
|
import { type Address, type Chain } from "viem";
|
|
2
2
|
import type { LightAccountBase } from "./accounts/base";
|
|
3
|
-
import type {
|
|
4
|
-
/**
|
|
5
|
-
* Light account deployed chains
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare const supportedChains: Chain[];
|
|
3
|
+
import type { LightAccountType, LightAccountVersion, LightAccountVersionConfig, LightAccountVersionConfigs } from "./types";
|
|
9
4
|
/**
|
|
10
5
|
* Account version registry interface that defines the light account versions
|
|
11
6
|
* and the version definition for each light account type
|
|
12
7
|
*
|
|
13
8
|
*/
|
|
14
|
-
export declare const AccountVersionRegistry:
|
|
9
|
+
export declare const AccountVersionRegistry: LightAccountVersionConfigs;
|
|
15
10
|
/**
|
|
16
11
|
* Get the default light account version for the given light account type
|
|
17
12
|
*
|
|
18
13
|
* @template {LightAccountType} TLightAccountType
|
|
19
|
-
* @
|
|
20
|
-
* @returns the default version for the given light account type
|
|
14
|
+
* @returns {LightAccountVersion<TLightAccountType>} the default version for the given light account type
|
|
21
15
|
*/
|
|
22
|
-
export declare const defaultLightAccountVersion: <TLightAccountType extends
|
|
16
|
+
export declare const defaultLightAccountVersion: <TLightAccountType extends LightAccountType>() => keyof LightAccountVersionConfigs[TLightAccountType];
|
|
23
17
|
/**
|
|
24
|
-
* Utility method returning the default light account factory address given a
|
|
18
|
+
* Utility method returning the default light account factory address given a Chain object
|
|
25
19
|
*
|
|
26
|
-
* @param chain - a
|
|
27
|
-
* @param version - the version of the light account to get the factory address for
|
|
28
|
-
* @returns
|
|
20
|
+
* @param {Chain} chain - a Chain object
|
|
21
|
+
* @param {LightAccountVersion} version - the version of the light account to get the factory address for
|
|
22
|
+
* @returns {Address} an for the given chain
|
|
29
23
|
* @throws if the chain doesn't have an address currently deployed
|
|
30
24
|
*/
|
|
31
|
-
export declare const getDefaultLightAccountFactoryAddress: (chain: Chain, version:
|
|
25
|
+
export declare const getDefaultLightAccountFactoryAddress: (chain: Chain, version: LightAccountVersion<"LightAccount">) => Address;
|
|
32
26
|
/**
|
|
33
|
-
* Utility method returning the default multi owner light account factory address given a
|
|
27
|
+
* Utility method returning the default multi owner light account factory address given a Chain object
|
|
34
28
|
*
|
|
35
|
-
* @param chain - a
|
|
36
|
-
* @param version - the version of the light account to get the factory address for
|
|
37
|
-
* @returns
|
|
38
|
-
* @throws if the chain doesn't have an address currently deployed
|
|
29
|
+
* @param {Chain} chain - a Chain object
|
|
30
|
+
* @param {string} version - the version of the light account to get the factory address for
|
|
31
|
+
* @returns {Address} an Address for the given chain
|
|
39
32
|
*/
|
|
40
|
-
export declare const getDefaultMultiOwnerLightAccountFactoryAddress: (chain: Chain, version:
|
|
33
|
+
export declare const getDefaultMultiOwnerLightAccountFactoryAddress: (chain: Chain, version: LightAccountVersion<"MultiOwnerLightAccount">) => `0x${string}`;
|
|
41
34
|
/**
|
|
42
35
|
* Can be used to check if the account with one of the following implementation addresses
|
|
43
36
|
* to not support 1271 signing.
|
|
44
37
|
*
|
|
45
38
|
* Light accounts with versions v1.0.1 and v1.0.2 do not support 1271 signing.
|
|
46
39
|
*/
|
|
47
|
-
export declare const LightAccountUnsupported1271Impls:
|
|
40
|
+
export declare const LightAccountUnsupported1271Impls: LightAccountVersionConfig<"0.6.0">[];
|
|
48
41
|
/**
|
|
49
42
|
* Can be used to check if the account with one of the following factory addresses
|
|
50
43
|
* to not support 1271 signing.
|
|
@@ -56,31 +49,9 @@ export declare const LightAccountUnsupported1271Factories: Set<`0x${string}`>;
|
|
|
56
49
|
* Get the light account version definition for the given light account and chain
|
|
57
50
|
*
|
|
58
51
|
* @template {LightAccountBase} TAccount
|
|
59
|
-
* @
|
|
60
|
-
* @
|
|
61
|
-
* @
|
|
62
|
-
* @param chain - the chain to get the version for
|
|
63
|
-
* @returns the light account version definition for the given light account and chain
|
|
64
|
-
*/
|
|
65
|
-
export declare function getLightAccountVersionDef<TAccount extends LightAccountBase, TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>>(account: TAccount, chain: Chain): Promise<LightAccountVersionDef<TLightAccountType, TLightAccountVersion>>;
|
|
66
|
-
/**
|
|
67
|
-
* Get the light account version definition for the given light account and chain
|
|
68
|
-
*
|
|
69
|
-
* @template {LightAccountBase} TAccount
|
|
70
|
-
* @template {GetLightAccountType<TAccount>} TLightAccountType
|
|
71
|
-
* @param account - the light account to get the version for
|
|
72
|
-
* @param chain - the chain to get the version for
|
|
73
|
-
* @returns the light account version definition for the given light account and chain
|
|
74
|
-
*/
|
|
75
|
-
export declare function getLightAccountVersionDef<TAccount extends LightAccountBase, TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>>(account: TAccount, chain: Chain): Promise<AccountVersionDef<TLightAccountType, GetLightAccountVersion<TLightAccountType>>>;
|
|
76
|
-
/**
|
|
77
|
-
* @param account - the light account to get the version for
|
|
78
|
-
* @param chain - the chain to get the version for
|
|
79
|
-
*
|
|
80
|
-
* @deprecated don't use this function as this function is replaced with getLightAccountVersionDef.
|
|
81
|
-
* Migrate to using getLightAccountVersionDef instead
|
|
82
|
-
*
|
|
83
|
-
* @returns the light account version for the given light account and chain
|
|
52
|
+
* @param {LightAccountBase} account the light account to get the version for
|
|
53
|
+
* @param {Chain} chain - the chain to get the version for
|
|
54
|
+
* @returns {Promise<LightAccountVersionConfig>} the light account version definition for the given light account and chain
|
|
84
55
|
*/
|
|
85
|
-
export declare function
|
|
56
|
+
export declare function getLightAccountVersionForAccount<TAccount extends LightAccountBase>(account: TAccount, chain: Chain): Promise<LightAccountVersionConfig>;
|
|
86
57
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/light-account/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/light-account/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,0BAuDpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,uGAEgB,CAAC;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC,UACxC,KAAK,WACH,oBAAoB,cAAc,CAAC,KAC3C,OAMF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8CAA8C,UAClD,KAAK,WACH,oBAAoB,wBAAwB,CAAC,kBAQvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,sCAG5C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,oBAKhD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,gCAAgC,CACpD,QAAQ,SAAS,gBAAgB,EACjC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAoDrE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
1
2
|
import { type AlchemySmartAccountClient, type AlchemySmartAccountClientConfig } from "@account-kit/infra";
|
|
2
3
|
import { type AccountLoupeActions, type CreateMultiOwnerModularAccountParams, type LightAccount, type MultiOwnerModularAccount, type MultiOwnerPluginActions, type PluginManagerActions } from "@account-kit/smart-contracts";
|
|
3
|
-
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
4
4
|
import { type Chain, type CustomTransport, type HttpTransport, type Transport } from "viem";
|
|
5
5
|
export type AlchemyModularAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultiOwnerModularAccountParams<HttpTransport, TSigner>, "transport" | "chain"> & Omit<AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>>, "account">;
|
|
6
6
|
export declare function createModularAccountAlchemyClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyModularAccountClientConfig<TSigner>): Promise<AlchemySmartAccountClient<CustomTransport, Chain | undefined, MultiOwnerModularAccount<TSigner>, MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> & PluginManagerActions<MultiOwnerModularAccount<TSigner>> & AccountLoupeActions<MultiOwnerModularAccount<TSigner>>>>;
|