@alchemy/smart-accounts 5.0.0-beta.3 → 5.0.0-beta.31
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/README.md +45 -2
- package/dist/esm/index.d.ts +1 -7
- package/dist/esm/index.js +1 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/light-account/accounts/base.js +0 -1
- package/dist/esm/light-account/accounts/base.js.map +1 -1
- package/dist/esm/light-account/accounts/calldataCodec.js +0 -3
- package/dist/esm/light-account/accounts/calldataCodec.js.map +1 -1
- package/dist/esm/light-account/utils.js +0 -5
- package/dist/esm/light-account/utils.js.map +1 -1
- package/dist/esm/ma-v1/accounts/base.js +1 -1
- package/dist/esm/ma-v1/accounts/base.js.map +1 -1
- package/dist/esm/ma-v1/accounts/calldataCodec.js +0 -4
- package/dist/esm/ma-v1/accounts/calldataCodec.js.map +1 -1
- package/dist/esm/ma-v1/mav1StaticImpl.d.ts +0 -2
- package/dist/esm/ma-v1/mav1StaticImpl.js +0 -2
- package/dist/esm/ma-v1/mav1StaticImpl.js.map +1 -1
- package/dist/esm/ma-v2/accounts/account.d.ts +39 -0
- package/dist/esm/ma-v2/accounts/account.js +40 -1
- package/dist/esm/ma-v2/accounts/account.js.map +1 -1
- package/dist/esm/ma-v2/accounts/base.js +1 -1
- package/dist/esm/ma-v2/accounts/base.js.map +1 -1
- package/dist/esm/ma-v2/accounts/calldataCodec.js +0 -4
- package/dist/esm/ma-v2/accounts/calldataCodec.js.map +1 -1
- package/dist/esm/ma-v2/decorators/deferralActions.d.ts +3 -3
- package/dist/esm/ma-v2/decorators/deferralActions.js +3 -3
- package/dist/esm/ma-v2/decorators/deferralActions.js.map +1 -1
- package/dist/esm/ma-v2/decorators/installValidation.d.ts +8 -20
- package/dist/esm/ma-v2/decorators/installValidation.js +7 -58
- package/dist/esm/ma-v2/decorators/installValidation.js.map +1 -1
- package/dist/esm/ma-v2/mav2StaticImpl.d.ts +0 -4
- package/dist/esm/ma-v2/mav2StaticImpl.js +0 -4
- package/dist/esm/ma-v2/mav2StaticImpl.js.map +1 -1
- package/dist/esm/ma-v2/permissionBuilder.d.ts +2 -2
- package/dist/esm/ma-v2/permissionBuilder.js +46 -14
- package/dist/esm/ma-v2/permissionBuilder.js.map +1 -1
- package/dist/esm/ma-v2/utils/account.js +0 -2
- package/dist/esm/ma-v2/utils/account.js.map +1 -1
- package/dist/esm/ma-v2/utils/deferredActions.d.ts +6 -6
- package/dist/esm/ma-v2/utils/deferredActions.js +5 -5
- package/dist/esm/ma-v2/utils/deferredActions.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/index.d.ts +1 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/light-account/accounts/base.d.ts.map +1 -1
- package/dist/types/light-account/accounts/calldataCodec.d.ts.map +1 -1
- package/dist/types/light-account/utils.d.ts.map +1 -1
- package/dist/types/ma-v1/accounts/calldataCodec.d.ts.map +1 -1
- package/dist/types/ma-v1/mav1StaticImpl.d.ts +0 -2
- package/dist/types/ma-v1/mav1StaticImpl.d.ts.map +1 -1
- package/dist/types/ma-v2/accounts/account.d.ts +39 -0
- package/dist/types/ma-v2/accounts/account.d.ts.map +1 -1
- package/dist/types/ma-v2/accounts/calldataCodec.d.ts.map +1 -1
- package/dist/types/ma-v2/decorators/deferralActions.d.ts +3 -3
- package/dist/types/ma-v2/decorators/deferralActions.d.ts.map +1 -1
- package/dist/types/ma-v2/decorators/installValidation.d.ts +8 -20
- package/dist/types/ma-v2/decorators/installValidation.d.ts.map +1 -1
- package/dist/types/ma-v2/mav2StaticImpl.d.ts +0 -4
- package/dist/types/ma-v2/mav2StaticImpl.d.ts.map +1 -1
- package/dist/types/ma-v2/permissionBuilder.d.ts +2 -2
- package/dist/types/ma-v2/permissionBuilder.d.ts.map +1 -1
- package/dist/types/ma-v2/utils/account.d.ts.map +1 -1
- package/dist/types/ma-v2/utils/deferredActions.d.ts +6 -6
- package/dist/types/ma-v2/utils/deferredActions.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/index.ts +1 -14
- package/src/light-account/accounts/base.ts +0 -1
- package/src/light-account/accounts/calldataCodec.ts +0 -4
- package/src/light-account/utils.ts +0 -6
- package/src/ma-v1/accounts/base.ts +1 -1
- package/src/ma-v1/accounts/calldataCodec.ts +0 -5
- package/src/ma-v1/mav1StaticImpl.ts +0 -2
- package/src/ma-v2/accounts/account.ts +41 -2
- package/src/ma-v2/accounts/base.ts +1 -1
- package/src/ma-v2/accounts/calldataCodec.ts +0 -5
- package/src/ma-v2/decorators/deferralActions.ts +7 -7
- package/src/ma-v2/decorators/installValidation.ts +8 -83
- package/src/ma-v2/mav2StaticImpl.ts +0 -4
- package/src/ma-v2/permissionBuilder.ts +54 -17
- package/src/ma-v2/utils/account.ts +0 -2
- package/src/ma-v2/utils/deferredActions.ts +9 -9
- package/src/version.ts +1 -1
- package/dist/esm/light-account/decorators/multiOwner.d.ts +0 -17
- package/dist/esm/light-account/decorators/multiOwner.js +0 -39
- package/dist/esm/light-account/decorators/multiOwner.js.map +0 -1
- package/dist/esm/light-account/decorators/singleOwner.d.ts +0 -16
- package/dist/esm/light-account/decorators/singleOwner.js +0 -35
- package/dist/esm/light-account/decorators/singleOwner.js.map +0 -1
- package/dist/esm/ma-v1/decorators/multiOwner.d.ts +0 -17
- package/dist/esm/ma-v1/decorators/multiOwner.js +0 -39
- package/dist/esm/ma-v1/decorators/multiOwner.js.map +0 -1
- package/dist/types/light-account/decorators/multiOwner.d.ts +0 -18
- package/dist/types/light-account/decorators/multiOwner.d.ts.map +0 -1
- package/dist/types/light-account/decorators/singleOwner.d.ts +0 -17
- package/dist/types/light-account/decorators/singleOwner.d.ts.map +0 -1
- package/dist/types/ma-v1/decorators/multiOwner.d.ts +0 -18
- package/dist/types/ma-v1/decorators/multiOwner.d.ts.map +0 -1
- package/src/light-account/decorators/multiOwner.ts +0 -72
- package/src/light-account/decorators/singleOwner.ts +0 -63
- package/src/ma-v1/decorators/multiOwner.ts +0 -72
|
@@ -25,7 +25,7 @@ export type CreateDeferredActionTypedDataParams = {
|
|
|
25
25
|
deadline: number;
|
|
26
26
|
nonce: bigint;
|
|
27
27
|
};
|
|
28
|
-
export type
|
|
28
|
+
export type BuildPreSignatureDeferredActionPayloadParams = {
|
|
29
29
|
typedData: DeferredActionTypedData;
|
|
30
30
|
};
|
|
31
31
|
export type EntityIdAndNonceParams = {
|
|
@@ -36,7 +36,7 @@ export type EntityIdAndNonceParams = {
|
|
|
36
36
|
};
|
|
37
37
|
export type DeferralActions = {
|
|
38
38
|
createDeferredActionTypedDataObject: (args: CreateDeferredActionTypedDataParams) => Promise<DeferredActionReturnData>;
|
|
39
|
-
|
|
39
|
+
buildPreSignatureDeferredActionPayload: (args: BuildPreSignatureDeferredActionPayloadParams) => Hex;
|
|
40
40
|
getEntityIdAndNonce: (args: EntityIdAndNonceParams) => Promise<{
|
|
41
41
|
nonce: bigint;
|
|
42
42
|
entityId: number;
|
|
@@ -46,7 +46,7 @@ export type DeferralActions = {
|
|
|
46
46
|
* Provides deferred action functionalities for a MA v2 client, ensuring compatibility with `SmartAccountClient`.
|
|
47
47
|
*
|
|
48
48
|
* @param {ModularAccountV2Client} client - The client instance which provides account and sendUserOperation functionality.
|
|
49
|
-
* @returns {object} - An object containing three methods: `createDeferredActionTypedDataObject`, `
|
|
49
|
+
* @returns {object} - An object containing three methods: `createDeferredActionTypedDataObject`, `buildPreSignatureDeferredActionPayload`, and `buildUserOperationWithDeferredAction`.
|
|
50
50
|
*/
|
|
51
51
|
export declare const deferralActions: <TTransport extends Transport = Transport, TChain extends Chain = Chain, TAccount extends SmartAccount = SmartAccount>(client: Client<TTransport, TChain, TAccount>) => DeferralActions;
|
|
52
52
|
//# sourceMappingURL=deferralActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferralActions.d.ts","sourceRoot":"","sources":["../../../../src/ma-v2/decorators/deferralActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,SAAS,EAQd,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQ7D,eAAO,MAAM,mCAAmC,y+EACw7E,CAAC;AAEz+E,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CACvD;IACE,cAAc,EAAE;QACd;YAAE,IAAI,EAAE,OAAO,CAAC;YAAC,IAAI,EAAE,SAAS,CAAA;SAAE;QAClC;YAAE,IAAI,EAAE,UAAU,CAAC;YAAC,IAAI,EAAE,QAAQ,CAAA;SAAE;QACpC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,OAAO,CAAA;SAAE;KAChC,CAAC;CACH,EACD,gBAAgB,CACjB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,uBAAuB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"deferralActions.d.ts","sourceRoot":"","sources":["../../../../src/ma-v2/decorators/deferralActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,SAAS,EAQd,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQ7D,eAAO,MAAM,mCAAmC,y+EACw7E,CAAC;AAEz+E,MAAM,MAAM,uBAAuB,GAAG,mBA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,SAAS,YAAY,GAAG,YAAY,EAE5C,QAAQ,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,KAC3C,eA8GF,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type Address, type Client, type Hex, type IsUndefined, type Chain, type
|
|
|
2
2
|
import type { HookConfig, ValidationConfig } from "../types.js";
|
|
3
3
|
import type { ModularAccountV2 } from "../accounts/account.js";
|
|
4
4
|
import type { GetAccountParameter } from "../../types.js";
|
|
5
|
-
import {
|
|
5
|
+
import type { SmartAccount } from "viem/account-abstraction";
|
|
6
6
|
export type InstallValidationParams<TAccount extends SmartAccount | undefined = SmartAccount | undefined> = {
|
|
7
7
|
validationConfig: ValidationConfig;
|
|
8
8
|
selectors: Hex[];
|
|
@@ -20,27 +20,23 @@ export type UninstallValidationParams<TAccount extends SmartAccount | undefined
|
|
|
20
20
|
} & GetAccountParameter<TAccount, ModularAccountV2>;
|
|
21
21
|
export type InstallValidationActions<TAccount extends SmartAccount | undefined = SmartAccount | undefined> = {
|
|
22
22
|
encodeInstallValidation: (args: InstallValidationParams<TAccount>) => Promise<Hex>;
|
|
23
|
-
installValidation: (args: InstallValidationParams<TAccount>) => Promise<Hex>;
|
|
24
23
|
encodeUninstallValidation: (args: UninstallValidationParams<TAccount>) => Promise<Hex>;
|
|
25
|
-
uninstallValidation: (args: UninstallValidationParams<TAccount>) => Promise<Hex>;
|
|
26
24
|
};
|
|
27
25
|
/**
|
|
28
|
-
* Provides validation installation and uninstallation functionalities for a MA v2 client
|
|
26
|
+
* Provides validation installation and uninstallation encoding functionalities for a MA v2 client.
|
|
29
27
|
*
|
|
30
28
|
* @example
|
|
31
29
|
* ```ts
|
|
32
|
-
* import {
|
|
30
|
+
* import { installValidationActions, SingleSignerValidationModule } from "@alchemy/smart-accounts";
|
|
33
31
|
* import { Address } from "viem";
|
|
34
32
|
*
|
|
35
33
|
* const client = (await createModularAccountV2Client({ ... })).extend(installValidationActions);
|
|
36
34
|
* const sessionKeyAddress: Address = "0x1234";
|
|
37
35
|
* const sessionKeyEntityId: number = 1;
|
|
38
36
|
*
|
|
39
|
-
* await client.
|
|
37
|
+
* const callData = await client.encodeInstallValidation({
|
|
40
38
|
* validationConfig: {
|
|
41
|
-
* moduleAddress: getDefaultSingleSignerValidationModuleAddress(
|
|
42
|
-
* client.chain
|
|
43
|
-
* ),
|
|
39
|
+
* moduleAddress: getDefaultSingleSignerValidationModuleAddress(client.chain),
|
|
44
40
|
* entityId: sessionKeyEntityId,
|
|
45
41
|
* isGlobal: true,
|
|
46
42
|
* isSignatureValidation: false,
|
|
@@ -54,19 +50,11 @@ export type InstallValidationActions<TAccount extends SmartAccount | undefined =
|
|
|
54
50
|
* hooks: [],
|
|
55
51
|
* });
|
|
56
52
|
*
|
|
57
|
-
* await client.
|
|
58
|
-
* moduleAddress: sessionKeyAddress,
|
|
59
|
-
* entityId: sessionKeyEntityId,
|
|
60
|
-
* uninstallData: SingleSignerValidationModule.encodeOnUninstallData({
|
|
61
|
-
* entityId: sessionKeyEntityId,
|
|
62
|
-
* }),
|
|
63
|
-
* hookUninstallDatas: [],
|
|
64
|
-
* });
|
|
65
|
-
*
|
|
53
|
+
* await client.sendUserOperation({ callData, account });
|
|
66
54
|
* ```
|
|
67
55
|
*
|
|
68
|
-
* @param {object} client - The client instance which provides account
|
|
69
|
-
* @returns {object} - An object containing
|
|
56
|
+
* @param {object} client - The client instance which provides account functionality.
|
|
57
|
+
* @returns {object} - An object containing `encodeInstallValidation` and `encodeUninstallValidation`.
|
|
70
58
|
*/
|
|
71
59
|
export declare function installValidationActions<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartAccount | undefined = SmartAccount | undefined>(client: Client<TTransport, TChain, TAccount>): InstallValidationActions<IsUndefined<TAccount> extends true ? undefined : ModularAccountV2>;
|
|
72
60
|
//# sourceMappingURL=installValidation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installValidation.d.ts","sourceRoot":"","sources":["../../../../src/ma-v2/decorators/installValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,SAAS,EAIf,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"installValidation.d.ts","sourceRoot":"","sources":["../../../../src/ma-v2/decorators/installValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,SAAS,EAIf,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAa7D,MAAM,MAAM,uBAAuB,CACjC,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IAClE;IACF,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,WAAW,EAAE,GAAG,CAAC;IACjB,KAAK,EAAE;QACL,UAAU,EAAE,UAAU,CAAC;QACvB,QAAQ,EAAE,GAAG,CAAC;KACf,EAAE,CAAC;CACL,GAAG,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;AAEpD,MAAM,MAAM,yBAAyB,CACnC,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IAClE;IACF,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,GAAG,CAAC;IACnB,kBAAkB,EAAE,GAAG,EAAE,CAAC;CAC3B,GAAG,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;AAEpD,MAAM,MAAM,wBAAwB,CAClC,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IAClE;IACF,uBAAuB,EAAE,CACvB,IAAI,EAAE,uBAAuB,CAAC,QAAQ,CAAC,KACpC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClB,yBAAyB,EAAE,CACzB,IAAI,EAAE,yBAAyB,CAAC,QAAQ,CAAC,KACtC,OAAO,CAAC,GAAG,CAAC,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,EAEpE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,GAC3C,wBAAwB,CACzB,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAAG,SAAS,GAAG,gBAAgB,CAClE,CA+EA"}
|
|
@@ -10,15 +10,11 @@ export type SemiModularAccountV2FactoryArgs = {
|
|
|
10
10
|
export type SemiModularAccountV2StaticImpl = StaticSmartAccountImplementation<false, "0.7", SemiModularAccountV2FactoryArgs, typeof entryPoint07Abi, typeof semiModularAccountBytecodeAbi, typeof accountFactoryAbi>;
|
|
11
11
|
/**
|
|
12
12
|
* Static implementation logic for SemiModularAccountV2.
|
|
13
|
-
*
|
|
14
|
-
* TODO(v5): update JSDoc format when doc-gen supports structs or records.
|
|
15
13
|
*/
|
|
16
14
|
export declare const semiModularAccountV2StaticImpl: SemiModularAccountV2StaticImpl;
|
|
17
15
|
export type SemiModularAccount7702StaticImpl = StaticSmartAccountImplementation<true, "0.7", SemiModularAccountV2FactoryArgs, typeof entryPoint07Abi, typeof semiModularAccountBytecodeAbi, typeof accountFactoryAbi>;
|
|
18
16
|
/**
|
|
19
17
|
* Static implementation logic for SemiModularAccount7702.
|
|
20
|
-
*
|
|
21
|
-
* TODO(v5): update JSDoc format when doc-gen supports structs or records.
|
|
22
18
|
*/
|
|
23
19
|
export declare const semiModularAccount7702StaticImpl: SemiModularAccount7702StaticImpl;
|
|
24
20
|
//# sourceMappingURL=mav2StaticImpl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mav2StaticImpl.d.ts","sourceRoot":"","sources":["../../../src/ma-v2/mav2StaticImpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,eAAe,EAAuB,MAAM,0BAA0B,CAAC;AAEhF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIhE,MAAM,MAAM,+BAA+B,GAAG;IAC5C,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,gCAAgC,CAC3E,KAAK,EACL,KAAK,EACL,+BAA+B,EAC/B,OAAO,eAAe,EACtB,OAAO,6BAA6B,EACpC,OAAO,iBAAiB,CACzB,CAAC;AAeF
|
|
1
|
+
{"version":3,"file":"mav2StaticImpl.d.ts","sourceRoot":"","sources":["../../../src/ma-v2/mav2StaticImpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,eAAe,EAAuB,MAAM,0BAA0B,CAAC;AAEhF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIhE,MAAM,MAAM,+BAA+B,GAAG;IAC5C,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,gCAAgC,CAC3E,KAAK,EACL,KAAK,EACL,+BAA+B,EAC/B,OAAO,eAAe,EACtB,OAAO,6BAA6B,EACpC,OAAO,iBAAiB,CACzB,CAAC;AAeF;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,8BAqB5C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,gCAAgC,CAC7E,IAAI,EACJ,KAAK,EACL,+BAA+B,EAC/B,OAAO,eAAe,EACtB,OAAO,6BAA6B,EACpC,OAAO,iBAAiB,CACzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,gCAI5C,CAAC"}
|
|
@@ -133,11 +133,11 @@ export declare class PermissionBuilder {
|
|
|
133
133
|
/**
|
|
134
134
|
* Compiles the deferred action typed data to sign.
|
|
135
135
|
*
|
|
136
|
-
* @returns {Promise<{typedData: DeferredActionTypedData,
|
|
136
|
+
* @returns {Promise<{typedData: DeferredActionTypedData, fullPreSignatureDeferredActionPayload: Hex}>} The deferred action typed data and the full pre-signature deferred action payload.
|
|
137
137
|
*/
|
|
138
138
|
compileDeferred(): Promise<{
|
|
139
139
|
typedData: DeferredActionTypedData;
|
|
140
|
-
|
|
140
|
+
fullPreSignatureDeferredActionPayload: Hex;
|
|
141
141
|
}>;
|
|
142
142
|
/**
|
|
143
143
|
* Compiles the raw install arguments for the installValidation function.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissionBuilder.d.ts","sourceRoot":"","sources":["../../../src/ma-v2/permissionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAKd,OAAO,EAAY,KAAK,UAAU,EAAyB,MAAM,YAAY,CAAC;AAC9E,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAe3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"permissionBuilder.d.ts","sourceRoot":"","sources":["../../../src/ma-v2/permissionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAKd,OAAO,EAAY,KAAK,UAAU,EAAyB,MAAM,YAAY,CAAC;AAC9E,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAe3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAkD7D;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;CAajB,CAAC;AAGX,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC;AAGX,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,cAAc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AiDF;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC;IAyBhC;;;;OAIG;IACG,kBAAkB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAiB5D,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,oBAAoB;IAgO5B,OAAO,CAAC,QAAQ;CAiCjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../src/ma-v2/utils/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,GAAG,EACT,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;CAKQ,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;CAME,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,GAAkB,CAAC;AAE1D,MAAM,MAAM,oBAAoB,CAC9B,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IAClE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAElC;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../src/ma-v2/utils/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,GAAG,EACT,MAAM,MA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-13,18 +13,18 @@ export declare const parseDeferredAction: (deferredAction: Hex) => {
|
|
|
13
13
|
deferredActionData: Hex;
|
|
14
14
|
hasAssociatedExecHooks: boolean;
|
|
15
15
|
};
|
|
16
|
-
export type
|
|
17
|
-
|
|
16
|
+
export type EncodeDeferredActionWithSignatureParams = {
|
|
17
|
+
fullPreSignatureDeferredActionPayload: Hex;
|
|
18
18
|
sig: Hex;
|
|
19
19
|
signaturePrefix?: SignaturePrefix;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Encodes the deferred action with its signature, producing the payload to prepend to the userOp signature.
|
|
23
23
|
*
|
|
24
24
|
* Assumption: The client this extends is used to sign the typed data.
|
|
25
25
|
*
|
|
26
|
-
* @param {
|
|
27
|
-
* @returns {Hex} The encoded
|
|
26
|
+
* @param {EncodeDeferredActionWithSignatureParams} params - The parameters for encoding the deferred action with its signature.
|
|
27
|
+
* @returns {Hex} The encoded payload to be prepended to the userOp signature.
|
|
28
28
|
*/
|
|
29
|
-
export declare const
|
|
29
|
+
export declare const encodeDeferredActionWithSignature: ({ fullPreSignatureDeferredActionPayload, sig, }: EncodeDeferredActionWithSignatureParams) => Hex;
|
|
30
30
|
//# sourceMappingURL=deferredActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferredActions.d.ts","sourceRoot":"","sources":["../../../../src/ma-v2/utils/deferredActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,GAAG,EACT,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,gBAAgB,GAAG,KAClB;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,GAAG,CAAC;IACxB,sBAAsB,EAAE,OAAO,CAAC;CAWjC,CAAC;AAEF,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"deferredActions.d.ts","sourceRoot":"","sources":["../../../../src/ma-v2/utils/deferredActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,GAAG,EACT,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,gBAAgB,GAAG,KAClB;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,GAAG,CAAC;IACxB,sBAAsB,EAAE,OAAO,CAAC;CAWjC,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD,qCAAqC,EAAE,GAAG,CAAC;IAC3C,GAAG,EAAE,GAAG,CAAC;IACT,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,GAAI,iDAG/C,uCAAuC,KAAG,GAY5C,CAAC"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "5.0.0-beta.
|
|
1
|
+
export declare const VERSION = "5.0.0-beta.30";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alchemy/smart-accounts",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.31",
|
|
4
4
|
"description": "This package contains all of the viem interfaces for Alchemy's Smart Contract Accounts",
|
|
5
5
|
"author": "Alchemy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"prebuild": "tsx ./inject-version.ts",
|
|
34
|
-
"build": "
|
|
34
|
+
"build": "pnpm run clean && pnpm run build:esm && pnpm run build:types",
|
|
35
35
|
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm",
|
|
36
36
|
"build:types": "tsc --project tsconfig.build.json --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
|
|
37
37
|
"clean": "rm -rf ./dist",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"test:run": "vitest run"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@alchemy/aa-infra": "
|
|
43
|
-
"typescript-template": "
|
|
42
|
+
"@alchemy/aa-infra": "5.0.0-beta.31",
|
|
43
|
+
"typescript-template": "workspace:*",
|
|
44
44
|
"viem": "^2.45.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@alchemy/common": "
|
|
47
|
+
"@alchemy/common": "5.0.0-beta.31"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"viem": "^2.45.0"
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "1ad684c12e9a610b13b521a4831dc33948c4ef7b"
|
|
65
65
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,16 +7,6 @@ export { toLightAccount } from "./light-account/accounts/account.js";
|
|
|
7
7
|
export type * from "./light-account/accounts/multi-owner-account.js";
|
|
8
8
|
export { toMultiOwnerLightAccount } from "./light-account/accounts/multi-owner-account.js";
|
|
9
9
|
|
|
10
|
-
// TODO(v5): Something to consider for v5 - can we cut the exports for the account-specific actions
|
|
11
|
-
// from the public interface, and just consume these internally with account + rely on the standard
|
|
12
|
-
// bundlerClient actions for performing state writes (i.e. rotating owners)? I'm not sure it's useful
|
|
13
|
-
// to consumers outside of attaching to instances of a client with the right action.
|
|
14
|
-
export type * from "./light-account/decorators/singleOwner.js";
|
|
15
|
-
export { singleOwnerLightAccountActions } from "./light-account/decorators/singleOwner.js";
|
|
16
|
-
|
|
17
|
-
export type * from "./light-account/decorators/multiOwner.js";
|
|
18
|
-
export { multiOwnerLightAccountActions } from "./light-account/decorators/multiOwner.js";
|
|
19
|
-
|
|
20
10
|
export type * from "./light-account/predictAddress.js";
|
|
21
11
|
export {
|
|
22
12
|
predictLightAccountAddress,
|
|
@@ -52,9 +42,6 @@ export { toModularAccountV1Base } from "./ma-v1/accounts/base.js";
|
|
|
52
42
|
export type * from "./ma-v1/accounts/multi-owner-account.js";
|
|
53
43
|
export { toMultiOwnerModularAccountV1 } from "./ma-v1/accounts/multi-owner-account.js";
|
|
54
44
|
|
|
55
|
-
export type * from "./ma-v1/decorators/multiOwner.js";
|
|
56
|
-
export { multiOwnerModularAccountV1Actions } from "./ma-v1/decorators/multiOwner.js";
|
|
57
|
-
|
|
58
45
|
export type * from "./ma-v1/predictAddress.js";
|
|
59
46
|
export { predictMultiOwnerModularAccountV1Address } from "./ma-v1/predictAddress.js";
|
|
60
47
|
|
|
@@ -127,7 +114,7 @@ export {
|
|
|
127
114
|
export type * from "./ma-v2/utils/deferredActions.js";
|
|
128
115
|
export {
|
|
129
116
|
parseDeferredAction,
|
|
130
|
-
|
|
117
|
+
encodeDeferredActionWithSignature,
|
|
131
118
|
} from "./ma-v2/utils/deferredActions.js";
|
|
132
119
|
|
|
133
120
|
export type * from "./ma-v2/utils/hooks.js";
|
|
@@ -128,7 +128,6 @@ export async function toLightAccountBase<
|
|
|
128
128
|
).map((x) => x.accountImplementation);
|
|
129
129
|
|
|
130
130
|
const getStorageAtAction = getAction(client, getStorageAt, "getStorageAt");
|
|
131
|
-
// TODO(v5): This is a super fragile workflow, and we should consider not supporting this on the SmartAccount level in v5.
|
|
132
131
|
const storage = await getStorageAtAction({
|
|
133
132
|
address: accountAddress,
|
|
134
133
|
slot: EIP1967_PROXY_IMPL_STORAGE_SLOT,
|
|
@@ -19,10 +19,6 @@ import { BaseError } from "@alchemy/common";
|
|
|
19
19
|
* @returns {Hex} The encoded calldata.
|
|
20
20
|
*/
|
|
21
21
|
export function encodeCallsLA(calls: readonly Call[]): Hex {
|
|
22
|
-
if (!calls.length) {
|
|
23
|
-
throw new BaseError("No calls to encode.");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
22
|
if (calls.length === 1) {
|
|
27
23
|
return encodeFunctionData({
|
|
28
24
|
abi: LightAccountAbi_v1,
|
|
@@ -6,12 +6,6 @@ import type { LightAccountBase } from "./accounts/base.js";
|
|
|
6
6
|
import type { LightAccountType, LightAccountVersion } from "./registry.js";
|
|
7
7
|
import { AccountVersionRegistry } from "./registry.js";
|
|
8
8
|
|
|
9
|
-
// TODO(v5): The pattern of getDefaultXYZAddress(…) doesn’t really make sense as a standalone.
|
|
10
|
-
// We built this expecting lots of diverging addresses per chain, but in practice we have none
|
|
11
|
-
// (and we’ve turned down things that require this). Instead: we could build the
|
|
12
|
-
// default-but-overridable behavior into the consuming functions themselves (i.e.
|
|
13
|
-
// createLightAccount defaulting to a factory address, but make it overridable)
|
|
14
|
-
|
|
15
9
|
/**
|
|
16
10
|
* Get the default light account version for the given light account type
|
|
17
11
|
*
|
|
@@ -160,7 +160,7 @@ export async function toModularAccountV1Base<
|
|
|
160
160
|
);
|
|
161
161
|
const { type, data } = await prepareSignature({
|
|
162
162
|
type: "eth_signTypedData_v4",
|
|
163
|
-
data: params as TypedDataDefinition,
|
|
163
|
+
data: params as TypedDataDefinition,
|
|
164
164
|
});
|
|
165
165
|
return type === "personal_sign"
|
|
166
166
|
? signMessageAction({ account: owner, message: data })
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
type Hex,
|
|
7
7
|
} from "viem";
|
|
8
8
|
import { IStandardExecutorAbi } from "../abis/IStandardExecutor.js";
|
|
9
|
-
import { BaseError } from "@alchemy/common";
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Encodes an array of calls into ModularAccountV1 calldata for `execute` or `executeBatch`.
|
|
@@ -17,10 +16,6 @@ import { BaseError } from "@alchemy/common";
|
|
|
17
16
|
* @returns {Hex} The encoded calldata.
|
|
18
17
|
*/
|
|
19
18
|
export function encodeCallsMAv1(calls: readonly Call[]): Hex {
|
|
20
|
-
if (!calls.length) {
|
|
21
|
-
throw new BaseError("No calls to encode.");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
19
|
if (calls.length === 1) {
|
|
25
20
|
return encodeFunctionData({
|
|
26
21
|
abi: IStandardExecutorAbi,
|
|
@@ -14,8 +14,6 @@ export type MultiOwnerModularAccountV1FactoryArgs = {
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Static implementation logic for ModularAccountV1.
|
|
17
|
-
*
|
|
18
|
-
* TODO(v5): update JSDoc format when doc-gen supports structs or records.
|
|
19
17
|
*/
|
|
20
18
|
export const multiOwnerModularAccountStaticImpl: StaticSmartAccountImplementation<
|
|
21
19
|
false,
|
|
@@ -27,7 +27,7 @@ import { LOGGER } from "../../logger.js";
|
|
|
27
27
|
|
|
28
28
|
type Mode = "default" | "7702";
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// This may be extended in the future with additional MAv2-specific methods.
|
|
31
31
|
export type ModularAccountV2 = ModularAccountV2Base & {};
|
|
32
32
|
|
|
33
33
|
export type ToModularAccountV2Params<
|
|
@@ -65,6 +65,45 @@ export type ToModularAccountV2Params<
|
|
|
65
65
|
*
|
|
66
66
|
* @param {ToModularAccountV2Params} param0 - The parameters for creating a MAv2 account.
|
|
67
67
|
* @returns {Promise<ModularAccountV2>} A MAv2 account.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* import { createPublicClient } from "viem";
|
|
72
|
+
* import { createBundlerClient, createPaymasterClient } from "viem/account-abstraction";
|
|
73
|
+
* import { sepolia } from "viem/chains";
|
|
74
|
+
* import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
|
|
75
|
+
* import { alchemyTransport } from "@alchemy/common";
|
|
76
|
+
* import { estimateFeesPerGas } from "@alchemy/aa-infra";
|
|
77
|
+
* import { toModularAccountV2 } from "@alchemy/smart-accounts";
|
|
78
|
+
*
|
|
79
|
+
* const transport = alchemyTransport({ apiKey: "YOUR_API_KEY" });
|
|
80
|
+
*
|
|
81
|
+
* // 1. Create a MAv2 smart account
|
|
82
|
+
* const account = await toModularAccountV2({
|
|
83
|
+
* client: createPublicClient({ chain: sepolia, transport }),
|
|
84
|
+
* owner: privateKeyToAccount(generatePrivateKey()),
|
|
85
|
+
* });
|
|
86
|
+
*
|
|
87
|
+
* // 2. Create a bundler client with the account
|
|
88
|
+
* const bundlerClient = createBundlerClient({
|
|
89
|
+
* account,
|
|
90
|
+
* chain: sepolia,
|
|
91
|
+
* transport,
|
|
92
|
+
* userOperation: {
|
|
93
|
+
* estimateFeesPerGas,
|
|
94
|
+
* },
|
|
95
|
+
* // Optional: sponsor gas with a paymaster
|
|
96
|
+
* paymaster: createPaymasterClient({ transport }),
|
|
97
|
+
* paymasterContext: { policyId: "YOUR_POLICY_ID" },
|
|
98
|
+
* });
|
|
99
|
+
*
|
|
100
|
+
* // 3. Send a user operation
|
|
101
|
+
* const hash = await bundlerClient.sendUserOperation({
|
|
102
|
+
* calls: [{ to: "0x...", value: 0n, data: "0x" }],
|
|
103
|
+
* });
|
|
104
|
+
*
|
|
105
|
+
* const receipt = await bundlerClient.waitForUserOperationReceipt({ hash });
|
|
106
|
+
* ```
|
|
68
107
|
*/
|
|
69
108
|
export async function toModularAccountV2<TMode extends Mode = Mode>({
|
|
70
109
|
client,
|
|
@@ -193,6 +232,6 @@ export async function toModularAccountV2<TMode extends Mode = Mode>({
|
|
|
193
232
|
|
|
194
233
|
return {
|
|
195
234
|
...base,
|
|
196
|
-
//
|
|
235
|
+
// This may be extended in the future with additional MAv2-specific methods.
|
|
197
236
|
};
|
|
198
237
|
}
|
|
@@ -380,7 +380,7 @@ export async function toModularAccountV2Base<
|
|
|
380
380
|
|
|
381
381
|
const { data } = await prepareSignature({
|
|
382
382
|
type: "eth_signTypedData_v4",
|
|
383
|
-
data: td as TypedDataDefinition,
|
|
383
|
+
data: td as TypedDataDefinition,
|
|
384
384
|
});
|
|
385
385
|
|
|
386
386
|
const action = getAction(client, signTypedData, "signTypedData");
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
import { sliceHex } from "viem/utils";
|
|
9
9
|
import { modularAccountAbi } from "../abis/modularAccountAbi.js";
|
|
10
10
|
import { EXECUTE_USER_OP_SELECTOR } from "../utils/account.js";
|
|
11
|
-
import { BaseError } from "@alchemy/common";
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Encodes an array of calls into ModularAccountV2 calldata for `execute` or `executeBatch`.
|
|
@@ -19,10 +18,6 @@ import { BaseError } from "@alchemy/common";
|
|
|
19
18
|
* @returns {Hex} The encoded calldata.
|
|
20
19
|
*/
|
|
21
20
|
export function encodeCallsMAv2(calls: readonly Call[]): Hex {
|
|
22
|
-
if (!calls.length) {
|
|
23
|
-
throw new BaseError("No calls to encode.");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
21
|
if (calls.length === 1) {
|
|
27
22
|
return encodeFunctionData({
|
|
28
23
|
abi: modularAccountAbi,
|
|
@@ -45,7 +45,7 @@ export type CreateDeferredActionTypedDataParams = {
|
|
|
45
45
|
nonce: bigint;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
export type
|
|
48
|
+
export type BuildPreSignatureDeferredActionPayloadParams = {
|
|
49
49
|
typedData: DeferredActionTypedData;
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -60,8 +60,8 @@ export type DeferralActions = {
|
|
|
60
60
|
createDeferredActionTypedDataObject: (
|
|
61
61
|
args: CreateDeferredActionTypedDataParams,
|
|
62
62
|
) => Promise<DeferredActionReturnData>;
|
|
63
|
-
|
|
64
|
-
args:
|
|
63
|
+
buildPreSignatureDeferredActionPayload: (
|
|
64
|
+
args: BuildPreSignatureDeferredActionPayloadParams,
|
|
65
65
|
) => Hex;
|
|
66
66
|
getEntityIdAndNonce: (
|
|
67
67
|
args: EntityIdAndNonceParams,
|
|
@@ -72,7 +72,7 @@ export type DeferralActions = {
|
|
|
72
72
|
* Provides deferred action functionalities for a MA v2 client, ensuring compatibility with `SmartAccountClient`.
|
|
73
73
|
*
|
|
74
74
|
* @param {ModularAccountV2Client} client - The client instance which provides account and sendUserOperation functionality.
|
|
75
|
-
* @returns {object} - An object containing three methods: `createDeferredActionTypedDataObject`, `
|
|
75
|
+
* @returns {object} - An object containing three methods: `createDeferredActionTypedDataObject`, `buildPreSignatureDeferredActionPayload`, and `buildUserOperationWithDeferredAction`.
|
|
76
76
|
*/
|
|
77
77
|
export const deferralActions = <
|
|
78
78
|
TTransport extends Transport = Transport,
|
|
@@ -114,9 +114,9 @@ export const deferralActions = <
|
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
const
|
|
117
|
+
const buildPreSignatureDeferredActionPayload = ({
|
|
118
118
|
typedData,
|
|
119
|
-
}:
|
|
119
|
+
}: BuildPreSignatureDeferredActionPayloadParams): Hex => {
|
|
120
120
|
const account = client.account;
|
|
121
121
|
if (!account || !isModularAccountV2(account)) {
|
|
122
122
|
throw new AccountNotFoundError();
|
|
@@ -187,7 +187,7 @@ export const deferralActions = <
|
|
|
187
187
|
|
|
188
188
|
return {
|
|
189
189
|
createDeferredActionTypedDataObject,
|
|
190
|
-
|
|
190
|
+
buildPreSignatureDeferredActionPayload,
|
|
191
191
|
getEntityIdAndNonce,
|
|
192
192
|
};
|
|
193
193
|
};
|