@tinycloudlabs/web-core 0.2.0 → 1.0.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/LICENSE.md +320 -0
- package/dist/client/types.d.ts +23 -23
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.schema.d.ts +1853 -0
- package/dist/client/types.schema.d.ts.map +1 -0
- package/dist/client/types.schema.js +250 -0
- package/dist/client/types.schema.js.map +1 -0
- package/dist/types.d.ts +61 -61
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +83 -83
- package/dist/types.js.map +1 -1
- package/dist/types.schema.d.ts +594 -0
- package/dist/types.schema.d.ts.map +1 -0
- package/dist/types.schema.js +377 -0
- package/dist/types.schema.js.map +1 -0
- package/dist/utils/utils.d.ts +4 -4
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +16 -16
- package/dist/utils/utils.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,1853 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for TinyCloud Web Core client types.
|
|
3
|
+
*
|
|
4
|
+
* These schemas provide runtime validation for client sessions, configurations,
|
|
5
|
+
* and extension interfaces. Types are derived from schemas using z.infer<>.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
/**
|
|
11
|
+
* The URL of the server running tcw-server.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ServerHostSchema: z.ZodString;
|
|
14
|
+
export type ServerHost = z.infer<typeof ServerHostSchema>;
|
|
15
|
+
/**
|
|
16
|
+
* The tcw-powered server configuration settings.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ProviderServerSchema: z.ZodObject<{
|
|
19
|
+
host: z.ZodString;
|
|
20
|
+
/** Optional configuration for the server's routes. */
|
|
21
|
+
routes: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
nonce: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
23
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
25
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
url?: string;
|
|
28
|
+
method?: "get" | "post" | "put" | "delete";
|
|
29
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
30
|
+
}, {
|
|
31
|
+
url?: string;
|
|
32
|
+
method?: "get" | "post" | "put" | "delete";
|
|
33
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
34
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
35
|
+
path: z.ZodString;
|
|
36
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
path?: string;
|
|
39
|
+
callback?: (...args: unknown[]) => unknown;
|
|
40
|
+
}, {
|
|
41
|
+
path?: string;
|
|
42
|
+
callback?: (...args: unknown[]) => unknown;
|
|
43
|
+
}>]>>;
|
|
44
|
+
login: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
45
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
46
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
47
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
url?: string;
|
|
50
|
+
method?: "get" | "post" | "put" | "delete";
|
|
51
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
52
|
+
}, {
|
|
53
|
+
url?: string;
|
|
54
|
+
method?: "get" | "post" | "put" | "delete";
|
|
55
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
56
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
57
|
+
path: z.ZodString;
|
|
58
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
path?: string;
|
|
61
|
+
callback?: (...args: unknown[]) => unknown;
|
|
62
|
+
}, {
|
|
63
|
+
path?: string;
|
|
64
|
+
callback?: (...args: unknown[]) => unknown;
|
|
65
|
+
}>]>>;
|
|
66
|
+
logout: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
67
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
68
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
69
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
url?: string;
|
|
72
|
+
method?: "get" | "post" | "put" | "delete";
|
|
73
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
74
|
+
}, {
|
|
75
|
+
url?: string;
|
|
76
|
+
method?: "get" | "post" | "put" | "delete";
|
|
77
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
78
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
79
|
+
path: z.ZodString;
|
|
80
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
path?: string;
|
|
83
|
+
callback?: (...args: unknown[]) => unknown;
|
|
84
|
+
}, {
|
|
85
|
+
path?: string;
|
|
86
|
+
callback?: (...args: unknown[]) => unknown;
|
|
87
|
+
}>]>>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
nonce?: unknown;
|
|
90
|
+
login?: unknown;
|
|
91
|
+
logout?: unknown;
|
|
92
|
+
}, {
|
|
93
|
+
nonce?: unknown;
|
|
94
|
+
login?: unknown;
|
|
95
|
+
logout?: unknown;
|
|
96
|
+
}>>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
host?: string;
|
|
99
|
+
routes?: {
|
|
100
|
+
nonce?: unknown;
|
|
101
|
+
login?: unknown;
|
|
102
|
+
logout?: unknown;
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
host?: string;
|
|
106
|
+
routes?: {
|
|
107
|
+
nonce?: unknown;
|
|
108
|
+
login?: unknown;
|
|
109
|
+
logout?: unknown;
|
|
110
|
+
};
|
|
111
|
+
}>;
|
|
112
|
+
export type ProviderServer = z.infer<typeof ProviderServerSchema>;
|
|
113
|
+
/**
|
|
114
|
+
* Web3 provider configuration settings.
|
|
115
|
+
* Note: driver is any external provider (Metamask, Web3Modal, etc.)
|
|
116
|
+
*/
|
|
117
|
+
export declare const ProviderWeb3Schema: z.ZodObject<{
|
|
118
|
+
/**
|
|
119
|
+
* window.ethereum for Metamask;
|
|
120
|
+
* web3modal.connect() for Web3Modal;
|
|
121
|
+
* const signer = useSigner(); const provider = signer.provider; from Wagmi for Rainbowkit
|
|
122
|
+
*/
|
|
123
|
+
driver: z.ZodUnknown;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
driver?: unknown;
|
|
126
|
+
}, {
|
|
127
|
+
driver?: unknown;
|
|
128
|
+
}>;
|
|
129
|
+
export type ProviderWeb3 = z.infer<typeof ProviderWeb3Schema>;
|
|
130
|
+
/**
|
|
131
|
+
* TCW web3 configuration settings.
|
|
132
|
+
*/
|
|
133
|
+
export declare const ClientProvidersSchema: z.ZodObject<{
|
|
134
|
+
/** Web3 wallet provider */
|
|
135
|
+
web3: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
/**
|
|
137
|
+
* window.ethereum for Metamask;
|
|
138
|
+
* web3modal.connect() for Web3Modal;
|
|
139
|
+
* const signer = useSigner(); const provider = signer.provider; from Wagmi for Rainbowkit
|
|
140
|
+
*/
|
|
141
|
+
driver: z.ZodUnknown;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
driver?: unknown;
|
|
144
|
+
}, {
|
|
145
|
+
driver?: unknown;
|
|
146
|
+
}>>;
|
|
147
|
+
/** JSON RPC provider configurations */
|
|
148
|
+
rpc: z.ZodOptional<z.ZodDiscriminatedUnion<"service", [z.ZodObject<{
|
|
149
|
+
service: z.ZodLiteral<"etherscan">;
|
|
150
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
151
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli", "kovan"]>>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
service?: "etherscan";
|
|
154
|
+
apiKey?: string;
|
|
155
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
156
|
+
}, {
|
|
157
|
+
service?: "etherscan";
|
|
158
|
+
apiKey?: string;
|
|
159
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
160
|
+
}>, z.ZodObject<{
|
|
161
|
+
service: z.ZodLiteral<"infura">;
|
|
162
|
+
apiKey: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
163
|
+
projectId: z.ZodString;
|
|
164
|
+
projectSecret: z.ZodString;
|
|
165
|
+
}, "strip", z.ZodTypeAny, {
|
|
166
|
+
projectId?: string;
|
|
167
|
+
projectSecret?: string;
|
|
168
|
+
}, {
|
|
169
|
+
projectId?: string;
|
|
170
|
+
projectSecret?: string;
|
|
171
|
+
}>]>;
|
|
172
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli", "kovan", "matic", "maticmum", "optimism", "optimism-kovan", "arbitrum", "arbitrum-rinkeby"]>>;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
service?: "infura";
|
|
175
|
+
apiKey?: string | {
|
|
176
|
+
projectId?: string;
|
|
177
|
+
projectSecret?: string;
|
|
178
|
+
};
|
|
179
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
180
|
+
}, {
|
|
181
|
+
service?: "infura";
|
|
182
|
+
apiKey?: string | {
|
|
183
|
+
projectId?: string;
|
|
184
|
+
projectSecret?: string;
|
|
185
|
+
};
|
|
186
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
187
|
+
}>, z.ZodObject<{
|
|
188
|
+
service: z.ZodLiteral<"alchemy">;
|
|
189
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
190
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli", "kovan", "matic", "maticmum", "optimism", "optimism-kovan", "arbitrum", "arbitrum-rinkeby"]>>;
|
|
191
|
+
}, "strip", z.ZodTypeAny, {
|
|
192
|
+
service?: "alchemy";
|
|
193
|
+
apiKey?: string;
|
|
194
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
195
|
+
}, {
|
|
196
|
+
service?: "alchemy";
|
|
197
|
+
apiKey?: string;
|
|
198
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
199
|
+
}>, z.ZodObject<{
|
|
200
|
+
service: z.ZodLiteral<"cloudflare">;
|
|
201
|
+
}, "strip", z.ZodTypeAny, {
|
|
202
|
+
service?: "cloudflare";
|
|
203
|
+
}, {
|
|
204
|
+
service?: "cloudflare";
|
|
205
|
+
}>, z.ZodObject<{
|
|
206
|
+
service: z.ZodLiteral<"pocket">;
|
|
207
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
208
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli"]>>;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
service?: "pocket";
|
|
211
|
+
apiKey?: string;
|
|
212
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
213
|
+
}, {
|
|
214
|
+
service?: "pocket";
|
|
215
|
+
apiKey?: string;
|
|
216
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
217
|
+
}>, z.ZodObject<{
|
|
218
|
+
service: z.ZodLiteral<"ankr">;
|
|
219
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
220
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "matic", "arbitrum"]>>;
|
|
221
|
+
}, "strip", z.ZodTypeAny, {
|
|
222
|
+
service?: "ankr";
|
|
223
|
+
apiKey?: string;
|
|
224
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
225
|
+
}, {
|
|
226
|
+
service?: "ankr";
|
|
227
|
+
apiKey?: string;
|
|
228
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
229
|
+
}>, z.ZodObject<{
|
|
230
|
+
service: z.ZodLiteral<"custom">;
|
|
231
|
+
url: z.ZodOptional<z.ZodUnknown>;
|
|
232
|
+
network: z.ZodOptional<z.ZodUnknown>;
|
|
233
|
+
}, "strip", z.ZodTypeAny, {
|
|
234
|
+
service?: "custom";
|
|
235
|
+
network?: unknown;
|
|
236
|
+
url?: unknown;
|
|
237
|
+
}, {
|
|
238
|
+
service?: "custom";
|
|
239
|
+
network?: unknown;
|
|
240
|
+
url?: unknown;
|
|
241
|
+
}>]>>;
|
|
242
|
+
/** Optional reference to server running tcw-server. */
|
|
243
|
+
server: z.ZodOptional<z.ZodObject<{
|
|
244
|
+
host: z.ZodString;
|
|
245
|
+
/** Optional configuration for the server's routes. */
|
|
246
|
+
routes: z.ZodOptional<z.ZodObject<{
|
|
247
|
+
nonce: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
248
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
249
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
250
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
url?: string;
|
|
253
|
+
method?: "get" | "post" | "put" | "delete";
|
|
254
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
255
|
+
}, {
|
|
256
|
+
url?: string;
|
|
257
|
+
method?: "get" | "post" | "put" | "delete";
|
|
258
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
259
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
260
|
+
path: z.ZodString;
|
|
261
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
path?: string;
|
|
264
|
+
callback?: (...args: unknown[]) => unknown;
|
|
265
|
+
}, {
|
|
266
|
+
path?: string;
|
|
267
|
+
callback?: (...args: unknown[]) => unknown;
|
|
268
|
+
}>]>>;
|
|
269
|
+
login: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
270
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
271
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
272
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
273
|
+
}, "strip", z.ZodTypeAny, {
|
|
274
|
+
url?: string;
|
|
275
|
+
method?: "get" | "post" | "put" | "delete";
|
|
276
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
277
|
+
}, {
|
|
278
|
+
url?: string;
|
|
279
|
+
method?: "get" | "post" | "put" | "delete";
|
|
280
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
281
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
282
|
+
path: z.ZodString;
|
|
283
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
284
|
+
}, "strip", z.ZodTypeAny, {
|
|
285
|
+
path?: string;
|
|
286
|
+
callback?: (...args: unknown[]) => unknown;
|
|
287
|
+
}, {
|
|
288
|
+
path?: string;
|
|
289
|
+
callback?: (...args: unknown[]) => unknown;
|
|
290
|
+
}>]>>;
|
|
291
|
+
logout: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
292
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
293
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
294
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
295
|
+
}, "strip", z.ZodTypeAny, {
|
|
296
|
+
url?: string;
|
|
297
|
+
method?: "get" | "post" | "put" | "delete";
|
|
298
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
299
|
+
}, {
|
|
300
|
+
url?: string;
|
|
301
|
+
method?: "get" | "post" | "put" | "delete";
|
|
302
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
303
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
304
|
+
path: z.ZodString;
|
|
305
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
306
|
+
}, "strip", z.ZodTypeAny, {
|
|
307
|
+
path?: string;
|
|
308
|
+
callback?: (...args: unknown[]) => unknown;
|
|
309
|
+
}, {
|
|
310
|
+
path?: string;
|
|
311
|
+
callback?: (...args: unknown[]) => unknown;
|
|
312
|
+
}>]>>;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
nonce?: unknown;
|
|
315
|
+
login?: unknown;
|
|
316
|
+
logout?: unknown;
|
|
317
|
+
}, {
|
|
318
|
+
nonce?: unknown;
|
|
319
|
+
login?: unknown;
|
|
320
|
+
logout?: unknown;
|
|
321
|
+
}>>;
|
|
322
|
+
}, "strip", z.ZodTypeAny, {
|
|
323
|
+
host?: string;
|
|
324
|
+
routes?: {
|
|
325
|
+
nonce?: unknown;
|
|
326
|
+
login?: unknown;
|
|
327
|
+
logout?: unknown;
|
|
328
|
+
};
|
|
329
|
+
}, {
|
|
330
|
+
host?: string;
|
|
331
|
+
routes?: {
|
|
332
|
+
nonce?: unknown;
|
|
333
|
+
login?: unknown;
|
|
334
|
+
logout?: unknown;
|
|
335
|
+
};
|
|
336
|
+
}>>;
|
|
337
|
+
}, "strip", z.ZodTypeAny, {
|
|
338
|
+
web3?: {
|
|
339
|
+
driver?: unknown;
|
|
340
|
+
};
|
|
341
|
+
rpc?: {
|
|
342
|
+
service?: "etherscan";
|
|
343
|
+
apiKey?: string;
|
|
344
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
345
|
+
} | {
|
|
346
|
+
service?: "infura";
|
|
347
|
+
apiKey?: string | {
|
|
348
|
+
projectId?: string;
|
|
349
|
+
projectSecret?: string;
|
|
350
|
+
};
|
|
351
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
352
|
+
} | {
|
|
353
|
+
service?: "alchemy";
|
|
354
|
+
apiKey?: string;
|
|
355
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
356
|
+
} | {
|
|
357
|
+
service?: "cloudflare";
|
|
358
|
+
} | {
|
|
359
|
+
service?: "pocket";
|
|
360
|
+
apiKey?: string;
|
|
361
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
362
|
+
} | {
|
|
363
|
+
service?: "ankr";
|
|
364
|
+
apiKey?: string;
|
|
365
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
366
|
+
} | {
|
|
367
|
+
service?: "custom";
|
|
368
|
+
network?: unknown;
|
|
369
|
+
url?: unknown;
|
|
370
|
+
};
|
|
371
|
+
server?: {
|
|
372
|
+
host?: string;
|
|
373
|
+
routes?: {
|
|
374
|
+
nonce?: unknown;
|
|
375
|
+
login?: unknown;
|
|
376
|
+
logout?: unknown;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
}, {
|
|
380
|
+
web3?: {
|
|
381
|
+
driver?: unknown;
|
|
382
|
+
};
|
|
383
|
+
rpc?: {
|
|
384
|
+
service?: "etherscan";
|
|
385
|
+
apiKey?: string;
|
|
386
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
387
|
+
} | {
|
|
388
|
+
service?: "infura";
|
|
389
|
+
apiKey?: string | {
|
|
390
|
+
projectId?: string;
|
|
391
|
+
projectSecret?: string;
|
|
392
|
+
};
|
|
393
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
394
|
+
} | {
|
|
395
|
+
service?: "alchemy";
|
|
396
|
+
apiKey?: string;
|
|
397
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
398
|
+
} | {
|
|
399
|
+
service?: "cloudflare";
|
|
400
|
+
} | {
|
|
401
|
+
service?: "pocket";
|
|
402
|
+
apiKey?: string;
|
|
403
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
404
|
+
} | {
|
|
405
|
+
service?: "ankr";
|
|
406
|
+
apiKey?: string;
|
|
407
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
408
|
+
} | {
|
|
409
|
+
service?: "custom";
|
|
410
|
+
network?: unknown;
|
|
411
|
+
url?: unknown;
|
|
412
|
+
};
|
|
413
|
+
server?: {
|
|
414
|
+
host?: string;
|
|
415
|
+
routes?: {
|
|
416
|
+
nonce?: unknown;
|
|
417
|
+
login?: unknown;
|
|
418
|
+
logout?: unknown;
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
}>;
|
|
422
|
+
export type ClientProviders = z.infer<typeof ClientProvidersSchema>;
|
|
423
|
+
/**
|
|
424
|
+
* Extra SIWE fields.
|
|
425
|
+
* Note: This is from tcwSession.ExtraFields which is an external type.
|
|
426
|
+
*/
|
|
427
|
+
export declare const ExtraFieldsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
428
|
+
export type ExtraFields = z.infer<typeof ExtraFieldsSchema>;
|
|
429
|
+
/**
|
|
430
|
+
* Optional session configuration for the SIWE message.
|
|
431
|
+
* Note: Extends Partial<tcwSession.SiweConfig> from @tinycloudlabs/web-sdk-wasm.
|
|
432
|
+
*/
|
|
433
|
+
export declare const SiweConfigSchema: z.ZodObject<{
|
|
434
|
+
/** Domain for the SIWE message. */
|
|
435
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
436
|
+
/** URI for the SIWE message. */
|
|
437
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
438
|
+
/** Chain ID for the SIWE message. */
|
|
439
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
440
|
+
/** Statement for the SIWE message. */
|
|
441
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
442
|
+
/** Nonce for the SIWE message. */
|
|
443
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
444
|
+
/** Expiration time for the SIWE message. */
|
|
445
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
446
|
+
/** Not before time for the SIWE message. */
|
|
447
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
448
|
+
/** Request ID for the SIWE message. */
|
|
449
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
450
|
+
/** Resources for the SIWE message. */
|
|
451
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
452
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
453
|
+
/** Domain for the SIWE message. */
|
|
454
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
455
|
+
/** URI for the SIWE message. */
|
|
456
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
457
|
+
/** Chain ID for the SIWE message. */
|
|
458
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
459
|
+
/** Statement for the SIWE message. */
|
|
460
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
461
|
+
/** Nonce for the SIWE message. */
|
|
462
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
463
|
+
/** Expiration time for the SIWE message. */
|
|
464
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
465
|
+
/** Not before time for the SIWE message. */
|
|
466
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
467
|
+
/** Request ID for the SIWE message. */
|
|
468
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
469
|
+
/** Resources for the SIWE message. */
|
|
470
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
471
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
472
|
+
/** Domain for the SIWE message. */
|
|
473
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
474
|
+
/** URI for the SIWE message. */
|
|
475
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
476
|
+
/** Chain ID for the SIWE message. */
|
|
477
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
478
|
+
/** Statement for the SIWE message. */
|
|
479
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
480
|
+
/** Nonce for the SIWE message. */
|
|
481
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
482
|
+
/** Expiration time for the SIWE message. */
|
|
483
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
484
|
+
/** Not before time for the SIWE message. */
|
|
485
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
486
|
+
/** Request ID for the SIWE message. */
|
|
487
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
488
|
+
/** Resources for the SIWE message. */
|
|
489
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
490
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
491
|
+
export type SiweConfig = z.infer<typeof SiweConfigSchema>;
|
|
492
|
+
/**
|
|
493
|
+
* Overrides for the session configuration.
|
|
494
|
+
*/
|
|
495
|
+
export declare const ConfigOverridesSchema: z.ZodObject<{
|
|
496
|
+
siwe: z.ZodOptional<z.ZodObject<{
|
|
497
|
+
/** Domain for the SIWE message. */
|
|
498
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
499
|
+
/** URI for the SIWE message. */
|
|
500
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
501
|
+
/** Chain ID for the SIWE message. */
|
|
502
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
503
|
+
/** Statement for the SIWE message. */
|
|
504
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
505
|
+
/** Nonce for the SIWE message. */
|
|
506
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
507
|
+
/** Expiration time for the SIWE message. */
|
|
508
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
509
|
+
/** Not before time for the SIWE message. */
|
|
510
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
511
|
+
/** Request ID for the SIWE message. */
|
|
512
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
513
|
+
/** Resources for the SIWE message. */
|
|
514
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
515
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
516
|
+
/** Domain for the SIWE message. */
|
|
517
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
518
|
+
/** URI for the SIWE message. */
|
|
519
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
520
|
+
/** Chain ID for the SIWE message. */
|
|
521
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
522
|
+
/** Statement for the SIWE message. */
|
|
523
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
524
|
+
/** Nonce for the SIWE message. */
|
|
525
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
526
|
+
/** Expiration time for the SIWE message. */
|
|
527
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
528
|
+
/** Not before time for the SIWE message. */
|
|
529
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
530
|
+
/** Request ID for the SIWE message. */
|
|
531
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
532
|
+
/** Resources for the SIWE message. */
|
|
533
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
534
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
535
|
+
/** Domain for the SIWE message. */
|
|
536
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
537
|
+
/** URI for the SIWE message. */
|
|
538
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
539
|
+
/** Chain ID for the SIWE message. */
|
|
540
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
541
|
+
/** Statement for the SIWE message. */
|
|
542
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
543
|
+
/** Nonce for the SIWE message. */
|
|
544
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
545
|
+
/** Expiration time for the SIWE message. */
|
|
546
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
547
|
+
/** Not before time for the SIWE message. */
|
|
548
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
549
|
+
/** Request ID for the SIWE message. */
|
|
550
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
551
|
+
/** Resources for the SIWE message. */
|
|
552
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
553
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
554
|
+
}, "strip", z.ZodTypeAny, {
|
|
555
|
+
siwe?: {
|
|
556
|
+
chainId?: number;
|
|
557
|
+
domain?: string;
|
|
558
|
+
nonce?: string;
|
|
559
|
+
expirationTime?: string;
|
|
560
|
+
notBefore?: string;
|
|
561
|
+
requestId?: string;
|
|
562
|
+
resources?: string[];
|
|
563
|
+
statement?: string;
|
|
564
|
+
uri?: string;
|
|
565
|
+
} & {
|
|
566
|
+
[k: string]: unknown;
|
|
567
|
+
};
|
|
568
|
+
}, {
|
|
569
|
+
siwe?: {
|
|
570
|
+
chainId?: number;
|
|
571
|
+
domain?: string;
|
|
572
|
+
nonce?: string;
|
|
573
|
+
expirationTime?: string;
|
|
574
|
+
notBefore?: string;
|
|
575
|
+
requestId?: string;
|
|
576
|
+
resources?: string[];
|
|
577
|
+
statement?: string;
|
|
578
|
+
uri?: string;
|
|
579
|
+
} & {
|
|
580
|
+
[k: string]: unknown;
|
|
581
|
+
};
|
|
582
|
+
}>;
|
|
583
|
+
export type ConfigOverrides = z.infer<typeof ConfigOverridesSchema>;
|
|
584
|
+
/**
|
|
585
|
+
* Core config for TCW.
|
|
586
|
+
*/
|
|
587
|
+
export declare const ClientConfigSchema: z.ZodObject<{
|
|
588
|
+
/** Connection to a cryptographic keypair and/or network. */
|
|
589
|
+
providers: z.ZodOptional<z.ZodObject<{
|
|
590
|
+
/** Web3 wallet provider */
|
|
591
|
+
web3: z.ZodOptional<z.ZodObject<{
|
|
592
|
+
/**
|
|
593
|
+
* window.ethereum for Metamask;
|
|
594
|
+
* web3modal.connect() for Web3Modal;
|
|
595
|
+
* const signer = useSigner(); const provider = signer.provider; from Wagmi for Rainbowkit
|
|
596
|
+
*/
|
|
597
|
+
driver: z.ZodUnknown;
|
|
598
|
+
}, "strip", z.ZodTypeAny, {
|
|
599
|
+
driver?: unknown;
|
|
600
|
+
}, {
|
|
601
|
+
driver?: unknown;
|
|
602
|
+
}>>;
|
|
603
|
+
/** JSON RPC provider configurations */
|
|
604
|
+
rpc: z.ZodOptional<z.ZodDiscriminatedUnion<"service", [z.ZodObject<{
|
|
605
|
+
service: z.ZodLiteral<"etherscan">;
|
|
606
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
607
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli", "kovan"]>>;
|
|
608
|
+
}, "strip", z.ZodTypeAny, {
|
|
609
|
+
service?: "etherscan";
|
|
610
|
+
apiKey?: string;
|
|
611
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
612
|
+
}, {
|
|
613
|
+
service?: "etherscan";
|
|
614
|
+
apiKey?: string;
|
|
615
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
616
|
+
}>, z.ZodObject<{
|
|
617
|
+
service: z.ZodLiteral<"infura">;
|
|
618
|
+
apiKey: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
619
|
+
projectId: z.ZodString;
|
|
620
|
+
projectSecret: z.ZodString;
|
|
621
|
+
}, "strip", z.ZodTypeAny, {
|
|
622
|
+
projectId?: string;
|
|
623
|
+
projectSecret?: string;
|
|
624
|
+
}, {
|
|
625
|
+
projectId?: string;
|
|
626
|
+
projectSecret?: string;
|
|
627
|
+
}>]>;
|
|
628
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli", "kovan", "matic", "maticmum", "optimism", "optimism-kovan", "arbitrum", "arbitrum-rinkeby"]>>;
|
|
629
|
+
}, "strip", z.ZodTypeAny, {
|
|
630
|
+
service?: "infura";
|
|
631
|
+
apiKey?: string | {
|
|
632
|
+
projectId?: string;
|
|
633
|
+
projectSecret?: string;
|
|
634
|
+
};
|
|
635
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
636
|
+
}, {
|
|
637
|
+
service?: "infura";
|
|
638
|
+
apiKey?: string | {
|
|
639
|
+
projectId?: string;
|
|
640
|
+
projectSecret?: string;
|
|
641
|
+
};
|
|
642
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
643
|
+
}>, z.ZodObject<{
|
|
644
|
+
service: z.ZodLiteral<"alchemy">;
|
|
645
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
646
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli", "kovan", "matic", "maticmum", "optimism", "optimism-kovan", "arbitrum", "arbitrum-rinkeby"]>>;
|
|
647
|
+
}, "strip", z.ZodTypeAny, {
|
|
648
|
+
service?: "alchemy";
|
|
649
|
+
apiKey?: string;
|
|
650
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
651
|
+
}, {
|
|
652
|
+
service?: "alchemy";
|
|
653
|
+
apiKey?: string;
|
|
654
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
655
|
+
}>, z.ZodObject<{
|
|
656
|
+
service: z.ZodLiteral<"cloudflare">;
|
|
657
|
+
}, "strip", z.ZodTypeAny, {
|
|
658
|
+
service?: "cloudflare";
|
|
659
|
+
}, {
|
|
660
|
+
service?: "cloudflare";
|
|
661
|
+
}>, z.ZodObject<{
|
|
662
|
+
service: z.ZodLiteral<"pocket">;
|
|
663
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
664
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli"]>>;
|
|
665
|
+
}, "strip", z.ZodTypeAny, {
|
|
666
|
+
service?: "pocket";
|
|
667
|
+
apiKey?: string;
|
|
668
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
669
|
+
}, {
|
|
670
|
+
service?: "pocket";
|
|
671
|
+
apiKey?: string;
|
|
672
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
673
|
+
}>, z.ZodObject<{
|
|
674
|
+
service: z.ZodLiteral<"ankr">;
|
|
675
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
676
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "matic", "arbitrum"]>>;
|
|
677
|
+
}, "strip", z.ZodTypeAny, {
|
|
678
|
+
service?: "ankr";
|
|
679
|
+
apiKey?: string;
|
|
680
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
681
|
+
}, {
|
|
682
|
+
service?: "ankr";
|
|
683
|
+
apiKey?: string;
|
|
684
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
685
|
+
}>, z.ZodObject<{
|
|
686
|
+
service: z.ZodLiteral<"custom">;
|
|
687
|
+
url: z.ZodOptional<z.ZodUnknown>;
|
|
688
|
+
network: z.ZodOptional<z.ZodUnknown>;
|
|
689
|
+
}, "strip", z.ZodTypeAny, {
|
|
690
|
+
service?: "custom";
|
|
691
|
+
network?: unknown;
|
|
692
|
+
url?: unknown;
|
|
693
|
+
}, {
|
|
694
|
+
service?: "custom";
|
|
695
|
+
network?: unknown;
|
|
696
|
+
url?: unknown;
|
|
697
|
+
}>]>>;
|
|
698
|
+
/** Optional reference to server running tcw-server. */
|
|
699
|
+
server: z.ZodOptional<z.ZodObject<{
|
|
700
|
+
host: z.ZodString;
|
|
701
|
+
/** Optional configuration for the server's routes. */
|
|
702
|
+
routes: z.ZodOptional<z.ZodObject<{
|
|
703
|
+
nonce: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
704
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
705
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
706
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
707
|
+
}, "strip", z.ZodTypeAny, {
|
|
708
|
+
url?: string;
|
|
709
|
+
method?: "get" | "post" | "put" | "delete";
|
|
710
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
711
|
+
}, {
|
|
712
|
+
url?: string;
|
|
713
|
+
method?: "get" | "post" | "put" | "delete";
|
|
714
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
715
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
716
|
+
path: z.ZodString;
|
|
717
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
718
|
+
}, "strip", z.ZodTypeAny, {
|
|
719
|
+
path?: string;
|
|
720
|
+
callback?: (...args: unknown[]) => unknown;
|
|
721
|
+
}, {
|
|
722
|
+
path?: string;
|
|
723
|
+
callback?: (...args: unknown[]) => unknown;
|
|
724
|
+
}>]>>;
|
|
725
|
+
login: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
726
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
727
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
728
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
729
|
+
}, "strip", z.ZodTypeAny, {
|
|
730
|
+
url?: string;
|
|
731
|
+
method?: "get" | "post" | "put" | "delete";
|
|
732
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
733
|
+
}, {
|
|
734
|
+
url?: string;
|
|
735
|
+
method?: "get" | "post" | "put" | "delete";
|
|
736
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
737
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
738
|
+
path: z.ZodString;
|
|
739
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
740
|
+
}, "strip", z.ZodTypeAny, {
|
|
741
|
+
path?: string;
|
|
742
|
+
callback?: (...args: unknown[]) => unknown;
|
|
743
|
+
}, {
|
|
744
|
+
path?: string;
|
|
745
|
+
callback?: (...args: unknown[]) => unknown;
|
|
746
|
+
}>]>>;
|
|
747
|
+
logout: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
748
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
749
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
750
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
751
|
+
}, "strip", z.ZodTypeAny, {
|
|
752
|
+
url?: string;
|
|
753
|
+
method?: "get" | "post" | "put" | "delete";
|
|
754
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
755
|
+
}, {
|
|
756
|
+
url?: string;
|
|
757
|
+
method?: "get" | "post" | "put" | "delete";
|
|
758
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
759
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
760
|
+
path: z.ZodString;
|
|
761
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
762
|
+
}, "strip", z.ZodTypeAny, {
|
|
763
|
+
path?: string;
|
|
764
|
+
callback?: (...args: unknown[]) => unknown;
|
|
765
|
+
}, {
|
|
766
|
+
path?: string;
|
|
767
|
+
callback?: (...args: unknown[]) => unknown;
|
|
768
|
+
}>]>>;
|
|
769
|
+
}, "strip", z.ZodTypeAny, {
|
|
770
|
+
nonce?: unknown;
|
|
771
|
+
login?: unknown;
|
|
772
|
+
logout?: unknown;
|
|
773
|
+
}, {
|
|
774
|
+
nonce?: unknown;
|
|
775
|
+
login?: unknown;
|
|
776
|
+
logout?: unknown;
|
|
777
|
+
}>>;
|
|
778
|
+
}, "strip", z.ZodTypeAny, {
|
|
779
|
+
host?: string;
|
|
780
|
+
routes?: {
|
|
781
|
+
nonce?: unknown;
|
|
782
|
+
login?: unknown;
|
|
783
|
+
logout?: unknown;
|
|
784
|
+
};
|
|
785
|
+
}, {
|
|
786
|
+
host?: string;
|
|
787
|
+
routes?: {
|
|
788
|
+
nonce?: unknown;
|
|
789
|
+
login?: unknown;
|
|
790
|
+
logout?: unknown;
|
|
791
|
+
};
|
|
792
|
+
}>>;
|
|
793
|
+
}, "strip", z.ZodTypeAny, {
|
|
794
|
+
web3?: {
|
|
795
|
+
driver?: unknown;
|
|
796
|
+
};
|
|
797
|
+
rpc?: {
|
|
798
|
+
service?: "etherscan";
|
|
799
|
+
apiKey?: string;
|
|
800
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
801
|
+
} | {
|
|
802
|
+
service?: "infura";
|
|
803
|
+
apiKey?: string | {
|
|
804
|
+
projectId?: string;
|
|
805
|
+
projectSecret?: string;
|
|
806
|
+
};
|
|
807
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
808
|
+
} | {
|
|
809
|
+
service?: "alchemy";
|
|
810
|
+
apiKey?: string;
|
|
811
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
812
|
+
} | {
|
|
813
|
+
service?: "cloudflare";
|
|
814
|
+
} | {
|
|
815
|
+
service?: "pocket";
|
|
816
|
+
apiKey?: string;
|
|
817
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
818
|
+
} | {
|
|
819
|
+
service?: "ankr";
|
|
820
|
+
apiKey?: string;
|
|
821
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
822
|
+
} | {
|
|
823
|
+
service?: "custom";
|
|
824
|
+
network?: unknown;
|
|
825
|
+
url?: unknown;
|
|
826
|
+
};
|
|
827
|
+
server?: {
|
|
828
|
+
host?: string;
|
|
829
|
+
routes?: {
|
|
830
|
+
nonce?: unknown;
|
|
831
|
+
login?: unknown;
|
|
832
|
+
logout?: unknown;
|
|
833
|
+
};
|
|
834
|
+
};
|
|
835
|
+
}, {
|
|
836
|
+
web3?: {
|
|
837
|
+
driver?: unknown;
|
|
838
|
+
};
|
|
839
|
+
rpc?: {
|
|
840
|
+
service?: "etherscan";
|
|
841
|
+
apiKey?: string;
|
|
842
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
843
|
+
} | {
|
|
844
|
+
service?: "infura";
|
|
845
|
+
apiKey?: string | {
|
|
846
|
+
projectId?: string;
|
|
847
|
+
projectSecret?: string;
|
|
848
|
+
};
|
|
849
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
850
|
+
} | {
|
|
851
|
+
service?: "alchemy";
|
|
852
|
+
apiKey?: string;
|
|
853
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
854
|
+
} | {
|
|
855
|
+
service?: "cloudflare";
|
|
856
|
+
} | {
|
|
857
|
+
service?: "pocket";
|
|
858
|
+
apiKey?: string;
|
|
859
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
860
|
+
} | {
|
|
861
|
+
service?: "ankr";
|
|
862
|
+
apiKey?: string;
|
|
863
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
864
|
+
} | {
|
|
865
|
+
service?: "custom";
|
|
866
|
+
network?: unknown;
|
|
867
|
+
url?: unknown;
|
|
868
|
+
};
|
|
869
|
+
server?: {
|
|
870
|
+
host?: string;
|
|
871
|
+
routes?: {
|
|
872
|
+
nonce?: unknown;
|
|
873
|
+
login?: unknown;
|
|
874
|
+
logout?: unknown;
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
}>>;
|
|
878
|
+
/** Optional session configuration for the SIWE message. */
|
|
879
|
+
siweConfig: z.ZodOptional<z.ZodObject<{
|
|
880
|
+
/** Domain for the SIWE message. */
|
|
881
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
882
|
+
/** URI for the SIWE message. */
|
|
883
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
884
|
+
/** Chain ID for the SIWE message. */
|
|
885
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
886
|
+
/** Statement for the SIWE message. */
|
|
887
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
888
|
+
/** Nonce for the SIWE message. */
|
|
889
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
890
|
+
/** Expiration time for the SIWE message. */
|
|
891
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
892
|
+
/** Not before time for the SIWE message. */
|
|
893
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
894
|
+
/** Request ID for the SIWE message. */
|
|
895
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
896
|
+
/** Resources for the SIWE message. */
|
|
897
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
898
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
899
|
+
/** Domain for the SIWE message. */
|
|
900
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
901
|
+
/** URI for the SIWE message. */
|
|
902
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
903
|
+
/** Chain ID for the SIWE message. */
|
|
904
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
905
|
+
/** Statement for the SIWE message. */
|
|
906
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
907
|
+
/** Nonce for the SIWE message. */
|
|
908
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
909
|
+
/** Expiration time for the SIWE message. */
|
|
910
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
911
|
+
/** Not before time for the SIWE message. */
|
|
912
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
913
|
+
/** Request ID for the SIWE message. */
|
|
914
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
915
|
+
/** Resources for the SIWE message. */
|
|
916
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
917
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
918
|
+
/** Domain for the SIWE message. */
|
|
919
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
920
|
+
/** URI for the SIWE message. */
|
|
921
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
922
|
+
/** Chain ID for the SIWE message. */
|
|
923
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
924
|
+
/** Statement for the SIWE message. */
|
|
925
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
926
|
+
/** Nonce for the SIWE message. */
|
|
927
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
928
|
+
/** Expiration time for the SIWE message. */
|
|
929
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
930
|
+
/** Not before time for the SIWE message. */
|
|
931
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
932
|
+
/** Request ID for the SIWE message. */
|
|
933
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
934
|
+
/** Resources for the SIWE message. */
|
|
935
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
936
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
937
|
+
/** Whether or not ENS resolution is enabled. True means resolve all on client. */
|
|
938
|
+
resolveEns: z.ZodOptional<z.ZodBoolean>;
|
|
939
|
+
}, "strip", z.ZodTypeAny, {
|
|
940
|
+
providers?: {
|
|
941
|
+
web3?: {
|
|
942
|
+
driver?: unknown;
|
|
943
|
+
};
|
|
944
|
+
rpc?: {
|
|
945
|
+
service?: "etherscan";
|
|
946
|
+
apiKey?: string;
|
|
947
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
948
|
+
} | {
|
|
949
|
+
service?: "infura";
|
|
950
|
+
apiKey?: string | {
|
|
951
|
+
projectId?: string;
|
|
952
|
+
projectSecret?: string;
|
|
953
|
+
};
|
|
954
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
955
|
+
} | {
|
|
956
|
+
service?: "alchemy";
|
|
957
|
+
apiKey?: string;
|
|
958
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
959
|
+
} | {
|
|
960
|
+
service?: "cloudflare";
|
|
961
|
+
} | {
|
|
962
|
+
service?: "pocket";
|
|
963
|
+
apiKey?: string;
|
|
964
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
965
|
+
} | {
|
|
966
|
+
service?: "ankr";
|
|
967
|
+
apiKey?: string;
|
|
968
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
969
|
+
} | {
|
|
970
|
+
service?: "custom";
|
|
971
|
+
network?: unknown;
|
|
972
|
+
url?: unknown;
|
|
973
|
+
};
|
|
974
|
+
server?: {
|
|
975
|
+
host?: string;
|
|
976
|
+
routes?: {
|
|
977
|
+
nonce?: unknown;
|
|
978
|
+
login?: unknown;
|
|
979
|
+
logout?: unknown;
|
|
980
|
+
};
|
|
981
|
+
};
|
|
982
|
+
};
|
|
983
|
+
siweConfig?: {
|
|
984
|
+
chainId?: number;
|
|
985
|
+
domain?: string;
|
|
986
|
+
nonce?: string;
|
|
987
|
+
expirationTime?: string;
|
|
988
|
+
notBefore?: string;
|
|
989
|
+
requestId?: string;
|
|
990
|
+
resources?: string[];
|
|
991
|
+
statement?: string;
|
|
992
|
+
uri?: string;
|
|
993
|
+
} & {
|
|
994
|
+
[k: string]: unknown;
|
|
995
|
+
};
|
|
996
|
+
resolveEns?: boolean;
|
|
997
|
+
}, {
|
|
998
|
+
providers?: {
|
|
999
|
+
web3?: {
|
|
1000
|
+
driver?: unknown;
|
|
1001
|
+
};
|
|
1002
|
+
rpc?: {
|
|
1003
|
+
service?: "etherscan";
|
|
1004
|
+
apiKey?: string;
|
|
1005
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
1006
|
+
} | {
|
|
1007
|
+
service?: "infura";
|
|
1008
|
+
apiKey?: string | {
|
|
1009
|
+
projectId?: string;
|
|
1010
|
+
projectSecret?: string;
|
|
1011
|
+
};
|
|
1012
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1013
|
+
} | {
|
|
1014
|
+
service?: "alchemy";
|
|
1015
|
+
apiKey?: string;
|
|
1016
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1017
|
+
} | {
|
|
1018
|
+
service?: "cloudflare";
|
|
1019
|
+
} | {
|
|
1020
|
+
service?: "pocket";
|
|
1021
|
+
apiKey?: string;
|
|
1022
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
1023
|
+
} | {
|
|
1024
|
+
service?: "ankr";
|
|
1025
|
+
apiKey?: string;
|
|
1026
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
1027
|
+
} | {
|
|
1028
|
+
service?: "custom";
|
|
1029
|
+
network?: unknown;
|
|
1030
|
+
url?: unknown;
|
|
1031
|
+
};
|
|
1032
|
+
server?: {
|
|
1033
|
+
host?: string;
|
|
1034
|
+
routes?: {
|
|
1035
|
+
nonce?: unknown;
|
|
1036
|
+
login?: unknown;
|
|
1037
|
+
logout?: unknown;
|
|
1038
|
+
};
|
|
1039
|
+
};
|
|
1040
|
+
};
|
|
1041
|
+
siweConfig?: {
|
|
1042
|
+
chainId?: number;
|
|
1043
|
+
domain?: string;
|
|
1044
|
+
nonce?: string;
|
|
1045
|
+
expirationTime?: string;
|
|
1046
|
+
notBefore?: string;
|
|
1047
|
+
requestId?: string;
|
|
1048
|
+
resources?: string[];
|
|
1049
|
+
statement?: string;
|
|
1050
|
+
uri?: string;
|
|
1051
|
+
} & {
|
|
1052
|
+
[k: string]: unknown;
|
|
1053
|
+
};
|
|
1054
|
+
resolveEns?: boolean;
|
|
1055
|
+
}>;
|
|
1056
|
+
export type ClientConfig = z.infer<typeof ClientConfigSchema>;
|
|
1057
|
+
/**
|
|
1058
|
+
* Representation of an active TCWSession.
|
|
1059
|
+
*/
|
|
1060
|
+
export declare const ClientSessionSchema: z.ZodObject<{
|
|
1061
|
+
/** User address */
|
|
1062
|
+
address: z.ZodString;
|
|
1063
|
+
/** User address without delegation */
|
|
1064
|
+
walletAddress: z.ZodString;
|
|
1065
|
+
/** Chain ID */
|
|
1066
|
+
chainId: z.ZodNumber;
|
|
1067
|
+
/** Key to identify the session */
|
|
1068
|
+
sessionKey: z.ZodString;
|
|
1069
|
+
/** The message that can be obtained by SiweMessage.prepareMessage() */
|
|
1070
|
+
siwe: z.ZodString;
|
|
1071
|
+
/** The signature of the siwe message */
|
|
1072
|
+
signature: z.ZodString;
|
|
1073
|
+
/** ENS data supported by TCW */
|
|
1074
|
+
ens: z.ZodOptional<z.ZodObject<{
|
|
1075
|
+
domain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1076
|
+
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1077
|
+
}, "strip", z.ZodTypeAny, {
|
|
1078
|
+
domain?: string;
|
|
1079
|
+
avatarUrl?: string;
|
|
1080
|
+
}, {
|
|
1081
|
+
domain?: string;
|
|
1082
|
+
avatarUrl?: string;
|
|
1083
|
+
}>>;
|
|
1084
|
+
}, "strip", z.ZodTypeAny, {
|
|
1085
|
+
address?: string;
|
|
1086
|
+
chainId?: number;
|
|
1087
|
+
siwe?: string;
|
|
1088
|
+
walletAddress?: string;
|
|
1089
|
+
sessionKey?: string;
|
|
1090
|
+
signature?: string;
|
|
1091
|
+
ens?: {
|
|
1092
|
+
domain?: string;
|
|
1093
|
+
avatarUrl?: string;
|
|
1094
|
+
};
|
|
1095
|
+
}, {
|
|
1096
|
+
address?: string;
|
|
1097
|
+
chainId?: number;
|
|
1098
|
+
siwe?: string;
|
|
1099
|
+
walletAddress?: string;
|
|
1100
|
+
sessionKey?: string;
|
|
1101
|
+
signature?: string;
|
|
1102
|
+
ens?: {
|
|
1103
|
+
domain?: string;
|
|
1104
|
+
avatarUrl?: string;
|
|
1105
|
+
};
|
|
1106
|
+
}>;
|
|
1107
|
+
export type ClientSession = z.infer<typeof ClientSessionSchema>;
|
|
1108
|
+
/**
|
|
1109
|
+
* Interface for an extension to TCW.
|
|
1110
|
+
* Note: Methods are async functions, validated as functions at runtime.
|
|
1111
|
+
*/
|
|
1112
|
+
export declare const ExtensionSchema: z.ZodObject<{
|
|
1113
|
+
/** [recap] Capability namespace. */
|
|
1114
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
1115
|
+
/** [recap] Default delegated actions in capability namespace. */
|
|
1116
|
+
defaultActions: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1117
|
+
/** [recap] Delegated actions by target in capability namespace. */
|
|
1118
|
+
targetedActions: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1119
|
+
/** [recap] Extra metadata to help validate the capability. */
|
|
1120
|
+
extraFields: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1121
|
+
/** Hook to run after TCW has connected to the user's wallet. */
|
|
1122
|
+
afterConnect: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1123
|
+
/** Hook to run after TCW has signed in. */
|
|
1124
|
+
afterSignIn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1125
|
+
}, "strip", z.ZodTypeAny, {
|
|
1126
|
+
namespace?: string;
|
|
1127
|
+
defaultActions?: (...args: unknown[]) => unknown;
|
|
1128
|
+
targetedActions?: (...args: unknown[]) => unknown;
|
|
1129
|
+
extraFields?: (...args: unknown[]) => unknown;
|
|
1130
|
+
afterConnect?: (...args: unknown[]) => unknown;
|
|
1131
|
+
afterSignIn?: (...args: unknown[]) => unknown;
|
|
1132
|
+
}, {
|
|
1133
|
+
namespace?: string;
|
|
1134
|
+
defaultActions?: (...args: unknown[]) => unknown;
|
|
1135
|
+
targetedActions?: (...args: unknown[]) => unknown;
|
|
1136
|
+
extraFields?: (...args: unknown[]) => unknown;
|
|
1137
|
+
afterConnect?: (...args: unknown[]) => unknown;
|
|
1138
|
+
afterSignIn?: (...args: unknown[]) => unknown;
|
|
1139
|
+
}>;
|
|
1140
|
+
export type Extension = z.infer<typeof ExtensionSchema>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Interface to an intermediate TCW state: connected, but not signed-in.
|
|
1143
|
+
* Note: Contains many functions and external types, use z.unknown() for complex fields.
|
|
1144
|
+
*/
|
|
1145
|
+
export declare const IConnectedSchema: z.ZodObject<{
|
|
1146
|
+
/** Instance of TCWSessionManager. */
|
|
1147
|
+
builder: z.ZodUnknown;
|
|
1148
|
+
/** TCWConfig object. */
|
|
1149
|
+
config: z.ZodObject<{
|
|
1150
|
+
/** Connection to a cryptographic keypair and/or network. */
|
|
1151
|
+
providers: z.ZodOptional<z.ZodObject<{
|
|
1152
|
+
/** Web3 wallet provider */
|
|
1153
|
+
web3: z.ZodOptional<z.ZodObject<{
|
|
1154
|
+
/**
|
|
1155
|
+
* window.ethereum for Metamask;
|
|
1156
|
+
* web3modal.connect() for Web3Modal;
|
|
1157
|
+
* const signer = useSigner(); const provider = signer.provider; from Wagmi for Rainbowkit
|
|
1158
|
+
*/
|
|
1159
|
+
driver: z.ZodUnknown;
|
|
1160
|
+
}, "strip", z.ZodTypeAny, {
|
|
1161
|
+
driver?: unknown;
|
|
1162
|
+
}, {
|
|
1163
|
+
driver?: unknown;
|
|
1164
|
+
}>>;
|
|
1165
|
+
/** JSON RPC provider configurations */
|
|
1166
|
+
rpc: z.ZodOptional<z.ZodDiscriminatedUnion<"service", [z.ZodObject<{
|
|
1167
|
+
service: z.ZodLiteral<"etherscan">;
|
|
1168
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
1169
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli", "kovan"]>>;
|
|
1170
|
+
}, "strip", z.ZodTypeAny, {
|
|
1171
|
+
service?: "etherscan";
|
|
1172
|
+
apiKey?: string;
|
|
1173
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
1174
|
+
}, {
|
|
1175
|
+
service?: "etherscan";
|
|
1176
|
+
apiKey?: string;
|
|
1177
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
1178
|
+
}>, z.ZodObject<{
|
|
1179
|
+
service: z.ZodLiteral<"infura">;
|
|
1180
|
+
apiKey: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1181
|
+
projectId: z.ZodString;
|
|
1182
|
+
projectSecret: z.ZodString;
|
|
1183
|
+
}, "strip", z.ZodTypeAny, {
|
|
1184
|
+
projectId?: string;
|
|
1185
|
+
projectSecret?: string;
|
|
1186
|
+
}, {
|
|
1187
|
+
projectId?: string;
|
|
1188
|
+
projectSecret?: string;
|
|
1189
|
+
}>]>;
|
|
1190
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli", "kovan", "matic", "maticmum", "optimism", "optimism-kovan", "arbitrum", "arbitrum-rinkeby"]>>;
|
|
1191
|
+
}, "strip", z.ZodTypeAny, {
|
|
1192
|
+
service?: "infura";
|
|
1193
|
+
apiKey?: string | {
|
|
1194
|
+
projectId?: string;
|
|
1195
|
+
projectSecret?: string;
|
|
1196
|
+
};
|
|
1197
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1198
|
+
}, {
|
|
1199
|
+
service?: "infura";
|
|
1200
|
+
apiKey?: string | {
|
|
1201
|
+
projectId?: string;
|
|
1202
|
+
projectSecret?: string;
|
|
1203
|
+
};
|
|
1204
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1205
|
+
}>, z.ZodObject<{
|
|
1206
|
+
service: z.ZodLiteral<"alchemy">;
|
|
1207
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
1208
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli", "kovan", "matic", "maticmum", "optimism", "optimism-kovan", "arbitrum", "arbitrum-rinkeby"]>>;
|
|
1209
|
+
}, "strip", z.ZodTypeAny, {
|
|
1210
|
+
service?: "alchemy";
|
|
1211
|
+
apiKey?: string;
|
|
1212
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1213
|
+
}, {
|
|
1214
|
+
service?: "alchemy";
|
|
1215
|
+
apiKey?: string;
|
|
1216
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1217
|
+
}>, z.ZodObject<{
|
|
1218
|
+
service: z.ZodLiteral<"cloudflare">;
|
|
1219
|
+
}, "strip", z.ZodTypeAny, {
|
|
1220
|
+
service?: "cloudflare";
|
|
1221
|
+
}, {
|
|
1222
|
+
service?: "cloudflare";
|
|
1223
|
+
}>, z.ZodObject<{
|
|
1224
|
+
service: z.ZodLiteral<"pocket">;
|
|
1225
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
1226
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "ropsten", "rinkeby", "goerli"]>>;
|
|
1227
|
+
}, "strip", z.ZodTypeAny, {
|
|
1228
|
+
service?: "pocket";
|
|
1229
|
+
apiKey?: string;
|
|
1230
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
1231
|
+
}, {
|
|
1232
|
+
service?: "pocket";
|
|
1233
|
+
apiKey?: string;
|
|
1234
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
1235
|
+
}>, z.ZodObject<{
|
|
1236
|
+
service: z.ZodLiteral<"ankr">;
|
|
1237
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
1238
|
+
network: z.ZodOptional<z.ZodEnum<["homestead", "matic", "arbitrum"]>>;
|
|
1239
|
+
}, "strip", z.ZodTypeAny, {
|
|
1240
|
+
service?: "ankr";
|
|
1241
|
+
apiKey?: string;
|
|
1242
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
1243
|
+
}, {
|
|
1244
|
+
service?: "ankr";
|
|
1245
|
+
apiKey?: string;
|
|
1246
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
1247
|
+
}>, z.ZodObject<{
|
|
1248
|
+
service: z.ZodLiteral<"custom">;
|
|
1249
|
+
url: z.ZodOptional<z.ZodUnknown>;
|
|
1250
|
+
network: z.ZodOptional<z.ZodUnknown>;
|
|
1251
|
+
}, "strip", z.ZodTypeAny, {
|
|
1252
|
+
service?: "custom";
|
|
1253
|
+
network?: unknown;
|
|
1254
|
+
url?: unknown;
|
|
1255
|
+
}, {
|
|
1256
|
+
service?: "custom";
|
|
1257
|
+
network?: unknown;
|
|
1258
|
+
url?: unknown;
|
|
1259
|
+
}>]>>;
|
|
1260
|
+
/** Optional reference to server running tcw-server. */
|
|
1261
|
+
server: z.ZodOptional<z.ZodObject<{
|
|
1262
|
+
host: z.ZodString;
|
|
1263
|
+
/** Optional configuration for the server's routes. */
|
|
1264
|
+
routes: z.ZodOptional<z.ZodObject<{
|
|
1265
|
+
nonce: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
1266
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1267
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
1268
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
1269
|
+
}, "strip", z.ZodTypeAny, {
|
|
1270
|
+
url?: string;
|
|
1271
|
+
method?: "get" | "post" | "put" | "delete";
|
|
1272
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
1273
|
+
}, {
|
|
1274
|
+
url?: string;
|
|
1275
|
+
method?: "get" | "post" | "put" | "delete";
|
|
1276
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
1277
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
1278
|
+
path: z.ZodString;
|
|
1279
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1280
|
+
}, "strip", z.ZodTypeAny, {
|
|
1281
|
+
path?: string;
|
|
1282
|
+
callback?: (...args: unknown[]) => unknown;
|
|
1283
|
+
}, {
|
|
1284
|
+
path?: string;
|
|
1285
|
+
callback?: (...args: unknown[]) => unknown;
|
|
1286
|
+
}>]>>;
|
|
1287
|
+
login: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
1288
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1289
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
1290
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
1291
|
+
}, "strip", z.ZodTypeAny, {
|
|
1292
|
+
url?: string;
|
|
1293
|
+
method?: "get" | "post" | "put" | "delete";
|
|
1294
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
1295
|
+
}, {
|
|
1296
|
+
url?: string;
|
|
1297
|
+
method?: "get" | "post" | "put" | "delete";
|
|
1298
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
1299
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
1300
|
+
path: z.ZodString;
|
|
1301
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1302
|
+
}, "strip", z.ZodTypeAny, {
|
|
1303
|
+
path?: string;
|
|
1304
|
+
callback?: (...args: unknown[]) => unknown;
|
|
1305
|
+
}, {
|
|
1306
|
+
path?: string;
|
|
1307
|
+
callback?: (...args: unknown[]) => unknown;
|
|
1308
|
+
}>]>>;
|
|
1309
|
+
logout: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
1310
|
+
url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1311
|
+
method: z.ZodOptional<z.ZodOptional<z.ZodEnum<["get", "post", "put", "delete"]>>>;
|
|
1312
|
+
customAPIOperation: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>>;
|
|
1313
|
+
}, "strip", z.ZodTypeAny, {
|
|
1314
|
+
url?: string;
|
|
1315
|
+
method?: "get" | "post" | "put" | "delete";
|
|
1316
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
1317
|
+
}, {
|
|
1318
|
+
url?: string;
|
|
1319
|
+
method?: "get" | "post" | "put" | "delete";
|
|
1320
|
+
customAPIOperation?: (...args: unknown[]) => unknown;
|
|
1321
|
+
}>, z.ZodUnknown, z.ZodString, z.ZodObject<{
|
|
1322
|
+
path: z.ZodString;
|
|
1323
|
+
callback: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1324
|
+
}, "strip", z.ZodTypeAny, {
|
|
1325
|
+
path?: string;
|
|
1326
|
+
callback?: (...args: unknown[]) => unknown;
|
|
1327
|
+
}, {
|
|
1328
|
+
path?: string;
|
|
1329
|
+
callback?: (...args: unknown[]) => unknown;
|
|
1330
|
+
}>]>>;
|
|
1331
|
+
}, "strip", z.ZodTypeAny, {
|
|
1332
|
+
nonce?: unknown;
|
|
1333
|
+
login?: unknown;
|
|
1334
|
+
logout?: unknown;
|
|
1335
|
+
}, {
|
|
1336
|
+
nonce?: unknown;
|
|
1337
|
+
login?: unknown;
|
|
1338
|
+
logout?: unknown;
|
|
1339
|
+
}>>;
|
|
1340
|
+
}, "strip", z.ZodTypeAny, {
|
|
1341
|
+
host?: string;
|
|
1342
|
+
routes?: {
|
|
1343
|
+
nonce?: unknown;
|
|
1344
|
+
login?: unknown;
|
|
1345
|
+
logout?: unknown;
|
|
1346
|
+
};
|
|
1347
|
+
}, {
|
|
1348
|
+
host?: string;
|
|
1349
|
+
routes?: {
|
|
1350
|
+
nonce?: unknown;
|
|
1351
|
+
login?: unknown;
|
|
1352
|
+
logout?: unknown;
|
|
1353
|
+
};
|
|
1354
|
+
}>>;
|
|
1355
|
+
}, "strip", z.ZodTypeAny, {
|
|
1356
|
+
web3?: {
|
|
1357
|
+
driver?: unknown;
|
|
1358
|
+
};
|
|
1359
|
+
rpc?: {
|
|
1360
|
+
service?: "etherscan";
|
|
1361
|
+
apiKey?: string;
|
|
1362
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
1363
|
+
} | {
|
|
1364
|
+
service?: "infura";
|
|
1365
|
+
apiKey?: string | {
|
|
1366
|
+
projectId?: string;
|
|
1367
|
+
projectSecret?: string;
|
|
1368
|
+
};
|
|
1369
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1370
|
+
} | {
|
|
1371
|
+
service?: "alchemy";
|
|
1372
|
+
apiKey?: string;
|
|
1373
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1374
|
+
} | {
|
|
1375
|
+
service?: "cloudflare";
|
|
1376
|
+
} | {
|
|
1377
|
+
service?: "pocket";
|
|
1378
|
+
apiKey?: string;
|
|
1379
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
1380
|
+
} | {
|
|
1381
|
+
service?: "ankr";
|
|
1382
|
+
apiKey?: string;
|
|
1383
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
1384
|
+
} | {
|
|
1385
|
+
service?: "custom";
|
|
1386
|
+
network?: unknown;
|
|
1387
|
+
url?: unknown;
|
|
1388
|
+
};
|
|
1389
|
+
server?: {
|
|
1390
|
+
host?: string;
|
|
1391
|
+
routes?: {
|
|
1392
|
+
nonce?: unknown;
|
|
1393
|
+
login?: unknown;
|
|
1394
|
+
logout?: unknown;
|
|
1395
|
+
};
|
|
1396
|
+
};
|
|
1397
|
+
}, {
|
|
1398
|
+
web3?: {
|
|
1399
|
+
driver?: unknown;
|
|
1400
|
+
};
|
|
1401
|
+
rpc?: {
|
|
1402
|
+
service?: "etherscan";
|
|
1403
|
+
apiKey?: string;
|
|
1404
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
1405
|
+
} | {
|
|
1406
|
+
service?: "infura";
|
|
1407
|
+
apiKey?: string | {
|
|
1408
|
+
projectId?: string;
|
|
1409
|
+
projectSecret?: string;
|
|
1410
|
+
};
|
|
1411
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1412
|
+
} | {
|
|
1413
|
+
service?: "alchemy";
|
|
1414
|
+
apiKey?: string;
|
|
1415
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1416
|
+
} | {
|
|
1417
|
+
service?: "cloudflare";
|
|
1418
|
+
} | {
|
|
1419
|
+
service?: "pocket";
|
|
1420
|
+
apiKey?: string;
|
|
1421
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
1422
|
+
} | {
|
|
1423
|
+
service?: "ankr";
|
|
1424
|
+
apiKey?: string;
|
|
1425
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
1426
|
+
} | {
|
|
1427
|
+
service?: "custom";
|
|
1428
|
+
network?: unknown;
|
|
1429
|
+
url?: unknown;
|
|
1430
|
+
};
|
|
1431
|
+
server?: {
|
|
1432
|
+
host?: string;
|
|
1433
|
+
routes?: {
|
|
1434
|
+
nonce?: unknown;
|
|
1435
|
+
login?: unknown;
|
|
1436
|
+
logout?: unknown;
|
|
1437
|
+
};
|
|
1438
|
+
};
|
|
1439
|
+
}>>;
|
|
1440
|
+
/** Optional session configuration for the SIWE message. */
|
|
1441
|
+
siweConfig: z.ZodOptional<z.ZodObject<{
|
|
1442
|
+
/** Domain for the SIWE message. */
|
|
1443
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
1444
|
+
/** URI for the SIWE message. */
|
|
1445
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
1446
|
+
/** Chain ID for the SIWE message. */
|
|
1447
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
1448
|
+
/** Statement for the SIWE message. */
|
|
1449
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
1450
|
+
/** Nonce for the SIWE message. */
|
|
1451
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
1452
|
+
/** Expiration time for the SIWE message. */
|
|
1453
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
1454
|
+
/** Not before time for the SIWE message. */
|
|
1455
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
1456
|
+
/** Request ID for the SIWE message. */
|
|
1457
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
1458
|
+
/** Resources for the SIWE message. */
|
|
1459
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1460
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1461
|
+
/** Domain for the SIWE message. */
|
|
1462
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
1463
|
+
/** URI for the SIWE message. */
|
|
1464
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
1465
|
+
/** Chain ID for the SIWE message. */
|
|
1466
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
1467
|
+
/** Statement for the SIWE message. */
|
|
1468
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
1469
|
+
/** Nonce for the SIWE message. */
|
|
1470
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
1471
|
+
/** Expiration time for the SIWE message. */
|
|
1472
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
1473
|
+
/** Not before time for the SIWE message. */
|
|
1474
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
1475
|
+
/** Request ID for the SIWE message. */
|
|
1476
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
1477
|
+
/** Resources for the SIWE message. */
|
|
1478
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1479
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1480
|
+
/** Domain for the SIWE message. */
|
|
1481
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
1482
|
+
/** URI for the SIWE message. */
|
|
1483
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
1484
|
+
/** Chain ID for the SIWE message. */
|
|
1485
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
1486
|
+
/** Statement for the SIWE message. */
|
|
1487
|
+
statement: z.ZodOptional<z.ZodString>;
|
|
1488
|
+
/** Nonce for the SIWE message. */
|
|
1489
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
1490
|
+
/** Expiration time for the SIWE message. */
|
|
1491
|
+
expirationTime: z.ZodOptional<z.ZodString>;
|
|
1492
|
+
/** Not before time for the SIWE message. */
|
|
1493
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
1494
|
+
/** Request ID for the SIWE message. */
|
|
1495
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
1496
|
+
/** Resources for the SIWE message. */
|
|
1497
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1498
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
1499
|
+
/** Whether or not ENS resolution is enabled. True means resolve all on client. */
|
|
1500
|
+
resolveEns: z.ZodOptional<z.ZodBoolean>;
|
|
1501
|
+
}, "strip", z.ZodTypeAny, {
|
|
1502
|
+
providers?: {
|
|
1503
|
+
web3?: {
|
|
1504
|
+
driver?: unknown;
|
|
1505
|
+
};
|
|
1506
|
+
rpc?: {
|
|
1507
|
+
service?: "etherscan";
|
|
1508
|
+
apiKey?: string;
|
|
1509
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
1510
|
+
} | {
|
|
1511
|
+
service?: "infura";
|
|
1512
|
+
apiKey?: string | {
|
|
1513
|
+
projectId?: string;
|
|
1514
|
+
projectSecret?: string;
|
|
1515
|
+
};
|
|
1516
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1517
|
+
} | {
|
|
1518
|
+
service?: "alchemy";
|
|
1519
|
+
apiKey?: string;
|
|
1520
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1521
|
+
} | {
|
|
1522
|
+
service?: "cloudflare";
|
|
1523
|
+
} | {
|
|
1524
|
+
service?: "pocket";
|
|
1525
|
+
apiKey?: string;
|
|
1526
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
1527
|
+
} | {
|
|
1528
|
+
service?: "ankr";
|
|
1529
|
+
apiKey?: string;
|
|
1530
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
1531
|
+
} | {
|
|
1532
|
+
service?: "custom";
|
|
1533
|
+
network?: unknown;
|
|
1534
|
+
url?: unknown;
|
|
1535
|
+
};
|
|
1536
|
+
server?: {
|
|
1537
|
+
host?: string;
|
|
1538
|
+
routes?: {
|
|
1539
|
+
nonce?: unknown;
|
|
1540
|
+
login?: unknown;
|
|
1541
|
+
logout?: unknown;
|
|
1542
|
+
};
|
|
1543
|
+
};
|
|
1544
|
+
};
|
|
1545
|
+
siweConfig?: {
|
|
1546
|
+
chainId?: number;
|
|
1547
|
+
domain?: string;
|
|
1548
|
+
nonce?: string;
|
|
1549
|
+
expirationTime?: string;
|
|
1550
|
+
notBefore?: string;
|
|
1551
|
+
requestId?: string;
|
|
1552
|
+
resources?: string[];
|
|
1553
|
+
statement?: string;
|
|
1554
|
+
uri?: string;
|
|
1555
|
+
} & {
|
|
1556
|
+
[k: string]: unknown;
|
|
1557
|
+
};
|
|
1558
|
+
resolveEns?: boolean;
|
|
1559
|
+
}, {
|
|
1560
|
+
providers?: {
|
|
1561
|
+
web3?: {
|
|
1562
|
+
driver?: unknown;
|
|
1563
|
+
};
|
|
1564
|
+
rpc?: {
|
|
1565
|
+
service?: "etherscan";
|
|
1566
|
+
apiKey?: string;
|
|
1567
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
1568
|
+
} | {
|
|
1569
|
+
service?: "infura";
|
|
1570
|
+
apiKey?: string | {
|
|
1571
|
+
projectId?: string;
|
|
1572
|
+
projectSecret?: string;
|
|
1573
|
+
};
|
|
1574
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1575
|
+
} | {
|
|
1576
|
+
service?: "alchemy";
|
|
1577
|
+
apiKey?: string;
|
|
1578
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1579
|
+
} | {
|
|
1580
|
+
service?: "cloudflare";
|
|
1581
|
+
} | {
|
|
1582
|
+
service?: "pocket";
|
|
1583
|
+
apiKey?: string;
|
|
1584
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
1585
|
+
} | {
|
|
1586
|
+
service?: "ankr";
|
|
1587
|
+
apiKey?: string;
|
|
1588
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
1589
|
+
} | {
|
|
1590
|
+
service?: "custom";
|
|
1591
|
+
network?: unknown;
|
|
1592
|
+
url?: unknown;
|
|
1593
|
+
};
|
|
1594
|
+
server?: {
|
|
1595
|
+
host?: string;
|
|
1596
|
+
routes?: {
|
|
1597
|
+
nonce?: unknown;
|
|
1598
|
+
login?: unknown;
|
|
1599
|
+
logout?: unknown;
|
|
1600
|
+
};
|
|
1601
|
+
};
|
|
1602
|
+
};
|
|
1603
|
+
siweConfig?: {
|
|
1604
|
+
chainId?: number;
|
|
1605
|
+
domain?: string;
|
|
1606
|
+
nonce?: string;
|
|
1607
|
+
expirationTime?: string;
|
|
1608
|
+
notBefore?: string;
|
|
1609
|
+
requestId?: string;
|
|
1610
|
+
resources?: string[];
|
|
1611
|
+
statement?: string;
|
|
1612
|
+
uri?: string;
|
|
1613
|
+
} & {
|
|
1614
|
+
[k: string]: unknown;
|
|
1615
|
+
};
|
|
1616
|
+
resolveEns?: boolean;
|
|
1617
|
+
}>;
|
|
1618
|
+
/** List of enabled extensions. */
|
|
1619
|
+
extensions: z.ZodArray<z.ZodObject<{
|
|
1620
|
+
/** [recap] Capability namespace. */
|
|
1621
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
1622
|
+
/** [recap] Default delegated actions in capability namespace. */
|
|
1623
|
+
defaultActions: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1624
|
+
/** [recap] Delegated actions by target in capability namespace. */
|
|
1625
|
+
targetedActions: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1626
|
+
/** [recap] Extra metadata to help validate the capability. */
|
|
1627
|
+
extraFields: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1628
|
+
/** Hook to run after TCW has connected to the user's wallet. */
|
|
1629
|
+
afterConnect: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1630
|
+
/** Hook to run after TCW has signed in. */
|
|
1631
|
+
afterSignIn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
1632
|
+
}, "strip", z.ZodTypeAny, {
|
|
1633
|
+
namespace?: string;
|
|
1634
|
+
defaultActions?: (...args: unknown[]) => unknown;
|
|
1635
|
+
targetedActions?: (...args: unknown[]) => unknown;
|
|
1636
|
+
extraFields?: (...args: unknown[]) => unknown;
|
|
1637
|
+
afterConnect?: (...args: unknown[]) => unknown;
|
|
1638
|
+
afterSignIn?: (...args: unknown[]) => unknown;
|
|
1639
|
+
}, {
|
|
1640
|
+
namespace?: string;
|
|
1641
|
+
defaultActions?: (...args: unknown[]) => unknown;
|
|
1642
|
+
targetedActions?: (...args: unknown[]) => unknown;
|
|
1643
|
+
extraFields?: (...args: unknown[]) => unknown;
|
|
1644
|
+
afterConnect?: (...args: unknown[]) => unknown;
|
|
1645
|
+
afterSignIn?: (...args: unknown[]) => unknown;
|
|
1646
|
+
}>, "many">;
|
|
1647
|
+
/** Web3 provider. */
|
|
1648
|
+
provider: z.ZodUnknown;
|
|
1649
|
+
/** Promise that is initialized on construction to run the "afterConnect" methods of extensions. */
|
|
1650
|
+
afterConnectHooksPromise: z.ZodUnknown;
|
|
1651
|
+
/** Method to verify if extension is enabled. */
|
|
1652
|
+
isExtensionEnabled: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
1653
|
+
/** Axios instance. */
|
|
1654
|
+
api: z.ZodOptional<z.ZodUnknown>;
|
|
1655
|
+
/** Method to apply the "afterConnect" methods and the delegated capabilities of the extensions. */
|
|
1656
|
+
applyExtensions: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
1657
|
+
/** Method to apply the "afterSignIn" methods of the extensions. */
|
|
1658
|
+
afterSignIn: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
1659
|
+
/** Method to request the user to sign in. */
|
|
1660
|
+
signIn: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
1661
|
+
/** Method to request the user to sign out. */
|
|
1662
|
+
signOut: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
1663
|
+
}, "strip", z.ZodTypeAny, {
|
|
1664
|
+
afterSignIn?: (...args: unknown[]) => unknown;
|
|
1665
|
+
builder?: unknown;
|
|
1666
|
+
config?: {
|
|
1667
|
+
providers?: {
|
|
1668
|
+
web3?: {
|
|
1669
|
+
driver?: unknown;
|
|
1670
|
+
};
|
|
1671
|
+
rpc?: {
|
|
1672
|
+
service?: "etherscan";
|
|
1673
|
+
apiKey?: string;
|
|
1674
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
1675
|
+
} | {
|
|
1676
|
+
service?: "infura";
|
|
1677
|
+
apiKey?: string | {
|
|
1678
|
+
projectId?: string;
|
|
1679
|
+
projectSecret?: string;
|
|
1680
|
+
};
|
|
1681
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1682
|
+
} | {
|
|
1683
|
+
service?: "alchemy";
|
|
1684
|
+
apiKey?: string;
|
|
1685
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1686
|
+
} | {
|
|
1687
|
+
service?: "cloudflare";
|
|
1688
|
+
} | {
|
|
1689
|
+
service?: "pocket";
|
|
1690
|
+
apiKey?: string;
|
|
1691
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
1692
|
+
} | {
|
|
1693
|
+
service?: "ankr";
|
|
1694
|
+
apiKey?: string;
|
|
1695
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
1696
|
+
} | {
|
|
1697
|
+
service?: "custom";
|
|
1698
|
+
network?: unknown;
|
|
1699
|
+
url?: unknown;
|
|
1700
|
+
};
|
|
1701
|
+
server?: {
|
|
1702
|
+
host?: string;
|
|
1703
|
+
routes?: {
|
|
1704
|
+
nonce?: unknown;
|
|
1705
|
+
login?: unknown;
|
|
1706
|
+
logout?: unknown;
|
|
1707
|
+
};
|
|
1708
|
+
};
|
|
1709
|
+
};
|
|
1710
|
+
siweConfig?: {
|
|
1711
|
+
chainId?: number;
|
|
1712
|
+
domain?: string;
|
|
1713
|
+
nonce?: string;
|
|
1714
|
+
expirationTime?: string;
|
|
1715
|
+
notBefore?: string;
|
|
1716
|
+
requestId?: string;
|
|
1717
|
+
resources?: string[];
|
|
1718
|
+
statement?: string;
|
|
1719
|
+
uri?: string;
|
|
1720
|
+
} & {
|
|
1721
|
+
[k: string]: unknown;
|
|
1722
|
+
};
|
|
1723
|
+
resolveEns?: boolean;
|
|
1724
|
+
};
|
|
1725
|
+
extensions?: {
|
|
1726
|
+
namespace?: string;
|
|
1727
|
+
defaultActions?: (...args: unknown[]) => unknown;
|
|
1728
|
+
targetedActions?: (...args: unknown[]) => unknown;
|
|
1729
|
+
extraFields?: (...args: unknown[]) => unknown;
|
|
1730
|
+
afterConnect?: (...args: unknown[]) => unknown;
|
|
1731
|
+
afterSignIn?: (...args: unknown[]) => unknown;
|
|
1732
|
+
}[];
|
|
1733
|
+
provider?: unknown;
|
|
1734
|
+
afterConnectHooksPromise?: unknown;
|
|
1735
|
+
isExtensionEnabled?: (...args: unknown[]) => unknown;
|
|
1736
|
+
api?: unknown;
|
|
1737
|
+
applyExtensions?: (...args: unknown[]) => unknown;
|
|
1738
|
+
signIn?: (...args: unknown[]) => unknown;
|
|
1739
|
+
signOut?: (...args: unknown[]) => unknown;
|
|
1740
|
+
}, {
|
|
1741
|
+
afterSignIn?: (...args: unknown[]) => unknown;
|
|
1742
|
+
builder?: unknown;
|
|
1743
|
+
config?: {
|
|
1744
|
+
providers?: {
|
|
1745
|
+
web3?: {
|
|
1746
|
+
driver?: unknown;
|
|
1747
|
+
};
|
|
1748
|
+
rpc?: {
|
|
1749
|
+
service?: "etherscan";
|
|
1750
|
+
apiKey?: string;
|
|
1751
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan";
|
|
1752
|
+
} | {
|
|
1753
|
+
service?: "infura";
|
|
1754
|
+
apiKey?: string | {
|
|
1755
|
+
projectId?: string;
|
|
1756
|
+
projectSecret?: string;
|
|
1757
|
+
};
|
|
1758
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1759
|
+
} | {
|
|
1760
|
+
service?: "alchemy";
|
|
1761
|
+
apiKey?: string;
|
|
1762
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "matic" | "maticmum" | "optimism" | "optimism-kovan" | "arbitrum" | "arbitrum-rinkeby";
|
|
1763
|
+
} | {
|
|
1764
|
+
service?: "cloudflare";
|
|
1765
|
+
} | {
|
|
1766
|
+
service?: "pocket";
|
|
1767
|
+
apiKey?: string;
|
|
1768
|
+
network?: "homestead" | "ropsten" | "rinkeby" | "goerli";
|
|
1769
|
+
} | {
|
|
1770
|
+
service?: "ankr";
|
|
1771
|
+
apiKey?: string;
|
|
1772
|
+
network?: "homestead" | "matic" | "arbitrum";
|
|
1773
|
+
} | {
|
|
1774
|
+
service?: "custom";
|
|
1775
|
+
network?: unknown;
|
|
1776
|
+
url?: unknown;
|
|
1777
|
+
};
|
|
1778
|
+
server?: {
|
|
1779
|
+
host?: string;
|
|
1780
|
+
routes?: {
|
|
1781
|
+
nonce?: unknown;
|
|
1782
|
+
login?: unknown;
|
|
1783
|
+
logout?: unknown;
|
|
1784
|
+
};
|
|
1785
|
+
};
|
|
1786
|
+
};
|
|
1787
|
+
siweConfig?: {
|
|
1788
|
+
chainId?: number;
|
|
1789
|
+
domain?: string;
|
|
1790
|
+
nonce?: string;
|
|
1791
|
+
expirationTime?: string;
|
|
1792
|
+
notBefore?: string;
|
|
1793
|
+
requestId?: string;
|
|
1794
|
+
resources?: string[];
|
|
1795
|
+
statement?: string;
|
|
1796
|
+
uri?: string;
|
|
1797
|
+
} & {
|
|
1798
|
+
[k: string]: unknown;
|
|
1799
|
+
};
|
|
1800
|
+
resolveEns?: boolean;
|
|
1801
|
+
};
|
|
1802
|
+
extensions?: {
|
|
1803
|
+
namespace?: string;
|
|
1804
|
+
defaultActions?: (...args: unknown[]) => unknown;
|
|
1805
|
+
targetedActions?: (...args: unknown[]) => unknown;
|
|
1806
|
+
extraFields?: (...args: unknown[]) => unknown;
|
|
1807
|
+
afterConnect?: (...args: unknown[]) => unknown;
|
|
1808
|
+
afterSignIn?: (...args: unknown[]) => unknown;
|
|
1809
|
+
}[];
|
|
1810
|
+
provider?: unknown;
|
|
1811
|
+
afterConnectHooksPromise?: unknown;
|
|
1812
|
+
isExtensionEnabled?: (...args: unknown[]) => unknown;
|
|
1813
|
+
api?: unknown;
|
|
1814
|
+
applyExtensions?: (...args: unknown[]) => unknown;
|
|
1815
|
+
signIn?: (...args: unknown[]) => unknown;
|
|
1816
|
+
signOut?: (...args: unknown[]) => unknown;
|
|
1817
|
+
}>;
|
|
1818
|
+
export type IConnected = z.infer<typeof IConnectedSchema>;
|
|
1819
|
+
/**
|
|
1820
|
+
* Validation error type.
|
|
1821
|
+
*/
|
|
1822
|
+
export interface ValidationError {
|
|
1823
|
+
code: string;
|
|
1824
|
+
message: string;
|
|
1825
|
+
issues?: unknown[];
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* Result type for validation operations.
|
|
1829
|
+
*/
|
|
1830
|
+
export type ValidationResult<T> = {
|
|
1831
|
+
ok: true;
|
|
1832
|
+
data: T;
|
|
1833
|
+
} | {
|
|
1834
|
+
ok: false;
|
|
1835
|
+
error: ValidationError;
|
|
1836
|
+
};
|
|
1837
|
+
/**
|
|
1838
|
+
* Validates ClientSession.
|
|
1839
|
+
*/
|
|
1840
|
+
export declare function validateClientSession(data: unknown): ValidationResult<ClientSession>;
|
|
1841
|
+
/**
|
|
1842
|
+
* Validates ClientConfig.
|
|
1843
|
+
*/
|
|
1844
|
+
export declare function validateClientConfig(data: unknown): ValidationResult<ClientConfig>;
|
|
1845
|
+
/**
|
|
1846
|
+
* Validates SiweConfig.
|
|
1847
|
+
*/
|
|
1848
|
+
export declare function validateSiweConfig(data: unknown): ValidationResult<SiweConfig>;
|
|
1849
|
+
/**
|
|
1850
|
+
* Validates Extension.
|
|
1851
|
+
*/
|
|
1852
|
+
export declare function validateExtension(data: unknown): ValidationResult<Extension>;
|
|
1853
|
+
//# sourceMappingURL=types.schema.d.ts.map
|