@paraspell/sdk-core 11.12.4 → 11.12.6

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
@@ -849,6 +849,7 @@ var isConfig = function isConfig(value) {
849
849
  };
850
850
 
851
851
  var computeOverridenAmount = function computeOverridenAmount(options, increaseAmount) {
852
+ var relative = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
852
853
  var from = options.from,
853
854
  to = options.to,
854
855
  currency = options.currency,
@@ -856,21 +857,23 @@ var computeOverridenAmount = function computeOverridenAmount(options, increaseAm
856
857
  var amount = options.currency.amount;
857
858
  var config = api.getConfig();
858
859
  if (isConfig(config) && config.abstractDecimals && typeof amount !== 'bigint') {
859
- return Number(increaseAmount) + Number(amount);
860
+ var base = relative ? Number(amount) : 0;
861
+ return Number(increaseAmount) + base;
860
862
  } else {
861
863
  assertToIsString(to);
862
864
  var asset = assets.findAssetInfoOrThrow(from, currency, to);
863
- return parseUnits(increaseAmount, asset.decimals) + BigInt(amount);
865
+ var _base = relative ? BigInt(amount) : 0n;
866
+ return parseUnits(increaseAmount, asset.decimals) + _base;
864
867
  }
865
868
  };
866
869
  var overrideTxAmount = /*#__PURE__*/function () {
867
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options, builder, amount) {
870
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options, builder, amount, relative) {
868
871
  var modifiedBuilder, _yield$modifiedBuilde, tx;
869
872
  return _regenerator().w(function (_context) {
870
873
  while (1) switch (_context.n) {
871
874
  case 0:
872
875
  modifiedBuilder = builder.currency(_objectSpread2(_objectSpread2({}, options.currency), {}, {
873
- amount: computeOverridenAmount(options, amount)
876
+ amount: computeOverridenAmount(options, amount, relative)
874
877
  }));
875
878
  _context.n = 1;
876
879
  return modifiedBuilder['buildInternal']();
@@ -881,12 +884,12 @@ var overrideTxAmount = /*#__PURE__*/function () {
881
884
  }
882
885
  }, _callee);
883
886
  }));
884
- return function overrideTxAmount(_x, _x2, _x3) {
887
+ return function overrideTxAmount(_x, _x2, _x3, _x4) {
885
888
  return _ref.apply(this, arguments);
886
889
  };
887
890
  }();
888
891
  var createTx = /*#__PURE__*/function () {
889
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options, builder, amount) {
892
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options, builder, amount, relative) {
890
893
  var _yield$builder$buildI, tx;
891
894
  return _regenerator().w(function (_context2) {
892
895
  while (1) switch (_context2.n) {
@@ -903,13 +906,13 @@ var createTx = /*#__PURE__*/function () {
903
906
  return _context2.a(2, tx);
904
907
  case 2:
905
908
  _context2.n = 3;
906
- return overrideTxAmount(options, builder, amount);
909
+ return overrideTxAmount(options, builder, amount, relative);
907
910
  case 3:
908
911
  return _context2.a(2, _context2.v);
909
912
  }
910
913
  }, _callee2);
911
914
  }));
912
- return function createTx(_x4, _x5, _x6) {
915
+ return function createTx(_x5, _x6, _x7, _x8) {
913
916
  return _ref2.apply(this, arguments);
914
917
  };
915
918
  }();
@@ -3162,6 +3165,10 @@ var reverseTransformLocation = function reverseTransformLocation(location) {
3162
3165
  });
3163
3166
  };
3164
3167
 
