@tetherto/wdk-wallet 1.0.0-beta.13 → 1.0.0-beta.15

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.
@@ -0,0 +1,640 @@
1
+ /** @interface */
2
+ export interface ISdaProtocol {
3
+ /**
4
+ * Lists the conversion routes the protocol supports: source chains, accepted input tokens, output assets and
5
+ * per-route deposit limits. A protocol that discovers routes by blockchain pairs might require the `sourceChain`
6
+ * and `destinationChain` options to be set.
7
+ *
8
+ * @param {SdaRoutesOptions} [options] - Optional filters for route discovery.
9
+ * @returns {Promise<SdaRoute[]>} The supported routes.
10
+ * @throws {ValueError} If the protocol discovers routes by blockchain pairs and the source or destination blockchain
11
+ * is not set.
12
+ */
13
+ getSupportedRoutes(options?: SdaRoutesOptions): Promise<SdaRoute[]>;
14
+ /**
15
+ * Fetches a non-binding quote (estimate) for a deposit — what a given deposit would deliver.
16
+ *
17
+ * @param {SdaDepositOptions} options - The quote options.
18
+ * @returns {Promise<SdaDepositQuote>} The quoted deposit details.
19
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
20
+ * @throws {ValueError} If the protocol requires an output asset and none is provided.
21
+ */
22
+ quoteDeposit(options: SdaDepositOptions): Promise<SdaDepositQuote>;
23
+ /**
24
+ * Creates deposit addresses for the given route and destination, ready to receive per the protocol's activation
25
+ * lifecycle — a protocol that activates addresses also activates the created address so it is monitored. Returns
26
+ * one entry per distinct address: a protocol that issues a single address across a chain family returns one entry
27
+ * covering all of `sourceChains`, while a protocol that issues one address per source chain returns one entry each.
28
+ *
29
+ * @param {SdaCreateDepositAddressOptions} options - The address creation options.
30
+ * @returns {Promise<SdaDepositAddress[]>} The created deposit addresses, one per distinct address.
31
+ * @throws {ValueError} If `destinationAddress` is omitted and no account was bound at construction.
32
+ * @throws {ValueError} If the protocol requires an output asset and none is provided.
33
+ */
34
+ createDepositAddress(options: SdaCreateDepositAddressOptions): Promise<SdaDepositAddress[]>;
35
+ /**
36
+ * Derives a deposit address client-side, without any protocol call and without activating or monitoring it —
37
+ * used to verify (derive + compare) or recover an address for a self-custodial protocol.
38
+ *
39
+ * @param {SdaCreateDepositAddressOptions} options - The same options passed to
40
+ * {@link ISdaProtocol#createDepositAddress}; a protocol needing extra derivation inputs declares them on its own
41
+ * options type (which extends `SdaCreateDepositAddressOptions`).
42
+ * @returns {Promise<string>} The derived deposit address.
43
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
44
+ * @throws {ValueError} If `destinationAddress` is omitted and no account was bound at construction.
45
+ */
46
+ deriveDepositAddress(options: SdaCreateDepositAddressOptions): Promise<string>;
47
+ /**
48
+ * Looks up an existing deposit address by its identifier — the `SdaDepositAddress.id` returned by
49
+ * {@link ISdaProtocol#createDepositAddress}, which round-trips any chain context the protocol needs.
50
+ *
51
+ * @param {string} id - The deposit-address identifier returned in `SdaDepositAddress.id` (round-trips any chain
52
+ * context the protocol needs).
53
+ * @returns {Promise<SdaDepositAddress>} The deposit address descriptor.
54
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
55
+ * @throws {NoSuchElementError} If no such address exists.
56
+ */
57
+ getDepositAddress(id: string): Promise<SdaDepositAddress>;
58
+ /**
59
+ * Refreshes the activation of a deposit address so the protocol keeps monitoring it.
60
+ *
61
+ * @param {string} id - The deposit-address identifier returned in `SdaDepositAddress.id`.
62
+ * @returns {Promise<SdaDepositAddress>} The refreshed deposit address descriptor (with the new `expiry`).
63
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
64
+ */
65
+ renewDepositAddress(id: string): Promise<SdaDepositAddress>;
66
+ /**
67
+ * Lists the deposits observed at a deposit address.
68
+ *
69
+ * @param {string} address - The deposit address to list transfers for.
70
+ * @param {SdaTransfersOptions} [options] - Optional pagination/filtering, plus `sourceChain` for protocols that key
71
+ * addresses by (address, chain).
72
+ * @returns {Promise<SdaTransfer[]>} The transfers for the address.
73
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
74
+ */
75
+ getTransfers(address: string, options?: SdaTransfersOptions): Promise<SdaTransfer[]>;
76
+ /**
77
+ * Lists transfers aggregated by recipient — every deposit routed to the given recipient across all of that
78
+ * recipient's deposit addresses and source chains.
79
+ *
80
+ * @param {Blockchain} destinationChain - The destination chain the transfers are delivered to.
81
+ * @param {string} recipient - The recipient (destination) address to aggregate transfers for.
82
+ * @param {SdaTransfersOptions} [options] - Optional pagination/filtering.
83
+ * @returns {Promise<SdaTransfer[]>} The transfers routed to the recipient.
84
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
85
+ */
86
+ getTransfersByRecipient(destinationChain: Blockchain, recipient: string, options?: SdaTransfersOptions): Promise<SdaTransfer[]>;
87
+ /**
88
+ * Retrieves a single transfer by its identifier.
89
+ *
90
+ * @param {string} id - The transfer identifier.
91
+ * @returns {Promise<SdaTransfer>} The transfer's current status.
92
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
93
+ * @throws {NoSuchElementError} If no such transfer exists.
94
+ */
95
+ getTransfer(id: string): Promise<SdaTransfer>;
96
+ /**
97
+ * Recovers a deposit or address that was not picked up automatically, using the protocol's recovery mode.
98
+ *
99
+ * @param {SdaRecoveryOptions} options - The recovery options.
100
+ * @returns {Promise<SdaRecoveryResult>} The recovery outcome.
101
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
102
+ */
103
+ recoverDepositAddress(options: SdaRecoveryOptions): Promise<SdaRecoveryResult>;
104
+ /**
105
+ * Disables a deposit address so it no longer accepts deposits.
106
+ *
107
+ * @param {string} id - The deposit-address identifier returned in `SdaDepositAddress.id` (round-trips any chain
108
+ * context the protocol needs).
109
+ * @returns {Promise<void>} Resolves once the address has been disabled.
110
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
111
+ */
112
+ disableDepositAddress(id: string): Promise<void>;
113
+ }
114
+ /**
115
+ * Abstract base class for "Smart Deposit Address" (SDA) protocols.
116
+ *
117
+ * @abstract
118
+ * @implements {ISdaProtocol}
119
+ */
120
+ export default abstract class SdaProtocol implements ISdaProtocol {
121
+ /**
122
+ * Creates a new SDA protocol without binding it to a wallet account.
123
+ *
124
+ * @overload
125
+ * @param {undefined} [account] - The wallet account to use to interact with the protocol.
126
+ */
127
+ constructor(account?: undefined);
128
+ /**
129
+ * Creates a new read-only SDA protocol.
130
+ *
131
+ * @overload
132
+ * @param {IWalletAccountReadOnly} account - The wallet account to use to interact with the protocol.
133
+ */
134
+ constructor(account: IWalletAccountReadOnly);
135
+ /**
136
+ * Creates a new SDA protocol.
137
+ *
138
+ * @overload
139
+ * @param {IWalletAccount} account - The wallet account to use to interact with the protocol.
140
+ */
141
+ constructor(account: IWalletAccount);
142
+ /**
143
+ * The wallet account to use to interact with the protocol. The account's address is the default delivery
144
+ * destination for created addresses.
145
+ *
146
+ * @protected
147
+ * @type {IWalletAccountReadOnly | IWalletAccount | undefined}
148
+ */
149
+ protected _account: IWalletAccountReadOnly | IWalletAccount | undefined;
150
+ /**
151
+ * Lists the conversion routes the protocol supports: source chains, accepted input tokens, output assets and
152
+ * per-route deposit limits. A protocol that discovers routes by blockchain pairs might require the `sourceChain`
153
+ * and `destinationChain` options to be set.
154
+ *
155
+ * @abstract
156
+ * @param {SdaRoutesOptions} [options] - Optional filters for route discovery.
157
+ * @returns {Promise<SdaRoute[]>} The supported routes.
158
+ * @throws {ValueError} If the protocol discovers routes by blockchain pairs and the source or destination blockchain
159
+ * is not set.
160
+ */
161
+ getSupportedRoutes(options?: SdaRoutesOptions): Promise<SdaRoute[]>;
162
+ /**
163
+ * Fetches a non-binding quote (estimate) for a deposit — what a given deposit would deliver.
164
+ *
165
+ * @param {SdaDepositOptions} options - The quote options.
166
+ * @returns {Promise<SdaDepositQuote>} The quoted deposit details.
167
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
168
+ * @throws {ValueError} If the protocol requires an output asset and none is provided.
169
+ */
170
+ quoteDeposit(options: SdaDepositOptions): Promise<SdaDepositQuote>;
171
+ /**
172
+ * Creates deposit addresses for the given route and destination, ready to receive per the protocol's activation
173
+ * lifecycle — a protocol that activates addresses also activates the created address so it is monitored. Returns
174
+ * one entry per distinct address: a protocol that issues a single address across a chain family returns one entry
175
+ * covering all of `sourceChains`, while a protocol that issues one address per source chain returns one entry each.
176
+ *
177
+ * @abstract
178
+ * @param {SdaCreateDepositAddressOptions} options - The address creation options.
179
+ * @returns {Promise<SdaDepositAddress[]>} The created deposit addresses, one per distinct address.
180
+ * @throws {ValueError} If `destinationAddress` is omitted and no account was bound at construction.
181
+ * @throws {ValueError} If the protocol requires an output asset and none is provided.
182
+ */
183
+ createDepositAddress(options: SdaCreateDepositAddressOptions): Promise<SdaDepositAddress[]>;
184
+ /**
185
+ * Derives a deposit address client-side, without any protocol call and without activating or monitoring it —
186
+ * used to verify (derive + compare) or recover an address for a self-custodial protocol.
187
+ *
188
+ * @param {SdaCreateDepositAddressOptions} options - The same options passed to
189
+ * {@link ISdaProtocol#createDepositAddress}; a protocol needing extra derivation inputs declares them on its own
190
+ * options type (which extends `SdaCreateDepositAddressOptions`).
191
+ * @returns {Promise<string>} The derived deposit address.
192
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
193
+ * @throws {ValueError} If `destinationAddress` is omitted and no account was bound at construction.
194
+ */
195
+ deriveDepositAddress(options: SdaCreateDepositAddressOptions): Promise<string>;
196
+ /**
197
+ * Looks up an existing deposit address by its identifier — the `SdaDepositAddress.id` returned by
198
+ * {@link ISdaProtocol#createDepositAddress}, which round-trips any chain context the protocol needs.
199
+ *
200
+ * @param {string} id - The deposit-address identifier returned in `SdaDepositAddress.id` (round-trips any chain
201
+ * context the protocol needs).
202
+ * @returns {Promise<SdaDepositAddress>} The deposit address descriptor.
203
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
204
+ * @throws {NoSuchElementError} If no such address exists.
205
+ */
206
+ getDepositAddress(id: string): Promise<SdaDepositAddress>;
207
+ /**
208
+ * Refreshes the activation of a deposit address so the protocol keeps monitoring it.
209
+ *
210
+ * @param {string} id - The deposit-address identifier returned in `SdaDepositAddress.id`.
211
+ * @returns {Promise<SdaDepositAddress>} The refreshed deposit address descriptor (with the new `expiry`).
212
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
213
+ */
214
+ renewDepositAddress(id: string): Promise<SdaDepositAddress>;
215
+ /**
216
+ * Lists the deposits observed at a deposit address.
217
+ *
218
+ * @param {string} address - The deposit address to list transfers for.
219
+ * @param {SdaTransfersOptions} [options] - Optional pagination/filtering, plus `sourceChain` for protocols that key
220
+ * addresses by (address, chain).
221
+ * @returns {Promise<SdaTransfer[]>} The transfers for the address.
222
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
223
+ */
224
+ getTransfers(address: string, options?: SdaTransfersOptions): Promise<SdaTransfer[]>;
225
+ /**
226
+ * Lists transfers aggregated by recipient — every deposit routed to the given recipient across all of that
227
+ * recipient's deposit addresses and source chains.
228
+ *
229
+ * @param {Blockchain} destinationChain - The destination chain the transfers are delivered to.
230
+ * @param {string} recipient - The recipient (destination) address to aggregate transfers for.
231
+ * @param {SdaTransfersOptions} [options] - Optional pagination/filtering.
232
+ * @returns {Promise<SdaTransfer[]>} The transfers routed to the recipient.
233
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
234
+ */
235
+ getTransfersByRecipient(destinationChain: Blockchain, recipient: string, options?: SdaTransfersOptions): Promise<SdaTransfer[]>;
236
+ /**
237
+ * Retrieves a single transfer by its identifier.
238
+ *
239
+ * @param {string} id - The transfer identifier.
240
+ * @returns {Promise<SdaTransfer>} The transfer's current status.
241
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
242
+ * @throws {NoSuchElementError} If no such transfer exists.
243
+ */
244
+ getTransfer(id: string): Promise<SdaTransfer>;
245
+ /**
246
+ * Recovers a deposit or address that was not picked up automatically, using the protocol's recovery mode.
247
+ *
248
+ * @param {SdaRecoveryOptions} options - The recovery options.
249
+ * @returns {Promise<SdaRecoveryResult>} The recovery outcome.
250
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
251
+ */
252
+ recoverDepositAddress(options: SdaRecoveryOptions): Promise<SdaRecoveryResult>;
253
+ /**
254
+ * Disables a deposit address so it no longer accepts deposits.
255
+ *
256
+ * @param {string} id - The deposit-address identifier returned in `SdaDepositAddress.id` (round-trips any chain
257
+ * context the protocol needs).
258
+ * @returns {Promise<void>} Resolves once the address has been disabled.
259
+ * @throws {UnsupportedOperationError} If the protocol does not support this operation.
260
+ */
261
+ disableDepositAddress(id: string): Promise<void>;
262
+ }
263
+ export type IWalletAccountReadOnly = import("../wallet-account-read-only.js").IWalletAccountReadOnly;
264
+ export type IWalletAccount = import("../wallet-account.js").IWalletAccount;
265
+ export type ValueError = import("../errors.js").ValueError;
266
+ export type NoSuchElementError = import("../errors.js").NoSuchElementError;
267
+ /**
268
+ * A blockchain identifier: a numeric chain id (e.g. `1`) or a protocol-specific chain name (e.g. `'ethereum'`).
269
+ */
270
+ export type Blockchain = string | number;
271
+ /**
272
+ * A normalized token reference. `token` is the identifier the protocol expects in SDA calls; `address` is the
273
+ * on-chain contract address when applicable (absent for native gas tokens).
274
+ */
275
+ export type SdaToken = {
276
+ /**
277
+ * - The protocol-specific token identifier to use in SDA calls.
278
+ */
279
+ token: string;
280
+ /**
281
+ * - The chain on which the token lives.
282
+ */
283
+ chain: Blockchain;
284
+ /**
285
+ * - The token symbol (e.g., 'USDC', 'USDT').
286
+ */
287
+ symbol: string;
288
+ /**
289
+ * - The number of decimal places for the token's base unit.
290
+ */
291
+ decimals: number;
292
+ /**
293
+ * - The token contract address, if applicable.
294
+ */
295
+ address?: string;
296
+ /**
297
+ * - The token's full name.
298
+ */
299
+ name?: string;
300
+ };
301
+ /**
302
+ * Per-route deposit limits, denominated in the base unit of the route's input token. Either bound may be absent
303
+ * when the protocol does not enforce it; a protocol that only enforces limits in another denomination (e.g. USD)
304
+ * omits `limits` rather than converting.
305
+ */
306
+ export type SdaDepositAddressLimits = {
307
+ /**
308
+ * - Minimum deposit amount, in the input token's base unit.
309
+ */
310
+ min?: number | bigint;
311
+ /**
312
+ * - Maximum deposit amount, in the input token's base unit.
313
+ */
314
+ max?: number | bigint;
315
+ };
316
+ /**
317
+ * Optional filters for narrowing route discovery.
318
+ */
319
+ export type SdaRoutesOptions = {
320
+ /**
321
+ * - Restrict to routes that accept deposits from this chain.
322
+ */
323
+ sourceChain?: Blockchain;
324
+ /**
325
+ * - Restrict to routes that accept this input token.
326
+ */
327
+ sourceToken?: string;
328
+ /**
329
+ * - Restrict to routes that deliver to this chain.
330
+ */
331
+ destinationChain?: Blockchain;
332
+ /**
333
+ * - Restrict to routes that deliver this asset.
334
+ */
335
+ outputAsset?: string;
336
+ };
337
+ /**
338
+ * A supported conversion route: one or more source chains and their accepted input tokens, the destination chain,
339
+ * and the asset delivered there.
340
+ */
341
+ export type SdaRoute = {
342
+ /**
343
+ * - The source chains this route accepts deposits from. A list because some
344
+ * protocols issue one address valid across a VM family.
345
+ */
346
+ sourceChains: Blockchain[];
347
+ /**
348
+ * - The deposit tokens accepted on the source side.
349
+ */
350
+ inputTokens: SdaToken[];
351
+ /**
352
+ * - The chain the converted asset is delivered to.
353
+ */
354
+ destinationChain: Blockchain;
355
+ /**
356
+ * - The asset delivered to the destination (e.g., USDT). If unset, the route
357
+ * delivers each input token as its own equivalent on the destination chain.
358
+ */
359
+ outputAsset?: SdaToken;
360
+ /**
361
+ * - Deposit limits for this route.
362
+ */
363
+ limits?: SdaDepositAddressLimits;
364
+ /**
365
+ * - Whether addresses issued for this route can receive more than one deposit.
366
+ */
367
+ reusable?: boolean;
368
+ /**
369
+ * - Typical end-to-end duration in seconds.
370
+ */
371
+ estimatedDuration?: number;
372
+ };
373
+ /**
374
+ * Options for fetching a deposit quote — a non-binding estimate of what a given deposit would deliver.
375
+ */
376
+ export type SdaDepositOptions = {
377
+ /**
378
+ * - The chain the deposit originates from.
379
+ */
380
+ sourceChain: Blockchain;
381
+ /**
382
+ * - The protocol identifier of the token being deposited.
383
+ */
384
+ inputToken: string;
385
+ /**
386
+ * - The chain the converted asset is delivered to.
387
+ */
388
+ destinationChain: Blockchain;
389
+ /**
390
+ * - The protocol identifier of the asset to deliver. Omit for protocols that deliver each input token as its
391
+ * own equivalent.
392
+ */
393
+ outputAsset?: string;
394
+ /**
395
+ * - The amount to deposit, in the input token's base unit.
396
+ */
397
+ inputAmount: number | bigint;
398
+ };
399
+ /**
400
+ * The category of a fee charged by the protocol.
401
+ */
402
+ export type SdaFeeType = "network" | "protocol" | "affiliate" | "other";
403
+ /**
404
+ * A single itemised fee.
405
+ */
406
+ export type SdaFee = {
407
+ /**
408
+ * - The category of the fee.
409
+ */
410
+ type: SdaFeeType;
411
+ /**
412
+ * - The fee amount, in the fee token's base unit.
413
+ */
414
+ amount: bigint;
415
+ /**
416
+ * - The token in which the fee is denominated.
417
+ */
418
+ token: string;
419
+ /**
420
+ * - The chain on which the fee is charged.
421
+ */
422
+ chain?: Blockchain;
423
+ /**
424
+ * - Whether the fee is already reflected in the quoted output amount.
425
+ */
426
+ included?: boolean;
427
+ /**
428
+ * - A human-readable description of the fee.
429
+ */
430
+ description?: string;
431
+ };
432
+ /**
433
+ * A non-binding estimate of the asset delivered for a given deposit.
434
+ */
435
+ export type SdaDepositQuote = {
436
+ /**
437
+ * - The chain the deposit originates from.
438
+ */
439
+ inputChain: Blockchain;
440
+ /**
441
+ * - The protocol identifier of the deposited token.
442
+ */
443
+ inputToken: string;
444
+ /**
445
+ * - The amount deposited, in the input token's base unit.
446
+ */
447
+ inputAmount: bigint;
448
+ /**
449
+ * - The chain the converted asset is delivered to.
450
+ */
451
+ destinationChain: Blockchain;
452
+ /**
453
+ * - The protocol identifier of the delivered asset.
454
+ */
455
+ outputAsset: string;
456
+ /**
457
+ * - The estimated amount delivered, in the destination asset's base unit.
458
+ */
459
+ outputAmount: bigint;
460
+ /**
461
+ * - Itemised fee breakdown.
462
+ */
463
+ fees: SdaFee[];
464
+ /**
465
+ * - The effective conversion rate as a string, to avoid precision loss.
466
+ */
467
+ rate?: string;
468
+ /**
469
+ * - Unix timestamp (seconds) at which the quote expires.
470
+ */
471
+ expiry?: number;
472
+ /**
473
+ * - The protocol quote identifier, if the protocol issues one.
474
+ */
475
+ id?: string;
476
+ };
477
+ /**
478
+ * Options for creating a deposit address.
479
+ */
480
+ export type SdaCreateDepositAddressOptions = {
481
+ /**
482
+ * - One or more source chains the address should accept deposits from. Protocols
483
+ * that issue one address per VM family use the full list; single-chain protocols use a one-element list.
484
+ */
485
+ sourceChains: Blockchain[];
486
+ /**
487
+ * - The chain the converted asset is delivered to.
488
+ */
489
+ destinationChain: Blockchain;
490
+ /**
491
+ * - The protocol identifier of the asset to deliver (e.g., USDT). Omit for protocols that deliver each input
492
+ * token as its own equivalent.
493
+ */
494
+ outputAsset?: string;
495
+ /**
496
+ * - The address that receives the delivered asset. Defaults to the bound
497
+ * account's address.
498
+ */
499
+ destinationAddress?: string;
500
+ };
501
+ /**
502
+ * A deposit address plus its normalized descriptor: where it accepts deposits from, what it accepts, where it
503
+ * delivers, and its lifecycle metadata.
504
+ */
505
+ export type SdaDepositAddress = {
506
+ /**
507
+ * - The deposit address the user sends funds to.
508
+ */
509
+ address: string;
510
+ /**
511
+ * - The protocol identifier for this SDA, used for status, recovery and disabling.
512
+ */
513
+ id: string;
514
+ /**
515
+ * - The chains this address accepts deposits from.
516
+ */
517
+ sourceChains: Blockchain[];
518
+ /**
519
+ * - The tokens this address accepts.
520
+ */
521
+ supportedInputTokens: SdaToken[];
522
+ /**
523
+ * - The chain the converted asset is delivered to.
524
+ */
525
+ destinationChain: Blockchain;
526
+ /**
527
+ * - The asset delivered to the destination. If unset, the address delivers each input token as its own
528
+ * equivalent on the destination chain.
529
+ */
530
+ outputAsset?: SdaToken;
531
+ /**
532
+ * - The resolved address that receives the delivered asset.
533
+ */
534
+ destinationAddress: string;
535
+ /**
536
+ * - Deposit limits for this address.
537
+ */
538
+ limits?: SdaDepositAddressLimits;
539
+ /**
540
+ * - Whether the address can receive more than one deposit.
541
+ */
542
+ reusable: boolean;
543
+ /**
544
+ * - Unix timestamp (seconds) at which the address's activation expires, when the protocol's
545
+ * address activation is time-limited.
546
+ */
547
+ expiry?: number;
548
+ };
549
+ /**
550
+ * The lifecycle status of a deposit/transfer through an SDA.
551
+ */
552
+ export type SdaTransferStatus = "pending" | "detected" | "processing" | "completed" | "failed" | "refund-pending" | "refunded" | "expired";
553
+ /**
554
+ * A single deposit observed at, and processed through, an SDA.
555
+ */
556
+ export type SdaTransfer = {
557
+ /**
558
+ * - The protocol identifier for this transfer.
559
+ */
560
+ id: string;
561
+ /**
562
+ * - The current status of the transfer.
563
+ */
564
+ status: SdaTransferStatus;
565
+ };
566
+ /**
567
+ * Optional pagination/filtering for transfer history.
568
+ */
569
+ export type SdaTransfersOptions = {
570
+ /**
571
+ * - The source chain of the deposit address, required by protocols that key
572
+ * addresses by (address, chain).
573
+ */
574
+ sourceChain?: Blockchain;
575
+ /**
576
+ * - The maximum number of transfers to return.
577
+ */
578
+ limit?: number;
579
+ /**
580
+ * - The number of transfers to skip, for offset-based pagination.
581
+ */
582
+ skip?: number;
583
+ /**
584
+ * - Restrict to transfers in this status.
585
+ */
586
+ status?: SdaTransferStatus;
587
+ };
588
+ /**
589
+ * Recover a deposit by the SDA identifier.
590
+ */
591
+ export type SdaRecoverById = {
592
+ /**
593
+ * - The protocol SDA identifier (the `SdaDepositAddress.id`).
594
+ */
595
+ id: string;
596
+ };
597
+ /**
598
+ * Recover a deposit by its deposit address.
599
+ */
600
+ export type SdaRecoverByAddress = {
601
+ /**
602
+ * - The deposit address to reindex.
603
+ */
604
+ address: string;
605
+ /**
606
+ * - The chain of the deposit address, required by protocols that key addresses by
607
+ * (address, chain).
608
+ */
609
+ sourceChain?: Blockchain;
610
+ };
611
+ /**
612
+ * Options for re-processing a deposit that was not picked up automatically (`reindex`). A caller identifies the
613
+ * deposit either by SDA id or by its deposit address.
614
+ */
615
+ export type SdaRecoveryOptions = SdaRecoverById | SdaRecoverByAddress;
616
+ /**
617
+ * The outcome of a recovery attempt.
618
+ */
619
+ export type SdaRecoveryResult = {
620
+ /**
621
+ * - The result of the reindex attempt.
622
+ */
623
+ status: "reindexed" | "pending" | "failed";
624
+ /**
625
+ * - The address that was reindexed.
626
+ */
627
+ address?: string;
628
+ /**
629
+ * - The protocol SDA identifier.
630
+ */
631
+ id?: string;
632
+ /**
633
+ * - The transfer that was recovered, if one resulted.
634
+ */
635
+ transfer?: SdaTransfer;
636
+ /**
637
+ * - A human-readable description of the outcome.
638
+ */
639
+ message?: string;
640
+ };
@@ -86,6 +86,10 @@ type SwapCommonOptions = {
86
86
  * - The address that will receive the output tokens. If not set, the account itself will receive the funds.
87
87
  */
88
88
  to?: string;
89
+ /**
90
+ * - The minimum acceptable amount of destination tokens to receive (in base unit).
91
+ */
92
+ minAmountOut?: number | bigint;
89
93
  };
90
94
  type SwapBuyOptions = {
91
95
  /**