@account-kit/smart-contracts 4.7.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/src/light-account/clients/alchemyClient.js +6 -12
- package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/client.d.ts +9 -4
- package/dist/esm/src/light-account/clients/client.js +26 -1
- package/dist/esm/src/light-account/clients/client.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js +6 -11
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerLightAccount.d.ts +10 -4
- package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js +27 -3
- package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
- package/dist/esm/src/ma-v2/abis/accountFactoryAbi.d.ts +492 -0
- package/dist/esm/src/ma-v2/abis/accountFactoryAbi.js +639 -0
- package/dist/esm/src/ma-v2/abis/accountFactoryAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/abis/modularAccountAbi.d.ts +954 -0
- package/dist/esm/src/ma-v2/abis/modularAccountAbi.js +1242 -0
- package/dist/esm/src/ma-v2/abis/modularAccountAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/abis/semiModularAccountBytecodeAbi.d.ts +991 -0
- package/dist/esm/src/ma-v2/abis/semiModularAccountBytecodeAbi.js +1289 -0
- package/dist/esm/src/ma-v2/abis/semiModularAccountBytecodeAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/abis/semiModularAccountStorageAbi.d.ts +1001 -0
- package/dist/esm/src/ma-v2/abis/semiModularAccountStorageAbi.js +1302 -0
- package/dist/esm/src/ma-v2/abis/semiModularAccountStorageAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/account/nativeSMASigner.d.ts +238 -0
- package/dist/esm/src/ma-v2/account/nativeSMASigner.js +88 -0
- package/dist/esm/src/ma-v2/account/nativeSMASigner.js.map +1 -0
- package/dist/esm/src/ma-v2/account/semiModularAccountV2.d.ts +41 -0
- package/dist/esm/src/ma-v2/account/semiModularAccountV2.js +148 -0
- package/dist/esm/src/ma-v2/account/semiModularAccountV2.js.map +1 -0
- package/dist/esm/src/ma-v2/actions/common/types.d.ts +31 -0
- package/dist/esm/src/ma-v2/actions/common/types.js +6 -0
- package/dist/esm/src/ma-v2/actions/common/types.js.map +1 -0
- package/dist/esm/src/ma-v2/actions/common/utils.d.ts +76 -0
- package/dist/esm/src/ma-v2/actions/common/utils.js +100 -0
- package/dist/esm/src/ma-v2/actions/common/utils.js.map +1 -0
- package/dist/esm/src/ma-v2/actions/install-validation/installValidation.d.ts +71 -0
- package/dist/esm/src/ma-v2/actions/install-validation/installValidation.js +109 -0
- package/dist/esm/src/ma-v2/actions/install-validation/installValidation.js.map +1 -0
- package/dist/esm/src/ma-v2/client/client.d.ts +13 -0
- package/dist/esm/src/ma-v2/client/client.js +54 -0
- package/dist/esm/src/ma-v2/client/client.js.map +1 -0
- package/dist/esm/src/ma-v2/index.d.ts +26 -0
- package/dist/esm/src/ma-v2/index.js +24 -0
- package/dist/esm/src/ma-v2/index.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.d.ts +556 -0
- package/dist/esm/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.js +716 -0
- package/dist/esm/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/allowlist-module/module.d.ts +579 -0
- package/dist/esm/src/ma-v2/modules/allowlist-module/module.js +56 -0
- package/dist/esm/src/ma-v2/modules/allowlist-module/module.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.d.ts +312 -0
- package/dist/esm/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.js +404 -0
- package/dist/esm/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/native-token-limit-module/module.d.ts +322 -0
- package/dist/esm/src/ma-v2/modules/native-token-limit-module/module.js +14 -0
- package/dist/esm/src/ma-v2/modules/native-token-limit-module/module.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.d.ts +186 -0
- package/dist/esm/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.js +242 -0
- package/dist/esm/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/paymaster-guard-module/module.d.ts +196 -0
- package/dist/esm/src/ma-v2/modules/paymaster-guard-module/module.js +25 -0
- package/dist/esm/src/ma-v2/modules/paymaster-guard-module/module.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.d.ts +45 -0
- package/dist/esm/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.js +331 -0
- package/dist/esm/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/single-signer-validation/module.d.ts +10 -0
- package/dist/esm/src/ma-v2/modules/single-signer-validation/module.js +16 -0
- package/dist/esm/src/ma-v2/modules/single-signer-validation/module.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.d.ts +239 -0
- package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js +93 -0
- package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.d.ts +229 -0
- package/dist/esm/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.js +296 -0
- package/dist/esm/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/time-range-module/module.d.ts +245 -0
- package/dist/esm/src/ma-v2/modules/time-range-module/module.js +42 -0
- package/dist/esm/src/ma-v2/modules/time-range-module/module.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/utils.d.ts +91 -0
- package/dist/esm/src/ma-v2/modules/utils.js +188 -0
- package/dist/esm/src/ma-v2/modules/utils.js.map +1 -0
- package/dist/esm/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.d.ts +287 -0
- package/dist/esm/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.js +374 -0
- package/dist/esm/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.js.map +1 -0
- package/dist/esm/src/ma-v2/utils.d.ts +16 -0
- package/dist/esm/src/ma-v2/utils.js +105 -0
- package/dist/esm/src/ma-v2/utils.js.map +1 -0
- package/dist/esm/src/msca/client/alchemyClient.js +4 -17
- package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/esm/src/msca/client/client.d.ts +14 -5
- package/dist/esm/src/msca/client/client.js +62 -0
- package/dist/esm/src/msca/client/client.js.map +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.d.ts +4 -2
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js +5 -19
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/types/src/light-account/clients/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/client.d.ts +9 -4
- package/dist/types/src/light-account/clients/client.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts +10 -4
- package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts.map +1 -1
- package/dist/types/src/ma-v2/abis/accountFactoryAbi.d.ts +493 -0
- package/dist/types/src/ma-v2/abis/accountFactoryAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/abis/modularAccountAbi.d.ts +955 -0
- package/dist/types/src/ma-v2/abis/modularAccountAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/abis/semiModularAccountBytecodeAbi.d.ts +992 -0
- package/dist/types/src/ma-v2/abis/semiModularAccountBytecodeAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/abis/semiModularAccountStorageAbi.d.ts +1002 -0
- package/dist/types/src/ma-v2/abis/semiModularAccountStorageAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts +239 -0
- package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts.map +1 -0
- package/dist/types/src/ma-v2/account/semiModularAccountV2.d.ts +42 -0
- package/dist/types/src/ma-v2/account/semiModularAccountV2.d.ts.map +1 -0
- package/dist/types/src/ma-v2/actions/common/types.d.ts +32 -0
- package/dist/types/src/ma-v2/actions/common/types.d.ts.map +1 -0
- package/dist/types/src/ma-v2/actions/common/utils.d.ts +77 -0
- package/dist/types/src/ma-v2/actions/common/utils.d.ts.map +1 -0
- package/dist/types/src/ma-v2/actions/install-validation/installValidation.d.ts +72 -0
- package/dist/types/src/ma-v2/actions/install-validation/installValidation.d.ts.map +1 -0
- package/dist/types/src/ma-v2/client/client.d.ts +14 -0
- package/dist/types/src/ma-v2/client/client.d.ts.map +1 -0
- package/dist/types/src/ma-v2/index.d.ts +27 -0
- package/dist/types/src/ma-v2/index.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.d.ts +557 -0
- package/dist/types/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/allowlist-module/module.d.ts +580 -0
- package/dist/types/src/ma-v2/modules/allowlist-module/module.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.d.ts +313 -0
- package/dist/types/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/native-token-limit-module/module.d.ts +323 -0
- package/dist/types/src/ma-v2/modules/native-token-limit-module/module.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.d.ts +187 -0
- package/dist/types/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/paymaster-guard-module/module.d.ts +197 -0
- package/dist/types/src/ma-v2/modules/paymaster-guard-module/module.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.d.ts +46 -0
- package/dist/types/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/single-signer-validation/module.d.ts +11 -0
- package/dist/types/src/ma-v2/modules/single-signer-validation/module.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts +240 -0
- package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.d.ts +230 -0
- package/dist/types/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/time-range-module/module.d.ts +246 -0
- package/dist/types/src/ma-v2/modules/time-range-module/module.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/utils.d.ts +92 -0
- package/dist/types/src/ma-v2/modules/utils.d.ts.map +1 -0
- package/dist/types/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.d.ts +288 -0
- package/dist/types/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.d.ts.map +1 -0
- package/dist/types/src/ma-v2/utils.d.ts +17 -0
- package/dist/types/src/ma-v2/utils.d.ts.map +1 -0
- package/dist/types/src/msca/client/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/msca/client/client.d.ts +14 -5
- package/dist/types/src/msca/client/client.d.ts.map +1 -1
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts +4 -2
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts.map +1 -1
- package/package.json +11 -5
- package/src/light-account/clients/alchemyClient.ts +5 -14
- package/src/light-account/clients/client.ts +52 -6
- package/src/light-account/clients/multiOwnerAlchemyClient.ts +5 -13
- package/src/light-account/clients/multiOwnerLightAccount.ts +64 -8
- package/src/ma-v2/abis/accountFactoryAbi.ts +638 -0
- package/src/ma-v2/abis/modularAccountAbi.ts +1241 -0
- package/src/ma-v2/abis/semiModularAccountBytecodeAbi.ts +1288 -0
- package/src/ma-v2/abis/semiModularAccountStorageAbi.ts +1301 -0
- package/src/ma-v2/account/nativeSMASigner.ts +121 -0
- package/src/ma-v2/account/semiModularAccountV2.ts +289 -0
- package/src/ma-v2/actions/common/types.ts +37 -0
- package/src/ma-v2/actions/common/utils.ts +103 -0
- package/src/ma-v2/actions/install-validation/installValidation.ts +213 -0
- package/src/ma-v2/client/client.ts +117 -0
- package/src/ma-v2/index.ts +47 -0
- package/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.ts +715 -0
- package/src/ma-v2/modules/allowlist-module/module.ts +87 -0
- package/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.ts +403 -0
- package/src/ma-v2/modules/native-token-limit-module/module.ts +21 -0
- package/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.ts +241 -0
- package/src/ma-v2/modules/paymaster-guard-module/module.ts +35 -0
- package/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.ts +330 -0
- package/src/ma-v2/modules/single-signer-validation/module.ts +24 -0
- package/src/ma-v2/modules/single-signer-validation/signer.ts +127 -0
- package/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.ts +295 -0
- package/src/ma-v2/modules/time-range-module/module.ts +63 -0
- package/src/ma-v2/modules/utils.ts +213 -0
- package/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.ts +373 -0
- package/src/ma-v2/utils.ts +138 -0
- package/src/msca/client/alchemyClient.ts +3 -22
- package/src/msca/client/client.ts +157 -13
- package/src/msca/client/multiSigAlchemyClient.ts +6 -29
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {} from "@account-kit/infra";
|
|
2
|
+
import { createLightAccountClient, } from "@account-kit/smart-contracts";
|
|
3
3
|
import {} from "viem";
|
|
4
4
|
/**
|
|
5
5
|
* Creates an Alchemy smart account client connected to a Light Account instance.
|
|
@@ -17,22 +17,16 @@ import {} from "viem";
|
|
|
17
17
|
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
18
18
|
* });
|
|
19
19
|
* ```
|
|
20
|
-
*
|
|
20
|
+
* @deprecated Use createLightAccountClient instead now, it should switch depending on the transport
|
|
21
21
|
* @param {AlchemyLightAccountClientConfig} config The configuration for setting up the Alchemy Light Account Client
|
|
22
22
|
* @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created client
|
|
23
23
|
*/
|
|
24
24
|
export async function createLightAccountAlchemyClient({ opts, transport, chain, ...config }) {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
return createLightAccountClient({
|
|
26
|
+
opts,
|
|
27
27
|
transport,
|
|
28
28
|
chain,
|
|
29
|
-
});
|
|
30
|
-
return createAlchemySmartAccountClient({
|
|
31
29
|
...config,
|
|
32
|
-
|
|
33
|
-
chain,
|
|
34
|
-
account,
|
|
35
|
-
opts,
|
|
36
|
-
}).extend(lightAccountClientActions);
|
|
30
|
+
});
|
|
37
31
|
}
|
|
38
32
|
//# sourceMappingURL=alchemyClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,GAIzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAc,MAAM,MAAM,CAAC;AAsBlC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CAAC,EACpD,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,MAAM,EACuB;IAChC,OAAO,wBAAwB,CAAC;QAC9B,IAAI;QACJ,SAAS;QACT,KAAK;QACL,GAAG,MAAM;KACV,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createLightAccountClient,\n type CreateLightAccountParams,\n type LightAccount,\n type LightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport { type Chain } from \"viem\";\n\nexport type AlchemyLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<CreateLightAccountParams<HttpTransport, TSigner>, \"transport\"> &\n Omit<\n AlchemySmartAccountClientConfig<Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n LightAccount<TSigner>,\n LightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates an Alchemy smart account client connected to a Light Account instance.\n *\n * @example\n * ```ts\n * import { createLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createLightAccountAlchemyClient({\n * transport: alchemy({ apiKey: \"your-api-key\" }),\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n * @deprecated Use createLightAccountClient instead now, it should switch depending on the transport\n * @param {AlchemyLightAccountClientConfig} config The configuration for setting up the Alchemy Light Account Client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created client\n */\nexport async function createLightAccountAlchemyClient({\n opts,\n transport,\n chain,\n ...config\n}: AlchemyLightAccountClientConfig): Promise<AlchemySmartAccountClient> {\n return createLightAccountClient({\n opts,\n transport,\n chain,\n ...config,\n });\n}\n"]}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
|
|
1
|
+
import { type NotType, type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import { type Chain, type CustomTransport, type Transport } from "viem";
|
|
3
|
-
import { type CreateLightAccountParams, type LightAccount } from "
|
|
3
|
+
import { type CreateLightAccountParams, type LightAccount } from "@account-kit/smart-contracts";
|
|
4
4
|
import { type LightAccountClientActions } from "../decorators/lightAccount.js";
|
|
5
|
-
|
|
5
|
+
import { type AlchemySmartAccountClient, type AlchemyTransport } from "@account-kit/infra";
|
|
6
|
+
import { type AlchemyLightAccountClientConfig } from "./alchemyClient.js";
|
|
7
|
+
export type CreateLightAccountClientParams<TTransport extends Transport | AlchemyTransport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = {
|
|
6
8
|
transport: CreateLightAccountParams<TTransport, TSigner>["transport"];
|
|
7
9
|
chain: CreateLightAccountParams<TTransport, TSigner>["chain"];
|
|
8
10
|
} & Omit<CreateLightAccountParams<TTransport, TSigner>, "transport" | "chain"> & Omit<SmartAccountClientConfig<TTransport, TChain>, "transport" | "account" | "chain">;
|
|
9
|
-
export declare function createLightAccountClient<
|
|
11
|
+
export declare function createLightAccountClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyLightAccountClientConfig<TSigner> & {
|
|
12
|
+
transport: AlchemyTransport;
|
|
13
|
+
}): Promise<AlchemySmartAccountClient<Chain | undefined, LightAccount<TSigner>, LightAccountClientActions<TSigner>>>;
|
|
14
|
+
export declare function createLightAccountClient<TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner, TTransport extends Transport = Transport>(args: CreateLightAccountClientParams<TTransport, TChain, TSigner> & NotType<TTransport, AlchemyTransport>): Promise<SmartAccountClient<CustomTransport, TChain, LightAccount<TSigner>, SmartAccountClientActions<Chain, SmartContractAccount> & LightAccountClientActions<TSigner, LightAccount<TSigner>>>>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { createSmartAccountClient, } from "@aa-sdk/core";
|
|
2
2
|
import {} from "viem";
|
|
3
|
-
import { createLightAccount, } from "
|
|
3
|
+
import { createLightAccount, } from "@account-kit/smart-contracts";
|
|
4
4
|
import { lightAccountClientActions, } from "../decorators/lightAccount.js";
|
|
5
|
+
import { isAlchemyTransport, createAlchemySmartAccountClient, } from "@account-kit/infra";
|
|
6
|
+
import {} from "./alchemyClient.js";
|
|
5
7
|
/**
|
|
6
8
|
* Creates a light account client using the provided parameters, including account information, transport mechanism, blockchain chain, and additional client configurations. This function first creates a light account and then uses it to create a smart account client, extending it with light account client actions.
|
|
7
9
|
*
|
|
10
|
+
* Also, we modified the return type to be the light account alchemy client if the transport is alchemy.
|
|
11
|
+
*
|
|
8
12
|
* @example
|
|
9
13
|
* ```ts
|
|
10
14
|
* import { createLightAccountClient } from "@account-kit/smart-contracts";
|
|
@@ -18,6 +22,19 @@ import { lightAccountClientActions, } from "../decorators/lightAccount.js";
|
|
|
18
22
|
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
19
23
|
* });
|
|
20
24
|
* ```
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { createLightAccountClient } from "@account-kit/smart-contracts";
|
|
28
|
+
* import { sepolia, alchemy } from "@account-kit/infra";
|
|
29
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
30
|
+
* import { generatePrivateKey } from "viem"
|
|
31
|
+
*
|
|
32
|
+
* const lightAlchemyAccountClient = await createLightAccountClient({
|
|
33
|
+
* transport: alchemy({ apiKey: "your-api-key" }),
|
|
34
|
+
* chain: sepolia,
|
|
35
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
21
38
|
*
|
|
22
39
|
* @param {CreateLightAccountClientParams} params The parameters for creating a light account client
|
|
23
40
|
* @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` object containing the created account information and methods
|
|
@@ -29,6 +46,14 @@ export async function createLightAccountClient(params) {
|
|
|
29
46
|
transport,
|
|
30
47
|
chain,
|
|
31
48
|
});
|
|
49
|
+
if (isAlchemyTransport(transport, chain)) {
|
|
50
|
+
return createAlchemySmartAccountClient({
|
|
51
|
+
...params,
|
|
52
|
+
transport,
|
|
53
|
+
chain,
|
|
54
|
+
account: lightAccount,
|
|
55
|
+
}).extend(lightAccountClientActions);
|
|
56
|
+
}
|
|
32
57
|
return createSmartAccountClient({
|
|
33
58
|
...params,
|
|
34
59
|
transport,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAOzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAoD,MAAM,MAAM,CAAC;AACxE,OAAO,EACL,kBAAkB,GAGnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,yBAAyB,GAE1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,+BAA+B,GAGhC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAwC,MAAM,oBAAoB,CAAC;AA6C1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,MAAsC;IAEtC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEpC,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC;QAC5C,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IACH,IAAI,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,+BAA+B,CAAC;YACrC,GAAG,MAAM;YACT,SAAS;YACT,KAAK;YACL,OAAO,EAAE,YAAY;SACtB,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n type NotType,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n createLightAccount,\n type CreateLightAccountParams,\n type LightAccount,\n} from \"@account-kit/smart-contracts\";\nimport {\n lightAccountClientActions,\n type LightAccountClientActions,\n} from \"../decorators/lightAccount.js\";\nimport {\n isAlchemyTransport,\n createAlchemySmartAccountClient,\n type AlchemySmartAccountClient,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\nimport { type AlchemyLightAccountClientConfig } from \"./alchemyClient.js\";\n\nexport type CreateLightAccountClientParams<\n TTransport extends Transport | AlchemyTransport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateLightAccountParams<TTransport, TSigner>[\"transport\"];\n chain: CreateLightAccountParams<TTransport, TSigner>[\"chain\"];\n} & Omit<CreateLightAccountParams<TTransport, TSigner>, \"transport\" | \"chain\"> &\n Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n >;\n\nexport function createLightAccountClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyLightAccountClientConfig<TSigner> & {\n transport: AlchemyTransport;\n }\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n LightAccount<TSigner>,\n LightAccountClientActions<TSigner>\n >\n>;\nexport function createLightAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TTransport extends Transport = Transport\n>(\n args: CreateLightAccountClientParams<TTransport, TChain, TSigner> &\n NotType<TTransport, AlchemyTransport>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n TChain,\n LightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n LightAccountClientActions<TSigner, LightAccount<TSigner>>\n >\n>;\n\n/**\n * Creates a light account client using the provided parameters, including account information, transport mechanism, blockchain chain, and additional client configurations. This function first creates a light account and then uses it to create a smart account client, extending it with light account client actions.\n *\n * Also, we modified the return type to be the light account alchemy client if the transport is alchemy.\n *\n * @example\n * ```ts\n * import { createLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createLightAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n * @example\n * ```ts\n * import { createLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAlchemyAccountClient = await createLightAccountClient({\n * transport: alchemy({ apiKey: \"your-api-key\" }),\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateLightAccountClientParams} params The parameters for creating a light account client\n * @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` object containing the created account information and methods\n */\nexport async function createLightAccountClient(\n params: CreateLightAccountClientParams\n): Promise<SmartAccountClient | AlchemySmartAccountClient> {\n const { transport, chain } = params;\n\n const lightAccount = await createLightAccount({\n ...params,\n transport,\n chain,\n });\n if (isAlchemyTransport(transport, chain)) {\n return createAlchemySmartAccountClient({\n ...params,\n transport,\n chain,\n account: lightAccount,\n }).extend(lightAccountClientActions);\n }\n\n return createSmartAccountClient({\n ...params,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(lightAccountClientActions);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {} from "@account-kit/infra";
|
|
2
|
+
import { createMultiOwnerLightAccountClient, } from "@account-kit/smart-contracts";
|
|
3
3
|
import {} from "viem";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a multi-owner light account Alchemy client using the provided configuration.
|
|
@@ -20,21 +20,16 @@ import {} from "viem";
|
|
|
20
20
|
* });
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
23
|
+
* @deprecated Use createMultiOwnerLightAccountAlchemyClient instead now, it should switch depending on the transport
|
|
23
24
|
* @param {AlchemyMultiOwnerLightAccountClientConfig} config The configuration for creating the Alchemy client
|
|
24
25
|
* @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created account information and methods
|
|
25
26
|
*/
|
|
26
27
|
export async function createMultiOwnerLightAccountAlchemyClient({ opts, transport, chain, ...config }) {
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
return createMultiOwnerLightAccountClient({
|
|
29
|
+
opts,
|
|
29
30
|
transport,
|
|
30
31
|
chain,
|
|
31
|
-
});
|
|
32
|
-
return createAlchemySmartAccountClient({
|
|
33
32
|
...config,
|
|
34
|
-
|
|
35
|
-
chain,
|
|
36
|
-
account,
|
|
37
|
-
opts,
|
|
38
|
-
}).extend(multiOwnerLightAccountClientActions);
|
|
33
|
+
});
|
|
39
34
|
}
|
|
40
35
|
//# sourceMappingURL=multiOwnerAlchemyClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiOwnerAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"multiOwnerAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kCAAkC,GAInC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAc,MAAM,MAAM,CAAC;AAyBlC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,yCAAyC,CAAC,EAC9D,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,MAAM,EACiC;IAC1C,OAAO,kCAAkC,CAAC;QACxC,IAAI;QACJ,SAAS;QACT,KAAK;QACL,GAAG,MAAM;KACV,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createMultiOwnerLightAccountClient,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n type MultiOwnerLightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport { type Chain } from \"viem\";\n\nexport type AlchemyMultiOwnerLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"type\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Chain, MultiOwnerLightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createMultiOwnerLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultiOwnerLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultiOwnerLightAccount<TSigner>,\n MultiOwnerLightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates a multi-owner light account Alchemy client using the provided configuration.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createMultiOwnerLightAccountAlchemyClient({\n * transport: alchemy({\n * apiKey: \"your-api-key\",\n * }),\n * chain: sepolia\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @deprecated Use createMultiOwnerLightAccountAlchemyClient instead now, it should switch depending on the transport\n * @param {AlchemyMultiOwnerLightAccountClientConfig} config The configuration for creating the Alchemy client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created account information and methods\n */\nexport async function createMultiOwnerLightAccountAlchemyClient({\n opts,\n transport,\n chain,\n ...config\n}: AlchemyMultiOwnerLightAccountClientConfig): Promise<AlchemySmartAccountClient> {\n return createMultiOwnerLightAccountClient({\n opts,\n transport,\n chain,\n ...config,\n });\n}\n"]}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
|
|
1
|
+
import { type NotType, type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import { type Chain, type CustomTransport, type Transport } from "viem";
|
|
3
|
-
import { type CreateMultiOwnerLightAccountParams, type MultiOwnerLightAccount } from "
|
|
4
|
-
import { type
|
|
3
|
+
import { type CreateMultiOwnerLightAccountParams, type MultiOwnerLightAccount, type MultiOwnerLightAccountClientActions, type AlchemyMultiOwnerLightAccountClientConfig } from "@account-kit/smart-contracts";
|
|
4
|
+
import { type AlchemySmartAccountClient, type AlchemyTransport } from "@account-kit/infra";
|
|
5
5
|
export type CreateMultiOwnerLightAccountClientParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = {
|
|
6
6
|
transport: CreateMultiOwnerLightAccountParams<TTransport, TSigner>["transport"];
|
|
7
7
|
chain: CreateMultiOwnerLightAccountParams<TTransport, TSigner>["chain"];
|
|
8
8
|
} & Omit<CreateMultiOwnerLightAccountParams<TTransport, TSigner>, "transport" | "chain"> & Omit<SmartAccountClientConfig<TTransport, TChain>, "transport" | "account" | "chain">;
|
|
9
|
-
export
|
|
9
|
+
export type CreateMultiOwnerLightAccountClientDynamicTransportParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = (AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {
|
|
10
|
+
transport: AlchemyTransport;
|
|
11
|
+
}) | CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner>;
|
|
12
|
+
export declare function createMultiOwnerLightAccountClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {
|
|
13
|
+
transport: AlchemyTransport;
|
|
14
|
+
}): Promise<AlchemySmartAccountClient<Chain | undefined, MultiOwnerLightAccount<TSigner>, MultiOwnerLightAccountClientActions<TSigner>>>;
|
|
15
|
+
export declare function createMultiOwnerLightAccountClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner>(args: CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner> & NotType<TTransport, AlchemyTransport>): Promise<SmartAccountClient<CustomTransport, Chain, MultiOwnerLightAccount<TSigner>, SmartAccountClientActions<Chain, SmartContractAccount> & MultiOwnerLightAccountClientActions<TSigner, MultiOwnerLightAccount<TSigner>>>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSmartAccountClient, } from "@aa-sdk/core";
|
|
2
2
|
import {} from "viem";
|
|
3
|
-
import { createMultiOwnerLightAccount, } from "
|
|
4
|
-
import {
|
|
3
|
+
import { multiOwnerLightAccountClientActions, createMultiOwnerLightAccount, } from "@account-kit/smart-contracts";
|
|
4
|
+
import { isAlchemyTransport, createAlchemySmartAccountClient, } from "@account-kit/infra";
|
|
5
5
|
/**
|
|
6
6
|
* Creates a multi-owner light account client using the provided parameters. It first creates a multi-owner light account and then creates a smart account client with the provided configurations.
|
|
7
7
|
*
|
|
@@ -19,7 +19,23 @@ import { multiOwnerLightAccountClientActions, } from "../decorators/multiOwnerLi
|
|
|
19
19
|
* });
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
|
-
* @
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { createMultiOwnerLightAccountClient } from "@account-kit/smart-contracts";
|
|
25
|
+
* import { sepolia, alchemy } from "@account-kit/infra";
|
|
26
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
27
|
+
* import { generatePrivateKey } from "viem"
|
|
28
|
+
*
|
|
29
|
+
* const lightAccountClient = await createMultiOwnerLightAccountClient({
|
|
30
|
+
* transport: alchemy({
|
|
31
|
+
* apiKey: "your-api-key",
|
|
32
|
+
* }),
|
|
33
|
+
* chain: sepolia
|
|
34
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param {CreateMultiOwnerLightAccountClientDynamicTransportParams} params the configuration for creating the multi-owner light / alchemy account client with the provided parameters transport
|
|
23
39
|
* @returns {Promise<SmartAccountClient>} a promise that resolves to a `SmartAccountClient` containing the created account client and relevant methods
|
|
24
40
|
*/
|
|
25
41
|
export async function createMultiOwnerLightAccountClient(params) {
|
|
@@ -29,6 +45,14 @@ export async function createMultiOwnerLightAccountClient(params) {
|
|
|
29
45
|
transport,
|
|
30
46
|
chain,
|
|
31
47
|
});
|
|
48
|
+
if (isAlchemyTransport(transport, chain)) {
|
|
49
|
+
return createAlchemySmartAccountClient({
|
|
50
|
+
...params,
|
|
51
|
+
transport,
|
|
52
|
+
chain,
|
|
53
|
+
account: lightAccount,
|
|
54
|
+
}).extend(multiOwnerLightAccountClientActions);
|
|
55
|
+
}
|
|
32
56
|
return createSmartAccountClient({
|
|
33
57
|
...params,
|
|
34
58
|
transport,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiOwnerLightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerLightAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,
|
|
1
|
+
{"version":3,"file":"multiOwnerLightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerLightAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAOzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAoD,MAAM,MAAM,CAAC;AACxE,OAAO,EACL,mCAAmC,EACnC,4BAA4B,GAK7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,+BAA+B,GAGhC,MAAM,oBAAoB,CAAC;AAiE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,KAAK,UAAU,kCAAkC,CACtD,MAAgE;IAEhE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEpC,MAAM,YAAY,GAAG,MAAM,4BAA4B,CAAC;QACtD,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IACH,IAAI,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,+BAA+B,CAAC;YACrC,GAAG,MAAM;YACT,SAAS;YACT,KAAK;YACL,OAAO,EAAE,YAAY;SACtB,CAAC,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n type NotType,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n multiOwnerLightAccountClientActions,\n createMultiOwnerLightAccount,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n type MultiOwnerLightAccountClientActions,\n type AlchemyMultiOwnerLightAccountClientConfig,\n} from \"@account-kit/smart-contracts\";\nimport {\n isAlchemyTransport,\n createAlchemySmartAccountClient,\n type AlchemySmartAccountClient,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\n\nexport type CreateMultiOwnerLightAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner\n >[\"transport\"];\n chain: CreateMultiOwnerLightAccountParams<TTransport, TSigner>[\"chain\"];\n} & Omit<\n CreateMultiOwnerLightAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n >;\n\nexport type CreateMultiOwnerLightAccountClientDynamicTransportParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> =\n | (AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {\n transport: AlchemyTransport;\n })\n | CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner>;\n\nexport async function createMultiOwnerLightAccountClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {\n transport: AlchemyTransport;\n }\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultiOwnerLightAccount<TSigner>,\n MultiOwnerLightAccountClientActions<TSigner>\n >\n>;\n\nexport function createMultiOwnerLightAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner> &\n NotType<TTransport, AlchemyTransport>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultiOwnerLightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n MultiOwnerLightAccountClientActions<\n TSigner,\n MultiOwnerLightAccount<TSigner>\n >\n >\n>;\n\n/**\n * Creates a multi-owner light account client using the provided parameters. It first creates a multi-owner light account and then creates a smart account client with the provided configurations.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createMultiOwnerLightAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createMultiOwnerLightAccountClient({\n * transport: alchemy({\n * apiKey: \"your-api-key\",\n * }),\n * chain: sepolia\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateMultiOwnerLightAccountClientDynamicTransportParams} params the configuration for creating the multi-owner light / alchemy account client with the provided parameters transport\n * @returns {Promise<SmartAccountClient>} a promise that resolves to a `SmartAccountClient` containing the created account client and relevant methods\n */\nexport async function createMultiOwnerLightAccountClient(\n params: CreateMultiOwnerLightAccountClientDynamicTransportParams\n): Promise<SmartAccountClient | AlchemySmartAccountClient> {\n const { transport, chain } = params;\n\n const lightAccount = await createMultiOwnerLightAccount({\n ...params,\n transport,\n chain,\n });\n if (isAlchemyTransport(transport, chain)) {\n return createAlchemySmartAccountClient({\n ...params,\n transport,\n chain,\n account: lightAccount,\n }).extend(multiOwnerLightAccountClientActions);\n }\n\n return createSmartAccountClient({\n ...params,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(multiOwnerLightAccountClientActions);\n}\n"]}
|