@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,401 @@
1
+ // Copyright 2024 Tether Operations Limited
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ 'use strict'
15
+
16
+ import { NotImplementedError } from './errors.js'
17
+
18
+ /** @typedef {import('../wallet-account-read-only.js').IWalletAccountReadOnly} IWalletAccountReadOnly */
19
+
20
+ /** @typedef {import('../wallet-account.js').IWalletAccount} IWalletAccount */
21
+
22
+ /** @typedef {import('./errors.js').AccountRequiredError} AccountRequiredError */
23
+ /** @typedef {import('./errors.js').BuyError} BuyError */
24
+ /** @typedef {import('./errors.js').MaximumFeeExceededError} MaximumFeeExceededError */
25
+ /** @typedef {import('./errors.js').NoSuchElementError} NoSuchElementError */
26
+ /** @typedef {import('./errors.js').ReadOnlyAccountRequiredError} ReadOnlyAccountRequiredError */
27
+ /** @typedef {import('./errors.js').ProviderError} ProviderError */
28
+ /** @typedef {import('./errors.js').ProviderRequiredError} ProviderRequiredError */
29
+ /** @typedef {import('./errors.js').SellError} SellError */
30
+ /** @typedef {import('./errors.js').ValueError} ValueError */
31
+
32
+ /**
33
+ * Standardized status for an on/off-ramp transaction.
34
+ *
35
+ * @typedef {'in_progress' | 'failed' | 'completed'} FiatTransactionStatus
36
+ */
37
+
38
+ /**
39
+ * A protocol-agnostic, standardized object representing the details of an on/off-ramp transaction.
40
+ *
41
+ * @typedef {Object} FiatTransactionDetail
42
+ * @property {FiatTransactionStatus} status - The current status of the transaction.
43
+ * @property {string} cryptoAsset - The provider-specific code of the crypto asset (e.g., 'btc').
44
+ * @property {string} fiatCurrency - The currency's ISO 4217 code (e.g., 'USD').
45
+ */
46
+
47
+ /**
48
+ * A protocol-agnostic, standardized object representing a supported crypto asset.
49
+ *
50
+ * @typedef {Object} SupportedCryptoAsset
51
+ * @property {string} code - Provider-specific asset code for the crypto asset.
52
+ * @property {string} networkCode - The network code for the asset, if applicable (e.g., 'ethereum', 'tron').
53
+ * @property {number} decimals - The on-chain number of decimal places for the asset's base unit (e.g., 18 for ETH).
54
+ * @property {string} [name] - The asset's full name (e.g., 'Bitcoin').
55
+ */
56
+
57
+ /**
58
+ * A protocol-agnostic, standardized object representing a supported fiat currency.
59
+ * @typedef {Object} SupportedFiatCurrency
60
+ * @property {string} code - The currency's ISO 4217 code (e.g., 'USD').
61
+ * @property {number} decimals - The number of decimal places for the currency's smallest unit (e.g., 2 for USD, 0 for JPY).
62
+ * @property {string} [name] - The currency's full name (e.g., 'United States Dollar').
63
+ */
64
+
65
+ /**
66
+ * A protocol-agnostic, standardized object representing a supported country.
67
+ * @typedef {Object} SupportedCountry
68
+ * @property {string} code - The country's ISO 3166-1 alpha-2 or alpha-3 code.
69
+ * @property {boolean} isBuyAllowed - Whether buying is supported in this country.
70
+ * @property {boolean} isSellAllowed - Whether selling is supported in this country.
71
+ * @property {string} [name] - The country's common name.
72
+ */
73
+
74
+ /**
75
+ * @typedef {BuyCommonOptions & (BuyExactCryptoAmountOptions | BuyWithFiatAmountOptions)} BuyOptions
76
+ */
77
+
78
+ /**
79
+ * @typedef {Object} BuyCommonOptions
80
+ * @property {string} cryptoAsset - The provider-specific code of the crypto asset to purchase.
81
+ * @property {string} fiatCurrency - The currency's ISO 4217 code (e.g., 'USD').
82
+ * @property {string} [recipient] - The wallet address to receive the purchased crypto asset. Defaults to the account's address.
83
+ */
84
+
85
+ /**
86
+ * @typedef {Object} BuyExactCryptoAmountOptions
87
+ * @property {number | bigint} cryptoAmount - The amount of crypto asset to buy, in its base unit (e.g., wei for ETH).
88
+ * @property {never} [fiatAmount] - The amount of fiat currency to spend, in its smallest unit (e.g., cents for USD).
89
+ */
90
+
91
+ /**
92
+ * @typedef {Object} BuyWithFiatAmountOptions
93
+ * @property {number | bigint} fiatAmount - The amount of fiat currency to spend, in its smallest unit (e.g., cents for USD).
94
+ * @property {never} [cryptoAmount] - The amount of crypto asset to buy, in its base unit (e.g., wei for ETH).
95
+ */
96
+
97
+ /**
98
+ * @typedef {Object} BuyResult
99
+ * @property {string} buyUrl - The URL for the user to complete the purchase.
100
+ */
101
+
102
+ /**
103
+ * @typedef {SellCommonOptions & (SellExactCryptoAmountOptions | SellForFiatAmountOptions)} SellOptions
104
+ */
105
+
106
+ /**
107
+ * @typedef {Object} SellCommonOptions
108
+ * @property {string} cryptoAsset - The provider-specific code of the crypto asset to sell.
109
+ * @property {string} fiatCurrency - The currency's ISO 4217 code (e.g., 'USD').
110
+ * @property {string} [refundAddress] - The wallet address to receive refunds in case of failure. Defaults to the account's address.
111
+ */
112
+
113
+ /**
114
+ * @typedef {Object} SellExactCryptoAmountOptions
115
+ * @property {number | bigint} cryptoAmount - The amount of crypto asset to sell, in its base unit (e.g., wei for ETH).
116
+ * @property {never} [fiatAmount] - The amount of fiat currency to receive, in its smallest unit (e.g., cents for USD).
117
+ */
118
+
119
+ /**
120
+ * @typedef {Object} SellForFiatAmountOptions
121
+ * @property {number | bigint} fiatAmount - The amount of fiat currency to receive, in its smallest unit (e.g., cents for USD).
122
+ * @property {never} [cryptoAmount] - The amount of crypto asset to sell, in its base unit (e.g., wei for ETH).
123
+ */
124
+
125
+ /**
126
+ * @typedef {Object} SellResult
127
+ * @property {string} sellUrl - The URL for the user to complete the sale.
128
+ */
129
+
130
+ /**
131
+ * A protocol-agnostic, standardized object representing a quote for an on/off-ramp transaction.
132
+ *
133
+ * @typedef {Object} FiatQuote
134
+ * @property {bigint} cryptoAmount - The amount of the crypto asset, in its base unit (e.g., wei).
135
+ * @property {bigint} fiatAmount - The amount of the fiat currency, in its smallest unit (e.g., cents).
136
+ * @property {bigint} fee - The fee charged for the transaction, denominated in the smallest unit of the fiat currency.
137
+ * @property {string} rate - The effective exchange rate, expressed as a string to avoid precision loss (e.g., a rate of "3000.50" for ETH/USD means 1 ETH = 3000.50 USD). Note: This rate applies to the standard units (e.g., ETH and USD).
138
+ */
139
+
140
+ /** @interface */
141
+ export class IFiatProtocol {
142
+ /**
143
+ * Gets a quote for a crypto asset purchase.
144
+ *
145
+ * @param {Omit<BuyOptions, 'recipient'>} options - The options for the buy operation.
146
+ * @returns {Promise<FiatQuote>} A quote for the transaction.
147
+ * @throws {ReadOnlyAccountRequiredError} If the protocol requires a read-only or full account to quote the costs of a purchase.
148
+ * @throws {ValueError} If the buy options are not valid.
149
+ * @throws {ProviderRequiredError} If the method requires a provider.
150
+ * @throws {ProviderError} If the provider fails to estimate the costs of the purchase.
151
+ * @throws {BuyError} If the purchase fails with an error.
152
+ */
153
+ async quoteBuy (options) {
154
+ throw new NotImplementedError('quoteBuy(options)')
155
+ }
156
+
157
+ /**
158
+ * Generates a widget URL for a user to purchase a crypto asset with fiat currency.
159
+ *
160
+ * @param {BuyOptions} options - The options for the buy operation.
161
+ * @returns {Promise<BuyResult>} The operation's result.
162
+ * @throws {AccountRequiredError} If the protocol requires a full account to perform a purchase.
163
+ * @throws {ValueError} If the buy options are not valid.
164
+ * @throws {ProviderRequiredError} If the method requires a provider.
165
+ * @throws {ProviderError} If the provider fails to perform the purchase.
166
+ * @throws {BuyError} If the purchase fails with an error.
167
+ * @throws {MaximumFeeExceededError} If the the costs of the purchase exceeds the buy max. fee option.
168
+ */
169
+ async buy (options) {
170
+ throw new NotImplementedError('buy(options)')
171
+ }
172
+
173
+ /**
174
+ * Gets a quote for a crypto asset sale.
175
+ *
176
+ * @param {Omit<SellOptions, 'refundAddress'>} options - The options for the sell operation.
177
+ * @returns {Promise<FiatQuote>} A quote for the transaction.
178
+ * @throws {ReadOnlyAccountRequiredError} If the protocol requires a read-only or full account to quote the costs of a sale.
179
+ * @throws {ValueError} If the sell options are not valid.
180
+ * @throws {ProviderRequiredError} If the method requires a provider.
181
+ * @throws {ProviderError} If the provider fails to estimate the costs of the sale.
182
+ * @throws {SellError} If the sale fails with an error.
183
+ */
184
+ async quoteSell (options) {
185
+ throw new NotImplementedError('quoteSell(options)')
186
+ }
187
+
188
+ /**
189
+ * Generates a widget URL for a user to sell a crypto asset for fiat currency.
190
+ *
191
+ * @param {SellOptions} options - The options for the sell operation.
192
+ * @returns {Promise<SellResult>} The operation's result.
193
+ * @throws {AccountRequiredError} If the protocol requires a full account to perform a sale.
194
+ * @throws {ValueError} If the buy options are not valid.
195
+ * @throws {ProviderRequiredError} If the method requires a provider.
196
+ * @throws {ProviderError} If the provider fails to perform the sale.
197
+ * @throws {SellError} If the sale fails with an error.
198
+ * @throws {MaximumFeeExceededError} If the the costs of the sale exceeds the sell max. fee option.
199
+ */
200
+ async sell (options) {
201
+ throw new NotImplementedError('sell(options)')
202
+ }
203
+
204
+ /**
205
+ * Retrieves the details of a specific transaction from the provider.
206
+ *
207
+ * @param {string} txId - The unique identifier of the transaction.
208
+ * @returns {Promise<FiatTransactionDetail>} The transaction details.
209
+ * @throws {ValueError} If the transaction's id is not valid.
210
+ * @throws {NoSuchElementError} If no transaction exists for the given id.
211
+ * @throws {ProviderRequiredError} If the method requires a provider.
212
+ * @throws {ProviderError} If the provider fails to fetch the transaction's details.
213
+ */
214
+ async getTransactionDetail (txId) {
215
+ throw new NotImplementedError('getTransactionDetail(txId)')
216
+ }
217
+
218
+ /**
219
+ * Retrieves a list of supported crypto assets from the provider.
220
+ *
221
+ * @returns {Promise<SupportedCryptoAsset[]>} An array of supported crypto assets.
222
+ * @throws {ProviderRequiredError} If the method requires a provider.
223
+ * @throws {ProviderError} If the provider fails to fetch the available crypto assets.
224
+ */
225
+ async getSupportedCryptoAssets () {
226
+ throw new NotImplementedError('getSupportedCryptoAssets()')
227
+ }
228
+
229
+ /**
230
+ * Retrieves a list of supported fiat currencies from the provider.
231
+ *
232
+ * @returns {Promise<SupportedFiatCurrency[]>} An array of supported fiat currencies.
233
+ * @throws {ProviderRequiredError} If the method requires a provider.
234
+ * @throws {ProviderError} If the provider fails to fetch the available fiat currencies.
235
+ */
236
+ async getSupportedFiatCurrencies () {
237
+ throw new NotImplementedError('getSupportedFiatCurrencies()')
238
+ }
239
+
240
+ /**
241
+ * Retrieves a list of supported countries from the provider.
242
+ *
243
+ * @returns {Promise<SupportedCountry[]>} An array of supported countries.
244
+ * @throws {ProviderRequiredError} If the method requires a provider.
245
+ * @throws {ProviderError} If the provider fails to fetch the available countries.
246
+ */
247
+ async getSupportedCountries () {
248
+ throw new NotImplementedError('getSupportedCountries()')
249
+ }
250
+ }
251
+
252
+ /**
253
+ * @abstract
254
+ * @implements {IFiatProtocol}
255
+ */
256
+ export default class FiatProtocol {
257
+ /**
258
+ * Creates a new interface to the protocol without binding it to a wallet account.
259
+ *
260
+ * @overload
261
+ * @param {undefined} [account] - The wallet account to use to interact with the protocol.
262
+ */
263
+ /**
264
+ * Creates a new read-only interface to the protocol.
265
+ *
266
+ * @overload
267
+ * @param {IWalletAccountReadOnly} account - The wallet account to use to interact with the protocol.
268
+ */
269
+ /**
270
+ * Creates a new interface to the protocol.
271
+ *
272
+ * @overload
273
+ * @param {IWalletAccount} account - The wallet account to use to interact with the protocol.
274
+ */
275
+ constructor (account) {
276
+ /**
277
+ * The wallet account to use to interact with the protocol.
278
+ *
279
+ * @protected
280
+ * @type {IWalletAccountReadOnly | IWalletAccount | undefined}
281
+ */
282
+ this._account = account
283
+ }
284
+
285
+ /**
286
+ * Gets a quote for a crypto asset purchase.
287
+ *
288
+ * @abstract
289
+ * @param {Omit<BuyOptions, 'recipient'>} options - The options for the buy operation.
290
+ * @returns {Promise<FiatQuote>} A quote for the transaction.
291
+ * @throws {ReadOnlyAccountRequiredError} If the protocol requires a read-only or full account to quote the costs of a purchase.
292
+ * @throws {ValueError} If the buy options are not valid.
293
+ * @throws {ProviderRequiredError} If the method requires a provider.
294
+ * @throws {ProviderError} If the provider fails to estimate the costs of the purchase.
295
+ * @throws {BuyError} If the purchase fails with an error.
296
+ */
297
+ async quoteBuy (options) {
298
+ throw new NotImplementedError('quoteBuy(options)')
299
+ }
300
+
301
+ /**
302
+ * Generates a URL for a user to purchase a crypto asset with fiat currency.
303
+ *
304
+ * @abstract
305
+ * @param {BuyOptions} options - The options for the buy operation.
306
+ * @returns {Promise<BuyResult>} The URL for the user to complete the purchase.
307
+ * @throws {AccountRequiredError} If the protocol requires a full account to perform a purchase.
308
+ * @throws {ValueError} If the buy options are not valid.
309
+ * @throws {ProviderRequiredError} If the method requires a provider.
310
+ * @throws {ProviderError} If the provider fails to perform the purchase.
311
+ * @throws {BuyError} If the purchase fails with an error.
312
+ * @throws {MaximumFeeExceededError} If the the costs of the purchase exceeds the buy max. fee option.
313
+ */
314
+ async buy (options) {
315
+ throw new NotImplementedError('buy(options)')
316
+ }
317
+
318
+ /**
319
+ * Gets a quote for a crypto asset sale.
320
+ *
321
+ * @abstract
322
+ * @param {Omit<SellOptions, 'refundAddress'>} options - The options for the sell operation.
323
+ * @returns {Promise<FiatQuote>} A quote for the transaction.
324
+ * @throws {ReadOnlyAccountRequiredError} If the protocol requires a read-only or full account to quote the costs of a sale.
325
+ * @throws {ValueError} If the sell options are not valid.
326
+ * @throws {ProviderRequiredError} If the method requires a provider.
327
+ * @throws {ProviderError} If the provider fails to estimate the costs of the sale.
328
+ * @throws {SellError} If the sale fails with an error.
329
+ */
330
+ async quoteSell (options) {
331
+ throw new NotImplementedError('quoteSell(options)')
332
+ }
333
+
334
+ /**
335
+ * Generates a URL for a user to sell a crypto asset for fiat currency.
336
+ *
337
+ * @abstract
338
+ * @param {SellOptions} options - The options for the sell operation.
339
+ * @returns {Promise<SellResult>} The URL for the user to complete the sale.
340
+ * @throws {AccountRequiredError} If the protocol requires a full account to perform a sale.
341
+ * @throws {ValueError} If the buy options are not valid.
342
+ * @throws {ProviderRequiredError} If the method requires a provider.
343
+ * @throws {ProviderError} If the provider fails to perform the sale.
344
+ * @throws {SellError} If the sale fails with an error.
345
+ * @throws {MaximumFeeExceededError} If the the costs of the sale exceeds the sell max. fee option.
346
+ */
347
+ async sell (options) {
348
+ throw new NotImplementedError('sell(options)')
349
+ }
350
+
351
+ /**
352
+ * Retrieves the details of a specific transaction from the provider.
353
+ *
354
+ * @abstract
355
+ * @param {string} txId - The unique identifier of the transaction.
356
+ * @returns {Promise<FiatTransactionDetail>} The transaction details.
357
+ * @throws {ValueError} If the transaction's id is not valid.
358
+ * @throws {NoSuchElementError} If no transaction exists for the given id.
359
+ * @throws {ProviderRequiredError} If the method requires a provider.
360
+ * @throws {ProviderError} If the provider fails to fetch the transaction's details.
361
+ */
362
+ async getTransactionDetail (txId) {
363
+ throw new NotImplementedError('getTransactionDetail(txId)')
364
+ }
365
+
366
+ /**
367
+ * Retrieves a list of supported crypto assets from the provider.
368
+ *
369
+ * @abstract
370
+ * @returns {Promise<SupportedCryptoAsset[]>} An array of supported crypto assets.
371
+ * @throws {ProviderRequiredError} If the method requires a provider.
372
+ * @throws {ProviderError} If the provider fails to fetch the available crypto assets.
373
+ */
374
+ async getSupportedCryptoAssets () {
375
+ throw new NotImplementedError('getSupportedCryptoAssets()')
376
+ }
377
+
378
+ /**
379
+ * Retrieves a list of supported fiat currencies from the provider.
380
+ *
381
+ * @abstract
382
+ * @returns {Promise<SupportedFiatCurrency[]>} An array of supported fiat currencies.
383
+ * @throws {ProviderRequiredError} If the method requires a provider.
384
+ * @throws {ProviderError} If the provider fails to fetch the available fiat currencies.
385
+ */
386
+ async getSupportedFiatCurrencies () {
387
+ throw new NotImplementedError('getSupportedFiatCurrencies()')
388
+ }
389
+
390
+ /**
391
+ * Retrieves a list of supported countries or regions from the provider.
392
+ *
393
+ * @abstract
394
+ * @returns {Promise<SupportedCountry[]>} An array of supported countries.
395
+ * @throws {ProviderRequiredError} If the method requires a provider.
396
+ * @throws {ProviderError} If the provider fails to fetch the available countries.
397
+ */
398
+ async getSupportedCountries () {
399
+ throw new NotImplementedError('getSupportedCountries()')
400
+ }
401
+ }
@@ -30,8 +30,84 @@
30
30
  /** @typedef {import('./lending-protocol.js').RepayOptions} RepayOptions */
