@account-kit/wallet-client 0.1.0-alpha.7 → 0.1.0-alpha.9
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/capabilities/index.d.ts +3 -0
- package/dist/esm/capabilities/index.js +2 -0
- package/dist/esm/capabilities/index.js.map +1 -1
- package/dist/esm/capabilities/multiDimensionalNonce.d.ts +3 -0
- package/dist/esm/capabilities/multiDimensionalNonce.js +7 -0
- package/dist/esm/capabilities/multiDimensionalNonce.js.map +1 -0
- package/dist/esm/client/actions/prepareCalls.d.ts +1 -1
- package/dist/esm/client/actions/prepareCalls.js +1 -1
- package/dist/esm/client/actions/prepareCalls.js.map +1 -1
- package/dist/esm/client/actions/signPreparedCalls.js +26 -37
- package/dist/esm/client/actions/signPreparedCalls.js.map +1 -1
- package/dist/esm/client/actions/signSignatureRequest.d.ts +3 -2
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
- package/dist/esm/exports/internal.d.ts +1 -0
- package/dist/esm/exports/internal.js +1 -0
- package/dist/esm/exports/internal.js.map +1 -1
- package/dist/esm/isomorphic/actions/createSession.js +20 -5
- package/dist/esm/isomorphic/actions/createSession.js.map +1 -1
- package/dist/esm/isomorphic/actions/prepareCalls.js +39 -17
- package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -1
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js +62 -8
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/isomorphic/client.d.ts +9 -0
- package/dist/esm/isomorphic/utils/7702.d.ts +6 -1
- package/dist/esm/isomorphic/utils/7702.js +26 -12
- package/dist/esm/isomorphic/utils/7702.js.map +1 -1
- package/dist/esm/isomorphic/utils/createAccount.d.ts +1 -0
- package/dist/esm/isomorphic/utils/createAccount.js +96 -34
- package/dist/esm/isomorphic/utils/createAccount.js.map +1 -1
- package/dist/esm/isomorphic/utils/supportsFeature.d.ts +4 -0
- package/dist/esm/isomorphic/utils/supportsFeature.js +21 -0
- package/dist/esm/isomorphic/utils/supportsFeature.js.map +1 -0
- package/dist/esm/rpc/request.d.ts +54 -0
- package/dist/esm/rpc/request.js +1 -0
- package/dist/esm/rpc/request.js.map +1 -1
- package/dist/esm/rpc/schema.d.ts +54 -0
- package/dist/esm/schemas.d.ts +35 -1
- package/dist/esm/schemas.js +56 -1
- package/dist/esm/schemas.js.map +1 -1
- package/dist/esm/types.d.ts +3 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils.d.ts +1 -0
- package/dist/esm/utils.js.map +1 -1
- package/dist/types/capabilities/index.d.ts +3 -0
- package/dist/types/capabilities/index.d.ts.map +1 -1
- package/dist/types/capabilities/multiDimensionalNonce.d.ts +4 -0
- package/dist/types/capabilities/multiDimensionalNonce.d.ts.map +1 -0
- package/dist/types/client/actions/prepareCalls.d.ts +1 -1
- package/dist/types/client/actions/signPreparedCalls.d.ts.map +1 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts +3 -2
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
- package/dist/types/exports/internal.d.ts +1 -0
- package/dist/types/exports/internal.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/createSession.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/client.d.ts +9 -0
- package/dist/types/isomorphic/client.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/7702.d.ts +6 -1
- package/dist/types/isomorphic/utils/7702.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/createAccount.d.ts +1 -0
- package/dist/types/isomorphic/utils/createAccount.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/supportsFeature.d.ts +5 -0
- package/dist/types/isomorphic/utils/supportsFeature.d.ts.map +1 -0
- package/dist/types/rpc/request.d.ts +54 -0
- package/dist/types/rpc/request.d.ts.map +1 -1
- package/dist/types/rpc/schema.d.ts +54 -0
- package/dist/types/rpc/schema.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +35 -1
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/types.d.ts +3 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts +1 -0
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/capabilities/index.ts +2 -0
- package/src/capabilities/multiDimensionalNonce.ts +7 -0
- package/src/client/actions/prepareCalls.ts +1 -1
- package/src/client/actions/signPreparedCalls.ts +42 -43
- package/src/client/actions/signSignatureRequest.ts +4 -2
- package/src/exports/internal.ts +1 -0
- package/src/isomorphic/actions/createSession.ts +25 -4
- package/src/isomorphic/actions/prepareCalls.ts +48 -21
- package/src/isomorphic/actions/sendPreparedCalls.ts +69 -9
- package/src/isomorphic/utils/7702.ts +41 -14
- package/src/isomorphic/utils/createAccount.ts +115 -35
- package/src/isomorphic/utils/supportsFeature.ts +34 -0
- package/src/rpc/request.ts +1 -0
- package/src/schemas.ts +94 -3
- package/src/types.ts +4 -0
- package/src/utils.ts +2 -0
|
@@ -38,6 +38,9 @@ export declare const WalletServerRpcSchema: {
|
|
|
38
38
|
multiplier: number;
|
|
39
39
|
} | undefined;
|
|
40
40
|
} | undefined;
|
|
41
|
+
nonceOverride?: {
|
|
42
|
+
nonceKey: `0x${string}`;
|
|
43
|
+
} | undefined;
|
|
41
44
|
} | undefined;
|
|
42
45
|
chainId: `0x${string}`;
|
|
43
46
|
calls: {
|
|
@@ -87,11 +90,13 @@ export declare const WalletServerRpcSchema: {
|
|
|
87
90
|
[x: string]: unknown;
|
|
88
91
|
};
|
|
89
92
|
};
|
|
93
|
+
rawPayload: `0x${string}`;
|
|
90
94
|
} | {
|
|
91
95
|
type: "personal_sign";
|
|
92
96
|
data: string | {
|
|
93
97
|
raw: `0x${string}`;
|
|
94
98
|
};
|
|
99
|
+
rawPayload: `0x${string}`;
|
|
95
100
|
};
|
|
96
101
|
} | {
|
|
97
102
|
type: "user-operation-v070";
|
|
@@ -133,11 +138,13 @@ export declare const WalletServerRpcSchema: {
|
|
|
133
138
|
[x: string]: unknown;
|
|
134
139
|
};
|
|
135
140
|
};
|
|
141
|
+
rawPayload: `0x${string}`;
|
|
136
142
|
} | {
|
|
137
143
|
type: "personal_sign";
|
|
138
144
|
data: string | {
|
|
139
145
|
raw: `0x${string}`;
|
|
140
146
|
};
|
|
147
|
+
rawPayload: `0x${string}`;
|
|
141
148
|
};
|
|
142
149
|
} | {
|
|
143
150
|
type: "authorization";
|
|
@@ -148,6 +155,7 @@ export declare const WalletServerRpcSchema: {
|
|
|
148
155
|
};
|
|
149
156
|
signatureRequest: {
|
|
150
157
|
type: "eip7702Auth";
|
|
158
|
+
rawPayload: `0x${string}`;
|
|
151
159
|
};
|
|
152
160
|
})[];
|
|
153
161
|
} | {
|
|
@@ -186,11 +194,13 @@ export declare const WalletServerRpcSchema: {
|
|
|
186
194
|
[x: string]: unknown;
|
|
187
195
|
};
|
|
188
196
|
};
|
|
197
|
+
rawPayload: `0x${string}`;
|
|
189
198
|
} | {
|
|
190
199
|
type: "personal_sign";
|
|
191
200
|
data: string | {
|
|
192
201
|
raw: `0x${string}`;
|
|
193
202
|
};
|
|
203
|
+
rawPayload: `0x${string}`;
|
|
194
204
|
};
|
|
195
205
|
} | {
|
|
196
206
|
type: "user-operation-v070";
|
|
@@ -232,11 +242,13 @@ export declare const WalletServerRpcSchema: {
|
|
|
232
242
|
[x: string]: unknown;
|
|
233
243
|
};
|
|
234
244
|
};
|
|
245
|
+
rawPayload: `0x${string}`;
|
|
235
246
|
} | {
|
|
236
247
|
type: "personal_sign";
|
|
237
248
|
data: string | {
|
|
238
249
|
raw: `0x${string}`;
|
|
239
250
|
};
|
|
251
|
+
rawPayload: `0x${string}`;
|
|
240
252
|
};
|
|
241
253
|
};
|
|
242
254
|
} | {
|
|
@@ -461,6 +473,26 @@ export declare const WalletServerRpcSchema: {
|
|
|
461
473
|
creationOptions?: {
|
|
462
474
|
salt?: `0x${string}` | undefined;
|
|
463
475
|
accountType?: "sma-b" | undefined;
|
|
476
|
+
} | {
|
|
477
|
+
salt?: `0x${string}` | undefined;
|
|
478
|
+
accountType: "la-v2";
|
|
479
|
+
} | {
|
|
480
|
+
salt?: `0x${string}` | undefined;
|
|
481
|
+
initialOwners?: `0x${string}`[] | undefined;
|
|
482
|
+
accountType: "la-v2-multi-owner";
|
|
483
|
+
} | {
|
|
484
|
+
salt?: `0x${string}` | undefined;
|
|
485
|
+
accountType: "la-v1.0.1";
|
|
486
|
+
} | {
|
|
487
|
+
salt?: `0x${string}` | undefined;
|
|
488
|
+
accountType: "la-v1.0.2";
|
|
489
|
+
} | {
|
|
490
|
+
salt?: `0x${string}` | undefined;
|
|
491
|
+
accountType: "la-v1.1.0";
|
|
492
|
+
} | {
|
|
493
|
+
salt?: `0x${string}` | undefined;
|
|
494
|
+
initialOwners?: `0x${string}`[] | undefined;
|
|
495
|
+
accountType: "ma-v1-multi-owner";
|
|
464
496
|
} | {
|
|
465
497
|
accountType: "7702";
|
|
466
498
|
} | undefined;
|
|
@@ -479,6 +511,26 @@ export declare const WalletServerRpcSchema: {
|
|
|
479
511
|
creationHint?: {
|
|
480
512
|
salt?: `0x${string}` | undefined;
|
|
481
513
|
accountType?: "sma-b" | undefined;
|
|
514
|
+
} | {
|
|
515
|
+
salt?: `0x${string}` | undefined;
|
|
516
|
+
accountType: "la-v2";
|
|
517
|
+
} | {
|
|
518
|
+
salt?: `0x${string}` | undefined;
|
|
519
|
+
initialOwners?: `0x${string}`[] | undefined;
|
|
520
|
+
accountType: "la-v2-multi-owner";
|
|
521
|
+
} | {
|
|
522
|
+
salt?: `0x${string}` | undefined;
|
|
523
|
+
accountType: "la-v1.0.1";
|
|
524
|
+
} | {
|
|
525
|
+
salt?: `0x${string}` | undefined;
|
|
526
|
+
accountType: "la-v1.0.2";
|
|
527
|
+
} | {
|
|
528
|
+
salt?: `0x${string}` | undefined;
|
|
529
|
+
accountType: "la-v1.1.0";
|
|
530
|
+
} | {
|
|
531
|
+
salt?: `0x${string}` | undefined;
|
|
532
|
+
initialOwners?: `0x${string}`[] | undefined;
|
|
533
|
+
accountType: "ma-v1-multi-owner";
|
|
482
534
|
} | {
|
|
483
535
|
accountType: "7702";
|
|
484
536
|
} | undefined;
|
|
@@ -575,6 +627,7 @@ export declare const WalletServerRpcSchema: {
|
|
|
575
627
|
method: "wallet_createSession";
|
|
576
628
|
};
|
|
577
629
|
ReturnType: {
|
|
630
|
+
chainId: `0x${string}`;
|
|
578
631
|
signatureRequest: {
|
|
579
632
|
type: "eth_signTypedData_v4";
|
|
580
633
|
data: {
|
|
@@ -596,6 +649,7 @@ export declare const WalletServerRpcSchema: {
|
|
|
596
649
|
[x: string]: unknown;
|
|
597
650
|
};
|
|
598
651
|
};
|
|
652
|
+
rawPayload: `0x${string}`;
|
|
599
653
|
};
|
|
600
654
|
sessionId: `0x${string}`;
|
|
601
655
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/rpc/schema.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/rpc/schema.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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1,4 +1,8 @@
|
|
|
1
1
|
import { type SchemaOptions, type Static } from "@sinclair/typebox";
|
|
2
|
+
export declare const baseAccountTypes: readonly ["sma-b", "la-v2", "la-v2-multi-owner", "la-v1.0.1", "la-v1.0.2", "la-v1.1.0", "ma-v1-multi-owner"];
|
|
3
|
+
export type BaseAccountType = (typeof baseAccountTypes)[number];
|
|
4
|
+
export declare const accountTypes: readonly ["sma-b", "la-v2", "la-v2-multi-owner", "la-v1.0.1", "la-v1.0.2", "la-v1.1.0", "ma-v1-multi-owner", "7702"];
|
|
5
|
+
export type AccountType = (typeof accountTypes)[number];
|
|
2
6
|
export declare const TypeHex: (options?: SchemaOptions) => import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
3
7
|
export declare const TypeAddress: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
4
8
|
export declare const TypeUuid: import("@sinclair/typebox").TString;
|
|
@@ -143,11 +147,30 @@ export type TypeCounterfactualInfo = Static<typeof TypeCounterfactualInfo>;
|
|
|
143
147
|
export declare const TypeCreationOptions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
144
148
|
accountType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<"sma-b">>;
|
|
145
149
|
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
150
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
151
|
+
accountType: import("@sinclair/typebox").TLiteral<"la-v2">;
|
|
152
|
+
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
153
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
154
|
+
accountType: import("@sinclair/typebox").TLiteral<"la-v2-multi-owner">;
|
|
155
|
+
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
156
|
+
initialOwners: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>>;
|
|
157
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
158
|
+
accountType: import("@sinclair/typebox").TLiteral<"la-v1.0.1">;
|
|
159
|
+
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
160
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
161
|
+
accountType: import("@sinclair/typebox").TLiteral<"la-v1.0.2">;
|
|
162
|
+
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
163
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
164
|
+
accountType: import("@sinclair/typebox").TLiteral<"la-v1.1.0">;
|
|
165
|
+
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
166
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
167
|
+
accountType: import("@sinclair/typebox").TLiteral<"ma-v1-multi-owner">;
|
|
168
|
+
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
169
|
+
initialOwners: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>>;
|
|
146
170
|
}>, import("@sinclair/typebox").TObject<{
|
|
147
171
|
accountType: import("@sinclair/typebox").TLiteral<"7702">;
|
|
148
172
|
}>]>>;
|
|
149
173
|
export type TypeCreationOptions = Static<typeof TypeCreationOptions>;
|
|
150
|
-
export type TypeAccountType = Exclude<Static<typeof TypeCreationOptions>, undefined>["accountType"];
|
|
151
174
|
export declare const TypeSignatureType: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"secp256k1">, import("@sinclair/typebox").TLiteral<"ecdsa">, import("@sinclair/typebox").TLiteral<"contract">]>;
|
|
152
175
|
export type TypeSignatureType = Static<typeof TypeSignatureType>;
|
|
153
176
|
export declare const KeySigner: import("@sinclair/typebox").TObject<{
|
|
@@ -193,6 +216,7 @@ export declare const TypePersonalSignSignatureRequest: import("@sinclair/typebox
|
|
|
193
216
|
data: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
194
217
|
raw: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
195
218
|
}>]>;
|
|
219
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
196
220
|
}>;
|
|
197
221
|
export declare const TypeTypedDataSignatureRequest: import("@sinclair/typebox").TObject<{
|
|
198
222
|
type: import("@sinclair/typebox").TLiteral<"eth_signTypedData_v4">;
|
|
@@ -229,15 +253,18 @@ export declare const TypeTypedDataSignatureRequest: import("@sinclair/typebox").
|
|
|
229
253
|
[x: string]: unknown;
|
|
230
254
|
};
|
|
231
255
|
}>;
|
|
256
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
232
257
|
}>;
|
|
233
258
|
export declare const TypeAuthorizationSignatureRequest: import("@sinclair/typebox").TObject<{
|
|
234
259
|
type: import("@sinclair/typebox").TLiteral<"eip7702Auth">;
|
|
260
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
235
261
|
}>;
|
|
236
262
|
export declare const TypeSignatureRequest: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
237
263
|
type: import("@sinclair/typebox").TLiteral<"personal_sign">;
|
|
238
264
|
data: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
239
265
|
raw: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
240
266
|
}>]>;
|
|
267
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
241
268
|
}>, import("@sinclair/typebox").TObject<{
|
|
242
269
|
type: import("@sinclair/typebox").TLiteral<"eth_signTypedData_v4">;
|
|
243
270
|
data: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TObject<{
|
|
@@ -273,8 +300,10 @@ export declare const TypeSignatureRequest: import("@sinclair/typebox").TUnion<[i
|
|
|
273
300
|
[x: string]: unknown;
|
|
274
301
|
};
|
|
275
302
|
}>;
|
|
303
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
276
304
|
}>, import("@sinclair/typebox").TObject<{
|
|
277
305
|
type: import("@sinclair/typebox").TLiteral<"eip7702Auth">;
|
|
306
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
278
307
|
}>]>;
|
|
279
308
|
export declare const TypeCallId: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">, {
|
|
280
309
|
chainId: `0x${string}`;
|
|
@@ -300,6 +329,7 @@ export declare const PreparedCall_UserOpV060: import("@sinclair/typebox").TObjec
|
|
|
300
329
|
data: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
301
330
|
raw: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
302
331
|
}>]>;
|
|
332
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
303
333
|
}>, import("@sinclair/typebox").TObject<{
|
|
304
334
|
type: import("@sinclair/typebox").TLiteral<"eth_signTypedData_v4">;
|
|
305
335
|
data: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TObject<{
|
|
@@ -335,6 +365,7 @@ export declare const PreparedCall_UserOpV060: import("@sinclair/typebox").TObjec
|
|
|
335
365
|
[x: string]: unknown;
|
|
336
366
|
};
|
|
337
367
|
}>;
|
|
368
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
338
369
|
}>]>;
|
|
339
370
|
}>;
|
|
340
371
|
export declare const PreparedCall_UserOpV070: import("@sinclair/typebox").TObject<{
|
|
@@ -361,6 +392,7 @@ export declare const PreparedCall_UserOpV070: import("@sinclair/typebox").TObjec
|
|
|
361
392
|
data: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
362
393
|
raw: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
363
394
|
}>]>;
|
|
395
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
364
396
|
}>, import("@sinclair/typebox").TObject<{
|
|
365
397
|
type: import("@sinclair/typebox").TLiteral<"eth_signTypedData_v4">;
|
|
366
398
|
data: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TObject<{
|
|
@@ -396,6 +428,7 @@ export declare const PreparedCall_UserOpV070: import("@sinclair/typebox").TObjec
|
|
|
396
428
|
[x: string]: unknown;
|
|
397
429
|
};
|
|
398
430
|
}>;
|
|
431
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
399
432
|
}>]>;
|
|
400
433
|
}>;
|
|
401
434
|
export declare const PreparedCall_Authorization: import("@sinclair/typebox").TObject<{
|
|
@@ -407,6 +440,7 @@ export declare const PreparedCall_Authorization: import("@sinclair/typebox").TOb
|
|
|
407
440
|
chainId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
408
441
|
signatureRequest: import("@sinclair/typebox").TObject<{
|
|
409
442
|
type: import("@sinclair/typebox").TLiteral<"eip7702Auth">;
|
|
443
|
+
rawPayload: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
410
444
|
}>;
|
|
411
445
|
}>;
|
|
412
446
|
export declare const TypeEdcsaSigData: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">, import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAsB3B,eAAO,MAAM,gBAAgB,8GAQnB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,YAAY,sHAAyC,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,eAAO,MAAM,OAAO,GAAI,UAAU,aAAa,sEAG3C,CAAC;AAEL,eAAO,MAAM,WAAW,mEAA0C,CAAC;AAEnE,eAAO,MAAM,QAAQ,qCAEnB,CAAC;AAEH,eAAO,MAAM,0BAA0B,qCAErC,CAAC;AAGH,eAAO,MAAM,QAAQ,qFAEa,CAAC;AAEnC,eAAO,MAAM,OAAO,qFAEc,CAAC;AAEnC,eAAO,MAAM,2BAA2B;;;;;;;;;;;;EA0BtC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;EAgBtC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;EAIlC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;IAOhC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;EAGhC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FhC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;EA4BjC,CAAC;AAEH,eAAO,MAAM,sBAAsB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;;;;;;;;;;;;;;;;;EAqBvB,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK7C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK7C,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKhD,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAczB,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -36,4 +36,7 @@ export type InnerWalletApiClient = InnerWalletApiClientBase<InnerClientActions &
|
|
|
36
36
|
export type WithoutChainId<T> = T extends {
|
|
37
37
|
chainId: Hex;
|
|
38
38
|
} ? Omit<T, "chainId"> : T;
|
|
39
|
+
export type WithoutRawPayload<T> = T extends {
|
|
40
|
+
rawPayload: Hex;
|
|
41
|
+
} ? Omit<T, "rawPayload"> : T;
|
|
39
42
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,MAAM,EACN,GAAG,EACH,cAAc,EACd,SAAS,EACV,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,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B;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAChC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,EAAE,CAChB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,sBAAsB,GAAG;QAAE,OAAO,EAAE,GAAG,CAAA;KAAE,KAC9C,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,aAAa,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,UAAU,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CACzD,kBAAkB,GAAG;IAAE,QAAQ,EAAE,aAAa,CAAA;CAAE,CACjD,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACtD,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,GAClB,CAAC,CAAC;AAEN,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,UAAU,EAAE,GAAG,CAAA;CAAE,GAC5D,IAAI,CAAC,CAAC,EAAE,YAAY,CAAC,GACrB,CAAC,CAAC"}
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Hex } from "viem";
|
|
2
|
+
export type Expect<T extends true> = T;
|
|
2
3
|
export declare const assertNever: (_val: never, msg: string) => never;
|
|
3
4
|
/** If the value is already Hex, it is returned unchanged. If it's a string, number or bigint, it's converted. */
|
|
4
5
|
export declare const castToHex: (val: string | number | bigint | Hex) => Hex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAE9C,eAAO,MAAM,WAAW,GAAI,MAAM,KAAK,EAAE,KAAK,MAAM,KAAG,KAEtD,CAAC;AAEF,iHAAiH;AACjH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,KAAG,GAK/D,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAE9C,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;AAEvC,eAAO,MAAM,WAAW,GAAI,MAAM,KAAK,EAAE,KAAK,MAAM,KAAG,KAEtD,CAAC;AAEF,iHAAiH;AACjH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,KAAG,GAK/D,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@account-kit/wallet-client",
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.1.0-alpha.
|
|
5
|
+
"version": "0.1.0-alpha.9",
|
|
6
6
|
"main": "./dist/esm/exports/index.js",
|
|
7
7
|
"module": "./dist/esm/exports/index.js",
|
|
8
8
|
"types": "./dist/types/exports/index.d.ts",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"typescript": "^5.8.2"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@aa-sdk/core": "^4.
|
|
62
|
-
"@account-kit/infra": "^4.
|
|
63
|
-
"@account-kit/smart-contracts": "^4.
|
|
61
|
+
"@aa-sdk/core": "^4.43.1",
|
|
62
|
+
"@account-kit/infra": "^4.43.1",
|
|
63
|
+
"@account-kit/smart-contracts": "^4.43.1",
|
|
64
64
|
"@sinclair/typebox": "^0.34.33",
|
|
65
65
|
"deep-equal": "^2.2.3",
|
|
66
66
|
"ox": "^0.6.12",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"access": "public",
|
|
71
71
|
"registry": "https://registry.npmjs.org/"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "899de86e079a719b9e4ce484a9d5dca6bdfd6186"
|
|
74
74
|
}
|
|
@@ -3,10 +3,12 @@ import { GasParamsOverrideCapability } from "./overrides.js";
|
|
|
3
3
|
import { PaymasterCapability } from "./paymaster.js";
|
|
4
4
|
import { PermissionsCapability } from "./permissions/index.js";
|
|
5
5
|
import { Eip7702AuthCapability } from "./eip7702Auth.js";
|
|
6
|
+
import { MultiDimensionalNonceCapability } from "./multiDimensionalNonce.js";
|
|
6
7
|
|
|
7
8
|
export const Capabilities = Type.Object({
|
|
8
9
|
permissions: Type.Optional(PermissionsCapability),
|
|
9
10
|
paymasterService: Type.Optional(PaymasterCapability),
|
|
10
11
|
gasParamsOverride: Type.Optional(GasParamsOverrideCapability),
|
|
11
12
|
eip7702Auth: Type.Optional(Eip7702AuthCapability),
|
|
13
|
+
nonceOverride: Type.Optional(MultiDimensionalNonceCapability),
|
|
12
14
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { TypeHex } from "../schemas.js";
|
|
3
|
+
|
|
4
|
+
export const MultiDimensionalNonceCapability = Type.Object({
|
|
5
|
+
// we do not support the optional sequentialNonce param
|
|
6
|
+
nonceKey: TypeHex({ description: "Override nonce key as hex string" }),
|
|
7
|
+
});
|
|
@@ -32,7 +32,7 @@ export type PrepareCallsResult = IsomorphicPrepareCallsResult;
|
|
|
32
32
|
* the user operation data and signature request
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
|
-
* // Prepare a
|
|
35
|
+
* // Prepare a sponsored user operation call
|
|
36
36
|
* const result = await client.prepareCalls({
|
|
37
37
|
* calls: [{
|
|
38
38
|
* to: "0x1234...",
|
|
@@ -3,7 +3,11 @@ import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
|
3
3
|
import { signSignatureRequest } from "./signSignatureRequest.js";
|
|
4
4
|
import type { Static } from "@sinclair/typebox";
|
|
5
5
|
import { wallet_sendPreparedCalls } from "../../rpc/request.js";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
PreparedCall_Authorization,
|
|
8
|
+
PreparedCall_UserOpV060,
|
|
9
|
+
PreparedCall_UserOpV070,
|
|
10
|
+
} from "../../schemas.js";
|
|
7
11
|
|
|
8
12
|
export type SignPreparedCallsParams = PrepareCallsResult;
|
|
9
13
|
|
|
@@ -22,51 +26,46 @@ export async function signPreparedCalls(
|
|
|
22
26
|
signer: SmartAccountSigner,
|
|
23
27
|
params: SignPreparedCallsParams,
|
|
24
28
|
): Promise<SignPreparedCallsResult> {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
const signAuthorizationCall = async (
|
|
30
|
+
call: Static<typeof PreparedCall_Authorization>,
|
|
31
|
+
) => {
|
|
32
|
+
const { signatureRequest: _signatureRequest, ...rest } = call;
|
|
33
|
+
const signature = await signSignatureRequest(signer, {
|
|
34
|
+
type: "eip7702Auth",
|
|
35
|
+
data: {
|
|
36
|
+
...rest.data,
|
|
37
|
+
chainId: call.chainId,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
28
40
|
return {
|
|
29
|
-
...
|
|
41
|
+
...rest,
|
|
30
42
|
signature,
|
|
31
43
|
};
|
|
32
|
-
}
|
|
44
|
+
};
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
chainId: call.chainId,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
return {
|
|
49
|
-
...rest,
|
|
50
|
-
signature,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
case "user-operation-v060":
|
|
54
|
-
case "user-operation-v070": {
|
|
55
|
-
const { signatureRequest, ...rest } = call;
|
|
56
|
-
const signature = await signSignatureRequest(
|
|
57
|
-
signer,
|
|
58
|
-
signatureRequest,
|
|
59
|
-
);
|
|
60
|
-
return {
|
|
61
|
-
...rest,
|
|
62
|
-
signature,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
default: {
|
|
66
|
-
return assertNever(call, "Unexpected call type");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
),
|
|
46
|
+
const signUserOperationCall = async (
|
|
47
|
+
call:
|
|
48
|
+
| Static<typeof PreparedCall_UserOpV060>
|
|
49
|
+
| Static<typeof PreparedCall_UserOpV070>,
|
|
50
|
+
) => {
|
|
51
|
+
const { signatureRequest, ...rest } = call;
|
|
52
|
+
const signature = await signSignatureRequest(signer, signatureRequest);
|
|
53
|
+
return {
|
|
54
|
+
...rest,
|
|
55
|
+
signature,
|
|
56
|
+
};
|
|
71
57
|
};
|
|
58
|
+
|
|
59
|
+
return params.type === "array"
|
|
60
|
+
? {
|
|
61
|
+
type: "array" as const,
|
|
62
|
+
data: await Promise.all(
|
|
63
|
+
params.data.map((call) =>
|
|
64
|
+
call.type === "authorization"
|
|
65
|
+
? signAuthorizationCall(call)
|
|
66
|
+
: signUserOperationCall(call),
|
|
67
|
+
),
|
|
68
|
+
),
|
|
69
|
+
}
|
|
70
|
+
: signUserOperationCall(params);
|
|
72
71
|
}
|
|
@@ -9,13 +9,15 @@ import {
|
|
|
9
9
|
} from "../../schemas.js";
|
|
10
10
|
import { TypeEip7702UnsignedAuth } from "../../schemas.js";
|
|
11
11
|
import { vToYParity } from "ox/Signature";
|
|
12
|
+
import type { WithoutRawPayload } from "../../types.ts";
|
|
12
13
|
|
|
13
|
-
export type SignSignatureRequestParams =
|
|
14
|
+
export type SignSignatureRequestParams = WithoutRawPayload<
|
|
14
15
|
| Static<typeof TypePersonalSignSignatureRequest>
|
|
15
16
|
| Static<typeof TypeTypedDataSignatureRequest>
|
|
16
17
|
| (Static<typeof TypeAuthorizationSignatureRequest> & {
|
|
17
18
|
data: Static<typeof TypeEip7702UnsignedAuth>;
|
|
18
|
-
})
|
|
19
|
+
})
|
|
20
|
+
>;
|
|
19
21
|
|
|
20
22
|
export type SignSignatureRequestResult = {
|
|
21
23
|
type: "secp256k1";
|
package/src/exports/internal.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "../capabilities/permissions/mav2.js";
|
|
|
8
8
|
export type * from "../isomorphic/client.js";
|
|
9
9
|
export { createIsomorphicClient } from "../isomorphic/client.js";
|
|
10
10
|
export { createDummySigner } from "../isomorphic/utils/createDummySigner.js";
|
|
11
|
+
export { prepareInitialOwners } from "../isomorphic/utils/createAccount.js";
|
|
11
12
|
export * from "../rpc/request.js";
|
|
12
13
|
export * as RpcSchemas from "../rpc/request.js";
|
|
13
14
|
export * from "../rpc/schema.js";
|
|
@@ -12,19 +12,22 @@ import { Value } from "@sinclair/typebox/value";
|
|
|
12
12
|
import {
|
|
13
13
|
ChainNotFoundError,
|
|
14
14
|
custom,
|
|
15
|
+
hashTypedData,
|
|
15
16
|
hexToNumber,
|
|
16
17
|
toHex,
|
|
17
18
|
type Chain,
|
|
18
19
|
type Hex,
|
|
19
20
|
type Transport,
|
|
20
21
|
} from "viem";
|
|
22
|
+
import { InvalidRequestError } from "ox/RpcResponse";
|
|
21
23
|
import { TypePermission } from "../../capabilities/permissions/index.js";
|
|
22
24
|
import { isGlobalValidation } from "../../capabilities/permissions/mav2.js";
|
|
23
25
|
import type { wallet_createSession } from "../../rpc/request.js";
|
|
24
26
|
import type { WalletServerViemRpcSchema } from "../../rpc/schema.js";
|
|
25
27
|
import { createAccount, isModularAccountV2 } from "../utils/createAccount.js";
|
|
26
28
|
import { createDummySigner } from "../utils/createDummySigner.js";
|
|
27
|
-
import {
|
|
29
|
+
import { supportsFeature } from "../utils/supportsFeature.js";
|
|
30
|
+
import { isDelegated } from "../utils/7702.js";
|
|
28
31
|
|
|
29
32
|
export type CreateSessionParams = Omit<
|
|
30
33
|
Static<
|
|
@@ -68,19 +71,35 @@ export async function createSession(
|
|
|
68
71
|
],
|
|
69
72
|
});
|
|
70
73
|
|
|
71
|
-
if (
|
|
74
|
+
if (
|
|
75
|
+
delegation &&
|
|
76
|
+
!(await isDelegated(client, {
|
|
77
|
+
address: params.account,
|
|
78
|
+
delegation,
|
|
79
|
+
}))
|
|
80
|
+
) {
|
|
72
81
|
throw new InvalidRequestError({
|
|
73
82
|
message:
|
|
74
|
-
"
|
|
83
|
+
"7702 account must be delegated before calling `wallet_createSession`",
|
|
75
84
|
});
|
|
76
85
|
}
|
|
77
86
|
|
|
78
|
-
if (!counterfactualInfo) {
|
|
87
|
+
if (!delegation && !counterfactualInfo) {
|
|
79
88
|
throw new InvalidRequestError({
|
|
80
89
|
message: "No counterfactual info found.",
|
|
81
90
|
});
|
|
82
91
|
}
|
|
83
92
|
|
|
93
|
+
if (
|
|
94
|
+
counterfactualInfo &&
|
|
95
|
+
!supportsFeature(counterfactualInfo, "permissions")
|
|
96
|
+
) {
|
|
97
|
+
throw new InvalidRequestError({
|
|
98
|
+
message: "Account type does not support createSession",
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// At this point we know the account supports the permission feature
|
|
84
103
|
const account = await createAccount({
|
|
85
104
|
chain: client.chain,
|
|
86
105
|
transport: custom(client.transport),
|
|
@@ -128,10 +147,12 @@ export async function createSession(
|
|
|
128
147
|
|
|
129
148
|
return {
|
|
130
149
|
sessionId: null, // In remote mode, the server will set this later.
|
|
150
|
+
chainId: toHex(client.chain.id),
|
|
131
151
|
entityId: toHex(entityId),
|
|
132
152
|
signatureRequest: {
|
|
133
153
|
type: "eth_signTypedData_v4" as const,
|
|
134
154
|
data: typedData,
|
|
155
|
+
rawPayload: hashTypedData(typedData),
|
|
135
156
|
},
|
|
136
157
|
fullPreSignatureDeferredActionDigest,
|
|
137
158
|
};
|