@paraspell/sdk-pjs 8.0.0 → 8.0.2

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.cjs CHANGED
@@ -18,6 +18,31 @@ function _arrayWithHoles(r) {
18
18
  function _arrayWithoutHoles(r) {
19
19
  if (Array.isArray(r)) return _arrayLikeToArray(r);
20
20
  }
21
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
22
+ try {
23
+ var i = n[a](c),
24
+ u = i.value;
25
+ } catch (n) {
26
+ return void e(n);
27
+ }
28
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
29
+ }
30
+ function _asyncToGenerator(n) {
31
+ return function () {
32
+ var t = this,
33
+ e = arguments;
34
+ return new Promise(function (r, o) {
35
+ var a = n.apply(t, e);
36
+ function _next(n) {
37
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
38
+ }
39
+ function _throw(n) {
40
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
41
+ }
42
+ _next(void 0);
43
+ });
44
+ };
45
+ }
21
46
  function _classCallCheck(a, n) {
22
47
  if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
23
48
  }
@@ -32,6 +57,14 @@ function _createClass(e, r, t) {
32
57
  writable: !1
33
58
  }), e;
34
59
  }
60
+ function _defineProperty(e, r, t) {
61
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
62
+ value: t,
63
+ enumerable: !0,
64
+ configurable: !0,
65
+ writable: !0
66
+ }) : e[r] = t, e;
67
+ }
35
68
  function _iterableToArray(r) {
36
69
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
37
70
  }
@@ -65,6 +98,27 @@ function _nonIterableRest() {
65
98
  function _nonIterableSpread() {
66
99
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
67
100
  }
101
+ function ownKeys(e, r) {
102
+ var t = Object.keys(e);
103
+ if (Object.getOwnPropertySymbols) {
104
+ var o = Object.getOwnPropertySymbols(e);
105
+ r && (o = o.filter(function (r) {
106
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
107
+ })), t.push.apply(t, o);
108
+ }
109
+ return t;
110
+ }
111
+ function _objectSpread2(e) {
112
+ for (var r = 1; r < arguments.length; r++) {
113
+ var t = null != arguments[r] ? arguments[r] : {};
114
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
115
+ _defineProperty(e, r, t[r]);
116
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
117
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
118
+ });
119
+ }
120
+ return e;
121
+ }
68
122
  function _regeneratorRuntime() {
69
123
  _regeneratorRuntime = function () {
70
124
  return e;
@@ -376,11 +430,11 @@ function _toPrimitive(t, r) {
376
430
  if ("object" != typeof t || !t) return t;
377
431
  var e = t[Symbol.toPrimitive];
378
432
  if (void 0 !== e) {
379
- var i = e.call(t, r);
433
+ var i = e.call(t, r || "default");
380
434
  if ("object" != typeof i) return i;
381
435
  throw new TypeError("@@toPrimitive must return a primitive value.");
382
436
  }
383
- return (String )(t);
437
+ return ("string" === r ? String : Number)(t);
384
438
  }
385
439
  function _toPropertyKey(t) {
386
440
  var i = _toPrimitive(t, "string");
@@ -403,53 +457,8 @@ function _unsupportedIterableToArray(r, a) {
403
457
  }
404
458
  }
405
459
 
406
- /******************************************************************************
407
- Copyright (c) Microsoft Corporation.
408
-
409
- Permission to use, copy, modify, and/or distribute this software for any
410
- purpose with or without fee is hereby granted.
411
-
412
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
413
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
414
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
415
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
416
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
417
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
418
- PERFORMANCE OF THIS SOFTWARE.
419
- ***************************************************************************** */
420
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
421
-
422
-
423
- function __awaiter(thisArg, _arguments, P, generator) {
424
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
425
- return new (P || (P = Promise))(function (resolve, reject) {
426
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
427
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
428
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
429
- step((generator = generator.apply(thisArg, _arguments || [])).next());
430
- });
431
- }
432
-
433
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
434
- var e = new Error(message);
435
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
436
- };
437
-
438
- var findEthAsset = function findEthAsset(currency) {
439
- var ethAssets = sdkCore.getOtherAssets('Ethereum');
440
- var ethAsset = 'symbol' in currency ? ethAssets.find(function (asset) {
441
- return asset.symbol === currency.symbol;
442
- }) : ethAssets.find(function (asset) {
443
- return asset.assetId === currency.id;
444
- });
445
- if (!ethAsset) {
446
- throw new sdkCore.InvalidCurrencyError("Currency ".concat(JSON.stringify(currency), " is not supported for Ethereum transfers"));
447
- }
448
- return ethAsset;
449
- };
450
-
451
- var createContext = function createContext(executionUrl, config) {
452
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
460
+ var createContext = /*#__PURE__*/function () {
461
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(executionUrl, config) {
453
462
  return _regeneratorRuntime().wrap(function _callee$(_context) {
454
463
  while (1) switch (_context.prev = _context.next) {
455
464
  case 0:
@@ -477,7 +486,10 @@ var createContext = function createContext(executionUrl, config) {
477
486
  }
478
487
  }, _callee);
479
488
  }));
480
- };
489
+ return function createContext(_x, _x2) {
490
+ return _ref.apply(this, arguments);
491
+ };
492
+ }();
481
493
 
