@unlink-xyz/sdk 0.0.2-canary.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/README.md +74 -0
- package/dist/index.d.ts +1998 -0
- package/dist/index.js +1465 -0
- package/package.json +47 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1998 @@
|
|
|
1
|
+
import * as openapi_fetch from 'openapi-fetch';
|
|
2
|
+
import { Client } from 'openapi-fetch';
|
|
3
|
+
import { Address, LocalAccount } from 'viem';
|
|
4
|
+
|
|
5
|
+
declare function poseidon(inputs: bigint[]): bigint;
|
|
6
|
+
|
|
7
|
+
interface EdDSASignature {
|
|
8
|
+
R8: [bigint, bigint];
|
|
9
|
+
S: bigint;
|
|
10
|
+
}
|
|
11
|
+
declare function eddsaPublicKey(privateKey: bigint): Promise<[bigint, bigint]>;
|
|
12
|
+
declare function eddsaSign(privateKey: bigint, message: bigint): Promise<EdDSASignature>;
|
|
13
|
+
declare function eddsaVerify(message: bigint, signature: EdDSASignature, publicKey: [bigint, bigint]): Promise<boolean>;
|
|
14
|
+
|
|
15
|
+
declare function viewingPublicKey(privateKey: Uint8Array): Uint8Array;
|
|
16
|
+
declare function viewingPublicKeyFromHex(hexPrivateKey: string): Uint8Array;
|
|
17
|
+
|
|
18
|
+
declare const P = 21888242871839275222246405745257275088548364400416034343698204186575808495617n;
|
|
19
|
+
declare function mod(n: bigint): bigint;
|
|
20
|
+
declare function fromDecimal(s: string): bigint;
|
|
21
|
+
declare function toBytesBE(n: bigint): Uint8Array;
|
|
22
|
+
declare function fromBytesBE(bytes: Uint8Array): bigint;
|
|
23
|
+
declare function fromHex(hex: string): bigint;
|
|
24
|
+
declare function toDecimal(n: bigint): string;
|
|
25
|
+
|
|
26
|
+
interface AccountKeys {
|
|
27
|
+
spendingPrivateKey: bigint;
|
|
28
|
+
spendingPublicKey: [bigint, bigint];
|
|
29
|
+
viewingPrivateKey: Uint8Array;
|
|
30
|
+
viewingPublicKey: Uint8Array;
|
|
31
|
+
nullifyingKey: bigint;
|
|
32
|
+
masterPublicKey: bigint;
|
|
33
|
+
address: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare function deriveAccountKeys(seed: Uint8Array, index?: number): Promise<AccountKeys>;
|
|
37
|
+
|
|
38
|
+
declare function encodeAddress(mpk: bigint, viewingPubKey: Uint8Array): string;
|
|
39
|
+
declare function decodeAddress(address: string): {
|
|
40
|
+
version: number;
|
|
41
|
+
masterPublicKey: bigint;
|
|
42
|
+
viewingPublicKey: Uint8Array;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
interface AccountExportPayload {
|
|
46
|
+
version: 1;
|
|
47
|
+
spendingPrivateKey: string;
|
|
48
|
+
viewingPrivateKey: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface UnlinkAccountProvider {
|
|
52
|
+
getAccountKeys(): Promise<AccountKeys>;
|
|
53
|
+
}
|
|
54
|
+
interface UnlinkAccountSeedOptions {
|
|
55
|
+
seed: Uint8Array;
|
|
56
|
+
accountIndex?: number;
|
|
57
|
+
}
|
|
58
|
+
interface UnlinkAccountMnemonicOptions {
|
|
59
|
+
mnemonic: string;
|
|
60
|
+
accountIndex?: number;
|
|
61
|
+
}
|
|
62
|
+
declare const unlinkAccount: {
|
|
63
|
+
fromKeys(keys: AccountKeys): UnlinkAccountProvider;
|
|
64
|
+
fromSeed(options: UnlinkAccountSeedOptions): UnlinkAccountProvider;
|
|
65
|
+
fromMnemonic(options: UnlinkAccountMnemonicOptions): UnlinkAccountProvider;
|
|
66
|
+
export(keys: AccountKeys): AccountExportPayload;
|
|
67
|
+
import(input: unknown): Promise<AccountKeys>;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* This file was auto-generated by openapi-typescript.
|
|
72
|
+
* Do not make direct changes to the file.
|
|
73
|
+
*/
|
|
74
|
+
interface paths {
|
|
75
|
+
"/health": {
|
|
76
|
+
parameters: {
|
|
77
|
+
query?: never;
|
|
78
|
+
header?: never;
|
|
79
|
+
path?: never;
|
|
80
|
+
cookie?: never;
|
|
81
|
+
};
|
|
82
|
+
/** Health check */
|
|
83
|
+
get: operations["getHealth"];
|
|
84
|
+
put?: never;
|
|
85
|
+
post?: never;
|
|
86
|
+
delete?: never;
|
|
87
|
+
options?: never;
|
|
88
|
+
head?: never;
|
|
89
|
+
patch?: never;
|
|
90
|
+
trace?: never;
|
|
91
|
+
};
|
|
92
|
+
"/info/environment": {
|
|
93
|
+
parameters: {
|
|
94
|
+
query?: never;
|
|
95
|
+
header?: never;
|
|
96
|
+
path?: never;
|
|
97
|
+
cookie?: never;
|
|
98
|
+
};
|
|
99
|
+
/** Active environment */
|
|
100
|
+
get: operations["getEnvironment"];
|
|
101
|
+
put?: never;
|
|
102
|
+
post?: never;
|
|
103
|
+
delete?: never;
|
|
104
|
+
options?: never;
|
|
105
|
+
head?: never;
|
|
106
|
+
patch?: never;
|
|
107
|
+
trace?: never;
|
|
108
|
+
};
|
|
109
|
+
"/info/permit2/nonces/{owner}": {
|
|
110
|
+
parameters: {
|
|
111
|
+
query?: never;
|
|
112
|
+
header?: never;
|
|
113
|
+
path?: never;
|
|
114
|
+
cookie?: never;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Get Permit2 nonce bitmap
|
|
118
|
+
* @description Reads a single window of Permit2 nonce bitmap words for the given owner from on-chain state. Returns any available nonce found within the requested window, plus a cursor to continue when not found.
|
|
119
|
+
*/
|
|
120
|
+
get: operations["getPermit2Nonces"];
|
|
121
|
+
put?: never;
|
|
122
|
+
post?: never;
|
|
123
|
+
delete?: never;
|
|
124
|
+
options?: never;
|
|
125
|
+
head?: never;
|
|
126
|
+
patch?: never;
|
|
127
|
+
trace?: never;
|
|
128
|
+
};
|
|
129
|
+
"/users": {
|
|
130
|
+
parameters: {
|
|
131
|
+
query?: never;
|
|
132
|
+
header?: never;
|
|
133
|
+
path?: never;
|
|
134
|
+
cookie?: never;
|
|
135
|
+
};
|
|
136
|
+
/** List users */
|
|
137
|
+
get: operations["listUsers"];
|
|
138
|
+
put?: never;
|
|
139
|
+
/** Create user */
|
|
140
|
+
post: operations["createUser"];
|
|
141
|
+
delete?: never;
|
|
142
|
+
options?: never;
|
|
143
|
+
head?: never;
|
|
144
|
+
patch?: never;
|
|
145
|
+
trace?: never;
|
|
146
|
+
};
|
|
147
|
+
"/users/{address}": {
|
|
148
|
+
parameters: {
|
|
149
|
+
query?: never;
|
|
150
|
+
header?: never;
|
|
151
|
+
path?: never;
|
|
152
|
+
cookie?: never;
|
|
153
|
+
};
|
|
154
|
+
/** Get user details */
|
|
155
|
+
get: operations["getUser"];
|
|
156
|
+
put?: never;
|
|
157
|
+
post?: never;
|
|
158
|
+
delete?: never;
|
|
159
|
+
options?: never;
|
|
160
|
+
head?: never;
|
|
161
|
+
patch?: never;
|
|
162
|
+
trace?: never;
|
|
163
|
+
};
|
|
164
|
+
"/users/{address}/balances": {
|
|
165
|
+
parameters: {
|
|
166
|
+
query?: never;
|
|
167
|
+
header?: never;
|
|
168
|
+
path?: never;
|
|
169
|
+
cookie?: never;
|
|
170
|
+
};
|
|
171
|
+
/** Get user balances */
|
|
172
|
+
get: operations["getUserBalances"];
|
|
173
|
+
put?: never;
|
|
174
|
+
post?: never;
|
|
175
|
+
delete?: never;
|
|
176
|
+
options?: never;
|
|
177
|
+
head?: never;
|
|
178
|
+
patch?: never;
|
|
179
|
+
trace?: never;
|
|
180
|
+
};
|
|
181
|
+
"/users/{address}/transactions": {
|
|
182
|
+
parameters: {
|
|
183
|
+
query?: never;
|
|
184
|
+
header?: never;
|
|
185
|
+
path?: never;
|
|
186
|
+
cookie?: never;
|
|
187
|
+
};
|
|
188
|
+
/** Get user transaction history */
|
|
189
|
+
get: operations["getUserTransactions"];
|
|
190
|
+
put?: never;
|
|
191
|
+
post?: never;
|
|
192
|
+
delete?: never;
|
|
193
|
+
options?: never;
|
|
194
|
+
head?: never;
|
|
195
|
+
patch?: never;
|
|
196
|
+
trace?: never;
|
|
197
|
+
};
|
|
198
|
+
"/transactions": {
|
|
199
|
+
parameters: {
|
|
200
|
+
query?: never;
|
|
201
|
+
header?: never;
|
|
202
|
+
path?: never;
|
|
203
|
+
cookie?: never;
|
|
204
|
+
};
|
|
205
|
+
/** List all transactions */
|
|
206
|
+
get: operations["listTransactions"];
|
|
207
|
+
put?: never;
|
|
208
|
+
post?: never;
|
|
209
|
+
delete?: never;
|
|
210
|
+
options?: never;
|
|
211
|
+
head?: never;
|
|
212
|
+
patch?: never;
|
|
213
|
+
trace?: never;
|
|
214
|
+
};
|
|
215
|
+
"/transactions/deposit": {
|
|
216
|
+
parameters: {
|
|
217
|
+
query?: never;
|
|
218
|
+
header?: never;
|
|
219
|
+
path?: never;
|
|
220
|
+
cookie?: never;
|
|
221
|
+
};
|
|
222
|
+
get?: never;
|
|
223
|
+
put?: never;
|
|
224
|
+
/**
|
|
225
|
+
* Create deposit (deprecated)
|
|
226
|
+
* @deprecated
|
|
227
|
+
* @description Deprecated. Use POST /transactions/deposit/prepare + POST /transactions/deposit/{tx_id}/submit.
|
|
228
|
+
* Returns 400 — deposits now require a Permit2 witness signature bound to notes_hash.
|
|
229
|
+
*/
|
|
230
|
+
post: operations["createDeposit"];
|
|
231
|
+
delete?: never;
|
|
232
|
+
options?: never;
|
|
233
|
+
head?: never;
|
|
234
|
+
patch?: never;
|
|
235
|
+
trace?: never;
|
|
236
|
+
};
|
|
237
|
+
"/transactions/deposit/prepare": {
|
|
238
|
+
parameters: {
|
|
239
|
+
query?: never;
|
|
240
|
+
header?: never;
|
|
241
|
+
path?: never;
|
|
242
|
+
cookie?: never;
|
|
243
|
+
};
|
|
244
|
+
get?: never;
|
|
245
|
+
put?: never;
|
|
246
|
+
/**
|
|
247
|
+
* Prepare deposit
|
|
248
|
+
* @description Builds note/ciphertext artifacts and returns a notes_hash for the SDK to sign
|
|
249
|
+
* via Permit2 witness. Call `/transactions/deposit/{tx_id}/submit` with the Permit2 signature.
|
|
250
|
+
*/
|
|
251
|
+
post: operations["prepareDeposit"];
|
|
252
|
+
delete?: never;
|
|
253
|
+
options?: never;
|
|
254
|
+
head?: never;
|
|
255
|
+
patch?: never;
|
|
256
|
+
trace?: never;
|
|
257
|
+
};
|
|
258
|
+
"/transactions/deposit/{tx_id}/submit": {
|
|
259
|
+
parameters: {
|
|
260
|
+
query?: never;
|
|
261
|
+
header?: never;
|
|
262
|
+
path?: never;
|
|
263
|
+
cookie?: never;
|
|
264
|
+
};
|
|
265
|
+
get?: never;
|
|
266
|
+
put?: never;
|
|
267
|
+
/**
|
|
268
|
+
* Submit deposit Permit2 signature
|
|
269
|
+
* @description Submit the Permit2 witness signature for a prepared deposit.
|
|
270
|
+
*/
|
|
271
|
+
post: operations["submitDeposit"];
|
|
272
|
+
delete?: never;
|
|
273
|
+
options?: never;
|
|
274
|
+
head?: never;
|
|
275
|
+
patch?: never;
|
|
276
|
+
trace?: never;
|
|
277
|
+
};
|
|
278
|
+
"/transactions/prepare/transfer": {
|
|
279
|
+
parameters: {
|
|
280
|
+
query?: never;
|
|
281
|
+
header?: never;
|
|
282
|
+
path?: never;
|
|
283
|
+
cookie?: never;
|
|
284
|
+
};
|
|
285
|
+
get?: never;
|
|
286
|
+
put?: never;
|
|
287
|
+
/**
|
|
288
|
+
* Prepare transfer
|
|
289
|
+
* @description Returns a signing request. Call `/transactions/{tx_id}/submit` with the EdDSA signature.
|
|
290
|
+
*/
|
|
291
|
+
post: operations["prepareTransfer"];
|
|
292
|
+
delete?: never;
|
|
293
|
+
options?: never;
|
|
294
|
+
head?: never;
|
|
295
|
+
patch?: never;
|
|
296
|
+
trace?: never;
|
|
297
|
+
};
|
|
298
|
+
"/transactions/prepare/execute": {
|
|
299
|
+
parameters: {
|
|
300
|
+
query?: never;
|
|
301
|
+
header?: never;
|
|
302
|
+
path?: never;
|
|
303
|
+
cookie?: never;
|
|
304
|
+
};
|
|
305
|
+
get?: never;
|
|
306
|
+
put?: never;
|
|
307
|
+
/**
|
|
308
|
+
* Prepare execute (adapter)
|
|
309
|
+
* @description Prepares an adapter transaction that withdraws tokens from the user's private balance,
|
|
310
|
+
* executes arbitrary external calls (e.g. DeFi swaps), and deposits the results back.
|
|
311
|
+
* Returns a signing request. Call `/transactions/{tx_id}/submit` with the EdDSA signature.
|
|
312
|
+
*/
|
|
313
|
+
post: operations["prepareExecute"];
|
|
314
|
+
delete?: never;
|
|
315
|
+
options?: never;
|
|
316
|
+
head?: never;
|
|
317
|
+
patch?: never;
|
|
318
|
+
trace?: never;
|
|
319
|
+
};
|
|
320
|
+
"/transactions/prepare/withdraw": {
|
|
321
|
+
parameters: {
|
|
322
|
+
query?: never;
|
|
323
|
+
header?: never;
|
|
324
|
+
path?: never;
|
|
325
|
+
cookie?: never;
|
|
326
|
+
};
|
|
327
|
+
get?: never;
|
|
328
|
+
put?: never;
|
|
329
|
+
/**
|
|
330
|
+
* Prepare withdraw
|
|
331
|
+
* @description Returns a signing request. Call `/transactions/{tx_id}/submit` with the EdDSA signature.
|
|
332
|
+
*/
|
|
333
|
+
post: operations["prepareWithdraw"];
|
|
334
|
+
delete?: never;
|
|
335
|
+
options?: never;
|
|
336
|
+
head?: never;
|
|
337
|
+
patch?: never;
|
|
338
|
+
trace?: never;
|
|
339
|
+
};
|
|
340
|
+
"/transactions/{tx_id}/submit": {
|
|
341
|
+
parameters: {
|
|
342
|
+
query?: never;
|
|
343
|
+
header?: never;
|
|
344
|
+
path?: never;
|
|
345
|
+
cookie?: never;
|
|
346
|
+
};
|
|
347
|
+
get?: never;
|
|
348
|
+
put?: never;
|
|
349
|
+
/**
|
|
350
|
+
* Submit EdDSA signature
|
|
351
|
+
* @description Submit the EdDSA signature for a prepared transfer, withdraw, or execute.
|
|
352
|
+
*/
|
|
353
|
+
post: operations["submitTransaction"];
|
|
354
|
+
delete?: never;
|
|
355
|
+
options?: never;
|
|
356
|
+
head?: never;
|
|
357
|
+
patch?: never;
|
|
358
|
+
trace?: never;
|
|
359
|
+
};
|
|
360
|
+
"/transactions/{tx_id}": {
|
|
361
|
+
parameters: {
|
|
362
|
+
query?: never;
|
|
363
|
+
header?: never;
|
|
364
|
+
path?: never;
|
|
365
|
+
cookie?: never;
|
|
366
|
+
};
|
|
367
|
+
/** Get transaction status */
|
|
368
|
+
get: operations["getTransaction"];
|
|
369
|
+
put?: never;
|
|
370
|
+
post?: never;
|
|
371
|
+
delete?: never;
|
|
372
|
+
options?: never;
|
|
373
|
+
head?: never;
|
|
374
|
+
patch?: never;
|
|
375
|
+
trace?: never;
|
|
376
|
+
};
|
|
377
|
+
"/burner/create": {
|
|
378
|
+
parameters: {
|
|
379
|
+
query?: never;
|
|
380
|
+
header?: never;
|
|
381
|
+
path?: never;
|
|
382
|
+
cookie?: never;
|
|
383
|
+
};
|
|
384
|
+
get?: never;
|
|
385
|
+
put?: never;
|
|
386
|
+
/**
|
|
387
|
+
* Create burner account
|
|
388
|
+
* @description Creates a burner account and prepares a withdrawal to fund it.
|
|
389
|
+
* The client generates an ephemeral keypair and sends the burner address.
|
|
390
|
+
* Returns a signing request — call `/transactions/{tx_id}/submit` with the EdDSA signature.
|
|
391
|
+
* After the withdrawal confirms on-chain, the relayer sends ETH to the burner for gas.
|
|
392
|
+
*/
|
|
393
|
+
post: operations["createBurner"];
|
|
394
|
+
delete?: never;
|
|
395
|
+
options?: never;
|
|
396
|
+
head?: never;
|
|
397
|
+
patch?: never;
|
|
398
|
+
trace?: never;
|
|
399
|
+
};
|
|
400
|
+
"/burner/{burner_address}/status": {
|
|
401
|
+
parameters: {
|
|
402
|
+
query?: never;
|
|
403
|
+
header?: never;
|
|
404
|
+
path?: never;
|
|
405
|
+
cookie?: never;
|
|
406
|
+
};
|
|
407
|
+
/** Get burner account status */
|
|
408
|
+
get: operations["getBurnerStatus"];
|
|
409
|
+
put?: never;
|
|
410
|
+
post?: never;
|
|
411
|
+
delete?: never;
|
|
412
|
+
options?: never;
|
|
413
|
+
head?: never;
|
|
414
|
+
patch?: never;
|
|
415
|
+
trace?: never;
|
|
416
|
+
};
|
|
417
|
+
"/burner/{burner_address}/dispose": {
|
|
418
|
+
parameters: {
|
|
419
|
+
query?: never;
|
|
420
|
+
header?: never;
|
|
421
|
+
path?: never;
|
|
422
|
+
cookie?: never;
|
|
423
|
+
};
|
|
424
|
+
get?: never;
|
|
425
|
+
put?: never;
|
|
426
|
+
/**
|
|
427
|
+
* Dispose burner account
|
|
428
|
+
* @description Mark a burner account as disposed after depositing tokens back to the pool.
|
|
429
|
+
*/
|
|
430
|
+
post: operations["disposeBurner"];
|
|
431
|
+
delete?: never;
|
|
432
|
+
options?: never;
|
|
433
|
+
head?: never;
|
|
434
|
+
patch?: never;
|
|
435
|
+
trace?: never;
|
|
436
|
+
};
|
|
437
|
+
"/burner/info": {
|
|
438
|
+
parameters: {
|
|
439
|
+
query?: never;
|
|
440
|
+
header?: never;
|
|
441
|
+
path?: never;
|
|
442
|
+
cookie?: never;
|
|
443
|
+
};
|
|
444
|
+
/**
|
|
445
|
+
* Burner configuration info
|
|
446
|
+
* @description Returns chain configuration the SDK needs for burner operations.
|
|
447
|
+
*/
|
|
448
|
+
get: operations["getBurnerInfo"];
|
|
449
|
+
put?: never;
|
|
450
|
+
post?: never;
|
|
451
|
+
delete?: never;
|
|
452
|
+
options?: never;
|
|
453
|
+
head?: never;
|
|
454
|
+
patch?: never;
|
|
455
|
+
trace?: never;
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
type webhooks = Record<string, never>;
|
|
459
|
+
interface components {
|
|
460
|
+
schemas: {
|
|
461
|
+
ErrorResponse: {
|
|
462
|
+
error: {
|
|
463
|
+
/** @description Error code (e.g. INTERNAL_ERROR) */
|
|
464
|
+
code: string;
|
|
465
|
+
message: string;
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
/** @description Bech32m-encoded Unlink address */
|
|
469
|
+
Bech32mAddress: string;
|
|
470
|
+
/** @description EVM address (checksummed or lowercase) */
|
|
471
|
+
EvmAddress: string;
|
|
472
|
+
HealthData: {
|
|
473
|
+
status: string;
|
|
474
|
+
};
|
|
475
|
+
EnvironmentInfo: {
|
|
476
|
+
/** @description Environment identifier (e.g. "base-mainnet") */
|
|
477
|
+
name: string;
|
|
478
|
+
chain_id: number;
|
|
479
|
+
/** @description UnlinkPool contract address */
|
|
480
|
+
pool_address: components["schemas"]["EvmAddress"];
|
|
481
|
+
/** @description Permit2 contract address */
|
|
482
|
+
permit2_address: components["schemas"]["EvmAddress"];
|
|
483
|
+
};
|
|
484
|
+
BitmapWord: {
|
|
485
|
+
/** @description Permit2 bitmap word index */
|
|
486
|
+
word_position: number;
|
|
487
|
+
/** @description Hex-encoded uint256 bitmap value */
|
|
488
|
+
bitmap: string;
|
|
489
|
+
};
|
|
490
|
+
Permit2NoncesData: {
|
|
491
|
+
owner: components["schemas"]["EvmAddress"];
|
|
492
|
+
environment: string;
|
|
493
|
+
/** @description Bitmap words returned for the requested window */
|
|
494
|
+
bitmap_words: components["schemas"]["BitmapWord"][];
|
|
495
|
+
/** @description First available (unset) nonce within the returned bitmap words. Omitted when none is found. */
|
|
496
|
+
next_available_nonce?: number;
|
|
497
|
+
/** @description Word position to request next when the current window contains no available nonce */
|
|
498
|
+
next_word_position?: number;
|
|
499
|
+
};
|
|
500
|
+
CreateUserRequest: {
|
|
501
|
+
/** @description Hex-encoded Ed25519 viewing private key */
|
|
502
|
+
viewing_private_key: string;
|
|
503
|
+
/** @description Poseidon hash as decimal string */
|
|
504
|
+
nullifying_key: string;
|
|
505
|
+
/** @description BabyJubJub spending public key [x, y] as decimal strings */
|
|
506
|
+
public_key: string[];
|
|
507
|
+
};
|
|
508
|
+
CreateUserResponse: {
|
|
509
|
+
address: components["schemas"]["Bech32mAddress"];
|
|
510
|
+
/** @description Key derivation index */
|
|
511
|
+
index: number;
|
|
512
|
+
};
|
|
513
|
+
User: {
|
|
514
|
+
address: components["schemas"]["Bech32mAddress"];
|
|
515
|
+
/** @description BabyJubJub x coordinate as decimal string */
|
|
516
|
+
public_key_x: string;
|
|
517
|
+
/** @description BabyJubJub y coordinate as decimal string */
|
|
518
|
+
public_key_y: string;
|
|
519
|
+
/** Format: date-time */
|
|
520
|
+
created_at: string;
|
|
521
|
+
/** Format: date-time */
|
|
522
|
+
updated_at: string;
|
|
523
|
+
};
|
|
524
|
+
UserListData: {
|
|
525
|
+
users: components["schemas"]["User"][];
|
|
526
|
+
/** @description Opaque cursor for next page. Omitted when no more results. */
|
|
527
|
+
next_cursor?: string;
|
|
528
|
+
};
|
|
529
|
+
Balance: {
|
|
530
|
+
/** @description ERC-20 contract address */
|
|
531
|
+
token: components["schemas"]["EvmAddress"];
|
|
532
|
+
/** @description Token amount as string (large numbers) */
|
|
533
|
+
amount: string;
|
|
534
|
+
};
|
|
535
|
+
BalancesData: {
|
|
536
|
+
balances: components["schemas"]["Balance"][];
|
|
537
|
+
};
|
|
538
|
+
/** @enum {string} */
|
|
539
|
+
TransactionType: "deposit" | "transfer" | "withdraw" | "execute";
|
|
540
|
+
/** @enum {string} */
|
|
541
|
+
TransactionStatus: "accepted" | "prepared" | "proving" | "proved" | "broadcasting" | "relayed" | "processed" | "failed";
|
|
542
|
+
Transaction: {
|
|
543
|
+
/** Format: uuid */
|
|
544
|
+
id: string;
|
|
545
|
+
user_address: components["schemas"]["Bech32mAddress"];
|
|
546
|
+
type: components["schemas"]["TransactionType"];
|
|
547
|
+
status: components["schemas"]["TransactionStatus"];
|
|
548
|
+
environment: string;
|
|
549
|
+
/** @description On-chain transaction hash, set once relayed */
|
|
550
|
+
tx_hash?: string | null;
|
|
551
|
+
/** Format: date-time */
|
|
552
|
+
created_at: string;
|
|
553
|
+
/** Format: date-time */
|
|
554
|
+
updated_at: string;
|
|
555
|
+
};
|
|
556
|
+
TransactionListData: {
|
|
557
|
+
transactions: components["schemas"]["Transaction"][];
|
|
558
|
+
/** @description Opaque cursor for next page. Omitted when no more results. */
|
|
559
|
+
next_cursor?: string;
|
|
560
|
+
};
|
|
561
|
+
DepositRequest: {
|
|
562
|
+
/** @description Recipient Unlink address */
|
|
563
|
+
unlink_address: components["schemas"]["Bech32mAddress"];
|
|
564
|
+
/** @description ERC-20 token address */
|
|
565
|
+
token: components["schemas"]["EvmAddress"];
|
|
566
|
+
/** @description Token amount as string */
|
|
567
|
+
amount: string;
|
|
568
|
+
/** @description Target environment (e.g. "base-mainnet") */
|
|
569
|
+
environment: string;
|
|
570
|
+
/** @description Depositor EOA address */
|
|
571
|
+
evm_address: components["schemas"]["EvmAddress"];
|
|
572
|
+
/** @description EIP-712 Permit2 signature */
|
|
573
|
+
permit2_signature: string;
|
|
574
|
+
/** @description Permit2 nonce */
|
|
575
|
+
permit2_nonce: string;
|
|
576
|
+
/** @description Permit2 deadline (Unix timestamp) */
|
|
577
|
+
permit2_deadline: number;
|
|
578
|
+
};
|
|
579
|
+
DepositResponse: {
|
|
580
|
+
/** Format: uuid */
|
|
581
|
+
tx_id: string;
|
|
582
|
+
status: components["schemas"]["TransactionStatus"];
|
|
583
|
+
};
|
|
584
|
+
PrepareDepositRequest: {
|
|
585
|
+
/** @description Recipient Unlink address */
|
|
586
|
+
unlink_address: components["schemas"]["Bech32mAddress"];
|
|
587
|
+
/** @description ERC-20 token address */
|
|
588
|
+
token: components["schemas"]["EvmAddress"];
|
|
589
|
+
/** @description Token amount as string */
|
|
590
|
+
amount: string;
|
|
591
|
+
/** @description Target environment (e.g. "base-mainnet") */
|
|
592
|
+
environment: string;
|
|
593
|
+
/** @description Depositor EOA address */
|
|
594
|
+
evm_address: components["schemas"]["EvmAddress"];
|
|
595
|
+
};
|
|
596
|
+
PrepareDepositResponse: {
|
|
597
|
+
/** Format: uuid */
|
|
598
|
+
tx_id: string;
|
|
599
|
+
/** @description keccak256(abi.encode(notes, ciphertexts)) — sign this in the Permit2 witness */
|
|
600
|
+
notes_hash: string;
|
|
601
|
+
};
|
|
602
|
+
SubmitDepositRequest: {
|
|
603
|
+
/** @description EIP-712 Permit2 witness signature */
|
|
604
|
+
permit2_signature: string;
|
|
605
|
+
/** @description Permit2 nonce */
|
|
606
|
+
permit2_nonce: string;
|
|
607
|
+
/** @description Permit2 deadline (Unix timestamp) */
|
|
608
|
+
permit2_deadline: number;
|
|
609
|
+
};
|
|
610
|
+
TransferItem: {
|
|
611
|
+
/** @description Recipient Unlink address */
|
|
612
|
+
unlink_address: components["schemas"]["Bech32mAddress"];
|
|
613
|
+
/** @description ERC-20 token address */
|
|
614
|
+
token: components["schemas"]["EvmAddress"];
|
|
615
|
+
/** @description Token amount as string */
|
|
616
|
+
amount: string;
|
|
617
|
+
};
|
|
618
|
+
TransferRequest: {
|
|
619
|
+
/** @description Sender Unlink address */
|
|
620
|
+
unlink_address: components["schemas"]["Bech32mAddress"];
|
|
621
|
+
transfers: components["schemas"]["TransferItem"][];
|
|
622
|
+
environment: string;
|
|
623
|
+
};
|
|
624
|
+
WithdrawRequest: {
|
|
625
|
+
/** @description Sender Unlink address */
|
|
626
|
+
unlink_address: components["schemas"]["Bech32mAddress"];
|
|
627
|
+
/** @description Destination EVM address */
|
|
628
|
+
evm_address: components["schemas"]["EvmAddress"];
|
|
629
|
+
/** @description ERC-20 token address */
|
|
630
|
+
token: components["schemas"]["EvmAddress"];
|
|
631
|
+
/** @description Token amount as string */
|
|
632
|
+
amount: string;
|
|
633
|
+
environment: string;
|
|
634
|
+
};
|
|
635
|
+
ExecuteWithdrawal: {
|
|
636
|
+
/** @description ERC-20 token address to withdraw from private balance */
|
|
637
|
+
token: components["schemas"]["EvmAddress"];
|
|
638
|
+
/** @description Token amount as string */
|
|
639
|
+
amount: string;
|
|
640
|
+
};
|
|
641
|
+
ExecuteCall: {
|
|
642
|
+
/** @description Target contract address */
|
|
643
|
+
to: components["schemas"]["EvmAddress"];
|
|
644
|
+
/** @description Hex-encoded calldata */
|
|
645
|
+
data: string;
|
|
646
|
+
/** @description ETH value in wei (use "0" for non-payable calls) */
|
|
647
|
+
value: string;
|
|
648
|
+
};
|
|
649
|
+
ExecuteOutput: {
|
|
650
|
+
/** @description Nullifier public key of the recipient (decimal string) */
|
|
651
|
+
npk: string;
|
|
652
|
+
/** @description ERC-20 token address of expected output */
|
|
653
|
+
token: components["schemas"]["EvmAddress"];
|
|
654
|
+
/** @description Minimum acceptable output amount (slippage protection) */
|
|
655
|
+
min_amount: string;
|
|
656
|
+
};
|
|
657
|
+
PrepareExecuteRequest: {
|
|
658
|
+
/** @description Sender Unlink address */
|
|
659
|
+
unlink_address: components["schemas"]["Bech32mAddress"];
|
|
660
|
+
/** @description Target environment (e.g. "base-mainnet") */
|
|
661
|
+
environment: string;
|
|
662
|
+
/** @description Tokens to withdraw from private balance into the adapter */
|
|
663
|
+
withdrawals: components["schemas"]["ExecuteWithdrawal"][];
|
|
664
|
+
/** @description Arbitrary external calls the adapter will execute */
|
|
665
|
+
calls: components["schemas"]["ExecuteCall"][];
|
|
666
|
+
/** @description Expected outputs to deposit back into private balance */
|
|
667
|
+
outputs: components["schemas"]["ExecuteOutput"][];
|
|
668
|
+
/** @description Unix timestamp after which the transaction reverts */
|
|
669
|
+
deadline: number;
|
|
670
|
+
};
|
|
671
|
+
PrepareExecuteResponse: {
|
|
672
|
+
/** Format: uuid */
|
|
673
|
+
tx_id: string;
|
|
674
|
+
status: components["schemas"]["TransactionStatus"];
|
|
675
|
+
signing_request: components["schemas"]["SigningRequest"];
|
|
676
|
+
/** @description keccak256(abi.encode(calls, outputs, inputTokens, deadline, chainId)) % SNARK_FIELD — committed to in the circuit proof */
|
|
677
|
+
adapter_data_hash: string;
|
|
678
|
+
};
|
|
679
|
+
SigningRequest: {
|
|
680
|
+
/** @description Poseidon hash to sign (decimal string) */
|
|
681
|
+
message_hash: string;
|
|
682
|
+
public_inputs: components["schemas"]["PublicInputs"];
|
|
683
|
+
selected_notes: components["schemas"]["SelectedNote"][];
|
|
684
|
+
/** @description JoinSplit circuit variant identifier */
|
|
685
|
+
circuit_variant: string;
|
|
686
|
+
};
|
|
687
|
+
PublicInputs: {
|
|
688
|
+
/** @description Merkle tree root (decimal string) */
|
|
689
|
+
merkle_root: string;
|
|
690
|
+
/** @description Bound parameters hash (decimal string) */
|
|
691
|
+
bound_params_hash: string;
|
|
692
|
+
/** @description Input nullifiers (decimal strings) */
|
|
693
|
+
nullifiers: string[];
|
|
694
|
+
/** @description Output commitments (decimal strings) */
|
|
695
|
+
all_commitments_out: string[];
|
|
696
|
+
};
|
|
697
|
+
SelectedNote: {
|
|
698
|
+
/** @description Merkle tree leaf index */
|
|
699
|
+
leaf_index: number;
|
|
700
|
+
/** @description Note amount as string */
|
|
701
|
+
amount: string;
|
|
702
|
+
};
|
|
703
|
+
PrepareResponse: {
|
|
704
|
+
/** Format: uuid */
|
|
705
|
+
tx_id: string;
|
|
706
|
+
status: components["schemas"]["TransactionStatus"];
|
|
707
|
+
signing_request: components["schemas"]["SigningRequest"];
|
|
708
|
+
};
|
|
709
|
+
SubmitRequest: {
|
|
710
|
+
/** @description EdDSA signature [R8x, R8y, S] as decimal strings */
|
|
711
|
+
signature: string[];
|
|
712
|
+
};
|
|
713
|
+
SubmitResponse: {
|
|
714
|
+
/** Format: uuid */
|
|
715
|
+
tx_id: string;
|
|
716
|
+
status: components["schemas"]["TransactionStatus"];
|
|
717
|
+
};
|
|
718
|
+
BurnerCreateRequest: {
|
|
719
|
+
/** @description Sender Unlink address (whose private notes to spend) */
|
|
720
|
+
unlink_address: components["schemas"]["Bech32mAddress"];
|
|
721
|
+
/** @description Client-generated burner EOA address */
|
|
722
|
+
burner_address: components["schemas"]["EvmAddress"];
|
|
723
|
+
/** @description ERC-20 token address */
|
|
724
|
+
token: components["schemas"]["EvmAddress"];
|
|
725
|
+
/** @description Token amount as string */
|
|
726
|
+
amount: string;
|
|
727
|
+
/** @description Target environment (e.g. "base-mainnet") */
|
|
728
|
+
environment: string;
|
|
729
|
+
};
|
|
730
|
+
/** @enum {string} */
|
|
731
|
+
BurnerStatus: "pending" | "gas_pending" | "funded" | "disposed" | "gas_funding_failed";
|
|
732
|
+
BurnerStatusResponse: {
|
|
733
|
+
evm_address: components["schemas"]["EvmAddress"];
|
|
734
|
+
status: components["schemas"]["BurnerStatus"];
|
|
735
|
+
/** Format: uuid */
|
|
736
|
+
withdraw_tx_id: string;
|
|
737
|
+
token: components["schemas"]["EvmAddress"];
|
|
738
|
+
token_amount: string;
|
|
739
|
+
gas_funding_wei: string;
|
|
740
|
+
gas_funding_tx_hash?: string | null;
|
|
741
|
+
/** Format: uuid */
|
|
742
|
+
deposit_back_tx_id?: string | null;
|
|
743
|
+
/** Format: date-time */
|
|
744
|
+
created_at: string;
|
|
745
|
+
/** Format: date-time */
|
|
746
|
+
disposed_at?: string | null;
|
|
747
|
+
};
|
|
748
|
+
BurnerDisposeRequest: {
|
|
749
|
+
/**
|
|
750
|
+
* Format: uuid
|
|
751
|
+
* @description Transaction ID of the deposit-back, if any
|
|
752
|
+
*/
|
|
753
|
+
deposit_back_tx_id?: string;
|
|
754
|
+
};
|
|
755
|
+
BurnerDisposeResponse: {
|
|
756
|
+
status: components["schemas"]["BurnerStatus"];
|
|
757
|
+
};
|
|
758
|
+
BurnerInfoResponse: {
|
|
759
|
+
pool_address: components["schemas"]["EvmAddress"];
|
|
760
|
+
permit2_address: components["schemas"]["EvmAddress"];
|
|
761
|
+
chain_id: number;
|
|
762
|
+
/** @description ETH amount (in wei) the relayer sends for gas funding */
|
|
763
|
+
gas_funding_wei: string;
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
responses: {
|
|
767
|
+
/** @description Invalid request */
|
|
768
|
+
BadRequest: {
|
|
769
|
+
headers: {
|
|
770
|
+
[name: string]: unknown;
|
|
771
|
+
};
|
|
772
|
+
content: {
|
|
773
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
774
|
+
};
|
|
775
|
+
};
|
|
776
|
+
/** @description Authentication required or invalid */
|
|
777
|
+
Unauthorized: {
|
|
778
|
+
headers: {
|
|
779
|
+
[name: string]: unknown;
|
|
780
|
+
};
|
|
781
|
+
content: {
|
|
782
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
/** @description Resource not found */
|
|
786
|
+
NotFound: {
|
|
787
|
+
headers: {
|
|
788
|
+
[name: string]: unknown;
|
|
789
|
+
};
|
|
790
|
+
content: {
|
|
791
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
/** @description Request conflicts with current transaction state */
|
|
795
|
+
Conflict: {
|
|
796
|
+
headers: {
|
|
797
|
+
[name: string]: unknown;
|
|
798
|
+
};
|
|
799
|
+
content: {
|
|
800
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
/** @description Rate limited — per-key tier quota exceeded or proving capacity exhausted */
|
|
804
|
+
RateLimited: {
|
|
805
|
+
headers: {
|
|
806
|
+
/** @description Seconds until the rate limit resets */
|
|
807
|
+
"Retry-After"?: number;
|
|
808
|
+
/** @description Maximum requests allowed in the current window for this tier */
|
|
809
|
+
"X-RateLimit-Limit"?: number;
|
|
810
|
+
/** @description Remaining requests in the current window for this tier */
|
|
811
|
+
"X-RateLimit-Remaining"?: number;
|
|
812
|
+
/** @description Unix epoch seconds when the current window resets */
|
|
813
|
+
"X-RateLimit-Reset"?: number;
|
|
814
|
+
/** @description Rate limit tier applied to this request (reads, writes, or heavy) */
|
|
815
|
+
"X-RateLimit-Policy"?: "reads" | "writes" | "heavy";
|
|
816
|
+
[name: string]: unknown;
|
|
817
|
+
};
|
|
818
|
+
content: {
|
|
819
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
parameters: {
|
|
824
|
+
/** @description Maximum number of items to return */
|
|
825
|
+
limit: number;
|
|
826
|
+
/** @description Opaque pagination cursor from a previous response */
|
|
827
|
+
cursor: string;
|
|
828
|
+
/** @description Environment name (e.g. "base-mainnet") */
|
|
829
|
+
environmentQuery: string;
|
|
830
|
+
/** @description ERC-20 token address to filter by */
|
|
831
|
+
tokenQuery: string;
|
|
832
|
+
/** @description Filter by transaction status */
|
|
833
|
+
statusQuery: components["schemas"]["TransactionStatus"];
|
|
834
|
+
/** @description Filter by transaction type */
|
|
835
|
+
typeQuery: components["schemas"]["TransactionType"];
|
|
836
|
+
/** @description User Unlink address */
|
|
837
|
+
address: components["schemas"]["Bech32mAddress"];
|
|
838
|
+
/** @description Transaction ID */
|
|
839
|
+
tx_id: string;
|
|
840
|
+
};
|
|
841
|
+
requestBodies: never;
|
|
842
|
+
headers: never;
|
|
843
|
+
pathItems: never;
|
|
844
|
+
}
|
|
845
|
+
type $defs = Record<string, never>;
|
|
846
|
+
interface operations {
|
|
847
|
+
getHealth: {
|
|
848
|
+
parameters: {
|
|
849
|
+
query?: never;
|
|
850
|
+
header?: never;
|
|
851
|
+
path?: never;
|
|
852
|
+
cookie?: never;
|
|
853
|
+
};
|
|
854
|
+
requestBody?: never;
|
|
855
|
+
responses: {
|
|
856
|
+
/** @description System health status */
|
|
857
|
+
200: {
|
|
858
|
+
headers: {
|
|
859
|
+
[name: string]: unknown;
|
|
860
|
+
};
|
|
861
|
+
content: {
|
|
862
|
+
"application/json": {
|
|
863
|
+
data: components["schemas"]["HealthData"];
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
/** @description System health is degraded */
|
|
868
|
+
503: {
|
|
869
|
+
headers: {
|
|
870
|
+
[name: string]: unknown;
|
|
871
|
+
};
|
|
872
|
+
content: {
|
|
873
|
+
"application/json": {
|
|
874
|
+
data: components["schemas"]["HealthData"];
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
};
|
|
878
|
+
};
|
|
879
|
+
};
|
|
880
|
+
getEnvironment: {
|
|
881
|
+
parameters: {
|
|
882
|
+
query?: never;
|
|
883
|
+
header?: never;
|
|
884
|
+
path?: never;
|
|
885
|
+
cookie?: never;
|
|
886
|
+
};
|
|
887
|
+
requestBody?: never;
|
|
888
|
+
responses: {
|
|
889
|
+
/** @description Active environment */
|
|
890
|
+
200: {
|
|
891
|
+
headers: {
|
|
892
|
+
[name: string]: unknown;
|
|
893
|
+
};
|
|
894
|
+
content: {
|
|
895
|
+
"application/json": {
|
|
896
|
+
data: components["schemas"]["EnvironmentInfo"];
|
|
897
|
+
};
|
|
898
|
+
};
|
|
899
|
+
};
|
|
900
|
+
};
|
|
901
|
+
};
|
|
902
|
+
getPermit2Nonces: {
|
|
903
|
+
parameters: {
|
|
904
|
+
query?: {
|
|
905
|
+
/** @description Permit2 bitmap word index to start reading from. Defaults to 0. */
|
|
906
|
+
start_word?: number;
|
|
907
|
+
/** @description Number of bitmap words to read. Defaults to 3. */
|
|
908
|
+
word_count?: number;
|
|
909
|
+
};
|
|
910
|
+
header?: never;
|
|
911
|
+
path: {
|
|
912
|
+
owner: components["schemas"]["EvmAddress"];
|
|
913
|
+
};
|
|
914
|
+
cookie?: never;
|
|
915
|
+
};
|
|
916
|
+
requestBody?: never;
|
|
917
|
+
responses: {
|
|
918
|
+
/** @description Permit2 nonce bitmap */
|
|
919
|
+
200: {
|
|
920
|
+
headers: {
|
|
921
|
+
[name: string]: unknown;
|
|
922
|
+
};
|
|
923
|
+
content: {
|
|
924
|
+
"application/json": {
|
|
925
|
+
data: components["schemas"]["Permit2NoncesData"];
|
|
926
|
+
};
|
|
927
|
+
};
|
|
928
|
+
};
|
|
929
|
+
400: components["responses"]["BadRequest"];
|
|
930
|
+
/** @description Chain RPC unavailable */
|
|
931
|
+
503: {
|
|
932
|
+
headers: {
|
|
933
|
+
[name: string]: unknown;
|
|
934
|
+
};
|
|
935
|
+
content: {
|
|
936
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
listUsers: {
|
|
942
|
+
parameters: {
|
|
943
|
+
query?: {
|
|
944
|
+
/** @description Maximum number of items to return */
|
|
945
|
+
limit?: components["parameters"]["limit"];
|
|
946
|
+
/** @description Opaque pagination cursor from a previous response */
|
|
947
|
+
cursor?: components["parameters"]["cursor"];
|
|
948
|
+
};
|
|
949
|
+
header?: never;
|
|
950
|
+
path?: never;
|
|
951
|
+
cookie?: never;
|
|
952
|
+
};
|
|
953
|
+
requestBody?: never;
|
|
954
|
+
responses: {
|
|
955
|
+
/** @description Paginated user list */
|
|
956
|
+
200: {
|
|
957
|
+
headers: {
|
|
958
|
+
[name: string]: unknown;
|
|
959
|
+
};
|
|
960
|
+
content: {
|
|
961
|
+
"application/json": {
|
|
962
|
+
data: components["schemas"]["UserListData"];
|
|
963
|
+
};
|
|
964
|
+
};
|
|
965
|
+
};
|
|
966
|
+
401: components["responses"]["Unauthorized"];
|
|
967
|
+
429: components["responses"]["RateLimited"];
|
|
968
|
+
};
|
|
969
|
+
};
|
|
970
|
+
createUser: {
|
|
971
|
+
parameters: {
|
|
972
|
+
query?: never;
|
|
973
|
+
header?: never;
|
|
974
|
+
path?: never;
|
|
975
|
+
cookie?: never;
|
|
976
|
+
};
|
|
977
|
+
requestBody: {
|
|
978
|
+
content: {
|
|
979
|
+
"application/json": components["schemas"]["CreateUserRequest"];
|
|
980
|
+
};
|
|
981
|
+
};
|
|
982
|
+
responses: {
|
|
983
|
+
/** @description User created */
|
|
984
|
+
201: {
|
|
985
|
+
headers: {
|
|
986
|
+
[name: string]: unknown;
|
|
987
|
+
};
|
|
988
|
+
content: {
|
|
989
|
+
"application/json": {
|
|
990
|
+
data: components["schemas"]["CreateUserResponse"];
|
|
991
|
+
};
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
400: components["responses"]["BadRequest"];
|
|
995
|
+
401: components["responses"]["Unauthorized"];
|
|
996
|
+
429: components["responses"]["RateLimited"];
|
|
997
|
+
};
|
|
998
|
+
};
|
|
999
|
+
getUser: {
|
|
1000
|
+
parameters: {
|
|
1001
|
+
query?: never;
|
|
1002
|
+
header?: never;
|
|
1003
|
+
path: {
|
|
1004
|
+
/** @description User Unlink address */
|
|
1005
|
+
address: components["parameters"]["address"];
|
|
1006
|
+
};
|
|
1007
|
+
cookie?: never;
|
|
1008
|
+
};
|
|
1009
|
+
requestBody?: never;
|
|
1010
|
+
responses: {
|
|
1011
|
+
/** @description User details */
|
|
1012
|
+
200: {
|
|
1013
|
+
headers: {
|
|
1014
|
+
[name: string]: unknown;
|
|
1015
|
+
};
|
|
1016
|
+
content: {
|
|
1017
|
+
"application/json": {
|
|
1018
|
+
data: components["schemas"]["User"];
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
};
|
|
1022
|
+
401: components["responses"]["Unauthorized"];
|
|
1023
|
+
404: components["responses"]["NotFound"];
|
|
1024
|
+
429: components["responses"]["RateLimited"];
|
|
1025
|
+
};
|
|
1026
|
+
};
|
|
1027
|
+
getUserBalances: {
|
|
1028
|
+
parameters: {
|
|
1029
|
+
query?: {
|
|
1030
|
+
/** @description ERC-20 token address to filter by */
|
|
1031
|
+
token?: components["parameters"]["tokenQuery"];
|
|
1032
|
+
};
|
|
1033
|
+
header?: never;
|
|
1034
|
+
path: {
|
|
1035
|
+
/** @description User Unlink address */
|
|
1036
|
+
address: components["parameters"]["address"];
|
|
1037
|
+
};
|
|
1038
|
+
cookie?: never;
|
|
1039
|
+
};
|
|
1040
|
+
requestBody?: never;
|
|
1041
|
+
responses: {
|
|
1042
|
+
/** @description User balances */
|
|
1043
|
+
200: {
|
|
1044
|
+
headers: {
|
|
1045
|
+
[name: string]: unknown;
|
|
1046
|
+
};
|
|
1047
|
+
content: {
|
|
1048
|
+
"application/json": {
|
|
1049
|
+
data: components["schemas"]["BalancesData"];
|
|
1050
|
+
};
|
|
1051
|
+
};
|
|
1052
|
+
};
|
|
1053
|
+
401: components["responses"]["Unauthorized"];
|
|
1054
|
+
404: components["responses"]["NotFound"];
|
|
1055
|
+
429: components["responses"]["RateLimited"];
|
|
1056
|
+
};
|
|
1057
|
+
};
|
|
1058
|
+
getUserTransactions: {
|
|
1059
|
+
parameters: {
|
|
1060
|
+
query?: {
|
|
1061
|
+
/** @description Environment name (e.g. "base-mainnet") */
|
|
1062
|
+
environment?: components["parameters"]["environmentQuery"];
|
|
1063
|
+
/** @description Filter by transaction status */
|
|
1064
|
+
status?: components["parameters"]["statusQuery"];
|
|
1065
|
+
/** @description Filter by transaction type */
|
|
1066
|
+
type?: components["parameters"]["typeQuery"];
|
|
1067
|
+
/** @description Maximum number of items to return */
|
|
1068
|
+
limit?: components["parameters"]["limit"];
|
|
1069
|
+
/** @description Opaque pagination cursor from a previous response */
|
|
1070
|
+
cursor?: components["parameters"]["cursor"];
|
|
1071
|
+
};
|
|
1072
|
+
header?: never;
|
|
1073
|
+
path: {
|
|
1074
|
+
/** @description User Unlink address */
|
|
1075
|
+
address: components["parameters"]["address"];
|
|
1076
|
+
};
|
|
1077
|
+
cookie?: never;
|
|
1078
|
+
};
|
|
1079
|
+
requestBody?: never;
|
|
1080
|
+
responses: {
|
|
1081
|
+
/** @description Paginated transaction list */
|
|
1082
|
+
200: {
|
|
1083
|
+
headers: {
|
|
1084
|
+
[name: string]: unknown;
|
|
1085
|
+
};
|
|
1086
|
+
content: {
|
|
1087
|
+
"application/json": {
|
|
1088
|
+
data: components["schemas"]["TransactionListData"];
|
|
1089
|
+
};
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
401: components["responses"]["Unauthorized"];
|
|
1093
|
+
404: components["responses"]["NotFound"];
|
|
1094
|
+
429: components["responses"]["RateLimited"];
|
|
1095
|
+
};
|
|
1096
|
+
};
|
|
1097
|
+
listTransactions: {
|
|
1098
|
+
parameters: {
|
|
1099
|
+
query?: {
|
|
1100
|
+
/** @description Environment name (e.g. "base-mainnet") */
|
|
1101
|
+
environment?: components["parameters"]["environmentQuery"];
|
|
1102
|
+
/** @description Filter by transaction status */
|
|
1103
|
+
status?: components["parameters"]["statusQuery"];
|
|
1104
|
+
/** @description Filter by transaction type */
|
|
1105
|
+
type?: components["parameters"]["typeQuery"];
|
|
1106
|
+
/** @description Maximum number of items to return */
|
|
1107
|
+
limit?: components["parameters"]["limit"];
|
|
1108
|
+
/** @description Opaque pagination cursor from a previous response */
|
|
1109
|
+
cursor?: components["parameters"]["cursor"];
|
|
1110
|
+
};
|
|
1111
|
+
header?: never;
|
|
1112
|
+
path?: never;
|
|
1113
|
+
cookie?: never;
|
|
1114
|
+
};
|
|
1115
|
+
requestBody?: never;
|
|
1116
|
+
responses: {
|
|
1117
|
+
/** @description Paginated transaction list */
|
|
1118
|
+
200: {
|
|
1119
|
+
headers: {
|
|
1120
|
+
[name: string]: unknown;
|
|
1121
|
+
};
|
|
1122
|
+
content: {
|
|
1123
|
+
"application/json": {
|
|
1124
|
+
data: components["schemas"]["TransactionListData"];
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1127
|
+
};
|
|
1128
|
+
401: components["responses"]["Unauthorized"];
|
|
1129
|
+
429: components["responses"]["RateLimited"];
|
|
1130
|
+
};
|
|
1131
|
+
};
|
|
1132
|
+
createDeposit: {
|
|
1133
|
+
parameters: {
|
|
1134
|
+
query?: never;
|
|
1135
|
+
header?: never;
|
|
1136
|
+
path?: never;
|
|
1137
|
+
cookie?: never;
|
|
1138
|
+
};
|
|
1139
|
+
requestBody: {
|
|
1140
|
+
content: {
|
|
1141
|
+
"application/json": components["schemas"]["DepositRequest"];
|
|
1142
|
+
};
|
|
1143
|
+
};
|
|
1144
|
+
responses: {
|
|
1145
|
+
400: components["responses"]["BadRequest"];
|
|
1146
|
+
401: components["responses"]["Unauthorized"];
|
|
1147
|
+
429: components["responses"]["RateLimited"];
|
|
1148
|
+
};
|
|
1149
|
+
};
|
|
1150
|
+
prepareDeposit: {
|
|
1151
|
+
parameters: {
|
|
1152
|
+
query?: never;
|
|
1153
|
+
header?: never;
|
|
1154
|
+
path?: never;
|
|
1155
|
+
cookie?: never;
|
|
1156
|
+
};
|
|
1157
|
+
requestBody: {
|
|
1158
|
+
content: {
|
|
1159
|
+
"application/json": components["schemas"]["PrepareDepositRequest"];
|
|
1160
|
+
};
|
|
1161
|
+
};
|
|
1162
|
+
responses: {
|
|
1163
|
+
/** @description Deposit prepared, awaiting Permit2 witness signature */
|
|
1164
|
+
201: {
|
|
1165
|
+
headers: {
|
|
1166
|
+
[name: string]: unknown;
|
|
1167
|
+
};
|
|
1168
|
+
content: {
|
|
1169
|
+
"application/json": {
|
|
1170
|
+
data: components["schemas"]["PrepareDepositResponse"];
|
|
1171
|
+
};
|
|
1172
|
+
};
|
|
1173
|
+
};
|
|
1174
|
+
400: components["responses"]["BadRequest"];
|
|
1175
|
+
401: components["responses"]["Unauthorized"];
|
|
1176
|
+
429: components["responses"]["RateLimited"];
|
|
1177
|
+
};
|
|
1178
|
+
};
|
|
1179
|
+
submitDeposit: {
|
|
1180
|
+
parameters: {
|
|
1181
|
+
query?: never;
|
|
1182
|
+
header?: never;
|
|
1183
|
+
path: {
|
|
1184
|
+
/** @description Transaction ID */
|
|
1185
|
+
tx_id: components["parameters"]["tx_id"];
|
|
1186
|
+
};
|
|
1187
|
+
cookie?: never;
|
|
1188
|
+
};
|
|
1189
|
+
requestBody: {
|
|
1190
|
+
content: {
|
|
1191
|
+
"application/json": components["schemas"]["SubmitDepositRequest"];
|
|
1192
|
+
};
|
|
1193
|
+
};
|
|
1194
|
+
responses: {
|
|
1195
|
+
/** @description Deposit accepted */
|
|
1196
|
+
200: {
|
|
1197
|
+
headers: {
|
|
1198
|
+
[name: string]: unknown;
|
|
1199
|
+
};
|
|
1200
|
+
content: {
|
|
1201
|
+
"application/json": {
|
|
1202
|
+
data: components["schemas"]["DepositResponse"];
|
|
1203
|
+
};
|
|
1204
|
+
};
|
|
1205
|
+
};
|
|
1206
|
+
400: components["responses"]["BadRequest"];
|
|
1207
|
+
401: components["responses"]["Unauthorized"];
|
|
1208
|
+
404: components["responses"]["NotFound"];
|
|
1209
|
+
/** @description Duplicate deposit (Permit2 nonce reuse) */
|
|
1210
|
+
409: {
|
|
1211
|
+
headers: {
|
|
1212
|
+
[name: string]: unknown;
|
|
1213
|
+
};
|
|
1214
|
+
content: {
|
|
1215
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1216
|
+
};
|
|
1217
|
+
};
|
|
1218
|
+
/** @description Prepared deposit expired */
|
|
1219
|
+
410: {
|
|
1220
|
+
headers: {
|
|
1221
|
+
[name: string]: unknown;
|
|
1222
|
+
};
|
|
1223
|
+
content: {
|
|
1224
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1225
|
+
};
|
|
1226
|
+
};
|
|
1227
|
+
429: components["responses"]["RateLimited"];
|
|
1228
|
+
};
|
|
1229
|
+
};
|
|
1230
|
+
prepareTransfer: {
|
|
1231
|
+
parameters: {
|
|
1232
|
+
query?: never;
|
|
1233
|
+
header?: never;
|
|
1234
|
+
path?: never;
|
|
1235
|
+
cookie?: never;
|
|
1236
|
+
};
|
|
1237
|
+
requestBody: {
|
|
1238
|
+
content: {
|
|
1239
|
+
"application/json": components["schemas"]["TransferRequest"];
|
|
1240
|
+
};
|
|
1241
|
+
};
|
|
1242
|
+
responses: {
|
|
1243
|
+
/** @description Transfer prepared, awaiting signature */
|
|
1244
|
+
201: {
|
|
1245
|
+
headers: {
|
|
1246
|
+
[name: string]: unknown;
|
|
1247
|
+
};
|
|
1248
|
+
content: {
|
|
1249
|
+
"application/json": {
|
|
1250
|
+
data: components["schemas"]["PrepareResponse"];
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
};
|
|
1254
|
+
400: components["responses"]["BadRequest"];
|
|
1255
|
+
401: components["responses"]["Unauthorized"];
|
|
1256
|
+
429: components["responses"]["RateLimited"];
|
|
1257
|
+
};
|
|
1258
|
+
};
|
|
1259
|
+
prepareExecute: {
|
|
1260
|
+
parameters: {
|
|
1261
|
+
query?: never;
|
|
1262
|
+
header?: never;
|
|
1263
|
+
path?: never;
|
|
1264
|
+
cookie?: never;
|
|
1265
|
+
};
|
|
1266
|
+
requestBody: {
|
|
1267
|
+
content: {
|
|
1268
|
+
"application/json": components["schemas"]["PrepareExecuteRequest"];
|
|
1269
|
+
};
|
|
1270
|
+
};
|
|
1271
|
+
responses: {
|
|
1272
|
+
/** @description Execute prepared, awaiting signature */
|
|
1273
|
+
201: {
|
|
1274
|
+
headers: {
|
|
1275
|
+
[name: string]: unknown;
|
|
1276
|
+
};
|
|
1277
|
+
content: {
|
|
1278
|
+
"application/json": {
|
|
1279
|
+
data: components["schemas"]["PrepareExecuteResponse"];
|
|
1280
|
+
};
|
|
1281
|
+
};
|
|
1282
|
+
};
|
|
1283
|
+
400: components["responses"]["BadRequest"];
|
|
1284
|
+
401: components["responses"]["Unauthorized"];
|
|
1285
|
+
429: components["responses"]["RateLimited"];
|
|
1286
|
+
};
|
|
1287
|
+
};
|
|
1288
|
+
prepareWithdraw: {
|
|
1289
|
+
parameters: {
|
|
1290
|
+
query?: never;
|
|
1291
|
+
header?: never;
|
|
1292
|
+
path?: never;
|
|
1293
|
+
cookie?: never;
|
|
1294
|
+
};
|
|
1295
|
+
requestBody: {
|
|
1296
|
+
content: {
|
|
1297
|
+
"application/json": components["schemas"]["WithdrawRequest"];
|
|
1298
|
+
};
|
|
1299
|
+
};
|
|
1300
|
+
responses: {
|
|
1301
|
+
/** @description Withdraw prepared, awaiting signature */
|
|
1302
|
+
201: {
|
|
1303
|
+
headers: {
|
|
1304
|
+
[name: string]: unknown;
|
|
1305
|
+
};
|
|
1306
|
+
content: {
|
|
1307
|
+
"application/json": {
|
|
1308
|
+
data: components["schemas"]["PrepareResponse"];
|
|
1309
|
+
};
|
|
1310
|
+
};
|
|
1311
|
+
};
|
|
1312
|
+
400: components["responses"]["BadRequest"];
|
|
1313
|
+
401: components["responses"]["Unauthorized"];
|
|
1314
|
+
429: components["responses"]["RateLimited"];
|
|
1315
|
+
};
|
|
1316
|
+
};
|
|
1317
|
+
submitTransaction: {
|
|
1318
|
+
parameters: {
|
|
1319
|
+
query?: never;
|
|
1320
|
+
header?: never;
|
|
1321
|
+
path: {
|
|
1322
|
+
/** @description Transaction ID */
|
|
1323
|
+
tx_id: components["parameters"]["tx_id"];
|
|
1324
|
+
};
|
|
1325
|
+
cookie?: never;
|
|
1326
|
+
};
|
|
1327
|
+
requestBody: {
|
|
1328
|
+
content: {
|
|
1329
|
+
"application/json": components["schemas"]["SubmitRequest"];
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
responses: {
|
|
1333
|
+
/** @description Signature accepted */
|
|
1334
|
+
200: {
|
|
1335
|
+
headers: {
|
|
1336
|
+
[name: string]: unknown;
|
|
1337
|
+
};
|
|
1338
|
+
content: {
|
|
1339
|
+
"application/json": {
|
|
1340
|
+
data: components["schemas"]["SubmitResponse"];
|
|
1341
|
+
};
|
|
1342
|
+
};
|
|
1343
|
+
};
|
|
1344
|
+
400: components["responses"]["BadRequest"];
|
|
1345
|
+
401: components["responses"]["Unauthorized"];
|
|
1346
|
+
404: components["responses"]["NotFound"];
|
|
1347
|
+
409: components["responses"]["Conflict"];
|
|
1348
|
+
/** @description Transaction expired (5 min TTL) */
|
|
1349
|
+
410: {
|
|
1350
|
+
headers: {
|
|
1351
|
+
[name: string]: unknown;
|
|
1352
|
+
};
|
|
1353
|
+
content: {
|
|
1354
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1355
|
+
};
|
|
1356
|
+
};
|
|
1357
|
+
429: components["responses"]["RateLimited"];
|
|
1358
|
+
};
|
|
1359
|
+
};
|
|
1360
|
+
getTransaction: {
|
|
1361
|
+
parameters: {
|
|
1362
|
+
query?: never;
|
|
1363
|
+
header?: never;
|
|
1364
|
+
path: {
|
|
1365
|
+
/** @description Transaction ID */
|
|
1366
|
+
tx_id: components["parameters"]["tx_id"];
|
|
1367
|
+
};
|
|
1368
|
+
cookie?: never;
|
|
1369
|
+
};
|
|
1370
|
+
requestBody?: never;
|
|
1371
|
+
responses: {
|
|
1372
|
+
/** @description Transaction details */
|
|
1373
|
+
200: {
|
|
1374
|
+
headers: {
|
|
1375
|
+
[name: string]: unknown;
|
|
1376
|
+
};
|
|
1377
|
+
content: {
|
|
1378
|
+
"application/json": {
|
|
1379
|
+
data: components["schemas"]["Transaction"];
|
|
1380
|
+
};
|
|
1381
|
+
};
|
|
1382
|
+
};
|
|
1383
|
+
401: components["responses"]["Unauthorized"];
|
|
1384
|
+
404: components["responses"]["NotFound"];
|
|
1385
|
+
429: components["responses"]["RateLimited"];
|
|
1386
|
+
};
|
|
1387
|
+
};
|
|
1388
|
+
createBurner: {
|
|
1389
|
+
parameters: {
|
|
1390
|
+
query?: never;
|
|
1391
|
+
header?: never;
|
|
1392
|
+
path?: never;
|
|
1393
|
+
cookie?: never;
|
|
1394
|
+
};
|
|
1395
|
+
requestBody: {
|
|
1396
|
+
content: {
|
|
1397
|
+
"application/json": components["schemas"]["BurnerCreateRequest"];
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1400
|
+
responses: {
|
|
1401
|
+
/** @description Burner created, withdrawal prepared, awaiting signature */
|
|
1402
|
+
201: {
|
|
1403
|
+
headers: {
|
|
1404
|
+
[name: string]: unknown;
|
|
1405
|
+
};
|
|
1406
|
+
content: {
|
|
1407
|
+
"application/json": {
|
|
1408
|
+
data: components["schemas"]["PrepareResponse"];
|
|
1409
|
+
};
|
|
1410
|
+
};
|
|
1411
|
+
};
|
|
1412
|
+
400: components["responses"]["BadRequest"];
|
|
1413
|
+
401: components["responses"]["Unauthorized"];
|
|
1414
|
+
429: components["responses"]["RateLimited"];
|
|
1415
|
+
};
|
|
1416
|
+
};
|
|
1417
|
+
getBurnerStatus: {
|
|
1418
|
+
parameters: {
|
|
1419
|
+
query?: never;
|
|
1420
|
+
header?: never;
|
|
1421
|
+
path: {
|
|
1422
|
+
burner_address: components["schemas"]["EvmAddress"];
|
|
1423
|
+
};
|
|
1424
|
+
cookie?: never;
|
|
1425
|
+
};
|
|
1426
|
+
requestBody?: never;
|
|
1427
|
+
responses: {
|
|
1428
|
+
/** @description Burner account status */
|
|
1429
|
+
200: {
|
|
1430
|
+
headers: {
|
|
1431
|
+
[name: string]: unknown;
|
|
1432
|
+
};
|
|
1433
|
+
content: {
|
|
1434
|
+
"application/json": {
|
|
1435
|
+
data: components["schemas"]["BurnerStatusResponse"];
|
|
1436
|
+
};
|
|
1437
|
+
};
|
|
1438
|
+
};
|
|
1439
|
+
401: components["responses"]["Unauthorized"];
|
|
1440
|
+
404: components["responses"]["NotFound"];
|
|
1441
|
+
429: components["responses"]["RateLimited"];
|
|
1442
|
+
};
|
|
1443
|
+
};
|
|
1444
|
+
disposeBurner: {
|
|
1445
|
+
parameters: {
|
|
1446
|
+
query?: never;
|
|
1447
|
+
header?: never;
|
|
1448
|
+
path: {
|
|
1449
|
+
burner_address: components["schemas"]["EvmAddress"];
|
|
1450
|
+
};
|
|
1451
|
+
cookie?: never;
|
|
1452
|
+
};
|
|
1453
|
+
requestBody?: {
|
|
1454
|
+
content: {
|
|
1455
|
+
"application/json": components["schemas"]["BurnerDisposeRequest"];
|
|
1456
|
+
};
|
|
1457
|
+
};
|
|
1458
|
+
responses: {
|
|
1459
|
+
/** @description Burner disposed */
|
|
1460
|
+
200: {
|
|
1461
|
+
headers: {
|
|
1462
|
+
[name: string]: unknown;
|
|
1463
|
+
};
|
|
1464
|
+
content: {
|
|
1465
|
+
"application/json": {
|
|
1466
|
+
data: components["schemas"]["BurnerDisposeResponse"];
|
|
1467
|
+
};
|
|
1468
|
+
};
|
|
1469
|
+
};
|
|
1470
|
+
401: components["responses"]["Unauthorized"];
|
|
1471
|
+
404: components["responses"]["NotFound"];
|
|
1472
|
+
429: components["responses"]["RateLimited"];
|
|
1473
|
+
};
|
|
1474
|
+
};
|
|
1475
|
+
getBurnerInfo: {
|
|
1476
|
+
parameters: {
|
|
1477
|
+
query?: never;
|
|
1478
|
+
header?: never;
|
|
1479
|
+
path?: never;
|
|
1480
|
+
cookie?: never;
|
|
1481
|
+
};
|
|
1482
|
+
requestBody?: never;
|
|
1483
|
+
responses: {
|
|
1484
|
+
/** @description Burner configuration */
|
|
1485
|
+
200: {
|
|
1486
|
+
headers: {
|
|
1487
|
+
[name: string]: unknown;
|
|
1488
|
+
};
|
|
1489
|
+
content: {
|
|
1490
|
+
"application/json": {
|
|
1491
|
+
data: components["schemas"]["BurnerInfoResponse"];
|
|
1492
|
+
};
|
|
1493
|
+
};
|
|
1494
|
+
};
|
|
1495
|
+
401: components["responses"]["Unauthorized"];
|
|
1496
|
+
429: components["responses"]["RateLimited"];
|
|
1497
|
+
};
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
interface ClientOptions {
|
|
1502
|
+
/** Maximum number of retries on 429 responses. Default: 3. Set to 0 to disable. */
|
|
1503
|
+
maxRetries?: number;
|
|
1504
|
+
/** Custom fetch implementation. */
|
|
1505
|
+
customFetch?: typeof globalThis.fetch;
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Create an Unlink API client with automatic retry on rate-limit (429) responses.
|
|
1509
|
+
*
|
|
1510
|
+
* The third argument accepts either a `ClientOptions` object or a bare `fetch`
|
|
1511
|
+
* function for backward compatibility.
|
|
1512
|
+
*/
|
|
1513
|
+
declare const createUnlinkClient: (baseUrl: string, apiKey: string, options?: ClientOptions | typeof globalThis.fetch) => openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
1514
|
+
|
|
1515
|
+
/** EIP-712 typed data for Permit2 PermitTransferFrom */
|
|
1516
|
+
interface Permit2TypedData {
|
|
1517
|
+
domain: {
|
|
1518
|
+
name: string;
|
|
1519
|
+
chainId: number;
|
|
1520
|
+
verifyingContract: string;
|
|
1521
|
+
};
|
|
1522
|
+
types: {
|
|
1523
|
+
PermitTransferFrom: Array<{
|
|
1524
|
+
name: string;
|
|
1525
|
+
type: string;
|
|
1526
|
+
}>;
|
|
1527
|
+
TokenPermissions: Array<{
|
|
1528
|
+
name: string;
|
|
1529
|
+
type: string;
|
|
1530
|
+
}>;
|
|
1531
|
+
};
|
|
1532
|
+
primaryType: "PermitTransferFrom";
|
|
1533
|
+
value: {
|
|
1534
|
+
permitted: {
|
|
1535
|
+
token: string;
|
|
1536
|
+
amount: string;
|
|
1537
|
+
};
|
|
1538
|
+
spender: string;
|
|
1539
|
+
nonce: string;
|
|
1540
|
+
deadline: string;
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
/** EIP-712 typed data for Permit2 PermitWitnessTransferFrom (with deposit witness). */
|
|
1544
|
+
interface Permit2WitnessTypedData {
|
|
1545
|
+
domain: {
|
|
1546
|
+
name: string;
|
|
1547
|
+
chainId: number;
|
|
1548
|
+
verifyingContract: string;
|
|
1549
|
+
};
|
|
1550
|
+
types: {
|
|
1551
|
+
PermitWitnessTransferFrom: Array<{
|
|
1552
|
+
name: string;
|
|
1553
|
+
type: string;
|
|
1554
|
+
}>;
|
|
1555
|
+
TokenPermissions: Array<{
|
|
1556
|
+
name: string;
|
|
1557
|
+
type: string;
|
|
1558
|
+
}>;
|
|
1559
|
+
DepositWitness: Array<{
|
|
1560
|
+
name: string;
|
|
1561
|
+
type: string;
|
|
1562
|
+
}>;
|
|
1563
|
+
};
|
|
1564
|
+
primaryType: "PermitWitnessTransferFrom";
|
|
1565
|
+
value: {
|
|
1566
|
+
permitted: {
|
|
1567
|
+
token: string;
|
|
1568
|
+
amount: string;
|
|
1569
|
+
};
|
|
1570
|
+
spender: string;
|
|
1571
|
+
nonce: string;
|
|
1572
|
+
deadline: string;
|
|
1573
|
+
witness: {
|
|
1574
|
+
notesHash: string;
|
|
1575
|
+
};
|
|
1576
|
+
};
|
|
1577
|
+
}
|
|
1578
|
+
/** Callback to sign EIP-712 typed data with an EVM wallet. Returns hex-encoded signature. */
|
|
1579
|
+
type SignTypedDataFn = (typedData: Permit2TypedData | Permit2WitnessTypedData) => Promise<string>;
|
|
1580
|
+
interface TransactionResult {
|
|
1581
|
+
txId: string;
|
|
1582
|
+
status: string;
|
|
1583
|
+
}
|
|
1584
|
+
interface TransferInstruction {
|
|
1585
|
+
recipientAddress: string;
|
|
1586
|
+
token: string;
|
|
1587
|
+
amount: string;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
interface UnlinkEvmTransactionRequest {
|
|
1591
|
+
to: string;
|
|
1592
|
+
data: string;
|
|
1593
|
+
value?: bigint;
|
|
1594
|
+
}
|
|
1595
|
+
interface UnlinkEvmProvider {
|
|
1596
|
+
getAddress(): Promise<string>;
|
|
1597
|
+
signTypedData(typedData: Permit2TypedData | Permit2WitnessTypedData): Promise<string>;
|
|
1598
|
+
getErc20Allowance?(params: {
|
|
1599
|
+
token: string;
|
|
1600
|
+
owner: string;
|
|
1601
|
+
spender: string;
|
|
1602
|
+
}): Promise<bigint | string>;
|
|
1603
|
+
sendTransaction?(tx: UnlinkEvmTransactionRequest): Promise<string>;
|
|
1604
|
+
}
|
|
1605
|
+
interface UnlinkSignerProviderOptions {
|
|
1606
|
+
address: string;
|
|
1607
|
+
signTypedData(typedData: Permit2TypedData | Permit2WitnessTypedData): Promise<string>;
|
|
1608
|
+
getErc20Allowance?(params: {
|
|
1609
|
+
token: string;
|
|
1610
|
+
owner: string;
|
|
1611
|
+
spender: string;
|
|
1612
|
+
}): Promise<bigint | string>;
|
|
1613
|
+
sendTransaction?(tx: UnlinkEvmTransactionRequest): Promise<string>;
|
|
1614
|
+
}
|
|
1615
|
+
interface ViemWalletClientLike {
|
|
1616
|
+
account?: {
|
|
1617
|
+
address: string;
|
|
1618
|
+
} | string;
|
|
1619
|
+
signTypedData(params: unknown): Promise<string>;
|
|
1620
|
+
sendTransaction?(params: unknown): Promise<string>;
|
|
1621
|
+
}
|
|
1622
|
+
interface ViemPublicClientLike {
|
|
1623
|
+
readContract(params: unknown): Promise<unknown>;
|
|
1624
|
+
}
|
|
1625
|
+
interface UnlinkViemProviderOptions {
|
|
1626
|
+
walletClient: ViemWalletClientLike;
|
|
1627
|
+
publicClient?: ViemPublicClientLike;
|
|
1628
|
+
address?: string;
|
|
1629
|
+
}
|
|
1630
|
+
interface EthersProviderLike {
|
|
1631
|
+
call(tx: {
|
|
1632
|
+
to: string;
|
|
1633
|
+
data: string;
|
|
1634
|
+
}): Promise<string>;
|
|
1635
|
+
}
|
|
1636
|
+
interface EthersSignerLike {
|
|
1637
|
+
provider?: EthersProviderLike | null;
|
|
1638
|
+
getAddress(): Promise<string>;
|
|
1639
|
+
signTypedData(domain: Permit2TypedData["domain"] | Permit2WitnessTypedData["domain"], types: Permit2TypedData["types"] | Permit2WitnessTypedData["types"], value: Permit2TypedData["value"] | Permit2WitnessTypedData["value"]): Promise<string>;
|
|
1640
|
+
sendTransaction?(tx: {
|
|
1641
|
+
to: string;
|
|
1642
|
+
data: string;
|
|
1643
|
+
value?: bigint;
|
|
1644
|
+
}): Promise<{
|
|
1645
|
+
hash: string;
|
|
1646
|
+
}>;
|
|
1647
|
+
}
|
|
1648
|
+
interface UnlinkEthersProviderOptions {
|
|
1649
|
+
signer: EthersSignerLike;
|
|
1650
|
+
provider?: EthersProviderLike;
|
|
1651
|
+
}
|
|
1652
|
+
declare const unlinkEvm: {
|
|
1653
|
+
fromSigner(options: UnlinkSignerProviderOptions): UnlinkEvmProvider;
|
|
1654
|
+
fromViem(options: UnlinkViemProviderOptions): UnlinkEvmProvider;
|
|
1655
|
+
fromEthers(options: UnlinkEthersProviderOptions): UnlinkEvmProvider;
|
|
1656
|
+
};
|
|
1657
|
+
|
|
1658
|
+
interface ApprovalState {
|
|
1659
|
+
token: string;
|
|
1660
|
+
owner: string;
|
|
1661
|
+
spender: string;
|
|
1662
|
+
amount: string;
|
|
1663
|
+
allowance: string;
|
|
1664
|
+
isApproved: boolean;
|
|
1665
|
+
}
|
|
1666
|
+
interface GetApprovalStateParams {
|
|
1667
|
+
evm: {
|
|
1668
|
+
getErc20Allowance: NonNullable<UnlinkEvmProvider["getErc20Allowance"]>;
|
|
1669
|
+
};
|
|
1670
|
+
token: string;
|
|
1671
|
+
owner: string;
|
|
1672
|
+
spender: string;
|
|
1673
|
+
amount: bigint | string;
|
|
1674
|
+
}
|
|
1675
|
+
interface BuildApprovalTxParams {
|
|
1676
|
+
token: string;
|
|
1677
|
+
spender: string;
|
|
1678
|
+
amount: bigint | string;
|
|
1679
|
+
}
|
|
1680
|
+
interface EnsureErc20ApprovalParams extends GetApprovalStateParams {
|
|
1681
|
+
evm: {
|
|
1682
|
+
getErc20Allowance: NonNullable<UnlinkEvmProvider["getErc20Allowance"]>;
|
|
1683
|
+
sendTransaction?: NonNullable<UnlinkEvmProvider["sendTransaction"]>;
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
type EnsureErc20ApprovalResult = {
|
|
1687
|
+
status: "already-approved";
|
|
1688
|
+
state: ApprovalState;
|
|
1689
|
+
} | {
|
|
1690
|
+
status: "submitted";
|
|
1691
|
+
state: ApprovalState;
|
|
1692
|
+
txHash: string;
|
|
1693
|
+
transaction: UnlinkEvmTransactionRequest;
|
|
1694
|
+
};
|
|
1695
|
+
declare function getApprovalState(params: GetApprovalStateParams): Promise<ApprovalState>;
|
|
1696
|
+
declare function buildApprovalTx(params: BuildApprovalTxParams): UnlinkEvmTransactionRequest;
|
|
1697
|
+
declare function ensureErc20Approval(params: EnsureErc20ApprovalParams): Promise<EnsureErc20ApprovalResult>;
|
|
1698
|
+
|
|
1699
|
+
type BalancesData = components["schemas"]["BalancesData"];
|
|
1700
|
+
type TransactionListData$1 = components["schemas"]["TransactionListData"];
|
|
1701
|
+
type TransactionStatus = components["schemas"]["TransactionStatus"];
|
|
1702
|
+
type TransactionType = components["schemas"]["TransactionType"];
|
|
1703
|
+
interface CreateUnlinkOptions {
|
|
1704
|
+
engineUrl: string;
|
|
1705
|
+
apiKey: string;
|
|
1706
|
+
account: UnlinkAccountProvider;
|
|
1707
|
+
evm?: UnlinkEvmProvider;
|
|
1708
|
+
customFetch?: typeof globalThis.fetch;
|
|
1709
|
+
}
|
|
1710
|
+
interface UnlinkDepositParams {
|
|
1711
|
+
token: string;
|
|
1712
|
+
amount: string;
|
|
1713
|
+
deadline?: number;
|
|
1714
|
+
nonce?: string;
|
|
1715
|
+
evm?: UnlinkEvmProvider;
|
|
1716
|
+
}
|
|
1717
|
+
interface UnlinkSingleTransferParams {
|
|
1718
|
+
token: string;
|
|
1719
|
+
amount: string;
|
|
1720
|
+
recipientAddress: string;
|
|
1721
|
+
transfers?: never;
|
|
1722
|
+
}
|
|
1723
|
+
interface UnlinkMultiTransferParams {
|
|
1724
|
+
token: string;
|
|
1725
|
+
amount?: never;
|
|
1726
|
+
recipientAddress?: never;
|
|
1727
|
+
transfers: Array<{
|
|
1728
|
+
recipientAddress: string;
|
|
1729
|
+
amount: string;
|
|
1730
|
+
}>;
|
|
1731
|
+
}
|
|
1732
|
+
type UnlinkTransferParams = UnlinkSingleTransferParams | UnlinkMultiTransferParams;
|
|
1733
|
+
interface UnlinkWithdrawParams {
|
|
1734
|
+
recipientEvmAddress: string;
|
|
1735
|
+
token: string;
|
|
1736
|
+
amount: string;
|
|
1737
|
+
}
|
|
1738
|
+
interface UnlinkPollOptions {
|
|
1739
|
+
intervalMs?: number;
|
|
1740
|
+
timeoutMs?: number;
|
|
1741
|
+
}
|
|
1742
|
+
interface UnlinkGetBalancesParams {
|
|
1743
|
+
token?: string;
|
|
1744
|
+
}
|
|
1745
|
+
interface UnlinkGetTransactionsParams {
|
|
1746
|
+
environment?: string;
|
|
1747
|
+
status?: TransactionStatus;
|
|
1748
|
+
type?: TransactionType;
|
|
1749
|
+
limit?: number;
|
|
1750
|
+
cursor?: string;
|
|
1751
|
+
}
|
|
1752
|
+
interface UnlinkApprovalParams {
|
|
1753
|
+
token: string;
|
|
1754
|
+
amount: string;
|
|
1755
|
+
evm?: UnlinkEvmProvider;
|
|
1756
|
+
}
|
|
1757
|
+
interface UnlinkClient {
|
|
1758
|
+
getAddress(): Promise<string>;
|
|
1759
|
+
getPublicKey(): Promise<[bigint, bigint]>;
|
|
1760
|
+
ensureRegistered(): Promise<void>;
|
|
1761
|
+
deposit(params: UnlinkDepositParams): Promise<TransactionResult>;
|
|
1762
|
+
transfer(params: UnlinkTransferParams): Promise<TransactionResult>;
|
|
1763
|
+
withdraw(params: UnlinkWithdrawParams): Promise<TransactionResult>;
|
|
1764
|
+
getBalances(params?: UnlinkGetBalancesParams): Promise<BalancesData>;
|
|
1765
|
+
getTransactions(params?: UnlinkGetTransactionsParams): Promise<TransactionListData$1>;
|
|
1766
|
+
pollTransactionStatus(txId: string, options?: UnlinkPollOptions): Promise<TransactionResult>;
|
|
1767
|
+
getApprovalState(params: UnlinkApprovalParams): Promise<ApprovalState>;
|
|
1768
|
+
buildApprovalTx(params: UnlinkApprovalParams): Promise<UnlinkEvmTransactionRequest>;
|
|
1769
|
+
ensureErc20Approval(params: UnlinkApprovalParams): Promise<EnsureErc20ApprovalResult>;
|
|
1770
|
+
}
|
|
1771
|
+
declare function createUnlink(options: CreateUnlinkOptions): UnlinkClient;
|
|
1772
|
+
|
|
1773
|
+
declare class UnlinkApiError extends Error {
|
|
1774
|
+
readonly operation: string;
|
|
1775
|
+
readonly code: string;
|
|
1776
|
+
readonly detail: string;
|
|
1777
|
+
constructor(operation: string, error: unknown);
|
|
1778
|
+
}
|
|
1779
|
+
declare class UnlinkCapabilityError extends Error {
|
|
1780
|
+
constructor(message: string);
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
type CreateUserResponse = components["schemas"]["CreateUserResponse"];
|
|
1784
|
+
type User = components["schemas"]["User"];
|
|
1785
|
+
declare function createUser(client: Client<paths>, keys: Pick<AccountKeys, "spendingPublicKey" | "viewingPrivateKey" | "nullifyingKey">): Promise<CreateUserResponse>;
|
|
1786
|
+
declare function getUser(client: Client<paths>, address: string): Promise<User>;
|
|
1787
|
+
|
|
1788
|
+
type EnvironmentInfo = components["schemas"]["EnvironmentInfo"];
|
|
1789
|
+
type Transaction = components["schemas"]["Transaction"];
|
|
1790
|
+
type TransactionListData = components["schemas"]["TransactionListData"];
|
|
1791
|
+
declare function getEnvironment(client: Client<paths>): Promise<EnvironmentInfo>;
|
|
1792
|
+
declare function getTransaction(client: Client<paths>, txId: string): Promise<Transaction>;
|
|
1793
|
+
declare function getUserTransactions(client: Client<paths>, address: string, options?: {
|
|
1794
|
+
environment?: string;
|
|
1795
|
+
status?: Transaction["status"];
|
|
1796
|
+
type?: Transaction["type"];
|
|
1797
|
+
limit?: number;
|
|
1798
|
+
cursor?: string;
|
|
1799
|
+
}): Promise<TransactionListData>;
|
|
1800
|
+
|
|
1801
|
+
declare class Permit2NonceManager {
|
|
1802
|
+
private client;
|
|
1803
|
+
private cache;
|
|
1804
|
+
private locks;
|
|
1805
|
+
private startWordFn;
|
|
1806
|
+
constructor(client: Client<paths>, startWordFn?: () => number);
|
|
1807
|
+
getNextNonce(owner: string): Promise<string>;
|
|
1808
|
+
commitNonce(_owner: string, _nonce: string): void;
|
|
1809
|
+
releaseNonce(owner: string, nonce: string): void;
|
|
1810
|
+
invalidate(owner?: string): void;
|
|
1811
|
+
private allocateNonce;
|
|
1812
|
+
private scanForUnsetBit;
|
|
1813
|
+
private fetchWindow;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
/**
|
|
1817
|
+
* Execute a deposit into the Unlink pool using the two-phase prepare/submit flow.
|
|
1818
|
+
*
|
|
1819
|
+
* 1. POST /transactions/deposit/prepare → {tx_id, notes_hash}
|
|
1820
|
+
* 2. Sign Permit2 witness typed data (binds notes_hash into signature)
|
|
1821
|
+
* 3. POST /transactions/deposit/{tx_id}/submit → {tx_id, status}
|
|
1822
|
+
*
|
|
1823
|
+
* @param client - Unlink API client from createUnlinkClient
|
|
1824
|
+
* @param params.unlinkAddress - Recipient's unlink1... address
|
|
1825
|
+
* @param params.evmAddress - Depositor's 0x... address
|
|
1826
|
+
* @param params.token - ERC-20 token address
|
|
1827
|
+
* @param params.amount - Amount as decimal string
|
|
1828
|
+
* @param params.environment - Target environment (e.g. "base-sepolia")
|
|
1829
|
+
* @param params.nonce - Permit2 nonce as decimal string. Optional if nonceManager is provided.
|
|
1830
|
+
* @param params.deadline - Permit2 deadline as unix timestamp
|
|
1831
|
+
* @param params.chainId - Chain ID (from GET /info/environment)
|
|
1832
|
+
* @param params.permit2Address - Permit2 contract address (from GET /info/environment)
|
|
1833
|
+
* @param params.poolAddress - UnlinkPool contract address (from GET /info/environment)
|
|
1834
|
+
* @param params.signTypedData - Callback to sign EIP-712 typed data with EVM wallet
|
|
1835
|
+
* @param params.nonceManager - Optional Permit2NonceManager for automatic nonce selection
|
|
1836
|
+
*/
|
|
1837
|
+
declare function deposit(client: Client<paths>, params: {
|
|
1838
|
+
unlinkAddress: string;
|
|
1839
|
+
evmAddress: string;
|
|
1840
|
+
token: string;
|
|
1841
|
+
amount: string;
|
|
1842
|
+
environment: string;
|
|
1843
|
+
nonce?: string;
|
|
1844
|
+
deadline: number;
|
|
1845
|
+
chainId: number;
|
|
1846
|
+
permit2Address: string;
|
|
1847
|
+
poolAddress: string;
|
|
1848
|
+
signTypedData: SignTypedDataFn;
|
|
1849
|
+
nonceManager?: Permit2NonceManager;
|
|
1850
|
+
}): Promise<TransactionResult>;
|
|
1851
|
+
|
|
1852
|
+
/**
|
|
1853
|
+
* Execute a private transfer: prepare → sign → submit.
|
|
1854
|
+
*
|
|
1855
|
+
* 1. Calls POST /transactions/prepare/transfer to get a message_hash
|
|
1856
|
+
* 2. Signs the message_hash with the sender's EdDSA spending key
|
|
1857
|
+
* 3. Calls POST /transactions/{tx_id}/submit with the signature
|
|
1858
|
+
*
|
|
1859
|
+
* @param client - Unlink API client from createUnlinkClient
|
|
1860
|
+
* @param params.senderKeys - Sender's account keys (from deriveAccountKeys)
|
|
1861
|
+
* @param params.transfers - Array of transfer instructions (recipient, token, amount)
|
|
1862
|
+
* @param params.environment - Target environment (e.g. "base-sepolia")
|
|
1863
|
+
*/
|
|
1864
|
+
declare function transfer(client: Client<paths>, params: {
|
|
1865
|
+
senderKeys: AccountKeys;
|
|
1866
|
+
transfers: TransferInstruction[];
|
|
1867
|
+
environment: string;
|
|
1868
|
+
}): Promise<TransactionResult>;
|
|
1869
|
+
|
|
1870
|
+
/**
|
|
1871
|
+
* Execute a private withdrawal: prepare → sign → submit.
|
|
1872
|
+
*
|
|
1873
|
+
* 1. Calls POST /transactions/prepare/withdraw to get a message_hash
|
|
1874
|
+
* 2. Signs the message_hash with the sender's EdDSA spending key
|
|
1875
|
+
* 3. Calls POST /transactions/{tx_id}/submit with the signature
|
|
1876
|
+
*
|
|
1877
|
+
* @param client - Unlink API client from createUnlinkClient
|
|
1878
|
+
* @param params.senderKeys - Sender's account keys (from deriveAccountKeys)
|
|
1879
|
+
* @param params.recipientEvmAddress - Destination 0x... EVM address
|
|
1880
|
+
* @param params.token - ERC-20 token address
|
|
1881
|
+
* @param params.amount - Amount as decimal string
|
|
1882
|
+
* @param params.environment - Target environment (e.g. "base-sepolia")
|
|
1883
|
+
*/
|
|
1884
|
+
declare function withdraw(client: Client<paths>, params: {
|
|
1885
|
+
senderKeys: AccountKeys;
|
|
1886
|
+
recipientEvmAddress: string;
|
|
1887
|
+
token: string;
|
|
1888
|
+
amount: string;
|
|
1889
|
+
environment: string;
|
|
1890
|
+
}): Promise<TransactionResult>;
|
|
1891
|
+
|
|
1892
|
+
/**
|
|
1893
|
+
* Build EIP-712 typed data for Permit2 PermitTransferFrom.
|
|
1894
|
+
*
|
|
1895
|
+
* The integrator signs the returned object with their EVM wallet
|
|
1896
|
+
* (e.g. viem's `signTypedData`, ethers' `signTypedData`).
|
|
1897
|
+
*
|
|
1898
|
+
* @param params.token - ERC-20 token address
|
|
1899
|
+
* @param params.amount - amount as decimal string
|
|
1900
|
+
* @param params.spender - UnlinkPool contract address (from GET /info/environment)
|
|
1901
|
+
* @param params.nonce - Permit2 nonce as decimal string
|
|
1902
|
+
* @param params.deadline - Unix timestamp as decimal string
|
|
1903
|
+
* @param params.chainId - Chain ID (from GET /info/environment)
|
|
1904
|
+
* @param params.permit2Address - Permit2 contract address (from GET /info/environment)
|
|
1905
|
+
*/
|
|
1906
|
+
declare function buildPermit2TypedData(params: {
|
|
1907
|
+
token: string;
|
|
1908
|
+
amount: string;
|
|
1909
|
+
spender: string;
|
|
1910
|
+
nonce: string;
|
|
1911
|
+
deadline: string;
|
|
1912
|
+
chainId: number;
|
|
1913
|
+
permit2Address: string;
|
|
1914
|
+
}): Permit2TypedData;
|
|
1915
|
+
/**
|
|
1916
|
+
* Get the next available Permit2 nonce for the given owner.
|
|
1917
|
+
*
|
|
1918
|
+
* Wraps GET /info/permit2/nonces/{owner}. Paginates through bitmap words
|
|
1919
|
+
* using `start_word` until a free nonce is found.
|
|
1920
|
+
*
|
|
1921
|
+
* For concurrent deposit workflows, use {@link Permit2NonceManager} instead.
|
|
1922
|
+
*
|
|
1923
|
+
* @throws If no available nonce is found after scanning all windows or the request fails.
|
|
1924
|
+
*/
|
|
1925
|
+
declare function getPermit2Nonce(client: Client<paths>, owner: string): Promise<string>;
|
|
1926
|
+
|
|
1927
|
+
/** Pluggable storage for burner key persistence. */
|
|
1928
|
+
interface BurnerStorage {
|
|
1929
|
+
save(address: string, privateKey: string): Promise<void>;
|
|
1930
|
+
load(address: string): Promise<string | null>;
|
|
1931
|
+
delete(address: string): Promise<void>;
|
|
1932
|
+
}
|
|
1933
|
+
/** Burner account status returned by the backend. */
|
|
1934
|
+
type BurnerStatus = components["schemas"]["BurnerStatusResponse"];
|
|
1935
|
+
/** Chain configuration for burner operations. */
|
|
1936
|
+
type BurnerInfo = components["schemas"]["BurnerInfoResponse"];
|
|
1937
|
+
/**
|
|
1938
|
+
* BurnerWallet — a disposable EOA that holds tokens outside the privacy pool
|
|
1939
|
+
* for arbitrary DeFi interactions, then deposits them back.
|
|
1940
|
+
*
|
|
1941
|
+
* Lifecycle: create → fund from pool → do DeFi → deposit back → dispose
|
|
1942
|
+
*
|
|
1943
|
+
* Key generation happens client-side; only the public address is sent to the
|
|
1944
|
+
* backend. The private key is stored via a pluggable `BurnerStorage`.
|
|
1945
|
+
*/
|
|
1946
|
+
declare class BurnerWallet {
|
|
1947
|
+
readonly address: Address;
|
|
1948
|
+
private readonly account;
|
|
1949
|
+
private readonly storage;
|
|
1950
|
+
private constructor();
|
|
1951
|
+
/** Generate a new burner with a fresh keypair. */
|
|
1952
|
+
static create(storage?: BurnerStorage): Promise<BurnerWallet>;
|
|
1953
|
+
/** Restore a burner from storage by address. Returns null if not found. */
|
|
1954
|
+
static restore(address: Address, storage: BurnerStorage): Promise<BurnerWallet | null>;
|
|
1955
|
+
/** Return a viem-compatible Account for use with WalletClient. */
|
|
1956
|
+
toViemAccount(): LocalAccount;
|
|
1957
|
+
/**
|
|
1958
|
+
* Fund this burner by withdrawing from the Unlink pool.
|
|
1959
|
+
*
|
|
1960
|
+
* Calls POST /burner/create, signs the withdrawal with EdDSA, and submits.
|
|
1961
|
+
* After the withdrawal confirms on-chain, the relayer sends ETH for gas.
|
|
1962
|
+
*/
|
|
1963
|
+
fundFromPool(client: Client<paths>, params: {
|
|
1964
|
+
senderKeys: AccountKeys;
|
|
1965
|
+
token: string;
|
|
1966
|
+
amount: string;
|
|
1967
|
+
environment: string;
|
|
1968
|
+
}): Promise<TransactionResult>;
|
|
1969
|
+
/**
|
|
1970
|
+
* Deposit tokens back to the Unlink pool from this burner.
|
|
1971
|
+
*
|
|
1972
|
+
* The caller must ensure the burner has approved Permit2 for the token
|
|
1973
|
+
* before calling this method. This uses the standard deposit flow with
|
|
1974
|
+
* the burner signing the Permit2 typed data.
|
|
1975
|
+
*/
|
|
1976
|
+
depositToPool(client: Client<paths>, params: {
|
|
1977
|
+
unlinkAddress: string;
|
|
1978
|
+
token: string;
|
|
1979
|
+
amount: string;
|
|
1980
|
+
environment: string;
|
|
1981
|
+
chainId: number;
|
|
1982
|
+
permit2Address: string;
|
|
1983
|
+
poolAddress: string;
|
|
1984
|
+
nonceManager?: Permit2NonceManager;
|
|
1985
|
+
nonce?: string;
|
|
1986
|
+
deadline: number;
|
|
1987
|
+
}): Promise<TransactionResult>;
|
|
1988
|
+
/** Check the burner's lifecycle status. */
|
|
1989
|
+
getStatus(client: Client<paths>): Promise<BurnerStatus>;
|
|
1990
|
+
/** Mark this burner as disposed, optionally linking a deposit-back tx. */
|
|
1991
|
+
dispose(client: Client<paths>, depositBackTxId?: string): Promise<void>;
|
|
1992
|
+
/** Delete the burner key from storage. Call after dispose. */
|
|
1993
|
+
deleteKey(): Promise<void>;
|
|
1994
|
+
/** Get chain configuration for burner operations. */
|
|
1995
|
+
static getInfo(client: Client<paths>): Promise<BurnerInfo>;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
export { type $defs, type AccountExportPayload, type AccountKeys, type ApprovalState, P as BN254_FIELD_ORDER, type BuildApprovalTxParams, type BurnerInfo, type BurnerStatus, type BurnerStorage, BurnerWallet, type ClientOptions, type CreateUnlinkOptions, type EdDSASignature, type EnsureErc20ApprovalParams, type EnsureErc20ApprovalResult, type EthersProviderLike, type EthersSignerLike, type GetApprovalStateParams, Permit2NonceManager, type Permit2TypedData, type Permit2WitnessTypedData, type SignTypedDataFn, type TransactionResult, type TransferInstruction, type UnlinkAccountMnemonicOptions, type UnlinkAccountProvider, type UnlinkAccountSeedOptions, UnlinkApiError, type UnlinkApprovalParams, UnlinkCapabilityError, type UnlinkClient, type UnlinkDepositParams, type UnlinkEthersProviderOptions, type UnlinkEvmProvider, type UnlinkEvmTransactionRequest, type UnlinkGetBalancesParams, type UnlinkGetTransactionsParams, type UnlinkPollOptions, type UnlinkSignerProviderOptions, type UnlinkTransferParams, type UnlinkViemProviderOptions, type UnlinkWithdrawParams, type ViemPublicClientLike, type ViemWalletClientLike, buildApprovalTx, buildPermit2TypedData, type components, createUnlink, createUnlinkClient, createUser, decodeAddress, deposit, deriveAccountKeys, eddsaPublicKey, eddsaSign, eddsaVerify, encodeAddress, ensureErc20Approval, fromBytesBE, fromDecimal, fromHex, getApprovalState, getEnvironment, getPermit2Nonce, getTransaction, getUser, getUserTransactions, mod, type operations, type paths, poseidon, toBytesBE, toDecimal, transfer, unlinkAccount, unlinkEvm, viewingPublicKey, viewingPublicKeyFromHex, type webhooks, withdraw };
|