@account-kit/smart-contracts 4.0.0-alpha.5 → 4.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/index.d.ts +1 -1
- package/dist/cjs/src/index.js +2 -2
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/account.d.ts +5 -6
- package/dist/cjs/src/light-account/accounts/account.js +3 -2
- package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/base.d.ts +7 -6
- package/dist/cjs/src/light-account/accounts/base.js +8 -8
- package/dist/cjs/src/light-account/accounts/base.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/cjs/src/light-account/accounts/multiOwner.js +3 -2
- package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.d.ts +1 -1
- package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/cjs/src/light-account/types.d.ts +23 -31
- package/dist/cjs/src/light-account/types.js.map +1 -1
- package/dist/cjs/src/light-account/utils.d.ts +7 -10
- package/dist/cjs/src/light-account/utils.js +59 -88
- package/dist/cjs/src/light-account/utils.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/cjs/src/msca/utils.js.map +1 -1
- package/dist/esm/src/index.d.ts +1 -1
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/light-account/accounts/account.d.ts +5 -6
- package/dist/esm/src/light-account/accounts/account.js +3 -2
- package/dist/esm/src/light-account/accounts/account.js.map +1 -1
- package/dist/esm/src/light-account/accounts/base.d.ts +7 -6
- package/dist/esm/src/light-account/accounts/base.js +8 -8
- package/dist/esm/src/light-account/accounts/base.js.map +1 -1
- package/dist/esm/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/esm/src/light-account/accounts/multiOwner.js +4 -3
- package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.d.ts +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/types.d.ts +23 -31
- package/dist/esm/src/light-account/types.js.map +1 -1
- package/dist/esm/src/light-account/utils.d.ts +7 -10
- package/dist/esm/src/light-account/utils.js +57 -85
- package/dist/esm/src/light-account/utils.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/esm/src/msca/utils.js.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/account.d.ts +5 -6
- package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/base.d.ts +7 -6
- package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts +1 -1
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/types.d.ts +23 -118
- package/dist/types/src/light-account/types.d.ts.map +1 -1
- package/dist/types/src/light-account/utils.d.ts +19 -48
- package/dist/types/src/light-account/utils.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/middleware.d.ts +6 -6
- package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts +3 -3
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +13 -12
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts +147 -1
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts +71 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
- package/dist/types/src/msca/utils.d.ts +6 -6
- package/package.json +6 -5
- package/src/index.ts +1 -1
- package/src/light-account/accounts/account.ts +24 -45
- package/src/light-account/accounts/base.ts +39 -68
- package/src/light-account/accounts/multiOwner.ts +29 -43
- package/src/light-account/clients/multiOwnerAlchemyClient.ts +1 -1
- package/src/light-account/types.ts +31 -188
- package/src/light-account/utils.ts +91 -245
- package/src/msca/plugins/multisig/middleware.ts +6 -6
- package/src/msca/plugins/multisig/utils/formatSignatures.ts +3 -3
- package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +15 -12
- package/src/msca/plugins/session-key/permissions.ts +147 -1
- package/src/msca/plugins/session-key/signer.ts +71 -1
- package/src/msca/utils.ts +6 -6
- package/dist/cjs/src/light-account/schema.d.ts +0 -21
- package/dist/cjs/src/light-account/schema.js +0 -30
- package/dist/cjs/src/light-account/schema.js.map +0 -1
- package/dist/esm/src/light-account/schema.d.ts +0 -21
- package/dist/esm/src/light-account/schema.js +0 -27
- package/dist/esm/src/light-account/schema.js.map +0 -1
- package/dist/types/src/light-account/schema.d.ts +0 -22
- package/dist/types/src/light-account/schema.d.ts.map +0 -1
- package/src/light-account/schema.ts +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAKd,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAKd,OAAO,KAAK,EACV,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAOrB,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,gBAAgB,EACtB,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,YAAY,CACtB,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,cAAc,CAAC,GAAG,mBAAmB,CAAC,cAAc,CAAC,IACpG,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,oBAAoB,CAAC,GAAG;IACpE,uBAAuB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,GAAG,CAAC;IACpD,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACzC,CAAC;AAGF,MAAM,MAAM,wBAAwB,CAClC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,cAAc,CAAC,GAAG,mBAAmB,CAAC,cAAc,CAAC,IACpG,IAAI,CACN,4BAA4B,CAC1B,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,OAAO,CACR,EACC,oBAAoB,GACpB,YAAY,GACZ,SAAS,GACT,KAAK,GACL,gBAAgB,GAChB,MAAM,CACT,GAAG;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,UAAU,CAAC,EAAE,aAAa,CACxB,6BAA6B,CAAC,cAAc,EAAE,oBAAoB,CAAC,EACnE,KAAK,CACN,CAAC;CACH,CAAC;AAGF,wBAAsB,kBAAkB,CACtC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,cAAc,CAAC,GAAG,QAAQ,EAE3E,MAAM,EAAE,wBAAwB,CAAC,UAAU,EAAE,OAAO,EAAE,oBAAoB,CAAC,GAC1E,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { type Abi, type EntryPointDef, type SmartAccountSigner, type SmartContractAccountWithSigner, type ToSmartContractAccountParams } from "@aa-sdk/core";
|
|
2
2
|
import { type Address, type Chain, type Transport } from "viem";
|
|
3
|
-
import type {
|
|
4
|
-
export type LightAccountBase<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends
|
|
3
|
+
import type { LightAccountEntryPointVersion, LightAccountType, LightAccountVersion } from "../types.js";
|
|
4
|
+
export type LightAccountBase<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>> = SmartContractAccountWithSigner<TLightAccountType, TSigner, LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>> & {
|
|
5
5
|
getLightAccountVersion: () => TLightAccountVersion;
|
|
6
6
|
};
|
|
7
|
-
export type CreateLightAccountBaseParams<
|
|
7
|
+
export type CreateLightAccountBaseParams<TLightAccountType extends LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>, TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> = Pick<ToSmartContractAccountParams<TLightAccountType, TTransport, Chain>, "transport" | "chain" | "getAccountInitCode"> & {
|
|
8
8
|
abi: Abi;
|
|
9
9
|
signer: TSigner;
|
|
10
10
|
accountAddress: Address;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
type: TLightAccountType;
|
|
12
|
+
version: TLightAccountVersion;
|
|
13
|
+
entryPoint: EntryPointDef<LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>, Chain>;
|
|
13
14
|
};
|
|
14
|
-
export declare function createLightAccountBase<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
15
|
+
export declare function createLightAccountBase<TLightAccountType extends LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType>, TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner>({ transport, chain, signer, abi, version, type, entryPoint, accountAddress, getAccountInitCode, }: CreateLightAccountBaseParams<TLightAccountType, TLightAccountVersion, TTransport, TSigner>): Promise<LightAccountBase<TSigner, TLightAccountType, TLightAccountVersion>>;
|
|
15
16
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EAElC,MAAM,cAAc,CAAC;AACtB,OAAO,EAOL,KAAK,OAAO,EACZ,KAAK,KAAK,EAGV,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EAElC,MAAM,cAAc,CAAC;AACtB,OAAO,EAOL,KAAK,OAAO,EACZ,KAAK,KAAK,EAGV,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AASrB,MAAM,MAAM,gBAAgB,CAC1B,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,iBAAiB,SAAS,gBAAgB,GAAG,gBAAgB,EAC7D,oBAAoB,SAAS,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,IAC1G,8BAA8B,CAChC,iBAAiB,EACjB,OAAO,EACP,6BAA6B,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CACvE,GAAG;IACF,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;CACpD,CAAC;AAGF,MAAM,MAAM,4BAA4B,CACtC,iBAAiB,SAAS,gBAAgB,EAC1C,oBAAoB,SAAS,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,EAC5G,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,4BAA4B,CAAC,iBAAiB,EAAE,UAAU,EAAE,KAAK,CAAC,EAClE,WAAW,GAAG,OAAO,GAAG,oBAAoB,CAC7C,GAAG;IACF,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,UAAU,EAAE,aAAa,CACvB,6BAA6B,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,EACtE,KAAK,CACN,CAAC;CACH,CAAC;AAGF,wBAAsB,sBAAsB,CAC1C,iBAAiB,SAAS,gBAAgB,EAC1C,oBAAoB,SAAS,mBAAmB,CAAC,iBAAiB,CAAC,EACnE,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,EACA,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,EACP,IAAI,EACJ,UAAU,EACV,cAAc,EACd,kBAAkB,GACnB,EAAE,4BAA4B,CAC7B,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,OAAO,CACR,GAAG,OAAO,CACT,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,CACnE,CAwKA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { type EntryPointDef, type SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import { type Address, type Chain, type Hex, type Transport } from "viem";
|
|
3
|
-
import type {
|
|
3
|
+
import type { LightAccountEntryPointVersion, LightAccountVersion } from "../types.js";
|
|
4
4
|
import { type CreateLightAccountBaseParams, type LightAccountBase } from "./base.js";
|
|
5
|
-
export type MultiOwnerLightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends
|
|
5
|
+
export type MultiOwnerLightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">> = LightAccountBase<TSigner, "MultiOwnerLightAccount", TLightAccountVersion> & {
|
|
6
6
|
encodeUpdateOwners: (ownersToAdd: Address[], ownersToRemove: Address[]) => Hex;
|
|
7
7
|
getOwnerAddresses: () => Promise<readonly Address[]>;
|
|
8
8
|
};
|
|
9
|
-
export type CreateMultiOwnerLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends
|
|
9
|
+
export type CreateMultiOwnerLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">> = Omit<CreateLightAccountBaseParams<"MultiOwnerLightAccount", TLightAccountVersion, TTransport, TSigner>, "getAccountInitCode" | "entryPoint" | "version" | "abi" | "accountAddress" | "type"> & {
|
|
10
10
|
salt?: bigint;
|
|
11
11
|
initCode?: Hex;
|
|
12
12
|
accountAddress?: Address;
|
|
13
13
|
factoryAddress?: Address;
|
|
14
14
|
version?: TLightAccountVersion;
|
|
15
|
-
entryPoint?: EntryPointDef<
|
|
15
|
+
entryPoint?: EntryPointDef<LightAccountEntryPointVersion<"MultiOwnerLightAccount", TLightAccountVersion>, Chain>;
|
|
16
16
|
owners?: Address[];
|
|
17
17
|
};
|
|
18
|
-
export declare function createMultiOwnerLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends
|
|
18
|
+
export declare function createMultiOwnerLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">>(config: CreateMultiOwnerLightAccountParams<TTransport, TSigner, TLightAccountVersion>): Promise<MultiOwnerLightAccount<TSigner, TLightAccountVersion>>;
|
|
19
19
|
//# sourceMappingURL=multiOwner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiOwner.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/multiOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"multiOwner.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/accounts/multiOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,gBAAgB,EACtB,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,sBAAsB,CAChC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,wBAAwB,CAAC,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,IACxH,gBAAgB,CAClB,OAAO,EACP,wBAAwB,EACxB,oBAAoB,CACrB,GAAG;IACF,kBAAkB,EAAE,CAClB,WAAW,EAAE,OAAO,EAAE,EACtB,cAAc,EAAE,OAAO,EAAE,KACtB,GAAG,CAAC;IACT,iBAAiB,EAAE,MAAM,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,kCAAkC,CAC5C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,wBAAwB,CAAC,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,IACxH,IAAI,CACN,4BAA4B,CAC1B,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,OAAO,CACR,EACC,oBAAoB,GACpB,YAAY,GACZ,SAAS,GACT,KAAK,GACL,gBAAgB,GAChB,MAAM,CACT,GAAG;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,UAAU,CAAC,EAAE,aAAa,CACxB,6BAA6B,CAC3B,wBAAwB,EACxB,oBAAoB,CACrB,EACD,KAAK,CACN,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;CACpB,CAAC;AAEF,wBAAsB,4BAA4B,CAChD,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,oBAAoB,SAAS,mBAAmB,CAAC,wBAAwB,CAAC,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,EAE1H,MAAM,EAAE,kCAAkC,CACxC,UAAU,EACV,OAAO,EACP,oBAAoB,CACrB,GACA,OAAO,CAAC,sBAAsB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC"}
|
|
@@ -2,6 +2,6 @@ import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
|
|
|
2
2
|
import { type AlchemySmartAccountClient, type AlchemySmartAccountClientConfig } from "@account-kit/infra";
|
|
3
3
|
import { type CreateMultiOwnerLightAccountParams, type MultiOwnerLightAccount, type MultiOwnerLightAccountClientActions } from "@account-kit/smart-contracts";
|
|
4
4
|
import { type Chain, type CustomTransport, type Transport } from "viem";
|
|
5
|
-
export type AlchemyMultiOwnerLightAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>, "transport" | "chain"> & Omit<AlchemySmartAccountClientConfig<Transport, Chain, MultiOwnerLightAccount<TSigner>>, "account">;
|
|
5
|
+
export type AlchemyMultiOwnerLightAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>, "transport" | "chain" | "type"> & Omit<AlchemySmartAccountClientConfig<Transport, Chain, MultiOwnerLightAccount<TSigner>>, "account">;
|
|
6
6
|
export declare function createMultiOwnerLightAccountAlchemyClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyMultiOwnerLightAccountClientConfig<TSigner>): Promise<AlchemySmartAccountClient<CustomTransport, Chain | undefined, MultiOwnerLightAccount<TSigner>, MultiOwnerLightAccountClientActions<TSigner>>>;
|
|
7
7
|
//# sourceMappingURL=multiOwnerAlchemyClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiOwnerAlchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,kCAAkC,EACvC,KAAK,sBAAsB,EAC3B,KAAK,mCAAmC,EACzC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAU,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AAEhF,MAAM,MAAM,yCAAyC,CACnD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,kCAAkC,CAAC,aAAa,EAAE,OAAO,CAAC,EAC1D,WAAW,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"multiOwnerAlchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,kCAAkC,EACvC,KAAK,sBAAsB,EAC3B,KAAK,mCAAmC,EACzC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAU,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AAEhF,MAAM,MAAM,yCAAyC,CACnD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,kCAAkC,CAAC,aAAa,EAAE,OAAO,CAAC,EAC1D,WAAW,GAAG,OAAO,GAAG,MAAM,CAC/B,GACC,IAAI,CACF,+BAA+B,CAC7B,SAAS,EACT,KAAK,EACL,sBAAsB,CAAC,OAAO,CAAC,CAChC,EACD,SAAS,CACV,CAAC;AAEJ,wBAAsB,yCAAyC,CAC7D,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EAEvD,MAAM,EAAE,yCAAyC,CAAC,OAAO,CAAC,GACzD,OAAO,CACR,yBAAyB,CACvB,eAAe,EACf,KAAK,GAAG,SAAS,EACjB,sBAAsB,CAAC,OAAO,CAAC,EAC/B,mCAAmC,CAAC,OAAO,CAAC,CAC7C,CACF,CAAC"}
|
|
@@ -1,131 +1,36 @@
|
|
|
1
|
-
import { type EntryPointVersion
|
|
1
|
+
import { type EntryPointVersion } from "@aa-sdk/core";
|
|
2
2
|
import { type Address, type Chain } from "viem";
|
|
3
3
|
import type { LightAccountBase } from "./accounts/base";
|
|
4
4
|
/**
|
|
5
5
|
* Light account types supported: LightAccount, MultiOwnerLightAccount
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export type LightAccountType =
|
|
9
|
-
|
|
10
|
-
* Account version definition, which is the base type defining the LightAccountVersionDef interface
|
|
11
|
-
*
|
|
12
|
-
* @template {LightAccountType} TLightAccountType type
|
|
13
|
-
* @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion version
|
|
14
|
-
* @template {EntryPointVersion} TEntryPointVersion entryPointVersion
|
|
15
|
-
*/
|
|
16
|
-
export type AccountVersionDef<TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = {
|
|
17
|
-
type: TLightAccountType;
|
|
18
|
-
version: TLightAccountVersion;
|
|
8
|
+
export type LightAccountType = "LightAccount" | "MultiOwnerLightAccount";
|
|
9
|
+
export type LightAccountVersionConfig<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = {
|
|
19
10
|
entryPointVersion: TEntryPointVersion;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
addresses: {
|
|
12
|
+
default: {
|
|
13
|
+
factory: Address;
|
|
14
|
+
impl: Address;
|
|
15
|
+
};
|
|
16
|
+
overrides?: Record<Chain["id"], {
|
|
17
|
+
factory: Address;
|
|
18
|
+
impl: Address;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
24
21
|
};
|
|
25
|
-
|
|
26
|
-
* Light account version type defs for tightly coupled types for smart accounts
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
export type LightAccountVersion = keyof IAccountVersionRegistry["LightAccount"] | keyof IAccountVersionRegistry["MultiOwnerLightAccount"];
|
|
30
|
-
/**
|
|
31
|
-
* Get the light account versions available for the given light account type
|
|
32
|
-
*
|
|
33
|
-
* @template {LightAccountType} TLightAccountType
|
|
34
|
-
*/
|
|
35
|
-
export type GetLightAccountVersion<TLightAccountType extends LightAccountType = LightAccountType> = keyof IAccountVersionRegistry[TLightAccountType];
|
|
36
|
-
/**
|
|
37
|
-
* Light account version definition type based on the light account type and version
|
|
38
|
-
*
|
|
39
|
-
* @template {LightAccountType} TLightAccountType
|
|
40
|
-
* @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion
|
|
41
|
-
*/
|
|
42
|
-
export type LightAccountVersionDef<TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>> = IAccountVersionRegistry[TLightAccountType][TLightAccountVersion];
|
|
43
|
-
/**
|
|
44
|
-
* Light account version registry interface defining the supported light account versions
|
|
45
|
-
*
|
|
46
|
-
*/
|
|
47
|
-
export interface IAccountVersionRegistry {
|
|
22
|
+
export type LightAccountVersionConfigs = {
|
|
48
23
|
LightAccount: {
|
|
49
|
-
|
|
50
|
-
"v1.0.
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"v1.1.0": AccountVersionDef<"LightAccount", "v1.1.0", "0.6.0">;
|
|
54
|
-
/**
|
|
55
|
-
* LightAccount v2 Changelog.
|
|
56
|
-
* It is recommended to use v2.0.0
|
|
57
|
-
* https://alchemotion.notion.site/External-Light-Account-v2-Changelog-725b306ab1e04eb0a3e596521dd8f0bd
|
|
58
|
-
*/
|
|
59
|
-
"v2.0.0": AccountVersionDef<"LightAccount", "v2.0.0", "0.7.0">;
|
|
24
|
+
"v1.0.1": LightAccountVersionConfig<"0.6.0">;
|
|
25
|
+
"v1.0.2": LightAccountVersionConfig<"0.6.0">;
|
|
26
|
+
"v1.1.0": LightAccountVersionConfig<"0.6.0">;
|
|
27
|
+
"v2.0.0": LightAccountVersionConfig<"0.7.0">;
|
|
60
28
|
};
|
|
61
29
|
MultiOwnerLightAccount: {
|
|
62
|
-
|
|
63
|
-
* MultiOwnerLightAccount v2 Changelog
|
|
64
|
-
* It is recommended to use v2.0.0
|
|
65
|
-
* https://alchemotion.notion.site/External-Light-Account-v2-Changelog-725b306ab1e04eb0a3e596521dd8f0bd
|
|
66
|
-
*/
|
|
67
|
-
"v2.0.0": AccountVersionDef<"MultiOwnerLightAccount", "v2.0.0", "0.7.0">;
|
|
30
|
+
"v2.0.0": LightAccountVersionConfig<"0.7.0">;
|
|
68
31
|
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* @template {LightAccountType} TLightAccountType
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* type T1 = GetLightAccountVersionsForType<"LightAccount">;
|
|
77
|
-
* const t1: T1 = AccountVersionRegistry.LightAccount["v1.0.2"];
|
|
78
|
-
*/
|
|
79
|
-
export type GetLightAccountVersionDefsForType<TType extends LightAccountType> = Extract<IAccountVersionRegistry[TType][keyof IAccountVersionRegistry[TType]], {
|
|
80
|
-
type: TType;
|
|
81
|
-
}>;
|
|
82
|
-
/**
|
|
83
|
-
* Get the light account version definition for the given light account type and version
|
|
84
|
-
*
|
|
85
|
-
* @template {LightAccountType} TType
|
|
86
|
-
* @template {GetLightAccountVersion<TType>} TLightAccountVersion
|
|
87
|
-
*/
|
|
88
|
-
export type GetLightAccountVersionDef<TType extends LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TType>> = IAccountVersionRegistry[TType][TLightAccountVersion];
|
|
89
|
-
/**
|
|
90
|
-
* @example
|
|
91
|
-
* type T = GetLightAccountVersionDefsForEntryPoint<"LightAccount", "0.6.0">;
|
|
92
|
-
* const t_1: T = AccountVersionRegistry.LightAccount["v1.0.2"]; // compiles
|
|
93
|
-
* const t_2: T = AccountVersionRegistry.LightAccount["v2.0.0"]; // errors
|
|
94
|
-
*/
|
|
95
|
-
export type GetLightAccountVersionDefsForEntryPoint<TType extends LightAccountType, TEntryPointVersion extends EntryPointVersion> = Extract<GetLightAccountVersionDefsForType<TType>, {
|
|
96
|
-
entryPointVersion: TEntryPointVersion;
|
|
97
|
-
}>;
|
|
98
|
-
/**
|
|
99
|
-
* Get the light account type for the given light account by inferring from its type definition
|
|
100
|
-
*
|
|
101
|
-
* @template {SmartContractAccount | undefined} TAccount
|
|
102
|
-
* @template {SmartContractAccount} TAccountOverride
|
|
103
|
-
*/
|
|
104
|
-
export type GetLightAccountType<TAccount extends SmartContractAccount | undefined, TAccountOverride extends SmartContractAccount = SmartContractAccount> = GetAccountParameter<TAccount, TAccountOverride> extends LightAccountBase<SmartAccountSigner, infer TLightAccountType> ? OneOf<TLightAccountType, LightAccountType> : LightAccountType;
|
|
105
|
-
/**
|
|
106
|
-
* Get the light account version for the given light account by inferring from its type definition
|
|
107
|
-
*
|
|
108
|
-
* @template {LightAccountBase | undefined} TAccount
|
|
109
|
-
* @template {LightAccountBase} TAccountOverride
|
|
110
|
-
*/
|
|
111
|
-
export type GetLightAccountVersionFromAccount<TAccount extends LightAccountBase | undefined, TAccountOverride extends LightAccountBase = LightAccountBase> = GetAccountParameter<TAccount, TAccountOverride> extends LightAccountBase<SmartAccountSigner, LightAccountType, infer TLightAccountVersion> ? OneOf<TLightAccountVersion, LightAccountVersion> : LightAccountVersion;
|
|
112
|
-
/**
|
|
113
|
-
* Get the entry point version supported for the given light account type and version
|
|
114
|
-
*
|
|
115
|
-
* @template {LightAccountType} TLightAccountType
|
|
116
|
-
* @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion
|
|
117
|
-
*/
|
|
118
|
-
export type GetEntryPointForLightAccountVersion<TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>> = GetLightAccountVersionDef<TLightAccountType, TLightAccountVersion> extends AccountVersionDef<TLightAccountType, TLightAccountVersion, infer TEntryPointVersion> ? TEntryPointVersion : EntryPointVersion;
|
|
119
|
-
/**
|
|
120
|
-
* Get the light account type for the given light account version by inferring from its type definition
|
|
121
|
-
*
|
|
122
|
-
* @template {LightAccountVersion} TLightAccountVersion
|
|
123
|
-
*/
|
|
124
|
-
export type GetLightAccountTypesForVersion<TLightAccountVersion extends LightAccountVersion = LightAccountVersion> = TLightAccountVersion extends GetLightAccountVersion<infer TLightAccountType> ? TLightAccountType : LightAccountType;
|
|
125
|
-
/**
|
|
126
|
-
* Get default light account version for the given light account type
|
|
127
|
-
*
|
|
128
|
-
* @template {LightAccountType} TLightAccountType
|
|
129
|
-
*/
|
|
130
|
-
export type GetDefaultLightAccountVersion<TLightAccountType extends LightAccountType = LightAccountType> = TLightAccountType extends "MultiOwnerLightAccount" ? "v2.0.0" & LightAccountVersion : "v1.1.0" & LightAccountVersion;
|
|
32
|
+
};
|
|
33
|
+
export type LightAccountVersion<TAccountType extends LightAccountType> = keyof LightAccountVersionConfigs[TAccountType];
|
|
34
|
+
export type GetLightAccountType<TAccount extends LightAccountBase> = TAccount["source"] extends LightAccountType ? TAccount["source"] : never;
|
|
35
|
+
export type LightAccountEntryPointVersion<TLightAccountType extends LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>> = LightAccountVersionConfigs[TLightAccountType][TLightAccountVersion] extends LightAccountVersionConfig ? LightAccountVersionConfigs[TLightAccountType][TLightAccountVersion]["entryPointVersion"] : never;
|
|
131
36
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/light-account/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/light-account/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,wBAAwB,CAAC;AAEzE,MAAM,MAAM,yBAAyB,CACnC,kBAAkB,SAAS,iBAAiB,GAAG,iBAAiB,IAC9D;IACF,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,SAAS,EAAE;QACT,OAAO,EAAE;YACP,OAAO,EAAE,OAAO,CAAC;YACjB,IAAI,EAAE,OAAO,CAAC;SACf,CAAC;QACF,SAAS,CAAC,EAAE,MAAM,CAChB,KAAK,CAAC,IAAI,CAAC,EACX;YACE,OAAO,EAAE,OAAO,CAAC;YACjB,IAAI,EAAE,OAAO,CAAC;SACf,CACF,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,YAAY,EAAE;QACZ,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;KAC9C,CAAC;IACF,sBAAsB,EAAE;QACtB,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;KAC9C,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,YAAY,SAAS,gBAAgB,IACnE,MAAM,0BAA0B,CAAC,YAAY,CAAC,CAAC;AAEjD,MAAM,MAAM,mBAAmB,CAAC,QAAQ,SAAS,gBAAgB,IAC/D,QAAQ,CAAC,QAAQ,CAAC,SAAS,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;AAE3E,MAAM,MAAM,6BAA6B,CACvC,iBAAiB,SAAS,gBAAgB,EAC1C,oBAAoB,SAAS,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,IAC1G,0BAA0B,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,SAAS,yBAAyB,GACrG,0BAA0B,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,CAAC,mBAAmB,CAAC,GACxF,KAAK,CAAC"}
|
|
@@ -1,50 +1,43 @@
|
|
|
1
1
|
import { type Address, type Chain } from "viem";
|
|
2
2
|
import type { LightAccountBase } from "./accounts/base";
|
|
3
|
-
import type {
|
|
4
|
-
/**
|
|
5
|
-
* Light account deployed chains
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare const supportedChains: Chain[];
|
|
3
|
+
import type { LightAccountType, LightAccountVersion, LightAccountVersionConfig, LightAccountVersionConfigs } from "./types";
|
|
9
4
|
/**
|
|
10
5
|
* Account version registry interface that defines the light account versions
|
|
11
6
|
* and the version definition for each light account type
|
|
12
7
|
*
|
|
13
8
|
*/
|
|
14
|
-
export declare const AccountVersionRegistry:
|
|
9
|
+
export declare const AccountVersionRegistry: LightAccountVersionConfigs;
|
|
15
10
|
/**
|
|
16
11
|
* Get the default light account version for the given light account type
|
|
17
12
|
*
|
|
18
13
|
* @template {LightAccountType} TLightAccountType
|
|
19
|
-
* @
|
|
20
|
-
* @returns the default version for the given light account type
|
|
14
|
+
* @returns {LightAccountVersion<TLightAccountType>} the default version for the given light account type
|
|
21
15
|
*/
|
|
22
|
-
export declare const defaultLightAccountVersion: <TLightAccountType extends
|
|
16
|
+
export declare const defaultLightAccountVersion: <TLightAccountType extends LightAccountType>() => keyof LightAccountVersionConfigs[TLightAccountType];
|
|
23
17
|
/**
|
|
24
|
-
* Utility method returning the default light account factory address given a
|
|
18
|
+
* Utility method returning the default light account factory address given a Chain object
|
|
25
19
|
*
|
|
26
|
-
* @param chain - a
|
|
27
|
-
* @param version - the version of the light account to get the factory address for
|
|
28
|
-
* @returns
|
|
20
|
+
* @param {Chain} chain - a Chain object
|
|
21
|
+
* @param {LightAccountVersion} version - the version of the light account to get the factory address for
|
|
22
|
+
* @returns {Address} an for the given chain
|
|
29
23
|
* @throws if the chain doesn't have an address currently deployed
|
|
30
24
|
*/
|
|
31
|
-
export declare const getDefaultLightAccountFactoryAddress: (chain: Chain, version:
|
|
25
|
+
export declare const getDefaultLightAccountFactoryAddress: (chain: Chain, version: LightAccountVersion<"LightAccount">) => Address;
|
|
32
26
|
/**
|
|
33
|
-
* Utility method returning the default multi owner light account factory address given a
|
|
27
|
+
* Utility method returning the default multi owner light account factory address given a Chain object
|
|
34
28
|
*
|
|
35
|
-
* @param chain - a
|
|
36
|
-
* @param version - the version of the light account to get the factory address for
|
|
37
|
-
* @returns
|
|
38
|
-
* @throws if the chain doesn't have an address currently deployed
|
|
29
|
+
* @param {Chain} chain - a Chain object
|
|
30
|
+
* @param {string} version - the version of the light account to get the factory address for
|
|
31
|
+
* @returns {Address} an Address for the given chain
|
|
39
32
|
*/
|
|
40
|
-
export declare const getDefaultMultiOwnerLightAccountFactoryAddress: (chain: Chain, version:
|
|
33
|
+
export declare const getDefaultMultiOwnerLightAccountFactoryAddress: (chain: Chain, version: LightAccountVersion<"MultiOwnerLightAccount">) => `0x${string}`;
|
|
41
34
|
/**
|
|
42
35
|
* Can be used to check if the account with one of the following implementation addresses
|
|
43
36
|
* to not support 1271 signing.
|
|
44
37
|
*
|
|
45
38
|
* Light accounts with versions v1.0.1 and v1.0.2 do not support 1271 signing.
|
|
46
39
|
*/
|
|
47
|
-
export declare const LightAccountUnsupported1271Impls:
|
|
40
|
+
export declare const LightAccountUnsupported1271Impls: LightAccountVersionConfig<"0.6.0">[];
|
|
48
41
|
/**
|
|
49
42
|
* Can be used to check if the account with one of the following factory addresses
|
|
50
43
|
* to not support 1271 signing.
|
|
@@ -56,31 +49,9 @@ export declare const LightAccountUnsupported1271Factories: Set<`0x${string}`>;
|
|
|
56
49
|
* Get the light account version definition for the given light account and chain
|
|
57
50
|
*
|
|
58
51
|
* @template {LightAccountBase} TAccount
|
|
59
|
-
* @
|
|
60
|
-
* @
|
|
61
|
-
* @
|
|
62
|
-
* @param chain - the chain to get the version for
|
|
63
|
-
* @returns the light account version definition for the given light account and chain
|
|
64
|
-
*/
|
|
65
|
-
export declare function getLightAccountVersionDef<TAccount extends LightAccountBase, TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>>(account: TAccount, chain: Chain): Promise<LightAccountVersionDef<TLightAccountType, TLightAccountVersion>>;
|
|
66
|
-
/**
|
|
67
|
-
* Get the light account version definition for the given light account and chain
|
|
68
|
-
*
|
|
69
|
-
* @template {LightAccountBase} TAccount
|
|
70
|
-
* @template {GetLightAccountType<TAccount>} TLightAccountType
|
|
71
|
-
* @param account - the light account to get the version for
|
|
72
|
-
* @param chain - the chain to get the version for
|
|
73
|
-
* @returns the light account version definition for the given light account and chain
|
|
74
|
-
*/
|
|
75
|
-
export declare function getLightAccountVersionDef<TAccount extends LightAccountBase, TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>>(account: TAccount, chain: Chain): Promise<AccountVersionDef<TLightAccountType, GetLightAccountVersion<TLightAccountType>>>;
|
|
76
|
-
/**
|
|
77
|
-
* @param account - the light account to get the version for
|
|
78
|
-
* @param chain - the chain to get the version for
|
|
79
|
-
*
|
|
80
|
-
* @deprecated don't use this function as this function is replaced with getLightAccountVersionDef.
|
|
81
|
-
* Migrate to using getLightAccountVersionDef instead
|
|
82
|
-
*
|
|
83
|
-
* @returns the light account version for the given light account and chain
|
|
52
|
+
* @param {LightAccountBase} account the light account to get the version for
|
|
53
|
+
* @param {Chain} chain - the chain to get the version for
|
|
54
|
+
* @returns {Promise<LightAccountVersionConfig>} the light account version definition for the given light account and chain
|
|
84
55
|
*/
|
|
85
|
-
export declare function
|
|
56
|
+
export declare function getLightAccountVersionForAccount<TAccount extends LightAccountBase>(account: TAccount, chain: Chain): Promise<LightAccountVersionConfig>;
|
|
86
57
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/light-account/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/light-account/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,0BAuDpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,uGAEgB,CAAC;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC,UACxC,KAAK,WACH,oBAAoB,cAAc,CAAC,KAC3C,OAMF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8CAA8C,UAClD,KAAK,WACH,oBAAoB,wBAAwB,CAAC,kBAQvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,sCAG5C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,oBAKhD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,gCAAgC,CACpD,QAAQ,SAAS,gBAAgB,EACjC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAoDrE"}
|
|
@@ -5,12 +5,12 @@ import { type MultisigUserOperationContext } from "./types.js";
|
|
|
5
5
|
* This middleware handles correctly aggregating signatures passed through
|
|
6
6
|
* as context when sending UserOperations, proposing UserOperations, or adding signatures to a UserOperation.
|
|
7
7
|
*
|
|
8
|
-
* @param struct the user operation struct to be signed
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @returns a Promise containing a UserOperation with an aggregated signature in the `signature` field
|
|
8
|
+
* @param {Deferrable<UserOperationStruct<TEntryPointVersion>>} struct the user operation struct to be signed
|
|
9
|
+
* @param {ClientMiddlewareArgs<TAccount, C, TContext, TEntryPointVersion>} args the parameters to be passed to the middleware
|
|
10
|
+
* @param {UserOperationOverrides<TEntryPointVersion>} args.account the account to be used for signing
|
|
11
|
+
* @param {MiddlewareClient} args.client the smart account client that will be used for RPC requests
|
|
12
|
+
* @param {MultisigUserOperationContext} args.context the context object containing the signatures to be aggregated MultisigUserOperationContext
|
|
13
|
+
* @returns {Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>} a Promise containing a UserOperation with an aggregated signature in the `signature` field
|
|
14
14
|
*/
|
|
15
15
|
export declare const multisigSignatureMiddleware: ClientMiddlewareFn<MultisigUserOperationContext>;
|
|
16
16
|
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -5,9 +5,9 @@ import type { Signature } from "../types";
|
|
|
5
5
|
* by signer address. The EOA SIGS contain the 65 signautre data for EOA signers and 65 bytes containing SIGNER | OFFSET | V for contract signers.
|
|
6
6
|
* The OFFSET is used to fetch the signature data from the CONTRACT_SIG_DATAS.
|
|
7
7
|
*
|
|
8
|
-
* @param signatures the array of
|
|
9
|
-
* @param usingMaxValues a boolean indicating wether or not the UserOperation is using the UPPER_LIMIT for the gas and fee values
|
|
10
|
-
* @returns the Hex representation of the signature
|
|
8
|
+
* @param {Signature[]} signatures the array of Signature objects to combine into the correct aggregated signature format excluding the upper limits
|
|
9
|
+
* @param {boolean} usingMaxValues a boolean indicating wether or not the UserOperation is using the UPPER_LIMIT for the gas and fee values
|
|
10
|
+
* @returns {Hex} the Hex representation of the signature
|
|
11
11
|
*/
|
|
12
12
|
export declare const formatSignatures: (signatures: Signature[], usingMaxValues?: boolean) => `0x${string}`;
|
|
13
13
|
//# sourceMappingURL=formatSignatures.d.ts.map
|
|
@@ -7,20 +7,21 @@ export type SplitAggregateSignatureParams<TAccount extends SmartContractAccount
|
|
|
7
7
|
account: SmartContractAccount;
|
|
8
8
|
request: UserOperationRequest<TEntryPointVersion>;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
* Takes an aggregated signature and threshold and splits it into its components
|
|
12
|
-
*
|
|
13
|
-
* @param args - the arguments for the split
|
|
14
|
-
* @param args.aggregateSignature - the aggregated signature to split
|
|
15
|
-
* @param args.threshold - the threshold for the signature
|
|
16
|
-
* @param args.account - the account which the signature is valid for
|
|
17
|
-
* @param args.request - the user operation request that the signature is for
|
|
18
|
-
* @returns the signature split into its upper limits and current signatures
|
|
19
|
-
*/
|
|
20
|
-
export declare const splitAggregatedSignature: <TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined>(args: SplitAggregateSignatureParams<TAccount, GetEntryPointFromAccount<TAccount, SmartContractAccount<string, keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>>) => Promise<{
|
|
10
|
+
export type SplitAggregateSignatureResult = {
|
|
21
11
|
upperLimitPvg: Hex;
|
|
22
12
|
upperLimitMaxFeePerGas: Hex;
|
|
23
13
|
upperLimitMaxPriorityFeePerGas: Hex;
|
|
24
14
|
signatures: Signature[];
|
|
25
|
-
}
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Takes an aggregated signature and threshold and splits it into its components
|
|
18
|
+
*
|
|
19
|
+
* @param {SplitAggregateSignatureParams<TAccount>} args - the arguments for the split
|
|
20
|
+
* @param {Hex} args.aggregateSignature - the aggregated signature to split
|
|
21
|
+
* @param {number} args.threshold - the threshold for the signature
|
|
22
|
+
* @param {SmartContractAccount} args.account - the account which the signature is valid for
|
|
23
|
+
* @param {UserOperationRequest<TEntryPointVersion>} args.request - the user operation request that the signature is for
|
|
24
|
+
* @returns {Promise<SplitAggregateSignatureResult>} the signature split into its upper limits and current signatures
|
|
25
|
+
*/
|
|
26
|
+
export declare const splitAggregatedSignature: <TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined>(args: SplitAggregateSignatureParams<TAccount, GetEntryPointFromAccount<TAccount, SmartContractAccount<string, keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>>) => Promise<SplitAggregateSignatureResult>;
|
|
26
27
|
//# sourceMappingURL=splitAggregatedSignature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitAggregatedSignature.d.ts","sourceRoot":"","sources":["../../../../../../../src/msca/plugins/multisig/utils/splitAggregatedSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAwC,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,6BAA6B,CACvC,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,IAChG;IACF,mBAAmB,EAAE,GAAG,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;CACnD,CAAC;
|
|
1
|
+
{"version":3,"file":"splitAggregatedSignature.d.ts","sourceRoot":"","sources":["../../../../../../../src/msca/plugins/multisig/utils/splitAggregatedSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAwC,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,6BAA6B,CACvC,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,IAChG;IACF,mBAAmB,EAAE,GAAG,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,aAAa,EAAE,GAAG,CAAC;IACnB,sBAAsB,EAAE,GAAG,CAAC;IAC5B,8BAA8B,EAAE,GAAG,CAAC;IACpC,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,2QAMlC,QAAQ,6BAA6B,CA2FvC,CAAC"}
|