@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,4 +1,4 @@
|
|
|
1
|
-
import { type SmartAccountClient, type SmartAccountClientRpcSchema, type SmartAccountSigner } from "@aa-sdk/core";
|
|
1
|
+
import { type NotType, type SmartAccountClient, type SmartAccountClientRpcSchema, type SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import { type Chain, type CustomTransport, type Transport } from "viem";
|
|
3
3
|
import type { CreateLightAccountClientParams } from "../../light-account/clients/client.js";
|
|
4
4
|
import { type AccountLoupeActions } from "../account-loupe/decorator.js";
|
|
@@ -7,8 +7,17 @@ import { type CreateMultisigModularAccountParams, type MultisigModularAccount }
|
|
|
7
7
|
import { type PluginManagerActions } from "../plugin-manager/decorator.js";
|
|
8
8
|
import { type MultiOwnerPluginActions } from "../plugins/multi-owner/index.js";
|
|
9
9
|
import { type MultisigPluginActions, type MultisigUserOperationContext } from "../plugins/multisig/index.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
10
|
+
import type { AlchemyModularAccountClientConfig } from "./alchemyClient.js";
|
|
11
|
+
import { type AlchemySmartAccountClient, type AlchemyTransport } from "@account-kit/infra";
|
|
12
|
+
import type { AlchemyMultisigAccountClientConfig } from "./multiSigAlchemyClient.js";
|
|
13
|
+
export type CreateMultiOwnerModularAccountClientWithoutAlchemyParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultiOwnerModularAccountParams<TTransport, TSigner>, "transport" | "chain"> & Omit<CreateLightAccountClientParams<TTransport, TChain, TSigner>, "account">;
|
|
14
|
+
export type CreateMultiOwnerModularAccountClientParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = CreateMultiOwnerModularAccountClientWithoutAlchemyParams<TTransport, TChain, TSigner> | AlchemyModularAccountClientConfig<TSigner>;
|
|
15
|
+
export type CreateMultisigModularAccountClientWithoutAlchemyParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultisigModularAccountParams<TTransport, TSigner>, "transport" | "chain"> & Omit<CreateLightAccountClientParams<TTransport, TChain, TSigner>, "account">;
|
|
16
|
+
export type CreateMultisigModularAccountClientParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = CreateMultisigModularAccountClientWithoutAlchemyParams<TTransport, TChain, TSigner> | AlchemyMultisigAccountClientConfig<TSigner>;
|
|
17
|
+
export declare function createMultiOwnerModularAccountClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyModularAccountClientConfig<TSigner> & {
|
|
18
|
+
transport: AlchemyTransport;
|
|
19
|
+
}): Promise<AlchemySmartAccountClient<Chain | undefined, MultiOwnerModularAccount<TSigner>, MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> & PluginManagerActions<MultiOwnerModularAccount<TSigner>> & AccountLoupeActions<MultiOwnerModularAccount<TSigner>>>>;
|
|
20
|
+
export declare function createMultiOwnerModularAccountClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner>(args: CreateMultiOwnerModularAccountClientParams<TTransport, TChain, TSigner> & NotType<TTransport, AlchemyTransport>): Promise<SmartAccountClient<CustomTransport, Chain, MultiOwnerModularAccount<TSigner>, MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> & PluginManagerActions<MultiOwnerModularAccount<TSigner>> & AccountLoupeActions<MultiOwnerModularAccount<TSigner>>>>;
|
|
21
|
+
export declare function createMultisigModularAccountClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyMultisigAccountClientConfig<TSigner>): Promise<AlchemySmartAccountClient<Chain | undefined, MultisigModularAccount<TSigner>, MultisigPluginActions<MultisigModularAccount<TSigner>> & PluginManagerActions<MultisigModularAccount<TSigner>> & AccountLoupeActions<MultisigModularAccount<TSigner>>, MultisigUserOperationContext>>;
|
|
22
|
+
export declare function createMultisigModularAccountClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner>(args: CreateMultisigModularAccountClientParams<TTransport, TChain, TSigner> & NotType<TTransport, AlchemyTransport>): Promise<SmartAccountClient<CustomTransport, Chain, MultisigModularAccount<TSigner>, MultisigPluginActions<MultisigModularAccount<TSigner>> & PluginManagerActions<MultisigModularAccount<TSigner>> & AccountLoupeActions<MultisigModularAccount<TSigner>>, SmartAccountClientRpcSchema, MultisigUserOperationContext>>;
|
|
14
23
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/msca/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,oCAAoC,EACzC,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL,KAAK,kCAAkC,EACvC,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL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B,GAAG,kBAAkB,EAEvD,IAAI,EAAE,wCAAwC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,GACzE,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,GACtC,OAAO,CACR,kBAAkB,CAChB,eAAe,EACf,KAAK,EACL,sBAAsB,CAAC,OAAO,CAAC,EAC/B,qBAAqB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,GACpD,oBAAoB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,GACrD,mBAAmB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,EACtD,2BAA2B,EAC3B,4BAA4B,CAC7B,CACF,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type SmartAccountSigner } from "@aa-sdk/core";
|
|
2
|
-
import { type AlchemySmartAccountClient, type AlchemySmartAccountClientConfig } from "@account-kit/infra";
|
|
2
|
+
import { type AlchemySmartAccountClient, type AlchemySmartAccountClientConfig, type AlchemyTransport } from "@account-kit/infra";
|
|
3
3
|
import { type AccountLoupeActions, type CreateMultisigModularAccountParams, type LightAccount, type MultisigModularAccount, type MultisigPluginActions, type MultisigUserOperationContext, type PluginManagerActions } from "@account-kit/smart-contracts";
|
|
4
4
|
import { type Chain, type HttpTransport } from "viem";
|
|
5
|
-
export type AlchemyMultisigAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultisigModularAccountParams<HttpTransport, TSigner>, "transport"> & Omit<AlchemySmartAccountClientConfig<Chain, LightAccount<TSigner>, MultisigUserOperationContext>, "account"
|
|
5
|
+
export type AlchemyMultisigAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultisigModularAccountParams<HttpTransport, TSigner>, "transport"> & Omit<AlchemySmartAccountClientConfig<Chain, LightAccount<TSigner>, MultisigUserOperationContext>, "account"> & {
|
|
6
|
+
transport: AlchemyTransport;
|
|
7
|
+
};
|
|
6
8
|
export declare function createMultisigAccountAlchemyClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyMultisigAccountClientConfig<TSigner>): Promise<AlchemySmartAccountClient<Chain | undefined, MultisigModularAccount<TSigner>, MultisigPluginActions<MultisigModularAccount<TSigner>> & PluginManagerActions<MultisigModularAccount<TSigner>> & AccountLoupeActions<MultisigModularAccount<TSigner>>, MultisigUserOperationContext>>;
|
|
7
9
|
//# sourceMappingURL=multiSigAlchemyClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiSigAlchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/msca/client/multiSigAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"multiSigAlchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/msca/client/multiSigAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,kCAAkC,EACvC,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,MAAM,CAAC;AAItD,MAAM,MAAM,kCAAkC,CAC5C,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,kCAAkC,CAAC,aAAa,EAAE,OAAO,CAAC,EAC1D,WAAW,CACZ,GACC,IAAI,CACF,+BAA+B,CAC7B,KAAK,EACL,YAAY,CAAC,OAAO,CAAC,EACrB,4BAA4B,CAC7B,EACD,SAAS,CACV,GAAG;IAAE,SAAS,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAEtC,wBAAgB,kCAAkC,CAChD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EAEvD,MAAM,EAAE,kCAAkC,CAAC,OAAO,CAAC,GAClD,OAAO,CACR,yBAAyB,CACvB,KAAK,GAAG,SAAS,EACjB,sBAAsB,CAAC,OAAO,CAAC,EAC/B,qBAAqB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,GACpD,oBAAoB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,GACrD,mBAAmB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,EACtD,4BAA4B,CAC7B,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@account-kit/smart-contracts",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"description": "aa-sdk compatible interfaces for Alchemy Smart Accounts",
|
|
5
5
|
"author": "Alchemy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"!vitest.config.ts",
|
|
20
20
|
"!.env",
|
|
21
21
|
"!src/**/*.test.ts",
|
|
22
|
+
"!src/**/*.test-d.ts",
|
|
22
23
|
"!src/__tests__/**/*"
|
|
23
24
|
],
|
|
24
25
|
"exports": {
|
|
@@ -32,6 +33,11 @@
|
|
|
32
33
|
"import": "./dist/esm/plugindefs/index.js",
|
|
33
34
|
"default": "./dist/esm/plugindefs/index.js"
|
|
34
35
|
},
|
|
36
|
+
"./experimental": {
|
|
37
|
+
"types": "./dist/types/src/ma-v2/index.d.ts",
|
|
38
|
+
"import": "./dist/esm/src/ma-v2/index.js",
|
|
39
|
+
"default": "./dist/esm/src/ma-v2/index.js"
|
|
40
|
+
},
|
|
35
41
|
"./package.json": "./package.json"
|
|
36
42
|
},
|
|
37
43
|
"scripts": {
|
|
@@ -46,7 +52,7 @@
|
|
|
46
52
|
"test:run": "vitest run"
|
|
47
53
|
},
|
|
48
54
|
"devDependencies": {
|
|
49
|
-
"@account-kit/plugingen": "^4.
|
|
55
|
+
"@account-kit/plugingen": "^4.9.0",
|
|
50
56
|
"change-case": "^5.1.2",
|
|
51
57
|
"dedent": "^1.5.1",
|
|
52
58
|
"dotenv": "^16.3.1",
|
|
@@ -66,10 +72,10 @@
|
|
|
66
72
|
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
67
73
|
},
|
|
68
74
|
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
|
|
69
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "9cd4dc759879defa6ac90f1ae7f8a378d9d1666f",
|
|
70
76
|
"dependencies": {
|
|
71
|
-
"@aa-sdk/core": "^4.
|
|
72
|
-
"@account-kit/infra": "^4.
|
|
77
|
+
"@aa-sdk/core": "^4.9.0",
|
|
78
|
+
"@account-kit/infra": "^4.9.0"
|
|
73
79
|
},
|
|
74
80
|
"peerDependencies": {
|
|
75
81
|
"viem": "^2.20.0"
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import {
|
|
3
|
-
createAlchemySmartAccountClient,
|
|
4
3
|
type AlchemySmartAccountClient,
|
|
5
4
|
type AlchemySmartAccountClientConfig,
|
|
6
5
|
} from "@account-kit/infra";
|
|
7
6
|
import {
|
|
8
|
-
|
|
9
|
-
lightAccountClientActions,
|
|
7
|
+
createLightAccountClient,
|
|
10
8
|
type CreateLightAccountParams,
|
|
11
9
|
type LightAccount,
|
|
12
10
|
type LightAccountClientActions,
|
|
@@ -49,7 +47,7 @@ export async function createLightAccountAlchemyClient<
|
|
|
49
47
|
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
50
48
|
* });
|
|
51
49
|
* ```
|
|
52
|
-
*
|
|
50
|
+
* @deprecated Use createLightAccountClient instead now, it should switch depending on the transport
|
|
53
51
|
* @param {AlchemyLightAccountClientConfig} config The configuration for setting up the Alchemy Light Account Client
|
|
54
52
|
* @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created client
|
|
55
53
|
*/
|
|
@@ -59,17 +57,10 @@ export async function createLightAccountAlchemyClient({
|
|
|
59
57
|
chain,
|
|
60
58
|
...config
|
|
61
59
|
}: AlchemyLightAccountClientConfig): Promise<AlchemySmartAccountClient> {
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
return createLightAccountClient({
|
|
61
|
+
opts,
|
|
64
62
|
transport,
|
|
65
63
|
chain,
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
return createAlchemySmartAccountClient({
|
|
69
64
|
...config,
|
|
70
|
-
|
|
71
|
-
chain,
|
|
72
|
-
account,
|
|
73
|
-
opts,
|
|
74
|
-
}).extend(lightAccountClientActions);
|
|
65
|
+
});
|
|
75
66
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSmartAccountClient,
|
|
3
|
+
type NotType,
|
|
3
4
|
type SmartAccountClient,
|
|
4
5
|
type SmartAccountClientActions,
|
|
5
6
|
type SmartAccountClientConfig,
|
|
@@ -11,14 +12,21 @@ import {
|
|
|
11
12
|
createLightAccount,
|
|
12
13
|
type CreateLightAccountParams,
|
|
13
14
|
type LightAccount,
|
|
14
|
-
} from "
|
|
15
|
+
} from "@account-kit/smart-contracts";
|
|
15
16
|
import {
|
|
16
17
|
lightAccountClientActions,
|
|
17
18
|
type LightAccountClientActions,
|
|
18
19
|
} from "../decorators/lightAccount.js";
|
|
20
|
+
import {
|
|
21
|
+
isAlchemyTransport,
|
|
22
|
+
createAlchemySmartAccountClient,
|
|
23
|
+
type AlchemySmartAccountClient,
|
|
24
|
+
type AlchemyTransport,
|
|
25
|
+
} from "@account-kit/infra";
|
|
26
|
+
import { type AlchemyLightAccountClientConfig } from "./alchemyClient.js";
|
|
19
27
|
|
|
20
28
|
export type CreateLightAccountClientParams<
|
|
21
|
-
TTransport extends Transport = Transport,
|
|
29
|
+
TTransport extends Transport | AlchemyTransport = Transport,
|
|
22
30
|
TChain extends Chain | undefined = Chain | undefined,
|
|
23
31
|
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
24
32
|
> = {
|
|
@@ -31,14 +39,29 @@ export type CreateLightAccountClientParams<
|
|
|
31
39
|
>;
|
|
32
40
|
|
|
33
41
|
export function createLightAccountClient<
|
|
34
|
-
TChain extends Chain | undefined = Chain | undefined,
|
|
35
42
|
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
36
43
|
>(
|
|
37
|
-
|
|
44
|
+
params: AlchemyLightAccountClientConfig<TSigner> & {
|
|
45
|
+
transport: AlchemyTransport;
|
|
46
|
+
}
|
|
47
|
+
): Promise<
|
|
48
|
+
AlchemySmartAccountClient<
|
|
49
|
+
Chain | undefined,
|
|
50
|
+
LightAccount<TSigner>,
|
|
51
|
+
LightAccountClientActions<TSigner>
|
|
52
|
+
>
|
|
53
|
+
>;
|
|
54
|
+
export function createLightAccountClient<
|
|
55
|
+
TChain extends Chain | undefined = Chain | undefined,
|
|
56
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
57
|
+
TTransport extends Transport = Transport
|
|
58
|
+
>(
|
|
59
|
+
args: CreateLightAccountClientParams<TTransport, TChain, TSigner> &
|
|
60
|
+
NotType<TTransport, AlchemyTransport>
|
|
38
61
|
): Promise<
|
|
39
62
|
SmartAccountClient<
|
|
40
63
|
CustomTransport,
|
|
41
|
-
|
|
64
|
+
TChain,
|
|
42
65
|
LightAccount<TSigner>,
|
|
43
66
|
SmartAccountClientActions<Chain, SmartContractAccount> &
|
|
44
67
|
LightAccountClientActions<TSigner, LightAccount<TSigner>>
|
|
@@ -48,6 +71,8 @@ export function createLightAccountClient<
|
|
|
48
71
|
/**
|
|
49
72
|
* 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.
|
|
50
73
|
*
|
|
74
|
+
* Also, we modified the return type to be the light account alchemy client if the transport is alchemy.
|
|
75
|
+
*
|
|
51
76
|
* @example
|
|
52
77
|
* ```ts
|
|
53
78
|
* import { createLightAccountClient } from "@account-kit/smart-contracts";
|
|
@@ -61,13 +86,26 @@ export function createLightAccountClient<
|
|
|
61
86
|
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
62
87
|
* });
|
|
63
88
|
* ```
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* import { createLightAccountClient } from "@account-kit/smart-contracts";
|
|
92
|
+
* import { sepolia, alchemy } from "@account-kit/infra";
|
|
93
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
94
|
+
* import { generatePrivateKey } from "viem"
|
|
95
|
+
*
|
|
96
|
+
* const lightAlchemyAccountClient = await createLightAccountClient({
|
|
97
|
+
* transport: alchemy({ apiKey: "your-api-key" }),
|
|
98
|
+
* chain: sepolia,
|
|
99
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
64
102
|
*
|
|
65
103
|
* @param {CreateLightAccountClientParams} params The parameters for creating a light account client
|
|
66
104
|
* @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` object containing the created account information and methods
|
|
67
105
|
*/
|
|
68
106
|
export async function createLightAccountClient(
|
|
69
107
|
params: CreateLightAccountClientParams
|
|
70
|
-
): Promise<SmartAccountClient> {
|
|
108
|
+
): Promise<SmartAccountClient | AlchemySmartAccountClient> {
|
|
71
109
|
const { transport, chain } = params;
|
|
72
110
|
|
|
73
111
|
const lightAccount = await createLightAccount({
|
|
@@ -75,6 +113,14 @@ export async function createLightAccountClient(
|
|
|
75
113
|
transport,
|
|
76
114
|
chain,
|
|
77
115
|
});
|
|
116
|
+
if (isAlchemyTransport(transport, chain)) {
|
|
117
|
+
return createAlchemySmartAccountClient({
|
|
118
|
+
...params,
|
|
119
|
+
transport,
|
|
120
|
+
chain,
|
|
121
|
+
account: lightAccount,
|
|
122
|
+
}).extend(lightAccountClientActions);
|
|
123
|
+
}
|
|
78
124
|
|
|
79
125
|
return createSmartAccountClient({
|
|
80
126
|
...params,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import {
|
|
3
|
-
createAlchemySmartAccountClient,
|
|
4
3
|
type AlchemySmartAccountClient,
|
|
5
4
|
type AlchemySmartAccountClientConfig,
|
|
6
5
|
} from "@account-kit/infra";
|
|
7
6
|
import {
|
|
8
|
-
|
|
9
|
-
multiOwnerLightAccountClientActions,
|
|
7
|
+
createMultiOwnerLightAccountClient,
|
|
10
8
|
type CreateMultiOwnerLightAccountParams,
|
|
11
9
|
type MultiOwnerLightAccount,
|
|
12
10
|
type MultiOwnerLightAccountClientActions,
|
|
@@ -55,6 +53,7 @@ export async function createMultiOwnerLightAccountAlchemyClient<
|
|
|
55
53
|
* });
|
|
56
54
|
* ```
|
|
57
55
|
*
|
|
56
|
+
* @deprecated Use createMultiOwnerLightAccountAlchemyClient instead now, it should switch depending on the transport
|
|
58
57
|
* @param {AlchemyMultiOwnerLightAccountClientConfig} config The configuration for creating the Alchemy client
|
|
59
58
|
* @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created account information and methods
|
|
60
59
|
*/
|
|
@@ -64,17 +63,10 @@ export async function createMultiOwnerLightAccountAlchemyClient({
|
|
|
64
63
|
chain,
|
|
65
64
|
...config
|
|
66
65
|
}: AlchemyMultiOwnerLightAccountClientConfig): Promise<AlchemySmartAccountClient> {
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
return createMultiOwnerLightAccountClient({
|
|
67
|
+
opts,
|
|
69
68
|
transport,
|
|
70
69
|
chain,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
return createAlchemySmartAccountClient({
|
|
74
70
|
...config,
|
|
75
|
-
|
|
76
|
-
chain,
|
|
77
|
-
account,
|
|
78
|
-
opts,
|
|
79
|
-
}).extend(multiOwnerLightAccountClientActions);
|
|
71
|
+
});
|
|
80
72
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSmartAccountClient,
|
|
3
|
+
type NotType,
|
|
3
4
|
type SmartAccountClient,
|
|
4
5
|
type SmartAccountClientActions,
|
|
5
6
|
type SmartAccountClientConfig,
|
|
@@ -8,14 +9,19 @@ import {
|
|
|
8
9
|
} from "@aa-sdk/core";
|
|
9
10
|
import { type Chain, type CustomTransport, type Transport } from "viem";
|
|
10
11
|
import {
|
|
12
|
+
multiOwnerLightAccountClientActions,
|
|
11
13
|
createMultiOwnerLightAccount,
|
|
12
14
|
type CreateMultiOwnerLightAccountParams,
|
|
13
15
|
type MultiOwnerLightAccount,
|
|
14
|
-
} from "../accounts/multiOwner.js";
|
|
15
|
-
import {
|
|
16
|
-
multiOwnerLightAccountClientActions,
|
|
17
16
|
type MultiOwnerLightAccountClientActions,
|
|
18
|
-
|
|
17
|
+
type AlchemyMultiOwnerLightAccountClientConfig,
|
|
18
|
+
} from "@account-kit/smart-contracts";
|
|
19
|
+
import {
|
|
20
|
+
isAlchemyTransport,
|
|
21
|
+
createAlchemySmartAccountClient,
|
|
22
|
+
type AlchemySmartAccountClient,
|
|
23
|
+
type AlchemyTransport,
|
|
24
|
+
} from "@account-kit/infra";
|
|
19
25
|
|
|
20
26
|
export type CreateMultiOwnerLightAccountClientParams<
|
|
21
27
|
TTransport extends Transport = Transport,
|
|
@@ -36,11 +42,37 @@ export type CreateMultiOwnerLightAccountClientParams<
|
|
|
36
42
|
"transport" | "account" | "chain"
|
|
37
43
|
>;
|
|
38
44
|
|
|
45
|
+
export type CreateMultiOwnerLightAccountClientDynamicTransportParams<
|
|
46
|
+
TTransport extends Transport = Transport,
|
|
47
|
+
TChain extends Chain | undefined = Chain | undefined,
|
|
48
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
49
|
+
> =
|
|
50
|
+
| (AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {
|
|
51
|
+
transport: AlchemyTransport;
|
|
52
|
+
})
|
|
53
|
+
| CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner>;
|
|
54
|
+
|
|
55
|
+
export async function createMultiOwnerLightAccountClient<
|
|
56
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
57
|
+
>(
|
|
58
|
+
params: AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {
|
|
59
|
+
transport: AlchemyTransport;
|
|
60
|
+
}
|
|
61
|
+
): Promise<
|
|
62
|
+
AlchemySmartAccountClient<
|
|
63
|
+
Chain | undefined,
|
|
64
|
+
MultiOwnerLightAccount<TSigner>,
|
|
65
|
+
MultiOwnerLightAccountClientActions<TSigner>
|
|
66
|
+
>
|
|
67
|
+
>;
|
|
68
|
+
|
|
39
69
|
export function createMultiOwnerLightAccountClient<
|
|
70
|
+
TTransport extends Transport = Transport,
|
|
40
71
|
TChain extends Chain | undefined = Chain | undefined,
|
|
41
72
|
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
42
73
|
>(
|
|
43
|
-
args: CreateMultiOwnerLightAccountClientParams<
|
|
74
|
+
args: CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner> &
|
|
75
|
+
NotType<TTransport, AlchemyTransport>
|
|
44
76
|
): Promise<
|
|
45
77
|
SmartAccountClient<
|
|
46
78
|
CustomTransport,
|
|
@@ -71,12 +103,28 @@ export function createMultiOwnerLightAccountClient<
|
|
|
71
103
|
* });
|
|
72
104
|
* ```
|
|
73
105
|
*
|
|
74
|
-
* @
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* import { createMultiOwnerLightAccountClient } from "@account-kit/smart-contracts";
|
|
109
|
+
* import { sepolia, alchemy } from "@account-kit/infra";
|
|
110
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
111
|
+
* import { generatePrivateKey } from "viem"
|
|
112
|
+
*
|
|
113
|
+
* const lightAccountClient = await createMultiOwnerLightAccountClient({
|
|
114
|
+
* transport: alchemy({
|
|
115
|
+
* apiKey: "your-api-key",
|
|
116
|
+
* }),
|
|
117
|
+
* chain: sepolia
|
|
118
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
119
|
+
* });
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @param {CreateMultiOwnerLightAccountClientDynamicTransportParams} params the configuration for creating the multi-owner light / alchemy account client with the provided parameters transport
|
|
75
123
|
* @returns {Promise<SmartAccountClient>} a promise that resolves to a `SmartAccountClient` containing the created account client and relevant methods
|
|
76
124
|
*/
|
|
77
125
|
export async function createMultiOwnerLightAccountClient(
|
|
78
|
-
params:
|
|
79
|
-
): Promise<SmartAccountClient> {
|
|
126
|
+
params: CreateMultiOwnerLightAccountClientDynamicTransportParams
|
|
127
|
+
): Promise<SmartAccountClient | AlchemySmartAccountClient> {
|
|
80
128
|
const { transport, chain } = params;
|
|
81
129
|
|
|
82
130
|
const lightAccount = await createMultiOwnerLightAccount({
|
|
@@ -84,6 +132,14 @@ export async function createMultiOwnerLightAccountClient(
|
|
|
84
132
|
transport,
|
|
85
133
|
chain,
|
|
86
134
|
});
|
|
135
|
+
if (isAlchemyTransport(transport, chain)) {
|
|
136
|
+
return createAlchemySmartAccountClient({
|
|
137
|
+
...params,
|
|
138
|
+
transport,
|
|
139
|
+
chain,
|
|
140
|
+
account: lightAccount,
|
|
141
|
+
}).extend(multiOwnerLightAccountClientActions);
|
|
142
|
+
}
|
|
87
143
|
|
|
88
144
|
return createSmartAccountClient({
|
|
89
145
|
...params,
|