3168
+ var normalizeAmount = function normalizeAmount(amount) {
3169
+ return amount < MIN_AMOUNT ? MIN_AMOUNT : amount;
3170
+ };
3171
+
3165
3172
  /**
3166
3173
  * Retrieves the chain name corresponding to a specified parachain ID.
3167
3174
  *
@@ -4471,7 +4478,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
4471
4478
  asset: asset,
4472
4479
  originFee: originFee,
4473
4480
  feeAsset: resolvedFeeAsset,
4474
- amount: currency.amount < MIN_AMOUNT ? MIN_AMOUNT : currency.amount
4481
+ amount: normalizeAmount(currency.amount)
4475
4482
  });
4476
4483
  case 4:
4477
4484
  dryRunResult = _context3.v;
@@ -4523,15 +4530,20 @@ var resolveAsset = function resolveAsset(currency, origin, destination, assetChe
4523
4530
  };
4524
4531
 
4525
4532
  var resolveHopAsset = function resolveHopAsset(_ref) {
4526
- var _asset$location, _findAssetInfoOnDest;
4527
- var originChain = _ref.originChain,
4533
+ var _findAssetInfoOnDest;
4534
+ var api = _ref.api,
4535
+ tx = _ref.tx,
4536
+ originChain = _ref.originChain,
4528
4537
  currentChain = _ref.currentChain,
4538
+ destination = _ref.destination,
4529
4539
  swapConfig = _ref.swapConfig,
4530
4540
  asset = _ref.asset,
4531
4541
  hasPassedExchange = _ref.hasPassedExchange,
4532
4542
  currency = _ref.currency;
4533
- var isExternalAsset = ((_asset$location = asset.location) === null || _asset$location === void 0 ? void 0 : _asset$location.parents) === sdkCommon.Parents.TWO;
4534
- if (isExternalAsset) {
4543
+ var isRelayAssetIncluded = api.getTypeThenAssetCount(tx) === 2;
4544
+ var isSubBridge = !sdkCommon.isTLocation(destination) && sdkCommon.isSubstrateBridge(originChain, destination);
4545
+ var useRelayAssetAsFee = destination === 'Ethereum' || isSubBridge || isRelayAssetIncluded;
4546
+ if (useRelayAssetAsFee) {
4535
4547
  return assets.findNativeAssetInfoOrThrow(getRelayChainOf(currentChain));
4536
4548
  }
4537
4549
  if (hasPassedExchange && swapConfig && currentChain !== swapConfig.exchangeChain) {
@@ -5554,8 +5566,11 @@ var dryRunInternal = /*#__PURE__*/function () {
5554
5566
  case 0:
5555
5567
  hopApi = params.api, currentChain = params.currentChain, currentOrigin = params.currentOrigin, currentAsset = params.currentAsset, forwardedXcms = params.forwardedXcms, hasPassedExchange = params.hasPassedExchange;
5556
5568
  hopAsset = resolveHopAsset({
5569
+ api: api,
5570
+ tx: tx,
5557
5571
  originChain: origin,
5558
5572
  currentChain: currentChain,
5573
+ destination: destination,
5559
5574
  asset: currentAsset,
5560
5575
  currency: currency,
5561
5576
  swapConfig: swapConfig,
@@ -9352,6 +9367,16 @@ var Manta = /*#__PURE__*/function (_Parachain) {
9352
9367
  };
9353
9368
  return transferXTokens(input, currencySelection);
9354
9369
  }
9370
+ }, {
9371
+ key: "isSendingTempDisabled",
9372
+ value: function isSendingTempDisabled(_options) {
9373
+ return true;
9374
+ }
9375
+ }, {
9376
+ key: "isReceivingTempDisabled",
9377
+ value: function isReceivingTempDisabled(_scenario) {
9378
+ return true;
9379
+ }
9355
9380
  }, {
9356
9381
  key: "transferLocalNonNativeAsset",
9357
9382
  value: function transferLocalNonNativeAsset(options) {
@@ -11018,130 +11043,212 @@ var wrapTxBypass = /*#__PURE__*/function () {
11018
11043
  };
11019
11044
  }();
11020
11045
 
11046
+ var MAX_INCREASE_RETRIES = 5;
11047
+ var INCREASE_BUMP_STEP = 100;
11048
+ var DECREASE_START_AMOUNT = 1;
11049
+ var MAX_DECREASE_RETRIES = 5;
11050
+ var DECREASE_DIVIDE_FACTOR = 5;
11051
+ var FAILED_TO_TRANSACT_ASSET = 'FailedToTransactAsset';
11021
11052
  var getBypassResultWithRetries = /*#__PURE__*/function () {
11022
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options, internalFn, initialTx) {
11053
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options, internalFn, initialTx) {
11023
11054
  var maxRetries,
11024
11055
  bumpStep,
11025
- hasError,
11056
+ getResultError,
11057
+ isFailedToTransact,
11058
+ isAmountTooLow,
11059
+ attempt,
11060
+ retryWithReducedAmount,
11026
11061
  first,
11027
- result,
11028
11062
  i,
11029
11063
  amount,
11030
- bumpedTx,
11031
- _args = arguments,
11032
- _t,
11064
+ res,
11065
+ err,
11066
+ _args3 = arguments,
11033
11067
  _t2,
11034
11068
  _t3;
11035
- return _regenerator().w(function (_context) {
11036
- while (1) switch (_context.p = _context.n) {
11069
+ return _regenerator().w(function (_context3) {
11070
+ while (1) switch (_context3.p = _context3.n) {
11037
11071
  case 0:
11038
- maxRetries = _args.length > 3 && _args[3] !== undefined ? _args[3] : 5;
11039
- bumpStep = _args.length > 4 && _args[4] !== undefined ? _args[4] : 100;
11040
- hasError = function hasError(res) {
11041
- return 'failureReason' in res ? !!res.failureReason : 'dryRunError' in res ? !!res.dryRunError : false;
11072
+ maxRetries = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : MAX_INCREASE_RETRIES;
11073
+ bumpStep = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : INCREASE_BUMP_STEP;
11074
+ getResultError = function getResultError(res) {
11075
+ return 'failureReason' in res ? res.failureReason : 'dryRunError' in res ? res.dryRunError : undefined;
11076
+ };
11077
+ isFailedToTransact = function isFailedToTransact(res) {
11078
+ return 'failureReason' in res && res.failureReason === FAILED_TO_TRANSACT_ASSET;
11079
+ };
11080
+ isAmountTooLow = function isAmountTooLow(e) {
11081
+ return e instanceof AmountTooLowError;
11042
11082
  };
11083
+ attempt = /*#__PURE__*/function () {
11084
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(amount, relative) {
11085
+ var tx;
11086
+ return _regenerator().w(function (_context) {
11087
+ while (1) switch (_context.n) {
11088
+ case 0:
11089
+ _context.n = 1;
11090
+ return options.buildTx(amount, relative);
11091
+ case 1:
11092
+ tx = _context.v;
11093
+ return _context.a(2, internalFn(_objectSpread2(_objectSpread2({}, options), {}, {
11094
+ tx: tx,
11095
+ useRootOrigin: true
11096
+ })));
11097
+ }
11098
+ }, _callee);
11099
+ }));
11100
+ return function attempt(_x4, _x5) {
11101
+ return _ref2.apply(this, arguments);
11102
+ };
11103
+ }();
11104
+ retryWithReducedAmount = /*#__PURE__*/function () {
11105
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
11106
+ var start,
11107
+ divide,
11108
+ amount,
11109
+ attemptIdx,
11110
+ res,
11111
+ err,
11112
+ _args2 = arguments,
11113
+ _t;
11114
+ return _regenerator().w(function (_context2) {
11115
+ while (1) switch (_context2.p = _context2.n) {
11116
+ case 0:
11117
+ start = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : DECREASE_START_AMOUNT;
11118
+ divide = function divide(v) {
11119
+ var next = v / DECREASE_DIVIDE_FACTOR;
11120
+ return next > 0 ? next : 1;
11121
+ };
11122
+ amount = divide(start);
11123
+ attemptIdx = 0;
11124
+ case 1:
11125
+ if (!(attemptIdx < MAX_DECREASE_RETRIES && amount > 0)) {
11126
+ _context2.n = 9;
11127
+ break;
11128
+ }
11129
+ _context2.p = 2;
11130
+ _context2.n = 3;
11131
+ return attempt(amount.toString(), false);
11132
+ case 3:
11133
+ res = _context2.v;
11134
+ err = getResultError(res);
11135
+ if (err) {
11136
+ _context2.n = 4;
11137
+ break;
11138
+ }
11139
+ return _context2.a(2, res);
11140
+ case 4:
11141
+ if (!isFailedToTransact(res)) {
11142
+ _context2.n = 5;
11143
+ break;
11144
+ }
11145
+ amount = divide(amount);
11146
+ return _context2.a(3, 8);
11147
+ case 5:
11148
+ return _context2.a(2, res);
11149
+ case 6:
11150
+ _context2.p = 6;
11151
+ _t = _context2.v;
11152
+ if (!isAmountTooLow(_t)) {
11153
+ _context2.n = 7;
11154
+ break;
11155
+ }
11156
+ amount = divide(amount);
11157
+ return _context2.a(3, 8);
11158
+ case 7:
11159
+ throw _t;
11160
+ case 8:
11161
+ attemptIdx++;
11162
+ _context2.n = 1;
11163
+ break;
11164
+ case 9:
11165
+ return _context2.a(2, attempt(amount.toString(), false));
11166
+ }
11167
+ }, _callee2, null, [[2, 6]]);
11168
+ }));
11169
+ return function retryWithReducedAmount() {
11170
+ return _ref3.apply(this, arguments);
11171
+ };
11172
+ }();
11043
11173
  if (!initialTx) {
11044
- _context.n = 5;
11174
+ _context3.n = 5;
11045
11175
  break;
11046
11176
  }
11047
- _context.p = 1;
11048
- _context.n = 2;
11177
+ _context3.p = 1;
11178
+ _context3.n = 2;
11049
11179
  return internalFn(_objectSpread2(_objectSpread2({}, options), {}, {
11050
11180
  tx: initialTx,
11051
11181
  useRootOrigin: true
11052
11182
  }));
11053
11183
  case 2:
11054
- first = _context.v;
11055
- if (hasError(first)) {
11056
- _context.n = 3;
11184
+ first = _context3.v;
11185
+ if (getResultError(first)) {
11186
+ _context3.n = 3;
11057
11187
  break;
11058
11188
  }
11059
- return _context.a(2, first);
11189
+ return _context3.a(2, first);
11060
11190
  case 3:
11061
- _context.n = 5;
11191
+ _context3.n = 5;
11062
11192
  break;
11063
11193
  case 4:
11064
- _context.p = 4;
11065
- _t = _context.v;
11066
- if (_t instanceof AmountTooLowError) {
11067
- _context.n = 5;
11194
+ _context3.p = 4;
11195
+ _t2 = _context3.v;
11196
+ if (isAmountTooLow(_t2)) {
11197
+ _context3.n = 5;
11068
11198
  break;
11069
11199
  }
11070
- throw _t;
11200
+ throw _t2;
11071
11201
  case 5:
11072
- result = null;
11073
11202
  i = 1;
11074
11203
  case 6:
11075
11204
  if (!(i <= maxRetries)) {
11076
- _context.n = 19;
11205
+ _context3.n = 15;
11077
11206
  break;
11078
11207
  }
11079
- amount = (bumpStep * i).toString();
11080
- bumpedTx = void 0;
11081
- _context.p = 7;
11082
- _context.n = 8;
11083
- return options.buildTx(amount);
11208
+ amount = bumpStep * i;
11209
+ _context3.p = 7;
11210
+ _context3.n = 8;
11211
+ return attempt(amount.toString());
11084
11212
  case 8:
11085
- bumpedTx = _context.v;
11086
- _context.n = 12;
11087
- break;
11088
- case 9:
11089
- _context.p = 9;
11090
- _t2 = _context.v;
11091
- if (!(_t2 instanceof AmountTooLowError)) {
11092
- _context.n = 11;
11213
+ res = _context3.v;
11214
+ err = getResultError(res);
11215
+ if (err) {
11216
+ _context3.n = 9;
11093
11217
  break;
11094
11218
  }
11095
- if (!(i === maxRetries)) {
11096
- _context.n = 10;
11219
+ return _context3.a(2, res);
11220
+ case 9:
11221
+ if (!isFailedToTransact(res)) {
11222
+ _context3.n = 10;
11097
11223
  break;
11098
11224
  }
11099
- throw _t2;
11225
+ return _context3.a(2, retryWithReducedAmount(DECREASE_START_AMOUNT));
11100
11226
  case 10:
11101
- return _context.a(3, 18);
11227
+ return _context3.a(3, 14);
11102
11228
  case 11:
11103
- throw _t2;
11104
- case 12:
11105
- _context.p = 12;
11106
- _context.n = 13;
11107
- return internalFn(_objectSpread2(_objectSpread2({}, options), {}, {
11108
- tx: bumpedTx,
11109
- useRootOrigin: true
11110
- }));
11111
- case 13:
11112
- result = _context.v;
11113
- if (hasError(result)) {
11114
- _context.n = 14;
11115
- break;
11116
- }
11117
- return _context.a(2, result);
11118
- case 14:
11119
- _context.n = 18;
11120
- break;
11121
- case 15:
11122
- _context.p = 15;
11123
- _t3 = _context.v;
11124
- if (!(_t3 instanceof AmountTooLowError)) {
11125
- _context.n = 17;
11229
+ _context3.p = 11;
11230
+ _t3 = _context3.v;
11231
+ if (!isAmountTooLow(_t3)) {
11232
+ _context3.n = 13;
11126
11233
  break;
11127
11234
  }
11128
11235
  if (!(i === maxRetries)) {
11129
- _context.n = 16;
11236
+ _context3.n = 12;
11130
11237
  break;
11131
11238
  }
11132
11239
  throw _t3;
11133
- case 16:
11134
- return _context.a(3, 18);
11135
- case 17:
11240
+ case 12:
11241
+ return _context3.a(3, 14);
11242
+ case 13:
11136
11243
  throw _t3;
11137
- case 18:
11244
+ case 14:
11138
11245
  i++;
11139
- _context.n = 6;
11246
+ _context3.n = 6;
11140
11247
  break;
11141
- case 19:
11142
- return _context.a(2, result);
11248
+ case 15:
11249
+ return _context3.a(2, attempt(String(bumpStep * maxRetries)));
11143
11250
  }
11144
- }, _callee, null, [[12, 15], [7, 9], [1, 4]]);
11251
+ }, _callee3, null, [[7, 11], [1, 4]]);
11145
11252
  }));
11146
11253
  return function getBypassResultWithRetries(_x, _x2, _x3) {
11147
11254
  return _ref.apply(this, arguments);
@@ -11502,8 +11609,11 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
11502
11609
  case 0:
11503
11610
  hopApi = params.api, currentChain = params.currentChain, currentOrigin = params.currentOrigin, currentAsset = params.currentAsset, forwardedXcms = params.forwardedXcms, hasPassedExchange = params.hasPassedExchange;
11504
11611
  hopAsset = resolveHopAsset({
11612
+ api: api,
11613
+ tx: tx,
11505
11614
  originChain: origin,
11506
11615
  currentChain: currentChain,
11616
+ destination: destination,
11507
11617
  asset: currentAsset,
11508
11618
  currency: currency,
11509
11619
  swapConfig: swapConfig,
@@ -12712,35 +12822,45 @@ var buildTypeAndThenCall = function buildTypeAndThenCall(_ref, isDotAsset, custo
12712
12822
  };
12713
12823
 
12714
12824
  var FEE_PADDING_PERCENTAGE = 20;
12825
+ var FEE_ETH_ASSET_PADDING_PERCENTAGE = 100;
12715
12826
  var FEE_PADDING_HYDRATION = 500;
12827
+ var getPadding = function getPadding(chain, _ref) {
12828
+ var assetInfo = _ref.assetInfo,
12829
+ dest = _ref.dest;
12830
+ var isEthAsset = assetInfo.location && assets.findAssetInfoByLoc(assets.getOtherAssets('Ethereum'), assetInfo.location);
12831
+ if (chain === 'Hydration') return FEE_PADDING_HYDRATION;
12832
+ if (isEthAsset && dest.chain.startsWith('AssetHub')) return FEE_ETH_ASSET_PADDING_PERCENTAGE;
12833
+ return FEE_PADDING_PERCENTAGE;
12834
+ };
12716
12835
  var computeInstructionFee = /*#__PURE__*/function () {
12717
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref, version, xcm) {
12718
- var chain, api, _t;
12836
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref2, version, xcm, context) {
12837
+ var chain, api, padding, _t;
12719
12838
  return _regenerator().w(function (_context) {
12720
12839
  while (1) switch (_context.n) {
12721
12840
  case 0:
12722
- chain = _ref.chain, api = _ref.api;
12841
+ chain = _ref2.chain, api = _ref2.api;
12842
+ padding = getPadding(chain, context);
12723
12843
  _t = padValueBy;
12724
12844
  _context.n = 1;
12725
12845
  return api.getXcmPaymentApiFee(chain, addXcmVersionHeader(xcm, version), [], {
12726
12846
  location: DOT_LOCATION
12727
12847
  }, true);
12728
12848
  case 1:
12729
- return _context.a(2, _t(_context.v, chain === 'Hydration' ? FEE_PADDING_HYDRATION : FEE_PADDING_PERCENTAGE));
12849
+ return _context.a(2, _t(_context.v, padding));
12730
12850
  }
12731
12851
  }, _callee);
12732
12852
  }));
12733
- return function computeInstructionFee(_x, _x2, _x3) {
12734
- return _ref2.apply(this, arguments);
12853
+ return function computeInstructionFee(_x, _x2, _x3, _x4) {
12854
+ return _ref3.apply(this, arguments);
12735
12855
  };
12736
12856
  }();
12737
12857
  var computeAllFees = /*#__PURE__*/function () {
12738
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3, customXcm, isDotAsset, refundInstruction) {
12858
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(context, customXcm, isDotAsset, refundInstruction) {
12739
12859
  var reserve, dest, version, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0;
12740
12860
  return _regenerator().w(function (_context2) {
12741
12861
  while (1) switch (_context2.n) {
12742
12862
  case 0:
12743
- reserve = _ref3.reserve, dest = _ref3.dest, version = _ref3.options.version;
12863
+ reserve = context.reserve, dest = context.dest, version = context.options.version;
12744
12864
  if (!customXcm.some(function (x) {
12745
12865
  return 'DepositReserveAsset' in x || 'InitiateTeleport' in x;
12746
12866
  })) {
@@ -12748,7 +12868,7 @@ var computeAllFees = /*#__PURE__*/function () {
12748
12868
  break;
12749
12869
  }
12750
12870
  _context2.n = 1;
12751
- return computeInstructionFee(reserve, version, customXcm);
12871
+ return computeInstructionFee(reserve, version, customXcm, context);
12752
12872
  case 1:
12753
12873
  _t3 = _context2.v;
12754
12874
  if (!refundInstruction) {
@@ -12756,7 +12876,7 @@ var computeAllFees = /*#__PURE__*/function () {
12756
12876
  break;
12757
12877
  }
12758
12878
  _context2.n = 2;
12759
- return computeInstructionFee(reserve, version, [refundInstruction]);
12879
+ return computeInstructionFee(reserve, version, [refundInstruction], context);
12760
12880
  case 2:
12761
12881
  _t4 = _context2.v;
12762
12882
  _context2.n = 4;
@@ -12771,7 +12891,7 @@ var computeAllFees = /*#__PURE__*/function () {
12771
12891
  return 'DepositReserveAsset' in j || 'InitiateTeleport' in j;
12772
12892
  });
12773
12893
  return instr ? 'DepositReserveAsset' in instr ? instr.DepositReserveAsset.xcm : instr.InitiateTeleport.xcm : undefined;
12774
- }());
12894
+ }(), context);
12775
12895
  case 5:
12776
12896
  _t6 = _context2.v;
12777
12897
  _t2 = {
@@ -12787,7 +12907,7 @@ var computeAllFees = /*#__PURE__*/function () {
12787
12907
  break;
12788
12908
  }
12789
12909
  _context2.n = 7;
12790
- return computeInstructionFee(assets.hasXcmPaymentApiSupport(dest.chain) ? dest : reserve, version, customXcm);
12910
+ return computeInstructionFee(assets.hasXcmPaymentApiSupport(dest.chain) ? dest : reserve, version, customXcm, context);
12791
12911
  case 7:
12792
12912
  _t7 = _context2.v;
12793
12913
  _context2.n = 9;
@@ -12801,7 +12921,7 @@ var computeAllFees = /*#__PURE__*/function () {
12801
12921
  break;
12802
12922
  }
12803
12923
  _context2.n = 10;
12804
- return computeInstructionFee(assets.hasXcmPaymentApiSupport(reserve.chain) ? reserve : dest, version, [refundInstruction]);
12924
+ return computeInstructionFee(assets.hasXcmPaymentApiSupport(reserve.chain) ? reserve : dest, version, [refundInstruction], context);
12805
12925
  case 10:
12806
12926
  _t9 = _context2.v;
12807
12927
  _context2.n = 12;
@@ -12820,7 +12940,7 @@ var computeAllFees = /*#__PURE__*/function () {
12820
12940
  }
12821
12941
  }, _callee2);
12822
12942
  }));
12823
- return function computeAllFees(_x4, _x5, _x6, _x7) {
12943
+ return function computeAllFees(_x5, _x6, _x7, _x8) {
12824
12944
  return _ref4.apply(this, arguments);
12825
12945
  };
12826
12946
  }();
@@ -12950,7 +13070,7 @@ var createCustomXcm = function createCustomXcm(_ref, isDotAsset, assetCount, isF
12950
13070
  };
12951
13071
  var buyExecution = {
12952
13072
  BuyExecution: {
12953
- fees: createAsset(version, buyExecutionAmount, feeLocLocalized),
13073
+ fees: createAsset(version, normalizeAmount(buyExecutionAmount), feeLocLocalized),
12954
13074
  weight_limit: 'Unlimited'
12955
13075
  }
12956
13076
  };
@@ -14011,10 +14131,10 @@ var GeneralBuilder = /*#__PURE__*/function () {
14011
14131
  key: "createTxFactory",
14012
14132
  value: function createTxFactory() {
14013
14133
  var _this = this;
14014
- return function (amount) {
14134
+ return function (amount, relative) {
14015
14135
  return createTx(_objectSpread2(_objectSpread2({}, _this._options), {}, {
14016
14136
  api: _this.api
14017
- }), _this, amount);
14137
+ }), _this, amount, relative);
14018
14138
  };
14019
14139
  }
