@account-kit/smart-contracts 4.34.1 → 4.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/plugindefs/session-key/config.js.map +1 -1
- package/dist/esm/src/light-account/accounts/account.js.map +1 -1
- package/dist/esm/src/light-account/accounts/base.js.map +1 -1
- package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/esm/src/light-account/accounts/predictAddress.js.map +1 -1
- package/dist/esm/src/light-account/actions/transferOwnership.d.ts +1 -1
- package/dist/esm/src/light-account/actions/transferOwnership.js.map +1 -1
- package/dist/esm/src/light-account/actions/updateOwners.js.map +1 -1
- package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/client.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerLightAccount.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.js.map +1 -1
- package/dist/esm/src/light-account/utils.d.ts +1 -1
- package/dist/esm/src/light-account/utils.js.map +1 -1
- package/dist/esm/src/ma-v2/account/common/modularAccountV2Base.js.map +1 -1
- package/dist/esm/src/ma-v2/account/modularAccountV2.js.map +1 -1
- package/dist/esm/src/ma-v2/account/nativeSMASigner.d.ts +2 -207
- package/dist/esm/src/ma-v2/account/nativeSMASigner.js +7 -4
- package/dist/esm/src/ma-v2/account/nativeSMASigner.js.map +1 -1
- package/dist/esm/src/ma-v2/account/predictAddress.js.map +1 -1
- package/dist/esm/src/ma-v2/actions/deferralActions.js.map +1 -1
- package/dist/esm/src/ma-v2/actions/install-validation/installValidation.js.map +1 -1
- package/dist/esm/src/ma-v2/client/client.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/allowlist-module/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/native-token-limit-module/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/paymaster-guard-module/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/single-signer-validation/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.d.ts +2 -207
- package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js +7 -4
- package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/time-range-module/module.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/utils.js.map +1 -1
- package/dist/esm/src/ma-v2/modules/webauthn-validation/module.js.map +1 -1
- package/dist/esm/src/ma-v2/permissionBuilder.js.map +1 -1
- package/dist/esm/src/ma-v2/permissionBuilderErrors.js +1 -1
- package/dist/esm/src/ma-v2/permissionBuilderErrors.js.map +1 -1
- package/dist/esm/src/ma-v2/utils.js.map +1 -1
- package/dist/esm/src/msca/account/multiOwnerAccount.js.map +1 -1
- package/dist/esm/src/msca/account/multisigAccount.d.ts +1 -1
- package/dist/esm/src/msca/account/multisigAccount.js.map +1 -1
- package/dist/esm/src/msca/account-loupe/decorator.js.map +1 -1
- package/dist/esm/src/msca/account-loupe/types.js.map +1 -1
- package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/esm/src/msca/client/client.js.map +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/esm/src/msca/plugin-manager/decorator.js.map +1 -1
- package/dist/esm/src/msca/plugin-manager/installPlugin.js.map +1 -1
- package/dist/esm/src/msca/plugin-manager/uninstallPlugin.js.map +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/extension.js.map +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/plugin.js.map +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/signer.d.ts +3 -208
- package/dist/esm/src/msca/plugins/multi-owner/signer.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/getThreshold.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/isOwnerOf.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/readOwners.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/extension.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/plugin.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/signer.d.ts +3 -208
- package/dist/esm/src/msca/plugins/multisig/signer.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/types.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/getSignerType.d.ts +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/extension.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/plugin.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/signer.d.ts +4 -209
- package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/utils.js.map +1 -1
- package/dist/esm/src/msca/plugins/types.js.map +1 -1
- package/dist/esm/src/msca/utils.js.map +1 -1
- package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
- package/dist/types/src/light-account/actions/transferOwnership.d.ts +1 -1
- package/dist/types/src/light-account/actions/transferOwnership.d.ts.map +1 -1
- package/dist/types/src/light-account/actions/updateOwners.d.ts.map +1 -1
- package/dist/types/src/light-account/types.d.ts.map +1 -1
- package/dist/types/src/light-account/utils.d.ts +1 -1
- package/dist/types/src/light-account/utils.d.ts.map +1 -1
- package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts +2 -207
- package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts.map +1 -1
- package/dist/types/src/ma-v2/modules/allowlist-module/module.d.ts.map +1 -1
- package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts +2 -207
- package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts.map +1 -1
- package/dist/types/src/ma-v2/modules/utils.d.ts.map +1 -1
- package/dist/types/src/ma-v2/permissionBuilderErrors.d.ts.map +1 -1
- package/dist/types/src/ma-v2/utils.d.ts.map +1 -1
- package/dist/types/src/msca/account/multisigAccount.d.ts +1 -1
- package/dist/types/src/msca/account/multisigAccount.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/decorator.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/installPlugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/uninstallPlugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multi-owner/plugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multi-owner/signer.d.ts +3 -208
- package/dist/types/src/msca/plugins/multi-owner/signer.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/actions/proposeUserOperation.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/plugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/signer.d.ts +3 -208
- package/dist/types/src/msca/plugins/multisig/signer.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/types.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/extension.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/plugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts +4 -209
- package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
- package/dist/types/src/msca/utils.d.ts.map +1 -1
- package/package.json +7 -9
- package/plugindefs/session-key/config.ts +1 -1
- package/src/light-account/accounts/account.ts +7 -5
- package/src/light-account/accounts/base.ts +18 -15
- package/src/light-account/accounts/multiOwner.ts +9 -6
- package/src/light-account/accounts/predictAddress.ts +5 -5
- package/src/light-account/actions/transferOwnership.ts +5 -4
- package/src/light-account/actions/updateOwners.ts +6 -5
- package/src/light-account/clients/alchemyClient.ts +3 -3
- package/src/light-account/clients/client.ts +6 -6
- package/src/light-account/clients/multiOwnerAlchemyClient.ts +3 -3
- package/src/light-account/clients/multiOwnerLightAccount.ts +7 -7
- package/src/light-account/decorators/lightAccount.ts +4 -4
- package/src/light-account/decorators/multiOwnerLightAccount.ts +4 -4
- package/src/light-account/types.ts +3 -2
- package/src/light-account/utils.ts +10 -10
- package/src/ma-v2/account/common/modularAccountV2Base.ts +8 -8
- package/src/ma-v2/account/modularAccountV2.ts +4 -4
- package/src/ma-v2/account/nativeSMASigner.ts +16 -13
- package/src/ma-v2/account/predictAddress.ts +13 -13
- package/src/ma-v2/actions/deferralActions.ts +7 -7
- package/src/ma-v2/actions/install-validation/installValidation.ts +14 -14
- package/src/ma-v2/client/client.ts +8 -8
- package/src/ma-v2/modules/allowlist-module/module.ts +5 -5
- package/src/ma-v2/modules/native-token-limit-module/module.ts +1 -1
- package/src/ma-v2/modules/paymaster-guard-module/module.ts +2 -2
- package/src/ma-v2/modules/single-signer-validation/module.ts +2 -2
- package/src/ma-v2/modules/single-signer-validation/signer.ts +14 -11
- package/src/ma-v2/modules/time-range-module/module.ts +6 -6
- package/src/ma-v2/modules/utils.ts +4 -4
- package/src/ma-v2/modules/webauthn-validation/module.ts +2 -2
- package/src/ma-v2/permissionBuilder.ts +14 -14
- package/src/ma-v2/permissionBuilderErrors.ts +9 -7
- package/src/ma-v2/utils.ts +4 -4
- package/src/msca/account/multiOwnerAccount.ts +5 -5
- package/src/msca/account/multisigAccount.ts +6 -6
- package/src/msca/account-loupe/decorator.ts +11 -11
- package/src/msca/account-loupe/types.ts +1 -1
- package/src/msca/client/alchemyClient.ts +4 -4
- package/src/msca/client/client.ts +12 -12
- package/src/msca/client/multiSigAlchemyClient.ts +4 -4
- package/src/msca/plugin-manager/decorator.ts +6 -5
- package/src/msca/plugin-manager/installPlugin.ts +8 -7
- package/src/msca/plugin-manager/uninstallPlugin.ts +6 -5
- package/src/msca/plugins/multi-owner/extension.ts +10 -10
- package/src/msca/plugins/multi-owner/plugin.ts +21 -19
- package/src/msca/plugins/multi-owner/signer.ts +4 -4
- package/src/msca/plugins/multisig/actions/getThreshold.ts +3 -3
- package/src/msca/plugins/multisig/actions/isOwnerOf.ts +2 -2
- package/src/msca/plugins/multisig/actions/proposeUserOperation.ts +4 -3
- package/src/msca/plugins/multisig/actions/readOwners.ts +3 -3
- package/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts +5 -5
- package/src/msca/plugins/multisig/extension.ts +16 -16
- package/src/msca/plugins/multisig/middleware.ts +2 -2
- package/src/msca/plugins/multisig/plugin.ts +21 -19
- package/src/msca/plugins/multisig/signer.ts +5 -5
- package/src/msca/plugins/multisig/types.ts +4 -2
- package/src/msca/plugins/multisig/utils/formatSignatures.ts +1 -1
- package/src/msca/plugins/multisig/utils/getSignerType.ts +2 -2
- package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +7 -6
- package/src/msca/plugins/session-key/extension.ts +16 -14
- package/src/msca/plugins/session-key/permissions.ts +7 -7
- package/src/msca/plugins/session-key/plugin.ts +30 -28
- package/src/msca/plugins/session-key/signer.ts +5 -5
- package/src/msca/plugins/session-key/utils.ts +4 -4
- package/src/msca/plugins/types.ts +1 -1
- package/src/msca/utils.ts +11 -11
|
@@ -28,7 +28,7 @@ import { type AlchemyLightAccountClientConfig } from "./alchemyClient.js";
|
|
|
28
28
|
export type CreateLightAccountClientParams<
|
|
29
29
|
TTransport extends Transport | AlchemyTransport = Transport,
|
|
30
30
|
TChain extends Chain | undefined = Chain | undefined,
|
|
31
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
31
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
32
32
|
> = {
|
|
33
33
|
transport: CreateLightAccountParams<TTransport, TSigner>["transport"];
|
|
34
34
|
chain: CreateLightAccountParams<TTransport, TSigner>["chain"];
|
|
@@ -39,11 +39,11 @@ export type CreateLightAccountClientParams<
|
|
|
39
39
|
>;
|
|
40
40
|
|
|
41
41
|
export function createLightAccountClient<
|
|
42
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
42
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
43
43
|
>(
|
|
44
44
|
params: AlchemyLightAccountClientConfig<TSigner> & {
|
|
45
45
|
transport: AlchemyTransport;
|
|
46
|
-
}
|
|
46
|
+
},
|
|
47
47
|
): Promise<
|
|
48
48
|
AlchemySmartAccountClient<
|
|
49
49
|
Chain | undefined,
|
|
@@ -54,10 +54,10 @@ export function createLightAccountClient<
|
|
|
54
54
|
export function createLightAccountClient<
|
|
55
55
|
TChain extends Chain | undefined = Chain | undefined,
|
|
56
56
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
57
|
-
TTransport extends Transport = Transport
|
|
57
|
+
TTransport extends Transport = Transport,
|
|
58
58
|
>(
|
|
59
59
|
args: CreateLightAccountClientParams<TTransport, TChain, TSigner> &
|
|
60
|
-
NotType<TTransport, AlchemyTransport
|
|
60
|
+
NotType<TTransport, AlchemyTransport>,
|
|
61
61
|
): Promise<
|
|
62
62
|
SmartAccountClient<
|
|
63
63
|
CustomTransport,
|
|
@@ -104,7 +104,7 @@ export function createLightAccountClient<
|
|
|
104
104
|
* @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` object containing the created account information and methods
|
|
105
105
|
*/
|
|
106
106
|
export async function createLightAccountClient(
|
|
107
|
-
params: CreateLightAccountClientParams
|
|
107
|
+
params: CreateLightAccountClientParams,
|
|
108
108
|
): Promise<SmartAccountClient | AlchemySmartAccountClient> {
|
|
109
109
|
const { transport, chain } = params;
|
|
110
110
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { type Chain } from "viem";
|
|
13
13
|
|
|
14
14
|
export type AlchemyMultiOwnerLightAccountClientConfig<
|
|
15
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
15
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
16
16
|
> = Omit<
|
|
17
17
|
CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>,
|
|
18
18
|
"transport" | "type"
|
|
@@ -23,9 +23,9 @@ export type AlchemyMultiOwnerLightAccountClientConfig<
|
|
|
23
23
|
>;
|
|
24
24
|
|
|
25
25
|
export async function createMultiOwnerLightAccountAlchemyClient<
|
|
26
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
26
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
27
27
|
>(
|
|
28
|
-
params: AlchemyMultiOwnerLightAccountClientConfig<TSigner
|
|
28
|
+
params: AlchemyMultiOwnerLightAccountClientConfig<TSigner>,
|
|
29
29
|
): Promise<
|
|
30
30
|
AlchemySmartAccountClient<
|
|
31
31
|
Chain | undefined,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
export type CreateMultiOwnerLightAccountClientParams<
|
|
27
27
|
TTransport extends Transport = Transport,
|
|
28
28
|
TChain extends Chain | undefined = Chain | undefined,
|
|
29
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
29
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
30
30
|
> = {
|
|
31
31
|
transport: CreateMultiOwnerLightAccountParams<
|
|
32
32
|
TTransport,
|
|
@@ -45,7 +45,7 @@ export type CreateMultiOwnerLightAccountClientParams<
|
|
|
45
45
|
export type CreateMultiOwnerLightAccountClientDynamicTransportParams<
|
|
46
46
|
TTransport extends Transport = Transport,
|
|
47
47
|
TChain extends Chain | undefined = Chain | undefined,
|
|
48
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
48
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
49
49
|
> =
|
|
50
50
|
| (AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {
|
|
51
51
|
transport: AlchemyTransport;
|
|
@@ -53,11 +53,11 @@ export type CreateMultiOwnerLightAccountClientDynamicTransportParams<
|
|
|
53
53
|
| CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner>;
|
|
54
54
|
|
|
55
55
|
export async function createMultiOwnerLightAccountClient<
|
|
56
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
56
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
57
57
|
>(
|
|
58
58
|
params: AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {
|
|
59
59
|
transport: AlchemyTransport;
|
|
60
|
-
}
|
|
60
|
+
},
|
|
61
61
|
): Promise<
|
|
62
62
|
AlchemySmartAccountClient<
|
|
63
63
|
Chain | undefined,
|
|
@@ -69,10 +69,10 @@ export async function createMultiOwnerLightAccountClient<
|
|
|
69
69
|
export function createMultiOwnerLightAccountClient<
|
|
70
70
|
TTransport extends Transport = Transport,
|
|
71
71
|
TChain extends Chain | undefined = Chain | undefined,
|
|
72
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
72
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
73
73
|
>(
|
|
74
74
|
args: CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner> &
|
|
75
|
-
NotType<TTransport, AlchemyTransport
|
|
75
|
+
NotType<TTransport, AlchemyTransport>,
|
|
76
76
|
): Promise<
|
|
77
77
|
SmartAccountClient<
|
|
78
78
|
CustomTransport,
|
|
@@ -123,7 +123,7 @@ export function createMultiOwnerLightAccountClient<
|
|
|
123
123
|
* @returns {Promise<SmartAccountClient>} a promise that resolves to a `SmartAccountClient` containing the created account client and relevant methods
|
|
124
124
|
*/
|
|
125
125
|
export async function createMultiOwnerLightAccountClient(
|
|
126
|
-
params: CreateMultiOwnerLightAccountClientDynamicTransportParams
|
|
126
|
+
params: CreateMultiOwnerLightAccountClientDynamicTransportParams,
|
|
127
127
|
): Promise<SmartAccountClient | AlchemySmartAccountClient> {
|
|
128
128
|
const { transport, chain } = params;
|
|
129
129
|
|
|
@@ -10,10 +10,10 @@ export type LightAccountClientActions<
|
|
|
10
10
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
11
11
|
TAccount extends LightAccount<TSigner> | undefined =
|
|
12
12
|
| LightAccount<TSigner>
|
|
13
|
-
| undefined
|
|
13
|
+
| undefined,
|
|
14
14
|
> = {
|
|
15
15
|
transferOwnership: (
|
|
16
|
-
args: TransferLightAccountOwnershipParams<TSigner, TAccount
|
|
16
|
+
args: TransferLightAccountOwnershipParams<TSigner, TAccount>,
|
|
17
17
|
) => Promise<Hex>;
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -42,9 +42,9 @@ export const lightAccountClientActions: <
|
|
|
42
42
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
43
43
|
TAccount extends LightAccount<TSigner> | undefined =
|
|
44
44
|
| LightAccount<TSigner>
|
|
45
|
-
| undefined
|
|
45
|
+
| undefined,
|
|
46
46
|
>(
|
|
47
|
-
client: Client<TTransport, TChain, TAccount
|
|
47
|
+
client: Client<TTransport, TChain, TAccount>,
|
|
48
48
|
) => LightAccountClientActions<TSigner, TAccount> = (client) => ({
|
|
49
49
|
transferOwnership: async (args) => transferOwnership(client, args),
|
|
50
50
|
});
|
|
@@ -10,10 +10,10 @@ export type MultiOwnerLightAccountClientActions<
|
|
|
10
10
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
11
11
|
TAccount extends MultiOwnerLightAccount<TSigner> | undefined =
|
|
12
12
|
| MultiOwnerLightAccount<TSigner>
|
|
13
|
-
| undefined
|
|
13
|
+
| undefined,
|
|
14
14
|
> = {
|
|
15
15
|
updateOwners: (
|
|
16
|
-
args: UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount
|
|
16
|
+
args: UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount>,
|
|
17
17
|
) => Promise<Hex>;
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -42,9 +42,9 @@ export const multiOwnerLightAccountClientActions: <
|
|
|
42
42
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
43
43
|
TAccount extends MultiOwnerLightAccount<TSigner> | undefined =
|
|
44
44
|
| MultiOwnerLightAccount<TSigner>
|
|
45
|
-
| undefined
|
|
45
|
+
| undefined,
|
|
46
46
|
>(
|
|
47
|
-
client: Client<TTransport, TChain, TAccount
|
|
47
|
+
client: Client<TTransport, TChain, TAccount>,
|
|
48
48
|
) => MultiOwnerLightAccountClientActions<TSigner, TAccount> = (client) => ({
|
|
49
49
|
updateOwners: async (args) => updateOwners(client, args),
|
|
50
50
|
});
|
|
@@ -9,7 +9,7 @@ import type { LightAccountBase } from "./accounts/base";
|
|
|
9
9
|
export type LightAccountType = "LightAccount" | "MultiOwnerLightAccount";
|
|
10
10
|
|
|
11
11
|
export type LightAccountVersionConfig<
|
|
12
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
12
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
13
13
|
> = {
|
|
14
14
|
entryPointVersion: TEntryPointVersion;
|
|
15
15
|
addresses: {
|
|
@@ -47,7 +47,8 @@ export type GetLightAccountType<TAccount extends LightAccountBase> =
|
|
|
47
47
|
|
|
48
48
|
export type LightAccountEntryPointVersion<
|
|
49
49
|
TLightAccountType extends LightAccountType,
|
|
50
|
-
TLightAccountVersion extends
|
|
50
|
+
TLightAccountVersion extends
|
|
51
|
+
LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>,
|
|
51
52
|
> = LightAccountVersionConfigs[TLightAccountType][TLightAccountVersion] extends LightAccountVersionConfig
|
|
52
53
|
? LightAccountVersionConfigs[TLightAccountType][TLightAccountVersion]["entryPointVersion"]
|
|
53
54
|
: never;
|
|
@@ -77,7 +77,7 @@ export const AccountVersionRegistry: LightAccountVersionConfigs = {
|
|
|
77
77
|
* @returns {LightAccountVersion<TLightAccountType>} the default version for the given light account type
|
|
78
78
|
*/
|
|
79
79
|
export const defaultLightAccountVersion = <
|
|
80
|
-
TLightAccountType extends LightAccountType
|
|
80
|
+
TLightAccountType extends LightAccountType,
|
|
81
81
|
>(): LightAccountVersion<TLightAccountType> => "v2.0.0";
|
|
82
82
|
|
|
83
83
|
/**
|
|
@@ -90,7 +90,7 @@ export const defaultLightAccountVersion = <
|
|
|
90
90
|
*/
|
|
91
91
|
export const getDefaultLightAccountFactoryAddress = (
|
|
92
92
|
chain: Chain,
|
|
93
|
-
version: LightAccountVersion<"LightAccount"
|
|
93
|
+
version: LightAccountVersion<"LightAccount">,
|
|
94
94
|
): Address => {
|
|
95
95
|
return (
|
|
96
96
|
AccountVersionRegistry.LightAccount[version].addresses.overrides?.[chain.id]
|
|
@@ -108,7 +108,7 @@ export const getDefaultLightAccountFactoryAddress = (
|
|
|
108
108
|
*/
|
|
109
109
|
export const getDefaultMultiOwnerLightAccountFactoryAddress = (
|
|
110
110
|
chain: Chain,
|
|
111
|
-
version: LightAccountVersion<"MultiOwnerLightAccount"
|
|
111
|
+
version: LightAccountVersion<"MultiOwnerLightAccount">,
|
|
112
112
|
) => {
|
|
113
113
|
return (
|
|
114
114
|
AccountVersionRegistry.MultiOwnerLightAccount[version].addresses
|
|
@@ -139,7 +139,7 @@ export const LightAccountUnsupported1271Factories = new Set(
|
|
|
139
139
|
LightAccountUnsupported1271Impls.map((x) => [
|
|
140
140
|
x.addresses.default.factory,
|
|
141
141
|
...Object.values(x.addresses.overrides ?? {}).map((z) => z.factory),
|
|
142
|
-
]).flat()
|
|
142
|
+
]).flat(),
|
|
143
143
|
);
|
|
144
144
|
|
|
145
145
|
/**
|
|
@@ -151,7 +151,7 @@ export const LightAccountUnsupported1271Factories = new Set(
|
|
|
151
151
|
* @returns {Promise<LightAccountVersionConfig>} the light account version definition for the given light account and chain
|
|
152
152
|
*/
|
|
153
153
|
export async function getLightAccountVersionForAccount<
|
|
154
|
-
TAccount extends LightAccountBase
|
|
154
|
+
TAccount extends LightAccountBase,
|
|
155
155
|
>(account: TAccount, chain: Chain): Promise<LightAccountVersionConfig> {
|
|
156
156
|
const accountType = account.source as LightAccountType;
|
|
157
157
|
const factoryAddress = await account.getFactoryAddress();
|
|
@@ -160,7 +160,7 @@ export async function getLightAccountVersionForAccount<
|
|
|
160
160
|
Object.entries(AccountVersionRegistry[accountType]).map((pair) => {
|
|
161
161
|
const [version, def] = pair as [
|
|
162
162
|
LightAccountVersion<LightAccountType>,
|
|
163
|
-
LightAccountVersionConfig<GetEntryPointFromAccount<TAccount
|
|
163
|
+
LightAccountVersionConfig<GetEntryPointFromAccount<TAccount>>,
|
|
164
164
|
];
|
|
165
165
|
|
|
166
166
|
if (
|
|
@@ -171,14 +171,14 @@ export async function getLightAccountVersionForAccount<
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
return [def.addresses.default.impl, version];
|
|
174
|
-
})
|
|
174
|
+
}),
|
|
175
175
|
);
|
|
176
176
|
|
|
177
177
|
const factoryToVersion = new Map(
|
|
178
178
|
Object.entries(AccountVersionRegistry[accountType]).map((pair) => {
|
|
179
179
|
const [version, def] = pair as [
|
|
180
180
|
LightAccountVersion<LightAccountType>,
|
|
181
|
-
LightAccountVersionConfig<GetEntryPointFromAccount<TAccount
|
|
181
|
+
LightAccountVersionConfig<GetEntryPointFromAccount<TAccount>>,
|
|
182
182
|
];
|
|
183
183
|
|
|
184
184
|
if (
|
|
@@ -189,7 +189,7 @@ export async function getLightAccountVersionForAccount<
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
return [def.addresses.default.factory, version];
|
|
192
|
-
})
|
|
192
|
+
}),
|
|
193
193
|
);
|
|
194
194
|
|
|
195
195
|
const version =
|
|
@@ -199,7 +199,7 @@ export async function getLightAccountVersionForAccount<
|
|
|
199
199
|
|
|
200
200
|
if (!version) {
|
|
201
201
|
throw new Error(
|
|
202
|
-
`Could not determine ${account.source} version for chain ${chain.id}
|
|
202
|
+
`Could not determine ${account.source} version for chain ${chain.id}`,
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -60,19 +60,19 @@ export type ValidationDataParams =
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export type ModularAccountV2<
|
|
63
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
63
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
64
64
|
> = SmartContractAccountWithSigner<"ModularAccountV2", TSigner, "0.7.0"> & {
|
|
65
65
|
signerEntity: SignerEntity;
|
|
66
66
|
getExecutionData: (selector: Hex) => Promise<ExecutionDataView>;
|
|
67
67
|
getValidationData: (
|
|
68
|
-
args: ValidationDataParams
|
|
68
|
+
args: ValidationDataParams,
|
|
69
69
|
) => Promise<ValidationDataView>;
|
|
70
70
|
encodeCallData: (callData: Hex) => Promise<Hex>;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
export type CreateMAV2BaseParams<
|
|
74
74
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
75
|
-
TTransport extends Transport = Transport
|
|
75
|
+
TTransport extends Transport = Transport,
|
|
76
76
|
> = Omit<
|
|
77
77
|
ToSmartContractAccountParams<"ModularAccountV2", TTransport, Chain, "0.7.0">,
|
|
78
78
|
// Implements the following methods required by `toSmartContractAccount`, and passes through any other parameters.
|
|
@@ -90,11 +90,11 @@ export type CreateMAV2BaseParams<
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
export type CreateMAV2BaseReturnType<
|
|
93
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
93
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
94
94
|
> = Promise<ModularAccountV2<TSigner>>;
|
|
95
95
|
|
|
96
96
|
export async function createMAv2Base<
|
|
97
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
97
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
98
98
|
>(config: CreateMAV2BaseParams<TSigner>): CreateMAV2BaseReturnType<TSigner> {
|
|
99
99
|
let {
|
|
100
100
|
transport,
|
|
@@ -169,7 +169,7 @@ export async function createMAv2Base<
|
|
|
169
169
|
abi: modularAccountAbi,
|
|
170
170
|
functionName: "execute",
|
|
171
171
|
args: [target, value ?? 0n, data],
|
|
172
|
-
})
|
|
172
|
+
}),
|
|
173
173
|
);
|
|
174
174
|
|
|
175
175
|
const encodeBatchExecute: (txs: AccountOp[]) => Promise<Hex> = async (txs) =>
|
|
@@ -184,7 +184,7 @@ export async function createMAv2Base<
|
|
|
184
184
|
value: tx.value ?? 0n,
|
|
185
185
|
})),
|
|
186
186
|
],
|
|
187
|
-
})
|
|
187
|
+
}),
|
|
188
188
|
);
|
|
189
189
|
|
|
190
190
|
const isAccountDeployed: () => Promise<boolean> = async () =>
|
|
@@ -280,7 +280,7 @@ export async function createMAv2Base<
|
|
|
280
280
|
chain,
|
|
281
281
|
accountAddress,
|
|
282
282
|
entityId,
|
|
283
|
-
deferredActionData
|
|
283
|
+
deferredActionData,
|
|
284
284
|
)),
|
|
285
285
|
});
|
|
286
286
|
|
|
@@ -31,7 +31,7 @@ import { predictModularAccountV2Address } from "./predictAddress.js";
|
|
|
31
31
|
|
|
32
32
|
export type CreateModularAccountV2Params<
|
|
33
33
|
TTransport extends Transport = Transport,
|
|
34
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
34
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
35
35
|
> = (Pick<
|
|
36
36
|
ToSmartContractAccountParams<"ModularAccountV2", TTransport, Chain, "0.7.0">,
|
|
37
37
|
"transport" | "chain" | "accountAddress"
|
|
@@ -56,9 +56,9 @@ export type CreateModularAccountV2Params<
|
|
|
56
56
|
|
|
57
57
|
export async function createModularAccountV2<
|
|
58
58
|
TTransport extends Transport = Transport,
|
|
59
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
59
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
60
60
|
>(
|
|
61
|
-
config: CreateModularAccountV2Params<TTransport, TSigner
|
|
61
|
+
config: CreateModularAccountV2Params<TTransport, TSigner>,
|
|
62
62
|
): Promise<ModularAccountV2<TSigner>>;
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -94,7 +94,7 @@ export async function createModularAccountV2<
|
|
|
94
94
|
* @returns {Promise<ModularAccountV2>} A promise that resolves to an `ModularAccountV2` providing methods for nonce retrieval, transaction execution, and more.
|
|
95
95
|
*/
|
|
96
96
|
export async function createModularAccountV2(
|
|
97
|
-
config: CreateModularAccountV2Params
|
|
97
|
+
config: CreateModularAccountV2Params,
|
|
98
98
|
): Promise<ModularAccountV2> {
|
|
99
99
|
const {
|
|
100
100
|
transport,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import {
|
|
3
|
+
type Address,
|
|
4
|
+
type Chain,
|
|
5
|
+
concat,
|
|
6
|
+
concatHex,
|
|
3
7
|
hashMessage,
|
|
4
8
|
hashTypedData,
|
|
5
9
|
type Hex,
|
|
6
10
|
type SignableMessage,
|
|
7
11
|
type TypedData,
|
|
8
12
|
type TypedDataDefinition,
|
|
9
|
-
type Chain,
|
|
10
|
-
type Address,
|
|
11
|
-
concat,
|
|
12
|
-
concatHex,
|
|
13
13
|
} from "viem";
|
|
14
14
|
|
|
15
|
+
import { SignatureType } from "../modules/utils.js";
|
|
15
16
|
import {
|
|
16
|
-
packUOSignature,
|
|
17
|
-
pack1271Signature,
|
|
18
17
|
DEFAULT_OWNER_ENTITY_ID,
|
|
18
|
+
pack1271Signature,
|
|
19
|
+
packUOSignature,
|
|
19
20
|
} from "../utils.js";
|
|
20
|
-
import { SignatureType } from "../modules/utils.js";
|
|
21
21
|
/**
|
|
22
22
|
* Creates an object with methods for generating a dummy signature, signing user operation hashes, signing messages, and signing typed data.
|
|
23
23
|
*
|
|
@@ -45,7 +45,7 @@ export const nativeSMASigner = (
|
|
|
45
45
|
signer: SmartAccountSigner,
|
|
46
46
|
chain: Chain,
|
|
47
47
|
accountAddress: Address,
|
|
48
|
-
deferredActionData?: Hex
|
|
48
|
+
deferredActionData?: Hex,
|
|
49
49
|
) => {
|
|
50
50
|
return {
|
|
51
51
|
getDummySignature: (): Hex => {
|
|
@@ -65,7 +65,7 @@ export const nativeSMASigner = (
|
|
|
65
65
|
packUOSignature({
|
|
66
66
|
// orderedHookData: [],
|
|
67
67
|
validationSignature: signature,
|
|
68
|
-
})
|
|
68
|
+
}),
|
|
69
69
|
);
|
|
70
70
|
|
|
71
71
|
if (deferredActionData) {
|
|
@@ -102,14 +102,17 @@ export const nativeSMASigner = (
|
|
|
102
102
|
// we don't apply the expected 1271 packing since deferred sigs use typed data sigs and don't expect the 1271 packing
|
|
103
103
|
signTypedData: async <
|
|
104
104
|
const typedData extends TypedData | Record<string, unknown>,
|
|
105
|
-
primaryType extends keyof typedData | "EIP712Domain" = keyof typedData
|
|
105
|
+
primaryType extends keyof typedData | "EIP712Domain" = keyof typedData,
|
|
106
106
|
>(
|
|
107
|
-
typedDataDefinition: TypedDataDefinition<typedData, primaryType
|
|
107
|
+
typedDataDefinition: TypedDataDefinition<typedData, primaryType>,
|
|
108
108
|
): Promise<Hex> => {
|
|
109
109
|
// the accounts domain already gives replay protection across accounts for deferred actions, so we don't need to apply another wrapping
|
|
110
110
|
const isDeferredAction =
|
|
111
|
-
typedDataDefinition
|
|
112
|
-
typedDataDefinition
|
|
111
|
+
typedDataDefinition.primaryType === "DeferredAction" &&
|
|
112
|
+
typedDataDefinition.domain != null &&
|
|
113
|
+
// @ts-expect-error the domain type I think changed in viem, so this is not working correctly (TODO: fix this)
|
|
114
|
+
"verifyingContract" in typedDataDefinition.domain &&
|
|
115
|
+
typedDataDefinition.domain.verifyingContract === accountAddress;
|
|
113
116
|
|
|
114
117
|
return isDeferredAction
|
|
115
118
|
? concat([
|
|
@@ -31,7 +31,7 @@ export type PredictModularAccountV2AddressParams = {
|
|
|
31
31
|
);
|
|
32
32
|
|
|
33
33
|
export function predictModularAccountV2Address(
|
|
34
|
-
params: PredictModularAccountV2AddressParams
|
|
34
|
+
params: PredictModularAccountV2AddressParams,
|
|
35
35
|
): Address {
|
|
36
36
|
const { factoryAddress, salt, implementationAddress } = params;
|
|
37
37
|
|
|
@@ -47,14 +47,14 @@ export function predictModularAccountV2Address(
|
|
|
47
47
|
const immutableArgs = params.ownerAddress;
|
|
48
48
|
initcode = getProxyBytecodeWithImmutableArgs(
|
|
49
49
|
implementationAddress,
|
|
50
|
-
immutableArgs
|
|
50
|
+
immutableArgs,
|
|
51
51
|
);
|
|
52
52
|
break;
|
|
53
53
|
case "MA":
|
|
54
54
|
combinedSalt = getCombinedSaltK1(
|
|
55
55
|
params.ownerAddress,
|
|
56
56
|
salt,
|
|
57
|
-
params.entityId
|
|
57
|
+
params.entityId,
|
|
58
58
|
);
|
|
59
59
|
|
|
60
60
|
initcode = getProxyBytecode(implementationAddress);
|
|
@@ -67,8 +67,8 @@ export function predictModularAccountV2Address(
|
|
|
67
67
|
combinedSalt = keccak256(
|
|
68
68
|
encodePacked(
|
|
69
69
|
["uint256", "uint256", "uint256", "uint32"],
|
|
70
|
-
[x, y, salt, params.entityId]
|
|
71
|
-
)
|
|
70
|
+
[x, y, salt, params.entityId],
|
|
71
|
+
),
|
|
72
72
|
);
|
|
73
73
|
|
|
74
74
|
initcode = getProxyBytecode(implementationAddress);
|
|
@@ -89,35 +89,35 @@ export function predictModularAccountV2Address(
|
|
|
89
89
|
function getCombinedSaltK1(
|
|
90
90
|
ownerAddress: Address,
|
|
91
91
|
salt: bigint,
|
|
92
|
-
entityId: number
|
|
92
|
+
entityId: number,
|
|
93
93
|
): Hex {
|
|
94
94
|
return keccak256(
|
|
95
95
|
encodePacked(
|
|
96
96
|
["address", "uint256", "uint32"],
|
|
97
|
-
[ownerAddress, salt, entityId]
|
|
98
|
-
)
|
|
97
|
+
[ownerAddress, salt, entityId],
|
|
98
|
+
),
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
function getProxyBytecode(implementationAddress: Address): Hex {
|
|
103
103
|
return `0x603d3d8160223d3973${implementationAddress.slice(
|
|
104
|
-
2
|
|
104
|
+
2,
|
|
105
105
|
)}60095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3`;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
function getProxyBytecodeWithImmutableArgs(
|
|
109
109
|
implementationAddress: Address,
|
|
110
|
-
immutableArgs: Hex
|
|
110
|
+
immutableArgs: Hex,
|
|
111
111
|
): Hex {
|
|
112
112
|
return `0x6100513d8160233d3973${implementationAddress.slice(
|
|
113
|
-
2
|
|
113
|
+
2,
|
|
114
114
|
)}60095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3${immutableArgs.slice(
|
|
115
|
-
2
|
|
115
|
+
2,
|
|
116
116
|
)}`;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
function assertNeverModularAccountV2Type(_: never): never {
|
|
120
120
|
throw new Error(
|
|
121
|
-
"Unknown modular account type in predictModularAccountV2Address"
|
|
121
|
+
"Unknown modular account type in predictModularAccountV2Address",
|
|
122
122
|
);
|
|
123
123
|
}
|
|
@@ -30,7 +30,7 @@ export type DeferredActionTypedData = {
|
|
|
30
30
|
DeferredAction: [
|
|
31
31
|
{ name: "nonce"; type: "uint256" },
|
|
32
32
|
{ name: "deadline"; type: "uint48" },
|
|
33
|
-
{ name: "call"; type: "bytes" }
|
|
33
|
+
{ name: "call"; type: "bytes" },
|
|
34
34
|
];
|
|
35
35
|
};
|
|
36
36
|
primaryType: "DeferredAction";
|
|
@@ -70,16 +70,16 @@ export type EntityIdAndNonceParams = {
|
|
|
70
70
|
|
|
71
71
|
export type DeferralActions = {
|
|
72
72
|
createDeferredActionTypedDataObject: (
|
|
73
|
-
args: CreateDeferredActionTypedDataParams
|
|
73
|
+
args: CreateDeferredActionTypedDataParams,
|
|
74
74
|
) => Promise<DeferredActionReturnData>;
|
|
75
75
|
buildPreSignatureDeferredActionDigest: (
|
|
76
|
-
args: BuildPreSignatureDeferredActionDigestParams
|
|
76
|
+
args: BuildPreSignatureDeferredActionDigestParams,
|
|
77
77
|
) => Hex;
|
|
78
78
|
buildUserOperationWithDeferredAction: (
|
|
79
|
-
args: BuildUserOperationWithDeferredActionParams
|
|
79
|
+
args: BuildUserOperationWithDeferredActionParams,
|
|
80
80
|
) => Promise<UserOperationRequest_v7>;
|
|
81
81
|
getEntityIdAndNonce: (
|
|
82
|
-
args: EntityIdAndNonceParams
|
|
82
|
+
args: EntityIdAndNonceParams,
|
|
83
83
|
) => Promise<{ nonce: bigint; entityId: number }>;
|
|
84
84
|
};
|
|
85
85
|
|
|
@@ -90,7 +90,7 @@ export type DeferralActions = {
|
|
|
90
90
|
* @returns {object} - An object containing three methods: `createDeferredActionTypedDataObject`, `buildDeferredActionDigest`, and `buildUserOperationWithDeferredAction`.
|
|
91
91
|
*/
|
|
92
92
|
export const deferralActions: (
|
|
93
|
-
client: ModularAccountV2Client
|
|
93
|
+
client: ModularAccountV2Client,
|
|
94
94
|
) => DeferralActions = (client: ModularAccountV2Client): DeferralActions => {
|
|
95
95
|
const createDeferredActionTypedDataObject = async ({
|
|
96
96
|
callData,
|
|
@@ -139,7 +139,7 @@ export const deferralActions: (
|
|
|
139
139
|
|
|
140
140
|
const encodedCallData = encodePacked(
|
|
141
141
|
["uint168", "uint48", "bytes"],
|
|
142
|
-
[validationLocator, typedData.message.deadline, typedData.message.call]
|
|
142
|
+
[validationLocator, typedData.message.deadline, typedData.message.call],
|
|
143
143
|
);
|
|
144
144
|
|
|
145
145
|
const encodedDataLength = size(encodedCallData);
|
|
@@ -29,7 +29,7 @@ import { type ModularAccountV2 } from "../../account/common/modularAccountV2Base
|
|
|
29
29
|
import { DEFAULT_OWNER_ENTITY_ID } from "../../utils.js";
|
|
30
30
|
|
|
31
31
|
export type InstallValidationParams<
|
|
32
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
32
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
33
33
|
> = {
|
|
34
34
|
validationConfig: ValidationConfig;
|
|
35
35
|
selectors: Hex[];
|
|
@@ -44,7 +44,7 @@ export type InstallValidationParams<
|
|
|
44
44
|
>;
|
|
45
45
|
|
|
46
46
|
export type UninstallValidationParams<
|
|
47
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
47
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
48
48
|
> = {
|
|
49
49
|
moduleAddress: Address;
|
|
50
50
|
entityId: number;
|
|
@@ -56,20 +56,20 @@ export type UninstallValidationParams<
|
|
|
56
56
|
>;
|
|
57
57
|
|
|
58
58
|
export type InstallValidationActions<
|
|
59
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
59
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
60
60
|
> = {
|
|
61
61
|
installValidation: (
|
|
62
|
-
args: InstallValidationParams<TSigner
|
|
62
|
+
args: InstallValidationParams<TSigner>,
|
|
63
63
|
) => Promise<SendUserOperationResult>;
|
|
64
64
|
encodeInstallValidation: (
|
|
65
65
|
// TODO: omit the user op sending related parameters from this type
|
|
66
|
-
args: InstallValidationParams<TSigner
|
|
66
|
+
args: InstallValidationParams<TSigner>,
|
|
67
67
|
) => Promise<Hex>;
|
|
68
68
|
uninstallValidation: (
|
|
69
|
-
args: UninstallValidationParams<TSigner
|
|
69
|
+
args: UninstallValidationParams<TSigner>,
|
|
70
70
|
) => Promise<SendUserOperationResult>;
|
|
71
71
|
encodeUninstallValidation: (
|
|
72
|
-
args: UninstallValidationParams<TSigner
|
|
72
|
+
args: UninstallValidationParams<TSigner>,
|
|
73
73
|
) => Promise<Hex>;
|
|
74
74
|
};
|
|
75
75
|
|
|
@@ -118,9 +118,9 @@ export type InstallValidationActions<
|
|
|
118
118
|
* @returns {object} - An object containing two methods, `installValidation` and `uninstallValidation`.
|
|
119
119
|
*/
|
|
120
120
|
export const installValidationActions: <
|
|
121
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
121
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
122
122
|
>(
|
|
123
|
-
client: ModularAccountV2Client<TSigner
|
|
123
|
+
client: ModularAccountV2Client<TSigner>,
|
|
124
124
|
) => InstallValidationActions<TSigner> = (client) => {
|
|
125
125
|
const encodeInstallValidation = async ({
|
|
126
126
|
validationConfig,
|
|
@@ -137,7 +137,7 @@ export const installValidationActions: <
|
|
|
137
137
|
throw new IncompatibleClientError(
|
|
138
138
|
"SmartAccountClient",
|
|
139
139
|
"installValidation",
|
|
140
|
-
client
|
|
140
|
+
client,
|
|
141
141
|
);
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -158,10 +158,10 @@ export const installValidationActions: <
|
|
|
158
158
|
selectors,
|
|
159
159
|
installData,
|
|
160
160
|
hooks.map((hook: { hookConfig: HookConfig; initData: Hex }) =>
|
|
161
|
-
concatHex([serializeHookConfig(hook.hookConfig), hook.initData])
|
|
161
|
+
concatHex([serializeHookConfig(hook.hookConfig), hook.initData]),
|
|
162
162
|
),
|
|
163
163
|
],
|
|
164
|
-
})
|
|
164
|
+
}),
|
|
165
165
|
);
|
|
166
166
|
};
|
|
167
167
|
|
|
@@ -180,7 +180,7 @@ export const installValidationActions: <
|
|
|
180
180
|
throw new IncompatibleClientError(
|
|
181
181
|
"SmartAccountClient",
|
|
182
182
|
"uninstallValidation",
|
|
183
|
-
client
|
|
183
|
+
client,
|
|
184
184
|
);
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -196,7 +196,7 @@ export const installValidationActions: <
|
|
|
196
196
|
uninstallData,
|
|
197
197
|
hookUninstallDatas,
|
|
198
198
|
],
|
|
199
|
-
})
|
|
199
|
+
}),
|
|
200
200
|
);
|
|
201
201
|
};
|
|
202
202
|
|