31
31
  /** @typedef {import('./lending-protocol.js').RepayResult} RepayResult */
32
32
 
33
+ /** @typedef {import('./fiat-protocol.js').BuyOptions} BuyOptions */
34
+ /** @typedef {import('./fiat-protocol.js').BuyCommonOptions} BuyCommonOptions */
35
+ /** @typedef {import('./fiat-protocol.js').BuyExactCryptoAmountOptions} BuyExactCryptoAmountOptions */
36
+ /** @typedef {import('./fiat-protocol.js').BuyWithFiatAmountOptions} BuyWithFiatAmountOptions */
37
+ /** @typedef {import('./fiat-protocol.js').BuyResult} BuyResult */
38
+
39
+ /** @typedef {import('./fiat-protocol.js').SellOptions} SellOptions */
40
+ /** @typedef {import('./fiat-protocol.js').SellCommonOptions} SellCommonOptions */
41
+ /** @typedef {import('./fiat-protocol.js').SellExactCryptoAmountOptions} SellExactCryptoAmountOptions */
42
+ /** @typedef {import('./fiat-protocol.js').SellForFiatAmountOptions} SellForFiatAmountOptions */
43
+ /** @typedef {import('./fiat-protocol.js').SellResult} SellResult */
44
+
45
+ /** @typedef {import('./fiat-protocol.js').FiatQuote} FiatQuote */
46
+
47
+ /** @typedef {import('./fiat-protocol.js').FiatTransactionStatus} FiatTransactionStatus */
48
+ /** @typedef {import('./fiat-protocol.js').FiatTransactionDetail} FiatTransactionDetail */
49
+
50
+ /** @typedef {import('./fiat-protocol.js').SupportedCryptoAsset} SupportedCryptoAsset */
51
+ /** @typedef {import('./fiat-protocol.js').SupportedFiatCurrency} SupportedFiatCurrency */
52
+ /** @typedef {import('./fiat-protocol.js').SupportedCountry} SupportedCountry */
53
+
54
+ /** @typedef {import('./swidge-protocol.js').SwidgeStatus} SwidgeStatus */
55
+ /** @typedef {import('./swidge-protocol.js').SwidgeFeeType} SwidgeFeeType */
56
+ /** @typedef {import('./swidge-protocol.js').SwidgeProtocolConfig} SwidgeProtocolConfig */
57
+ /** @typedef {import('./swidge-protocol.js').SwidgeOptions} SwidgeOptions */
58
+ /** @typedef {import('./swidge-protocol.js').SwidgeCommonOptions} SwidgeCommonOptions */
59
+ /** @typedef {import('./swidge-protocol.js').SwidgeExactInOptions} SwidgeExactInOptions */
60
+ /** @typedef {import('./swidge-protocol.js').SwidgeExactOutOptions} SwidgeExactOutOptions */
61
+ /** @typedef {import('./swidge-protocol.js').SwidgeFee} SwidgeFee */
62
+ /** @typedef {import('./swidge-protocol.js').SwidgeTransaction} SwidgeTransaction */
63
+ /** @typedef {import('./swidge-protocol.js').SwidgeQuote} SwidgeQuote */
64
+ /** @typedef {import('./swidge-protocol.js').SwidgeResult} SwidgeResult */
65
+ /** @typedef {import('./swidge-protocol.js').SwidgeStatusOptions} SwidgeStatusOptions */
66
+ /** @typedef {import('./swidge-protocol.js').SwidgeStatusResult} SwidgeStatusResult */
67
+ /** @typedef {import('./swidge-protocol.js').SwidgeSupportedChain} SwidgeSupportedChain */
68
+ /** @typedef {import('./swidge-protocol.js').SwidgeSupportedToken} SwidgeSupportedToken */
69
+ /** @typedef {import('./swidge-protocol.js').SwidgeSupportedTokensOptions} SwidgeSupportedTokensOptions */
70
+
71
+ /** @typedef {import('./sda-protocol.js').Blockchain} Blockchain */
72
+ /** @typedef {import('./sda-protocol.js').SdaToken} SdaToken */
73
+ /** @typedef {import('./sda-protocol.js').SdaDepositAddressLimits} SdaDepositAddressLimits */
74
+ /** @typedef {import('./sda-protocol.js').SdaRoutesOptions} SdaRoutesOptions */
75
+ /** @typedef {import('./sda-protocol.js').SdaRoute} SdaRoute */
76
+ /** @typedef {import('./sda-protocol.js').SdaDepositOptions} SdaDepositOptions */
77
+ /** @typedef {import('./sda-protocol.js').SdaFeeType} SdaFeeType */
78
+ /** @typedef {import('./sda-protocol.js').SdaFee} SdaFee */
79
+ /** @typedef {import('./sda-protocol.js').SdaDepositQuote} SdaDepositQuote */
80
+ /** @typedef {import('./sda-protocol.js').SdaCreateDepositAddressOptions} SdaCreateDepositAddressOptions */
81
+ /** @typedef {import('./sda-protocol.js').SdaDepositAddress} SdaDepositAddress */
82
+ /** @typedef {import('./sda-protocol.js').SdaTransferStatus} SdaTransferStatus */
83
+ /** @typedef {import('./sda-protocol.js').SdaTransfer} SdaTransfer */
84
+ /** @typedef {import('./sda-protocol.js').SdaTransfersOptions} SdaTransfersOptions */
85
+ /** @typedef {import('./sda-protocol.js').SdaRecoverById} SdaRecoverById */
86
+ /** @typedef {import('./sda-protocol.js').SdaRecoverByAddress} SdaRecoverByAddress */
87
+ /** @typedef {import('./sda-protocol.js').SdaRecoveryOptions} SdaRecoveryOptions */
88
+ /** @typedef {import('./sda-protocol.js').SdaRecoveryResult} SdaRecoveryResult */
89
+
90
+ /** @typedef {import('./errors.js').SwapErrorOptions} SwapErrorOptions */
91
+ /** @typedef {import('./errors.js').BridgeErrorOptions} BridgeErrorOptions */
92
+ /** @typedef {import('./errors.js').SupplyErrorOptions} SupplyErrorOptions */
93
+ /** @typedef {import('./errors.js').WithdrawErrorOptions} WithdrawErrorOptions */
94
+ /** @typedef {import('./errors.js').BorrowErrorOptions} BorrowErrorOptions */
95
+ /** @typedef {import('./errors.js').RepayErrorOptions} RepayErrorOptions */
96
+ /** @typedef {import('./errors.js').BuyErrorOptions} BuyErrorOptions */
97
+ /** @typedef {import('./errors.js').SellErrorOptions} SellErrorOptions */
98
+ /** @typedef {import('./errors.js').SwidgeErrorOptions} SwidgeErrorOptions */
99
+ /** @typedef {import('./errors.js').SdaErrorOptions} SdaErrorOptions */
100
+
33
101
  export { default as SwapProtocol, ISwapProtocol } from './swap-protocol.js'
34
102
 
35
103
  export { default as BridgeProtocol, IBridgeProtocol } from './bridge-protocol.js'
36
104
 
37
105
  export { default as LendingProtocol, ILendingProtocol } from './lending-protocol.js'
106
+
107
+ export { default as FiatProtocol, IFiatProtocol } from './fiat-protocol.js'
108
+
109
+ export { default as SwidgeProtocol, ISwidgeProtocol } from './swidge-protocol.js'
110
+
111
+ export { default as SdaProtocol, ISdaProtocol } from './sda-protocol.js'
112
+
113
+ export { AccountRequiredError, BorrowError, BorrowErrorReason, BridgeError, BridgeErrorReason, BuyError, BuyErrorReason, InvalidTokenError, MaximumFeeExceededError, NoSuchElementError, NotImplementedError, ProviderError, ProviderRequiredError, ReadOnlyAccountRequiredError, RepayError, RepayErrorReason, SdaError, SdaErrorReason, SellError, SellErrorReason, SupplyError, SupplyErrorReason, SwapError, SwapErrorReason, SwidgeError, SwidgeErrorReason, UnsupportedOperationError, ValueError, WdkError, WithdrawError, WithdrawErrorReason } from './errors.js'