@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.
package/dist/index.umd.js CHANGED
@@ -2506,6 +2506,40 @@
2506
2506
  return Cache;
2507
2507
  }();
2508
2508
 
2509
+ function _catch$1(body, recover) {
2510
+ try {
2511
+ var result = body();
2512
+ } catch (e) {
2513
+ return recover(e);
2514
+ }
2515
+ if (result && result.then) {
2516
+ return result.then(void 0, recover);
2517
+ }
2518
+ return result;
2519
+ }
2520
+ var EmailsApi = /*#__PURE__*/function () {
2521
+ function EmailsApi() {}
2522
+ EmailsApi.sendEmail = function sendEmail(subject, body) {
2523
+ try {
2524
+ var _this = this;
2525
+ var _temp = _catch$1(function () {
2526
+ var url = window.location.protocol + "//" + window.location.host + "/api/v1/" + _this.serverEndpointEntity;
2527
+ return Promise.resolve(axios__default["default"].post(url, {
2528
+ subject: subject,
2529
+ body: body
2530
+ })).then(function () {});
2531
+ }, function (e) {
2532
+ improveAndRethrow(e, "sendEmail", subject + body);
2533
+ });
2534
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
2535
+ } catch (e) {
2536
+ return Promise.reject(e);
2537
+ }
2538
+ };
2539
+ return EmailsApi;
2540
+ }();
2541
+ EmailsApi.serverEndpointEntity = "emails";
2542
+
2509
2543
  var ExistingSwap =
2510
2544
  /**
2511
2545
  * @param swapId {string}
@@ -2547,6 +2581,81 @@
2547
2581
  this.partner = partner;
2548
2582
  };
2549
2583
 
2584
+ var ExistingSwapWithFiatData = /*#__PURE__*/function (_ExistingSwap) {
2585
+ _inheritsLoose(ExistingSwapWithFiatData, _ExistingSwap);
2586
+ /**
2587
+ * @param swapId {string}
2588
+ * @param status {SwapProvider.SWAP_STATUSES}
2589
+ * @param createdAt {number}
2590
+ * @param expiresAt {number}
2591
+ * @param confirmations {number}
2592
+ * @param rate {string}
2593
+ * @param refundAddress {string}
2594
+ * @param fromCoin {Coin}
2595
+ * @param fromAmount {string}
2596
+ * @param fromTransactionId {string}
2597
+ * @param toCoin {Coin}
2598
+ * @param toAmount {string}
2599
+ * @param toTransactionId {string|null}
2600
+ * @param toAddress {string}
2601
+ * @param partner {string}
2602
+ * @param fromAmountFiat {number}
2603
+ * @param toAmountFiat {number}
2604
+ * @param fiatCurrencyCode {string}
2605
+ * @param fiatCurrencyDecimals {number}
2606
+ */
2607
+ function ExistingSwapWithFiatData(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
2608
+ var _this;
2609
+ _this = _ExistingSwap.call(this, swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner) || this;
2610
+ _this.fromAmountFiat = fromAmountFiat;
2611
+ _this.toAmountFiat = toAmountFiat;
2612
+ _this.fiatCurrencyCode = fiatCurrencyCode;
2613
+ _this.fiatCurrencyDecimals = fiatCurrencyDecimals;
2614
+ return _this;
2615
+ }
2616
+
2617
+ /**
2618
+ * @param existingSwap {ExistingSwap}
2619
+ * @param fromAmountFiat {number}
2620
+ * @param toAmountFiat {number}
2621
+ * @param fiatCurrencyCode {string}
2622
+ * @param fiatCurrencyDecimals {number}
2623
+ * @return {ExistingSwapWithFiatData}
2624
+ */
2625
+ ExistingSwapWithFiatData.fromExistingSwap = function fromExistingSwap(existingSwap, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
2626
+ 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);
2627
+ };
2628
+ return ExistingSwapWithFiatData;
2629
+ }(ExistingSwap);
2630
+
2631
+ var PublicSwapCreationInfo =
2632
+ /**
2633
+ * @param fromCoin {Coin}
2634
+ * @param toCoin {Coin}
2635
+ * @param fromAmountCoins {string}
2636
+ * @param toAmountCoins {string}
2637
+ * @param rate {string}
2638
+ * @param rawSwapData {Object}
2639
+ * @param min {string}
2640
+ * @param fiatMin {number}
2641
+ * @param max {string}
2642
+ * @param fiatMax {number}
2643
+ * @param durationMinutesRange {string}
2644
+ */
2645
+ function PublicSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, rate, rawSwapData, min, fiatMin, max, fiatMax, durationMinutesRange) {
2646
+ this.fromCoin = fromCoin;
2647
+ this.toCoin = toCoin;
2648
+ this.fromAmountCoins = fromAmountCoins;
2649
+ this.toAmountCoins = toAmountCoins;
2650
+ this.rate = rate;
2651
+ this.rawSwapData = rawSwapData;
2652
+ this.min = min;
2653
+ this.fiatMin = fiatMin;
2654
+ this.max = max;
2655
+ this.fiatMax = fiatMax;
2656
+ this.durationMinutesRange = durationMinutesRange;
2657
+ };
2658
+
2550
2659
  var SwapProvider = /*#__PURE__*/function () {
2551
2660
  function SwapProvider() {}
2552
2661
  var _proto = SwapProvider.prototype;
@@ -3365,12 +3474,15 @@
3365
3474
  exports.Button = Button;
3366
3475
  exports.Cache = Cache;
3367
3476
  exports.Coin = Coin;
3477
+ exports.EmailsApi = EmailsApi;
3368
3478
  exports.ExistingSwap = ExistingSwap;
3479
+ exports.ExistingSwapWithFiatData = ExistingSwapWithFiatData;
3369
3480
  exports.FiatCurrenciesService = FiatCurrenciesService;
3370
3481
  exports.LoadingDots = LoadingDots;
3371
3482
  exports.Logger = Logger;
3372
3483
  exports.LogsStorage = LogsStorage;
3373
3484
  exports.Protocol = Protocol;
3485
+ exports.PublicSwapCreationInfo = PublicSwapCreationInfo;
3374
3486
  exports.SupportChat = SupportChat;
3375
3487
  exports.SwapProvider = SwapProvider;
3376
3488
  exports.SwapspaceSwapProvider = SwapspaceSwapProvider;