@account-kit/smart-contracts 4.0.0-alpha.1 → 4.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/plugindefs/multi-owner/config.js +16 -17
- package/dist/cjs/plugindefs/multi-owner/config.js.map +1 -1
- package/dist/cjs/plugindefs/multisig/config.js +15 -15
- package/dist/cjs/plugindefs/multisig/config.js.map +1 -1
- package/dist/cjs/plugindefs/session-key/config.js +17 -17
- package/dist/cjs/plugindefs/session-key/config.js.map +1 -1
- package/dist/cjs/src/index.d.ts +1 -1
- package/dist/cjs/src/index.js +2 -2
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/account.d.ts +5 -6
- package/dist/cjs/src/light-account/accounts/account.js +3 -2
- package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/base.d.ts +7 -6
- package/dist/cjs/src/light-account/accounts/base.js +8 -8
- package/dist/cjs/src/light-account/accounts/base.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/cjs/src/light-account/accounts/multiOwner.js +3 -2
- package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/cjs/src/light-account/clients/alchemyClient.d.ts +1 -1
- package/dist/cjs/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
- package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/cjs/src/light-account/decorators/lightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/types.d.ts +23 -31
- package/dist/cjs/src/light-account/types.js.map +1 -1
- package/dist/cjs/src/light-account/utils.d.ts +7 -10
- package/dist/cjs/src/light-account/utils.js +59 -87
- package/dist/cjs/src/light-account/utils.js.map +1 -1
- package/dist/cjs/src/msca/client/alchemyClient.d.ts +1 -1
- package/dist/cjs/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.js +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/cjs/src/msca/utils.js +11 -10
- package/dist/cjs/src/msca/utils.js.map +1 -1
- package/dist/esm/plugindefs/multi-owner/config.js +1 -2
- package/dist/esm/plugindefs/multi-owner/config.js.map +1 -1
- package/dist/esm/plugindefs/multisig/config.js +1 -1
- package/dist/esm/plugindefs/multisig/config.js.map +1 -1
- package/dist/esm/plugindefs/session-key/config.js +1 -1
- package/dist/esm/plugindefs/session-key/config.js.map +1 -1
- package/dist/esm/src/index.d.ts +1 -1
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/light-account/accounts/account.d.ts +5 -6
- package/dist/esm/src/light-account/accounts/account.js +3 -2
- package/dist/esm/src/light-account/accounts/account.js.map +1 -1
- package/dist/esm/src/light-account/accounts/base.d.ts +7 -6
- package/dist/esm/src/light-account/accounts/base.js +8 -8
- package/dist/esm/src/light-account/accounts/base.js.map +1 -1
- package/dist/esm/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/esm/src/light-account/accounts/multiOwner.js +4 -3
- package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/esm/src/light-account/clients/alchemyClient.d.ts +1 -1
- package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
- package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
- package/dist/esm/src/light-account/types.d.ts +23 -31
- package/dist/esm/src/light-account/types.js.map +1 -1
- package/dist/esm/src/light-account/utils.d.ts +7 -10
- package/dist/esm/src/light-account/utils.js +57 -84
- package/dist/esm/src/light-account/utils.js.map +1 -1
- package/dist/esm/src/msca/client/alchemyClient.d.ts +1 -1
- package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/esm/src/msca/utils.js +2 -1
- package/dist/esm/src/msca/utils.js.map +1 -1
- package/dist/types/plugindefs/multi-owner/config.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/account.d.ts +5 -6
- package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/base.d.ts +7 -6
- package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/alchemyClient.d.ts +1 -1
- package/dist/types/src/light-account/clients/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/decorators/lightAccount.d.ts +1 -1
- package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts +1 -1
- package/dist/types/src/light-account/types.d.ts +23 -118
- package/dist/types/src/light-account/types.d.ts.map +1 -1
- package/dist/types/src/light-account/utils.d.ts +19 -48
- package/dist/types/src/light-account/utils.d.ts.map +1 -1
- package/dist/types/src/msca/client/alchemyClient.d.ts +1 -1
- package/dist/types/src/msca/client/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/middleware.d.ts +6 -6
- package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts +3 -3
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +13 -12
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts +147 -1
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts +71 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
- package/dist/types/src/msca/utils.d.ts +6 -6
- package/dist/types/src/msca/utils.d.ts.map +1 -1
- package/package.json +7 -6
- package/plugindefs/multi-owner/config.ts +1 -2
- package/plugindefs/multisig/config.ts +1 -1
- package/plugindefs/session-key/config.ts +1 -1
- package/src/index.ts +1 -1
- package/src/light-account/accounts/account.ts +24 -45
- package/src/light-account/accounts/base.ts +39 -68
- package/src/light-account/accounts/multiOwner.ts +29 -43
- package/src/light-account/clients/alchemyClient.ts +2 -2
- package/src/light-account/clients/multiOwnerAlchemyClient.ts +3 -3
- package/src/light-account/decorators/lightAccount.ts +1 -1
- package/src/light-account/decorators/multiOwnerLightAccount.ts +1 -1
- package/src/light-account/types.ts +31 -188
- package/src/light-account/utils.ts +91 -246
- package/src/msca/client/alchemyClient.ts +2 -2
- package/src/msca/client/multiSigAlchemyClient.ts +5 -5
- package/src/msca/plugins/multisig/middleware.ts +6 -6
- package/src/msca/plugins/multisig/utils/formatSignatures.ts +3 -3
- package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +15 -12
- package/src/msca/plugins/session-key/permissions.ts +147 -1
- package/src/msca/plugins/session-key/signer.ts +71 -1
- package/src/msca/utils.ts +15 -13
- package/dist/cjs/src/light-account/schema.d.ts +0 -21
- package/dist/cjs/src/light-account/schema.js +0 -30
- package/dist/cjs/src/light-account/schema.js.map +0 -1
- package/dist/esm/src/light-account/schema.d.ts +0 -21
- package/dist/esm/src/light-account/schema.js +0 -27
- package/dist/esm/src/light-account/schema.js.map +0 -1
- package/dist/types/src/light-account/schema.d.ts +0 -22
- package/dist/types/src/light-account/schema.d.ts.map +0 -1
- package/src/light-account/schema.ts +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/msca/client/alchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,oCAAoC,EACzC,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"alchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/msca/client/alchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,oCAAoC,EACzC,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAEd,MAAM,MAAM,iCAAiC,CAC3C,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,oCAAoC,CAAC,aAAa,EAAE,OAAO,CAAC,EAC5D,WAAW,GAAG,OAAO,CACtB,GACC,IAAI,CACF,+BAA+B,CAAC,SAAS,EAAE,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,EACxE,SAAS,CACV,CAAC;AAEJ,wBAAgB,iCAAiC,CAC/C,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EAEvD,MAAM,EAAE,iCAAiC,CAAC,OAAO,CAAC,GACjD,OAAO,CACR,yBAAyB,CACvB,eAAe,EACf,KAAK,GAAG,SAAS,EACjB,wBAAwB,CAAC,OAAO,CAAC,EACjC,uBAAuB,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,GACxD,oBAAoB,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,GACvD,mBAAmB,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CACzD,CACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type SmartAccountSigner } from "@aa-sdk/core";
|
|
1
2
|
import { type AlchemySmartAccountClient, type AlchemySmartAccountClientConfig } from "@account-kit/infra";
|
|
2
3
|
import { type AccountLoupeActions, type CreateMultisigModularAccountParams, type LightAccount, type MultisigModularAccount, type MultisigPluginActions, type MultisigUserOperationContext, type PluginManagerActions } from "@account-kit/smart-contracts";
|
|
3
|
-
import { type SmartAccountSigner } from "@aa-sdk/core";
|
|
4
4
|
import { type Chain, type CustomTransport, type HttpTransport, type Transport } from "viem";
|
|
5
5
|
export type AlchemyMultisigAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateMultisigModularAccountParams<HttpTransport, TSigner>, "transport" | "chain"> & Omit<AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>, MultisigUserOperationContext>, "account">;
|
|
6
6
|
export declare function createMultisigAccountAlchemyClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyMultisigAccountClientConfig<TSigner>): Promise<AlchemySmartAccountClient<CustomTransport, Chain | undefined, MultisigModularAccount<TSigner>, MultisigPluginActions<MultisigModularAccount<TSigner>> & PluginManagerActions<MultisigModularAccount<TSigner>> & AccountLoupeActions<MultisigModularAccount<TSigner>>, MultisigUserOperationContext>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiSigAlchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/msca/client/multiSigAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,kCAAkC,EACvC,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,
|
|
1
|
+
{"version":3,"file":"multiSigAlchemyClient.d.ts","sourceRoot":"","sources":["../../../../../src/msca/client/multiSigAlchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,kCAAkC,EACvC,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAId,MAAM,MAAM,kCAAkC,CAC5C,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,IACrD,IAAI,CACN,kCAAkC,CAAC,aAAa,EAAE,OAAO,CAAC,EAC1D,WAAW,GAAG,OAAO,CACtB,GACC,IAAI,CACF,+BAA+B,CAC7B,SAAS,EACT,KAAK,EACL,YAAY,CAAC,OAAO,CAAC,EACrB,4BAA4B,CAC7B,EACD,SAAS,CACV,CAAC;AAEJ,wBAAgB,kCAAkC,CAChD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EAEvD,MAAM,EAAE,kCAAkC,CAAC,OAAO,CAAC,GAClD,OAAO,CACR,yBAAyB,CACvB,eAAe,EACf,KAAK,GAAG,SAAS,EACjB,sBAAsB,CAAC,OAAO,CAAC,EAC/B,qBAAqB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,GACpD,oBAAoB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,GACrD,mBAAmB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,EACtD,4BAA4B,CAC7B,CACF,CAAC"}
|
|
@@ -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"}
|
|
@@ -43,14 +43,160 @@ export declare class SessionKeyPermissionsBuilder {
|
|
|
43
43
|
private _erc20TokenSpendLimits;
|
|
44
44
|
private _gasSpendLimit?;
|
|
45
45
|
private _requiredPaymaster?;
|
|
46
|
+
/**
|
|
47
|
+
* Sets the access control type for the contract and returns the current instance for method chaining.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { SessionKeyPermissionsBuilder } from "@account-kit/smart-contracts";
|
|
52
|
+
*
|
|
53
|
+
* const builder = new SessionKeyPermissionsBuilder();
|
|
54
|
+
* builder.setContractAccessControlType(SessionKeyAccessListType.ALLOWLIST);
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @param {SessionKeyAccessListType} aclType The access control type for the session key
|
|
58
|
+
* @returns {SessionKeyPermissionsBuilder} The current instance for method chaining
|
|
59
|
+
*/
|
|
46
60
|
setContractAccessControlType(aclType: SessionKeyAccessListType): this;
|
|
61
|
+
/**
|
|
62
|
+
* Adds a contract access entry to the internal list of contract address access entries.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* import { SessionKeyPermissionsBuilder } from "@account-kit/smart-contracts";
|
|
67
|
+
*
|
|
68
|
+
* const builder = new SessionKeyPermissionsBuilder();
|
|
69
|
+
* builder.addContractAddressAccessEntry({
|
|
70
|
+
* contractAddress: "0x1234",
|
|
71
|
+
* isOnList: true,
|
|
72
|
+
* checkSelectors: true,
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @param {ContractAccessEntry} entry the contract access entry to be added
|
|
77
|
+
* @returns {SessionKeyPermissionsBuilder} the instance of the current class for chaining
|
|
78
|
+
*/
|
|
47
79
|
addContractAddressAccessEntry(entry: ContractAccessEntry): this;
|
|
80
|
+
/**
|
|
81
|
+
* Adds a contract method entry to the `_contractMethodAccessEntrys` array.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { SessionKeyPermissionsBuilder } from "@account-kit/smart-contracts";
|
|
86
|
+
*
|
|
87
|
+
* const builder = new SessionKeyPermissionsBuilder();
|
|
88
|
+
* builder.addContractAddressAccessEntry({
|
|
89
|
+
* contractAddress: "0x1234",
|
|
90
|
+
* methodSelector: "0x45678",
|
|
91
|
+
* isOnList: true,
|
|
92
|
+
* });
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @param {ContractMethodEntry} entry The contract method entry to be added
|
|
96
|
+
* @returns {SessionKeyPermissionsBuilder} The instance of the class for method chaining
|
|
97
|
+
*/
|
|
48
98
|
addContractFunctionAccessEntry(entry: ContractMethodEntry): this;
|
|
99
|
+
/**
|
|
100
|
+
* Sets the time range for an object and returns the object itself for chaining.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { SessionKeyPermissionsBuilder } from "@account-kit/smart-contracts";
|
|
105
|
+
*
|
|
106
|
+
* const builder = new SessionKeyPermissionsBuilder();
|
|
107
|
+
* builder.setTimeRange({
|
|
108
|
+
* validFrom: Date.now(),
|
|
109
|
+
* validUntil: Date.now() + (15 * 60 * 1000),
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @param {TimeRange} timeRange The time range to be set
|
|
114
|
+
* @returns {SessionKeyPermissionsBuilder} The current object for method chaining
|
|
115
|
+
*/
|
|
49
116
|
setTimeRange(timeRange: TimeRange): this;
|
|
117
|
+
/**
|
|
118
|
+
* Sets the native token spend limit and returns the instance for chaining.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```ts
|
|
122
|
+
* import { SessionKeyPermissionsBuilder } from "@account-kit/smart-contracts";
|
|
123
|
+
*
|
|
124
|
+
* const builder = new SessionKeyPermissionsBuilder();
|
|
125
|
+
* builder.setNativeTokenSpendLimit({
|
|
126
|
+
* spendLimit: 1000000000000000000n,
|
|
127
|
+
* refreshInterval: 3600,
|
|
128
|
+
* });
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @param {NativeTokenLimit} limit The limit to set for native token spending
|
|
132
|
+
* @returns {SessionKeyPermissionsBuilder} The instance for chaining
|
|
133
|
+
*/
|
|
50
134
|
setNativeTokenSpendLimit(limit: NativeTokenLimit): this;
|
|
135
|
+
/**
|
|
136
|
+
* Adds an ERC20 token spend limit to the list of limits and returns the updated object.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* import { SessionKeyPermissionsBuilder } from "@account-kit/smart-contracts";
|
|
141
|
+
*
|
|
142
|
+
* const builder = new SessionKeyPermissionsBuilder();
|
|
143
|
+
* builder.addErc20TokenSpendLimit({
|
|
144
|
+
* tokenAddress: "0x1234",
|
|
145
|
+
* spendLimit: 1000000000000000000n,
|
|
146
|
+
* refreshInterval: 3600,
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @param {Erc20TokenLimit} limit The ERC20 token spend limit to be added
|
|
151
|
+
* @returns {object} The updated object with the new ERC20 token spend limit
|
|
152
|
+
*/
|
|
51
153
|
addErc20TokenSpendLimit(limit: Erc20TokenLimit): this;
|
|
52
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Sets the gas spend limit and returns the current instance for method chaining.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* import { SessionKeyPermissionsBuilder } from "@account-kit/smart-contracts";
|
|
160
|
+
*
|
|
161
|
+
* const builder = new SessionKeyPermissionsBuilder();
|
|
162
|
+
* builder.setGasSpendLimit({
|
|
163
|
+
* spendLimit: 1000000000000000000n,
|
|
164
|
+
* refreshInterval: 3600,
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* @param {GasSpendLimit} limit - The gas spend limit to be set
|
|
169
|
+
* @returns {SessionKeyPermissionsBuilder} The current instance for chaining
|
|
170
|
+
*/ setGasSpendLimit(limit: GasSpendLimit): this;
|
|
171
|
+
/**
|
|
172
|
+
* Sets the required paymaster address.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { SessionKeyPermissionsBuilder } from "@account-kit/smart-contracts";
|
|
177
|
+
*
|
|
178
|
+
* const builder = new SessionKeyPermissionsBuilder();
|
|
179
|
+
* builder.setRequiredPaymaster("0x1234");
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @param {Address} paymaster the address of the paymaster to be set
|
|
183
|
+
* @returns {SessionKeyPermissionsBuilder} the current instance for method chaining
|
|
184
|
+
*/
|
|
53
185
|
setRequiredPaymaster(paymaster: Address): this;
|
|
186
|
+
/**
|
|
187
|
+
* Encodes various function calls into an array of hexadecimal strings based on the provided permissions and limits.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```ts
|
|
191
|
+
* import { SessionKeyPermissionsBuilder } from "@account-kit/smart-contracts";
|
|
192
|
+
*
|
|
193
|
+
* const builder = new SessionKeyPermissionsBuilder();
|
|
194
|
+
* builder.setRequiredPaymaster("0x1234");
|
|
195
|
+
* const encoded = builder.encode();
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* @returns {Hex[]} An array of encoded hexadecimal strings representing the function calls for setting access control, permissions, and limits.
|
|
199
|
+
*/
|
|
54
200
|
encode(): Hex[];
|
|
55
201
|
private encodeIfDefined;
|
|
56
202
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../../../../src/msca/plugins/session-key/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAGlE,oBAAY,wBAAwB;IAClC,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,gBAAgB,IAAI;CACrB;AAED,MAAM,MAAM,mBAAmB,GAAG;IAEhC,eAAe,EAAE,OAAO,CAAC;IAEzB,QAAQ,EAAE,OAAO,CAAC;IAElB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAEhC,eAAe,EAAE,OAAO,CAAC;IAEzB,cAAc,EAAE,GAAG,CAAC;IAEpB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IAGnB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IAGnB,eAAe,CAAC,EAA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essionKeySigner implements SmartAccountSigner<LocalAccount
|
|
|
23
23
|
inner: LocalAccountSigner<PrivateKeyAccount>;
|
|
24
24
|
private storageType;
|
|
25
25
|
private storageKey;
|
|
26
|
+
/**
|
|
27
|
+
* Initializes a new instance of a session key signer with the provided configuration. This will set the `signerType`, `storageKey`, and `storageType`. It will also manage the session key, either fetching it from storage or generating a new one if it doesn't exist.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { SessionKeySigner } from "@account-kit/smart-contracts";
|
|
32
|
+
*
|
|
33
|
+
* const signer = new SessionKeySigner();
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param {SessionKeySignerConfig} config_ the configuration for initializing the session key signer
|
|
37
|
+
*/
|
|
26
38
|
constructor(config_?: SessionKeySignerConfig);
|
|
39
|
+
/**
|
|
40
|
+
* An async function that retrieves the address using the inner object's `getAddress` method.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { SessionKeySigner } from "@account-kit/smart-contracts";
|
|
45
|
+
*
|
|
46
|
+
* const signer = new SessionKeySigner();
|
|
47
|
+
* const sessionKeyAddress = await signer.getAddress();
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @returns {Promise<string>} A promise that resolves to the address as a string
|
|
51
|
+
*/
|
|
27
52
|
getAddress: () => Promise<`0x${string}`>;
|
|
53
|
+
/**
|
|
54
|
+
* Signs a message using the inner signer.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* import { SessionKeySigner } from "@account-kit/smart-contracts";
|
|
59
|
+
*
|
|
60
|
+
* const signer = new SessionKeySigner();
|
|
61
|
+
* const sessionKeyAddress = await signer.signMessage("hello");
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param {SignableMessage} msg The message to sign
|
|
65
|
+
* @returns {Promise<Hex>} A promise that resolves to the signed message
|
|
66
|
+
*/
|
|
28
67
|
signMessage: (msg: SignableMessage) => Promise<`0x${string}`>;
|
|
68
|
+
/**
|
|
69
|
+
* Signs the provided typed data using the inner signer.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { SessionKeySigner } from "@account-kit/smart-contracts";
|
|
74
|
+
*
|
|
75
|
+
* const signer = new SessionKeySigner();
|
|
76
|
+
* console.log(await signer.signTypedData({
|
|
77
|
+
* types: {
|
|
78
|
+
* "Message": [{ name: "content", type: "string" }]
|
|
79
|
+
* },
|
|
80
|
+
* primaryType: "Message",
|
|
81
|
+
* message: { content: "Hello" },
|
|
82
|
+
* }));
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @template TTypedData - The typed data type, which extends `TypedData` or a record of unknown keys to unknown values.
|
|
86
|
+
* @template TPrimaryType - The primary type of the typed data.
|
|
87
|
+
*
|
|
88
|
+
* @param {TypedDataDefinition<TTypedData, TPrimaryType>} params The parameters containing the typed data definition and primary type.
|
|
89
|
+
* @returns {Promise<string>} A promise that resolves to the signed typed data as a string.
|
|
90
|
+
*/
|
|
29
91
|
signTypedData: <const TTypedData extends {
|
|
30
92
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
31
93
|
[x: `string[${string}]`]: undefined;
|
|
@@ -237,7 +299,15 @@ export declare class SessionKeySigner implements SmartAccountSigner<LocalAccount
|
|
|
237
299
|
/**
|
|
238
300
|
* Generates a new private key and stores it in the storage.
|
|
239
301
|
*
|
|
240
|
-
* @
|
|
302
|
+
* @example
|
|
303
|
+
* ```ts
|
|
304
|
+
* import { SessionKeySigner } from "@account-kit/smart-contracts";
|
|
305
|
+
*
|
|
306
|
+
* const signer = new SessionKeySigner();
|
|
307
|
+
* const newSessionKey = signer.generateNewKey();
|
|
308
|
+
* ```
|
|
309
|
+
*
|
|
310
|
+
* @returns {Address} The public address of the new key.
|
|
241
311
|
*/
|
|
242
312
|
generateNewKey: () => `0x${string}`;
|
|
243
313
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../../../../src/msca/plugins/session-key/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAEV,iBAAiB,EACjB,eAAe,EAEf,mBAAmB,EACpB,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB;;;;;;;;;EAMjC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AAEjE;;;;GAIG;AACH,qBAAa,gBACX,YAAW,kBAAkB,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAEpE,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAC7C,OAAO,CAAC,WAAW,CAAgD;IACnE,OAAO,CAAC,UAAU,CAAS;
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../../../../src/msca/plugins/session-key/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAEV,iBAAiB,EACjB,eAAe,EAEf,mBAAmB,EACpB,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB;;;;;;;;;EAMjC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AAEjE;;;;GAIG;AACH,qBAAa,gBACX,YAAW,kBAAkB,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAEpE,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAC7C,OAAO,CAAC,WAAW,CAAgD;IACnE,OAAO,CAAC,UAAU,CAAS;IAE3B;;;;;;;;;;;OAWG;gBACS,OAAO,GAAE,sBAA2B;IA2BhD;;;;;;;;;;;;OAYG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAEtC;IAEF;;;;;;;;;;;;;OAaG;IACH,WAAW,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAI3D;IAEF;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8HAOX;IAEF;;;;;;;;;;;;OAYG;IACH,cAAc,sBASZ;CACH"}
|
|
@@ -2,18 +2,18 @@ import { type GetAccountParameter, type SmartAccountClient, type SmartAccountSig
|
|
|
2
2
|
import type { Address, Chain, Transport } from "viem";
|
|
3
3
|
import { type MultiOwnerModularAccount } from "./account/multiOwnerAccount.js";
|
|
4
4
|
/**
|
|
5
|
-
* Utility method returning the default multi sig msca factory address given a
|
|
5
|
+
* Utility method returning the default multi sig msca factory address given a chain
|
|
6
6
|
*
|
|
7
|
-
* @param chain
|
|
8
|
-
* @returns
|
|
7
|
+
* @param {Chain} chain the chain object for which to get the address
|
|
8
|
+
* @returns {Address} the address for the given chain
|
|
9
9
|
* @throws if the chain doesn't have an address currently deployed
|
|
10
10
|
*/
|
|
11
11
|
export declare const getDefaultMultisigModularAccountFactoryAddress: (chain: Chain) => Address;
|
|
12
12
|
/**
|
|
13
|
-
* Utility method returning the default multi owner msca factory address given a
|
|
13
|
+
* Utility method returning the default multi owner msca factory address given a chain
|
|
14
14
|
*
|
|
15
|
-
* @param chain
|
|
16
|
-
* @returns
|
|
15
|
+
* @param {Chain} chain the chain object for which to get the address
|
|
16
|
+
* @returns {Address} the address for the given chain
|
|
17
17
|
* @throws if the chain doesn't have an address currently deployed
|
|
18
18
|
*/
|
|
19
19
|
export declare const getDefaultMultiOwnerModularAccountFactoryAddress: (chain: Chain) => Address;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/msca/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/msca/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAatB,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAYtD,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,gCAAgC,CAAC;AAGxC;;;;;;GAMG;AACH,eAAO,MAAM,8CAA8C,UAClD,KAAK,KACX,OAeF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gDAAgD,UACpD,KAAK,KACX,OAKF,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAC9B,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,QAAQ,SACJ,8BAA8B,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/C,SAAS,GAAG,8BAA8B,CAAC,MAAM,EAAE,OAAO,CA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AC7C,oBAAoB,GACpB,SAAS,EACb,EACA,MAAM,EACN,uBAAuB,EACvB,aAAa,GACd,EAAE,6BAA6B,CAC9B,UAAU,EACV,MAAM,EACN,QAAQ,CACT,GAAG,OAAO,CAAC,aAAa,CAAC,CAwDzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@account-kit/smart-contracts",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.10",
|
|
4
4
|
"description": "aa-sdk compatible interfaces for Alchemy Smart Accounts",
|
|
5
5
|
"author": "Alchemy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,20 +40,21 @@
|
|
|
40
40
|
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
|
|
41
41
|
"build:esm": "tsc --project tsconfig.build.json --module es2020 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\"}'",
|
|
42
42
|
"build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
|
|
43
|
+
"docs:gen": "npx ak-docgen generate --in ./src/index.ts --out ../../site/pages/reference/account-kit/smart-contracts",
|
|
43
44
|
"clean": "rm -rf ./dist",
|
|
44
45
|
"test": "vitest",
|
|
45
46
|
"test:run": "vitest run",
|
|
46
47
|
"test:run-e2e": "vitest run --config vitest.config.e2e.ts"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@account-kit/plugingen": "^4.0.0-alpha.
|
|
50
|
+
"@account-kit/plugingen": "^4.0.0-alpha.10",
|
|
50
51
|
"@wagmi/cli": "^1.5.2",
|
|
51
52
|
"change-case": "^5.1.2",
|
|
52
53
|
"dedent": "^1.5.1",
|
|
53
54
|
"dotenv": "^16.3.1",
|
|
54
55
|
"typescript": "^5.0.4",
|
|
55
56
|
"typescript-template": "*",
|
|
56
|
-
"vitest": "^0.
|
|
57
|
+
"vitest": "^2.0.4"
|
|
57
58
|
},
|
|
58
59
|
"publishConfig": {
|
|
59
60
|
"access": "public",
|
|
@@ -67,10 +68,10 @@
|
|
|
67
68
|
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
68
69
|
},
|
|
69
70
|
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
|
|
70
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "e3446b95cdee38c248f336857b24f78a32694076",
|
|
71
72
|
"dependencies": {
|
|
72
|
-
"@aa-sdk/core": "^4.0.0-alpha.
|
|
73
|
-
"@account-kit/infra": "^4.0.0-alpha.
|
|
73
|
+
"@aa-sdk/core": "^4.0.0-alpha.10",
|
|
74
|
+
"@account-kit/infra": "^4.0.0-alpha.10",
|
|
74
75
|
"viem": "2.8.6"
|
|
75
76
|
},
|
|
76
77
|
"peerDependencies": {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
sepolia,
|
|
15
15
|
zora,
|
|
16
16
|
zoraSepolia,
|
|
17
|
-
} from "@
|
|
17
|
+
} from "@account-kit/infra";
|
|
18
18
|
import type { PluginConfig } from "@account-kit/plugingen";
|
|
19
19
|
import { parseAbiParameters } from "viem";
|
|
20
20
|
import { MultiOwnerPluginAbi } from "./abi.js";
|
|
@@ -33,7 +33,6 @@ export const MultiOwnerPluginGenConfig: PluginConfig = {
|
|
|
33
33
|
[arbitrum.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
|
|
34
34
|
[arbitrumSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
|
|
35
35
|
[base.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
|
|
36
|
-
[baseSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
|
|
37
36
|
[fraxtal.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
|
|
38
37
|
[fraxtalSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
|
|
39
38
|
[zora.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
sepolia,
|
|
14
14
|
zora,
|
|
15
15
|
zoraSepolia,
|
|
16
|
-
} from "@
|
|
16
|
+
} from "@account-kit/infra";
|
|
17
17
|
import type { PluginConfig } from "@account-kit/plugingen";
|
|
18
18
|
import { parseAbiParameters } from "viem";
|
|
19
19
|
import { MultisigPluginAbi } from "./abi.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
sepolia,
|
|
15
15
|
zora,
|
|
16
16
|
zoraSepolia,
|
|
17
|
-
} from "@
|
|
17
|
+
} from "@account-kit/infra";
|
|
18
18
|
import type { PluginConfig } from "@account-kit/plugingen";
|
|
19
19
|
import { parseAbiParameters } from "viem";
|
|
20
20
|
import { MultiOwnerPluginGenConfig } from "../multi-owner/config.js";
|
package/src/index.ts
CHANGED
|
@@ -24,7 +24,7 @@ export {
|
|
|
24
24
|
LightAccountUnsupported1271Impls,
|
|
25
25
|
defaultLightAccountVersion,
|
|
26
26
|
getDefaultLightAccountFactoryAddress,
|
|
27
|
-
|
|
27
|
+
getLightAccountVersionForAccount,
|
|
28
28
|
} from "./light-account/utils.js";
|
|
29
29
|
|
|
30
30
|
//multi-owner-light-account exports
|
|
@@ -18,8 +18,8 @@ import { LightAccountAbi_v2 } from "../abis/LightAccountAbi_v2.js";
|
|
|
18
18
|
import { LightAccountFactoryAbi_v1 } from "../abis/LightAccountFactoryAbi_v1.js";
|
|
19
19
|
import { LightAccountFactoryAbi_v2 } from "../abis/LightAccountFactoryAbi_v2.js";
|
|
20
20
|
import type {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
LightAccountEntryPointVersion,
|
|
22
|
+
LightAccountVersion,
|
|
23
23
|
} from "../types.js";
|
|
24
24
|
import {
|
|
25
25
|
AccountVersionRegistry,
|
|
@@ -35,17 +35,8 @@ import {
|
|
|
35
35
|
|
|
36
36
|
export type LightAccount<
|
|
37
37
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
38
|
-
TLightAccountVersion extends
|
|
39
|
-
|
|
40
|
-
"LightAccount",
|
|
41
|
-
TLightAccountVersion
|
|
42
|
-
> = GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion>
|
|
43
|
-
> = LightAccountBase<
|
|
44
|
-
TSigner,
|
|
45
|
-
"LightAccount",
|
|
46
|
-
TLightAccountVersion,
|
|
47
|
-
TEntryPointVersion
|
|
48
|
-
> & {
|
|
38
|
+
TLightAccountVersion extends LightAccountVersion<"LightAccount"> = LightAccountVersion<"LightAccount">
|
|
39
|
+
> = LightAccountBase<TSigner, "LightAccount", TLightAccountVersion> & {
|
|
49
40
|
encodeTransferOwnership: (newOwner: Address) => Hex;
|
|
50
41
|
getOwnerAddress: () => Promise<Address>;
|
|
51
42
|
};
|
|
@@ -54,55 +45,41 @@ export type LightAccount<
|
|
|
54
45
|
export type CreateLightAccountParams<
|
|
55
46
|
TTransport extends Transport = Transport,
|
|
56
47
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
57
|
-
TLightAccountVersion extends
|
|
58
|
-
TEntryPointVersion extends GetEntryPointForLightAccountVersion<
|
|
59
|
-
"LightAccount",
|
|
60
|
-
TLightAccountVersion
|
|
61
|
-
> = GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion>
|
|
48
|
+
TLightAccountVersion extends LightAccountVersion<"LightAccount"> = LightAccountVersion<"LightAccount">
|
|
62
49
|
> = Omit<
|
|
63
50
|
CreateLightAccountBaseParams<
|
|
64
|
-
TTransport,
|
|
65
|
-
TSigner,
|
|
66
51
|
"LightAccount",
|
|
67
52
|
TLightAccountVersion,
|
|
68
|
-
|
|
53
|
+
TTransport,
|
|
54
|
+
TSigner
|
|
69
55
|
>,
|
|
70
|
-
|
|
56
|
+
| "getAccountInitCode"
|
|
57
|
+
| "entryPoint"
|
|
58
|
+
| "version"
|
|
59
|
+
| "abi"
|
|
60
|
+
| "accountAddress"
|
|
61
|
+
| "type"
|
|
71
62
|
> & {
|
|
72
63
|
salt?: bigint;
|
|
73
64
|
initCode?: Hex;
|
|
74
65
|
accountAddress?: Address;
|
|
75
66
|
factoryAddress?: Address;
|
|
76
67
|
version?: TLightAccountVersion;
|
|
77
|
-
entryPoint?: EntryPointDef<
|
|
68
|
+
entryPoint?: EntryPointDef<
|
|
69
|
+
LightAccountEntryPointVersion<"LightAccount", TLightAccountVersion>,
|
|
70
|
+
Chain
|
|
71
|
+
>;
|
|
78
72
|
};
|
|
79
73
|
// [!endregion CreateLightAccountParams]
|
|
80
74
|
|
|
81
75
|
export async function createLightAccount<
|
|
82
76
|
TTransport extends Transport = Transport,
|
|
83
77
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
84
|
-
TLightAccountVersion extends
|
|
78
|
+
TLightAccountVersion extends LightAccountVersion<"LightAccount"> = "v2.0.0"
|
|
85
79
|
>(
|
|
86
80
|
config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>
|
|
87
81
|
): Promise<LightAccount<TSigner, TLightAccountVersion>>;
|
|
88
82
|
|
|
89
|
-
export async function createLightAccount<
|
|
90
|
-
TTransport extends Transport = Transport,
|
|
91
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
92
|
-
TLightAccountVersion extends GetLightAccountVersion<"LightAccount"> = GetLightAccountVersion<"LightAccount">,
|
|
93
|
-
TEntryPointVersion extends GetEntryPointForLightAccountVersion<
|
|
94
|
-
"LightAccount",
|
|
95
|
-
TLightAccountVersion
|
|
96
|
-
> = GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion>
|
|
97
|
-
>(
|
|
98
|
-
config: CreateLightAccountParams<
|
|
99
|
-
TTransport,
|
|
100
|
-
TSigner,
|
|
101
|
-
TLightAccountVersion,
|
|
102
|
-
TEntryPointVersion
|
|
103
|
-
>
|
|
104
|
-
): Promise<LightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>>;
|
|
105
|
-
|
|
106
83
|
/**
|
|
107
84
|
* Creates a light account based on the provided parameters such as transport, chain, signer, init code, and more. Ensures that an account is configured and returned with various capabilities, such as transferring ownership and retrieving the owner's address.
|
|
108
85
|
*
|
|
@@ -128,7 +105,7 @@ export async function createLightAccount({
|
|
|
128
105
|
chain,
|
|
129
106
|
signer,
|
|
130
107
|
initCode,
|
|
131
|
-
version = defaultLightAccountVersion(
|
|
108
|
+
version = defaultLightAccountVersion(),
|
|
132
109
|
entryPoint = getEntryPoint(chain, {
|
|
133
110
|
version: AccountVersionRegistry["LightAccount"][version]
|
|
134
111
|
.entryPointVersion as any,
|
|
@@ -176,15 +153,17 @@ export async function createLightAccount({
|
|
|
176
153
|
});
|
|
177
154
|
|
|
178
155
|
const account = await createLightAccountBase<
|
|
156
|
+
"LightAccount",
|
|
157
|
+
LightAccountVersion<"LightAccount">,
|
|
179
158
|
Transport,
|
|
180
|
-
SmartAccountSigner
|
|
181
|
-
"LightAccount"
|
|
159
|
+
SmartAccountSigner
|
|
182
160
|
>({
|
|
183
161
|
transport,
|
|
184
162
|
chain,
|
|
185
163
|
signer,
|
|
186
164
|
abi: accountAbi,
|
|
187
|
-
|
|
165
|
+
type: "LightAccount",
|
|
166
|
+
version,
|
|
188
167
|
entryPoint,
|
|
189
168
|
accountAddress: address,
|
|
190
169
|
getAccountInitCode,
|