@account-kit/wallet-client 0.1.0-alpha.2 → 0.1.0-alpha.4
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 +5 -2
- package/dist/esm/capabilities/index.js +1 -1
- package/dist/esm/capabilities/index.js.map +1 -1
- package/dist/esm/capabilities/overrides.js +8 -8
- package/dist/esm/capabilities/overrides.js.map +1 -1
- package/dist/esm/capabilities/permissions/index.d.ts +10 -3
- package/dist/esm/capabilities/permissions/index.js +11 -2
- package/dist/esm/capabilities/permissions/index.js.map +1 -1
- package/dist/esm/capabilities/permissions/mav2.d.ts +2 -2
- package/dist/esm/capabilities/permissions/mav2.js +9 -1
- package/dist/esm/capabilities/permissions/mav2.js.map +1 -1
- package/dist/esm/client/actions/grantPermissions.d.ts +57 -3
- package/dist/esm/client/actions/grantPermissions.js +1 -0
- package/dist/esm/client/actions/grantPermissions.js.map +1 -1
- package/dist/esm/client/actions/requestAccount.js +2 -2
- package/dist/esm/client/actions/requestAccount.js.map +1 -1
- package/dist/esm/client/actions/signSignatureRequest.d.ts +4 -1
- package/dist/esm/client/actions/signSignatureRequest.js +22 -1
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
- package/dist/esm/client/client.e2e-test.js +13 -19
- package/dist/esm/client/client.e2e-test.js.map +1 -1
- package/dist/esm/client/index.d.ts +4 -3
- package/dist/esm/client/index.js +2 -2
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/exports/index.d.ts +2 -2
- package/dist/esm/exports/index.js +1 -1
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/isomorphic/actions/createSession.js +25 -7
- package/dist/esm/isomorphic/actions/createSession.js.map +1 -1
- package/dist/esm/isomorphic/actions/prepareCalls.js +35 -12
- package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -1
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js +26 -6
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/isomorphic/client.d.ts +11 -5
- package/dist/esm/isomorphic/utils/7702.d.ts +11 -0
- package/dist/esm/isomorphic/utils/7702.js +26 -0
- package/dist/esm/isomorphic/utils/7702.js.map +1 -0
- package/dist/esm/isomorphic/utils/createAccount.d.ts +2 -1
- package/dist/esm/isomorphic/utils/createAccount.js +30 -5
- package/dist/esm/isomorphic/utils/createAccount.js.map +1 -1
- package/dist/esm/isomorphic/utils/createDummySigner.js +3 -3
- package/dist/esm/isomorphic/utils/createDummySigner.js.map +1 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +2 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js +17 -5
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js.map +1 -1
- package/dist/esm/local/client.js +2 -1
- package/dist/esm/local/client.js.map +1 -1
- package/dist/esm/remote/client.js +6 -2
- package/dist/esm/remote/client.js.map +1 -1
- package/dist/esm/rpc/examples.d.ts +230 -0
- package/dist/esm/rpc/examples.js +314 -0
- package/dist/esm/rpc/examples.js.map +1 -0
- package/dist/esm/rpc/request.d.ts +48 -17
- package/dist/esm/rpc/request.js +53 -14
- package/dist/esm/rpc/request.js.map +1 -1
- package/dist/esm/rpc/schema.d.ts +42 -11
- package/dist/esm/schemas.d.ts +29 -7
- package/dist/esm/schemas.js +120 -38
- package/dist/esm/schemas.js.map +1 -1
- package/dist/types/capabilities/index.d.ts +5 -2
- package/dist/types/capabilities/index.d.ts.map +1 -1
- package/dist/types/capabilities/overrides.d.ts.map +1 -1
- package/dist/types/capabilities/permissions/index.d.ts +10 -3
- package/dist/types/capabilities/permissions/index.d.ts.map +1 -1
- package/dist/types/capabilities/permissions/mav2.d.ts +2 -2
- package/dist/types/capabilities/permissions/mav2.d.ts.map +1 -1
- package/dist/types/client/actions/grantPermissions.d.ts +57 -3
- package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
- package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts +4 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +4 -3
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +2 -2
- package/dist/types/exports/index.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 +11 -5
- package/dist/types/isomorphic/client.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/7702.d.ts +12 -0
- package/dist/types/isomorphic/utils/7702.d.ts.map +1 -0
- package/dist/types/isomorphic/utils/createAccount.d.ts +2 -1
- package/dist/types/isomorphic/utils/createAccount.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/createDummySigner.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +2 -1
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts.map +1 -1
- package/dist/types/remote/client.d.ts.map +1 -1
- package/dist/types/rpc/examples.d.ts +231 -0
- package/dist/types/rpc/examples.d.ts.map +1 -0
- package/dist/types/rpc/request.d.ts +48 -17
- package/dist/types/rpc/request.d.ts.map +1 -1
- package/dist/types/rpc/schema.d.ts +42 -11
- package/dist/types/rpc/schema.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +29 -7
- package/dist/types/schemas.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/capabilities/index.ts +5 -8
- package/src/capabilities/overrides.ts +23 -8
- package/src/capabilities/permissions/index.ts +21 -5
- package/src/capabilities/permissions/mav2.ts +12 -2
- package/src/client/actions/grantPermissions.ts +57 -3
- package/src/client/actions/requestAccount.ts +2 -3
- package/src/client/actions/signSignatureRequest.ts +31 -3
- package/src/client/client.e2e-test.ts +14 -21
- package/src/client/index.ts +12 -10
- package/src/exports/index.ts +2 -1
- package/src/isomorphic/actions/createSession.ts +28 -7
- package/src/isomorphic/actions/prepareCalls.ts +38 -11
- package/src/isomorphic/actions/sendPreparedCalls.ts +47 -20
- package/src/isomorphic/utils/7702.ts +58 -0
- package/src/isomorphic/utils/createAccount.ts +38 -6
- package/src/isomorphic/utils/createDummySigner.ts +3 -2
- package/src/isomorphic/utils/parsePermissionsContext.ts +23 -7
- package/src/local/client.ts +2 -3
- package/src/remote/client.ts +12 -2
- package/src/rpc/examples.ts +343 -0
- package/src/rpc/request.ts +75 -26
- package/src/schemas.ts +218 -87
package/dist/esm/rpc/request.js
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
2
|
import { Capabilities } from "../capabilities/index.js";
|
|
3
|
-
import { PermissionsContext, PermissionsData, } from "../capabilities/permissions/index.js";
|
|
4
|
-
import { TypeAddress, TypeBase64UrlEncodedString, TypeCreationOptions, TypeHex, TypeSerializedInitcode, TypeSignatureRequest, TypeUserOperationRequest_v6, TypeUserOperationRequest_v7, TypeUuid, } from "../schemas.js";
|
|
3
|
+
import { PermissionsContext, PermissionsData, RemotePermission, } from "../capabilities/permissions/index.js";
|
|
4
|
+
import { TypeAddress, TypeBase64UrlEncodedString, TypeCreationOptions, TypeEip7702AuthExtendedFields, TypeHex, TypeSerializedInitcode, TypeSignatureRequest, TypeUserOperationRequest_v6, TypeUserOperationRequest_v7, TypeUuid, } from "../schemas.js";
|
|
5
|
+
import { Examples } from "./examples.js";
|
|
5
6
|
export const wallet_sendPreparedCalls = Type.Object({
|
|
6
7
|
Request: Type.Object({
|
|
7
8
|
method: Type.Literal("wallet_sendPreparedCalls"),
|
|
8
9
|
params: Type.Tuple([
|
|
9
10
|
Type.Object({
|
|
10
11
|
type: Type.Union([
|
|
11
|
-
Type.Literal("user-operation-v060"
|
|
12
|
-
|
|
12
|
+
Type.Literal("user-operation-v060", {
|
|
13
|
+
title: "User Operation (Entrypoint v0.6.0)",
|
|
14
|
+
}),
|
|
15
|
+
Type.Literal("user-operation-v070", {
|
|
16
|
+
title: "User Operation (Entrypoint v0.7.0)",
|
|
17
|
+
}),
|
|
13
18
|
]),
|
|
14
19
|
data: Type.Union([
|
|
15
|
-
Type.Omit(TypeUserOperationRequest_v6, ["signature"]
|
|
16
|
-
|
|
20
|
+
Type.Omit(TypeUserOperationRequest_v6, ["signature"], {
|
|
21
|
+
title: "Unsigned User Operation (Entrypoint v0.6.0)",
|
|
22
|
+
}),
|
|
23
|
+
Type.Omit(TypeUserOperationRequest_v7, ["signature"], {
|
|
24
|
+
title: "Unsigned User Operation (Entrypoint v0.7.0)",
|
|
25
|
+
}),
|
|
17
26
|
]),
|
|
18
27
|
chainId: TypeHex(),
|
|
19
28
|
signature: Type.Object({
|
|
20
|
-
type: Type.Transform(Type.
|
|
29
|
+
type: Type.Transform(Type.Literal("ecdsa"))
|
|
21
30
|
.Decode((value) => {
|
|
22
31
|
if (value.toLowerCase() !== "ecdsa") {
|
|
23
32
|
throw new Error("Invalid signature type, must be 'ecdsa'");
|
|
@@ -27,7 +36,10 @@ export const wallet_sendPreparedCalls = Type.Object({
|
|
|
27
36
|
.Encode((value) => value),
|
|
28
37
|
signature: TypeHex(),
|
|
29
38
|
}),
|
|
30
|
-
|
|
39
|
+
signedAuthorization: Type.Optional(TypeEip7702AuthExtendedFields),
|
|
40
|
+
capabilities: Type.Optional(Type.Object({
|
|
41
|
+
permissions: Type.Optional(Type.Union([PermissionsContext, RemotePermission])),
|
|
42
|
+
})),
|
|
31
43
|
}),
|
|
32
44
|
]),
|
|
33
45
|
}),
|
|
@@ -36,6 +48,7 @@ export const wallet_sendPreparedCalls = Type.Object({
|
|
|
36
48
|
}),
|
|
37
49
|
}, {
|
|
38
50
|
description: "This method is used after signing the signatureRequest returned from prepareCalls to submit a user operation",
|
|
51
|
+
examples: Examples.SendPreparedCalls,
|
|
39
52
|
});
|
|
40
53
|
export const wallet_prepareCalls = Type.Object({
|
|
41
54
|
Request: Type.Object({
|
|
@@ -55,18 +68,27 @@ export const wallet_prepareCalls = Type.Object({
|
|
|
55
68
|
}),
|
|
56
69
|
ReturnType: Type.Object({
|
|
57
70
|
type: Type.Union([
|
|
58
|
-
Type.Literal("user-operation-v060"
|
|
59
|
-
|
|
71
|
+
Type.Literal("user-operation-v060", {
|
|
72
|
+
title: "User Operation (Entrypoint v0.6.0)",
|
|
73
|
+
}),
|
|
74
|
+
Type.Literal("user-operation-v070", {
|
|
75
|
+
title: "User Operation (Entrypoint v0.7.0)",
|
|
76
|
+
}),
|
|
60
77
|
]),
|
|
61
78
|
data: Type.Union([
|
|
62
|
-
Type.Omit(TypeUserOperationRequest_v6, ["signature"]
|
|
63
|
-
|
|
79
|
+
Type.Omit(TypeUserOperationRequest_v6, ["signature"], {
|
|
80
|
+
title: "Unsigned User Operation (Entrypoint v0.6.0)",
|
|
81
|
+
}),
|
|
82
|
+
Type.Omit(TypeUserOperationRequest_v7, ["signature"], {
|
|
83
|
+
title: "Unsigned User Operation (Entrypoint v0.7.0)",
|
|
84
|
+
}),
|
|
64
85
|
]),
|
|
65
86
|
chainId: TypeHex(),
|
|
66
87
|
signatureRequest: TypeSignatureRequest,
|
|
67
88
|
}),
|
|
68
89
|
}, {
|
|
69
90
|
description: "This method is used to prepare a user operation for submission. It will return a built user operation and a signature request which needs to be signed by the user before submitting to wallet_sendPreparedCalls",
|
|
91
|
+
examples: Examples.PrepareCalls,
|
|
70
92
|
});
|
|
71
93
|
export const wallet_requestAccount = Type.Object({
|
|
72
94
|
Request: Type.Object({
|
|
@@ -78,10 +100,14 @@ export const wallet_requestAccount = Type.Object({
|
|
|
78
100
|
id: Type.Optional(TypeUuid),
|
|
79
101
|
creationHint: TypeCreationOptions,
|
|
80
102
|
includeCounterfactualInfo: Type.Optional(Type.Boolean({ default: false })),
|
|
103
|
+
}, {
|
|
104
|
+
title: "Using signer address",
|
|
81
105
|
}),
|
|
82
106
|
Type.Object({
|
|
83
107
|
accountAddress: TypeAddress,
|
|
84
108
|
includeCounterfactualInfo: Type.Optional(Type.Boolean({ default: false })),
|
|
109
|
+
}, {
|
|
110
|
+
title: "Using smart contract account address",
|
|
85
111
|
}),
|
|
86
112
|
]),
|
|
87
113
|
]),
|
|
@@ -90,9 +116,11 @@ export const wallet_requestAccount = Type.Object({
|
|
|
90
116
|
accountAddress: TypeAddress,
|
|
91
117
|
id: TypeUuid,
|
|
92
118
|
counterfactualInfo: Type.Optional(TypeSerializedInitcode),
|
|
119
|
+
delegation: Type.Optional(TypeAddress),
|
|
93
120
|
}),
|
|
94
121
|
}, {
|
|
95
122
|
description: `This method is used to get the smart account address and relevant info for a given signer. If an account does not already exist for a given signer, this method will create one before returning the counterfactual address.`,
|
|
123
|
+
examples: Examples.RequestAccount,
|
|
96
124
|
});
|
|
97
125
|
export const wallet_createAccount = Type.Object({
|
|
98
126
|
Request: Type.Object({
|
|
@@ -111,6 +139,7 @@ export const wallet_createAccount = Type.Object({
|
|
|
111
139
|
}),
|
|
112
140
|
}, {
|
|
113
141
|
description: `This method is used to create a smart account for a given signer. This method is primarly used to import existing accounts. For most cases, you should use wallet_requestAccount instead.`,
|
|
142
|
+
examples: Examples.CreateAccount,
|
|
114
143
|
});
|
|
115
144
|
export const wallet_listAccounts = Type.Object({
|
|
116
145
|
Request: Type.Object({
|
|
@@ -129,12 +158,13 @@ export const wallet_listAccounts = Type.Object({
|
|
|
129
158
|
id: TypeUuid,
|
|
130
159
|
})),
|
|
131
160
|
meta: Type.Object({
|
|
132
|
-
totalCount: Type.
|
|
161
|
+
totalCount: Type.Integer(),
|
|
133
162
|
after: Type.Union([TypeBase64UrlEncodedString, Type.Null()]),
|
|
134
163
|
}),
|
|
135
164
|
}),
|
|
136
165
|
}, {
|
|
137
166
|
description: "This method is used to list all smart accounts for a given signer.",
|
|
167
|
+
examples: Examples.ListAccounts,
|
|
138
168
|
});
|
|
139
169
|
export const wallet_createSession = Type.Object({
|
|
140
170
|
Request: Type.Object({
|
|
@@ -142,7 +172,9 @@ export const wallet_createSession = Type.Object({
|
|
|
142
172
|
params: Type.Tuple([
|
|
143
173
|
Type.Intersect([
|
|
144
174
|
PermissionsData,
|
|
145
|
-
Type.Object({
|
|
175
|
+
Type.Object({
|
|
176
|
+
account: TypeAddress,
|
|
177
|
+
}),
|
|
146
178
|
]),
|
|
147
179
|
]),
|
|
148
180
|
}),
|
|
@@ -152,6 +184,7 @@ export const wallet_createSession = Type.Object({
|
|
|
152
184
|
}),
|
|
153
185
|
}, {
|
|
154
186
|
description: "This method is used to create a session for a given address with specified permissions.",
|
|
187
|
+
examples: Examples.CreateSession,
|
|
155
188
|
});
|
|
156
189
|
export const wallet_getCallsStatus = Type.Object({
|
|
157
190
|
Request: Type.Object({
|
|
@@ -168,18 +201,23 @@ export const wallet_getCallsStatus = Type.Object({
|
|
|
168
201
|
atomic: Type.Boolean(),
|
|
169
202
|
status: Type.Union([
|
|
170
203
|
Type.Literal(100, {
|
|
204
|
+
title: "Pending",
|
|
171
205
|
description: "Batch has been received by the wallet but has not completed execution onchain",
|
|
172
206
|
}),
|
|
173
207
|
Type.Literal(200, {
|
|
208
|
+
title: "Confirmed",
|
|
174
209
|
description: "Batch has been included onchain without reverts, receipts array contains info of all calls",
|
|
175
210
|
}),
|
|
176
211
|
Type.Literal(400, {
|
|
212
|
+
title: "Offchain Failure",
|
|
177
213
|
description: "Batch has not been included onchain and wallet will not retry",
|
|
178
214
|
}),
|
|
179
215
|
Type.Literal(500, {
|
|
216
|
+
title: "Onchain Failure",
|
|
180
217
|
description: "Batch reverted *completely* and only changes related to gas charge may have been included onchain",
|
|
181
218
|
}),
|
|
182
219
|
Type.Literal(600, {
|
|
220
|
+
title: "Partial Onchain Failure",
|
|
183
221
|
description: "Batch reverted *partially* and some changes related to batch calls may have been included onchain",
|
|
184
222
|
}),
|
|
185
223
|
]),
|
|
@@ -200,5 +238,6 @@ export const wallet_getCallsStatus = Type.Object({
|
|
|
200
238
|
}),
|
|
201
239
|
}, {
|
|
202
240
|
description: "This method is used to get the status of calls IDs returned from wallet_sendPreparedCalls.",
|
|
241
|
+
examples: Examples.GetCallsStatus,
|
|
203
242
|
});
|
|
204
243
|
//# sourceMappingURL=request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/rpc/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,0BAA0B,EAC1B,mBAAmB,EACnB,OAAO,EACP,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CACjD;IACE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;QACnB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,0BAA0B,CAAC;QAChD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC;gBACV,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;oBACf,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC;oBACnC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC;iBACpC,CAAC;gBACF,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;oBACf,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,WAAW,CAAC,CAAC;oBACrD,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,WAAW,CAAC,CAAC;iBACtD,CAAC;gBACF,OAAO,EAAE,OAAO,EAAE;gBAClB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAA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CAAC;SACH,CAAC;KACH,CAAC;IACF,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;QACtB,EAAE,EAAE,OAAO,EAAE;QACb,OAAO,EAAE,OAAO,EAAE;QAClB,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;QACtB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;YACjB,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,+EAA+E;aAClF,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,4FAA4F;aAC/F,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,+DAA+D;aAClE,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,mGAAmG;aACtG,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,WAAW,EACT,mGAAmG;aACtG,CAAC;SACH,CAAC;QACF,QAAQ,EAAE,IAAI,CAAC,QAAQ,CACrB,IAAI,CAAC,KAAK,CACR,IAAI,CAAC,MAAM,CAAC;YACV,IAAI,EAAE,IAAI,CAAC,KAAK,CACd,IAAI,CAAC,MAAM,CAAC;gBACV,OAAO,EAAE,WAAW;gBACpB,IAAI,EAAE,OAAO,EAAE;gBACf,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;aAC9B,CAAC,CACH;YACD,MAAM,EAAE,OAAO,CAAC;gBACd,WAAW,EAAE,kCAAkC;aAChD,CAAC;YACF,SAAS,EAAE,OAAO,EAAE;YACpB,WAAW,EAAE,OAAO,EAAE;YACtB,OAAO,EAAE,OAAO,EAAE;YAClB,eAAe,EAAE,OAAO,EAAE;SAC3B,CAAC,CACH,CACF;KACF,CAAC;CACH,EACD;IACE,WAAW,EACT,4FAA4F;CAC/F,CACF,CAAC","sourcesContent":["import { Type } from \"@sinclair/typebox\";\nimport { Capabilities } from \"../capabilities/index.js\";\nimport {\n PermissionsContext,\n PermissionsData,\n} from \"../capabilities/permissions/index.js\";\nimport {\n TypeAddress,\n TypeBase64UrlEncodedString,\n TypeCreationOptions,\n TypeHex,\n TypeSerializedInitcode,\n TypeSignatureRequest,\n TypeUserOperationRequest_v6,\n TypeUserOperationRequest_v7,\n TypeUuid,\n} from \"../schemas.js\";\n\nexport const wallet_sendPreparedCalls = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_sendPreparedCalls\"),\n params: Type.Tuple([\n Type.Object({\n type: Type.Union([\n Type.Literal(\"user-operation-v060\"),\n Type.Literal(\"user-operation-v070\"),\n ]),\n data: Type.Union([\n Type.Omit(TypeUserOperationRequest_v6, [\"signature\"]),\n Type.Omit(TypeUserOperationRequest_v7, [\"signature\"]),\n ]),\n chainId: TypeHex(),\n signature: Type.Object({\n type: Type.Transform(Type.String())\n .Decode((value) => {\n if (value.toLowerCase() !== \"ecdsa\") {\n throw new Error(\"Invalid signature type, must be 'ecdsa'\");\n }\n\n return \"ecdsa\" as const;\n })\n .Encode((value) => value),\n signature: TypeHex(),\n }),\n capabilities: Type.Optional(\n Type.Object({ permissions: PermissionsContext }),\n ),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n preparedCallIds: Type.Array(TypeHex()),\n }),\n },\n {\n description:\n \"This method is used after signing the signatureRequest returned from prepareCalls to submit a user operation\",\n },\n);\n\nexport const wallet_prepareCalls = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_prepareCalls\"),\n params: Type.Tuple([\n Type.Object({\n calls: Type.Array(\n Type.Object({\n to: TypeAddress,\n data: Type.Optional(TypeHex()),\n value: Type.Optional(TypeHex()),\n }),\n ),\n from: TypeAddress,\n chainId: TypeHex(),\n capabilities: Type.Optional(Capabilities),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n type: Type.Union([\n Type.Literal(\"user-operation-v060\"),\n Type.Literal(\"user-operation-v070\"),\n ]),\n data: Type.Union([\n Type.Omit(TypeUserOperationRequest_v6, [\"signature\"]),\n Type.Omit(TypeUserOperationRequest_v7, [\"signature\"]),\n ]),\n chainId: TypeHex(),\n signatureRequest: TypeSignatureRequest,\n }),\n },\n {\n description:\n \"This method is used to prepare a user operation for submission. It will return a built user operation and a signature request which needs to be signed by the user before submitting to wallet_sendPreparedCalls\",\n },\n);\n\nexport const wallet_requestAccount = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_requestAccount\"),\n params: Type.Tuple([\n Type.Union([\n Type.Object({\n signerAddress: TypeAddress,\n id: Type.Optional(TypeUuid),\n creationHint: TypeCreationOptions,\n includeCounterfactualInfo: Type.Optional(\n Type.Boolean({ default: false }),\n ),\n }),\n Type.Object({\n accountAddress: TypeAddress,\n includeCounterfactualInfo: Type.Optional(\n Type.Boolean({ default: false }),\n ),\n }),\n ]),\n ]),\n }),\n ReturnType: Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n counterfactualInfo: Type.Optional(TypeSerializedInitcode),\n }),\n },\n {\n description: `This method is used to get the smart account address and relevant info for a given signer. If an account does not already exist for a given signer, this method will create one before returning the counterfactual address.`,\n },\n);\n\nexport const wallet_createAccount = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_createAccount\"),\n params: Type.Tuple([\n Type.Object({\n signerAddress: TypeAddress,\n id: Type.Optional(TypeUuid),\n creationOptions: TypeCreationOptions,\n }),\n ]),\n }),\n ReturnType: Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n }),\n },\n {\n description: `This method is used to create a smart account for a given signer. This method is primarly used to import existing accounts. For most cases, you should use wallet_requestAccount instead.`,\n },\n);\n\nexport const wallet_listAccounts = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_listAccounts\"),\n params: Type.Tuple([\n Type.Object({\n signerAddress: TypeAddress,\n limit: Type.Optional(\n Type.Number({ minimum: 1, maximum: 100, default: 100 }),\n ),\n after: Type.Optional(TypeBase64UrlEncodedString),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n accounts: Type.Array(\n Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n }),\n ),\n meta: Type.Object({\n totalCount: Type.Number(),\n after: Type.Union([TypeBase64UrlEncodedString, Type.Null()]),\n }),\n }),\n },\n {\n description:\n \"This method is used to list all smart accounts for a given signer.\",\n },\n);\n\nexport const wallet_createSession = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_createSession\"),\n params: Type.Tuple([\n Type.Intersect([\n PermissionsData,\n Type.Object({ account: TypeAddress }),\n ]),\n ]),\n }),\n ReturnType: Type.Object({\n sessionId: TypeHex(),\n signatureRequest: TypeSignatureRequest,\n }),\n },\n {\n description:\n \"This method is used to create a session for a given address with specified permissions.\",\n },\n);\n\nexport const wallet_getCallsStatus = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_getCallsStatus\"),\n params: Type.Tuple([\n TypeHex({\n description: \"The call ID returned from wallet_sendPreparedCalls\",\n }),\n ]),\n }),\n ReturnType: Type.Object({\n id: TypeHex(),\n chainId: TypeHex(),\n atomic: Type.Boolean(),\n status: Type.Union([\n Type.Literal(100, {\n description:\n \"Batch has been received by the wallet but has not completed execution onchain\",\n }),\n Type.Literal(200, {\n description:\n \"Batch has been included onchain without reverts, receipts array contains info of all calls\",\n }),\n Type.Literal(400, {\n description:\n \"Batch has not been included onchain and wallet will not retry\",\n }),\n Type.Literal(500, {\n description:\n \"Batch reverted *completely* and only changes related to gas charge may have been included onchain\",\n }),\n Type.Literal(600, {\n description:\n \"Batch reverted *partially* and some changes related to batch calls may have been included onchain\",\n }),\n ]),\n receipts: Type.Optional(\n Type.Array(\n Type.Object({\n logs: Type.Array(\n Type.Object({\n address: TypeAddress,\n data: TypeHex(),\n topics: Type.Array(TypeHex()),\n }),\n ),\n status: TypeHex({\n description: \"0x1 for success, 0x0 for failure\",\n }),\n blockHash: TypeHex(),\n blockNumber: TypeHex(),\n gasUsed: TypeHex(),\n transactionHash: TypeHex(),\n }),\n ),\n ),\n }),\n },\n {\n description:\n \"This method is used to get the status of calls IDs returned from wallet_sendPreparedCalls.\",\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/rpc/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,0BAA0B,EAC1B,mBAAmB,EACnB,6BAA6B,EAC7B,OAAO,EACP,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CACjD;IACE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;QACnB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,0BAA0B,CAAC;QAChD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC;gBACV,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;oBACf,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE;wBAClC,KAAK,EAAE,oCAAoC;qBAC5C,CAAC;oBACF,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE;wBAClC,KAAK,EAAE,oCAAoC;qBAC5C,CAAC;iBACH,CAAC;gBACF,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC;oBACf,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,WAAW,CAAC,EAAE;wBACpD,KAAK,EAAE,6CAA6C;qBACrD,CAAC;oBACF,IAAI,CAAC,IAAI,CAAC,2BAA2B,EA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,GAAG,EAAE;gBAChB,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,4FAA4F;aAC/F,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACT,+DAA+D;aAClE,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EACT,mGAAmG;aACtG,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChB,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EACT,mGAAmG;aACtG,CAAC;SACH,CAAC;QACF,QAAQ,EAAE,IAAI,CAAC,QAAQ,CACrB,IAAI,CAAC,KAAK,CACR,IAAI,CAAC,MAAM,CAAC;YACV,IAAI,EAAE,IAAI,CAAC,KAAK,CACd,IAAI,CAAC,MAAM,CAAC;gBACV,OAAO,EAAE,WAAW;gBACpB,IAAI,EAAE,OAAO,EAAE;gBACf,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;aAC9B,CAAC,CACH;YACD,MAAM,EAAE,OAAO,CAAC;gBACd,WAAW,EAAE,kCAAkC;aAChD,CAAC;YACF,SAAS,EAAE,OAAO,EAAE;YACpB,WAAW,EAAE,OAAO,EAAE;YACtB,OAAO,EAAE,OAAO,EAAE;YAClB,eAAe,EAAE,OAAO,EAAE;SAC3B,CAAC,CACH,CACF;KACF,CAAC;CACH,EACD;IACE,WAAW,EACT,4FAA4F;IAC9F,QAAQ,EAAE,QAAQ,CAAC,cAAc;CAClC,CACF,CAAC","sourcesContent":["import { Type } from \"@sinclair/typebox\";\nimport { Capabilities } from \"../capabilities/index.js\";\nimport {\n PermissionsContext,\n PermissionsData,\n RemotePermission,\n} from \"../capabilities/permissions/index.js\";\nimport {\n TypeAddress,\n TypeBase64UrlEncodedString,\n TypeCreationOptions,\n TypeEip7702AuthExtendedFields,\n TypeHex,\n TypeSerializedInitcode,\n TypeSignatureRequest,\n TypeUserOperationRequest_v6,\n TypeUserOperationRequest_v7,\n TypeUuid,\n} from \"../schemas.js\";\nimport { Examples } from \"./examples.js\";\n\nexport const wallet_sendPreparedCalls = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_sendPreparedCalls\"),\n params: Type.Tuple([\n Type.Object({\n type: Type.Union([\n Type.Literal(\"user-operation-v060\", {\n title: \"User Operation (Entrypoint v0.6.0)\",\n }),\n Type.Literal(\"user-operation-v070\", {\n title: \"User Operation (Entrypoint v0.7.0)\",\n }),\n ]),\n data: Type.Union([\n Type.Omit(TypeUserOperationRequest_v6, [\"signature\"], {\n title: \"Unsigned User Operation (Entrypoint v0.6.0)\",\n }),\n Type.Omit(TypeUserOperationRequest_v7, [\"signature\"], {\n title: \"Unsigned User Operation (Entrypoint v0.7.0)\",\n }),\n ]),\n chainId: TypeHex(),\n signature: Type.Object({\n type: Type.Transform(Type.Literal(\"ecdsa\"))\n .Decode((value) => {\n if (value.toLowerCase() !== \"ecdsa\") {\n throw new Error(\"Invalid signature type, must be 'ecdsa'\");\n }\n\n return \"ecdsa\" as const;\n })\n .Encode((value) => value),\n signature: TypeHex(),\n }),\n signedAuthorization: Type.Optional(TypeEip7702AuthExtendedFields),\n capabilities: Type.Optional(\n Type.Object({\n permissions: Type.Optional(\n Type.Union([PermissionsContext, RemotePermission]),\n ),\n }),\n ),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n preparedCallIds: Type.Array(TypeHex()),\n }),\n },\n {\n description:\n \"This method is used after signing the signatureRequest returned from prepareCalls to submit a user operation\",\n examples: Examples.SendPreparedCalls,\n },\n);\n\nexport const wallet_prepareCalls = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_prepareCalls\"),\n params: Type.Tuple([\n Type.Object({\n calls: Type.Array(\n Type.Object({\n to: TypeAddress,\n data: Type.Optional(TypeHex()),\n value: Type.Optional(TypeHex()),\n }),\n ),\n from: TypeAddress,\n chainId: TypeHex(),\n capabilities: Type.Optional(Capabilities),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n type: Type.Union([\n Type.Literal(\"user-operation-v060\", {\n title: \"User Operation (Entrypoint v0.6.0)\",\n }),\n Type.Literal(\"user-operation-v070\", {\n title: \"User Operation (Entrypoint v0.7.0)\",\n }),\n ]),\n data: Type.Union([\n Type.Omit(TypeUserOperationRequest_v6, [\"signature\"], {\n title: \"Unsigned User Operation (Entrypoint v0.6.0)\",\n }),\n Type.Omit(TypeUserOperationRequest_v7, [\"signature\"], {\n title: \"Unsigned User Operation (Entrypoint v0.7.0)\",\n }),\n ]),\n chainId: TypeHex(),\n signatureRequest: TypeSignatureRequest,\n }),\n },\n {\n description:\n \"This method is used to prepare a user operation for submission. It will return a built user operation and a signature request which needs to be signed by the user before submitting to wallet_sendPreparedCalls\",\n examples: Examples.PrepareCalls,\n },\n);\n\nexport const wallet_requestAccount = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_requestAccount\"),\n params: Type.Tuple([\n Type.Union([\n Type.Object(\n {\n signerAddress: TypeAddress,\n id: Type.Optional(TypeUuid),\n creationHint: TypeCreationOptions,\n includeCounterfactualInfo: Type.Optional(\n Type.Boolean({ default: false }),\n ),\n },\n {\n title: \"Using signer address\",\n },\n ),\n Type.Object(\n {\n accountAddress: TypeAddress,\n includeCounterfactualInfo: Type.Optional(\n Type.Boolean({ default: false }),\n ),\n },\n {\n title: \"Using smart contract account address\",\n },\n ),\n ]),\n ]),\n }),\n ReturnType: Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n counterfactualInfo: Type.Optional(TypeSerializedInitcode),\n delegation: Type.Optional(TypeAddress),\n }),\n },\n {\n description: `This method is used to get the smart account address and relevant info for a given signer. If an account does not already exist for a given signer, this method will create one before returning the counterfactual address.`,\n examples: Examples.RequestAccount,\n },\n);\n\nexport const wallet_createAccount = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_createAccount\"),\n params: Type.Tuple([\n Type.Object({\n signerAddress: TypeAddress,\n id: Type.Optional(TypeUuid),\n creationOptions: TypeCreationOptions,\n }),\n ]),\n }),\n ReturnType: Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n }),\n },\n {\n description: `This method is used to create a smart account for a given signer. This method is primarly used to import existing accounts. For most cases, you should use wallet_requestAccount instead.`,\n examples: Examples.CreateAccount,\n },\n);\n\nexport const wallet_listAccounts = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_listAccounts\"),\n params: Type.Tuple([\n Type.Object({\n signerAddress: TypeAddress,\n limit: Type.Optional(\n Type.Number({ minimum: 1, maximum: 100, default: 100 }),\n ),\n after: Type.Optional(TypeBase64UrlEncodedString),\n }),\n ]),\n }),\n ReturnType: Type.Object({\n accounts: Type.Array(\n Type.Object({\n accountAddress: TypeAddress,\n id: TypeUuid,\n }),\n ),\n meta: Type.Object({\n totalCount: Type.Integer(),\n after: Type.Union([TypeBase64UrlEncodedString, Type.Null()]),\n }),\n }),\n },\n {\n description:\n \"This method is used to list all smart accounts for a given signer.\",\n examples: Examples.ListAccounts,\n },\n);\n\nexport const wallet_createSession = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_createSession\"),\n params: Type.Tuple([\n Type.Intersect([\n PermissionsData,\n Type.Object({\n account: TypeAddress,\n }),\n ]),\n ]),\n }),\n ReturnType: Type.Object({\n sessionId: TypeHex(),\n signatureRequest: TypeSignatureRequest,\n }),\n },\n {\n description:\n \"This method is used to create a session for a given address with specified permissions.\",\n examples: Examples.CreateSession,\n },\n);\n\nexport const wallet_getCallsStatus = Type.Object(\n {\n Request: Type.Object({\n method: Type.Literal(\"wallet_getCallsStatus\"),\n params: Type.Tuple([\n TypeHex({\n description: \"The call ID returned from wallet_sendPreparedCalls\",\n }),\n ]),\n }),\n ReturnType: Type.Object({\n id: TypeHex(),\n chainId: TypeHex(),\n atomic: Type.Boolean(),\n status: Type.Union([\n Type.Literal(100, {\n title: \"Pending\",\n description:\n \"Batch has been received by the wallet but has not completed execution onchain\",\n }),\n Type.Literal(200, {\n title: \"Confirmed\",\n description:\n \"Batch has been included onchain without reverts, receipts array contains info of all calls\",\n }),\n Type.Literal(400, {\n title: \"Offchain Failure\",\n description:\n \"Batch has not been included onchain and wallet will not retry\",\n }),\n Type.Literal(500, {\n title: \"Onchain Failure\",\n description:\n \"Batch reverted *completely* and only changes related to gas charge may have been included onchain\",\n }),\n Type.Literal(600, {\n title: \"Partial Onchain Failure\",\n description:\n \"Batch reverted *partially* and some changes related to batch calls may have been included onchain\",\n }),\n ]),\n receipts: Type.Optional(\n Type.Array(\n Type.Object({\n logs: Type.Array(\n Type.Object({\n address: TypeAddress,\n data: TypeHex(),\n topics: Type.Array(TypeHex()),\n }),\n ),\n status: TypeHex({\n description: \"0x1 for success, 0x0 for failure\",\n }),\n blockHash: TypeHex(),\n blockNumber: TypeHex(),\n gasUsed: TypeHex(),\n transactionHash: TypeHex(),\n }),\n ),\n ),\n }),\n },\n {\n description:\n \"This method is used to get the status of calls IDs returned from wallet_sendPreparedCalls.\",\n examples: Examples.GetCallsStatus,\n },\n);\n"]}
|
package/dist/esm/rpc/schema.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ export declare const WalletServerRpcSchema: {
|
|
|
4
4
|
capabilities?: {
|
|
5
5
|
permissions?: {
|
|
6
6
|
context: `0x${string}`;
|
|
7
|
+
} | {
|
|
8
|
+
signature: `0x${string}`;
|
|
9
|
+
sessionId: `0x${string}`;
|
|
7
10
|
} | undefined;
|
|
8
11
|
paymasterService?: {
|
|
9
12
|
policyId: string;
|
|
@@ -43,7 +46,7 @@ export declare const WalletServerRpcSchema: {
|
|
|
43
46
|
method: "wallet_prepareCalls";
|
|
44
47
|
};
|
|
45
48
|
ReturnType: {
|
|
46
|
-
type: "user-operation-
|
|
49
|
+
type: "user-operation-v070" | "user-operation-v060";
|
|
47
50
|
chainId: `0x${string}`;
|
|
48
51
|
data: {
|
|
49
52
|
sender: `0x${string}`;
|
|
@@ -72,7 +75,7 @@ export declare const WalletServerRpcSchema: {
|
|
|
72
75
|
maxFeePerGas: `0x${string}`;
|
|
73
76
|
maxPriorityFeePerGas: `0x${string}`;
|
|
74
77
|
};
|
|
75
|
-
signatureRequest: {
|
|
78
|
+
signatureRequest: ({
|
|
76
79
|
type: "personal_sign";
|
|
77
80
|
data: string | {
|
|
78
81
|
raw: `0x${string}`;
|
|
@@ -81,8 +84,8 @@ export declare const WalletServerRpcSchema: {
|
|
|
81
84
|
type: "eth_signTypedData_v4";
|
|
82
85
|
data: {
|
|
83
86
|
domain?: {
|
|
84
|
-
salt?: `0x${string}` | undefined;
|
|
85
87
|
chainId?: number | undefined;
|
|
88
|
+
salt?: `0x${string}` | undefined;
|
|
86
89
|
name?: string | undefined;
|
|
87
90
|
verifyingContract?: `0x${string}` | undefined;
|
|
88
91
|
version?: string | undefined;
|
|
@@ -98,17 +101,34 @@ export declare const WalletServerRpcSchema: {
|
|
|
98
101
|
[x: string]: unknown;
|
|
99
102
|
};
|
|
100
103
|
};
|
|
104
|
+
}) & {
|
|
105
|
+
authorizationRequest?: {
|
|
106
|
+
nonce: number;
|
|
107
|
+
chainId: number;
|
|
108
|
+
address: `0x${string}`;
|
|
109
|
+
} | undefined;
|
|
101
110
|
};
|
|
102
111
|
};
|
|
103
112
|
} | {
|
|
104
113
|
Request: {
|
|
105
114
|
params: [{
|
|
115
|
+
signedAuthorization?: {
|
|
116
|
+
nonce: `0x${string}`;
|
|
117
|
+
chainId: `0x${string}`;
|
|
118
|
+
address: `0x${string}`;
|
|
119
|
+
r: `0x${string}`;
|
|
120
|
+
s: `0x${string}`;
|
|
121
|
+
yParity: `0x${string}`;
|
|
122
|
+
} | undefined;
|
|
106
123
|
capabilities?: {
|
|
107
|
-
permissions
|
|
124
|
+
permissions?: {
|
|
108
125
|
context: `0x${string}`;
|
|
109
|
-
}
|
|
126
|
+
} | {
|
|
127
|
+
signature: `0x${string}`;
|
|
128
|
+
sessionId: `0x${string}`;
|
|
129
|
+
} | undefined;
|
|
110
130
|
} | undefined;
|
|
111
|
-
type: "user-operation-
|
|
131
|
+
type: "user-operation-v070" | "user-operation-v060";
|
|
112
132
|
signature: {
|
|
113
133
|
type: "ecdsa";
|
|
114
134
|
signature: `0x${string}`;
|
|
@@ -154,6 +174,8 @@ export declare const WalletServerRpcSchema: {
|
|
|
154
174
|
creationOptions?: {
|
|
155
175
|
salt?: `0x${string}` | undefined;
|
|
156
176
|
accountType?: "sma-b" | undefined;
|
|
177
|
+
} | {
|
|
178
|
+
accountType: "7702";
|
|
157
179
|
} | undefined;
|
|
158
180
|
signerAddress: `0x${string}`;
|
|
159
181
|
}];
|
|
@@ -170,6 +192,8 @@ export declare const WalletServerRpcSchema: {
|
|
|
170
192
|
creationHint?: {
|
|
171
193
|
salt?: `0x${string}` | undefined;
|
|
172
194
|
accountType?: "sma-b" | undefined;
|
|
195
|
+
} | {
|
|
196
|
+
accountType: "7702";
|
|
173
197
|
} | undefined;
|
|
174
198
|
includeCounterfactualInfo?: boolean | undefined;
|
|
175
199
|
signerAddress: `0x${string}`;
|
|
@@ -185,6 +209,7 @@ export declare const WalletServerRpcSchema: {
|
|
|
185
209
|
factoryAddress: `0x${string}`;
|
|
186
210
|
factoryType: "unknown" | "LightAccountV2.0.0" | "LightAccountV1.1.0" | "LightAccountV1.0.2" | "LightAccountV1.0.1" | "MAv1.0.0-MultiOwner" | "LightAccountV2.0.0-MultiOwner" | "MAv1.0.0-MultiSig" | "MAv2.0.0-sma-b" | "MAv2.0.0-ma-ssv" | "MAv2.0.0-ma-webauthn";
|
|
187
211
|
} | undefined;
|
|
212
|
+
delegation?: `0x${string}` | undefined;
|
|
188
213
|
accountAddress: `0x${string}`;
|
|
189
214
|
id: string;
|
|
190
215
|
};
|
|
@@ -224,8 +249,8 @@ export declare const WalletServerRpcSchema: {
|
|
|
224
249
|
} | {
|
|
225
250
|
type: "erc20-token-transfer";
|
|
226
251
|
data: {
|
|
227
|
-
allowance: `0x${string}`;
|
|
228
252
|
address: `0x${string}`;
|
|
253
|
+
allowance: `0x${string}`;
|
|
229
254
|
};
|
|
230
255
|
} | {
|
|
231
256
|
type: "gas-limit";
|
|
@@ -264,7 +289,7 @@ export declare const WalletServerRpcSchema: {
|
|
|
264
289
|
};
|
|
265
290
|
ReturnType: {
|
|
266
291
|
sessionId: `0x${string}`;
|
|
267
|
-
signatureRequest: {
|
|
292
|
+
signatureRequest: ({
|
|
268
293
|
type: "personal_sign";
|
|
269
294
|
data: string | {
|
|
270
295
|
raw: `0x${string}`;
|
|
@@ -273,8 +298,8 @@ export declare const WalletServerRpcSchema: {
|
|
|
273
298
|
type: "eth_signTypedData_v4";
|
|
274
299
|
data: {
|
|
275
300
|
domain?: {
|
|
276
|
-
salt?: `0x${string}` | undefined;
|
|
277
301
|
chainId?: number | undefined;
|
|
302
|
+
salt?: `0x${string}` | undefined;
|
|
278
303
|
name?: string | undefined;
|
|
279
304
|
verifyingContract?: `0x${string}` | undefined;
|
|
280
305
|
version?: string | undefined;
|
|
@@ -290,6 +315,12 @@ export declare const WalletServerRpcSchema: {
|
|
|
290
315
|
[x: string]: unknown;
|
|
291
316
|
};
|
|
292
317
|
};
|
|
318
|
+
}) & {
|
|
319
|
+
authorizationRequest?: {
|
|
320
|
+
nonce: number;
|
|
321
|
+
chainId: number;
|
|
322
|
+
address: `0x${string}`;
|
|
323
|
+
} | undefined;
|
|
293
324
|
};
|
|
294
325
|
};
|
|
295
326
|
} | {
|
|
@@ -301,8 +332,8 @@ export declare const WalletServerRpcSchema: {
|
|
|
301
332
|
receipts?: {
|
|
302
333
|
status: `0x${string}`;
|
|
303
334
|
logs: {
|
|
304
|
-
data: `0x${string}`;
|
|
305
335
|
address: `0x${string}`;
|
|
336
|
+
data: `0x${string}`;
|
|
306
337
|
topics: `0x${string}`[];
|
|
307
338
|
}[];
|
|
308
339
|
blockHash: `0x${string}`;
|
|
@@ -313,7 +344,7 @@ export declare const WalletServerRpcSchema: {
|
|
|
313
344
|
chainId: `0x${string}`;
|
|
314
345
|
id: `0x${string}`;
|
|
315
346
|
atomic: boolean;
|
|
316
|
-
status:
|
|
347
|
+
status: 200 | 100 | 400 | 500 | 600;
|
|
317
348
|
};
|
|
318
349
|
};
|
|
319
350
|
export type WalletServerRpcSchemaType = typeof WalletServerRpcSchema;
|
package/dist/esm/schemas.d.ts
CHANGED
|
@@ -35,6 +35,19 @@ export declare const TypeUserOperationRequest_v7: import("@sinclair/typebox").TO
|
|
|
35
35
|
paymasterPostOpGasLimit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
36
36
|
signature: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
37
37
|
}>;
|
|
38
|
+
export declare const TypeEip7702AuthRequest: import("@sinclair/typebox").TObject<{
|
|
39
|
+
chainId: import("@sinclair/typebox").TInteger;
|
|
40
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
41
|
+
nonce: import("@sinclair/typebox").TInteger;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const TypeEip7702AuthExtendedFields: import("@sinclair/typebox").TObject<{
|
|
44
|
+
chainId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
45
|
+
nonce: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
46
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
47
|
+
r: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
48
|
+
s: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
49
|
+
yParity: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
50
|
+
}>;
|
|
38
51
|
export declare const TypeWebAuthnPublicKey: import("@sinclair/typebox").TObject<{
|
|
39
52
|
x: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TString, bigint>;
|
|
40
53
|
y: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TString, bigint>;
|
|
@@ -123,12 +136,15 @@ export declare const TypeCounterfactualInfo: import("@sinclair/typebox").TInters
|
|
|
123
136
|
}>]>]>]>;
|
|
124
137
|
}>]>, import("@sinclair/typebox").TObject<{
|
|
125
138
|
type: import("@sinclair/typebox").TLiteral<"7702">;
|
|
139
|
+
implementationAddress: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
126
140
|
}>]>]>;
|
|
127
141
|
export type TypeCounterfactualInfo = Static<typeof TypeCounterfactualInfo>;
|
|
128
|
-
export declare const TypeCreationOptions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
142
|
+
export declare const TypeCreationOptions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
129
143
|
accountType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<"sma-b">>;
|
|
130
144
|
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
131
|
-
}
|
|
145
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
146
|
+
accountType: import("@sinclair/typebox").TLiteral<"7702">;
|
|
147
|
+
}>]>>;
|
|
132
148
|
export type TypeCreationOptions = Static<typeof TypeCreationOptions>;
|
|
133
149
|
export type TypeAccountType = Exclude<Static<typeof TypeCreationOptions>, undefined>["accountType"];
|
|
134
150
|
export declare const KeySigner: import("@sinclair/typebox").TObject<{
|
|
@@ -138,7 +154,7 @@ export declare const KeySigner: import("@sinclair/typebox").TObject<{
|
|
|
138
154
|
export type KeySigner = Static<typeof KeySigner>;
|
|
139
155
|
export declare const TTypedDataDefinition: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TObject<{
|
|
140
156
|
domain: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
141
|
-
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
|
157
|
+
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
142
158
|
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
143
159
|
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
144
160
|
verifyingContract: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
@@ -152,8 +168,8 @@ export declare const TTypedDataDefinition: import("@sinclair/typebox").TTransfor
|
|
|
152
168
|
message: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
153
169
|
}>, {
|
|
154
170
|
domain?: {
|
|
155
|
-
salt?: `0x${string}` | undefined;
|
|
156
171
|
chainId?: number | undefined;
|
|
172
|
+
salt?: `0x${string}` | undefined;
|
|
157
173
|
name?: string | undefined;
|
|
158
174
|
verifyingContract?: `0x${string}` | undefined;
|
|
159
175
|
version?: string | undefined;
|
|
@@ -169,7 +185,7 @@ export declare const TTypedDataDefinition: import("@sinclair/typebox").TTransfor
|
|
|
169
185
|
[x: string]: unknown;
|
|
170
186
|
};
|
|
171
187
|
}>;
|
|
172
|
-
export declare const TypeSignatureRequest: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
188
|
+
export declare const TypeSignatureRequest: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
173
189
|
type: import("@sinclair/typebox").TLiteral<"personal_sign">;
|
|
174
190
|
data: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
175
191
|
raw: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
@@ -178,7 +194,7 @@ export declare const TypeSignatureRequest: import("@sinclair/typebox").TUnion<[i
|
|
|
178
194
|
type: import("@sinclair/typebox").TLiteral<"eth_signTypedData_v4">;
|
|
179
195
|
data: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TObject<{
|
|
180
196
|
domain: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
181
|
-
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
|
197
|
+
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
182
198
|
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
183
199
|
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
184
200
|
verifyingContract: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
@@ -192,8 +208,8 @@ export declare const TypeSignatureRequest: import("@sinclair/typebox").TUnion<[i
|
|
|
192
208
|
message: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
193
209
|
}>, {
|
|
194
210
|
domain?: {
|
|
195
|
-
salt?: `0x${string}` | undefined;
|
|
196
211
|
chainId?: number | undefined;
|
|
212
|
+
salt?: `0x${string}` | undefined;
|
|
197
213
|
name?: string | undefined;
|
|
198
214
|
verifyingContract?: `0x${string}` | undefined;
|
|
199
215
|
version?: string | undefined;
|
|
@@ -209,6 +225,12 @@ export declare const TypeSignatureRequest: import("@sinclair/typebox").TUnion<[i
|
|
|
209
225
|
[x: string]: unknown;
|
|
210
226
|
};
|
|
211
227
|
}>;
|
|
228
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
229
|
+
authorizationRequest: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
230
|
+
chainId: import("@sinclair/typebox").TInteger;
|
|
231
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
232
|
+
nonce: import("@sinclair/typebox").TInteger;
|
|
233
|
+
}>>;
|
|
212
234
|
}>]>;
|
|
213
235
|
export declare const TypeCallId: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">, {
|
|
214
236
|
chainId: `0x${string}`;
|