@account-kit/smart-contracts 4.0.0-alpha.0 → 4.0.0-alpha.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/cjs/src/index.d.ts +3 -3
- package/dist/cjs/src/index.js +15 -15
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/account.js +1 -1
- package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/multiOwner.js +2 -4
- package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/cjs/src/light-account/actions/transferOwnership.d.ts +1 -1
- package/dist/cjs/src/light-account/actions/transferOwnership.js +2 -1
- package/dist/cjs/src/light-account/actions/transferOwnership.js.map +1 -1
- package/dist/cjs/src/light-account/actions/updateOwners.js.map +1 -1
- package/dist/cjs/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/cjs/src/light-account/clients/client.js +2 -1
- package/dist/cjs/src/light-account/clients/client.js.map +1 -1
- package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js +2 -1
- package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/decorators/lightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/utils.d.ts +3 -2
- package/dist/cjs/src/light-account/utils.js +14 -5
- package/dist/cjs/src/light-account/utils.js.map +1 -1
- package/dist/cjs/src/msca/account/multiOwnerAccount.js +2 -1
- package/dist/cjs/src/msca/account/multiOwnerAccount.js.map +1 -1
- package/dist/cjs/src/msca/account/multisigAccount.js +4 -3
- package/dist/cjs/src/msca/account/multisigAccount.js.map +1 -1
- package/dist/cjs/src/msca/account-loupe/decorator.js.map +1 -1
- package/dist/cjs/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/cjs/src/msca/client/client.js.map +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/cjs/src/msca/errors.js.map +1 -1
- package/dist/cjs/src/msca/plugin-manager/decorator.d.ts +1 -1
- package/dist/cjs/src/msca/plugin-manager/decorator.js +6 -4
- package/dist/cjs/src/msca/plugin-manager/decorator.js.map +1 -1
- package/dist/cjs/src/msca/plugin-manager/installPlugin.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multi-owner/extension.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multi-owner/index.d.ts +1 -1
- package/dist/cjs/src/msca/plugins/multi-owner/index.js +2 -1
- package/dist/cjs/src/msca/plugins/multi-owner/index.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js +2 -2
- package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +1 -1
- package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/extension.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/index.d.ts +1 -8
- package/dist/cjs/src/msca/plugins/multisig/index.js +1 -16
- package/dist/cjs/src/msca/plugins/multisig/index.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/middleware.d.ts +1 -1
- package/dist/cjs/src/msca/plugins/multisig/middleware.js +1 -1
- package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.d.ts +3 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js +2 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.d.ts +2 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/index.d.ts +4 -0
- package/dist/cjs/src/msca/plugins/multisig/utils/index.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/extension.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/index.d.ts +1 -1
- package/dist/cjs/src/msca/plugins/session-key/index.js +3 -1
- package/dist/cjs/src/msca/plugins/session-key/index.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/utils.d.ts +4 -2
- package/dist/cjs/src/msca/plugins/session-key/utils.js +3 -2
- package/dist/cjs/src/msca/plugins/session-key/utils.js.map +1 -1
- package/dist/cjs/src/msca/utils.d.ts +6 -4
- package/dist/cjs/src/msca/utils.js.map +1 -1
- package/dist/esm/src/index.d.ts +3 -3
- package/dist/esm/src/index.js +2 -2
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/light-account/accounts/account.js +2 -2
- package/dist/esm/src/light-account/accounts/account.js.map +1 -1
- package/dist/esm/src/light-account/accounts/multiOwner.js +3 -5
- package/dist/esm/src/light-account/accounts/multiOwner.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 +2 -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 +2 -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 +2 -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/utils.d.ts +3 -2
- package/dist/esm/src/light-account/utils.js +12 -4
- package/dist/esm/src/light-account/utils.js.map +1 -1
- package/dist/esm/src/msca/account/multiOwnerAccount.js +2 -1
- package/dist/esm/src/msca/account/multiOwnerAccount.js.map +1 -1
- package/dist/esm/src/msca/account/multisigAccount.js +4 -3
- 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/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/errors.js.map +1 -1
- package/dist/esm/src/msca/plugin-manager/decorator.d.ts +1 -1
- package/dist/esm/src/msca/plugin-manager/decorator.js +6 -4
- 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/plugins/multi-owner/extension.js.map +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/index.d.ts +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/index.js +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/index.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +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/index.d.ts +1 -8
- package/dist/esm/src/msca/plugins/multisig/index.js +0 -7
- package/dist/esm/src/msca/plugins/multisig/index.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.d.ts +1 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.js +2 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.d.ts +3 -2
- package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js +2 -2
- package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.d.ts +2 -2
- package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/index.d.ts +4 -0
- package/dist/esm/src/msca/plugins/multisig/utils/index.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/index.d.ts +1 -1
- package/dist/esm/src/msca/plugins/session-key/index.js +1 -1
- package/dist/esm/src/msca/plugins/session-key/index.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/utils.d.ts +4 -2
- package/dist/esm/src/msca/plugins/session-key/utils.js +3 -2
- package/dist/esm/src/msca/plugins/session-key/utils.js.map +1 -1
- package/dist/esm/src/msca/utils.d.ts +6 -4
- package/dist/esm/src/msca/utils.js.map +1 -1
- package/dist/types/src/index.d.ts +3 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/account.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 +26 -1
- package/dist/types/src/light-account/actions/transferOwnership.d.ts.map +1 -1
- package/dist/types/src/light-account/actions/updateOwners.d.ts +24 -0
- package/dist/types/src/light-account/actions/updateOwners.d.ts.map +1 -1
- package/dist/types/src/light-account/decorators/lightAccount.d.ts +19 -0
- package/dist/types/src/light-account/decorators/lightAccount.d.ts.map +1 -1
- package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts +19 -0
- package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts.map +1 -1
- package/dist/types/src/light-account/utils.d.ts +11 -4
- package/dist/types/src/light-account/utils.d.ts.map +1 -1
- package/dist/types/src/msca/account/multisigAccount.d.ts.map +1 -1
- package/dist/types/src/msca/account-loupe/decorator.d.ts +15 -0
- package/dist/types/src/msca/account-loupe/decorator.d.ts.map +1 -1
- package/dist/types/src/msca/client/client.d.ts.map +1 -1
- package/dist/types/src/msca/errors.d.ts +12 -0
- package/dist/types/src/msca/errors.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/decorator.d.ts +16 -1
- package/dist/types/src/msca/plugin-manager/decorator.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/installPlugin.d.ts +21 -0
- package/dist/types/src/msca/plugin-manager/installPlugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multi-owner/extension.d.ts +15 -0
- package/dist/types/src/msca/plugins/multi-owner/extension.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multi-owner/index.d.ts +1 -1
- package/dist/types/src/msca/plugins/multi-owner/index.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/actions/signMultisigUserOperation.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/extension.d.ts +13 -0
- package/dist/types/src/msca/plugins/multisig/extension.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/index.d.ts +1 -8
- package/dist/types/src/msca/plugins/multisig/index.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/middleware.d.ts +1 -1
- package/dist/types/src/msca/plugins/multisig/middleware.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/combineSignatures.d.ts +28 -2
- package/dist/types/src/msca/plugins/multisig/utils/combineSignatures.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts +21 -2
- package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/index.d.ts +4 -0
- package/dist/types/src/msca/plugins/multisig/utils/index.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/extension.d.ts +13 -0
- package/dist/types/src/msca/plugins/session-key/extension.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/index.d.ts +1 -1
- package/dist/types/src/msca/plugins/session-key/index.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts +3 -0
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts +1 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/utils.d.ts +22 -2
- package/dist/types/src/msca/plugins/session-key/utils.d.ts.map +1 -1
- package/dist/types/src/msca/utils.d.ts +43 -5
- package/dist/types/src/msca/utils.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +2 -3
- package/src/light-account/accounts/account.ts +22 -3
- package/src/light-account/accounts/multiOwner.ts +26 -5
- package/src/light-account/actions/transferOwnership.ts +28 -5
- package/src/light-account/actions/updateOwners.ts +24 -0
- package/src/light-account/clients/alchemyClient.ts +20 -0
- package/src/light-account/clients/client.ts +27 -6
- package/src/light-account/clients/multiOwnerAlchemyClient.ts +20 -0
- package/src/light-account/clients/multiOwnerLightAccount.ts +27 -6
- package/src/light-account/decorators/lightAccount.ts +19 -0
- package/src/light-account/decorators/multiOwnerLightAccount.ts +19 -0
- package/src/light-account/utils.ts +29 -6
- package/src/msca/account/multiOwnerAccount.ts +36 -11
- package/src/msca/account/multisigAccount.ts +40 -14
- package/src/msca/account-loupe/decorator.ts +15 -0
- package/src/msca/client/alchemyClient.ts +20 -0
- package/src/msca/client/client.ts +46 -0
- package/src/msca/client/multiSigAlchemyClient.ts +22 -0
- package/src/msca/errors.ts +12 -0
- package/src/msca/plugin-manager/decorator.ts +22 -5
- package/src/msca/plugin-manager/installPlugin.ts +21 -0
- package/src/msca/plugins/multi-owner/extension.ts +15 -0
- package/src/msca/plugins/multi-owner/index.ts +3 -0
- package/src/msca/plugins/multisig/actions/proposeUserOperation.ts +1 -1
- package/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts +1 -1
- package/src/msca/plugins/multisig/extension.ts +13 -0
- package/src/msca/plugins/multisig/index.ts +1 -12
- package/src/msca/plugins/multisig/middleware.ts +2 -2
- package/src/msca/plugins/multisig/utils/combineSignatures.ts +36 -9
- package/src/msca/plugins/multisig/utils/getSignerType.ts +23 -4
- package/src/msca/plugins/multisig/utils/index.ts +4 -0
- package/src/msca/plugins/session-key/extension.ts +13 -0
- package/src/msca/plugins/session-key/index.ts +7 -1
- package/src/msca/plugins/session-key/permissions.ts +3 -0
- package/src/msca/plugins/session-key/signer.ts +1 -2
- package/src/msca/plugins/session-key/utils.ts +33 -12
- package/src/msca/utils.ts +64 -9
package/src/msca/errors.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BaseError } from "@aa-sdk/core";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when the aggregated signature is invalid
|
|
5
|
+
*/
|
|
3
6
|
export class InvalidAggregatedSignatureError extends BaseError {
|
|
4
7
|
override name = "InvalidAggregatedSignatureError";
|
|
5
8
|
constructor() {
|
|
@@ -7,6 +10,9 @@ export class InvalidAggregatedSignatureError extends BaseError {
|
|
|
7
10
|
}
|
|
8
11
|
}
|
|
9
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Error thrown when the context signature is invalid
|
|
15
|
+
*/
|
|
10
16
|
export class InvalidContextSignatureError extends BaseError {
|
|
11
17
|
override name = "InvalidContextSignatureError";
|
|
12
18
|
constructor() {
|
|
@@ -14,6 +20,9 @@ export class InvalidContextSignatureError extends BaseError {
|
|
|
14
20
|
}
|
|
15
21
|
}
|
|
16
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Error thrown when the expected account is not a multisig modular account
|
|
25
|
+
*/
|
|
17
26
|
export class MultisigAccountExpectedError extends BaseError {
|
|
18
27
|
override name = "MultisigAccountExpectedError";
|
|
19
28
|
constructor() {
|
|
@@ -21,6 +30,9 @@ export class MultisigAccountExpectedError extends BaseError {
|
|
|
21
30
|
}
|
|
22
31
|
}
|
|
23
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Error thrown when a multisig user op is missing a signature
|
|
35
|
+
*/
|
|
24
36
|
export class MultisigMissingSignatureError extends BaseError {
|
|
25
37
|
override name = "MultisigMissingSignatureError";
|
|
26
38
|
constructor() {
|
|
@@ -27,7 +27,22 @@ export type PluginManagerActions<
|
|
|
27
27
|
) => Promise<SendUserOperationResult<TEntryPointVersion>>;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Provides actions for managing plugins on a given client, including installing and uninstalling plugins.
|
|
32
|
+
* NOTE: this is provided by default when using a modular account client
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { pluginManagerActions } from "@account-kit/smart-contracts";
|
|
37
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
38
|
+
*
|
|
39
|
+
* const client = createSmartAccountClient(...).extend(pluginManagerActions);
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance on which to manage plugins
|
|
43
|
+
* @returns {PluginManagerActions<TAccount>} An object containing functions to install and uninstall plugins
|
|
44
|
+
*/
|
|
45
|
+
export function pluginManagerActions<
|
|
31
46
|
TTransport extends Transport = Transport,
|
|
32
47
|
TChain extends Chain | undefined = Chain | undefined,
|
|
33
48
|
TAccount extends SmartContractAccount | undefined =
|
|
@@ -35,7 +50,9 @@ export const pluginManagerActions: <
|
|
|
35
50
|
| undefined
|
|
36
51
|
>(
|
|
37
52
|
client: Client<TTransport, TChain, TAccount>
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
): PluginManagerActions<TAccount> {
|
|
54
|
+
return {
|
|
55
|
+
installPlugin: async (params) => installPlugin(client, params),
|
|
56
|
+
uninstallPlugin: async (params) => uninstallPlugin(client, params),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -40,6 +40,27 @@ export type InstallPluginParams<
|
|
|
40
40
|
GetAccountParameter<TAccount> &
|
|
41
41
|
GetContextParameter<TContext>;
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Installs a plugin on a smart account via the client, sending the user operation with the appropriate parameters.
|
|
45
|
+
* NOTE: it's recommended to just use the installPlugin action returned from generated plugins
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { installPlugin, createModularAccountAlchemyClient } from "@account-kit/smart-contracts";
|
|
50
|
+
*
|
|
51
|
+
* const client = createModularAccountAlchemyClient(...);
|
|
52
|
+
*
|
|
53
|
+
* const hash = await installPlugin(client, {
|
|
54
|
+
* pluginAddress: "0x...",
|
|
55
|
+
* manifestHash: "0x...",
|
|
56
|
+
* dependencies: [], // this is defined by the plugin you're installing
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client configured to the smart account on which the plugin will be installed
|
|
61
|
+
* @param {InstallPluginParams<TAccount, TContext>} params The parameters required to install the plugin, including overrides, context, and account information
|
|
62
|
+
* @returns {Promise<any>} A promise that resolves once the plugin installation operation is sent
|
|
63
|
+
*/
|
|
43
64
|
export async function installPlugin<
|
|
44
65
|
TTransport extends Transport = Transport,
|
|
45
66
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -33,6 +33,21 @@ export type MultiOwnerPluginActions<
|
|
|
33
33
|
}
|
|
34
34
|
: {});
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Creates actions for the MultiOwner plugin, including reading owners and checking ownership.
|
|
38
|
+
* NOTE: this is already added to the client returned from createMultiOwnerModularAccountClient
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { multiOwnerPluginActions } from "@account-kit/smart-contracts";
|
|
43
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
44
|
+
*
|
|
45
|
+
* const client = createSmartAccountClient(...).extend(multiOwnerPluginActions);
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @param {Client<TTransport, TChain, TAccount>} client the client instance containing the transport, chain, and account information
|
|
49
|
+
* @returns {MultiOwnerPluginActions<TAccount>} an object containing the actions for the MultiOwner plugin, such as `readOwners` and `isOwnerOf`
|
|
50
|
+
*/
|
|
36
51
|
export const multiOwnerPluginActions: <
|
|
37
52
|
TTransport extends Transport = Transport,
|
|
38
53
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
type UserOperationOverrides,
|
|
11
11
|
} from "@aa-sdk/core";
|
|
12
12
|
import { type Chain, type Client, type Transport } from "viem";
|
|
13
|
-
import { splitAggregatedSignature } from "../index.js";
|
|
14
13
|
import { type ProposeUserOperationResult } from "../types.js";
|
|
14
|
+
import { splitAggregatedSignature } from "../utils/splitAggregatedSignature.js";
|
|
15
15
|
|
|
16
16
|
export async function proposeUserOperation<
|
|
17
17
|
TTransport extends Transport = Transport,
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
} from "@aa-sdk/core";
|
|
9
9
|
import { type Chain, type Client, type Transport } from "viem";
|
|
10
10
|
import { MultisigMissingSignatureError } from "../../../errors.js";
|
|
11
|
-
import { combineSignatures, splitAggregatedSignature } from "../index.js";
|
|
12
11
|
import {
|
|
13
12
|
type SignMultisigUserOperationParams,
|
|
14
13
|
type SignMultisigUserOperationResult,
|
|
15
14
|
} from "../types.js";
|
|
15
|
+
import { combineSignatures, splitAggregatedSignature } from "../utils/index.js";
|
|
16
16
|
|
|
17
17
|
export async function signMultisigUserOperation<
|
|
18
18
|
TTransport extends Transport = Transport,
|
|
@@ -58,6 +58,19 @@ export type MultisigPluginActions<
|
|
|
58
58
|
}
|
|
59
59
|
: {});
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Provides actions for managing a multisig plugin within the specified client, including reading owners, checking ownership, getting the threshold, proposing user operations, and signing multisig user operations.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* import { createModularAccountAlchemyClient, multisigPluginActions } from "@account-kit/smart-contracts";
|
|
67
|
+
*
|
|
68
|
+
* const client = createModularAccountAlchemyClient(...).extend(multisigPluginActions);
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance configured with transport, chain, and account information
|
|
72
|
+
* @returns {MultisigPluginActions<TAccount>} An object containing methods to perform actions related to the multisig plugin
|
|
73
|
+
*/
|
|
61
74
|
export const multisigPluginActions: <
|
|
62
75
|
TTransport extends Transport = Transport,
|
|
63
76
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export { getThreshold } from "./actions/getThreshold.js";
|
|
2
|
-
export { isOwnerOf } from "./actions/isOwnerOf.js";
|
|
3
|
-
export { proposeUserOperation } from "./actions/proposeUserOperation.js";
|
|
4
|
-
export { readOwners } from "./actions/readOwners.js";
|
|
5
|
-
export { signMultisigUserOperation } from "./actions/signMultisigUserOperation.js";
|
|
6
1
|
export type * from "./extension.js";
|
|
7
2
|
export { multisigPluginActions } from "./extension.js";
|
|
8
3
|
export { multisigSignatureMiddleware } from "./middleware.js";
|
|
@@ -10,12 +5,6 @@ export {
|
|
|
10
5
|
MultisigPlugin,
|
|
11
6
|
MultisigPluginAbi,
|
|
12
7
|
MultisigPluginExecutionFunctionAbi,
|
|
8
|
+
type InstallMultisigPluginParams,
|
|
13
9
|
} from "./plugin.js";
|
|
14
10
|
export type * from "./types.js";
|
|
15
|
-
export { type SignerType } from "./types.js";
|
|
16
|
-
export {
|
|
17
|
-
combineSignatures,
|
|
18
|
-
formatSignatures,
|
|
19
|
-
getSignerType,
|
|
20
|
-
splitAggregatedSignature,
|
|
21
|
-
} from "./utils/index.js";
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
InvalidContextSignatureError,
|
|
16
16
|
MultisigAccountExpectedError,
|
|
17
17
|
} from "../../errors.js";
|
|
18
|
+
import { type MultisigUserOperationContext } from "./types.js";
|
|
18
19
|
import {
|
|
19
20
|
combineSignatures,
|
|
20
21
|
getSignerType,
|
|
21
22
|
splitAggregatedSignature,
|
|
22
|
-
|
|
23
|
-
} from "./index.js";
|
|
23
|
+
} from "./utils/index.js";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* A signer middleware to be used with Multisig Account Clients.
|
|
@@ -2,23 +2,50 @@ import { type Hex, concat, pad } from "viem";
|
|
|
2
2
|
import type { Signature } from "../types.js";
|
|
3
3
|
import { formatSignatures } from "./formatSignatures.js";
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
signatures,
|
|
7
|
-
upperLimitMaxFeePerGas,
|
|
8
|
-
upperLimitMaxPriorityFeePerGas,
|
|
9
|
-
upperLimitPvg,
|
|
10
|
-
usingMaxValues,
|
|
11
|
-
}: {
|
|
5
|
+
export type CombineSignaturesParams = {
|
|
12
6
|
upperLimitPvg: Hex;
|
|
13
7
|
upperLimitMaxFeePerGas: Hex;
|
|
14
8
|
upperLimitMaxPriorityFeePerGas: Hex;
|
|
15
9
|
signatures: Signature[];
|
|
16
10
|
usingMaxValues: boolean;
|
|
17
|
-
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Combines multiple signatures with provided upper limit values for gas fees and returns the concatenated result.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { combineSignatures } from "@account-kit/smart-contracts";
|
|
19
|
+
*
|
|
20
|
+
* const combinedSignature = combineSignatures({
|
|
21
|
+
* // this is the upper limit pre-verification gas
|
|
22
|
+
* upperLimitPvg: "0x01",
|
|
23
|
+
* upperLimitMaxFeePerGas: "0x02",
|
|
24
|
+
* upperLimitMaxPriorityFeePerGas: "0x03",
|
|
25
|
+
* signatures: [{
|
|
26
|
+
* signerType: "EOA",
|
|
27
|
+
* userOpSigType: "UPPERLIMIT",
|
|
28
|
+
* signer: `0x...`,
|
|
29
|
+
* signature: `0x...`,
|
|
30
|
+
* }]
|
|
31
|
+
* usingMaxValues: false,
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param {CombineSignaturesParams} params The function parameters
|
|
36
|
+
* @returns {Hex} The concatenated result of padding and formatting the provided values and signatures
|
|
37
|
+
*/
|
|
38
|
+
export function combineSignatures({
|
|
39
|
+
signatures,
|
|
40
|
+
upperLimitMaxFeePerGas,
|
|
41
|
+
upperLimitMaxPriorityFeePerGas,
|
|
42
|
+
upperLimitPvg,
|
|
43
|
+
usingMaxValues,
|
|
44
|
+
}: CombineSignaturesParams): Hex {
|
|
18
45
|
return concat([
|
|
19
46
|
pad(upperLimitPvg),
|
|
20
47
|
pad(upperLimitMaxFeePerGas),
|
|
21
48
|
pad(upperLimitMaxPriorityFeePerGas),
|
|
22
49
|
formatSignatures(signatures, usingMaxValues),
|
|
23
50
|
]);
|
|
24
|
-
}
|
|
51
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SmartAccountSigner, SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import {
|
|
3
|
-
type Transport,
|
|
4
3
|
type Chain,
|
|
5
4
|
type Client,
|
|
6
|
-
type PublicRpcSchema,
|
|
7
|
-
type PublicActions,
|
|
8
5
|
type Hex,
|
|
6
|
+
type PublicActions,
|
|
7
|
+
type PublicRpcSchema,
|
|
9
8
|
size,
|
|
9
|
+
type Transport,
|
|
10
10
|
} from "viem";
|
|
11
11
|
import type { SignerType } from "../types";
|
|
12
12
|
|
|
@@ -29,6 +29,25 @@ type GetSignerTypeParams<
|
|
|
29
29
|
client: TClient;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Determines the type of signer (Externally Owned Account (EOA) or CONTRACT) based on the provided client, signature, and signer.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { getSignerType } from "@account-kit/smart-contracts";
|
|
38
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
39
|
+
* import { createPublicClient, generatePrivateKey } from "viem";
|
|
40
|
+
*
|
|
41
|
+
* const signer = LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey());
|
|
42
|
+
* const client = createPublicClient(...);
|
|
43
|
+
* const signature = signer.signMessage("Hello World");
|
|
44
|
+
*
|
|
45
|
+
* const signerType = await getSignerType({ client, signature, signer }); // EOA
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @param {GetSignerTypeParams<TTransport, TChain>} params the parameters including the client, signature, and signer
|
|
49
|
+
* @returns {Promise<SignerType>} A promise that resolves to the signer type, which is either "EOA" or "CONTRACT"
|
|
50
|
+
*/
|
|
32
51
|
export const getSignerType = async <
|
|
33
52
|
TTransport extends Transport = Transport,
|
|
34
53
|
TChain extends Chain | undefined = Chain | undefined
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export type * from "./combineSignatures.js";
|
|
1
2
|
export { combineSignatures } from "./combineSignatures.js";
|
|
3
|
+
export type * from "./formatSignatures.js";
|
|
2
4
|
export { formatSignatures } from "./formatSignatures.js";
|
|
5
|
+
export type * from "./getSignerType.js";
|
|
3
6
|
export { getSignerType } from "./getSignerType.js";
|
|
7
|
+
export type * from "./splitAggregatedSignature.js";
|
|
4
8
|
export { splitAggregatedSignature } from "./splitAggregatedSignature.js";
|
|
@@ -82,6 +82,19 @@ export type SessionKeyPluginActions<
|
|
|
82
82
|
}
|
|
83
83
|
: {});
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Creates actions for managing session keys in a smart contract associated with a client, including adding, removing, rotating, and updating session key permissions.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* import { createModularAccountAlchemyClient, sessionKeyPluginActions } from "@account-kit/smart-contracts";
|
|
91
|
+
*
|
|
92
|
+
* const client = createModularAccountAlchemyClient(...).extend(sessionKeyPluginActions);
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance to use for managing session keys
|
|
96
|
+
* @returns {SessionKeyPluginActions<TAccount>} An object containing methods for session key management and interaction with the smart contract
|
|
97
|
+
*/
|
|
85
98
|
export const sessionKeyPluginActions: <
|
|
86
99
|
TTransport extends Transport = Transport,
|
|
87
100
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export type * from "./extension.js";
|
|
2
2
|
export { sessionKeyPluginActions } from "./extension.js";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
SessionKeyPlugin,
|
|
6
|
+
SessionKeyPluginAbi,
|
|
7
|
+
SessionKeyPluginExecutionFunctionAbi,
|
|
8
|
+
type InstallSessionKeyPluginParams,
|
|
9
|
+
} from "./plugin.js";
|
|
@@ -56,6 +56,9 @@ export type GasSpendLimit = {
|
|
|
56
56
|
refreshInterval?: number;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* A builder for creating the hex-encoded data for updating session key permissions.
|
|
61
|
+
*/
|
|
59
62
|
export class SessionKeyPermissionsBuilder {
|
|
60
63
|
private _contractAccessControlType: SessionKeyAccessListType =
|
|
61
64
|
SessionKeyAccessListType.ALLOWLIST;
|
|
@@ -18,14 +18,13 @@ export const SessionKeySignerSchema = z.object({
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
export type SessionKeySignerConfig = z.input<typeof SessionKeySignerSchema>;
|
|
21
|
+
export const SESSION_KEY_SIGNER_TYPE_PFX = "alchemy:session-key";
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* A simple session key signer that uses localStorage or sessionStorage to store
|
|
24
25
|
* a private key. If the key is not found, it will generate a new one and store
|
|
25
26
|
* it in the storage.
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
|
-
export const SESSION_KEY_SIGNER_TYPE_PFX = "alchemy:session-key";
|
|
29
28
|
export class SessionKeySigner
|
|
30
29
|
implements SmartAccountSigner<LocalAccountSigner<PrivateKeyAccount>>
|
|
31
30
|
{
|
|
@@ -3,9 +3,34 @@ import { AccountNotFoundError } from "@aa-sdk/core";
|
|
|
3
3
|
import type { Address, Chain, Client, Transport } from "viem";
|
|
4
4
|
import { SessionKeyPlugin } from "./plugin.js";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
type BuildSessionKeysToRemoveStructParams<
|
|
7
|
+
TAccount extends SmartContractAccount | undefined =
|
|
8
|
+
| SmartContractAccount
|
|
9
|
+
| undefined
|
|
10
|
+
> = {
|
|
11
|
+
keys: ReadonlyArray<Address>;
|
|
12
|
+
pluginAddress?: Address;
|
|
13
|
+
} & GetAccountParameter<TAccount>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Finds predecessors for each provided key and returns them in the struct `ISessionKeyPlugin.SessionKeyToRemove[]`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { buildSessionKeysToRemoveStruct } from "@account-kit/smart-contracts";
|
|
21
|
+
*
|
|
22
|
+
* const client = createSmartAccountClient(...);
|
|
23
|
+
*
|
|
24
|
+
* const keysToRemove = await buildSessionKeysToRemoveStruct(client, {
|
|
25
|
+
* keys: ["0x...", "0x..."],
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance used to interact with the smart account
|
|
30
|
+
* @param {BuildSessionKeysToRemoveStructParams<TAccount>} args Arguments to configure the session key removal process
|
|
31
|
+
* @returns {Promise<{ sessionKey: Address; predecessor: Address }[]>} A promise that resolves to an array of objects each containing a session key and its predecessor
|
|
32
|
+
*/
|
|
33
|
+
export async function buildSessionKeysToRemoveStruct<
|
|
9
34
|
TTransport extends Transport = Transport,
|
|
10
35
|
TChain extends Chain | undefined = Chain | undefined,
|
|
11
36
|
TAccount extends SmartContractAccount | undefined =
|
|
@@ -13,14 +38,10 @@ export const buildSessionKeysToRemoveStruct: <
|
|
|
13
38
|
| undefined
|
|
14
39
|
>(
|
|
15
40
|
client: Client<TTransport, TChain, TAccount>,
|
|
16
|
-
args:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
) => Promise<{ sessionKey: Address; predecessor: Address }[]> = async (
|
|
21
|
-
client,
|
|
22
|
-
{ keys, pluginAddress, account = client.account }
|
|
23
|
-
) => {
|
|
41
|
+
args: BuildSessionKeysToRemoveStructParams
|
|
42
|
+
): Promise<{ sessionKey: Address; predecessor: Address }[]> {
|
|
43
|
+
const { keys, pluginAddress, account = client.account } = args;
|
|
44
|
+
|
|
24
45
|
if (!account) throw new AccountNotFoundError();
|
|
25
46
|
|
|
26
47
|
const contract = SessionKeyPlugin.getContract(client, pluginAddress);
|
|
@@ -37,4 +58,4 @@ export const buildSessionKeysToRemoveStruct: <
|
|
|
37
58
|
sessionKey: key,
|
|
38
59
|
predecessor,
|
|
39
60
|
}));
|
|
40
|
-
}
|
|
61
|
+
}
|
package/src/msca/utils.ts
CHANGED
|
@@ -39,7 +39,7 @@ import { MultiOwnerPlugin } from "./plugins/multi-owner/plugin.js";
|
|
|
39
39
|
/**
|
|
40
40
|
* Utility method returning the default multi sig msca factory address given a {@link Chain} object
|
|
41
41
|
*
|
|
42
|
-
* @param chain
|
|
42
|
+
* @param chain a {@link Chain} object
|
|
43
43
|
* @returns a {@link Address} for the given chain
|
|
44
44
|
* @throws if the chain doesn't have an address currently deployed
|
|
45
45
|
*/
|
|
@@ -78,6 +78,30 @@ export const getDefaultMultiOwnerModularAccountFactoryAddress = (
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
+
export type GetMSCAUpgradeToData<
|
|
82
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
83
|
+
TAccount extends
|
|
84
|
+
| SmartContractAccountWithSigner<string, TSigner>
|
|
85
|
+
| undefined = SmartContractAccountWithSigner<string, TSigner> | undefined
|
|
86
|
+
> = {
|
|
87
|
+
multiOwnerPluginAddress?: Address;
|
|
88
|
+
} & GetAccountParameter<TAccount>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Retrieves the data necessary to upgrade to a Multi-Signature Contract Account (MSCA) and provides a method to create a Multi-Owner Modular Account.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* import { createLightAccountClient, getMSCAUpgradeToData } from "@account-kit/smart-contracts";
|
|
96
|
+
*
|
|
97
|
+
* const client = createLightAccountClient(...);
|
|
98
|
+
* const upgradeData = await getMSCAUpgradeToData(client, {});
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @param {SmartAccountClient<TTransport, TChain, TAccount>} client The smart account client
|
|
102
|
+
* @param {GetMSCAUpgradeToData<TSigner, TAccount>} args The arguments required for the upgrade
|
|
103
|
+
* @returns {Promise<UpgradeToData & { createMAAccount: () => Promise<MultiOwnerModularAccount<TSigner>>}>} A promise that resolves to upgrade data augmented with a function to create a Multi-Owner Modular Account
|
|
104
|
+
*/
|
|
81
105
|
export async function getMSCAUpgradeToData<
|
|
82
106
|
TTransport extends Transport = Transport,
|
|
83
107
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -87,9 +111,7 @@ export async function getMSCAUpgradeToData<
|
|
|
87
111
|
| undefined = SmartContractAccountWithSigner<string, TSigner> | undefined
|
|
88
112
|
>(
|
|
89
113
|
client: SmartAccountClient<TTransport, TChain, TAccount>,
|
|
90
|
-
args:
|
|
91
|
-
multiOwnerPluginAddress?: Address;
|
|
92
|
-
} & GetAccountParameter<TAccount>
|
|
114
|
+
args: GetMSCAUpgradeToData<TSigner, TAccount>
|
|
93
115
|
): Promise<
|
|
94
116
|
UpgradeToData & {
|
|
95
117
|
createMAAccount: () => Promise<MultiOwnerModularAccount<TSigner>>;
|
|
@@ -125,6 +147,39 @@ export async function getMSCAUpgradeToData<
|
|
|
125
147
|
};
|
|
126
148
|
}
|
|
127
149
|
|
|
150
|
+
export type GetMAInitializationDataParams<
|
|
151
|
+
TTransport extends Transport = Transport,
|
|
152
|
+
TChain extends Chain | undefined = Chain | undefined,
|
|
153
|
+
TAccount extends SmartContractAccount | undefined =
|
|
154
|
+
| SmartContractAccount
|
|
155
|
+
| undefined
|
|
156
|
+
> = {
|
|
157
|
+
multiOwnerPluginAddress?: Address;
|
|
158
|
+
client: SmartAccountClient<TTransport, TChain, TAccount>;
|
|
159
|
+
signerAddress: Address | Address[];
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Retrieves the initialization data for a multi-owner modular account. Throws an error if the client's chain is not found or if the multi-owner plugin address is not retrievable.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* import { getMAInitializationData } from "@account-kit/smart-contracts";
|
|
168
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
169
|
+
*
|
|
170
|
+
* const client = createSmartAccountClient(...);
|
|
171
|
+
* const initializationData = await getMAInitializationData({
|
|
172
|
+
* client,
|
|
173
|
+
* signerAddress: "0x...", // or array of signers
|
|
174
|
+
* });
|
|
175
|
+
* ```
|
|
176
|
+
*
|
|
177
|
+
* @param {GetMAInitializationDataParams<TTransport, TChain, TAccount>} params the parameters for getting initialization data
|
|
178
|
+
* @param {SmartAccountClient<TTransport, TChain, TAccount>} params.client the smart account client
|
|
179
|
+
* @param {Address | Address[]} params.signerAddress the address of the signer or an array of signer addresses
|
|
180
|
+
* @param {Address} [params.multiOwnerPluginAddress] optional address of the multi-owner plugin
|
|
181
|
+
* @returns {Promise<UpgradeToData>} a promise that resolves to the initialization data required for upgrading to a multi-owner modular account
|
|
182
|
+
*/
|
|
128
183
|
export async function getMAInitializationData<
|
|
129
184
|
TTransport extends Transport = Transport,
|
|
130
185
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -135,11 +190,11 @@ export async function getMAInitializationData<
|
|
|
135
190
|
client,
|
|
136
191
|
multiOwnerPluginAddress,
|
|
137
192
|
signerAddress,
|
|
138
|
-
}:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
193
|
+
}: GetMAInitializationDataParams<
|
|
194
|
+
TTransport,
|
|
195
|
+
TChain,
|
|
196
|
+
TAccount
|
|
197
|
+
>): Promise<UpgradeToData> {
|
|
143
198
|
if (!client.chain) {
|
|
144
199
|
throw new ChainNotFoundError();
|
|
145
200
|
}
|