@paraspell/sdk-core 11.9.0 → 11.9.1

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
@@ -12888,6 +12888,7 @@ var createCustomXcm = function createCustomXcm(_ref, isDotAsset) {
12888
12888
  refundFee = fees.refundFee,
12889
12889
  destFee = fees.destFee;
12890
12890
  var feeAssetLocation = !isDotAsset ? RELAY_LOCATION : assetInfo.location;
12891
+ var feeLocLocalized = localizeLocation(dest.chain, feeAssetLocation);
12891
12892
  var asset = createAsset(version, assetInfo.amount, localizeLocation(dest.chain, assetInfo.location));
12892
12893
  var depositInstruction = {
12893
12894
  DepositAsset: {
@@ -12919,7 +12920,7 @@ var createCustomXcm = function createCustomXcm(_ref, isDotAsset) {
12919
12920
  };
12920
12921
  var buyExecution = {
12921
12922
  BuyExecution: {
12922
- fees: createAsset(version, buyExecutionAmount, feeAssetLocation),
12923
+ fees: createAsset(version, buyExecutionAmount, feeLocLocalized),
12923
12924
  weight_limit: 'Unlimited'
12924
12925
  }
12925
12926
  };
@@ -13776,6 +13777,34 @@ var GeneralBuilder = /*#__PURE__*/function () {
13776
13777
  value: function buildInternal() {
13777
13778
  return this.buildCommon(true);
13778
13779
  }
13780
+ }, {
13781
+ key: "prepareNormalizedOptions",
13782
+ value: function () {
13783
+ var _prepareNormalizedOptions = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
13784
+ var builder, buildTx, normalizedOptions;
13785
+ return _regenerator().w(function (_context2) {
13786
+ while (1) switch (_context2.n) {
13787
+ case 0:
13788
+ builder = this.currency(_objectSpread2(_objectSpread2({}, options.currency), {}, {
13789
+ amount: MIN_AMOUNT.toString()
13790
+ }));
13791
+ buildTx = builder.createTxFactory();
13792
+ _context2.n = 1;
13793
+ return normalizeAmountAll(this.api, buildTx, options);
13794
+ case 1:
13795
+ normalizedOptions = _context2.v;
13796
+ return _context2.a(2, {
13797
+ normalizedOptions: normalizedOptions,
13798
+ buildTx: buildTx
13799
+ });
13800
+ }
13801
+ }, _callee2, this);
13802
+ }));
13803
+ function prepareNormalizedOptions(_x2) {
13804
+ return _prepareNormalizedOptions.apply(this, arguments);
13805
+ }
13806
+ return prepareNormalizedOptions;
13807
+ }()
13779
13808
  /**
13780
13809
  * Builds and returns the transfer extrinsic.
13781
13810
  *
@@ -13784,19 +13813,19 @@ var GeneralBuilder = /*#__PURE__*/function () {
13784
13813
  }, {
13785
13814
  key: "build",
13786
13815
  value: (function () {
13787
- var _build = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
13816
+ var _build = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
13788
13817
  var _yield$this$buildComm, tx;
13789
- return _regenerator().w(function (_context2) {
13790
- while (1) switch (_context2.n) {
13818
+ return _regenerator().w(function (_context3) {
13819
+ while (1) switch (_context3.n) {
13791
13820
  case 0:
13792
- _context2.n = 1;
13821
+ _context3.n = 1;
13793
13822
  return this.buildCommon();
13794
13823
  case 1:
13795
- _yield$this$buildComm = _context2.v;
13824
+ _yield$this$buildComm = _context3.v;
13796
13825
  tx = _yield$this$buildComm.tx;
13797
- return _context2.a(2, tx);
13826
+ return _context3.a(2, tx);
13798
13827
  }
13799
- }, _callee2, this);
13828
+ }, _callee3, this);
13800
13829
  }));
13801
13830
  function build() {
13802
13831
  return _build.apply(this, arguments);
@@ -13806,54 +13835,50 @@ var GeneralBuilder = /*#__PURE__*/function () {
13806
13835
  }, {
13807
13836
  key: "buildCommon",
13808
13837
  value: function () {
13809
- var _buildCommon = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
13838
+ var _buildCommon = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
13810
13839
  var isCalledInternally,
13811
13840
  _this$_options,
13812
13841
  from,
13813
13842
  to,
13814
- builder,
13815
- createTx,
13843
+ _yield$this$prepareNo,
13816
13844
  normalizedOptions,
13817
13845
  tx,
13818
- _args3 = arguments;
13819
- return _regenerator().w(function (_context3) {
13820
- while (1) switch (_context3.n) {
13846
+ _args4 = arguments;
13847
+ return _regenerator().w(function (_context4) {
13848
+ while (1) switch (_context4.n) {
13821
13849
  case 0:
13822
- isCalledInternally = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;
13850
+ isCalledInternally = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : false;
13823
13851
  if (!(!this.batchManager.isEmpty() && !isCalledInternally)) {
13824
- _context3.n = 1;
13852
+ _context4.n = 1;
13825
13853
  break;
13826
13854
  }
13827
13855
  throw new InvalidParameterError('Transaction manager contains batched items. Use buildBatch() to process them.');
13828
13856
  case 1:
13829
13857
  _this$_options = this._options, from = _this$_options.from, to = _this$_options.to;
13830
13858
  if (!(!sdkCommon.isTLocation(to) && sdkCommon.isRelayChain(from) && sdkCommon.isRelayChain(to) && from !== to)) {
13831
- _context3.n = 2;
13859
+ _context4.n = 2;
13832
13860
  break;
13833
13861
  }
13834
13862
  throw new InvalidParameterError('Transfers between relay chains are not yet supported.');
13835
13863
  case 2:
13836
- builder = this.currency(_objectSpread2(_objectSpread2({}, this._options.currency), {}, {
13837
- amount: MIN_AMOUNT.toString()
13838
- }));
13839
- createTx = builder.createTxFactory();
13840
- _context3.n = 3;
13841
- return normalizeAmountAll(this.api, createTx, this._options);
13864
+ _context4.n = 3;
13865
+ return this.prepareNormalizedOptions(this._options);
13842
13866
  case 3:
13843
- normalizedOptions = _context3.v;
13844
- _context3.n = 4;
13867
+ _yield$this$prepareNo = _context4.v;
13868
+ normalizedOptions = _yield$this$prepareNo.normalizedOptions;
13869
+ _context4.n = 4;
13845
13870
  return send(normalizedOptions);
13846
13871
  case 4:
13847
- tx = _context3.v;
13848
- _context3.n = 5;
13872
+ tx = _context4.v;
13873
+ _context4.n = 5;
13849
13874
  return this.maybePerformXcmFormatCheck(tx, normalizedOptions, isCalledInternally);
13850
13875
  case 5:
13851
- return _context3.a(2, {
13876
+ return _context4.a(2, {
13852
13877
  tx: tx,
13853
13878
  options: normalizedOptions
13854
13879
  });
13855
13880
  }
13856
- }, _callee3, this);
13881
+ }, _callee4, this);
13857
13882
  }));
13858
13883
  function buildCommon() {
13859
13884
  return _buildCommon.apply(this, arguments);
@@ -13863,37 +13888,37 @@ var GeneralBuilder = /*#__PURE__*/function () {
13863
13888
  }, {
13864
13889
  key: "maybePerformXcmFormatCheck",
13865
13890
  value: function () {
13866
- var _maybePerformXcmFormatCheck = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(tx, options, isCalledInternally) {
13891
+ var _maybePerformXcmFormatCheck = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(tx, options, isCalledInternally) {
13867
13892
  var senderAddress, config, dryRunResult;
13868
- return _regenerator().w(function (_context4) {
13869
- while (1) switch (_context4.n) {
13893
+ return _regenerator().w(function (_context5) {
13894
+ while (1) switch (_context5.n) {
13870
13895
  case 0:
13871
13896
  senderAddress = options.senderAddress;
13872
13897
  config = this.api.getConfig();
13873
13898
  if (!(isConfig(config) && config.xcmFormatCheck && !isCalledInternally)) {
13874
- _context4.n = 2;
13899
+ _context5.n = 2;
13875
13900
  break;
13876
13901
  }
13877
13902
  assertSenderAddress(senderAddress);
13878
- _context4.n = 1;
13903
+ _context5.n = 1;
13879
13904
  return buildDryRun(this.api, tx, _objectSpread2(_objectSpread2({}, options), {}, {
13880
13905
  senderAddress: senderAddress
13881
13906
  }), {
13882
13907
  sentAssetMintMode: 'bypass'
13883
13908
  });
13884
13909
  case 1:
13885
- dryRunResult = _context4.v;
13910
+ dryRunResult = _context5.v;
13886
13911
  if (!dryRunResult.failureReason) {
13887
- _context4.n = 2;
13912
+ _context5.n = 2;
13888
13913
  break;
13889
13914
  }
13890
13915
  throw new DryRunFailedError(dryRunResult.failureReason, dryRunResult.failureChain);
13891
13916
  case 2:
13892
- return _context4.a(2);
13917
+ return _context5.a(2);
13893
13918
  }
13894
- }, _callee4, this);
13919
+ }, _callee5, this);
13895
13920
  }));
13896
- function maybePerformXcmFormatCheck(_x2, _x3, _x4) {
13921
+ function maybePerformXcmFormatCheck(_x3, _x4, _x5) {
13897
13922
  return _maybePerformXcmFormatCheck.apply(this, arguments);
13898
13923
  }
13899
13924
  return maybePerformXcmFormatCheck;
@@ -13901,20 +13926,20 @@ var GeneralBuilder = /*#__PURE__*/function () {
13901
13926
  }, {
13902
13927
  key: "dryRun",
13903
13928
  value: function () {
13904
- var _dryRun = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
13929
+ var _dryRun = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
13905
13930
  var _yield$this$buildInte, tx, options;
13906
- return _regenerator().w(function (_context5) {
13907
- while (1) switch (_context5.n) {
13931
+ return _regenerator().w(function (_context6) {
13932
+ while (1) switch (_context6.n) {
13908
13933
  case 0:
13909
- _context5.n = 1;
13934
+ _context6.n = 1;
13910
13935
  return this.buildInternal();
13911
13936
  case 1:
13912
- _yield$this$buildInte = _context5.v;
13937
+ _yield$this$buildInte = _context6.v;
13913
13938
  tx = _yield$this$buildInte.tx;
13914
13939
  options = _yield$this$buildInte.options;
13915
- return _context5.a(2, buildDryRun(this.api, tx, options));
13940
+ return _context6.a(2, buildDryRun(this.api, tx, options));
13916
13941
  }
13917
- }, _callee5, this);
13942
+ }, _callee6, this);
13918
13943
  }));
13919
13944
  function dryRun() {
13920
13945
  return _dryRun.apply(this, arguments);
@@ -13924,25 +13949,25 @@ var GeneralBuilder = /*#__PURE__*/function () {
13924
13949
  }, {
13925
13950
  key: "dryRunPreview",
13926
13951
  value: function () {
13927
- var _dryRunPreview = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(dryRunOptions) {
13952
+ var _dryRunPreview = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(dryRunOptions) {
13928
13953
  var _yield$this$buildInte2, tx, options;
13929
- return _regenerator().w(function (_context6) {
13930
- while (1) switch (_context6.n) {
13954
+ return _regenerator().w(function (_context7) {
13955
+ while (1) switch (_context7.n) {
13931
13956
  case 0:
13932
- _context6.n = 1;
13957
+ _context7.n = 1;
13933
13958
  return this.buildInternal();
13934
13959
  case 1:
13935
- _yield$this$buildInte2 = _context6.v;
13960
+ _yield$this$buildInte2 = _context7.v;
13936
13961
  tx = _yield$this$buildInte2.tx;
13937
13962
  options = _yield$this$buildInte2.options;
13938
- return _context6.a(2, buildDryRun(this.api, tx, options, {
13963
+ return _context7.a(2, buildDryRun(this.api, tx, options, {
13939
13964
  sentAssetMintMode: 'preview',
13940
13965
  mintFeeAssets: dryRunOptions === null || dryRunOptions === void 0 ? void 0 : dryRunOptions.mintFeeAssets
13941
13966
  }));
13942
13967
  }
13943
- }, _callee6, this);
13968
+ }, _callee7, this);
13944
13969
  }));
13945
- function dryRunPreview(_x5) {
13970
+ function dryRunPreview(_x6) {
13946
13971
  return _dryRunPreview.apply(this, arguments);
13947
13972
  }
13948
13973
  return dryRunPreview;
@@ -13965,21 +13990,27 @@ var GeneralBuilder = /*#__PURE__*/function () {
13965
13990
  }, {
13966
13991
  key: "getXcmFee",
13967
13992
  value: (function () {
13968
- var _getXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(options) {
13993
+ var _getXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(options) {
13969
13994
  var _options$disableFallb;
13970
- var _this$_options2, from, to, address, senderAddress, feeAsset, currency, disableFallback;
13971
- return _regenerator().w(function (_context7) {
13972
- while (1) switch (_context7.p = _context7.n) {
13995
+ var disableFallback, _yield$this$prepareNo2, normalizedOptions, buildTx, api, from, to, senderAddress, address, currency, feeAsset;
13996
+ return _regenerator().w(function (_context8) {
13997
+ while (1) switch (_context8.p = _context8.n) {
13973
13998
  case 0:
13974
- _this$_options2 = this._options, from = _this$_options2.from, to = _this$_options2.to, address = _this$_options2.address, senderAddress = _this$_options2.senderAddress, feeAsset = _this$_options2.feeAsset, currency = _this$_options2.currency;
13999
+ disableFallback = (_options$disableFallb = options === null || options === void 0 ? void 0 : options.disableFallback) !== null && _options$disableFallb !== void 0 ? _options$disableFallb : false;
14000
+ _context8.n = 1;
14001
+ return this.prepareNormalizedOptions(this._options);
14002
+ case 1:
14003
+ _yield$this$prepareNo2 = _context8.v;
14004
+ normalizedOptions = _yield$this$prepareNo2.normalizedOptions;
14005
+ buildTx = _yield$this$prepareNo2.buildTx;
14006
+ api = normalizedOptions.api, from = normalizedOptions.from, to = normalizedOptions.to, senderAddress = normalizedOptions.senderAddress, address = normalizedOptions.address, currency = normalizedOptions.currency, feeAsset = normalizedOptions.feeAsset;
13975
14007
  assertToIsString(to);
13976
14008
  assertAddressIsString(address);
13977
- disableFallback = (_options$disableFallb = options === null || options === void 0 ? void 0 : options.disableFallback) !== null && _options$disableFallb !== void 0 ? _options$disableFallb : false;
13978
- _context7.p = 1;
13979
- _context7.n = 2;
14009
+ _context8.p = 2;
14010
+ _context8.n = 3;
13980
14011
  return getXcmFee({
13981
- api: this.api,
13982
- buildTx: this.createTxFactory(),
14012
+ api: api,
14013
+ buildTx: buildTx,
13983
14014
  origin: from,
13984
14015
  destination: to,
13985
14016
  senderAddress: senderAddress,
@@ -13988,20 +14019,20 @@ var GeneralBuilder = /*#__PURE__*/function () {
13988
14019
  feeAsset: feeAsset,
13989
14020
  disableFallback: disableFallback
13990
14021
  });
13991
- case 2:
13992
- return _context7.a(2, _context7.v);
13993
14022
  case 3:
13994
- _context7.p = 3;
13995
- _context7.n = 4;
13996
- return this.api.disconnect();
14023
+ return _context8.a(2, _context8.v);
13997
14024
  case 4:
13998
- return _context7.f(3);
14025
+ _context8.p = 4;
14026
+ _context8.n = 5;
14027
+ return this.api.disconnect();
13999
14028
  case 5:
14000
- return _context7.a(2);
14029
+ return _context8.f(4);
14030
+ case 6:
14031
+ return _context8.a(2);
14001
14032
  }
14002
- }, _callee7, this, [[1,, 3, 5]]);
14033
+ }, _callee8, this, [[2,, 4, 6]]);
14003
14034
  }));
14004
- function getXcmFee$1(_x6) {
14035
+ function getXcmFee$1(_x7) {
14005
14036
  return _getXcmFee2.apply(this, arguments);
14006
14037
  }
14007
14038
  return getXcmFee$1;
@@ -14015,31 +14046,38 @@ var GeneralBuilder = /*#__PURE__*/function () {
14015
14046
  }, {
14016
14047
  key: "getOriginXcmFee",
14017
14048
  value: (function () {
14018
- var _getOriginXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
14049
+ var _getOriginXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
14019
14050
  var _ref,
14020
14051
  disableFallback,
14021
- _this$_options3,
14052
+ _yield$this$prepareNo3,
14053
+ normalizedOptions,
14054
+ buildTx,
14055
+ api,
14022
14056
  from,
14023
14057
  to,
14024
14058
  senderAddress,
14025
14059
  currency,
14026
14060
  feeAsset,
14027
- api,
14028
- _args8 = arguments;
14029
- return _regenerator().w(function (_context8) {
14030
- while (1) switch (_context8.p = _context8.n) {
14061
+ _args9 = arguments;
14062
+ return _regenerator().w(function (_context9) {
14063
+ while (1) switch (_context9.p = _context9.n) {
14031
14064
  case 0:
14032
- _ref = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {
14065
+ _ref = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {
14033
14066
  disableFallback: false
14034
14067
  }, disableFallback = _ref.disableFallback;
14035
- _this$_options3 = this._options, from = _this$_options3.from, to = _this$_options3.to, senderAddress = _this$_options3.senderAddress, currency = _this$_options3.currency, feeAsset = _this$_options3.feeAsset;
14068
+ _context9.n = 1;
14069
+ return this.prepareNormalizedOptions(this._options);
14070
+ case 1:
14071
+ _yield$this$prepareNo3 = _context9.v;
14072
+ normalizedOptions = _yield$this$prepareNo3.normalizedOptions;
14073
+ buildTx = _yield$this$prepareNo3.buildTx;
14074
+ api = normalizedOptions.api, from = normalizedOptions.from, to = normalizedOptions.to, senderAddress = normalizedOptions.senderAddress, currency = normalizedOptions.currency, feeAsset = normalizedOptions.feeAsset;
14036
14075
  assertToIsString(to);
14037
- api = this.api;
14038
- _context8.p = 1;
14039
- _context8.n = 2;
14076
+ _context9.p = 2;
14077
+ _context9.n = 3;
14040
14078
  return getOriginXcmFee({
14041
14079
  api: api,
14042
- buildTx: this.createTxFactory(),
14080
+ buildTx: buildTx,
14043
14081
  origin: from,
14044
14082
  destination: to,
14045
14083
  senderAddress: senderAddress,
@@ -14047,18 +14085,18 @@ var GeneralBuilder = /*#__PURE__*/function () {
14047
14085
  feeAsset: feeAsset,
14048
14086
  disableFallback: disableFallback
14049
14087
  });
14050
- case 2:
14051
- return _context8.a(2, _context8.v);
14052
14088
  case 3:
14053
- _context8.p = 3;
14054
- _context8.n = 4;
14055
- return this.api.disconnect();
14089
+ return _context9.a(2, _context9.v);
14056
14090
  case 4:
14057
- return _context8.f(3);
14091
+ _context9.p = 4;
14092
+ _context9.n = 5;
14093
+ return this.api.disconnect();
14058
14094
  case 5:
14059
- return _context8.a(2);
14095
+ return _context9.f(4);
14096
+ case 6:
14097
+ return _context9.a(2);
14060
14098
  }
14061
- }, _callee8, this, [[1,, 3, 5]]);
14099
+ }, _callee9, this, [[2,, 4, 6]]);
14062
14100
  }));
14063
14101
  function getOriginXcmFee$1() {
14064
14102
  return _getOriginXcmFee2.apply(this, arguments);
@@ -14074,23 +14112,28 @@ var GeneralBuilder = /*#__PURE__*/function () {
14074
14112
  }, {
14075
14113
  key: "getXcmFeeEstimate",
14076
14114
  value: (function () {
14077
- var _getXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
14078
- var _this$_options4, from, to, address, senderAddress, currency, _yield$this$buildInte3, tx;
14079
- return _regenerator().w(function (_context9) {
14080
- while (1) switch (_context9.p = _context9.n) {
14115
+ var _getXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
14116
+ var _yield$this$prepareNo4, normalizedOptions, buildTx, api, from, to, address, senderAddress, currency, tx;
14117
+ return _regenerator().w(function (_context0) {
14118
+ while (1) switch (_context0.p = _context0.n) {
14081
14119
  case 0:
14082
- _this$_options4 = this._options, from = _this$_options4.from, to = _this$_options4.to, address = _this$_options4.address, senderAddress = _this$_options4.senderAddress, currency = _this$_options4.currency;
14120
+ _context0.n = 1;
14121
+ return this.prepareNormalizedOptions(this._options);
14122
+ case 1:
14123
+ _yield$this$prepareNo4 = _context0.v;
14124
+ normalizedOptions = _yield$this$prepareNo4.normalizedOptions;
14125
+ buildTx = _yield$this$prepareNo4.buildTx;
14126
+ api = normalizedOptions.api, from = normalizedOptions.from, to = normalizedOptions.to, address = normalizedOptions.address, senderAddress = normalizedOptions.senderAddress, currency = normalizedOptions.currency;
14083
14127
  assertToIsString(to);
14084
14128
  assertAddressIsString(address);
14085
- _context9.n = 1;
14086
- return this.buildInternal();
14087
- case 1:
14088
- _yield$this$buildInte3 = _context9.v;
14089
- tx = _yield$this$buildInte3.tx;
14090
- _context9.p = 2;
14091
- _context9.n = 3;
14129
+ _context0.n = 2;
14130
+ return buildTx();
14131
+ case 2:
14132
+ tx = _context0.v;
14133
+ _context0.p = 3;
14134
+ _context0.n = 4;
14092
14135
  return getXcmFeeEstimate({
14093
- api: this.api,
14136
+ api: api,
14094
14137
  tx: tx,
14095
14138
  origin: from,
14096
14139
  destination: to,
@@ -14098,18 +14141,18 @@ var GeneralBuilder = /*#__PURE__*/function () {
14098
14141
  senderAddress: senderAddress,
14099
14142
  currency: currency
14100
14143
  });
14101
- case 3:
14102
- return _context9.a(2, _context9.v);
14103
14144
  case 4:
14104
- _context9.p = 4;
14105
- _context9.n = 5;
14106
- return this.api.disconnect();
14145
+ return _context0.a(2, _context0.v);
14107
14146
  case 5:
14108
- return _context9.f(4);
14147
+ _context0.p = 5;
14148
+ _context0.n = 6;
14149
+ return this.api.disconnect();
14109
14150
  case 6:
14110
- return _context9.a(2);
14151
+ return _context0.f(5);
14152
+ case 7:
14153
+ return _context0.a(2);
14111
14154
  }
14112
- }, _callee9, this, [[2,, 4, 6]]);
14155
+ }, _callee0, this, [[3,, 5, 7]]);
14113
14156
  }));
14114
14157
  function getXcmFeeEstimate$1() {
14115
14158
  return _getXcmFeeEstimate2.apply(this, arguments);
@@ -14125,40 +14168,45 @@ var GeneralBuilder = /*#__PURE__*/function () {
14125
14168
  }, {
14126
14169
  key: "getOriginXcmFeeEstimate",
14127
14170
  value: (function () {
14128
- var _getOriginXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
14129
- var _this$_options5, from, to, senderAddress, currency, _yield$this$buildInte4, tx;
14130
- return _regenerator().w(function (_context0) {
14131
- while (1) switch (_context0.p = _context0.n) {
14171
+ var _getOriginXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
14172
+ var _yield$this$prepareNo5, normalizedOptions, buildTx, api, from, to, senderAddress, currency, tx;
14173
+ return _regenerator().w(function (_context1) {
14174
+ while (1) switch (_context1.p = _context1.n) {
14132
14175
  case 0:
14133
- _this$_options5 = this._options, from = _this$_options5.from, to = _this$_options5.to, senderAddress = _this$_options5.senderAddress, currency = _this$_options5.currency;
14134
- assertToIsString(to);
14135
- _context0.n = 1;
14136
- return this.buildInternal();
14176
+ _context1.n = 1;
14177
+ return this.prepareNormalizedOptions(this._options);
14137
14178
  case 1:
14138
- _yield$this$buildInte4 = _context0.v;
14139
- tx = _yield$this$buildInte4.tx;
14140
- _context0.p = 2;
14141
- _context0.n = 3;
14179
+ _yield$this$prepareNo5 = _context1.v;
14180
+ normalizedOptions = _yield$this$prepareNo5.normalizedOptions;
14181
+ buildTx = _yield$this$prepareNo5.buildTx;
14182
+ api = normalizedOptions.api, from = normalizedOptions.from, to = normalizedOptions.to, senderAddress = normalizedOptions.senderAddress, currency = normalizedOptions.currency;
14183
+ assertToIsString(to);
14184
+ _context1.n = 2;
14185
+ return buildTx();
14186
+ case 2:
14187
+ tx = _context1.v;
14188
+ _context1.p = 3;
14189
+ _context1.n = 4;
14142
14190
  return getOriginXcmFeeEstimate({
14143
- api: this.api,
14191
+ api: api,
14144
14192
  tx: tx,
14145
14193
  origin: from,
14146
14194
  destination: to,
14147
14195
  currency: currency,
14148
14196
  senderAddress: senderAddress
14149
14197
  });
14150
- case 3:
14151
- return _context0.a(2, _context0.v);
14152
14198
  case 4:
14153
- _context0.p = 4;
14154
- _context0.n = 5;
14155
- return this.api.disconnect();
14199
+ return _context1.a(2, _context1.v);
14156
14200
  case 5:
14157
- return _context0.f(4);
14201
+ _context1.p = 5;
14202
+ _context1.n = 6;
14203
+ return this.api.disconnect();
14158
14204
  case 6:
14159
- return _context0.a(2);
14205
+ return _context1.f(5);
14206
+ case 7:
14207
+ return _context1.a(2);
14160
14208
  }
14161
- }, _callee0, this, [[2,, 4, 6]]);
14209
+ }, _callee1, this, [[3,, 5, 7]]);
14162
14210
  }));
14163
14211
  function getOriginXcmFeeEstimate$1() {
14164
14212
  return _getOriginXcmFeeEstimate2.apply(this, arguments);
@@ -14174,17 +14222,22 @@ var GeneralBuilder = /*#__PURE__*/function () {
14174
14222
  }, {
14175
14223
  key: "getTransferableAmount",
14176
14224
  value: (function () {
14177
- var _getTransferableAmount2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
14178
- var _this$_options6, from, to, senderAddress, currency, feeAsset, api;
14179
- return _regenerator().w(function (_context1) {
14180
- while (1) switch (_context1.n) {
14225
+ var _getTransferableAmount2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
14226
+ var _yield$this$prepareNo6, normalizedOptions, buildTx, api, from, to, senderAddress, currency, feeAsset;
14227
+ return _regenerator().w(function (_context10) {
14228
+ while (1) switch (_context10.n) {
14181
14229
  case 0:
14182
- _this$_options6 = this._options, from = _this$_options6.from, to = _this$_options6.to, senderAddress = _this$_options6.senderAddress, currency = _this$_options6.currency, feeAsset = _this$_options6.feeAsset;
14230
+ _context10.n = 1;
14231
+ return this.prepareNormalizedOptions(this._options);
14232
+ case 1:
14233
+ _yield$this$prepareNo6 = _context10.v;
14234
+ normalizedOptions = _yield$this$prepareNo6.normalizedOptions;
14235
+ buildTx = _yield$this$prepareNo6.buildTx;
14236
+ api = normalizedOptions.api, from = normalizedOptions.from, to = normalizedOptions.to, senderAddress = normalizedOptions.senderAddress, currency = normalizedOptions.currency, feeAsset = normalizedOptions.feeAsset;
14183
14237
  assertToIsString(to);
14184
- api = this.api;
14185
- return _context1.a(2, getTransferableAmount({
14238
+ return _context10.a(2, getTransferableAmount({
14186
14239
  api: api,
14187
- buildTx: this.createTxFactory(),
14240
+ buildTx: buildTx,
14188
14241
  origin: from,
14189
14242
  destination: to,
14190
14243
  senderAddress: senderAddress,
@@ -14192,7 +14245,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
14192
14245
  currency: currency
14193
14246
  }));
14194
14247
  }
14195
- }, _callee1, this);
14248
+ }, _callee10, this);
14196
14249
  }));
14197
14250
  function getTransferableAmount$1() {
14198
14251
  return _getTransferableAmount2.apply(this, arguments);
@@ -14208,18 +14261,23 @@ var GeneralBuilder = /*#__PURE__*/function () {
14208
14261
  }, {
14209
14262
  key: "getMinTransferableAmount",
14210
14263
  value: (function () {
14211
- var _getMinTransferableAmount2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
14212
- var _this$_options7, from, to, senderAddress, address, currency, feeAsset, api;
14213
- return _regenerator().w(function (_context10) {
14214
- while (1) switch (_context10.n) {
14264
+ var _getMinTransferableAmount2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
14265
+ var _yield$this$prepareNo7, normalizedOptions, buildTx, api, from, to, senderAddress, address, currency, feeAsset;
14266
+ return _regenerator().w(function (_context11) {
14267
+ while (1) switch (_context11.n) {
14215
14268
  case 0:
14216
- _this$_options7 = this._options, from = _this$_options7.from, to = _this$_options7.to, senderAddress = _this$_options7.senderAddress, address = _this$_options7.address, currency = _this$_options7.currency, feeAsset = _this$_options7.feeAsset;
14269
+ _context11.n = 1;
14270
+ return this.prepareNormalizedOptions(this._options);
14271
+ case 1:
14272
+ _yield$this$prepareNo7 = _context11.v;
14273
+ normalizedOptions = _yield$this$prepareNo7.normalizedOptions;
14274
+ buildTx = _yield$this$prepareNo7.buildTx;
14275
+ api = normalizedOptions.api, from = normalizedOptions.from, to = normalizedOptions.to, senderAddress = normalizedOptions.senderAddress, address = normalizedOptions.address, currency = normalizedOptions.currency, feeAsset = normalizedOptions.feeAsset;
14217
14276
  assertToIsString(to);
14218
14277
  assertAddressIsString(address);
14219
- api = this.api;
14220
- return _context10.a(2, getMinTransferableAmount({
14278
+ return _context11.a(2, getMinTransferableAmount({
14221
14279
  api: api,
14222
- buildTx: this.createTxFactory(),
14280
+ buildTx: buildTx,
14223
14281
  origin: from,
14224
14282
  destination: to,
14225
14283
  senderAddress: senderAddress,
@@ -14229,7 +14287,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
14229
14287
  builder: this
14230
14288
  }));
14231
14289
  }
14232
- }, _callee10, this);
14290
+ }, _callee11, this);
14233
14291
  }));
14234
14292
  function getMinTransferableAmount$1() {
14235
14293
  return _getMinTransferableAmount2.apply(this, arguments);
@@ -14245,17 +14303,23 @@ var GeneralBuilder = /*#__PURE__*/function () {
14245
14303
  }, {
14246
14304
  key: "verifyEdOnDestination",
14247
14305
  value: (function () {
14248
- var _verifyEdOnDestination2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
14249
- var _this$_options8, from, to, address, currency, senderAddress, feeAsset;
14250
- return _regenerator().w(function (_context11) {
14251
- while (1) switch (_context11.n) {
14306
+ var _verifyEdOnDestination2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
14307
+ var _yield$this$prepareNo8, normalizedOptions, buildTx, api, from, to, address, currency, senderAddress, feeAsset;
14308
+ return _regenerator().w(function (_context12) {
14309
+ while (1) switch (_context12.n) {
14252
14310
  case 0:
14253
- _this$_options8 = this._options, from = _this$_options8.from, to = _this$_options8.to, address = _this$_options8.address, currency = _this$_options8.currency, senderAddress = _this$_options8.senderAddress, feeAsset = _this$_options8.feeAsset;
14311
+ _context12.n = 1;
14312
+ return this.prepareNormalizedOptions(this._options);
14313
+ case 1:
14314
+ _yield$this$prepareNo8 = _context12.v;
14315
+ normalizedOptions = _yield$this$prepareNo8.normalizedOptions;
14316
+ buildTx = _yield$this$prepareNo8.buildTx;
14317
+ api = normalizedOptions.api, from = normalizedOptions.from, to = normalizedOptions.to, address = normalizedOptions.address, currency = normalizedOptions.currency, senderAddress = normalizedOptions.senderAddress, feeAsset = normalizedOptions.feeAsset;
14254
14318
  assertToIsString(to);
14255
14319
  assertAddressIsString(address);
14256
- return _context11.a(2, verifyEdOnDestination({
14257
- api: this.api,
14258
- buildTx: this.createTxFactory(),
14320
+ return _context12.a(2, verifyEdOnDestination({
14321
+ api: api,
14322
+ buildTx: buildTx,
14259
14323
  origin: from,
14260
14324
  destination: to,
14261
14325
  address: address,
@@ -14264,7 +14328,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
14264
14328
  currency: currency
14265
14329
  }));
14266
14330
  }
14267
- }, _callee11, this);
14331
+ }, _callee12, this);
14268
14332
  }));
14269
14333
  function verifyEdOnDestination$1() {
14270
14334
  return _verifyEdOnDestination2.apply(this, arguments);
@@ -14280,17 +14344,23 @@ var GeneralBuilder = /*#__PURE__*/function () {
14280
14344
  }, {
14281
14345
  key: "getTransferInfo",
14282
14346
  value: (function () {
14283
- var _getTransferInfo2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
14284
- var _this$_options9, from, to, address, currency, ahAddress, senderAddress, feeAsset;
14285
- return _regenerator().w(function (_context12) {
14286
- while (1) switch (_context12.n) {
14347
+ var _getTransferInfo2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
14348
+ var _yield$this$prepareNo9, normalizedOptions, buildTx, api, from, to, address, currency, ahAddress, senderAddress, feeAsset;
14349
+ return _regenerator().w(function (_context13) {
14350
+ while (1) switch (_context13.n) {
14287
14351
  case 0:
14288
- _this$_options9 = this._options, from = _this$_options9.from, to = _this$_options9.to, address = _this$_options9.address, currency = _this$_options9.currency, ahAddress = _this$_options9.ahAddress, senderAddress = _this$_options9.senderAddress, feeAsset = _this$_options9.feeAsset;
14352
+ _context13.n = 1;
14353
+ return this.prepareNormalizedOptions(this._options);
14354
+ case 1:
14355
+ _yield$this$prepareNo9 = _context13.v;
14356
+ normalizedOptions = _yield$this$prepareNo9.normalizedOptions;
14357
+ buildTx = _yield$this$prepareNo9.buildTx;
14358
+ api = normalizedOptions.api, from = normalizedOptions.from, to = normalizedOptions.to, address = normalizedOptions.address, currency = normalizedOptions.currency, ahAddress = normalizedOptions.ahAddress, senderAddress = normalizedOptions.senderAddress, feeAsset = normalizedOptions.feeAsset;
14289
14359
  assertToIsString(to);
14290
14360
  assertAddressIsString(address);
14291
- return _context12.a(2, getTransferInfo({
14292
- api: this.api,
14293
- buildTx: this.createTxFactory(),
14361
+ return _context13.a(2, getTransferInfo({
14362
+ api: api,
14363
+ buildTx: buildTx,
14294
14364
  origin: from,
14295
14365
  destination: to,
14296
14366
  address: address,
@@ -14300,7 +14370,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
14300
14370
  feeAsset: feeAsset
14301
14371
  }));
14302
14372
  }
14303
- }, _callee12, this);
14373
+ }, _callee13, this);
14304
14374
  }));
14305
14375
  function getTransferInfo$1() {
14306
14376
  return _getTransferInfo2.apply(this, arguments);