14020
14140
  /**
@@ -14577,6 +14697,7 @@ exports.isConfig = isConfig;
14577
14697
  exports.localizeLocation = localizeLocation;
14578
14698
  exports.maybeOverrideAsset = maybeOverrideAsset;
14579
14699
  exports.maybeOverrideAssets = maybeOverrideAssets;
14700
+ exports.normalizeAmount = normalizeAmount;
14580
14701
  exports.overrideTxAmount = overrideTxAmount;
14581
14702
  exports.padFee = padFee;
14582
14703
  exports.padValueBy = padValueBy;
package/dist/index.d.ts CHANGED
@@ -643,9 +643,12 @@ type TDryRunResult = {
643
643
  bridgeHub?: TDryRunChainResult;
644
644
  hops: THopInfo[];
645
645
  };
646
- type TResolveHopParams = {
646
+ type TResolveHopParams<TApi, TRes> = {
647
+ api: IPolkadotApi<TApi, TRes>;
648
+ tx: TRes;
647
649
  originChain: TSubstrateChain;
648
650
  currentChain: TSubstrateChain;
651
+ destination: TDestination;
649
652
  asset: TAssetInfo;
650
653
  currency: TCurrencyInputWithAmount;
651
654
  swapConfig?: TSwapConfig;
@@ -752,7 +755,7 @@ type TModuleError = {
752
755
  type TXcmFeeSwapConfig = TSwapConfig & {
753
756
  amountOut: bigint;
754
757
  };
755
- type TTxFactory<TRes> = (amount?: string) => Promise<TRes>;
758
+ type TTxFactory<TRes> = (amount?: string, relative?: boolean) => Promise<TRes>;
756
759
  type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
757
760
  /**
758
761
  * The transaction factory
@@ -1453,6 +1456,7 @@ interface IPolkadotApi<TApi, TRes> {
1453
1456
  hexToUint8a(hex: string): Uint8Array;
1454
1457
  stringToUint8a(str: string): Uint8Array;
1455
1458
  getMethod(tx: TRes): string;
1459
+ getTypeThenAssetCount(tx: TRes): number | undefined;
1456
1460
  hasMethod(pallet: TPallet, method: string): Promise<boolean>;
1457
1461
  calculateTransactionFee(tx: TRes, address: string): Promise<bigint>;
1458
1462
  quoteAhPrice(fromMl: TLocation, toMl: TLocation, amountIn: bigint, includeFee?: boolean): Promise<bigint | undefined>;
@@ -1887,6 +1891,8 @@ declare class Manta<TApi, TRes> extends Parachain<TApi, TRes> implements IXToken
1887
1891
  constructor();
1888
1892
  private getAssetId;
1889
1893
  transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
1894
+ isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
1895
+ isReceivingTempDisabled(_scenario: TScenario): boolean;
1890
1896
  transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
1891
1897
  }
1892
1898
 
@@ -2249,9 +2255,9 @@ declare const maybeOverrideAsset: (version: Version, amount: bigint, asset: TAss
2249
2255
 
2250
2256
  declare const sortAssets: (assets: TAsset[]) => TAsset[];
2251
2257
 
2252
- declare const computeOverridenAmount: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, increaseAmount: string) => number | bigint;
2253
- declare const overrideTxAmount: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, builder: GeneralBuilder<TApi, TRes, TSendBaseOptions>, amount: string) => Promise<TRes>;
2254
- declare const createTx: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, builder: GeneralBuilder<TApi, TRes, TSendBaseOptions>, amount: string | undefined) => Promise<TRes>;
2258
+ declare const computeOverridenAmount: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, increaseAmount: string, relative?: boolean) => number | bigint;
2259
+ declare const overrideTxAmount: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, builder: GeneralBuilder<TApi, TRes, TSendBaseOptions>, amount: string, relative?: boolean) => Promise<TRes>;
2260
+ declare const createTx: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, builder: GeneralBuilder<TApi, TRes, TSendBaseOptions>, amount?: string, relative?: boolean) => Promise<TRes>;
2255
2261
 
2256
2262
  declare const isConfig: <TApi>(value: any) => value is TBuilderConfig<TApi>;
2257
2263
 
@@ -2304,6 +2310,8 @@ declare const localizeLocation: (chain: TChain, location: TLocation, origin?: TC
2304
2310
 
2305
2311
  declare const reverseTransformLocation: (location: TLocation) => TLocation;
2306
2312
 
2313
+ declare const normalizeAmount: (amount: bigint) => bigint;
2314
+
2307
2315
  declare const resolveDestChain: (originChain: TSubstrateChain, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "ComposableFinance" | "Darwinia" | "EnergyWebX" | "Hydration" | "IntegriteePolkadot" | "Interlay" | "Heima" | "Jamton" | "Moonbeam" | "CoretimePolkadot" | "Collectives" | "Crust" | "Manta" | "Nodle" | "NeuroWeb" | "Pendulum" | "Phala" | "Subsocial" | "KiltSpiritnet" | "Curio" | "Mythos" | "Peaq" | "Polimec" | "RobonomicsPolkadot" | "PeoplePolkadot" | "Unique" | "Xode" | "AssetHubKusama" | "BridgeHubKusama" | "IntegriteeKusama" | "Karura" | "Kintsugi" | "Moonriver" | "CoretimeKusama" | "Encointer" | "Altair" | "Amplitude" | "Basilisk" | "BifrostKusama" | "CrustShadow" | "Crab" | "Laos" | "Quartz" | "RobonomicsKusama" | "PeopleKusama" | "Shiden" | "Zeitgeist" | "AssetHubWestend" | "BridgeHubWestend" | "CollectivesWestend" | "CoretimeWestend" | "Penpal" | "PeopleWestend" | "AjunaPaseo" | "AssetHubPaseo" | "BifrostPaseo" | "BridgeHubPaseo" | "CoretimePaseo" | "EnergyWebXPaseo" | "HeimaPaseo" | "HydrationPaseo" | "IntegriteePaseo" | "KiltPaseo" | "LaosPaseo" | "NeuroWebPaseo" | "NodlePaseo" | "PAssetHub" | "PeoplePaseo" | "ZeitgeistPaseo" | undefined;
2308
2316
 
2309
2317
  declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
@@ -2343,5 +2351,5 @@ declare const formatUnits: typeof formatUnits$1;
2343
2351
 
2344
2352
  declare const validateAddress: (address: TAddress, chain: TChain, isDestination?: boolean) => void;
2345
2353
 
2346
- export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };
2354
+ export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };
2347
2355
  export type { BuildHopInfoOptions, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, TBifrostToken, TBridgeStatus, TBuildDestInfoOptions, TBuildInternalRes, TBuilderConfig, TBuilderOptions, TBypassOptions, TChainConfig, TChainConfigMap, TChainWithApi, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignByAssetOptions, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TSwapConfig, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
package/dist/index.mjs CHANGED
@@ -850,6 +850,7 @@ var isConfig = function isConfig(value) {
850
850
  };
851
851
 
852
852
  var computeOverridenAmount = function computeOverridenAmount(options, increaseAmount) {
853
+ var relative = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
853
854
  var from = options.from,
854
855
  to = options.to,
855
856
  currency = options.currency,
@@ -857,21 +858,23 @@ var computeOverridenAmount = function computeOverridenAmount(options, increaseAm
857
858
  var amount = options.currency.amount;
858
859
  var config = api.getConfig();
859
860
  if (isConfig(config) && config.abstractDecimals && typeof amount !== 'bigint') {
860
- return Number(increaseAmount) + Number(amount);
861
+ var base = relative ? Number(amount) : 0;
862
+ return Number(increaseAmount) + base;
861
863
  } else {
862
864
  assertToIsString(to);
863
865
  var asset = findAssetInfoOrThrow(from, currency, to);
864
- return parseUnits(increaseAmount, asset.decimals) + BigInt(amount);
866
+ var _base = relative ? BigInt(amount) : 0n;
867
+ return parseUnits(increaseAmount, asset.decimals) + _base;
865
868
  }
866
869
  };
867
870
  var overrideTxAmount = /*#__PURE__*/function () {
868
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options, builder, amount) {
871
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options, builder, amount, relative) {
869
872
  var modifiedBuilder, _yield$modifiedBuilde, tx;
870
873
  return _regenerator().w(function (_context) {
871
874
  while (1) switch (_context.n) {
872
875
  case 0:
873
876
  modifiedBuilder = builder.currency(_objectSpread2(_objectSpread2({}, options.currency), {}, {
874
- amount: computeOverridenAmount(options, amount)
877
+ amount: computeOverridenAmount(options, amount, relative)
875
878
  }));
876
879
  _context.n = 1;
877
880
  return modifiedBuilder['buildInternal']();
@@ -882,12 +885,12 @@ var overrideTxAmount = /*#__PURE__*/function () {
882
885
  }
883
886
  }, _callee);
884
887
  }));