482
494
  var checkPlanFailure = function checkPlanFailure(plan) {
483
495
  if (plan.failure) {
@@ -501,109 +513,152 @@ var isEthersSigner = function isEthersSigner(signer) {
501
513
  *
502
514
  * @throws Will throw an error if the transfer validation fails or if the transfer cannot be completed.
503
515
  */
504
- var transferEthToPolkadot$1 = function transferEthToPolkadot(_a) {
505
- return __awaiter(void 0, [_a], void 0, function (_ref) {
506
- var provider = _ref.provider,
507
- signer = _ref.signer,
508
- address = _ref.address,
509
- to = _ref.to,
510
- currency = _ref.currency;
511
- return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
512
- var _b, ethAsset, env, context, destParaId, plan, result;
513
- return _regeneratorRuntime().wrap(function _callee$(_context) {
514
- while (1) switch (_context.prev = _context.next) {
515
- case 0:
516
- if (provider) {
517
- _context.next = 2;
518
- break;
519
- }
520
- throw new Error('provider parameter is required for Snowbridge transfers.');
521
- case 2:
522
- if (isEthersSigner(signer)) {
523
- _context.next = 4;
524
- break;
525
- }
526
- throw new Error('Snowbridge does not support Viem provider yet.');
527
- case 4:
528
- ethAsset = findEthAsset(currency);
529
- env = api.environment.SNOWBRIDGE_ENV['polkadot_mainnet'];
530
- _context.next = 8;
531
- return createContext(provider, env.config);
532
- case 8:
533
- context = _context.sent;
534
- destParaId = sdkCore.getParaId(to);
516
+ var transferEthToPolkadot$1 = /*#__PURE__*/function () {
517
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
518
+ var provider, signer, address, to, currency, ethAsset, env, context, destParaId, plan, result;
519
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
520
+ while (1) switch (_context.prev = _context.next) {
521
+ case 0:
522
+ provider = _ref.provider, signer = _ref.signer, address = _ref.address, to = _ref.to, currency = _ref.currency;
523
+ if (!('multiasset' in currency)) {
524
+ _context.next = 3;
525
+ break;
526
+ }
527
+ throw new Error('Multiassets syntax is not supported for Evm transfers');
528
+ case 3:
529
+ if (!('multilocation' in currency && sdkCore.isOverrideMultiLocationSpecifier(currency.multilocation))) {
530
+ _context.next = 5;
531
+ break;
532
+ }
533
+ throw new Error('Override multilocation is not supported for Evm transfers');
534
+ case 5:
535
+ if (provider) {
536
+ _context.next = 7;
537
+ break;
538
+ }
539
+ throw new Error('provider parameter is required for Snowbridge transfers.');
540
+ case 7:
541
+ if (isEthersSigner(signer)) {
542
+ _context.next = 9;
543
+ break;
544
+ }
545
+ throw new Error('Snowbridge does not support Viem provider yet.');
546
+ case 9:
547
+ ethAsset = sdkCore.getAssetBySymbolOrId('Ethereum', currency, to);
548
+ if (!(ethAsset === null)) {
535
549
  _context.next = 12;
536
- return api.toPolkadot.validateSend(context, signer, address, (_b = ethAsset.assetId) !== null && _b !== void 0 ? _b : '', destParaId, BigInt(currency.amount), BigInt(0));
537
- case 12:
538
- plan = _context.sent;
539
- checkPlanFailure(plan);
540
- _context.next = 16;
541
- return api.toPolkadot.send(context, signer, plan);
542
- case 16:
543
- result = _context.sent;
544
- return _context.abrupt("return", {
545
- result: result,
546
- plan: plan
547
- });
548
- case 18:
549
- case "end":
550
- return _context.stop();
551
- }
552
- }, _callee);
553
- })();
554
- });
555
- };
550
+ break;
551
+ }
552
+ throw new sdkCore.InvalidCurrencyError("Origin node Ethereum does not support currency ".concat(JSON.stringify(currency), "."));
553
+ case 12:
554
+ env = api.environment.SNOWBRIDGE_ENV['polkadot_mainnet'];
555
+ _context.next = 15;
556
+ return createContext(provider, env.config);
557
+ case 15:
558
+ context = _context.sent;
559
+ destParaId = sdkCore.getParaId(to);
560
+ if (!(!sdkCore.isForeignAsset(ethAsset) || ethAsset.assetId === undefined)) {
561
+ _context.next = 19;
562
+ break;
563
+ }
564
+ throw new sdkCore.InvalidCurrencyError('Selected asset has no asset id');
565
+ case 19:
566
+ _context.next = 21;
567
+ return api.toPolkadot.validateSend(context, signer, address, ethAsset.assetId, destParaId, BigInt(currency.amount), 0n);
568
+ case 21:
569
+ plan = _context.sent;
570
+ checkPlanFailure(plan);
571
+ _context.next = 25;
572
+ return api.toPolkadot.send(context, signer, plan);
573
+ case 25:
574
+ result = _context.sent;
575
+ return _context.abrupt("return", {
576
+ result: result,
577
+ plan: plan
578
+ });
579
+ case 27:
580
+ case "end":
581
+ return _context.stop();
582
+ }
583
+ }, _callee);
584
+ }));
585
+ return function transferEthToPolkadot(_x) {
586
+ return _ref2.apply(this, arguments);
587
+ };
588
+ }();
556
589
 
