@rabbitio/ui-kit 1.0.0-beta.12 → 1.0.0-beta.13

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.
@@ -2312,6 +2312,21 @@ class Cache {
2312
2312
  }
2313
2313
  }
2314
2314
 
2315
+ class EmailsApi {
2316
+ static async sendEmail(subject, body) {
2317
+ try {
2318
+ const url = `${window.location.protocol + "//" + window.location.host}/api/v1/${this.serverEndpointEntity}`;
2319
+ await axios.post(url, {
2320
+ subject,
2321
+ body
2322
+ });
2323
+ } catch (e) {
2324
+ improveAndRethrow(e, "sendEmail", subject + body);
2325
+ }
2326
+ }
2327
+ }
2328
+ EmailsApi.serverEndpointEntity = "emails";
2329
+
2315
2330
  class ExistingSwap {
2316
2331
  /**
2317
2332
  * @param swapId {string}
@@ -2354,6 +2369,78 @@ class ExistingSwap {
2354
2369
  }
2355
2370
  }
2356
2371
 
2372
+ class ExistingSwapWithFiatData extends ExistingSwap {
2373
+ /**
2374
+ * @param swapId {string}
2375
+ * @param status {SwapProvider.SWAP_STATUSES}
2376
+ * @param createdAt {number}
2377
+ * @param expiresAt {number}
2378
+ * @param confirmations {number}
2379
+ * @param rate {string}
2380
+ * @param refundAddress {string}
2381
+ * @param fromCoin {Coin}
2382
+ * @param fromAmount {string}
2383
+ * @param fromTransactionId {string}
2384
+ * @param toCoin {Coin}
2385
+ * @param toAmount {string}
2386
+ * @param toTransactionId {string|null}
2387
+ * @param toAddress {string}
2388
+ * @param partner {string}
2389
+ * @param fromAmountFiat {number}
2390
+ * @param toAmountFiat {number}
2391
+ * @param fiatCurrencyCode {string}
2392
+ * @param fiatCurrencyDecimals {number}
2393
+ */
2394
+ constructor(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
2395
+ super(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner);
2396
+ this.fromAmountFiat = fromAmountFiat;
2397
+ this.toAmountFiat = toAmountFiat;
2398
+ this.fiatCurrencyCode = fiatCurrencyCode;
2399
+ this.fiatCurrencyDecimals = fiatCurrencyDecimals;
2400
+ }
2401
+
2402
+ /**
2403
+ * @param existingSwap {ExistingSwap}
2404
+ * @param fromAmountFiat {number}
2405
+ * @param toAmountFiat {number}
2406
+ * @param fiatCurrencyCode {string}
2407
+ * @param fiatCurrencyDecimals {number}
2408
+ * @return {ExistingSwapWithFiatData}
2409
+ */
2410
+ static fromExistingSwap(existingSwap, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
2411
+ return new ExistingSwapWithFiatData(existingSwap.swapId, existingSwap.status, existingSwap.createdAt, existingSwap.expiresAt, existingSwap.confirmations, existingSwap.rate, existingSwap.refundAddress, existingSwap.payToAddress, existingSwap.fromCoin, existingSwap.fromAmount, existingSwap.fromTransactionId, existingSwap.fromTransactionLink, existingSwap.toCoin, existingSwap.toAmount, existingSwap.toTransactionId, existingSwap.toTransactionLink, existingSwap.toAddress, existingSwap.partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals);
2412
+ }
2413
+ }
2414
+
2415
+ class PublicSwapCreationInfo {
2416
+ /**
2417
+ * @param fromCoin {Coin}
2418
+ * @param toCoin {Coin}
2419
+ * @param fromAmountCoins {string}
2420
+ * @param toAmountCoins {string}
2421
+ * @param rate {string}
2422
+ * @param rawSwapData {Object}
2423
+ * @param min {string}
2424
+ * @param fiatMin {number}
2425
+ * @param max {string}
2426
+ * @param fiatMax {number}
2427
+ * @param durationMinutesRange {string}
2428
+ */
2429
+ constructor(fromCoin, toCoin, fromAmountCoins, toAmountCoins, rate, rawSwapData, min, fiatMin, max, fiatMax, durationMinutesRange) {
2430
+ this.fromCoin = fromCoin;
2431
+ this.toCoin = toCoin;
2432
+ this.fromAmountCoins = fromAmountCoins;
2433
+ this.toAmountCoins = toAmountCoins;
2434
+ this.rate = rate;
2435
+ this.rawSwapData = rawSwapData;
2436
+ this.min = min;
2437
+ this.fiatMin = fiatMin;
2438
+ this.max = max;
2439
+ this.fiatMax = fiatMax;
2440
+ this.durationMinutesRange = durationMinutesRange;
2441
+ }
2442
+ }
2443
+
2357
2444
  class SwapProvider {
2358
2445
  /**
2359
2446
  * @return {Promise<void>}
@@ -2998,5 +3085,5 @@ class SwapspaceSwapProvider extends SwapProvider {
2998
3085
  }
2999
3086
  }
3000
3087
 
3001
- export { AmountUtils, AssetIcon, Blockchain, Button, Cache, Coin, ExistingSwap, FiatCurrenciesService, LoadingDots, Logger, LogsStorage, Protocol, SupportChat, SwapProvider, SwapspaceSwapProvider, improveAndRethrow, safeStringify };
3088
+ export { AmountUtils, AssetIcon, Blockchain, Button, Cache, Coin, EmailsApi, ExistingSwap, ExistingSwapWithFiatData, FiatCurrenciesService, LoadingDots, Logger, LogsStorage, Protocol, PublicSwapCreationInfo, SupportChat, SwapProvider, SwapspaceSwapProvider, improveAndRethrow, safeStringify };
3002
3089
  //# sourceMappingURL=index.modern.js.map