@account-kit/smart-contracts 4.0.0-beta.7 → 4.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/src/light-account/clients/alchemyClient.d.ts +3 -3
- package/dist/esm/src/light-account/clients/alchemyClient.js +10 -13
- package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.d.ts +3 -3
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js +13 -14
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/esm/src/msca/client/alchemyClient.d.ts +3 -3
- package/dist/esm/src/msca/client/alchemyClient.js +8 -12
- package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.d.ts +3 -3
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js +7 -11
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/types/src/light-account/clients/alchemyClient.d.ts +3 -3
- package/dist/types/src/light-account/clients/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts +3 -3
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
- package/dist/types/src/msca/client/alchemyClient.d.ts +3 -3
- package/dist/types/src/msca/client/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts +3 -3
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/light-account/clients/alchemyClient.ts +17 -26
- package/src/light-account/clients/multiOwnerAlchemyClient.ts +20 -28
- package/src/msca/client/alchemyClient.ts +10 -25
- package/src/msca/client/multiSigAlchemyClient.ts +8 -29
- package/src/msca/plugins/multi-owner/plugin.ts +21 -19
- package/src/msca/plugins/multisig/plugin.ts +21 -19
- package/src/msca/plugins/session-key/plugin.ts +30 -28
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
createAlchemyPublicRpcClient,
|
|
5
|
-
createAlchemySmartAccountClientFromExisting,
|
|
3
|
+
createAlchemySmartAccountClient,
|
|
6
4
|
type AlchemySmartAccountClient,
|
|
7
5
|
type AlchemySmartAccountClientConfig,
|
|
8
6
|
} from "@account-kit/infra";
|
|
@@ -13,20 +11,16 @@ import {
|
|
|
13
11
|
type MultiOwnerLightAccount,
|
|
14
12
|
type MultiOwnerLightAccountClientActions,
|
|
15
13
|
} from "@account-kit/smart-contracts";
|
|
16
|
-
import {
|
|
14
|
+
import { type Chain } from "viem";
|
|
17
15
|
|
|
18
16
|
export type AlchemyMultiOwnerLightAccountClientConfig<
|
|
19
17
|
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
20
18
|
> = Omit<
|
|
21
19
|
CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>,
|
|
22
|
-
"transport" | "
|
|
20
|
+
"transport" | "type"
|
|
23
21
|
> &
|
|
24
22
|
Omit<
|
|
25
|
-
AlchemySmartAccountClientConfig<
|
|
26
|
-
Transport,
|
|
27
|
-
Chain,
|
|
28
|
-
MultiOwnerLightAccount<TSigner>
|
|
29
|
-
>,
|
|
23
|
+
AlchemySmartAccountClientConfig<Chain, MultiOwnerLightAccount<TSigner>>,
|
|
30
24
|
"account"
|
|
31
25
|
>;
|
|
32
26
|
|
|
@@ -36,7 +30,6 @@ export async function createMultiOwnerLightAccountAlchemyClient<
|
|
|
36
30
|
params: AlchemyMultiOwnerLightAccountClientConfig<TSigner>
|
|
37
31
|
): Promise<
|
|
38
32
|
AlchemySmartAccountClient<
|
|
39
|
-
CustomTransport,
|
|
40
33
|
Chain | undefined,
|
|
41
34
|
MultiOwnerLightAccount<TSigner>,
|
|
42
35
|
MultiOwnerLightAccountClientActions<TSigner>
|
|
@@ -49,13 +42,15 @@ export async function createMultiOwnerLightAccountAlchemyClient<
|
|
|
49
42
|
* @example
|
|
50
43
|
* ```ts
|
|
51
44
|
* import { createMultiOwnerLightAccountAlchemyClient } from "@account-kit/smart-contracts";
|
|
52
|
-
* import { sepolia } from "@account-kit/infra";
|
|
45
|
+
* import { sepolia, alchemy } from "@account-kit/infra";
|
|
53
46
|
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
54
47
|
* import { generatePrivateKey } from "viem"
|
|
55
48
|
*
|
|
56
49
|
* const lightAccountClient = await createMultiOwnerLightAccountAlchemyClient({
|
|
57
|
-
*
|
|
58
|
-
*
|
|
50
|
+
* transport: alchemy({
|
|
51
|
+
* apiKey: "your-api-key",
|
|
52
|
+
* }),
|
|
53
|
+
* chain: sepolia
|
|
59
54
|
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
60
55
|
* });
|
|
61
56
|
* ```
|
|
@@ -63,25 +58,22 @@ export async function createMultiOwnerLightAccountAlchemyClient<
|
|
|
63
58
|
* @param {AlchemyMultiOwnerLightAccountClientConfig} config The configuration for creating the Alchemy client
|
|
64
59
|
* @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created account information and methods
|
|
65
60
|
*/
|
|
66
|
-
export async function createMultiOwnerLightAccountAlchemyClient(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const client = createAlchemyPublicRpcClient({
|
|
73
|
-
chain,
|
|
74
|
-
connectionConfig,
|
|
75
|
-
});
|
|
76
|
-
|
|
61
|
+
export async function createMultiOwnerLightAccountAlchemyClient({
|
|
62
|
+
opts,
|
|
63
|
+
transport,
|
|
64
|
+
chain,
|
|
65
|
+
...config
|
|
66
|
+
}: AlchemyMultiOwnerLightAccountClientConfig): Promise<AlchemySmartAccountClient> {
|
|
77
67
|
const account = await createMultiOwnerLightAccount({
|
|
78
|
-
transport: custom(client),
|
|
79
68
|
...config,
|
|
69
|
+
transport,
|
|
70
|
+
chain,
|
|
80
71
|
});
|
|
81
72
|
|
|
82
|
-
return
|
|
73
|
+
return createAlchemySmartAccountClient({
|
|
83
74
|
...config,
|
|
84
|
-
|
|
75
|
+
transport,
|
|
76
|
+
chain,
|
|
85
77
|
account,
|
|
86
78
|
opts,
|
|
87
79
|
}).extend(multiOwnerLightAccountClientActions);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
createAlchemyPublicRpcClient,
|
|
5
|
-
createAlchemySmartAccountClientFromExisting,
|
|
3
|
+
createAlchemySmartAccountClient,
|
|
6
4
|
type AlchemySmartAccountClient,
|
|
7
5
|
type AlchemySmartAccountClientConfig,
|
|
8
6
|
} from "@account-kit/infra";
|
|
@@ -18,22 +16,16 @@ import {
|
|
|
18
16
|
type MultiOwnerPluginActions,
|
|
19
17
|
type PluginManagerActions,
|
|
20
18
|
} from "@account-kit/smart-contracts";
|
|
21
|
-
import {
|
|
22
|
-
custom,
|
|
23
|
-
type Chain,
|
|
24
|
-
type CustomTransport,
|
|
25
|
-
type HttpTransport,
|
|
26
|
-
type Transport,
|
|
27
|
-
} from "viem";
|
|
19
|
+
import { type Chain, type HttpTransport } from "viem";
|
|
28
20
|
|
|
29
21
|
export type AlchemyModularAccountClientConfig<
|
|
30
22
|
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
31
23
|
> = Omit<
|
|
32
24
|
CreateMultiOwnerModularAccountParams<HttpTransport, TSigner>,
|
|
33
|
-
"transport"
|
|
25
|
+
"transport"
|
|
34
26
|
> &
|
|
35
27
|
Omit<
|
|
36
|
-
AlchemySmartAccountClientConfig<
|
|
28
|
+
AlchemySmartAccountClientConfig<Chain, LightAccount<TSigner>>,
|
|
37
29
|
"account"
|
|
38
30
|
>;
|
|
39
31
|
|
|
@@ -43,7 +35,6 @@ export function createModularAccountAlchemyClient<
|
|
|
43
35
|
params: AlchemyModularAccountClientConfig<TSigner>
|
|
44
36
|
): Promise<
|
|
45
37
|
AlchemySmartAccountClient<
|
|
46
|
-
CustomTransport,
|
|
47
38
|
Chain | undefined,
|
|
48
39
|
MultiOwnerModularAccount<TSigner>,
|
|
49
40
|
MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> &
|
|
@@ -58,12 +49,12 @@ export function createModularAccountAlchemyClient<
|
|
|
58
49
|
* @example
|
|
59
50
|
* ```ts
|
|
60
51
|
* import { createModularAccountAlchemyClient } from "@account-kit/smart-contracts";
|
|
61
|
-
* import { sepolia } from "@account-kit/infra";
|
|
52
|
+
* import { sepolia, alchemy } from "@account-kit/infra";
|
|
62
53
|
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
63
54
|
* import { generatePrivateKey } from "viem"
|
|
64
55
|
*
|
|
65
56
|
* const alchemyAccountClient = await createModularAccountAlchemyClient({
|
|
66
|
-
* apiKey: "your-api-key",
|
|
57
|
+
* transport: alchemy({ apiKey: "your-api-key" }),
|
|
67
58
|
* chain: sepolia,
|
|
68
59
|
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
69
60
|
* });
|
|
@@ -75,22 +66,16 @@ export function createModularAccountAlchemyClient<
|
|
|
75
66
|
export async function createModularAccountAlchemyClient(
|
|
76
67
|
config: AlchemyModularAccountClientConfig
|
|
77
68
|
): Promise<AlchemySmartAccountClient> {
|
|
78
|
-
const { chain, opts
|
|
79
|
-
AlchemyProviderConfigSchema.parse(config);
|
|
80
|
-
|
|
81
|
-
const client = createAlchemyPublicRpcClient({
|
|
82
|
-
chain,
|
|
83
|
-
connectionConfig,
|
|
84
|
-
});
|
|
69
|
+
const { transport, chain, opts } = config;
|
|
85
70
|
|
|
86
71
|
const account = await createMultiOwnerModularAccount({
|
|
87
|
-
transport: custom(client),
|
|
88
72
|
...config,
|
|
73
|
+
transport,
|
|
74
|
+
chain,
|
|
89
75
|
});
|
|
90
76
|
|
|
91
|
-
return
|
|
77
|
+
return createAlchemySmartAccountClient({
|
|
92
78
|
...config,
|
|
93
|
-
client,
|
|
94
79
|
account,
|
|
95
80
|
opts,
|
|
96
81
|
})
|
|
@@ -3,9 +3,7 @@ import {
|
|
|
3
3
|
type SmartAccountSigner,
|
|
4
4
|
} from "@aa-sdk/core";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
createAlchemyPublicRpcClient,
|
|
8
|
-
createAlchemySmartAccountClientFromExisting,
|
|
6
|
+
createAlchemySmartAccountClient,
|
|
9
7
|
type AlchemySmartAccountClient,
|
|
10
8
|
type AlchemySmartAccountClientConfig,
|
|
11
9
|
} from "@account-kit/infra";
|
|
@@ -23,13 +21,7 @@ import {
|
|
|
23
21
|
type MultisigUserOperationContext,
|
|
24
22
|
type PluginManagerActions,
|
|
25
23
|
} from "@account-kit/smart-contracts";
|
|
26
|
-
import {
|
|
27
|
-
custom,
|
|
28
|
-
type Chain,
|
|
29
|
-
type CustomTransport,
|
|
30
|
-
type HttpTransport,
|
|
31
|
-
type Transport,
|
|
32
|
-
} from "viem";
|
|
24
|
+
import { type Chain, type HttpTransport } from "viem";
|
|
33
25
|
|
|
34
26
|
// todo: this file seems somewhat duplicated with ./modularAccountClient.ts, but that file has some multi-owner specific fields. Is there a way to refactor these two to de-dupe?
|
|
35
27
|
|
|
@@ -37,11 +29,10 @@ export type AlchemyMultisigAccountClientConfig<
|
|
|
37
29
|
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
38
30
|
> = Omit<
|
|
39
31
|
CreateMultisigModularAccountParams<HttpTransport, TSigner>,
|
|
40
|
-
"transport"
|
|
32
|
+
"transport"
|
|
41
33
|
> &
|
|
42
34
|
Omit<
|
|
43
35
|
AlchemySmartAccountClientConfig<
|
|
44
|
-
Transport,
|
|
45
36
|
Chain,
|
|
46
37
|
LightAccount<TSigner>,
|
|
47
38
|
MultisigUserOperationContext
|
|
@@ -55,7 +46,6 @@ export function createMultisigAccountAlchemyClient<
|
|
|
55
46
|
params: AlchemyMultisigAccountClientConfig<TSigner>
|
|
56
47
|
): Promise<
|
|
57
48
|
AlchemySmartAccountClient<
|
|
58
|
-
CustomTransport,
|
|
59
49
|
Chain | undefined,
|
|
60
50
|
MultisigModularAccount<TSigner>,
|
|
61
51
|
MultisigPluginActions<MultisigModularAccount<TSigner>> &
|
|
@@ -76,7 +66,7 @@ export function createMultisigAccountAlchemyClient<
|
|
|
76
66
|
* import { generatePrivateKey } from "viem"
|
|
77
67
|
*
|
|
78
68
|
* const alchemyAccountClient = await createMultisigAccountAlchemyClient({
|
|
79
|
-
* apiKey: "your-api-key",
|
|
69
|
+
* transport: alchemy({ apiKey: "your-api-key" }),
|
|
80
70
|
* chain: sepolia,
|
|
81
71
|
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
|
|
82
72
|
* owners: [...], // other owners on the account
|
|
@@ -91,7 +81,6 @@ export async function createMultisigAccountAlchemyClient(
|
|
|
91
81
|
config: AlchemyMultisigAccountClientConfig
|
|
92
82
|
): Promise<
|
|
93
83
|
AlchemySmartAccountClient<
|
|
94
|
-
Transport,
|
|
95
84
|
Chain | undefined,
|
|
96
85
|
MultisigModularAccount<SmartAccountSigner>,
|
|
97
86
|
MultisigPluginActions<MultisigModularAccount<SmartAccountSigner>> &
|
|
@@ -100,26 +89,16 @@ export async function createMultisigAccountAlchemyClient(
|
|
|
100
89
|
MultisigUserOperationContext
|
|
101
90
|
>
|
|
102
91
|
> {
|
|
103
|
-
const {
|
|
104
|
-
AlchemyProviderConfigSchema.parse(config);
|
|
105
|
-
|
|
106
|
-
const client = createAlchemyPublicRpcClient({
|
|
107
|
-
chain,
|
|
108
|
-
connectionConfig,
|
|
109
|
-
});
|
|
92
|
+
const { transport, opts, chain } = config;
|
|
110
93
|
|
|
111
94
|
const account = await createMultisigModularAccount({
|
|
112
|
-
transport: custom(client),
|
|
113
95
|
...config,
|
|
96
|
+
transport,
|
|
97
|
+
chain,
|
|
114
98
|
});
|
|
115
99
|
|
|
116
|
-
return
|
|
117
|
-
Chain | undefined,
|
|
118
|
-
MultisigModularAccount<SmartAccountSigner>,
|
|
119
|
-
MultisigUserOperationContext
|
|
120
|
-
>({
|
|
100
|
+
return createAlchemySmartAccountClient({
|
|
121
101
|
...config,
|
|
122
|
-
client,
|
|
123
102
|
account,
|
|
124
103
|
opts,
|
|
125
104
|
signUserOperation: multisigSignatureMiddleware,
|
|
@@ -38,7 +38,8 @@ type ExecutionActions<
|
|
|
38
38
|
TContext extends UserOperationContext | undefined =
|
|
39
39
|
| UserOperationContext
|
|
40
40
|
| undefined,
|
|
41
|
-
TEntryPointVersion extends
|
|
41
|
+
TEntryPointVersion extends
|
|
42
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
42
43
|
> = {
|
|
43
44
|
updateOwners: (
|
|
44
45
|
args: Pick<
|
|
@@ -50,7 +51,7 @@ type ExecutionActions<
|
|
|
50
51
|
> &
|
|
51
52
|
UserOperationOverridesParameter<TEntryPointVersion> &
|
|
52
53
|
GetAccountParameter<TAccount> &
|
|
53
|
-
GetContextParameter<TContext
|
|
54
|
+
GetContextParameter<TContext>,
|
|
54
55
|
) => Promise<SendUserOperationResult<TEntryPointVersion>>;
|
|
55
56
|
};
|
|
56
57
|
|
|
@@ -69,20 +70,21 @@ type ManagementActions<
|
|
|
69
70
|
TContext extends UserOperationContext | undefined =
|
|
70
71
|
| Record<string, any>
|
|
71
72
|
| undefined,
|
|
72
|
-
TEntryPointVersion extends
|
|
73
|
+
TEntryPointVersion extends
|
|
74
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
73
75
|
> = {
|
|
74
76
|
installMultiOwnerPlugin: (
|
|
75
77
|
args: UserOperationOverridesParameter<TEntryPointVersion> &
|
|
76
78
|
InstallMultiOwnerPluginParams &
|
|
77
79
|
GetAccountParameter<TAccount> &
|
|
78
|
-
GetContextParameter<TContext
|
|
80
|
+
GetContextParameter<TContext>,
|
|
79
81
|
) => Promise<SendUserOperationResult<TEntryPointVersion>>;
|
|
80
82
|
};
|
|
81
83
|
|
|
82
84
|
type ReadAndEncodeActions<
|
|
83
85
|
TAccount extends SmartContractAccount | undefined =
|
|
84
86
|
| SmartContractAccount
|
|
85
|
-
| undefined
|
|
87
|
+
| undefined,
|
|
86
88
|
> = {
|
|
87
89
|
encodeUpdateOwners: (
|
|
88
90
|
args: Pick<
|
|
@@ -91,7 +93,7 @@ type ReadAndEncodeActions<
|
|
|
91
93
|
"updateOwners"
|
|
92
94
|
>,
|
|
93
95
|
"args"
|
|
94
|
-
|
|
96
|
+
>,
|
|
95
97
|
) => Hex;
|
|
96
98
|
|
|
97
99
|
encodeEip712Domain: (
|
|
@@ -101,11 +103,11 @@ type ReadAndEncodeActions<
|
|
|
101
103
|
"eip712Domain"
|
|
102
104
|
>,
|
|
103
105
|
"args"
|
|
104
|
-
|
|
106
|
+
>,
|
|
105
107
|
) => Hex;
|
|
106
108
|
|
|
107
109
|
readEip712Domain: (
|
|
108
|
-
args: GetAccountParameter<TAccount
|
|
110
|
+
args: GetAccountParameter<TAccount>,
|
|
109
111
|
) => Promise<
|
|
110
112
|
ReadContractReturnType<
|
|
111
113
|
typeof MultiOwnerPluginExecutionFunctionAbi,
|
|
@@ -120,7 +122,7 @@ type ReadAndEncodeActions<
|
|
|
120
122
|
"isValidSignature"
|
|
121
123
|
>,
|
|
122
124
|
"args"
|
|
123
|
-
|
|
125
|
+
>,
|
|
124
126
|
) => Hex;
|
|
125
127
|
|
|
126
128
|
readIsValidSignature: (
|
|
@@ -131,7 +133,7 @@ type ReadAndEncodeActions<
|
|
|
131
133
|
>,
|
|
132
134
|
"args"
|
|
133
135
|
> &
|
|
134
|
-
GetAccountParameter<TAccount
|
|
136
|
+
GetAccountParameter<TAccount>,
|
|
135
137
|
) => Promise<
|
|
136
138
|
ReadContractReturnType<
|
|
137
139
|
typeof MultiOwnerPluginExecutionFunctionAbi,
|
|
@@ -146,7 +148,7 @@ export type MultiOwnerPluginActions<
|
|
|
146
148
|
| undefined,
|
|
147
149
|
TContext extends UserOperationContext | undefined =
|
|
148
150
|
| UserOperationContext
|
|
149
|
-
| undefined
|
|
151
|
+
| undefined,
|
|
150
152
|
> = ExecutionActions<TAccount, TContext> &
|
|
151
153
|
ManagementActions<TAccount, TContext> &
|
|
152
154
|
ReadAndEncodeActions<TAccount>;
|
|
@@ -177,7 +179,7 @@ export const MultiOwnerPlugin: Plugin<typeof MultiOwnerPluginAbi> = {
|
|
|
177
179
|
},
|
|
178
180
|
getContract: <C extends Client>(
|
|
179
181
|
client: C,
|
|
180
|
-
address?: Address
|
|
182
|
+
address?: Address,
|
|
181
183
|
): GetContractReturnType<
|
|
182
184
|
typeof MultiOwnerPluginAbi,
|
|
183
185
|
PublicClient,
|
|
@@ -205,9 +207,9 @@ export const multiOwnerPluginActions: <
|
|
|
205
207
|
| undefined,
|
|
206
208
|
TContext extends UserOperationContext | undefined =
|
|
207
209
|
| UserOperationContext
|
|
208
|
-
| undefined
|
|
210
|
+
| undefined,
|
|
209
211
|
>(
|
|
210
|
-
client: Client<TTransport, TChain, TAccount
|
|
212
|
+
client: Client<TTransport, TChain, TAccount>,
|
|
211
213
|
) => MultiOwnerPluginActions<TAccount, TContext> = (client) => ({
|
|
212
214
|
updateOwners({ args, overrides, context, account = client.account }) {
|
|
213
215
|
if (!account) {
|
|
@@ -217,7 +219,7 @@ export const multiOwnerPluginActions: <
|
|
|
217
219
|
throw new IncompatibleClientError(
|
|
218
220
|
"SmartAccountClient",
|
|
219
221
|
"updateOwners",
|
|
220
|
-
client
|
|
222
|
+
client,
|
|
221
223
|
);
|
|
222
224
|
}
|
|
223
225
|
|
|
@@ -243,7 +245,7 @@ export const multiOwnerPluginActions: <
|
|
|
243
245
|
throw new IncompatibleClientError(
|
|
244
246
|
"SmartAccountClient",
|
|
245
247
|
"installMultiOwnerPlugin",
|
|
246
|
-
client
|
|
248
|
+
client,
|
|
247
249
|
);
|
|
248
250
|
}
|
|
249
251
|
|
|
@@ -259,7 +261,7 @@ export const multiOwnerPluginActions: <
|
|
|
259
261
|
|
|
260
262
|
if (!pluginAddress) {
|
|
261
263
|
throw new Error(
|
|
262
|
-
"missing MultiOwnerPlugin address for chain " + chain.name
|
|
264
|
+
"missing MultiOwnerPlugin address for chain " + chain.name,
|
|
263
265
|
);
|
|
264
266
|
}
|
|
265
267
|
|
|
@@ -295,7 +297,7 @@ export const multiOwnerPluginActions: <
|
|
|
295
297
|
throw new IncompatibleClientError(
|
|
296
298
|
"SmartAccountClient",
|
|
297
299
|
"readEip712Domain",
|
|
298
|
-
client
|
|
300
|
+
client,
|
|
299
301
|
);
|
|
300
302
|
}
|
|
301
303
|
|
|
@@ -322,7 +324,7 @@ export const multiOwnerPluginActions: <
|
|
|
322
324
|
throw new IncompatibleClientError(
|
|
323
325
|
"SmartAccountClient",
|
|
324
326
|
"readIsValidSignature",
|
|
325
|
-
client
|
|
327
|
+
client,
|
|
326
328
|
);
|
|
327
329
|
}
|
|
328
330
|
|
|
@@ -38,7 +38,8 @@ type ExecutionActions<
|
|
|
38
38
|
TContext extends UserOperationContext | undefined =
|
|
39
39
|
| UserOperationContext
|
|
40
40
|
| undefined,
|
|
41
|
-
TEntryPointVersion extends
|
|
41
|
+
TEntryPointVersion extends
|
|
42
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
42
43
|
> = {
|
|
43
44
|
updateOwnership: (
|
|
44
45
|
args: Pick<
|
|
@@ -50,7 +51,7 @@ type ExecutionActions<
|
|
|
50
51
|
> &
|
|
51
52
|
UserOperationOverridesParameter<TEntryPointVersion> &
|
|
52
53
|
GetAccountParameter<TAccount> &
|
|
53
|
-
GetContextParameter<TContext
|
|
54
|
+
GetContextParameter<TContext>,
|
|
54
55
|
) => Promise<SendUserOperationResult<TEntryPointVersion>>;
|
|
55
56
|
};
|
|
56
57
|
|
|
@@ -69,20 +70,21 @@ type ManagementActions<
|
|
|
69
70
|
TContext extends UserOperationContext | undefined =
|
|
70
71
|
| Record<string, any>
|
|
71
72
|
| undefined,
|
|
72
|
-
TEntryPointVersion extends
|
|
73
|
+
TEntryPointVersion extends
|
|
74
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
73
75
|
> = {
|
|
74
76
|
installMultisigPlugin: (
|
|
75
77
|
args: UserOperationOverridesParameter<TEntryPointVersion> &
|
|
76
78
|
InstallMultisigPluginParams &
|
|
77
79
|
GetAccountParameter<TAccount> &
|
|
78
|
-
GetContextParameter<TContext
|
|
80
|
+
GetContextParameter<TContext>,
|
|
79
81
|
) => Promise<SendUserOperationResult<TEntryPointVersion>>;
|
|
80
82
|
};
|
|
81
83
|
|
|
82
84
|
type ReadAndEncodeActions<
|
|
83
85
|
TAccount extends SmartContractAccount | undefined =
|
|
84
86
|
| SmartContractAccount
|
|
85
|
-
| undefined
|
|
87
|
+
| undefined,
|
|
86
88
|
> = {
|
|
87
89
|
encodeUpdateOwnership: (
|
|
88
90
|
args: Pick<
|
|
@@ -91,7 +93,7 @@ type ReadAndEncodeActions<
|
|
|
91
93
|
"updateOwnership"
|
|
92
94
|
>,
|
|
93
95
|
"args"
|
|
94
|
-
|
|
96
|
+
>,
|
|
95
97
|
) => Hex;
|
|
96
98
|
|
|
97
99
|
encodeEip712Domain: (
|
|
@@ -101,11 +103,11 @@ type ReadAndEncodeActions<
|
|
|
101
103
|
"eip712Domain"
|
|
102
104
|
>,
|
|
103
105
|
"args"
|
|
104
|
-
|
|
106
|
+
>,
|
|
105
107
|
) => Hex;
|
|
106
108
|
|
|
107
109
|
readEip712Domain: (
|
|
108
|
-
args: GetAccountParameter<TAccount
|
|
110
|
+
args: GetAccountParameter<TAccount>,
|
|
109
111
|
) => Promise<
|
|
110
112
|
ReadContractReturnType<
|
|
111
113
|
typeof MultisigPluginExecutionFunctionAbi,
|
|
@@ -120,7 +122,7 @@ type ReadAndEncodeActions<
|
|
|
120
122
|
"isValidSignature"
|
|
121
123
|
>,
|
|
122
124
|
"args"
|
|
123
|
-
|
|
125
|
+
>,
|
|
124
126
|
) => Hex;
|
|
125
127
|
|
|
126
128
|
readIsValidSignature: (
|
|
@@ -131,7 +133,7 @@ type ReadAndEncodeActions<
|
|
|
131
133
|
>,
|
|
132
134
|
"args"
|
|
133
135
|
> &
|
|
134
|
-
GetAccountParameter<TAccount
|
|
136
|
+
GetAccountParameter<TAccount>,
|
|
135
137
|
) => Promise<
|
|
136
138
|
ReadContractReturnType<
|
|
137
139
|
typeof MultisigPluginExecutionFunctionAbi,
|
|
@@ -146,7 +148,7 @@ export type MultisigPluginActions<
|
|
|
146
148
|
| undefined,
|
|
147
149
|
TContext extends UserOperationContext | undefined =
|
|
148
150
|
| UserOperationContext
|
|
149
|
-
| undefined
|
|
151
|
+
| undefined,
|
|
150
152
|
> = ExecutionActions<TAccount, TContext> &
|
|
151
153
|
ManagementActions<TAccount, TContext> &
|
|
152
154
|
ReadAndEncodeActions<TAccount>;
|
|
@@ -176,7 +178,7 @@ export const MultisigPlugin: Plugin<typeof MultisigPluginAbi> = {
|
|
|
176
178
|
},
|
|
177
179
|
getContract: <C extends Client>(
|
|
178
180
|
client: C,
|
|
179
|
-
address?: Address
|
|
181
|
+
address?: Address,
|
|
180
182
|
): GetContractReturnType<typeof MultisigPluginAbi, PublicClient, Address> => {
|
|
181
183
|
if (!client.chain) throw new ChainNotFoundError();
|
|
182
184
|
|
|
@@ -200,9 +202,9 @@ export const multisigPluginActions: <
|
|
|
200
202
|
| undefined,
|
|
201
203
|
TContext extends UserOperationContext | undefined =
|
|
202
204
|
| UserOperationContext
|
|
203
|
-
| undefined
|
|
205
|
+
| undefined,
|
|
204
206
|
>(
|
|
205
|
-
client: Client<TTransport, TChain, TAccount
|
|
207
|
+
client: Client<TTransport, TChain, TAccount>,
|
|
206
208
|
) => MultisigPluginActions<TAccount, TContext> = (client) => ({
|
|
207
209
|
updateOwnership({ args, overrides, context, account = client.account }) {
|
|
208
210
|
if (!account) {
|
|
@@ -212,7 +214,7 @@ export const multisigPluginActions: <
|
|
|
212
214
|
throw new IncompatibleClientError(
|
|
213
215
|
"SmartAccountClient",
|
|
214
216
|
"updateOwnership",
|
|
215
|
-
client
|
|
217
|
+
client,
|
|
216
218
|
);
|
|
217
219
|
}
|
|
218
220
|
|
|
@@ -238,7 +240,7 @@ export const multisigPluginActions: <
|
|
|
238
240
|
throw new IncompatibleClientError(
|
|
239
241
|
"SmartAccountClient",
|
|
240
242
|
"installMultisigPlugin",
|
|
241
|
-
client
|
|
243
|
+
client,
|
|
242
244
|
);
|
|
243
245
|
}
|
|
244
246
|
|
|
@@ -260,7 +262,7 @@ export const multisigPluginActions: <
|
|
|
260
262
|
pluginAddress,
|
|
261
263
|
pluginInitData: encodeAbiParameters(
|
|
262
264
|
[{ type: "address[]" }, { type: "uint256" }],
|
|
263
|
-
params.args
|
|
265
|
+
params.args,
|
|
264
266
|
),
|
|
265
267
|
dependencies,
|
|
266
268
|
overrides,
|
|
@@ -291,7 +293,7 @@ export const multisigPluginActions: <
|
|
|
291
293
|
throw new IncompatibleClientError(
|
|
292
294
|
"SmartAccountClient",
|
|
293
295
|
"readEip712Domain",
|
|
294
|
-
client
|
|
296
|
+
client,
|
|
295
297
|
);
|
|
296
298
|
}
|
|
297
299
|
|
|
@@ -318,7 +320,7 @@ export const multisigPluginActions: <
|
|
|
318
320
|
throw new IncompatibleClientError(
|
|
319
321
|
"SmartAccountClient",
|
|
320
322
|
"readIsValidSignature",
|
|
321
|
-
client
|
|
323
|
+
client,
|
|
322
324
|
);
|
|
323
325
|
}
|
|
324
326
|
|