557
- var buildEthTransferOptions = function buildEthTransferOptions(_a) {
558
- return __awaiter(void 0, [_a], void 0, function (_ref) {
559
- var currency = _ref.currency,
560
- to = _ref.to,
561
- address = _ref.address,
562
- destAddress = _ref.destAddress;
563
- return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
564
- var _b, ethAsset, env, EXECUTION_URL, context, destParaId, signer, plan;
565
- return _regeneratorRuntime().wrap(function _callee$(_context) {
566
- while (1) switch (_context.prev = _context.next) {
567
- case 0:
568
- ethAsset = findEthAsset(currency);
569
- env = api.environment.SNOWBRIDGE_ENV['polkadot_mainnet'];
570
- EXECUTION_URL = 'https://eth.llamarpc.com';
590
+ var buildEthTransferOptions = /*#__PURE__*/function () {
591
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
592
+ var currency, to, address, destAddress, ethAsset, env, EXECUTION_URL, context, destParaId, signer, plan;
593
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
594
+ while (1) switch (_context.prev = _context.next) {
595
+ case 0:
596
+ currency = _ref.currency, to = _ref.to, address = _ref.address, destAddress = _ref.destAddress;
597
+ if (!('multiasset' in currency)) {
598
+ _context.next = 3;
599
+ break;
600
+ }
601
+ throw new Error('Multiassets syntax is not supported for Evm transfers');
602
+ case 3:
603
+ if (!('multilocation' in currency && sdkCore.isOverrideMultiLocationSpecifier(currency.multilocation))) {
571
604
  _context.next = 5;
572
- return createContext(EXECUTION_URL, env.config);
573
- case 5:
574
- context = _context.sent;
575
- destParaId = sdkCore.getParaId(to);
576
- signer = {
577
- getAddress: function getAddress() {
578
- return Promise.resolve(address);
579
- }
580
- };
581
- _context.next = 10;
582
- return api.toPolkadot.validateSend(context, signer, destAddress, (_b = ethAsset.assetId) !== null && _b !== void 0 ? _b : '', destParaId, BigInt(currency.amount), BigInt(0));
583
- case 10:
584
- plan = _context.sent;
585
- checkPlanFailure(plan);
586
- if (plan.success) {
587
- _context.next = 14;
588
- break;
605
+ break;
606
+ }
607
+ throw new Error('Override multilocation is not supported for Evm transfers');
608
+ case 5:
609
+ ethAsset = sdkCore.getAssetBySymbolOrId('Ethereum', currency, to);
610
+ if (!(ethAsset === null)) {
611
+ _context.next = 8;
612
+ break;
613
+ }
614
+ throw new sdkCore.InvalidCurrencyError("Origin node Ethereum does not support currency ".concat(JSON.stringify(currency), "."));
615
+ case 8:
616
+ env = api.environment.SNOWBRIDGE_ENV['polkadot_mainnet'];
617
+ EXECUTION_URL = 'https://eth.llamarpc.com';
618
+ _context.next = 12;
619
+ return createContext(EXECUTION_URL, env.config);
620
+ case 12:
621
+ context = _context.sent;
622
+ destParaId = sdkCore.getParaId(to);
623
+ signer = {
624
+ getAddress: function getAddress() {
625
+ return Promise.resolve(address);
589
626
  }
590
- throw new Error('Failed to validate send');
591
- case 14:
592
- return _context.abrupt("return", {
593
- token: plan.success.token,
594
- destinationParaId: plan.success.destinationParaId,
595
- destinationFee: plan.success.destinationFee,
596
- amount: plan.success.amount,
597
- fee: plan.success.fee
598
- });
599
- case 15:
600
- case "end":
601
- return _context.stop();
602
- }
603
- }, _callee);
604
- })();
605
- });
606
- };
627
+ };
628
+ if (!(!sdkCore.isForeignAsset(ethAsset) || ethAsset.assetId === undefined)) {
629
+ _context.next = 17;
630
+ break;
631
+ }
632
+ throw new sdkCore.InvalidCurrencyError('Selected asset has no asset id');
633
+ case 17:
634
+ _context.next = 19;
635
+ return api.toPolkadot.validateSend(context, signer, destAddress, ethAsset.assetId, destParaId, BigInt(currency.amount), 0n);
636
+ case 19:
637
+ plan = _context.sent;
638
+ checkPlanFailure(plan);
639
+ if (plan.success) {
640
+ _context.next = 23;
641
+ break;
642
+ }
643
+ throw new Error('Failed to validate send');
644
+ case 23:
645
+ return _context.abrupt("return", {
646
+ token: plan.success.token,
647
+ destinationParaId: plan.success.destinationParaId,
648
+ destinationFee: plan.success.destinationFee,
649
+ amount: plan.success.amount,
650
+ fee: plan.success.fee
651
+ });
652
+ case 24:
653
+ case "end":
654
+ return _context.stop();
655
+ }
656
+ }, _callee);
657
+ }));
658
+ return function buildEthTransferOptions(_x) {
659
+ return _ref2.apply(this, arguments);
660
+ };
661
+ }();
607
662
 
608
663
  var lowercaseFirstLetter = function lowercaseFirstLetter(value) {
609
664
  return value.charAt(0).toLowerCase() + value.slice(1);
@@ -636,9 +691,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
636
691
  }
637
692
  }, {
638
693
  key: "init",
639
- value: function init(node) {
640
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
641
- var _a;
694
+ value: function () {
695
+ var _init = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(node) {
696
+ var _this$_api;
642
697
  return _regeneratorRuntime().wrap(function _callee$(_context) {
643
698
  while (1) switch (_context.prev = _context.next) {
644
699
  case 0:
@@ -659,11 +714,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
659
714
  _context.next = 16;
660
715
  break;
661
716
  case 8:
662
- if (!((_a = this._api) !== null && _a !== void 0)) {
717
+ if (!((_this$_api = this._api) !== null && _this$_api !== void 0)) {
663
718
  _context.next = 12;
664
719
  break;
665
720
  }
666
- _context.t0 = _a;
721
+ _context.t0 = _this$_api;
667
722
  _context.next = 15;
668
723
  break;
669
724
  case 12:
@@ -681,11 +736,15 @@ var PolkadotJsApi = /*#__PURE__*/function () {
681
736
  }
682
737
  }, _callee, this);
683
738
  }));
684
- }
739
+ function init(_x) {
740
+ return _init.apply(this, arguments);
741
+ }
742
+ return init;
743
+ }()
685
744
  }, {
686
745
  key: "createApiInstance",
687
- value: function createApiInstance(wsUrl) {
688
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
746
+ value: function () {
747
+ var _createApiInstance = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(wsUrl) {
689
748
  var wsProvider;
690
749
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
691
750
  while (1) switch (_context2.prev = _context2.next) {
@@ -700,7 +759,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
700
759
  }
701
760
  }, _callee2);
702
761
  }));