885
- return function overrideTxAmount(_x, _x2, _x3) {
888
+ return function overrideTxAmount(_x, _x2, _x3, _x4) {
886
889
  return _ref.apply(this, arguments);
887
890
  };
888
891
  }();
889
892
  var createTx = /*#__PURE__*/function () {
890
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options, builder, amount) {
893
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options, builder, amount, relative) {
891
894
  var _yield$builder$buildI, tx;
892
895
  return _regenerator().w(function (_context2) {
893
896
  while (1) switch (_context2.n) {
@@ -904,13 +907,13 @@ var createTx = /*#__PURE__*/function () {
904
907
  return _context2.a(2, tx);
905
908
  case 2:
906
909
  _context2.n = 3;
907
- return overrideTxAmount(options, builder, amount);
910
+ return overrideTxAmount(options, builder, amount, relative);
908
911
  case 3:
909
912
  return _context2.a(2, _context2.v);
910
913
  }
911
914
  }, _callee2);
912
915
  }));
913
- return function createTx(_x4, _x5, _x6) {
916
+ return function createTx(_x5, _x6, _x7, _x8) {
914
917
  return _ref2.apply(this, arguments);
915
918
  };
916
919
  }();
@@ -3163,6 +3166,10 @@ var reverseTransformLocation = function reverseTransformLocation(location) {
3163
3166
  });
