@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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Hex, type Chain, type Address } from "viem";
|
|
2
|
+
export declare const DEFAULT_OWNER_ENTITY_ID = 0;
|
|
3
|
+
export type PackUOSignatureParams = {
|
|
4
|
+
validationSignature: Hex;
|
|
5
|
+
};
|
|
6
|
+
export type Pack1271SignatureParams = {
|
|
7
|
+
validationSignature: Hex;
|
|
8
|
+
entityId: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const packUOSignature: ({ validationSignature, }: PackUOSignatureParams) => Hex;
|
|
11
|
+
export declare const pack1271Signature: ({ validationSignature, entityId, }: Pack1271SignatureParams) => Hex;
|
|
12
|
+
export declare const getDefaultMAV2FactoryAddress: (chain: Chain) => Address;
|
|
13
|
+
export declare const getDefaultSMAV2BytecodeAddress: (chain: Chain) => Address;
|
|
14
|
+
export declare const getDefaultSMAV2StorageAddress: (chain: Chain) => Address;
|
|
15
|
+
export declare const getDefaultSMAV27702Address: (chain: Chain) => Address;
|
|
16
|
+
export declare const getDefaultMAV2Address: (chain: Chain) => Address;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { concat, toHex } from "viem";
|
|
2
|
+
import { arbitrum, arbitrumSepolia, base, baseSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, sepolia, } from "@account-kit/infra";
|
|
3
|
+
export const DEFAULT_OWNER_ENTITY_ID = 0;
|
|
4
|
+
// Signature packing utility for user operations
|
|
5
|
+
export const packUOSignature = ({
|
|
6
|
+
// orderedHookData, TODO: integrate in next iteration of MAv2 sdk
|
|
7
|
+
validationSignature, }) => {
|
|
8
|
+
return concat(["0xFF", "0x00", validationSignature]);
|
|
9
|
+
};
|
|
10
|
+
// Signature packing utility for 1271 signatures
|
|
11
|
+
export const pack1271Signature = ({ validationSignature, entityId, }) => {
|
|
12
|
+
return concat([
|
|
13
|
+
"0x00",
|
|
14
|
+
toHex(entityId, { size: 4 }),
|
|
15
|
+
"0xFF",
|
|
16
|
+
"0x00", // EOA type signature
|
|
17
|
+
validationSignature,
|
|
18
|
+
]);
|
|
19
|
+
};
|
|
20
|
+
export const getDefaultMAV2FactoryAddress = (chain) => {
|
|
21
|
+
switch (chain.id) {
|
|
22
|
+
// TODO: case mekong.id:
|
|
23
|
+
case sepolia.id:
|
|
24
|
+
case baseSepolia.id:
|
|
25
|
+
case polygon.id:
|
|
26
|
+
case mainnet.id:
|
|
27
|
+
case polygonAmoy.id:
|
|
28
|
+
case optimism.id:
|
|
29
|
+
case optimismSepolia.id:
|
|
30
|
+
case arbitrum.id:
|
|
31
|
+
case arbitrumSepolia.id:
|
|
32
|
+
case base.id:
|
|
33
|
+
default:
|
|
34
|
+
return "0x00000000000017c61b5bEe81050EC8eFc9c6fecd";
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export const getDefaultSMAV2BytecodeAddress = (chain) => {
|
|
38
|
+
switch (chain.id) {
|
|
39
|
+
// TODO: case mekong.id:
|
|
40
|
+
case sepolia.id:
|
|
41
|
+
case baseSepolia.id:
|
|
42
|
+
case polygon.id:
|
|
43
|
+
case mainnet.id:
|
|
44
|
+
case polygonAmoy.id:
|
|
45
|
+
case optimism.id:
|
|
46
|
+
case optimismSepolia.id:
|
|
47
|
+
case arbitrum.id:
|
|
48
|
+
case arbitrumSepolia.id:
|
|
49
|
+
case base.id:
|
|
50
|
+
default:
|
|
51
|
+
return "0x000000000000c5A9089039570Dd36455b5C07383";
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export const getDefaultSMAV2StorageAddress = (chain) => {
|
|
55
|
+
switch (chain.id) {
|
|
56
|
+
// TODO: case mekong.id:
|
|
57
|
+
case sepolia.id:
|
|
58
|
+
case baseSepolia.id:
|
|
59
|
+
case polygon.id:
|
|
60
|
+
case mainnet.id:
|
|
61
|
+
case polygonAmoy.id:
|
|
62
|
+
case optimism.id:
|
|
63
|
+
case optimismSepolia.id:
|
|
64
|
+
case arbitrum.id:
|
|
65
|
+
case arbitrumSepolia.id:
|
|
66
|
+
case base.id:
|
|
67
|
+
default:
|
|
68
|
+
return "0x0000000000006E2f9d80CaEc0Da6500f005EB25A";
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
export const getDefaultSMAV27702Address = (chain) => {
|
|
72
|
+
switch (chain.id) {
|
|
73
|
+
// TODO: case mekong.id:
|
|
74
|
+
case sepolia.id:
|
|
75
|
+
case baseSepolia.id:
|
|
76
|
+
case polygon.id:
|
|
77
|
+
case mainnet.id:
|
|
78
|
+
case polygonAmoy.id:
|
|
79
|
+
case optimism.id:
|
|
80
|
+
case optimismSepolia.id:
|
|
81
|
+
case arbitrum.id:
|
|
82
|
+
case arbitrumSepolia.id:
|
|
83
|
+
case base.id:
|
|
84
|
+
default:
|
|
85
|
+
return "0x69007702764179f14F51cdce752f4f775d74E139";
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
export const getDefaultMAV2Address = (chain) => {
|
|
89
|
+
switch (chain.id) {
|
|
90
|
+
// TODO: case mekong.id:
|
|
91
|
+
case sepolia.id:
|
|
92
|
+
case baseSepolia.id:
|
|
93
|
+
case polygon.id:
|
|
94
|
+
case mainnet.id:
|
|
95
|
+
case polygonAmoy.id:
|
|
96
|
+
case optimism.id:
|
|
97
|
+
case optimismSepolia.id:
|
|
98
|
+
case arbitrum.id:
|
|
99
|
+
case arbitrumSepolia.id:
|
|
100
|
+
case base.id:
|
|
101
|
+
default:
|
|
102
|
+
return "0x00000000000002377B26b1EdA7b0BC371C60DD4f";
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/ma-v2/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAs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AwB;QACxB,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,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,EAAE,CAAC;QACb;YACE,OAAO,4CAA4C,CAAC;IACxD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAY,EAAW,EAAE;IAC7D,QAAQ,KAAK,CAAC,EAAE,EAAE,CAAC;QACjB,wBAAwB;QACxB,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,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,EAAE,CAAC;QACb;YACE,OAAO,4CAA4C,CAAC;IACxD,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { concat, toHex, type Hex, type Chain, type Address } from \"viem\";\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\";\n\nexport const DEFAULT_OWNER_ENTITY_ID = 0;\n\nexport type PackUOSignatureParams = {\n // orderedHookData: HookData[];\n validationSignature: Hex;\n};\n\n// TODO: direct call validation 1271\nexport type Pack1271SignatureParams = {\n validationSignature: Hex;\n entityId: number;\n};\n\n// Signature packing utility for user operations\nexport const packUOSignature = ({\n // orderedHookData, TODO: integrate in next iteration of MAv2 sdk\n validationSignature,\n}: PackUOSignatureParams): Hex => {\n return concat([\"0xFF\", \"0x00\", validationSignature]);\n};\n\n// Signature packing utility for 1271 signatures\nexport const pack1271Signature = ({\n validationSignature,\n entityId,\n}: Pack1271SignatureParams): Hex => {\n return concat([\n \"0x00\",\n toHex(entityId, { size: 4 }),\n \"0xFF\",\n \"0x00\", // EOA type signature\n validationSignature,\n ]);\n};\n\nexport const getDefaultMAV2FactoryAddress = (chain: Chain): Address => {\n switch (chain.id) {\n // TODO: case mekong.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 \"0x00000000000017c61b5bEe81050EC8eFc9c6fecd\";\n }\n};\n\nexport const getDefaultSMAV2BytecodeAddress = (chain: Chain): Address => {\n switch (chain.id) {\n // TODO: case mekong.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 \"0x000000000000c5A9089039570Dd36455b5C07383\";\n }\n};\n\nexport const getDefaultSMAV2StorageAddress = (chain: Chain): Address => {\n switch (chain.id) {\n // TODO: case mekong.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 \"0x0000000000006E2f9d80CaEc0Da6500f005EB25A\";\n }\n};\n\nexport const getDefaultSMAV27702Address = (chain: Chain): Address => {\n switch (chain.id) {\n // TODO: case mekong.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 \"0x69007702764179f14F51cdce752f4f775d74E139\";\n }\n};\n\nexport const getDefaultMAV2Address = (chain: Chain): Address => {\n switch (chain.id) {\n // TODO: case mekong.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 \"0x00000000000002377B26b1EdA7b0BC371C60DD4f\";\n }\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {} from "@account-kit/infra";
|
|
2
|
+
import { createMultiOwnerModularAccountClient, } from "@account-kit/smart-contracts";
|
|
3
3
|
import {} from "viem";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a modular account Alchemy client with the provided configuration.
|
|
@@ -17,24 +17,11 @@ import {} from "viem";
|
|
|
17
17
|
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
18
18
|
* });
|
|
19
19
|
* ```
|
|
20
|
-
*
|
|
20
|
+
* @deprecated Use createModularAccountClient instead of this function, we are switching based on the transport
|
|
21
21
|
* @param {AlchemyModularAccountClientConfig} config The configuration for creating the Alchemy client
|
|
22
22
|
* @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` configured with the desired plugins and actions
|
|
23
23
|
*/
|
|
24
24
|
export async function createModularAccountAlchemyClient(config) {
|
|
25
|
-
|
|
26
|
-
const account = await createMultiOwnerModularAccount({
|
|
27
|
-
...config,
|
|
28
|
-
transport,
|
|
29
|
-
chain,
|
|
30
|
-
});
|
|
31
|
-
return createAlchemySmartAccountClient({
|
|
32
|
-
...config,
|
|
33
|
-
account,
|
|
34
|
-
opts,
|
|
35
|
-
})
|
|
36
|
-
.extend(multiOwnerPluginActions)
|
|
37
|
-
.extend(pluginManagerActions)
|
|
38
|
-
.extend(accountLoupeActions);
|
|
25
|
+
return createMultiOwnerModularAccountClient(config);
|
|
39
26
|
}
|
|
40
27
|
//# sourceMappingURL=alchemyClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/msca/client/alchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/msca/client/alchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oCAAoC,GAOrC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAkC,MAAM,MAAM,CAAC;AA2BtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,MAAyC;IAEzC,OAAO,oCAAoC,CAAC,MAAM,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createMultiOwnerModularAccountClient,\n type AccountLoupeActions,\n type CreateMultiOwnerModularAccountParams,\n type LightAccount,\n type MultiOwnerModularAccount,\n type MultiOwnerPluginActions,\n type PluginManagerActions,\n} from \"@account-kit/smart-contracts\";\nimport { type Chain, type HttpTransport } from \"viem\";\n\nexport type AlchemyModularAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerModularAccountParams<HttpTransport, TSigner>,\n \"transport\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport function createModularAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyModularAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultiOwnerModularAccount<TSigner>,\n MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> &\n PluginManagerActions<MultiOwnerModularAccount<TSigner>> &\n AccountLoupeActions<MultiOwnerModularAccount<TSigner>>\n >\n>;\n\n/**\n * Creates a modular account Alchemy client with the provided configuration.\n *\n * @example\n * ```ts\n * import { createModularAccountAlchemyClient } 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 alchemyAccountClient = await createModularAccountAlchemyClient({\n * transport: alchemy({ apiKey: \"your-api-key\" }),\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n * @deprecated Use createModularAccountClient instead of this function, we are switching based on the transport\n * @param {AlchemyModularAccountClientConfig} config The configuration for creating the Alchemy client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` configured with the desired plugins and actions\n */\nexport async function createModularAccountAlchemyClient(\n config: AlchemyModularAccountClientConfig\n): Promise<AlchemySmartAccountClient> {\n return createMultiOwnerModularAccountClient(config);\n}\n"]}
|
|
@@ -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,7 +7,16 @@ 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>>;
|
|
@@ -7,6 +7,7 @@ import { pluginManagerActions, } from "../plugin-manager/decorator.js";
|
|
|
7
7
|
import { multiOwnerPluginActions, } from "../plugins/multi-owner/index.js";
|
|
8
8
|
import { multisigPluginActions, } from "../plugins/multisig/index.js";
|
|
9
9
|
import { multisigSignatureMiddleware } from "../plugins/multisig/middleware.js";
|
|
10
|
+
import { createAlchemySmartAccountClient, isAlchemyTransport, } from "@account-kit/infra";
|
|
10
11
|
/**
|
|
11
12
|
* Creates a multi-owner modular account client with the provided parameters including account, transport, chain, and additional client configuration. This function uses a modular account and extends it with various plugin actions.
|
|
12
13
|
*
|
|
@@ -24,6 +25,19 @@ import { multisigSignatureMiddleware } from "../plugins/multisig/middleware.js";
|
|
|
24
25
|
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
25
26
|
* });
|
|
26
27
|
* ```
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { createMultiOwnerModularAccountClient } from "@account-kit/smart-contracts";
|
|
31
|
+
* import { sepolia, alchemy } from "@account-kit/infra";
|
|
32
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
33
|
+
* import { generatePrivateKey } from "viem"
|
|
34
|
+
*
|
|
35
|
+
* const alchemyAccountClient = await createMultiOwnerModularAccountClient({
|
|
36
|
+
* transport: alchemy({ apiKey: "your-api-key" }),
|
|
37
|
+
* chain: sepolia,
|
|
38
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
27
41
|
*
|
|
28
42
|
* @param {CreateMultiOwnerModularAccountClientParams} config The parameters for creating the multi-owner modular account client
|
|
29
43
|
* @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` instance with extended plugin actions
|
|
@@ -34,6 +48,19 @@ export async function createMultiOwnerModularAccountClient({ transport, chain, .
|
|
|
34
48
|
transport,
|
|
35
49
|
chain,
|
|
36
50
|
});
|
|
51
|
+
if (isAlchemyTransport(transport, chain)) {
|
|
52
|
+
const { opts } = params;
|
|
53
|
+
return createAlchemySmartAccountClient({
|
|
54
|
+
...params,
|
|
55
|
+
account: modularAccount,
|
|
56
|
+
transport,
|
|
57
|
+
chain,
|
|
58
|
+
opts,
|
|
59
|
+
})
|
|
60
|
+
.extend(multiOwnerPluginActions)
|
|
61
|
+
.extend(pluginManagerActions)
|
|
62
|
+
.extend(accountLoupeActions);
|
|
63
|
+
}
|
|
37
64
|
return createSmartAccountClient({
|
|
38
65
|
...params,
|
|
39
66
|
transport,
|
|
@@ -63,6 +90,21 @@ export async function createMultiOwnerModularAccountClient({ transport, chain, .
|
|
|
63
90
|
* threshold: 2, // 2 of N signatures
|
|
64
91
|
* });
|
|
65
92
|
* ```
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* import { createMultisigModularAccountClient } from "@account-kit/smart-contracts";
|
|
96
|
+
* import { sepolia } from "@account-kit/infra";
|
|
97
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
98
|
+
* import { generatePrivateKey } from "viem"
|
|
99
|
+
*
|
|
100
|
+
* const alchemyAccountClient = await createMultisigModularAccountClient({
|
|
101
|
+
* transport: alchemy({ apiKey: "your-api-key" }),
|
|
102
|
+
* chain: sepolia,
|
|
103
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
|
|
104
|
+
* owners: [...], // other owners on the account
|
|
105
|
+
* threshold: 2, // 2 of N signatures
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
66
108
|
*
|
|
67
109
|
* @param {CreateMultisigModularAccountClientParams} config the parameters for configuring the multisig modular account client
|
|
68
110
|
* @returns {Promise<SmartAccountClient<Transport, Chain, MultisigModularAccount<SmartAccountSigner>, {}, SmartAccountClientRpcSchema, MultisigUserOperationContext>>} a promise that resolves to a `SmartAccountClient` object extended with the multisig modular account and additional actions
|
|
@@ -73,6 +115,26 @@ export async function createMultisigModularAccountClient({ transport, chain, ...
|
|
|
73
115
|
transport,
|
|
74
116
|
chain,
|
|
75
117
|
});
|
|
118
|
+
if (isAlchemyTransport(transport, chain)) {
|
|
119
|
+
// Need to fit the type into this since the previous multiSigAlchemyClient had it at this point, but without an Value as Type should be safe
|
|
120
|
+
// And the createAlchemySmartAccountClient signUserOperation could not infer without this
|
|
121
|
+
let config = {
|
|
122
|
+
...params,
|
|
123
|
+
chain,
|
|
124
|
+
transport,
|
|
125
|
+
};
|
|
126
|
+
const { opts } = config;
|
|
127
|
+
return createAlchemySmartAccountClient({
|
|
128
|
+
...config,
|
|
129
|
+
account: modularAccount,
|
|
130
|
+
opts,
|
|
131
|
+
signUserOperation: multisigSignatureMiddleware,
|
|
132
|
+
})
|
|
133
|
+
.extend(smartAccountClientActions)
|
|
134
|
+
.extend(multisigPluginActions)
|
|
135
|
+
.extend(pluginManagerActions)
|
|
136
|
+
.extend(accountLoupeActions);
|
|
137
|
+
}
|
|
76
138
|
const client = createSmartAccountClient({
|
|
77
139
|
...params,
|
|
78
140
|
transport,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/msca/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAI1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAoD,MAAM,MAAM,CAAC;AAExE,OAAO,EACL,mBAAmB,GAEpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,8BAA8B,GAG/B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,4BAA4B,GAG7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,oBAAoB,GAErB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,uBAAuB,GAExB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,GAGtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAsChF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,oCAAoC,CAAC,EACzD,SAAS,EACT,KAAK,EACL,GAAG,MAAM,EACkC;IAC3C,MAAM,cAAc,GAAG,MAAM,8BAA8B,CAAC;QAC1D,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,SAAS;QACT,KAAK;QACL,OAAO,EAAE,cAAc;KACxB,CAAC;SACC,MAAM,CAAC,oBAAoB,CAAC;SAC5B,MAAM,CAAC,uBAAuB,CAAC;SAC/B,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACjC,CAAC;AAoBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,kCAAkC,CAAC,EACvD,SAAS,EACT,KAAK,EACL,GAAG,MAAM,EACgC;IAUzC,MAAM,cAAc,GAAG,MAAM,4BAA4B,CAAC;QACxD,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,wBAAwB,CAAC;QACtC,GAAG,MAAM;QACT,SAAS;QACT,KAAK;QACL,OAAO,EAAE,cAAc;QACvB,iBAAiB,EAAE,2BAA2B;KAC/C,CAAC;SACC,MAAM,CAAC,yBAAyB,CAAC;SACjC,MAAM,CAAC,oBAAoB,CAAC;SAC5B,MAAM,CAAC,qBAAqB,CAAC;SAC7B,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAE/B,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n smartAccountClientActions,\n type SmartAccountClient,\n type SmartAccountClientRpcSchema,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport type { CreateLightAccountClientParams } from \"../../light-account/clients/client.js\";\nimport {\n accountLoupeActions,\n type AccountLoupeActions,\n} from \"../account-loupe/decorator.js\";\nimport {\n createMultiOwnerModularAccount,\n type CreateMultiOwnerModularAccountParams,\n type MultiOwnerModularAccount,\n} from \"../account/multiOwnerAccount.js\";\nimport {\n createMultisigModularAccount,\n type CreateMultisigModularAccountParams,\n type MultisigModularAccount,\n} from \"../account/multisigAccount.js\";\nimport {\n pluginManagerActions,\n type PluginManagerActions,\n} from \"../plugin-manager/decorator.js\";\nimport {\n multiOwnerPluginActions,\n type MultiOwnerPluginActions,\n} from \"../plugins/multi-owner/index.js\";\nimport {\n multisigPluginActions,\n type MultisigPluginActions,\n type MultisigUserOperationContext,\n} from \"../plugins/multisig/index.js\";\nimport { multisigSignatureMiddleware } from \"../plugins/multisig/middleware.js\";\n\nexport type CreateMultiOwnerModularAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerModularAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<CreateLightAccountClientParams<TTransport, TChain, TSigner>, \"account\">;\n\nexport type CreateMultisigModularAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultisigModularAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<CreateLightAccountClientParams<TTransport, TChain, TSigner>, \"account\">;\n\nexport function createMultiOwnerModularAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultiOwnerModularAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultiOwnerModularAccount<TSigner>,\n MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> &\n PluginManagerActions<MultiOwnerModularAccount<TSigner>> &\n AccountLoupeActions<MultiOwnerModularAccount<TSigner>>\n >\n>;\n\n/**\n * Creates a multi-owner modular account client with the provided parameters including account, transport, chain, and additional client configuration. This function uses a modular account and extends it with various plugin actions.\n *\n * @example\n * ```ts\n * import { createMultiOwnerModularAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http } from \"viem\";\n * import { generatePrivateKey } from \"viem/accounts\";\n *\n * const accountClient = await createMultiOwnerModularAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateMultiOwnerModularAccountClientParams} config The parameters for creating the multi-owner modular account client\n * @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` instance with extended plugin actions\n */\nexport async function createMultiOwnerModularAccountClient({\n transport,\n chain,\n ...params\n}: CreateMultiOwnerModularAccountClientParams): Promise<SmartAccountClient> {\n const modularAccount = await createMultiOwnerModularAccount({\n ...params,\n transport,\n chain,\n });\n\n return createSmartAccountClient({\n ...params,\n transport,\n chain,\n account: modularAccount,\n })\n .extend(pluginManagerActions)\n .extend(multiOwnerPluginActions)\n .extend(accountLoupeActions);\n}\n\nexport function createMultisigModularAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultisigModularAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultisigModularAccount<TSigner>,\n MultisigPluginActions<MultisigModularAccount<TSigner>> &\n PluginManagerActions<MultisigModularAccount<TSigner>> &\n AccountLoupeActions<MultisigModularAccount<TSigner>>,\n SmartAccountClientRpcSchema,\n MultisigUserOperationContext\n >\n>;\n\n/**\n * Creates a multisig modular account client using the provided parameters including account details, transport, chain, and additional client configuration. This function constructs the multisig modular account and extends it with various actions to create a comprehensive client.\n *\n * @example\n * ```ts\n * import { createMultisigModularAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http } from \"viem\"\n * import { generatePrivateKey } from \"viem/accounts\";\n *\n * const accountClient = await createMultisigModularAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),\n * owners: [], // other owners on the account\n * threshold: 2, // 2 of N signatures\n * });\n * ```\n *\n * @param {CreateMultisigModularAccountClientParams} config the parameters for configuring the multisig modular account client\n * @returns {Promise<SmartAccountClient<Transport, Chain, MultisigModularAccount<SmartAccountSigner>, {}, SmartAccountClientRpcSchema, MultisigUserOperationContext>>} a promise that resolves to a `SmartAccountClient` object extended with the multisig modular account and additional actions\n */\nexport async function createMultisigModularAccountClient({\n transport,\n chain,\n ...params\n}: CreateMultisigModularAccountClientParams): Promise<\n SmartAccountClient<\n Transport,\n Chain,\n MultisigModularAccount<SmartAccountSigner>,\n {},\n SmartAccountClientRpcSchema,\n MultisigUserOperationContext\n >\n> {\n const modularAccount = await createMultisigModularAccount({\n ...params,\n transport,\n chain,\n });\n\n const client = createSmartAccountClient({\n ...params,\n transport,\n chain,\n account: modularAccount,\n signUserOperation: multisigSignatureMiddleware,\n })\n .extend(smartAccountClientActions)\n .extend(pluginManagerActions)\n .extend(multisigPluginActions)\n .extend(accountLoupeActions);\n\n return client;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/msca/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAK1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAoD,MAAM,MAAM,CAAC;AAExE,OAAO,EACL,mBAAmB,GAEpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,8BAA8B,GAG/B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,4BAA4B,GAG7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,oBAAoB,GAErB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,uB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;QACT,KAAK;KACN,CAAC,CAAC;IACH,IAAI,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;QACzC,4IAA4I;QAC5I,yFAAyF;QACzF,IAAI,MAAM,GAAuC;YAC/C,GAAG,MAAM;YACT,KAAK;YACL,SAAS;SACV,CAAC;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QAExB,OAAO,+BAA+B,CAAC;YACrC,GAAG,MAAM;YACT,OAAO,EAAE,cAAc;YACvB,IAAI;YACJ,iBAAiB,EAAE,2BAA2B;SAC/C,CAAC;aACC,MAAM,CAAC,yBAAyB,CAAC;aACjC,MAAM,CAAC,qBAAqB,CAAC;aAC7B,MAAM,CAAC,oBAAoB,CAAC;aAC5B,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,MAAM,GAAG,wBAAwB,CAAC;QACtC,GAAG,MAAM;QACT,SAAS;QACT,KAAK;QACL,OAAO,EAAE,cAAc;QACvB,iBAAiB,EAAE,2BAA2B;KAC/C,CAAC;SACC,MAAM,CAAC,yBAAyB,CAAC;SACjC,MAAM,CAAC,oBAAoB,CAAC;SAC5B,MAAM,CAAC,qBAAqB,CAAC;SAC7B,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAE/B,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n smartAccountClientActions,\n type NotType,\n type SmartAccountClient,\n type SmartAccountClientRpcSchema,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport type { CreateLightAccountClientParams } from \"../../light-account/clients/client.js\";\nimport {\n accountLoupeActions,\n type AccountLoupeActions,\n} from \"../account-loupe/decorator.js\";\nimport {\n createMultiOwnerModularAccount,\n type CreateMultiOwnerModularAccountParams,\n type MultiOwnerModularAccount,\n} from \"../account/multiOwnerAccount.js\";\nimport {\n createMultisigModularAccount,\n type CreateMultisigModularAccountParams,\n type MultisigModularAccount,\n} from \"../account/multisigAccount.js\";\nimport {\n pluginManagerActions,\n type PluginManagerActions,\n} from \"../plugin-manager/decorator.js\";\nimport {\n multiOwnerPluginActions,\n type MultiOwnerPluginActions,\n} from \"../plugins/multi-owner/index.js\";\nimport {\n multisigPluginActions,\n type MultisigPluginActions,\n type MultisigUserOperationContext,\n} from \"../plugins/multisig/index.js\";\nimport { multisigSignatureMiddleware } from \"../plugins/multisig/middleware.js\";\nimport type { AlchemyModularAccountClientConfig } from \"./alchemyClient.js\";\nimport {\n createAlchemySmartAccountClient,\n isAlchemyTransport,\n type AlchemySmartAccountClient,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\nimport type { AlchemyMultisigAccountClientConfig } from \"./multiSigAlchemyClient.js\";\n\nexport type CreateMultiOwnerModularAccountClientWithoutAlchemyParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerModularAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<CreateLightAccountClientParams<TTransport, TChain, TSigner>, \"account\">;\nexport type CreateMultiOwnerModularAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> =\n | CreateMultiOwnerModularAccountClientWithoutAlchemyParams<\n TTransport,\n TChain,\n TSigner\n >\n | AlchemyModularAccountClientConfig<TSigner>;\n\nexport type CreateMultisigModularAccountClientWithoutAlchemyParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultisigModularAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<CreateLightAccountClientParams<TTransport, TChain, TSigner>, \"account\">;\n\nexport type CreateMultisigModularAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> =\n | CreateMultisigModularAccountClientWithoutAlchemyParams<\n TTransport,\n TChain,\n TSigner\n >\n | AlchemyMultisigAccountClientConfig<TSigner>;\n\nexport function createMultiOwnerModularAccountClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyModularAccountClientConfig<TSigner> & {\n transport: AlchemyTransport;\n }\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultiOwnerModularAccount<TSigner>,\n MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> &\n PluginManagerActions<MultiOwnerModularAccount<TSigner>> &\n AccountLoupeActions<MultiOwnerModularAccount<TSigner>>\n >\n>;\n\nexport function createMultiOwnerModularAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultiOwnerModularAccountClientParams<\n TTransport,\n TChain,\n TSigner\n > &\n NotType<TTransport, AlchemyTransport>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultiOwnerModularAccount<TSigner>,\n MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> &\n PluginManagerActions<MultiOwnerModularAccount<TSigner>> &\n AccountLoupeActions<MultiOwnerModularAccount<TSigner>>\n >\n>;\n\n/**\n * Creates a multi-owner modular account client with the provided parameters including account, transport, chain, and additional client configuration. This function uses a modular account and extends it with various plugin actions.\n *\n * @example\n * ```ts\n * import { createMultiOwnerModularAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http } from \"viem\";\n * import { generatePrivateKey } from \"viem/accounts\";\n *\n * const accountClient = await createMultiOwnerModularAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n * @example\n * ```ts\n * import { createMultiOwnerModularAccountClient } 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 alchemyAccountClient = await createMultiOwnerModularAccountClient({\n * transport: alchemy({ apiKey: \"your-api-key\" }),\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateMultiOwnerModularAccountClientParams} config The parameters for creating the multi-owner modular account client\n * @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` instance with extended plugin actions\n */\nexport async function createMultiOwnerModularAccountClient({\n transport,\n chain,\n ...params\n}: CreateMultiOwnerModularAccountClientParams): Promise<\n SmartAccountClient | AlchemySmartAccountClient\n> {\n const modularAccount = await createMultiOwnerModularAccount({\n ...params,\n transport,\n chain,\n });\n if (isAlchemyTransport(transport, chain)) {\n const { opts } = params;\n\n return createAlchemySmartAccountClient({\n ...params,\n account: modularAccount,\n transport,\n chain,\n opts,\n })\n .extend(multiOwnerPluginActions)\n .extend(pluginManagerActions)\n .extend(accountLoupeActions);\n }\n\n return createSmartAccountClient({\n ...params,\n transport,\n chain,\n account: modularAccount,\n })\n .extend(pluginManagerActions)\n .extend(multiOwnerPluginActions)\n .extend(accountLoupeActions);\n}\n\nexport function createMultisigModularAccountClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultisigAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultisigModularAccount<TSigner>,\n MultisigPluginActions<MultisigModularAccount<TSigner>> &\n PluginManagerActions<MultisigModularAccount<TSigner>> &\n AccountLoupeActions<MultisigModularAccount<TSigner>>,\n MultisigUserOperationContext\n >\n>;\n\nexport function createMultisigModularAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultisigModularAccountClientParams<TTransport, TChain, TSigner> &\n NotType<TTransport, AlchemyTransport>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultisigModularAccount<TSigner>,\n MultisigPluginActions<MultisigModularAccount<TSigner>> &\n PluginManagerActions<MultisigModularAccount<TSigner>> &\n AccountLoupeActions<MultisigModularAccount<TSigner>>,\n SmartAccountClientRpcSchema,\n MultisigUserOperationContext\n >\n>;\n\n/**\n * Creates a multisig modular account client using the provided parameters including account details, transport, chain, and additional client configuration. This function constructs the multisig modular account and extends it with various actions to create a comprehensive client.\n *\n * @example\n * ```ts\n * import { createMultisigModularAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http } from \"viem\"\n * import { generatePrivateKey } from \"viem/accounts\";\n *\n * const accountClient = await createMultisigModularAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),\n * owners: [], // other owners on the account\n * threshold: 2, // 2 of N signatures\n * });\n * ```\n * @example\n * ```ts\n * import { createMultisigModularAccountClient } from \"@account-kit/smart-contracts\";\n * import { sepolia } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const alchemyAccountClient = await createMultisigModularAccountClient({\n * transport: alchemy({ apiKey: \"your-api-key\" }),\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),\n * owners: [...], // other owners on the account\n * threshold: 2, // 2 of N signatures\n * });\n * ```\n *\n * @param {CreateMultisigModularAccountClientParams} config the parameters for configuring the multisig modular account client\n * @returns {Promise<SmartAccountClient<Transport, Chain, MultisigModularAccount<SmartAccountSigner>, {}, SmartAccountClientRpcSchema, MultisigUserOperationContext>>} a promise that resolves to a `SmartAccountClient` object extended with the multisig modular account and additional actions\n */\nexport async function createMultisigModularAccountClient({\n transport,\n chain,\n ...params\n}: CreateMultisigModularAccountClientParams): Promise<\n | SmartAccountClient<\n Transport,\n Chain,\n MultisigModularAccount<SmartAccountSigner>,\n {},\n SmartAccountClientRpcSchema,\n MultisigUserOperationContext\n >\n | AlchemySmartAccountClient<\n Chain | undefined,\n MultisigModularAccount<SmartAccountSigner>,\n MultisigPluginActions<MultisigModularAccount<SmartAccountSigner>> &\n PluginManagerActions<MultisigModularAccount<SmartAccountSigner>> &\n AccountLoupeActions<MultisigModularAccount<SmartAccountSigner>>,\n MultisigUserOperationContext\n >\n> {\n const modularAccount = await createMultisigModularAccount({\n ...params,\n transport,\n chain,\n });\n if (isAlchemyTransport(transport, chain)) {\n // Need to fit the type into this since the previous multiSigAlchemyClient had it at this point, but without an Value as Type should be safe\n // And the createAlchemySmartAccountClient signUserOperation could not infer without this\n let config: AlchemyMultisigAccountClientConfig = {\n ...params,\n chain,\n transport,\n };\n const { opts } = config;\n\n return createAlchemySmartAccountClient({\n ...config,\n account: modularAccount,\n opts,\n signUserOperation: multisigSignatureMiddleware,\n })\n .extend(smartAccountClientActions)\n .extend(multisigPluginActions)\n .extend(pluginManagerActions)\n .extend(accountLoupeActions);\n }\n\n const client = createSmartAccountClient({\n ...params,\n transport,\n chain,\n account: modularAccount,\n signUserOperation: multisigSignatureMiddleware,\n })\n .extend(smartAccountClientActions)\n .extend(pluginManagerActions)\n .extend(multisigPluginActions)\n .extend(accountLoupeActions);\n\n return client;\n}\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
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>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {} from "@aa-sdk/core";
|
|
2
|
+
import {} from "@account-kit/infra";
|
|
3
|
+
import { createMultisigModularAccountClient, } from "@account-kit/smart-contracts";
|
|
4
4
|
import {} from "viem";
|
|
5
5
|
/**
|
|
6
6
|
* Creates an Alchemy client for a multisig account using the provided configuration.
|
|
@@ -21,25 +21,11 @@ import {} from "viem";
|
|
|
21
21
|
* });
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
24
|
+
* @deprecated Use createModularAccountClient instead of this function, we are switching based on the transport
|
|
24
25
|
* @param {AlchemyMultisigAccountClientConfig} config The configuration for the Alchemy multisig account client
|
|
25
26
|
* @returns {Promise<AlchemySmartAccountClient<Transport, Chain | undefined, MultisigModularAccount<SmartAccountSigner>, MultisigPluginActions<MultisigModularAccount<SmartAccountSigner>> & PluginManagerActions<MultisigModularAccount<SmartAccountSigner>> & AccountLoupeActions<MultisigModularAccount<SmartAccountSigner>>, MultisigUserOperationContext>>} A promise that resolves to an Alchemy Smart Account Client for multisig accounts with extended functionalities.
|
|
26
27
|
*/
|
|
27
28
|
export async function createMultisigAccountAlchemyClient(config) {
|
|
28
|
-
|
|
29
|
-
const account = await createMultisigModularAccount({
|
|
30
|
-
...config,
|
|
31
|
-
transport,
|
|
32
|
-
chain,
|
|
33
|
-
});
|
|
34
|
-
return createAlchemySmartAccountClient({
|
|
35
|
-
...config,
|
|
36
|
-
account,
|
|
37
|
-
opts,
|
|
38
|
-
signUserOperation: multisigSignatureMiddleware,
|
|
39
|
-
})
|
|
40
|
-
.extend(smartAccountClientActions)
|
|
41
|
-
.extend(multisigPluginActions)
|
|
42
|
-
.extend(pluginManagerActions)
|
|
43
|
-
.extend(accountLoupeActions);
|
|
29
|
+
return createMultisigModularAccountClient(config);
|
|
44
30
|
}
|
|
45
31
|
//# sourceMappingURL=multiSigAlchemyClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiSigAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/msca/client/multiSigAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"multiSigAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/msca/client/multiSigAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,cAAc,CAAC;AACvD,OAAO,EAIN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kCAAkC,GAQnC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAkC,MAAM,MAAM,CAAC;AAkCtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,kCAAkC,CACtD,MAA0C;IAW1C,OAAO,kCAAkC,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import { type SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\nimport {\n createMultisigModularAccountClient,\n type AccountLoupeActions,\n type CreateMultisigModularAccountParams,\n type LightAccount,\n type MultisigModularAccount,\n type MultisigPluginActions,\n type MultisigUserOperationContext,\n type PluginManagerActions,\n} from \"@account-kit/smart-contracts\";\nimport { type Chain, type HttpTransport } from \"viem\";\n\n// todo: this file seems somewhat duplicated with ./modularAccountClient.ts, but that file has some multi-owner specific fields. Is there a way to refactor these two to de-dupe?\n\nexport type AlchemyMultisigAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultisigModularAccountParams<HttpTransport, TSigner>,\n \"transport\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<\n Chain,\n LightAccount<TSigner>,\n MultisigUserOperationContext\n >,\n \"account\"\n > & { transport: AlchemyTransport };\n\nexport function createMultisigAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultisigAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultisigModularAccount<TSigner>,\n MultisigPluginActions<MultisigModularAccount<TSigner>> &\n PluginManagerActions<MultisigModularAccount<TSigner>> &\n AccountLoupeActions<MultisigModularAccount<TSigner>>,\n MultisigUserOperationContext\n >\n>;\n\n/**\n * Creates an Alchemy client for a multisig account using the provided configuration.\n *\n * @example\n * ```ts\n * import { createMultisigAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const alchemyAccountClient = await createMultisigAccountAlchemyClient({\n * transport: alchemy({ apiKey: \"your-api-key\" }),\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),\n * owners: [...], // other owners on the account\n * threshold: 2, // 2 of N signatures\n * });\n * ```\n *\n * @deprecated Use createModularAccountClient instead of this function, we are switching based on the transport\n * @param {AlchemyMultisigAccountClientConfig} config The configuration for the Alchemy multisig account client\n * @returns {Promise<AlchemySmartAccountClient<Transport, Chain | undefined, MultisigModularAccount<SmartAccountSigner>, MultisigPluginActions<MultisigModularAccount<SmartAccountSigner>> & PluginManagerActions<MultisigModularAccount<SmartAccountSigner>> & AccountLoupeActions<MultisigModularAccount<SmartAccountSigner>>, MultisigUserOperationContext>>} A promise that resolves to an Alchemy Smart Account Client for multisig accounts with extended functionalities.\n */\nexport async function createMultisigAccountAlchemyClient(\n config: AlchemyMultisigAccountClientConfig\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultisigModularAccount<SmartAccountSigner>,\n MultisigPluginActions<MultisigModularAccount<SmartAccountSigner>> &\n PluginManagerActions<MultisigModularAccount<SmartAccountSigner>> &\n AccountLoupeActions<MultisigModularAccount<SmartAccountSigner>>,\n MultisigUserOperationContext\n >\n> {\n return createMultisigModularAccountClient(config);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EACL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,MAAM,+BAA+B,CACzC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CAAC,wBAAwB,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,GACrE,IAAI,CACF,+BAA+B,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,EAC7D,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,KAAK,GAAG,SAAS,EACjB,YAAY,CAAC,OAAO,CAAC,EACrB,yBAAyB,CAAC,OAAO,CAAC,CACnC,CACF,CAAC"}
|
|
@@ -1,10 +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 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>>>>;
|
|
10
15
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAClB,MAAM,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/client.ts"],"names":[],"mappings":"AAA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,OAAO,CACR,yBAAyB,CACvB,KAAK,GAAG,SAAS,EACjB,YAAY,CAAC,OAAO,CAAC,EACrB,yBAAyB,CAAC,OAAO,CAAC,CACnC,CACF,CAAC;AACF,wBAAgB,wBAAwB,CACtC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,UAAU,SAAS,SAAS,GAAG,SAAS,EAExC,IAAI,EAAE,8BAA8B,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,GAC/D,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,GACtC,OAAO,CACR,kBAAkB,CAChB,eAAe,EACf,MAAM,EACN,YAAY,CAAC,OAAO,CAAC,EACrB,yBAAyB,CAAC,KAAK,EAAE,oBAAoB,CAAC,GACpD,yBAAyB,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAC5D,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EACL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,kCAAkC,EACvC,KAAK,sBAAsB,EAC3B,KAAK,mCAAmC,EACzC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,MAAM,yCAAyC,CACnD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,kCAAkC,CAAC,aAAa,EAAE,OAAO,CAAC,EAC1D,WAAW,GAAG,MAAM,CACrB,GACC,IAAI,CACF,+BAA+B,CAAC,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC,EACvE,SAAS,CACV,CAAC;AAEJ,wBAAsB,yCAAyC,CAC7D,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EAEvD,MAAM,EAAE,yCAAyC,CAAC,OAAO,CAAC,GACzD,OAAO,CACR,yBAAyB,CACvB,KAAK,GAAG,SAAS,EACjB,sBAAsB,CAAC,OAAO,CAAC,EAC/B,mCAAmC,CAAC,OAAO,CAAC,CAC7C,CACF,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
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>>>>;
|
|
10
16
|
//# sourceMappingURL=multiOwnerLightAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiOwnerLightAccount.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerLightAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,
|
|
1
|
+
{"version":3,"file":"multiOwnerLightAccount.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerLightAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,EAGL,KAAK,kCAAkC,EACvC,KAAK,sBAAsB,EAC3B,KAAK,mCAAmC,EACxC,KAAK,yCAAyC,EAC/C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,wCAAwC,CAClD,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD;IACF,SAAS,EAAE,kCAAkC,CAC3C,UAAU,EACV,OAAO,CACR,CAAC,WAAW,CAAC,CAAC;IACf,KAAK,EAAE,kCAAkC,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;CACzE,GAAG,IAAI,CACN,kCAAkC,CAAC,UAAU,EAAE,OAAO,CAAC,EACvD,WAAW,GAAG,OAAO,CACtB,GACC,IAAI,CACF,wBAAwB,CAAC,UAAU,EAAE,MAAM,CAAC,EAC5C,WAAW,GAAG,SAAS,GAAG,OAAO,CAClC,C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