703
- }
762
+ function createApiInstance(_x2) {
763
+ return _createApiInstance.apply(this, arguments);
764
+ }
765
+ return createApiInstance;
766
+ }()
704
767
  }, {
705
768
  key: "createAccountId",
706
769
  value: function createAccountId(address) {
@@ -731,8 +794,8 @@ var PolkadotJsApi = /*#__PURE__*/function () {
731
794
  }
732
795
  }, {
733
796
  key: "calculateTransactionFee",
734
- value: function calculateTransactionFee(tx, address) {
735
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
797
+ value: function () {
798
+ var _calculateTransactionFee = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(tx, address) {
736
799
  var _yield$tx$paymentInfo, partialFee;
737
800
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
738
801
  while (1) switch (_context3.prev = _context3.next) {
@@ -749,11 +812,15 @@ var PolkadotJsApi = /*#__PURE__*/function () {
749
812
  }
750
813
  }, _callee3);
751
814
  }));
752
- }
815
+ function calculateTransactionFee(_x3, _x4) {
816
+ return _calculateTransactionFee.apply(this, arguments);
817
+ }
818
+ return calculateTransactionFee;
819
+ }()
753
820
  }, {
754
821
  key: "getBalanceNative",
755
- value: function getBalanceNative(address) {
756
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
822
+ value: function () {
823
+ var _getBalanceNative = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(address) {
757
824
  var response;
758
825
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
759
826
  while (1) switch (_context4.prev = _context4.next) {
@@ -769,11 +836,15 @@ var PolkadotJsApi = /*#__PURE__*/function () {
769
836
  }
770
837
  }, _callee4, this);
771
838
  }));
772
- }
839
+ function getBalanceNative(_x5) {
840
+ return _getBalanceNative.apply(this, arguments);
841
+ }
842
+ return getBalanceNative;
843
+ }()
773
844
  }, {
774
845
  key: "getBalanceForeignPolkadotXcm",
775
- value: function getBalanceForeignPolkadotXcm(address, id) {
776
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
846
+ value: function () {
847
+ var _getBalanceForeignPolkadotXcm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(address, id) {
777
848
  var parsedId, response, obj;
778
849
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
779
850
  while (1) switch (_context5.prev = _context5.next) {
@@ -784,18 +855,22 @@ var PolkadotJsApi = /*#__PURE__*/function () {
784
855
  case 3:
785
856
  response = _context5.sent;
786
857
  obj = response.toJSON();
787
- return _context5.abrupt("return", obj.balance ? BigInt(obj.balance) : BigInt(0));
858
+ return _context5.abrupt("return", obj.balance ? BigInt(obj.balance) : 0n);
788
859
  case 6:
789
860
  case "end":
790
861
  return _context5.stop();
791
862
  }
792
863
  }, _callee5, this);
793
864
  }));
794
- }
865
+ function getBalanceForeignPolkadotXcm(_x6, _x7) {
866
+ return _getBalanceForeignPolkadotXcm.apply(this, arguments);
867
+ }
868
+ return getBalanceForeignPolkadotXcm;
869
+ }()
795
870
  }, {
796
871
  key: "getMythosForeignBalance",
797
- value: function getMythosForeignBalance(address) {
798
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
872
+ value: function () {
873
+ var _getMythosForeignBalance = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(address) {
799
874
  var response, obj;
800
875
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
801
876
  while (1) switch (_context6.prev = _context6.next) {
@@ -805,18 +880,22 @@ var PolkadotJsApi = /*#__PURE__*/function () {
805
880
  case 2:
806
881
  response = _context6.sent;
807
882
  obj = response.toJSON();
808
- return _context6.abrupt("return", obj.free ? BigInt(obj.free) : BigInt(0));
883
+ return _context6.abrupt("return", obj.free ? BigInt(obj.free) : 0n);
809
884
  case 5:
810
885
  case "end":
811
886
  return _context6.stop();
812
887
  }
813
888
  }, _callee6, this);
814
889
  }));
815
- }
890
+ function getMythosForeignBalance(_x8) {
891
+ return _getMythosForeignBalance.apply(this, arguments);
892
+ }
893
+ return getMythosForeignBalance;
894
+ }()
816
895
  }, {
817
896
  key: "getAssetHubForeignBalance",
818
- value: function getAssetHubForeignBalance(address, multiLocation) {
819
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
897
+ value: function () {
898
+ var _getAssetHubForeignBalance = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(address, multiLocation) {
820
899
  var response, obj;
821
900
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
822
901
  while (1) switch (_context7.prev = _context7.next) {
@@ -833,11 +912,15 @@ var PolkadotJsApi = /*#__PURE__*/function () {
833
912
  }
834
913
  }, _callee7, this);
835
914
  }));