3164
3167
  };
3165
3168
 
3169
+ var normalizeAmount = function normalizeAmount(amount) {
3170
+ return amount < MIN_AMOUNT ? MIN_AMOUNT : amount;
3171
+ };
3172
+
3166
3173
  /**
3167
3174
  * Retrieves the chain name corresponding to a specified parachain ID.
3168
3175
  *
@@ -4472,7 +4479,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
4472
4479
  asset: asset,
4473
4480
  originFee: originFee,
4474
4481
  feeAsset: resolvedFeeAsset,
4475
- amount: currency.amount < MIN_AMOUNT ? MIN_AMOUNT : currency.amount
4482
+ amount: normalizeAmount(currency.amount)
4476
4483
  });
4477
4484
  case 4:
4478
4485
  dryRunResult = _context3.v;
@@ -4524,15 +4531,20 @@ var resolveAsset = function resolveAsset(currency, origin, destination, assetChe
4524
4531
  };
4525
4532
 
4526
4533
  var resolveHopAsset = function resolveHopAsset(_ref) {
4527
- var _asset$location, _findAssetInfoOnDest;
4528
- var originChain = _ref.originChain,
4534
+ var _findAssetInfoOnDest;
4535
+ var api = _ref.api,
4536
+ tx = _ref.tx,
4537
+ originChain = _ref.originChain,
4529
4538
  currentChain = _ref.currentChain,
4539
+ destination = _ref.destination,
4530
4540
  swapConfig = _ref.swapConfig,
4531
4541
  asset = _ref.asset,
4532
4542
  hasPassedExchange = _ref.hasPassedExchange,
4533
4543
  currency = _ref.currency;
4534
- var isExternalAsset = ((_asset$location = asset.location) === null || _asset$location === void 0 ? void 0 : _asset$location.parents) === Parents.TWO;
4535
- if (isExternalAsset) {
4544
+ var isRelayAssetIncluded = api.getTypeThenAssetCount(tx) === 2;
4545
+ var isSubBridge = !isTLocation(destination) && isSubstrateBridge(originChain, destination);
4546
+ var useRelayAssetAsFee = destination === 'Ethereum' || isSubBridge || isRelayAssetIncluded;
4547
+ if (useRelayAssetAsFee) {
4536
4548
  return findNativeAssetInfoOrThrow(getRelayChainOf(currentChain));
4537
4549
  }
4538
4550
  if (hasPassedExchange && swapConfig && currentChain !== swapConfig.exchangeChain) {
@@ -5555,8 +5567,11 @@ var dryRunInternal = /*#__PURE__*/function () {
5555
5567
  case 0:
5556
5568
  hopApi = params.api, currentChain = params.currentChain, currentOrigin = params.currentOrigin, currentAsset = params.currentAsset, forwardedXcms = params.forwardedXcms, hasPassedExchange = params.hasPassedExchange;
5557
5569
  hopAsset = resolveHopAsset({
5570
+ api: api,
5571
+ tx: tx,
5558
5572
  originChain: origin,
5559
5573
  currentChain: currentChain,
5574
+ destination: destination,
5560
5575
  asset: currentAsset,
5561
5576
  currency: currency,
5562
5577
  swapConfig: swapConfig,
@@ -9353,6 +9368,16 @@ var Manta = /*#__PURE__*/function (_Parachain) {
9353
9368
  };
9354
9369
  return transferXTokens(input, currencySelection);
9355
9370
  }
9371
+ }, {
9372
+ key: "isSendingTempDisabled",
9373
+ value: function isSendingTempDisabled(_options) {
9374
+ return true;
9375
+ }
9376
+ }, {
9377
+ key: "isReceivingTempDisabled",
9378
+ value: function isReceivingTempDisabled(_scenario) {
9379
+ return true;
9380
+ }
9356
9381
  }, {
9357
9382
  key: "transferLocalNonNativeAsset",
9358
9383
  value: function transferLocalNonNativeAsset(options) {
@@ -11019,130 +11044,212 @@ var wrapTxBypass = /*#__PURE__*/function () {
11019
11044
  };
11020
11045
  }();
11021
11046
 
11047
+ var MAX_INCREASE_RETRIES = 5;
11048
+ var INCREASE_BUMP_STEP = 100;
11049
+ var DECREASE_START_AMOUNT = 1;
11050
+ var MAX_DECREASE_RETRIES = 5;
11051
+ var DECREASE_DIVIDE_FACTOR = 5;
11052
+ var FAILED_TO_TRANSACT_ASSET = 'FailedToTransactAsset';
11022
11053
  var getBypassResultWithRetries = /*#__PURE__*/function () {
11023
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options, internalFn, initialTx) {
11054
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options, internalFn, initialTx) {
11024
11055
  var maxRetries,
11025
11056
  bumpStep,
11026
- hasError,
11057
+ getResultError,
11058
+ isFailedToTransact,
11059
+ isAmountTooLow,
11060
+ attempt,
11061
+ retryWithReducedAmount,
11027
11062
  first,
11028
- result,
11029
11063
  i,
11030
11064
  amount,
11031
- bumpedTx,
11032
- _args = arguments,
11033
- _t,
11065
+ res,
11066
+ err,
11067
+ _args3 = arguments,
11034
11068
  _t2,
11035
11069
  _t3;
11036
- return _regenerator().w(function (_context) {
11037
- while (1) switch (_context.p = _context.n) {
11070
+ return _regenerator().w(function (_context3) {
11071
+ while (1) switch (_context3.p = _context3.n) {
11038
11072
  case 0:
11039
- maxRetries = _args.length > 3 && _args[3] !== undefined ? _args[3] : 5;
11040
- bumpStep = _args.length > 4 && _args[4] !== undefined ? _args[4] : 100;
11041
- hasError = function hasError(res) {
11042
- return 'failureReason' in res ? !!res.failureReason : 'dryRunError' in res ? !!res.dryRunError : false;
11073
+ maxRetries = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : MAX_INCREASE_RETRIES;
11074
+ bumpStep = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : INCREASE_BUMP_STEP;
11075
+ getResultError = function getResultError(res) {
11076
+ return 'failureReason' in res ? res.failureReason : 'dryRunError' in res ? res.dryRunError : undefined;
11077
+ };
11078
+ isFailedToTransact = function isFailedToTransact(res) {
11079
+ return 'failureReason' in res && res.failureReason === FAILED_TO_TRANSACT_ASSET;
11080
+ };
11081
+ isAmountTooLow = function isAmountTooLow(e) {
11082
+ return e instanceof AmountTooLowError;
11043
11083
  };
11084
+ attempt = /*#__PURE__*/function () {
11085
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(amount, relative) {
11086
+ var tx;
11087
+ return _regenerator().w(function (_context) {
11088
+ while (1) switch (_context.n) {
11089
+ case 0:
11090
+ _context.n = 1;
11091
+ return options.buildTx(amount, relative);
11092
+ case 1:
11093
+ tx = _context.v;
11094
+ return _context.a(2, internalFn(_objectSpread2(_objectSpread2({}, options), {}, {
11095
+ tx: tx,
11096
+ useRootOrigin: true
11097
+ })));
11098
+ }
11099
+ }, _callee);
11100
+ }));
11101
+ return function attempt(_x4, _x5) {
11102
+ return _ref2.apply(this, arguments);
11103
+ };
11104
+ }();
11105
+ retryWithReducedAmount = /*#__PURE__*/function () {
11106
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
11107
+ var start,
11108
+ divide,
11109
+ amount,
11110
+ attemptIdx,
11111
+ res,
11112
+ err,
11113
+ _args2 = arguments,
11114
+ _t;
11115
+ return _regenerator().w(function (_context2) {
11116
+ while (1) switch (_context2.p = _context2.n) {
11117
+ case 0:
11118
+ start = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : DECREASE_START_AMOUNT;
11119
+ divide = function divide(v) {
11120
+ var next = v / DECREASE_DIVIDE_FACTOR;
11121
+ return next > 0 ? next : 1;
11122
+ };
11123
+ amount = divide(start);
11124
+ attemptIdx = 0;
11125
+ case 1:
11126
+ if (!(attemptIdx < MAX_DECREASE_RETRIES && amount > 0)) {
11127
+ _context2.n = 9;
11128
+ break;
11129
+ }
11130
+ _context2.p = 2;
11131
+ _context2.n = 3;
11132
+ return attempt(amount.toString(), false);
11133
+ case 3:
11134
+ res = _context2.v;
11135
+ err = getResultError(res);
11136
+ if (err) {
11137
+ _context2.n = 4;
11138
+ break;
11139
+ }
11140
+ return _context2.a(2, res);
11141
+ case 4:
11142
+ if (!isFailedToTransact(res)) {
11143
+ _context2.n = 5;
11144
+ break;
11145
+ }
11146
+ amount = divide(amount);
11147
+ return _context2.a(3, 8);
11148
+ case 5:
11149
+ return _context2.a(2, res);
11150
+ case 6:
11151
+ _context2.p = 6;
11152
+ _t = _context2.v;
11153
+ if (!isAmountTooLow(_t)) {
11154
+ _context2.n = 7;
11155
+ break;
11156
+ }
11157
+ amount = divide(amount);
11158
+ return _context2.a(3, 8);
11159
+ case 7:
11160
+ throw _t;
11161
+ case 8:
11162
+ attemptIdx++;
11163
+ _context2.n = 1;
11164
+ break;
11165
+ case 9:
11166
+ return _context2.a(2, attempt(amount.toString(), false));
11167
+ }
11168
+ }, _callee2, null, [[2, 6]]);
11169
+ }));
11170
+ return function retryWithReducedAmount() {
11171
+ return _ref3.apply(this, arguments);
11172
+ };
11173
+ }();
11044
11174
  if (!initialTx) {
11045
- _context.n = 5;
11175
+ _context3.n = 5;
11046
11176
  break;
11047
11177
  }
11048
- _context.p = 1;
11049
- _context.n = 2;
11178
+ _context3.p = 1;
11179
+ _context3.n = 2;
11050
11180
  return internalFn(_objectSpread2(_objectSpread2({}, options), {}, {
11051
11181
  tx: initialTx,
11052
11182
  useRootOrigin: true
11053
11183
  }));
11054
11184
  case 2:
11055
- first = _context.v;
11056
- if (hasError(first)) {
11057
- _context.n = 3;
11185
+ first = _context3.v;
11186
+ if (getResultError(first)) {
11187
+ _context3.n = 3;
11058
11188
  break;
11059
11189
  }
11060
- return _context.a(2, first);
11190
+ return _context3.a(2, first);
11061
11191
  case 3:
11062
- _context.n = 5;
11192
+ _context3.n = 5;
11063
11193
  break;
11064
11194
  case 4:
11065
- _context.p = 4;
11066
- _t = _context.v;
11067
- if (_t instanceof AmountTooLowError) {
11068
- _context.n = 5;
11195
+ _context3.p = 4;
11196
+ _t2 = _context3.v;
11197
+ if (isAmountTooLow(_t2)) {
11198
+ _context3.n = 5;
11069
11199
  break;
11070
11200
  }
11071
- throw _t;
11201
+ throw _t2;
11072
11202
  case 5:
11073
- result = null;
11074
11203
  i = 1;
11075
11204
  case 6:
11076
11205
  if (!(i <= maxRetries)) {
11077
- _context.n = 19;
11206
+ _context3.n = 15;
11078
11207
  break;
11079
11208
  }
11080
- amount = (bumpStep * i).toString();
11081
- bumpedTx = void 0;
11082
- _context.p = 7;
11083
- _context.n = 8;
11084
- return options.buildTx(amount);
11209
+ amount = bumpStep * i;
11210
+ _context3.p = 7;
11211
+ _context3.n = 8;
11212
+ return attempt(amount.toString());
11085
11213
  case 8:
11086
- bumpedTx = _context.v;
11087
- _context.n = 12;
11088
- break;
11089
- case 9:
11090
- _context.p = 9;
11091
- _t2 = _context.v;
11092
- if (!(_t2 instanceof AmountTooLowError)) {
11093
- _context.n = 11;
11214
+ res = _context3.v;
11215
+ err = getResultError(res);
11216
+ if (err) {
11217
+ _context3.n = 9;
11094
11218
  break;
11095
11219
  }
11096
- if (!(i === maxRetries)) {
11097
- _context.n = 10;
11220
+ return _context3.a(2, res);
11221
+ case 9:
11222
+ if (!isFailedToTransact(res)) {
11223
+ _context3.n = 10;
11098
11224
  break;
11099
11225
  }
11100
- throw _t2;
11226
+ return _context3.a(2, retryWithReducedAmount(DECREASE_START_AMOUNT));
11101
11227
  case 10:
11102
- return _context.a(3, 18);
11228
+ return _context3.a(3, 14);
11103
11229
  case 11:
11104
- throw _t2;
11105
- case 12:
11106
- _context.p = 12;
11107
- _context.n = 13;
11108
- return internalFn(_objectSpread2(_objectSpread2({}, options), {}, {
11109
- tx: bumpedTx,
11110
- useRootOrigin: true
11111
- }));
11112
- case 13:
11113
- result = _context.v;
11114
- if (hasError(result)) {
11115
- _context.n = 14;
11116
- break;
11117
- }
11118
- return _context.a(2, result);
11119
- case 14:
11120
- _context.n = 18;
11121
- break;
11122
- case 15:
11123
- _context.p = 15;
11124
- _t3 = _context.v;
11125
- if (!(_t3 instanceof AmountTooLowError)) {
11126
- _context.n = 17;
11230
+ _context3.p = 11;
11231
+ _t3 = _context3.v;
11232
+ if (!isAmountTooLow(_t3)) {
11233
+ _context3.n = 13;
11127
11234
  break;
11128
11235
  }
11129
11236
  if (!(i === maxRetries)) {
11130
- _context.n = 16;
11237
+ _context3.n = 12;
11131
11238
  break;
11132
11239
  }
11133
11240
  throw _t3;
11134
- case 16:
11135
- return _context.a(3, 18);
11136
- case 17:
11241
+ case 12:
11242
+ return _context3.a(3, 14);
11243
+ case 13:
11137
11244
  throw _t3;
11138
- case 18:
11245
+ case 14:
11139
11246
  i++;
11140
- _context.n = 6;
11247
+ _context3.n = 6;
11141
11248
  break;
11142
- case 19:
11143
- return _context.a(2, result);
11249
+ case 15:
11250
+ return _context3.a(2, attempt(String(bumpStep * maxRetries)));
11144
11251
  }
11145
- }, _callee, null, [[12, 15], [7, 9], [1, 4]]);
11252
+ }, _callee3, null, [[7, 11], [1, 4]]);
11146
11253
  }));
11147
11254
  return function getBypassResultWithRetries(_x, _x2, _x3) {
11148
11255
  return _ref.apply(this, arguments);
@@ -11503,8 +11610,11 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
11503
11610
  case 0:
11504
11611
  hopApi = params.api, currentChain = params.currentChain, currentOrigin = params.currentOrigin, currentAsset = params.currentAsset, forwardedXcms = params.forwardedXcms, hasPassedExchange = params.hasPassedExchange;
11505
11612
  hopAsset = resolveHopAsset({
11613
+ api: api,
11614
+ tx: tx,
11506
11615
  originChain: origin,
11507
11616
  currentChain: currentChain,
11617
+ destination: destination,
11508
11618
  asset: currentAsset,
11509
11619
  currency: currency,
11510
11620
  swapConfig: swapConfig,
@@ -12713,35 +12823,45 @@ var buildTypeAndThenCall = function buildTypeAndThenCall(_ref, isDotAsset, custo
12713
12823
  };
12714
12824
 
12715
12825
  var FEE_PADDING_PERCENTAGE = 20;
12826
+ var FEE_ETH_ASSET_PADDING_PERCENTAGE = 100;
12716
12827
  var FEE_PADDING_HYDRATION = 500;
12828
+ var getPadding = function getPadding(chain, _ref) {
12829
+ var assetInfo = _ref.assetInfo,
12830
+ dest = _ref.dest;
12831
+ var isEthAsset = assetInfo.location && findAssetInfoByLoc(getOtherAssets('Ethereum'), assetInfo.location);
12832
+ if (chain === 'Hydration') return FEE_PADDING_HYDRATION;
12833
+ if (isEthAsset && dest.chain.startsWith('AssetHub')) return FEE_ETH_ASSET_PADDING_PERCENTAGE;
12834
+ return FEE_PADDING_PERCENTAGE;
12835
+ };
12717
12836
  var computeInstructionFee = /*#__PURE__*/function () {
12718
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref, version, xcm) {
12719
- var chain, api, _t;
12837
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref2, version, xcm, context) {
12838
+ var chain, api, padding, _t;
12720
12839
  return _regenerator().w(function (_context) {
12721
12840
  while (1) switch (_context.n) {
12722
12841
  case 0:
12723
- chain = _ref.chain, api = _ref.api;
12842
+ chain = _ref2.chain, api = _ref2.api;
12843
+ padding = getPadding(chain, context);
12724
12844
  _t = padValueBy;
12725
12845
  _context.n = 1;
12726
12846
  return api.getXcmPaymentApiFee(chain, addXcmVersionHeader(xcm, version), [], {
12727
12847
  location: DOT_LOCATION
12728
12848
  }, true);
12729
12849
  case 1:
12730
- return _context.a(2, _t(_context.v, chain === 'Hydration' ? FEE_PADDING_HYDRATION : FEE_PADDING_PERCENTAGE));
12850
+ return _context.a(2, _t(_context.v, padding));
12731
12851
  }
12732
12852
  }, _callee);
12733
12853
  }));
12734
- return function computeInstructionFee(_x, _x2, _x3) {
12735
- return _ref2.apply(this, arguments);
12854
+ return function computeInstructionFee(_x, _x2, _x3, _x4) {
12855
+ return _ref3.apply(this, arguments);
12736
12856
  };
12737
12857
  }();
12738
12858
  var computeAllFees = /*#__PURE__*/function () {
12739
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3, customXcm, isDotAsset, refundInstruction) {
12859
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(context, customXcm, isDotAsset, refundInstruction) {
12740
12860
  var reserve, dest, version, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0;
12741
12861
  return _regenerator().w(function (_context2) {
12742
12862
  while (1) switch (_context2.n) {
12743
12863
  case 0:
12744
- reserve = _ref3.reserve, dest = _ref3.dest, version = _ref3.options.version;
12864
+ reserve = context.reserve, dest = context.dest, version = context.options.version;
12745
12865
  if (!customXcm.some(function (x) {
12746
12866
  return 'DepositReserveAsset' in x || 'InitiateTeleport' in x;
12747
12867
  })) {
@@ -12749,7 +12869,7 @@ var computeAllFees = /*#__PURE__*/function () {
12749
12869
  break;
12750
12870
  }
12751
12871
  _context2.n = 1;
12752
- return computeInstructionFee(reserve, version, customXcm);
12872
+ return computeInstructionFee(reserve, version, customXcm, context);
12753
12873
  case 1:
12754
12874
  _t3 = _context2.v;
12755
12875
  if (!refundInstruction) {
@@ -12757,7 +12877,7 @@ var computeAllFees = /*#__PURE__*/function () {
12757
12877
  break;
12758
12878
  }
12759
12879
  _context2.n = 2;
12760
- return computeInstructionFee(reserve, version, [refundInstruction]);
12880
+ return computeInstructionFee(reserve, version, [refundInstruction], context);
12761
12881
  case 2:
12762
12882
  _t4 = _context2.v;
12763
12883
  _context2.n = 4;
@@ -12772,7 +12892,7 @@ var computeAllFees = /*#__PURE__*/function () {
12772
12892
  return 'DepositReserveAsset' in j || 'InitiateTeleport' in j;
12773
12893
  });
12774
12894
  return instr ? 'DepositReserveAsset' in instr ? instr.DepositReserveAsset.xcm : instr.InitiateTeleport.xcm : undefined;
12775
- }());
12895
+ }(), context);
12776
12896
  case 5:
12777
12897
  _t6 = _context2.v;
12778
12898
  _t2 = {
@@ -12788,7 +12908,7 @@ var computeAllFees = /*#__PURE__*/function () {
12788
12908
  break;
12789
12909
  }
12790
12910
  _context2.n = 7;
12791
- return computeInstructionFee(hasXcmPaymentApiSupport(dest.chain) ? dest : reserve, version, customXcm);
12911
+ return computeInstructionFee(hasXcmPaymentApiSupport(dest.chain) ? dest : reserve, version, customXcm, context);
12792
12912
  case 7:
12793
12913
  _t7 = _context2.v;
12794
12914
  _context2.n = 9;
@@ -12802,7 +12922,7 @@ var computeAllFees = /*#__PURE__*/function () {
12802
12922
  break;
12803
12923
  }
12804
12924
  _context2.n = 10;
12805
- return computeInstructionFee(hasXcmPaymentApiSupport(reserve.chain) ? reserve : dest, version, [refundInstruction]);
12925
+ return computeInstructionFee(hasXcmPaymentApiSupport(reserve.chain) ? reserve : dest, version, [refundInstruction], context);
12806
12926
  case 10:
12807
12927
  _t9 = _context2.v;
12808
12928
  _context2.n = 12;
@@ -12821,7 +12941,7 @@ var computeAllFees = /*#__PURE__*/function () {
12821
12941
  }
12822
12942
  }, _callee2);
12823
12943
  }));
12824
- return function computeAllFees(_x4, _x5, _x6, _x7) {
12944
+ return function computeAllFees(_x5, _x6, _x7, _x8) {
12825
12945
  return _ref4.apply(this, arguments);
12826
12946
  };
12827
12947
  }();
@@ -12951,7 +13071,7 @@ var createCustomXcm = function createCustomXcm(_ref, isDotAsset, assetCount, isF
12951
13071
  };
12952
13072
  var buyExecution = {
12953
13073
  BuyExecution: {
12954
- fees: createAsset(version, buyExecutionAmount, feeLocLocalized),
13074
+ fees: createAsset(version, normalizeAmount(buyExecutionAmount), feeLocLocalized),
12955
13075
  weight_limit: 'Unlimited'
12956
13076
  }
12957
13077
  };
@@ -14012,10 +14132,10 @@ var GeneralBuilder = /*#__PURE__*/function () {
14012
14132
  key: "createTxFactory",
14013
14133
  value: function createTxFactory() {
14014
14134
  var _this = this;
14015
- return function (amount) {
14135
+ return function (amount, relative) {
14016
14136
  return createTx(_objectSpread2(_objectSpread2({}, _this._options), {}, {
14017
14137
  api: _this.api
14018
- }), _this, amount);
14138
+ }), _this, amount, relative);
14019
14139
  };
14020
14140
  }
14021
14141
  /**
@@ -14481,4 +14601,4 @@ var Builder = function Builder(api) {
14481
14601
  return new GeneralBuilder(api, new BatchTransactionManager());
14482
14602
  };
14483
14603
 
14484
- export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo$1 as getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };
14604
+ export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo$1 as getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-core",
3
- "version": "11.12.4",
3
+ "version": "11.12.6",
4
4
  "description": "SDK core for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,9 +26,9 @@
26
26
  "@noble/hashes": "^1.8.0",
27
27
  "@scure/base": "^2.0.0",
28
28
  "viem": "^2.37.9",
29
- "@paraspell/assets": "11.12.4",
30
- "@paraspell/sdk-common": "11.12.4",
31
- "@paraspell/pallets": "11.12.4"
29
+ "@paraspell/assets": "11.12.6",
30
+ "@paraspell/sdk-common": "11.12.6",
31
+ "@paraspell/pallets": "11.12.6"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@babel/plugin-syntax-import-attributes": "^7.27.1",