@account-kit/smart-contracts 4.35.0 → 4.36.0
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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LocalAccountSigner, type SmartAccountSigner } from "@aa-sdk/core";
|
|
2
|
-
import type { PrivateKeyAccount, SignableMessage, TypedDataDefinition } from "viem";
|
|
2
|
+
import type { PrivateKeyAccount, SignableMessage, TypedData, TypedDataDefinition } from "viem";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
export declare const SessionKeySignerSchema: z.ZodObject<{
|
|
5
5
|
storageType: z.ZodDefault<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"local-storage">, z.ZodLiteral<"session-storage">]>, z.ZodType<Storage, z.ZodTypeDef, Storage>]>>;
|
|
6
6
|
storageKey: z.ZodDefault<z.ZodString>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
storageType:
|
|
8
|
+
storageType: "local-storage" | "session-storage" | Storage;
|
|
9
9
|
storageKey: string;
|
|
10
10
|
}, {
|
|
11
11
|
storageType?: "local-storage" | "session-storage" | Storage | undefined;
|
|
@@ -88,214 +88,9 @@ export declare class SessionKeySigner implements SmartAccountSigner<LocalAccount
|
|
|
88
88
|
* @param {TypedDataDefinition<TTypedData, TPrimaryType>} params The parameters containing the typed data definition and primary type.
|
|
89
89
|
* @returns {Promise<string>} A promise that resolves to the signed typed data as a string.
|
|
90
90
|
*/
|
|
91
|
-
signTypedData: <const TTypedData extends {
|
|
92
|
-
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
93
|
-
[x: `string[${string}]`]: undefined;
|
|
94
|
-
[x: `function[${string}]`]: undefined;
|
|
95
|
-
[x: `address[${string}]`]: undefined;
|
|
96
|
-
[x: `uint64[${string}]`]: undefined;
|
|
97
|
-
[x: `bytes32[${string}]`]: undefined;
|
|
98
|
-
[x: `bytes[${string}]`]: undefined;
|
|
99
|
-
[x: `uint256[${string}]`]: undefined;
|
|
100
|
-
[x: `bytes4[${string}]`]: undefined;
|
|
101
|
-
[x: `bool[${string}]`]: undefined;
|
|
102
|
-
[x: `bytes1[${string}]`]: undefined;
|
|
103
|
-
[x: `uint32[${string}]`]: undefined;
|
|
104
|
-
[x: `bytes2[${string}]`]: undefined;
|
|
105
|
-
[x: `bytes3[${string}]`]: undefined;
|
|
106
|
-
[x: `bytes5[${string}]`]: undefined;
|
|
107
|
-
[x: `bytes6[${string}]`]: undefined;
|
|
108
|
-
[x: `bytes11[${string}]`]: undefined;
|
|
109
|
-
[x: `bytes7[${string}]`]: undefined;
|
|
110
|
-
[x: `bytes9[${string}]`]: undefined;
|
|
111
|
-
[x: `bytes27[${string}]`]: undefined;
|
|
112
|
-
[x: `bytes22[${string}]`]: undefined;
|
|
113
|
-
[x: `bytes8[${string}]`]: undefined;
|
|
114
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
115
|
-
[x: `bytes12[${string}]`]: undefined;
|
|
116
|
-
[x: `bytes13[${string}]`]: undefined;
|
|
117
|
-
[x: `bytes14[${string}]`]: undefined;
|
|
118
|
-
[x: `bytes15[${string}]`]: undefined;
|
|
119
|
-
[x: `bytes16[${string}]`]: undefined;
|
|
120
|
-
[x: `bytes17[${string}]`]: undefined;
|
|
121
|
-
[x: `bytes18[${string}]`]: undefined;
|
|
122
|
-
[x: `bytes19[${string}]`]: undefined;
|
|
123
|
-
[x: `bytes20[${string}]`]: undefined;
|
|
124
|
-
[x: `bytes21[${string}]`]: undefined;
|
|
125
|
-
[x: `bytes23[${string}]`]: undefined;
|
|
126
|
-
[x: `bytes24[${string}]`]: undefined;
|
|
127
|
-
[x: `bytes25[${string}]`]: undefined;
|
|
128
|
-
[x: `bytes26[${string}]`]: undefined;
|
|
129
|
-
[x: `bytes28[${string}]`]: undefined;
|
|
130
|
-
[x: `bytes29[${string}]`]: undefined;
|
|
131
|
-
[x: `bytes30[${string}]`]: undefined;
|
|
132
|
-
[x: `bytes31[${string}]`]: undefined;
|
|
133
|
-
[x: `int[${string}]`]: undefined;
|
|
134
|
-
[x: `int8[${string}]`]: undefined;
|
|
135
|
-
[x: `int16[${string}]`]: undefined;
|
|
136
|
-
[x: `int24[${string}]`]: undefined;
|
|
137
|
-
[x: `int32[${string}]`]: undefined;
|
|
138
|
-
[x: `int40[${string}]`]: undefined;
|
|
139
|
-
[x: `int48[${string}]`]: undefined;
|
|
140
|
-
[x: `int56[${string}]`]: undefined;
|
|
141
|
-
[x: `int64[${string}]`]: undefined;
|
|
142
|
-
[x: `int72[${string}]`]: undefined;
|
|
143
|
-
[x: `int80[${string}]`]: undefined;
|
|
144
|
-
[x: `int88[${string}]`]: undefined;
|
|
145
|
-
[x: `int96[${string}]`]: undefined;
|
|
146
|
-
[x: `int104[${string}]`]: undefined;
|
|
147
|
-
[x: `int112[${string}]`]: undefined;
|
|
148
|
-
[x: `int120[${string}]`]: undefined;
|
|
149
|
-
[x: `int128[${string}]`]: undefined;
|
|
150
|
-
[x: `int136[${string}]`]: undefined;
|
|
151
|
-
[x: `int144[${string}]`]: undefined;
|
|
152
|
-
[x: `int152[${string}]`]: undefined;
|
|
153
|
-
[x: `int160[${string}]`]: undefined;
|
|
154
|
-
[x: `int168[${string}]`]: undefined;
|
|
155
|
-
[x: `int176[${string}]`]: undefined;
|
|
156
|
-
[x: `int184[${string}]`]: undefined;
|
|
157
|
-
[x: `int192[${string}]`]: undefined;
|
|
158
|
-
[x: `int200[${string}]`]: undefined;
|
|
159
|
-
[x: `int208[${string}]`]: undefined;
|
|
160
|
-
[x: `int216[${string}]`]: undefined;
|
|
161
|
-
[x: `int224[${string}]`]: undefined;
|
|
162
|
-
[x: `int232[${string}]`]: undefined;
|
|
163
|
-
[x: `int240[${string}]`]: undefined;
|
|
164
|
-
[x: `int248[${string}]`]: undefined;
|
|
165
|
-
[x: `int256[${string}]`]: undefined;
|
|
166
|
-
[x: `uint[${string}]`]: undefined;
|
|
167
|
-
[x: `uint8[${string}]`]: undefined;
|
|
168
|
-
[x: `uint16[${string}]`]: undefined;
|
|
169
|
-
[x: `uint24[${string}]`]: undefined;
|
|
170
|
-
[x: `uint40[${string}]`]: undefined;
|
|
171
|
-
[x: `uint48[${string}]`]: undefined;
|
|
172
|
-
[x: `uint56[${string}]`]: undefined;
|
|
173
|
-
[x: `uint72[${string}]`]: undefined;
|
|
174
|
-
[x: `uint80[${string}]`]: undefined;
|
|
175
|
-
[x: `uint88[${string}]`]: undefined;
|
|
176
|
-
[x: `uint96[${string}]`]: undefined;
|
|
177
|
-
[x: `uint104[${string}]`]: undefined;
|
|
178
|
-
[x: `uint112[${string}]`]: undefined;
|
|
179
|
-
[x: `uint120[${string}]`]: undefined;
|
|
180
|
-
[x: `uint128[${string}]`]: undefined;
|
|
181
|
-
[x: `uint136[${string}]`]: undefined;
|
|
182
|
-
[x: `uint144[${string}]`]: undefined;
|
|
183
|
-
[x: `uint152[${string}]`]: undefined;
|
|
184
|
-
[x: `uint160[${string}]`]: undefined;
|
|
185
|
-
[x: `uint168[${string}]`]: undefined;
|
|
186
|
-
[x: `uint176[${string}]`]: undefined;
|
|
187
|
-
[x: `uint184[${string}]`]: undefined;
|
|
188
|
-
[x: `uint192[${string}]`]: undefined;
|
|
189
|
-
[x: `uint200[${string}]`]: undefined;
|
|
190
|
-
[x: `uint208[${string}]`]: undefined;
|
|
191
|
-
[x: `uint216[${string}]`]: undefined;
|
|
192
|
-
[x: `uint224[${string}]`]: undefined;
|
|
193
|
-
[x: `uint232[${string}]`]: undefined;
|
|
194
|
-
[x: `uint240[${string}]`]: undefined;
|
|
195
|
-
[x: `uint248[${string}]`]: undefined;
|
|
196
|
-
string?: undefined;
|
|
197
|
-
address?: undefined;
|
|
198
|
-
uint64?: undefined;
|
|
199
|
-
bytes32?: undefined;
|
|
200
|
-
bytes?: undefined;
|
|
201
|
-
uint256?: undefined;
|
|
202
|
-
bytes4?: undefined;
|
|
203
|
-
bool?: undefined;
|
|
204
|
-
bytes1?: undefined;
|
|
205
|
-
uint32?: undefined;
|
|
206
|
-
bytes2?: undefined;
|
|
207
|
-
bytes3?: undefined;
|
|
208
|
-
bytes5?: undefined;
|
|
209
|
-
bytes6?: undefined;
|
|
210
|
-
bytes11?: undefined;
|
|
211
|
-
bytes7?: undefined;
|
|
212
|
-
bytes9?: undefined;
|
|
213
|
-
bytes27?: undefined;
|
|
214
|
-
bytes22?: undefined;
|
|
215
|
-
bytes8?: undefined;
|
|
216
|
-
bytes10?: undefined;
|
|
217
|
-
bytes12?: undefined;
|
|
218
|
-
bytes13?: undefined;
|
|
219
|
-
bytes14?: undefined;
|
|
220
|
-
bytes15?: undefined;
|
|
221
|
-
bytes16?: undefined;
|
|
222
|
-
bytes17?: undefined;
|
|
223
|
-
bytes18?: undefined;
|
|
224
|
-
bytes19?: undefined;
|
|
225
|
-
bytes20?: undefined;
|
|
226
|
-
bytes21?: undefined;
|
|
227
|
-
bytes23?: undefined;
|
|
228
|
-
bytes24?: undefined;
|
|
229
|
-
bytes25?: undefined;
|
|
230
|
-
bytes26?: undefined;
|
|
231
|
-
bytes28?: undefined;
|
|
232
|
-
bytes29?: undefined;
|
|
233
|
-
bytes30?: undefined;
|
|
234
|
-
bytes31?: undefined;
|
|
235
|
-
int8?: undefined;
|
|
236
|
-
int16?: undefined;
|
|
237
|
-
int24?: undefined;
|
|
238
|
-
int32?: undefined;
|
|
239
|
-
int40?: undefined;
|
|
240
|
-
int48?: undefined;
|
|
241
|
-
int56?: undefined;
|
|
242
|
-
int64?: undefined;
|
|
243
|
-
int72?: undefined;
|
|
244
|
-
int80?: undefined;
|
|
245
|
-
int88?: undefined;
|
|
246
|
-
int96?: undefined;
|
|
247
|
-
int104?: undefined;
|
|
248
|
-
int112?: undefined;
|
|
249
|
-
int120?: undefined;
|
|
250
|
-
int128?: undefined;
|
|
251
|
-
int136?: undefined;
|
|
252
|
-
int144?: undefined;
|
|
253
|
-
int152?: undefined;
|
|
254
|
-
int160?: undefined;
|
|
255
|
-
int168?: undefined;
|
|
256
|
-
int176?: undefined;
|
|
257
|
-
int184?: undefined;
|
|
258
|
-
int192?: undefined;
|
|
259
|
-
int200?: undefined;
|
|
260
|
-
int208?: undefined;
|
|
261
|
-
int216?: undefined;
|
|
262
|
-
int224?: undefined;
|
|
263
|
-
int232?: undefined;
|
|
264
|
-
int240?: undefined;
|
|
265
|
-
int248?: undefined;
|
|
266
|
-
int256?: undefined;
|
|
267
|
-
uint8?: undefined;
|
|
268
|
-
uint16?: undefined;
|
|
269
|
-
uint24?: undefined;
|
|
270
|
-
uint40?: undefined;
|
|
271
|
-
uint48?: undefined;
|
|
272
|
-
uint56?: undefined;
|
|
273
|
-
uint72?: undefined;
|
|
274
|
-
uint80?: undefined;
|
|
275
|
-
uint88?: undefined;
|
|
276
|
-
uint96?: undefined;
|
|
277
|
-
uint104?: undefined;
|
|
278
|
-
uint112?: undefined;
|
|
279
|
-
uint120?: undefined;
|
|
280
|
-
uint128?: undefined;
|
|
281
|
-
uint136?: undefined;
|
|
282
|
-
uint144?: undefined;
|
|
283
|
-
uint152?: undefined;
|
|
284
|
-
uint160?: undefined;
|
|
285
|
-
uint168?: undefined;
|
|
286
|
-
uint176?: undefined;
|
|
287
|
-
uint184?: undefined;
|
|
288
|
-
uint192?: undefined;
|
|
289
|
-
uint200?: undefined;
|
|
290
|
-
uint208?: undefined;
|
|
291
|
-
uint216?: undefined;
|
|
292
|
-
uint224?: undefined;
|
|
293
|
-
uint232?: undefined;
|
|
294
|
-
uint240?: undefined;
|
|
295
|
-
uint248?: undefined;
|
|
296
|
-
} | {
|
|
91
|
+
signTypedData: <const TTypedData extends TypedData | {
|
|
297
92
|
[key: string]: unknown;
|
|
298
|
-
}, TPrimaryType extends "EIP712Domain"
|
|
93
|
+
}, TPrimaryType extends keyof TTypedData | "EIP712Domain" = keyof TTypedData>(params: TypedDataDefinition<TTypedData, TPrimaryType>) => Promise<`0x${string}`>;
|
|
299
94
|
/**
|
|
300
95
|
* Generates a new private key and stores it in the storage.
|
|
301
96
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../../../../src/msca/plugins/session-key/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAEV,iBAAiB,EACjB,eAAe,
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../../../../src/msca/plugins/session-key/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAEV,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,mBAAmB,EACpB,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB;;;;;;;;;EAMjC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AAEjE;;;;GAIG;AACH,qBAAa,gBACX,YAAW,kBAAkB,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAEpE,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAC7C,OAAO,CAAC,WAAW,CAAgD;IACnE,OAAO,CAAC,UAAU,CAAS;IAE3B;;;;;;;;;;;OAWG;gBACS,OAAO,GAAE,sBAA2B;IA2BhD;;;;;;;;;;;;OAYG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAEtC;IAEF;;;;;;;;;;;;;OAaG;IACH,WAAW,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAI3D;IAEF;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,aAAa,GACX,KAAK,CAAC,UAAU,SAAS,SAAS,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,EAC/D,YAAY,SAAS,MAAM,UAAU,GAAG,cAAc,GAAG,MAAM,UAAU,EAEzE,QAAQ,mBAAmB,CAAC,UAAU,EAAE,YAAY,CAAC,4BAGrD;IAEF;;;;;;;;;;;;OAYG;IACH,cAAc,sBASZ;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/msca/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAatB,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAYtD,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,gCAAgC,CAAC;AAGxC;;;;;;GAMG;AACH,eAAO,MAAM,8CAA8C,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/msca/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAatB,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAYtD,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,gCAAgC,CAAC;AAGxC;;;;;;GAMG;AACH,eAAO,MAAM,8CAA8C,GACzD,OAAO,KAAK,KACX,OAeF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gDAAgD,GAC3D,OAAO,KAAK,KACX,OAKF,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAC9B,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,QAAQ,SACJ,8BAA8B,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/C,SAAS,GAAG,8BAA8B,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,IACzE;IACF,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAElC;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,QAAQ,SACJ,8BAA8B,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/C,SAAS,GAAG,8BAA8B,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAE3E,MAAM,EAAE,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EACxD,IAAI,EAAE,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAC5C,OAAO,CACR,aAAa,GAAG;IACd,eAAe,EAAE,MAAM,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;CACnE,CACF,CA6BA;AAED,MAAM,MAAM,6BAA6B,CACvC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,IACX;IACF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,MAAM,EAAE,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzD,aAAa,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;CACpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,EACA,MAAM,EACN,uBAAuB,EACvB,aAAa,GACd,EAAE,6BAA6B,CAC9B,UAAU,EACV,MAAM,EACN,QAAQ,CACT,GAAG,OAAO,CAAC,aAAa,CAAC,CAwDzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@account-kit/smart-contracts",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.36.0",
|
|
4
4
|
"description": "aa-sdk compatible interfaces for Alchemy Smart Accounts",
|
|
5
5
|
"author": "Alchemy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,13 +52,11 @@
|
|
|
52
52
|
"test:run": "vitest run"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@account-kit/plugingen": "^4.
|
|
55
|
+
"@account-kit/plugingen": "^4.36.0",
|
|
56
56
|
"change-case": "^5.1.2",
|
|
57
57
|
"dedent": "^1.5.1",
|
|
58
58
|
"dotenv": "^16.3.1",
|
|
59
|
-
"typescript": "
|
|
60
|
-
"typescript-template": "*",
|
|
61
|
-
"vitest": "^2.0.4"
|
|
59
|
+
"typescript-template": "*"
|
|
62
60
|
},
|
|
63
61
|
"publishConfig": {
|
|
64
62
|
"access": "public",
|
|
@@ -72,12 +70,12 @@
|
|
|
72
70
|
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
73
71
|
},
|
|
74
72
|
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
|
|
75
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "298acffb1a9d648b4136e154c0354c1efe1c89f7",
|
|
76
74
|
"dependencies": {
|
|
77
|
-
"@aa-sdk/core": "^4.
|
|
78
|
-
"@account-kit/infra": "^4.
|
|
75
|
+
"@aa-sdk/core": "^4.36.0",
|
|
76
|
+
"@account-kit/infra": "^4.36.0"
|
|
79
77
|
},
|
|
80
78
|
"peerDependencies": {
|
|
81
|
-
"viem": "
|
|
79
|
+
"viem": "2.29.2"
|
|
82
80
|
}
|
|
83
81
|
}
|
|
@@ -41,7 +41,7 @@ export const SessionKeyPluginGenConfig: PluginConfig = {
|
|
|
41
41
|
},
|
|
42
42
|
installConfig: {
|
|
43
43
|
initAbiParams: parseAbiParameters(
|
|
44
|
-
"address[] initialKeys, bytes32[] tags, bytes[][] initialPermissions"
|
|
44
|
+
"address[] initialKeys, bytes32[] tags, bytes[][] initialPermissions",
|
|
45
45
|
),
|
|
46
46
|
dependencies: [
|
|
47
47
|
{
|
|
@@ -35,7 +35,8 @@ import { predictLightAccountAddress } from "./predictAddress.js";
|
|
|
35
35
|
|
|
36
36
|
export type LightAccount<
|
|
37
37
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
38
|
-
TLightAccountVersion extends
|
|
38
|
+
TLightAccountVersion extends
|
|
39
|
+
LightAccountVersion<"LightAccount"> = LightAccountVersion<"LightAccount">,
|
|
39
40
|
> = LightAccountBase<TSigner, "LightAccount", TLightAccountVersion> & {
|
|
40
41
|
encodeTransferOwnership: (newOwner: Address) => Hex;
|
|
41
42
|
getOwnerAddress: () => Promise<Address>;
|
|
@@ -45,7 +46,8 @@ export type LightAccount<
|
|
|
45
46
|
export type CreateLightAccountParams<
|
|
46
47
|
TTransport extends Transport = Transport,
|
|
47
48
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
48
|
-
TLightAccountVersion extends
|
|
49
|
+
TLightAccountVersion extends
|
|
50
|
+
LightAccountVersion<"LightAccount"> = LightAccountVersion<"LightAccount">,
|
|
49
51
|
> = Omit<
|
|
50
52
|
CreateLightAccountBaseParams<
|
|
51
53
|
"LightAccount",
|
|
@@ -75,9 +77,9 @@ export type CreateLightAccountParams<
|
|
|
75
77
|
export async function createLightAccount<
|
|
76
78
|
TTransport extends Transport = Transport,
|
|
77
79
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
78
|
-
TLightAccountVersion extends LightAccountVersion<"LightAccount"> = "v2.0.0"
|
|
80
|
+
TLightAccountVersion extends LightAccountVersion<"LightAccount"> = "v2.0.0",
|
|
79
81
|
>(
|
|
80
|
-
config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion
|
|
82
|
+
config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>,
|
|
81
83
|
): Promise<LightAccount<TSigner, TLightAccountVersion>>;
|
|
82
84
|
|
|
83
85
|
/**
|
|
@@ -129,7 +131,7 @@ export async function createLightAccount({
|
|
|
129
131
|
const signerAddress = await signer.getAddress();
|
|
130
132
|
|
|
131
133
|
const salt = LightAccountUnsupported1271Factories.has(
|
|
132
|
-
factoryAddress.toLowerCase() as Address
|
|
134
|
+
factoryAddress.toLowerCase() as Address,
|
|
133
135
|
)
|
|
134
136
|
? 0n
|
|
135
137
|
: salt_;
|
|
@@ -38,7 +38,8 @@ enum SignatureType {
|
|
|
38
38
|
export type LightAccountBase<
|
|
39
39
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
40
40
|
TLightAccountType extends LightAccountType = LightAccountType,
|
|
41
|
-
TLightAccountVersion extends
|
|
41
|
+
TLightAccountVersion extends
|
|
42
|
+
LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>,
|
|
42
43
|
> = SmartContractAccountWithSigner<
|
|
43
44
|
TLightAccountType,
|
|
44
45
|
TSigner,
|
|
@@ -50,9 +51,10 @@ export type LightAccountBase<
|
|
|
50
51
|
//#region CreateLightAccountBaseParams
|
|
51
52
|
export type CreateLightAccountBaseParams<
|
|
52
53
|
TLightAccountType extends LightAccountType,
|
|
53
|
-
TLightAccountVersion extends
|
|
54
|
+
TLightAccountVersion extends
|
|
55
|
+
LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>,
|
|
54
56
|
TTransport extends Transport = Transport,
|
|
55
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
57
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
56
58
|
> = Pick<
|
|
57
59
|
ToSmartContractAccountParams<TLightAccountType, TTransport, Chain>,
|
|
58
60
|
"transport" | "chain" | "getAccountInitCode"
|
|
@@ -73,7 +75,7 @@ export async function createLightAccountBase<
|
|
|
73
75
|
TLightAccountType extends LightAccountType,
|
|
74
76
|
TLightAccountVersion extends LightAccountVersion<TLightAccountType>,
|
|
75
77
|
TTransport extends Transport = Transport,
|
|
76
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
78
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
77
79
|
>({
|
|
78
80
|
transport,
|
|
79
81
|
chain,
|
|
@@ -110,14 +112,15 @@ export async function createLightAccountBase<
|
|
|
110
112
|
if (storage == null) {
|
|
111
113
|
throw new FailedToGetStorageSlotError(
|
|
112
114
|
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc",
|
|
113
|
-
"Proxy Implementation Address"
|
|
115
|
+
"Proxy Implementation Address",
|
|
114
116
|
);
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
const implementationAddresses = Object.values(
|
|
118
|
-
AccountVersionRegistry[type]
|
|
120
|
+
AccountVersionRegistry[type],
|
|
119
121
|
).map(
|
|
120
|
-
(x) =>
|
|
122
|
+
(x) =>
|
|
123
|
+
x.addresses.overrides?.[chain.id]?.impl ?? x.addresses.default.impl,
|
|
121
124
|
);
|
|
122
125
|
|
|
123
126
|
// only upgrade undeployed accounts (storage 0) or deployed light accounts, error otherwise
|
|
@@ -127,8 +130,8 @@ export async function createLightAccountBase<
|
|
|
127
130
|
) {
|
|
128
131
|
throw new Error(
|
|
129
132
|
`could not determine if smart account implementation is ${type} ${String(
|
|
130
|
-
version
|
|
131
|
-
)}
|
|
133
|
+
version,
|
|
134
|
+
)}`,
|
|
132
135
|
);
|
|
133
136
|
}
|
|
134
137
|
|
|
@@ -141,7 +144,7 @@ export async function createLightAccountBase<
|
|
|
141
144
|
|
|
142
145
|
const signWith1271Wrapper = async (
|
|
143
146
|
hashedMessage: Hex,
|
|
144
|
-
version: string
|
|
147
|
+
version: string,
|
|
145
148
|
): Promise<Hex> => {
|
|
146
149
|
return signer.signTypedData({
|
|
147
150
|
// EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)
|
|
@@ -185,7 +188,7 @@ export async function createLightAccountBase<
|
|
|
185
188
|
|
|
186
189
|
return accum;
|
|
187
190
|
},
|
|
188
|
-
[[], [], []] as [Address[], bigint[], Hex[]]
|
|
191
|
+
[[], [], []] as [Address[], bigint[], Hex[]],
|
|
189
192
|
);
|
|
190
193
|
return encodeFunctionData({
|
|
191
194
|
abi,
|
|
@@ -214,7 +217,7 @@ export async function createLightAccountBase<
|
|
|
214
217
|
case "v2.0.0":
|
|
215
218
|
const signature = await signWith1271Wrapper(
|
|
216
219
|
hashMessage(message),
|
|
217
|
-
"2"
|
|
220
|
+
"2",
|
|
218
221
|
);
|
|
219
222
|
// TODO: handle case where signer is an SCA.
|
|
220
223
|
return concat([SignatureType.EOA, signature]);
|
|
@@ -226,18 +229,18 @@ export async function createLightAccountBase<
|
|
|
226
229
|
switch (version as string) {
|
|
227
230
|
case "v1.0.1":
|
|
228
231
|
return signer.signTypedData(
|
|
229
|
-
params as unknown as SignTypedDataParameters
|
|
232
|
+
params as unknown as SignTypedDataParameters,
|
|
230
233
|
);
|
|
231
234
|
case "v1.0.2":
|
|
232
235
|
throw new Error(
|
|
233
|
-
`Version ${String(version)} of LightAccount doesn't support 1271
|
|
236
|
+
`Version ${String(version)} of LightAccount doesn't support 1271`,
|
|
234
237
|
);
|
|
235
238
|
case "v1.1.0":
|
|
236
239
|
return signWith1271Wrapper(hashTypedData(params), "1");
|
|
237
240
|
case "v2.0.0":
|
|
238
241
|
const signature = await signWith1271Wrapper(
|
|
239
242
|
hashTypedData(params),
|
|
240
|
-
"2"
|
|
243
|
+
"2",
|
|
241
244
|
);
|
|
242
245
|
// TODO: handle case where signer is an SCA.
|
|
243
246
|
return concat([SignatureType.EOA, signature]);
|
|
@@ -32,7 +32,8 @@ import { predictMultiOwnerLightAccountAddress } from "./predictAddress.js";
|
|
|
32
32
|
|
|
33
33
|
export type MultiOwnerLightAccount<
|
|
34
34
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
35
|
-
TLightAccountVersion extends
|
|
35
|
+
TLightAccountVersion extends
|
|
36
|
+
LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">,
|
|
36
37
|
> = LightAccountBase<
|
|
37
38
|
TSigner,
|
|
38
39
|
"MultiOwnerLightAccount",
|
|
@@ -40,7 +41,7 @@ export type MultiOwnerLightAccount<
|
|
|
40
41
|
> & {
|
|
41
42
|
encodeUpdateOwners: (
|
|
42
43
|
ownersToAdd: Address[],
|
|
43
|
-
ownersToRemove: Address[]
|
|
44
|
+
ownersToRemove: Address[],
|
|
44
45
|
) => Hex;
|
|
45
46
|
getOwnerAddresses: () => Promise<readonly Address[]>;
|
|
46
47
|
};
|
|
@@ -48,7 +49,8 @@ export type MultiOwnerLightAccount<
|
|
|
48
49
|
export type CreateMultiOwnerLightAccountParams<
|
|
49
50
|
TTransport extends Transport = Transport,
|
|
50
51
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
51
|
-
TLightAccountVersion extends
|
|
52
|
+
TLightAccountVersion extends
|
|
53
|
+
LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">,
|
|
52
54
|
> = Omit<
|
|
53
55
|
CreateLightAccountBaseParams<
|
|
54
56
|
"MultiOwnerLightAccount",
|
|
@@ -81,13 +83,14 @@ export type CreateMultiOwnerLightAccountParams<
|
|
|
81
83
|
export async function createMultiOwnerLightAccount<
|
|
82
84
|
TTransport extends Transport = Transport,
|
|
83
85
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
84
|
-
TLightAccountVersion extends
|
|
86
|
+
TLightAccountVersion extends
|
|
87
|
+
LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">,
|
|
85
88
|
>(
|
|
86
89
|
config: CreateMultiOwnerLightAccountParams<
|
|
87
90
|
TTransport,
|
|
88
91
|
TSigner,
|
|
89
92
|
TLightAccountVersion
|
|
90
|
-
|
|
93
|
+
>,
|
|
91
94
|
): Promise<MultiOwnerLightAccount<TSigner, TLightAccountVersion>>;
|
|
92
95
|
|
|
93
96
|
/**
|
|
@@ -122,7 +125,7 @@ export async function createMultiOwnerLightAccount({
|
|
|
122
125
|
accountAddress,
|
|
123
126
|
factoryAddress = getDefaultMultiOwnerLightAccountFactoryAddress(
|
|
124
127
|
chain,
|
|
125
|
-
version
|
|
128
|
+
version,
|
|
126
129
|
),
|
|
127
130
|
salt: salt_ = 0n,
|
|
128
131
|
owners = [],
|
|
@@ -68,8 +68,8 @@ export function predictLightAccountAddress({
|
|
|
68
68
|
const combinedSalt = keccak256(
|
|
69
69
|
encodeAbiParameters(
|
|
70
70
|
[{ type: "address" }, { type: "uint256" }],
|
|
71
|
-
[ownerAddress, salt]
|
|
72
|
-
)
|
|
71
|
+
[ownerAddress, salt],
|
|
72
|
+
),
|
|
73
73
|
);
|
|
74
74
|
|
|
75
75
|
const initCode: Hex = getLAv2ProxyBytecode(implementationAddress);
|
|
@@ -115,8 +115,8 @@ export function predictMultiOwnerLightAccountAddress({
|
|
|
115
115
|
const combinedSalt = keccak256(
|
|
116
116
|
encodeAbiParameters(
|
|
117
117
|
[{ type: "address[]" }, { type: "uint256" }],
|
|
118
|
-
[ownerAddresses, salt]
|
|
119
|
-
)
|
|
118
|
+
[ownerAddresses, salt],
|
|
119
|
+
),
|
|
120
120
|
);
|
|
121
121
|
|
|
122
122
|
const initCode: Hex = getLAv2ProxyBytecode(implementationAddress);
|
|
@@ -133,7 +133,7 @@ export function predictMultiOwnerLightAccountAddress({
|
|
|
133
133
|
|
|
134
134
|
function getLAv2ProxyBytecode(implementationAddress: Address): Hex {
|
|
135
135
|
return `0x603d3d8160223d3973${implementationAddress.slice(
|
|
136
|
-
2
|
|
136
|
+
2,
|
|
137
137
|
)}60095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3`;
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -15,7 +15,8 @@ export type TransferLightAccountOwnershipParams<
|
|
|
15
15
|
TAccount extends LightAccount<TSigner> | undefined =
|
|
16
16
|
| LightAccount<TSigner>
|
|
17
17
|
| undefined,
|
|
18
|
-
TEntryPointVersion extends
|
|
18
|
+
TEntryPointVersion extends
|
|
19
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
19
20
|
> = {
|
|
20
21
|
newOwner: TSigner;
|
|
21
22
|
waitForTxn?: boolean;
|
|
@@ -53,10 +54,10 @@ export const transferOwnership = async <
|
|
|
53
54
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
54
55
|
TAccount extends LightAccount<TSigner> | undefined =
|
|
55
56
|
| LightAccount<TSigner>
|
|
56
|
-
| undefined
|
|
57
|
+
| undefined,
|
|
57
58
|
>(
|
|
58
59
|
client: Client<TTransport, TChain, TAccount>,
|
|
59
|
-
args: TransferLightAccountOwnershipParams<TSigner, TAccount
|
|
60
|
+
args: TransferLightAccountOwnershipParams<TSigner, TAccount>,
|
|
60
61
|
): Promise<Hex> => {
|
|
61
62
|
const { newOwner, waitForTxn, overrides, account = client.account } = args;
|
|
62
63
|
if (!account) {
|
|
@@ -67,7 +68,7 @@ export const transferOwnership = async <
|
|
|
67
68
|
throw new IncompatibleClientError(
|
|
68
69
|
"SmartAccountClient",
|
|
69
70
|
"transferOwnership",
|
|
70
|
-
client
|
|
71
|
+
client,
|
|
71
72
|
);
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -15,7 +15,8 @@ export type UpdateMultiOwnerLightAccountOwnersParams<
|
|
|
15
15
|
TAccount extends MultiOwnerLightAccount<TSigner> | undefined =
|
|
16
16
|
| MultiOwnerLightAccount<TSigner>
|
|
17
17
|
| undefined,
|
|
18
|
-
TEntryPointVersion extends
|
|
18
|
+
TEntryPointVersion extends
|
|
19
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
19
20
|
> = {
|
|
20
21
|
ownersToAdd: Address[];
|
|
21
22
|
ownersToRemove: Address[];
|
|
@@ -53,10 +54,10 @@ export const updateOwners: <
|
|
|
53
54
|
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
54
55
|
TAccount extends MultiOwnerLightAccount<TSigner> | undefined =
|
|
55
56
|
| MultiOwnerLightAccount<TSigner>
|
|
56
|
-
| undefined
|
|
57
|
+
| undefined,
|
|
57
58
|
>(
|
|
58
59
|
client: Client<TTransport, TChain, TAccount>,
|
|
59
|
-
args: UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount
|
|
60
|
+
args: UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount>,
|
|
60
61
|
) => Promise<Hex> = async (
|
|
61
62
|
client,
|
|
62
63
|
{
|
|
@@ -65,7 +66,7 @@ export const updateOwners: <
|
|
|
65
66
|
waitForTxn,
|
|
66
67
|
overrides,
|
|
67
68
|
account = client.account,
|
|
68
|
-
}
|
|
69
|
+
},
|
|
69
70
|
) => {
|
|
70
71
|
if (!account) {
|
|
71
72
|
throw new AccountNotFoundError();
|
|
@@ -75,7 +76,7 @@ export const updateOwners: <
|
|
|
75
76
|
throw new IncompatibleClientError(
|
|
76
77
|
"SmartAccountClient",
|
|
77
78
|
"updateOwners",
|
|
78
|
-
client
|
|
79
|
+
client,
|
|
79
80
|
);
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { type Chain } from "viem";
|
|
13
13
|
|
|
14
14
|
export type AlchemyLightAccountClientConfig<
|
|
15
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
15
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
16
16
|
> = Omit<CreateLightAccountParams<HttpTransport, TSigner>, "transport"> &
|
|
17
17
|
Omit<
|
|
18
18
|
AlchemySmartAccountClientConfig<Chain, LightAccount<TSigner>>,
|
|
@@ -20,9 +20,9 @@ export type AlchemyLightAccountClientConfig<
|
|
|
20
20
|
>;
|
|
21
21
|
|
|
22
22
|
export async function createLightAccountAlchemyClient<
|
|
23
|
-
TSigner extends SmartAccountSigner = SmartAccountSigner
|
|
23
|
+
TSigner extends SmartAccountSigner = SmartAccountSigner,
|
|
24
24
|
>(
|
|
25
|
-
params: AlchemyLightAccountClientConfig<TSigner
|
|
25
|
+
params: AlchemyLightAccountClientConfig<TSigner>,
|
|
26
26
|
): Promise<
|
|
27
27
|
AlchemySmartAccountClient<
|
|
28
28
|
Chain | undefined,
|