836
- }
915
+ function getAssetHubForeignBalance(_x9, _x10) {
916
+ return _getAssetHubForeignBalance.apply(this, arguments);
917
+ }
918
+ return getAssetHubForeignBalance;
919
+ }()
837
920
  }, {
838
921
  key: "getForeignAssetsByIdBalance",
839
- value: function getForeignAssetsByIdBalance(address, assetId) {
840
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
922
+ value: function () {
923
+ var _getForeignAssetsByIdBalance = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(address, assetId) {
841
924
  var response, obj;
842
925
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
843
926
  while (1) switch (_context8.prev = _context8.next) {
@@ -854,11 +937,15 @@ var PolkadotJsApi = /*#__PURE__*/function () {
854
937
  }
855
938
  }, _callee8, this);
856
939
  }));
857
- }
940
+ function getForeignAssetsByIdBalance(_x11, _x12) {
941
+ return _getForeignAssetsByIdBalance.apply(this, arguments);
942
+ }
943
+ return getForeignAssetsByIdBalance;
944
+ }()
858
945
  }, {
859
946
  key: "getBalanceForeignBifrost",
860
- value: function getBalanceForeignBifrost(address, asset) {
861
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
947
+ value: function () {
948
+ var _getBalanceForeignBifrost = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(address, asset) {
862
949
  var currencySelection, response, accountData;
863
950
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
864
951
  while (1) switch (_context9.prev = _context9.next) {
@@ -869,18 +956,22 @@ var PolkadotJsApi = /*#__PURE__*/function () {
869
956
  case 3:
870
957
  response = _context9.sent;
871
958
  accountData = response ? response : null;
872
- return _context9.abrupt("return", accountData ? BigInt(accountData.free.toString()) : BigInt(0));
959
+ return _context9.abrupt("return", accountData ? BigInt(accountData.free.toString()) : 0n);
873
960
  case 6:
874
961
  case "end":
875
962
  return _context9.stop();
876
963
  }
877
964
  }, _callee9, this);
878
965
  }));
879
- }
966
+ function getBalanceForeignBifrost(_x13, _x14) {
967
+ return _getBalanceForeignBifrost.apply(this, arguments);
968
+ }
969
+ return getBalanceForeignBifrost;
970
+ }()
880
971
  }, {
881
972
  key: "getBalanceNativeAcala",
882
- value: function getBalanceNativeAcala(address, symbol) {
883
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
973
+ value: function () {
974
+ var _getBalanceNativeAcala = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(address, symbol) {
884
975
  var response, accountData;
885
976
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
886
977
  while (1) switch (_context10.prev = _context10.next) {
@@ -892,18 +983,22 @@ var PolkadotJsApi = /*#__PURE__*/function () {
892
983
  case 2:
893
984
  response = _context10.sent;
894
985
  accountData = response ? response : null;
895
- return _context10.abrupt("return", accountData ? BigInt(accountData.free.toString()) : BigInt(0));
986
+ return _context10.abrupt("return", accountData ? BigInt(accountData.free.toString()) : 0n);
896
987
  case 5:
897
988
  case "end":
898
989
  return _context10.stop();
899
990
  }
900
991
  }, _callee10, this);
901
992
  }));
902
- }
993
+ function getBalanceNativeAcala(_x15, _x16) {
994
+ return _getBalanceNativeAcala.apply(this, arguments);
995
+ }
996
+ return getBalanceNativeAcala;
997
+ }()
903
998
  }, {
904
999
  key: "getBalanceForeignXTokens",
905
- value: function getBalanceForeignXTokens(node, address, asset) {
906
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
1000
+ value: function () {
1001
+ var _getBalanceForeignXTokens = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(node, address, asset) {
907
1002
  var pallet, response, entry, accountData;
908
1003
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
909
1004
  while (1) switch (_context11.prev = _context11.next) {
@@ -917,28 +1012,32 @@ var PolkadotJsApi = /*#__PURE__*/function () {
917
1012
  case 4:
918
1013
  response = _context11.sent;
919
1014
  entry = response.find(function (_ref2) {
1015
+ var _asset$symbol, _asset$assetId, _assetItem$toHuman, _asset$symbol2, _assetItem$toHuman2, _asset$assetId2;
920
1016
  var _ref3 = _slicedToArray(_ref2, 2),
921
1017
  _ref3$0$args = _slicedToArray(_ref3[0].args, 2);
922
1018
  _ref3$0$args[0];
923
1019
  var assetItem = _ref3$0$args[1];
924
1020
  _ref3[1];
925
- var _a, _b, _c, _d, _e, _f;
926
1021
  var assetSymbol = assetItem.toString().toLowerCase();
927
- return assetSymbol === ((_a = asset.symbol) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || sdkCore.isForeignAsset(asset) && assetSymbol === ((_b = asset.assetId) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || Object.values((_c = assetItem.toHuman()) !== null && _c !== void 0 ? _c : {}).toString().toLowerCase() === ((_d = asset.symbol) === null || _d === void 0 ? void 0 : _d.toLowerCase()) || sdkCore.isForeignAsset(asset) && Object.values((_e = assetItem.toHuman()) !== null && _e !== void 0 ? _e : {}).toString().toLowerCase() === ((_f = asset.assetId) === null || _f === void 0 ? void 0 : _f.toLowerCase());
1022
+ return assetSymbol === ((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toLowerCase()) || sdkCore.isForeignAsset(asset) && assetSymbol === ((_asset$assetId = asset.assetId) === null || _asset$assetId === void 0 ? void 0 : _asset$assetId.toLowerCase()) || Object.values((_assetItem$toHuman = assetItem.toHuman()) !== null && _assetItem$toHuman !== void 0 ? _assetItem$toHuman : {}).toString().toLowerCase() === ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === void 0 ? void 0 : _asset$symbol2.toLowerCase()) || sdkCore.isForeignAsset(asset) && Object.values((_assetItem$toHuman2 = assetItem.toHuman()) !== null && _assetItem$toHuman2 !== void 0 ? _assetItem$toHuman2 : {}).toString().toLowerCase() === ((_asset$assetId2 = asset.assetId) === null || _asset$assetId2 === void 0 ? void 0 : _asset$assetId2.toLowerCase());
928
1023
  });
929
1024
  accountData = entry ? entry[1] : null;
930
- return _context11.abrupt("return", accountData ? BigInt(accountData.free.toString()) : BigInt(0));
1025
+ return _context11.abrupt("return", accountData ? BigInt(accountData.free.toString()) : 0n);
931
1026
  case 8:
932
1027
  case "end":
933
1028
  return _context11.stop();
934
1029
  }
935
1030
  }, _callee11, this);
936
1031
  }));
937
- }
1032
+ function getBalanceForeignXTokens(_x17, _x18, _x19) {
1033
+ return _getBalanceForeignXTokens.apply(this, arguments);
1034
+ }
1035
+ return getBalanceForeignXTokens;
1036
+ }()
938
1037
  }, {
939
1038
  key: "getBalanceForeignAssetsAccount",
940
- value: function getBalanceForeignAssetsAccount(address, assetId) {
941
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
1039
+ value: function () {
1040
+ var _getBalanceForeignAssetsAccount = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(address, assetId) {
942
1041
  var response, obj;
943
1042
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
944
1043
  while (1) switch (_context12.prev = _context12.next) {
@@ -955,11 +1054,15 @@ var PolkadotJsApi = /*#__PURE__*/function () {
955
1054
  }
956
1055
  }, _callee12, this);
957
1056
  }));
