@tetherto/wdk-wallet 1.0.0-beta.2 → 1.0.0-beta.21

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