958
- }
1057
+ function getBalanceForeignAssetsAccount(_x20, _x21) {
1058
+ return _getBalanceForeignAssetsAccount.apply(this, arguments);
1059
+ }
1060
+ return getBalanceForeignAssetsAccount;
1061
+ }()
959
1062
  }, {
960
1063
  key: "getFromStorage",
961
- value: function getFromStorage(key) {
962
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
1064
+ value: function () {
1065
+ var _getFromStorage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(key) {
963
1066
  var response;
964
1067
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
965
1068
  while (1) switch (_context13.prev = _context13.next) {
@@ -975,7 +1078,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
975
1078
  }
976
1079
  }, _callee13, this);
977
1080
  }));
978
- }
1081
+ function getFromStorage(_x22) {
1082
+ return _getFromStorage.apply(this, arguments);
1083
+ }
1084
+ return getFromStorage;
1085
+ }()
979
1086
  }, {
980
1087
  key: "clone",
981
1088
  value: function clone() {
@@ -983,8 +1090,8 @@ var PolkadotJsApi = /*#__PURE__*/function () {
983
1090
  }
984
1091
  }, {
985
1092
  key: "createApiForNode",
986
- value: function createApiForNode(node) {
987
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
1093
+ value: function () {
1094
+ var _createApiForNode = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(node) {
988
1095
  var api;
989
1096
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
990
1097
  while (1) switch (_context14.prev = _context14.next) {
@@ -1000,64 +1107,67 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1000
1107
  }
1001
1108
  }, _callee14);
1002
1109
  }));
1003
- }
1110
+ function createApiForNode(_x23) {
1111
+ return _createApiForNode.apply(this, arguments);
1112
+ }
1113
+ return createApiForNode;
1114
+ }()
1004
1115
  }, {
1005
1116
  key: "getDryRun",
1006
- value: function getDryRun(_a) {
1007
- return __awaiter(this, arguments, void 0, function (_ref4) {
1008
- var _this = this;
1009
- var tx = _ref4.tx,
1010
- address = _ref4.address,
1011
- node = _ref4.node;
1012
- return /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
1013
- var supportsDryRunApi, result, isSuccess, moduleError, failureReason, executionFee, fee;
1014
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1015
- while (1) switch (_context15.prev = _context15.next) {
1016
- case 0:
1017
- supportsDryRunApi = sdkCore.getAssetsObject(node).supportsDryRunApi;
1018
- if (supportsDryRunApi) {
1019
- _context15.next = 3;
1020
- break;
1021
- }
1022
- throw new Error("DryRunApi is not available on node ".concat(node));
1023
- case 3:
1024
- _context15.next = 5;
1025
- return _this.api.call.dryRunApi.dryRunCall({
1026
- system: {
1027
- Signed: address
1028
- }
1029
- }, tx);
1030
- case 5:
1031
- result = _context15.sent.toHuman();
1032
- isSuccess = result.Ok && result.Ok.executionResult.Ok;
1033
- if (isSuccess) {
1034
- _context15.next = 11;
1035
- break;
1117
+ value: function () {
1118
+ var _getDryRun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(_ref4) {
1119
+ var tx, address, node, supportsDryRunApi, result, isSuccess, moduleError, failureReason, executionFee, fee;
1120
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1121
+ while (1) switch (_context15.prev = _context15.next) {
1122
+ case 0:
1123
+ tx = _ref4.tx, address = _ref4.address, node = _ref4.node;
1124
+ supportsDryRunApi = sdkCore.getAssetsObject(node).supportsDryRunApi;
1125
+ if (supportsDryRunApi) {
1126
+ _context15.next = 4;
1127
+ break;
1128
+ }
1129
+ throw new Error("DryRunApi is not available on node ".concat(node));
1130
+ case 4:
1131
+ _context15.next = 6;
1132
+ return this.api.call.dryRunApi.dryRunCall({
1133
+ system: {
1134
+ Signed: address
1036
1135
  }
1037
- moduleError = result.Ok.executionResult.Err.error.Module;
1038
- failureReason = sdkCore.resolveModuleError(node, moduleError);
1039
- return _context15.abrupt("return", {
1040
- success: false,
1041
- failureReason: failureReason
1042
- });
1043
- case 11:
1044
- _context15.next = 13;
1045
- return _this.calculateTransactionFee(tx, address);
1046
- case 13:
1047
- executionFee = _context15.sent;
1048
- fee = sdkCore.computeFeeFromDryRunPjs(result, node, executionFee);
1049
- return _context15.abrupt("return", {
1050
- success: true,
1051
- fee: fee
1052
- });
1053
- case 16:
1054
- case "end":
1055
- return _context15.stop();
1056
- }
1057
- }, _callee15);
1058
- })();
1059
- });
1060
- }
1136
+ }, tx);
1137
+ case 6:
1138
+ result = _context15.sent.toHuman();
1139
+ isSuccess = result.Ok && result.Ok.executionResult.Ok;
1140
+ if (isSuccess) {
1141
+ _context15.next = 12;
1142
+ break;
1143
+ }
1144
+ moduleError = result.Ok.executionResult.Err.error.Module;
1145
+ failureReason = sdkCore.resolveModuleError(node, moduleError);
1146
+ return _context15.abrupt("return", {
1147
+ success: false,
1148
+ failureReason: failureReason
1149
+ });
1150
+ case 12:
1151
+ _context15.next = 14;
1152
+ return this.calculateTransactionFee(tx, address);
1153
+ case 14:
1154
+ executionFee = _context15.sent;
1155
+ fee = sdkCore.computeFeeFromDryRunPjs(result, node, executionFee);
1156
+ return _context15.abrupt("return", {
1157
+ success: true,
1158
+ fee: fee
1159
+ });
1160
+ case 17:
1161
+ case "end":
1162
+ return _context15.stop();
1163
+ }
1164
+ }, _callee15, this);
1165
+ }));
1166
+ function getDryRun(_x24) {
1167
+ return _getDryRun.apply(this, arguments);
1168
+ }
1169
+ return getDryRun;
1170
+ }()
1061
1171
  }, {
1062
1172
  key: "setDisconnectAllowed",
1063
1173
  value: function setDisconnectAllowed(allowed) {
@@ -1070,8 +1180,8 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1070
1180
  }
1071
1181
  }, {
1072
1182
  key: "disconnect",
1073
- value: function disconnect() {
1074
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1183
+ value: function () {
1184
+ var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1075
1185
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1076
1186
  while (1) switch (_context16.prev = _context16.next) {
1077
1187
  case 0:
@@ -1093,7 +1203,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1093
1203
  }
1094
1204
  }, _callee16, this);
1095
1205
  }));
1096
- }
1206
+ function disconnect() {
1207
+ return _disconnect.apply(this, arguments);
1208
+ }
1209
+ return disconnect;
1210
+ }()
1097
1211
  }]);
1098
1212
  }();
1099
1213
 
@@ -1102,15 +1216,15 @@ var createApiInstanceForNode = function createApiInstanceForNode(node) {
1102
1216
  return sdkCore.createApiInstanceForNode(pjsApi, node);
1103
1217
  };
1104
1218
  var createPolkadotJsApiCall = function createPolkadotJsApiCall(apiCall) {
1105
- return function (options) {
1106
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1219
+ return /*#__PURE__*/function () {
1220
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
1107
1221
  var pjsApi, optionsWithApi;
1108
1222
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1109
1223
  while (1) switch (_context.prev = _context.next) {
1110
1224
  case 0:
1111
1225
  pjsApi = new PolkadotJsApi();
1112
1226
  pjsApi.setApi(options.api);
1113
- optionsWithApi = Object.assign(Object.assign({}, options), {
1227
+ optionsWithApi = _objectSpread2(_objectSpread2({}, options), {}, {
1114
1228
  api: pjsApi
1115
1229
  });
1116
1230
  return _context.abrupt("return", apiCall(optionsWithApi));
@@ -1120,7 +1234,10 @@ var createPolkadotJsApiCall = function createPolkadotJsApiCall(apiCall) {
1120
1234
  }
1121
1235
  }, _callee);
1122
1236
  }));
1123
- };
1237
+ return function (_x) {
1238
+ return _ref.apply(this, arguments);
1239
+ };
1240
+ }();
1124
1241
  };
1125
1242
 
1126
1243
  /**
@@ -1128,19 +1245,10 @@ var createPolkadotJsApiCall = function createPolkadotJsApiCall(apiCall) {
1128
1245
  * @param options - The transfer options.
1129
1246
  * @returns An extrinsic to be signed and sent.
1130
1247
  */
1131
- var send = function send(options) {
1132
- var pjsApi = new PolkadotJsApi();
1133
- pjsApi.setApi(options.api);
1134
- var destPjsApi = new PolkadotJsApi();
1135
- destPjsApi.setApi(options.destApiForKeepAlive);
1136
- return sdkCore.send(Object.assign(Object.assign({}, options), {
1137
- api: pjsApi,
1138
- destApiForKeepAlive: destPjsApi
1139
- }));
1140
- };
1248
+ var send = createPolkadotJsApiCall(sdkCore.send);
1141
1249
  var getDryRun = createPolkadotJsApiCall(sdkCore.getDryRun);
1142
1250
  var transferEthToPolkadot = function transferEthToPolkadot(options) {
1143
- return transferEthToPolkadot$1(Object.assign(Object.assign({}, options), {
1251
+ return transferEthToPolkadot$1(_objectSpread2(_objectSpread2({}, options), {}, {
1144
1252
  api: new PolkadotJsApi()
1145
1253
  }));
1146
1254
  };
@@ -1190,15 +1298,34 @@ var getTransferableAmount = createPolkadotJsApiCall(sdkCore.getTransferableAmoun
1190
1298
 
1191
1299
  var assets = /*#__PURE__*/Object.freeze({
1192
1300
  __proto__: null,
1301
+ Foreign: sdkCore.Foreign,
1302
+ ForeignAbstract: sdkCore.ForeignAbstract,
1303
+ Native: sdkCore.Native,
1304
+ Override: sdkCore.Override,
1193
1305
  claimAssets: claimAssets,
1306
+ getAllAssetsSymbols: sdkCore.getAllAssetsSymbols,
1194
1307
  getAssetBalance: getAssetBalance,
1308
+ getAssetBySymbolOrId: sdkCore.getAssetBySymbolOrId,
1309
+ getAssetDecimals: sdkCore.getAssetDecimals,
1310
+ getAssetId: sdkCore.getAssetId,
1311
+ getAssets: sdkCore.getAssets,
1312
+ getAssetsObject: sdkCore.getAssetsObject,
1195
1313
  getBalanceForeign: getBalanceForeign,
1196
1314
  getBalanceNative: getBalanceNative,
1315
+ getExistentialDeposit: sdkCore.getExistentialDeposit,
1197
1316
  getMaxForeignTransferableAmount: getMaxForeignTransferableAmount,
1198
1317
  getMaxNativeTransferableAmount: getMaxNativeTransferableAmount,
1318
+ getNativeAssetSymbol: sdkCore.getNativeAssetSymbol,
1319
+ getNativeAssets: sdkCore.getNativeAssets,
1199
1320
  getOriginFeeDetails: getOriginFeeDetails,
1321
+ getOtherAssets: sdkCore.getOtherAssets,
1322
+ getRelayChainSymbol: sdkCore.getRelayChainSymbol,
1323
+ getSupportedAssets: sdkCore.getSupportedAssets,
1324
+ getTNode: sdkCore.getTNode,
1200
1325
  getTransferInfo: getTransferInfo,
1201
- getTransferableAmount: getTransferableAmount
1326
+ getTransferableAmount: getTransferableAmount,
1327
+ hasSupportForAsset: sdkCore.hasSupportForAsset,
1328
+ isNodeEvm: sdkCore.isNodeEvm
1202
1329
  });
1203
1330
 
1204
1331
  /**
@@ -1272,9 +1399,10 @@ var EvmBuilderClass = /*#__PURE__*/function () {
1272
1399
  */
1273
1400
  }, {
1274
1401
  key: "build",
1275
- value: function build() {
1276
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1277
- var _a, _b, requiredParams, _i, _requiredParams, param;
1402
+ value: (function () {
1403
+ var _build = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1404
+ var _yield$transferEthToP, _yield$transferEthToP2;
1405
+ var requiredParams, _i, _requiredParams, param;
1278
1406
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1279
1407
  while (1) switch (_context.prev = _context.next) {
1280
1408
  case 0:
@@ -1308,13 +1436,13 @@ var EvmBuilderClass = /*#__PURE__*/function () {
1308
1436
  _context.next = 15;
1309
1437
  return transferEthToPolkadot$1(this._options);
1310
1438
  case 15:
1311
- _context.t2 = _a = _context.sent.result.success;
1439
+ _context.t2 = _yield$transferEthToP2 = _context.sent.result.success;
1312
1440
  _context.t1 = _context.t2 === null;
1313
1441
  if (_context.t1) {
1314
1442
  _context.next = 19;
1315
1443
  break;
1316
1444
  }
1317
- _context.t1 = _a === void 0;
1445
+ _context.t1 = _yield$transferEthToP2 === void 0;
1318
1446
  case 19:
1319
1447
  if (!_context.t1) {
1320
1448
  _context.next = 23;
@@ -1324,21 +1452,21 @@ var EvmBuilderClass = /*#__PURE__*/function () {
1324
1452
  _context.next = 24;
1325
1453
  break;
1326
1454
  case 23:
1327
- _context.t3 = _a.ethereum.blockHash;
1455
+ _context.t3 = _yield$transferEthToP2.ethereum.blockHash;
1328
1456
  case 24:
1329
- _context.t4 = _b = _context.t3;
1457
+ _context.t4 = _yield$transferEthToP = _context.t3;
1330
1458
  _context.t0 = _context.t4 !== null;
1331
1459
  if (!_context.t0) {
1332
1460
  _context.next = 28;
1333
1461
  break;
1334
1462
  }
1335
- _context.t0 = _b !== void 0;
1463
+ _context.t0 = _yield$transferEthToP !== void 0;
1336
1464
  case 28:
1337
1465
  if (!_context.t0) {
1338
1466
  _context.next = 32;
1339
1467
  break;
1340
1468
  }
1341
- _context.t5 = _b;
1469
+ _context.t5 = _yield$transferEthToP;
1342
1470
  _context.next = 33;
1343
1471
  break;
1344
1472
  case 32:
@@ -1351,7 +1479,11 @@ var EvmBuilderClass = /*#__PURE__*/function () {
1351
1479
  }
1352
1480
  }, _callee, this);
1353
1481
  }));
1354
- }
1482
+ function build() {
1483
+ return _build.apply(this, arguments);
1484
+ }
1485
+ return build;
1486
+ }())
1355
1487
  }]);
1356
1488
  }();
1357
1489
  /**