@paraspell/sdk-core 11.6.0 → 11.7.0

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.mjs CHANGED
@@ -727,6 +727,11 @@ var assertAddressIsString = function assertAddressIsString(address) {
727
727
  throw new InvalidParameterError('Location address is not supported for this transfer type.');
728
728
  }
729
729
  };
730
+ var assertSenderAddress = function assertSenderAddress(address) {
731
+ if (!address) {
732
+ throw new InvalidParameterError('Sender address parameter is required for this transfer.');
733
+ }
734
+ };
730
735
  var assertHasLocation = function assertHasLocation(asset) {
731
736
  if (!asset.location) {
732
737
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, replaceBigInt), " is missing location"));
@@ -824,7 +829,7 @@ var sortAssets = function sortAssets(assets) {
824
829
  var isConfig = function isConfig(value) {
825
830
  return _typeof(value) === 'object' && value !== null && !Array.isArray(value) && (
826
831
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
827
- Object.keys(value).length < 3 || 'apiOverrides' in value || 'development' in value || 'abstractDecimals' in value);
832
+ Object.keys(value).length < 3 || 'apiOverrides' in value || 'development' in value || 'abstractDecimals' in value || 'xcmFormatCheck' in value);
828
833
  };
829
834
 
830
835
  /**
@@ -3553,12 +3558,7 @@ var handleExecuteTransfer = /*#__PURE__*/function () {
3553
3558
  while (1) switch (_context.n) {
3554
3559
  case 0:
3555
3560
  api = options.api, senderAddress = options.senderAddress, paraIdTo = options.paraIdTo, assetInfo = options.assetInfo, currency = options.currency, feeCurrency = options.feeCurrency, address = options.address, feeAssetInfo = options.feeAssetInfo, version = options.version;
3556
- if (senderAddress) {
3557
- _context.n = 1;
3558
- break;
3559
- }
3560
- throw new InvalidParameterError('Please provide senderAddress');
3561
- case 1:
3561
+ assertSenderAddress(senderAddress);
3562
3562
  assertAddressIsString(address);
3563
3563
  checkAmount = function checkAmount(fee) {
3564
3564
  if (assetInfo.amount <= fee) {
@@ -3589,7 +3589,7 @@ var handleExecuteTransfer = /*#__PURE__*/function () {
3589
3589
  reserveFee: MIN_FEE
3590
3590
  }
3591
3591
  })), MAX_WEIGHT);
3592
- _context.n = 2;
3592
+ _context.n = 1;
3593
3593
  return dryRunInternal({
3594
3594
  api: api,
3595
3595
  tx: api.callTxMethod(call),
@@ -3601,14 +3601,14 @@ var handleExecuteTransfer = /*#__PURE__*/function () {
3601
3601
  feeAsset: feeCurrency,
3602
3602
  useRootOrigin: true
3603
3603
  });
3604
- case 2:
3604
+ case 1:
3605
3605
  dryRunResult = _context.v;
3606
3606
  if (dryRunResult.origin.success) {
3607
- _context.n = 3;
3607
+ _context.n = 2;
3608
3608
  break;
3609
3609
  }
3610
3610
  throw new DryRunFailedError(dryRunResult.failureReason);
3611
- case 3:
3611
+ case 2:
3612
3612
  originFeeEstimate = dryRunResult.origin.fee;
3613
3613
  originFee = padFeeBy(originFeeEstimate, FEE_PADDING_PERCENTAGE$2);
3614
3614
  reserveFeeEstimate = getReserveFeeFromHops(dryRunResult.hops);
@@ -3620,9 +3620,9 @@ var handleExecuteTransfer = /*#__PURE__*/function () {
3620
3620
  reserveFee: reserveFee
3621
3621
  }
3622
3622
  }));
3623
- _context.n = 4;
3623
+ _context.n = 3;
3624
3624
  return api.getXcmWeight(xcm);
3625
- case 4:
3625
+ case 3:
3626
3626
  weight = _context.v;
3627
3627
  return _context.a(2, createExecuteCall(chain, xcm, weight));
3628
3628
  }
@@ -3660,7 +3660,7 @@ var getReverseTxFee = /*#__PURE__*/function () {
3660
3660
  _context.n = 1;
3661
3661
  return Builder(api).from(destination).to(origin).address(toAddress).senderAddress(fromAddress).currency(_objectSpread2(_objectSpread2({}, currencyInput), {}, {
3662
3662
  amount: currency.amount
3663
- })).build();
3663
+ }))['buildInternal']();
3664
3664
  case 1:
3665
3665
  tx = _context.v;
3666
3666
  _context.n = 2;
@@ -4153,7 +4153,7 @@ var getOriginFeeDetailsInternal = /*#__PURE__*/function () {
4153
4153
  return api.init(origin);
4154
4154
  case 1:
4155
4155
  _context.n = 2;
4156
- return Builder(api).from(origin).to(destination).currency(currency).address(accountDestination).senderAddress(account).ahAddress(ahAddress).build();
4156
+ return Builder(api).from(origin).to(destination).currency(currency).address(accountDestination).senderAddress(account).ahAddress(ahAddress)['buildInternal']();
4157
4157
  case 2:
4158
4158
  tx = _context.v;
4159
4159
  _context.n = 3;
@@ -4313,11 +4313,11 @@ var createOriginLocation = function createOriginLocation(origin, destination) {
4313
4313
  };
4314
4314
  var getDestXcmFee = /*#__PURE__*/function () {
4315
4315
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
4316
- var api, origin, hopChain, destination, currency, forwardedXcms, asset, address, feeAsset, originFee, tx, disableFallback, resolvedFeeAsset, calcPaymentInfoFee, _fee, sufficient, dryRunResult, _fee2, fee, newForwardedXcms, destParaId;
4316
+ var api, origin, hopChain, destination, currency, forwardedXcms, asset, address, feeAsset, originFee, tx, disableFallback, swapConfig, resolvedFeeAsset, calcPaymentInfoFee, _fee, sufficient, dryRunResult, _fee2, fee, newForwardedXcms, destParaId;
4317
4317
  return _regenerator().w(function (_context2) {
4318
4318
  while (1) switch (_context2.n) {
4319
4319
  case 0:
4320
- api = options.api, origin = options.origin, hopChain = options.prevChain, destination = options.destination, currency = options.currency, forwardedXcms = options.forwardedXcms, asset = options.asset, address = options.address, feeAsset = options.feeAsset, originFee = options.originFee, tx = options.tx, disableFallback = options.disableFallback;
4320
+ api = options.api, origin = options.origin, hopChain = options.prevChain, destination = options.destination, currency = options.currency, forwardedXcms = options.forwardedXcms, asset = options.asset, address = options.address, feeAsset = options.feeAsset, originFee = options.originFee, tx = options.tx, disableFallback = options.disableFallback, swapConfig = options.swapConfig;
4321
4321
  resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
4322
4322
  calcPaymentInfoFee = /*#__PURE__*/function () {
4323
4323
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
@@ -4331,7 +4331,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
4331
4331
  }
4332
4332
  return _context.a(2, 0n);
4333
4333
  case 1:
4334
- originAsset = findAssetInfoOrThrow(origin, currency, destination);
4334
+ originAsset = swapConfig !== null && swapConfig !== void 0 && swapConfig.currencyTo ? findAssetInfoOrThrow(swapConfig.exchangeChain, swapConfig.currencyTo, destination) : findAssetInfoOrThrow(origin, currency, destination);
4335
4335
  if (!originAsset.location) {
4336
4336
  _context.n = 7;
4337
4337
  break;
@@ -4695,9 +4695,7 @@ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, origin, message
4695
4695
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, replaceBigInt), " is not a foreign asset"));
4696
4696
  }
4697
4697
  assertHasLocation(asset);
4698
- if (!senderAddress) {
4699
- throw new InvalidParameterError("Please provide senderAddress");
4700
- }
4698
+ assertSenderAddress(senderAddress);
4701
4699
  if (isChainEvm(origin) && !ahAddress) {
4702
4700
  throw new InvalidParameterError("Please provide ahAddress");
4703
4701
  }
@@ -4967,18 +4965,13 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
4967
4965
  }
4968
4966
  });
4969
4967
  senderAddress = (_signer$account = signer.account) === null || _signer$account === void 0 ? void 0 : _signer$account.address;
4970
- if (senderAddress) {
4971
- _context.n = 8;
4972
- break;
4973
- }
4974
- throw new InvalidParameterError('Unable to get sender address');
4968
+ assertSenderAddress(senderAddress);
4969
+ _context.n = 8;
4970
+ return api.init(from, TX_CLIENT_TIMEOUT_MS);
4975
4971
  case 8:
4976
4972
  _context.n = 9;
4977
- return api.init(from, TX_CLIENT_TIMEOUT_MS);
4978
- case 9:
4979
- _context.n = 10;
4980
4973
  return generateMessageId(api, senderAddress, getParaId(from), ethAsset.assetId, address, amount);
4981
- case 10:
4974
+ case 9:
4982
4975
  messageId = _context.v;
4983
4976
  customXcm = createCustomXcmOnDest({
4984
4977
  api: api,
@@ -4990,17 +4983,17 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
4990
4983
  }),
4991
4984
  version: Version.V4
4992
4985
  }, from, messageId);
4993
- _context.n = 11;
4986
+ _context.n = 10;
4994
4987
  return api.objectToHex(customXcm, 'XcmVersionedXcm');
4995
- case 11:
4988
+ case 10:
4996
4989
  customXcmOnDest = _context.v;
4997
- _context.n = 12;
4990
+ _context.n = 11;
4998
4991
  return api.createApiForChain('AssetHubPolkadot');
4999
- case 12:
4992
+ case 11:
5000
4993
  assetHubApi = _context.v;
5001
- _context.n = 13;
4994
+ _context.n = 12;
5002
4995
  return getParaEthTransferFees(assetHubApi);
5003
- case 13:
4996
+ case 12:
5004
4997
  _yield$getParaEthTran = _context.v;
5005
4998
  _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
5006
4999
  bridgeFee = _yield$getParaEthTran2[0];
@@ -5015,7 +5008,7 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
5015
5008
  throw new InvalidParameterError('Input must be a valid number');
5016
5009
  }() : "0x".concat((num >>> 0).toString(16).padStart(8, '0'));
5017
5010
  }; // Execute the custom XCM message with the precompile
5018
- _context.n = 14;
5011
+ _context.n = 13;
5019
5012
  return createTx('transferAssetsUsingTypeAndThenAddress', [
5020
5013
  // This represents (1,X1(Parachain(1000)))
5021
5014
  [1, ['0x00' + numberToHex32(getParaId('AssetHubPolkadot')).slice(2)]],
@@ -5027,7 +5020,7 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
5027
5020
  0,
5028
5021
  // The TransferType corresponding to fee asset
5029
5022
  2, customXcmOnDest]);
5030
- case 14:
5023
+ case 13:
5031
5024
  tx = _context.v;
5032
5025
  return _context.a(2, tx);
5033
5026
  }
@@ -5766,13 +5759,8 @@ var handleToAhTeleport = /*#__PURE__*/function () {
5766
5759
  }
5767
5760
  throw new InvalidParameterError('Location address is not supported for this scenario');
5768
5761
  case 2:
5769
- if (senderAddress) {
5770
- _context.n = 3;
5771
- break;
5772
- }
5773
- throw new InvalidParameterError("Please provide senderAddress");
5774
- case 3:
5775
- _context.n = 4;
5762
+ assertSenderAddress(senderAddress);
5763
+ _context.n = 3;
5776
5764
  return dryRunInternal({
5777
5765
  api: api,
5778
5766
  tx: defaultTx,
@@ -5782,19 +5770,19 @@ var handleToAhTeleport = /*#__PURE__*/function () {
5782
5770
  address: address,
5783
5771
  currency: currency
5784
5772
  });
5785
- case 4:
5773
+ case 3:
5786
5774
  dryRunResult = _context.v;
5787
5775
  if (!((_dryRunResult$destina = dryRunResult.destination) !== null && _dryRunResult$destina !== void 0 && _dryRunResult$destina.success)) {
5788
- _context.n = 5;
5776
+ _context.n = 4;
5789
5777
  break;
5790
5778
  }
5791
5779
  return _context.a(2, defaultTx);
5792
- case 5:
5780
+ case 4:
5793
5781
  // If the default tx dry run failed, we need to create execute transaction
5794
5782
  dummyTx = createExecuteExchangeXcm(input, origin, MAX_WEIGHT,
5795
5783
  // Enter dummy fee values just to get the dry run to pass
5796
5784
  asset.amount, asset.amount / 2n);
5797
- _context.n = 6;
5785
+ _context.n = 5;
5798
5786
  return getXcmFee({
5799
5787
  api: api,
5800
5788
  tx: dummyTx,
@@ -5805,7 +5793,7 @@ var handleToAhTeleport = /*#__PURE__*/function () {
5805
5793
  currency: currency,
5806
5794
  disableFallback: false
5807
5795
  });
5808
- case 6:
5796
+ case 5:
5809
5797
  feeResult = _context.v;
5810
5798
  originExecutionFee = padFeeBy(feeResult.origin.fee, 20); // Pad by 20%
5811
5799
  destinationExecutionFee = padFeeBy(
@@ -6397,20 +6385,15 @@ var Parachain = /*#__PURE__*/function () {
6397
6385
  case 2:
6398
6386
  assertHasLocation(asset);
6399
6387
  assertAddressIsString(address);
6400
- if (!(senderAddress === undefined)) {
6401
- _context3.n = 3;
6402
- break;
6403
- }
6404
- throw new InvalidParameterError('Sender address is required for transfers to Ethereum');
6405
- case 3:
6388
+ assertSenderAddress(senderAddress);
6406
6389
  ethAsset = createAsset(version, asset.amount, asset.location);
6407
- _context3.n = 4;
6390
+ _context3.n = 3;
6408
6391
  return api.createApiForChain('AssetHubPolkadot');
6409
- case 4:
6392
+ case 3:
6410
6393
  ahApi = _context3.v;
6411
- _context3.n = 5;
6394
+ _context3.n = 4;
6412
6395
  return getParaEthTransferFees(ahApi);
6413
- case 5:
6396
+ case 4:
6414
6397
  _yield$getParaEthTran = _context3.v;
6415
6398
  _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
6416
6399
  bridgeFee = _yield$getParaEthTran2[0];
@@ -6419,13 +6402,13 @@ var Parachain = /*#__PURE__*/function () {
6419
6402
  fee = useOnlyDepositInstruction ? PARA_TO_PARA_FEE_DOT : bridgeFee + executionFee;
6420
6403
  ethAssetInfo = findAssetInfoByLoc(getOtherAssets('Ethereum'), asset.location);
6421
6404
  if (ethAssetInfo) {
6422
- _context3.n = 6;
6405
+ _context3.n = 5;
6423
6406
  break;
6424
6407
  }
6425
6408
  throw new InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(asset, replaceBigInt)));
6426
- case 6:
6409
+ case 5:
6427
6410
  if (!useOnlyDepositInstruction) {
6428
- _context3.n = 7;
6411
+ _context3.n = 6;
6429
6412
  break;
6430
6413
  }
6431
6414
  customXcmOnDest = addXcmVersionHeader([{
@@ -6442,16 +6425,16 @@ var Parachain = /*#__PURE__*/function () {
6442
6425
  })
6443
6426
  }
6444
6427
  }], version);
6445
- _context3.n = 9;
6428
+ _context3.n = 8;
6446
6429
  break;
6447
- case 7:
6430
+ case 6:
6448
6431
  assertHasId(ethAssetInfo);
6449
- _context3.n = 8;
6432
+ _context3.n = 7;
6450
6433
  return generateMessageId(api, senderAddress, getParaId(this.chain), ethAssetInfo.assetId, address, asset.amount);
6451
- case 8:
6434
+ case 7:
6452
6435
  messageId = _context3.v;
6453
6436
  customXcmOnDest = createCustomXcmOnDest(input, this.chain, messageId);
6454
- case 9:
6437
+ case 8:
6455
6438
  call = {
6456
6439
  module: 'PolkadotXcm',
6457
6440
  method: 'transfer_assets_using_type_and_then',
@@ -6864,23 +6847,18 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
6864
6847
  }
6865
6848
  throw new BridgeHaltedError();
6866
6849
  case 2:
6867
- if (!(senderAddress === undefined)) {
6868
- _context.n = 3;
6869
- break;
6870
- }
6871
- throw new InvalidParameterError('Sender address is required for transfers to Ethereum');
6872
- case 3:
6850
+ assertSenderAddress(senderAddress);
6873
6851
  if (!isTLocation(address)) {
6874
- _context.n = 4;
6852
+ _context.n = 3;
6875
6853
  break;
6876
6854
  }
6877
6855
  throw new InvalidParameterError('Location address is not supported for Ethereum transfers');
6878
- case 4:
6856
+ case 3:
6879
6857
  assertIsForeign(asset);
6880
6858
  assertHasLocation(asset);
6881
- _context.n = 5;
6859
+ _context.n = 4;
6882
6860
  return generateMessageId(api, senderAddress, getParaId(this.chain), JSON.stringify(asset.location), address, asset.amount);
6883
- case 5:
6861
+ case 4:
6884
6862
  messageId = _context.v;
6885
6863
  location = asset.symbol === this.getNativeAssetSymbol() ? DOT_LOCATION : asset.location;
6886
6864
  call = {
@@ -8826,43 +8804,38 @@ var createTypeAndThenTransfer = /*#__PURE__*/function () {
8826
8804
  api = options.api, asset = options.assetInfo, senderAddress = options.senderAddress, address = options.address, destination = options.destination;
8827
8805
  assertHasLocation(asset);
8828
8806
  assertAddressIsString(address);
8829
- if (senderAddress) {
8830
- _context.n = 1;
8831
- break;
8832
- }
8833
- throw new InvalidCurrencyError("Sender address is required for Mythos transfer");
8834
- case 1:
8807
+ assertSenderAddress(senderAddress);
8835
8808
  if (!(!isForeignAsset(asset) || !asset.assetId)) {
8836
- _context.n = 2;
8809
+ _context.n = 1;
8837
8810
  break;
8838
8811
  }
8839
8812
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, replaceBigInt), " is not a foreign asset"));
8840
- case 2:
8841
- _context.n = 3;
8813
+ case 1:
8814
+ _context.n = 2;
8842
8815
  return generateMessageId(api, senderAddress, getParaId(chain), asset.assetId, address, asset.amount);
8843
- case 3:
8816
+ case 2:
8844
8817
  messageId = _context.v;
8845
8818
  ahApi = api.clone();
8846
- _context.n = 4;
8819
+ _context.n = 3;
8847
8820
  return ahApi.init('AssetHubPolkadot');
8848
- case 4:
8849
- _context.n = 5;
8821
+ case 3:
8822
+ _context.n = 4;
8850
8823
  return getParaEthTransferFees(ahApi);
8851
- case 5:
8824
+ case 4:
8852
8825
  _yield$getParaEthTran = _context.v;
8853
8826
  _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
8854
8827
  bridgeFee = _yield$getParaEthTran2[0];
8855
8828
  ahExecutionFee = _yield$getParaEthTran2[1];
8856
- _context.n = 6;
8829
+ _context.n = 5;
8857
8830
  return ahApi.quoteAhPrice(DOT_LOCATION, getNativeAssets(chain)[0].location, bridgeFee + ahExecutionFee);
8858
- case 6:
8831
+ case 5:
8859
8832
  feeConverted = _context.v;
8860
8833
  if (feeConverted) {
8861
- _context.n = 7;
8834
+ _context.n = 6;
8862
8835
  break;
8863
8836
  }
8864
8837
  throw new InvalidParameterError("Pool DOT -> ".concat(asset.symbol, " not found."));
8865
- case 7:
8838
+ case 6:
8866
8839
  nativeMythAmount = padFeeBy(feeConverted, 10);
8867
8840
  return _context.a(2, {
8868
8841
  module: 'PolkadotXcm',
@@ -9610,6 +9583,8 @@ var MAX_WEIGHT = {
9610
9583
  proofSize: MAX_U64,
9611
9584
  refTime: MAX_U64
9612
9585
  };
9586
+ var BYPASS_MINT_AMOUNT = '1000';
9587
+ var BYPASS_CURRENCY_AMOUNT = '800';
9613
9588
 
9614
9589
  var buildClaimAssetsParams = function buildClaimAssetsParams(options) {
9615
9590
  var assets = options.assets,
@@ -9991,7 +9966,6 @@ var getPalletInstance = function getPalletInstance(type) {
9991
9966
  return new HandlerClass();
9992
9967
  };
9993
9968
 
9994
- var MINT_AMOUNT = 1000n; // Mint 1000 units of asset
9995
9969
  var getCurrencySelection = function getCurrencySelection(asset) {
9996
9970
  if (asset.location) return {
9997
9971
  location: asset.location
@@ -10024,7 +9998,7 @@ var createMintTxs = function createMintTxs(chain, asset, balance, address, api)
10024
9998
  return palletInstance.mint(address, asset, balance, chain, api);
10025
9999
  };
10026
10000
  var createRequiredMintTxs = function createRequiredMintTxs(chain, asset, amountHuman, balance, address, api) {
10027
- var amount = parseUnits(amountHuman.toString(), asset.decimals);
10001
+ var amount = parseUnits(amountHuman, asset.decimals);
10028
10002
  return createMintTxs(chain, _objectSpread2(_objectSpread2({}, asset), {}, {
10029
10003
  amount: amount
10030
10004
  }), balance, address, api);
@@ -10032,7 +10006,7 @@ var createRequiredMintTxs = function createRequiredMintTxs(chain, asset, amountH
10032
10006
  var createOptionalMintTxs = function createOptionalMintTxs(chain, currency, amountHuman, balance, address, api) {
10033
10007
  var asset = findAssetInfo(chain, currency, null);
10034
10008
  if (!asset) return null;
10035
- var amount = parseUnits(amountHuman.toString(), asset.decimals);
10009
+ var amount = parseUnits(amountHuman, asset.decimals);
10036
10010
  return createMintTxs(chain, _objectSpread2(_objectSpread2({}, asset), {}, {
10037
10011
  amount: amount
10038
10012
  }), balance, address, api);
@@ -10073,7 +10047,7 @@ var mintBonusForSent = function mintBonusForSent(chain, sent, feeAsset, mintFeeA
10073
10047
  });
10074
10048
  return preminted.some(function (a) {
10075
10049
  return isAssetXcEqual(a, sent);
10076
- }) ? parseUnits(MINT_AMOUNT.toString(), sent.decimals) : 0n;
10050
+ }) ? parseUnits(BYPASS_MINT_AMOUNT, sent.decimals) : 0n;
10077
10051
  };
10078
10052
  var wrapTxBypass = /*#__PURE__*/function () {
10079
10053
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(dryRunOptions) {
@@ -10129,7 +10103,7 @@ var wrapTxBypass = /*#__PURE__*/function () {
10129
10103
  break;
10130
10104
  }
10131
10105
  _context.n = 1;
10132
- return createRequiredMintTxs(chain, findNativeAssetInfoOrThrow(chain), MINT_AMOUNT, 0n, address, api);
10106
+ return createRequiredMintTxs(chain, findNativeAssetInfoOrThrow(chain), BYPASS_MINT_AMOUNT, 0n, address, api);
10133
10107
  case 1:
10134
10108
  _t = _context.v;
10135
10109
  _context.n = 3;
@@ -10143,7 +10117,7 @@ var wrapTxBypass = /*#__PURE__*/function () {
10143
10117
  break;
10144
10118
  }
10145
10119
  _context.n = 4;
10146
- return createOptionalMintTxs(chain, relayCurrency, MINT_AMOUNT, 0n, address, api);
10120
+ return createOptionalMintTxs(chain, relayCurrency, BYPASS_MINT_AMOUNT, 0n, address, api);
10147
10121
  case 4:
10148
10122
  _t2 = _context.v;
10149
10123
  _context.n = 6;
@@ -10156,7 +10130,7 @@ var wrapTxBypass = /*#__PURE__*/function () {
10156
10130
  _context.n = 8;
10157
10131
  break;
10158
10132
  }
10159
- amount = parseUnits(MINT_AMOUNT.toString(), feeAsset.decimals);
10133
+ amount = parseUnits(BYPASS_MINT_AMOUNT, feeAsset.decimals);
10160
10134
  _context.n = 7;
10161
10135
  return createMintTxs(chain, _objectSpread2(_objectSpread2({}, feeAsset), {}, {
10162
10136
  amount: amount
@@ -10175,7 +10149,7 @@ var wrapTxBypass = /*#__PURE__*/function () {
10175
10149
  balance = _context.v;
10176
10150
  bonus = mintBonusForSent(chain, asset, feeAsset, !!mintFeeAssets);
10177
10151
  if ((options === null || options === void 0 ? void 0 : options.sentAssetMintMode) === 'bypass') {
10178
- mintAmount = parseUnits(MINT_AMOUNT.toString(), asset.decimals) + asset.amount;
10152
+ mintAmount = parseUnits(BYPASS_MINT_AMOUNT, asset.decimals) + asset.amount;
10179
10153
  } else {
10180
10154
  missing = (_calcPreviewMintAmoun = calcPreviewMintAmount(balance, asset.amount)) !== null && _calcPreviewMintAmoun !== void 0 ? _calcPreviewMintAmoun : 0n;
10181
10155
  total = missing + bonus;
@@ -10616,7 +10590,8 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
10616
10590
  tx: tx,
10617
10591
  originFee: originFee !== null && originFee !== void 0 ? originFee : 0n,
10618
10592
  senderAddress: senderAddress,
10619
- disableFallback: disableFallback
10593
+ disableFallback: disableFallback,
10594
+ swapConfig: swapConfig
10620
10595
  });
10621
10596
  case 4:
10622
10597
  destFeeRes = _context2.v;
@@ -11664,7 +11639,7 @@ var getMinTransferableAmountInternal = /*#__PURE__*/function () {
11664
11639
  _t = dryRunInternal;
11665
11640
  _t2 = api;
11666
11641
  _context.n = 4;
11667
- return modifiedBuilder.build();
11642
+ return modifiedBuilder['buildInternal']();
11668
11643
  case 4:
11669
11644
  _t3 = _context.v;
11670
11645
  _t4 = chain;
@@ -11692,7 +11667,7 @@ var getMinTransferableAmountInternal = /*#__PURE__*/function () {
11692
11667
  _context.n = 6;
11693
11668
  break;
11694
11669
  }
11695
- throw new DryRunFailedError('Not enough balance for XCM');
11670
+ return _context.a(2, 0n);
11696
11671
  case 6:
11697
11672
  return _context.a(2, minAmount);
11698
11673
  }
@@ -11851,7 +11826,7 @@ var buildTypeAndThenCall = function buildTypeAndThenCall(_ref, isDotAsset, custo
11851
11826
  };
11852
11827
 
11853
11828
  var FEE_PADDING_PERCENTAGE = 20;
11854
- var FEE_PADDING_HYDRATION = 150;
11829
+ var FEE_PADDING_HYDRATION = 500;
11855
11830
  var computeInstructionFee = /*#__PURE__*/function () {
11856
11831
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref, version, xcm) {
11857
11832
  var chain, api, _t;
@@ -12650,60 +12625,156 @@ var GeneralBuilder = /*#__PURE__*/function () {
12650
12625
  return _buildBatch.apply(this, arguments);
12651
12626
  }
12652
12627
  return buildBatch;
12653
- }()
12628
+ }())
12629
+ }, {
12630
+ key: "buildInternal",
12631
+ value: function buildInternal() {
12632
+ return this.buildCommon(true);
12633
+ }
12654
12634
  /**
12655
12635
  * Builds and returns the transfer extrinsic.
12656
12636
  *
12657
12637
  * @returns A Promise that resolves to the transfer extrinsic.
12658
12638
  */
12659
- )
12660
12639
  }, {
12661
12640
  key: "build",
12662
12641
  value: (function () {
12663
12642
  var _build = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
12664
- var _this$_options, from, to;
12665
12643
  return _regenerator().w(function (_context2) {
12666
12644
  while (1) switch (_context2.n) {
12667
12645
  case 0:
12646
+ return _context2.a(2, this.buildCommon());
12647
+ }
12648
+ }, _callee2, this);
12649
+ }));
12650
+ function build() {
12651
+ return _build.apply(this, arguments);
12652
+ }
12653
+ return build;
12654
+ }())
12655
+ }, {
12656
+ key: "buildCommon",
12657
+ value: function () {
12658
+ var _buildCommon = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
12659
+ var isCalledInternally,
12660
+ _this$_options,
12661
+ from,
12662
+ to,
12663
+ tx,
12664
+ _args3 = arguments;
12665
+ return _regenerator().w(function (_context3) {
12666
+ while (1) switch (_context3.n) {
12667
+ case 0:
12668
+ isCalledInternally = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;
12668
12669
  if (this.batchManager.isEmpty()) {
12669
- _context2.n = 1;
12670
+ _context3.n = 1;
12670
12671
  break;
12671
12672
  }
12672
12673
  throw new InvalidParameterError('Transaction manager contains batched items. Use buildBatch() to process them.');
12673
12674
  case 1:
12674
12675
  _this$_options = this._options, from = _this$_options.from, to = _this$_options.to;
12675
12676
  if (!(!isTLocation(to) && isRelayChain(from) && isRelayChain(to) && from !== to)) {
12676
- _context2.n = 2;
12677
+ _context3.n = 2;
12677
12678
  break;
12678
12679
  }
12679
12680
  throw new InvalidParameterError('Transfers between relay chains are not yet supported.');
12680
12681
  case 2:
12681
- return _context2.a(2, send(_objectSpread2({
12682
+ _context3.n = 3;
12683
+ return send(_objectSpread2({
12682
12684
  api: this.api
12683
- }, this._options)));
12685
+ }, this._options));
12686
+ case 3:
12687
+ tx = _context3.v;
12688
+ _context3.n = 4;
12689
+ return this.maybePerformXcmFormatCheck(tx, this._options, isCalledInternally);
12690
+ case 4:
12691
+ return _context3.a(2, tx);
12684
12692
  }
12685
- }, _callee2, this);
12693
+ }, _callee3, this);
12686
12694
  }));
12687
- function build() {
12688
- return _build.apply(this, arguments);
12695
+ function buildCommon() {
12696
+ return _buildCommon.apply(this, arguments);
12689
12697
  }
12690
- return build;
12691
- }())
12698
+ return buildCommon;
12699
+ }()
12700
+ }, {
12701
+ key: "maybePerformXcmFormatCheck",
12702
+ value: function () {
12703
+ var _maybePerformXcmFormatCheck = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(tx, options, isCalledInternally) {
12704
+ var senderAddress, config, dryRunResult;
12705
+ return _regenerator().w(function (_context4) {
12706
+ while (1) switch (_context4.n) {
12707
+ case 0:
12708
+ senderAddress = options.senderAddress;
12709
+ config = this.api.getConfig();
12710
+ if (!(isConfig(config) && config.xcmFormatCheck && !isCalledInternally)) {
12711
+ _context4.n = 2;
12712
+ break;
12713
+ }
12714
+ assertSenderAddress(senderAddress);
12715
+ _context4.n = 1;
12716
+ return buildDryRun(this.api, tx, _objectSpread2(_objectSpread2({}, options), {}, {
12717
+ senderAddress: senderAddress
12718
+ }), {
12719
+ sentAssetMintMode: 'bypass'
12720
+ });
12721
+ case 1:
12722
+ dryRunResult = _context4.v;
12723
+ if (!dryRunResult.failureReason) {
12724
+ _context4.n = 2;
12725
+ break;
12726
+ }
12727
+ throw new DryRunFailedError(dryRunResult.failureReason, dryRunResult.failureChain);
12728
+ case 2:
12729
+ return _context4.a(2);
12730
+ }
12731
+ }, _callee4, this);
12732
+ }));
12733
+ function maybePerformXcmFormatCheck(_x2, _x3, _x4) {
12734
+ return _maybePerformXcmFormatCheck.apply(this, arguments);
12735
+ }
12736
+ return maybePerformXcmFormatCheck;
12737
+ }()
12738
+ }, {
12739
+ key: "computeOverridenAmount",
12740
+ value: function computeOverridenAmount() {
12741
+ var _this$_options2 = this._options,
12742
+ from = _this$_options2.from,
12743
+ to = _this$_options2.to,
12744
+ currency = _this$_options2.currency;
12745
+ var config = this.api.getConfig();
12746
+ if (isConfig(config) && config.abstractDecimals) {
12747
+ return BYPASS_CURRENCY_AMOUNT;
12748
+ } else {
12749
+ assertToIsString(to);
12750
+ var asset = findAssetInfoOrThrow(from, currency, to);
12751
+ return parseUnits(BYPASS_CURRENCY_AMOUNT, asset.decimals);
12752
+ }
12753
+ }
12754
+ }, {
12755
+ key: "overrideTxAmount",
12756
+ value: function overrideTxAmount() {
12757
+ var currency = this._options.currency;
12758
+ var modifiedBuilder = this.currency(_objectSpread2(_objectSpread2({}, currency), {}, {
12759
+ amount: this.computeOverridenAmount()
12760
+ }));
12761
+ return modifiedBuilder.buildInternal();
12762
+ }
12692
12763
  }, {
12693
12764
  key: "dryRun",
12694
12765
  value: function () {
12695
- var _dryRun = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
12766
+ var _dryRun = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
12696
12767
  var tx;
12697
- return _regenerator().w(function (_context3) {
12698
- while (1) switch (_context3.n) {
12768
+ return _regenerator().w(function (_context5) {
12769
+ while (1) switch (_context5.n) {
12699
12770
  case 0:
12700
- _context3.n = 1;
12701
- return this.build();
12771
+ _context5.n = 1;
12772
+ return this.buildInternal();
12702
12773
  case 1:
12703
- tx = _context3.v;
12704
- return _context3.a(2, buildDryRun(this.api, tx, this._options));
12774
+ tx = _context5.v;
12775
+ return _context5.a(2, buildDryRun(this.api, tx, this._options));
12705
12776
  }
12706
- }, _callee3, this);
12777
+ }, _callee5, this);
12707
12778
  }));
12708
12779
  function dryRun() {
12709
12780
  return _dryRun.apply(this, arguments);
@@ -12713,23 +12784,23 @@ var GeneralBuilder = /*#__PURE__*/function () {
12713
12784
  }, {
12714
12785
  key: "dryRunPreview",
12715
12786
  value: function () {
12716
- var _dryRunPreview = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(options) {
12787
+ var _dryRunPreview = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(options) {
12717
12788
  var tx;
12718
- return _regenerator().w(function (_context4) {
12719
- while (1) switch (_context4.n) {
12789
+ return _regenerator().w(function (_context6) {
12790
+ while (1) switch (_context6.n) {
12720
12791
  case 0:
12721
- _context4.n = 1;
12722
- return this.build();
12792
+ _context6.n = 1;
12793
+ return this.buildInternal();
12723
12794
  case 1:
12724
- tx = _context4.v;
12725
- return _context4.a(2, buildDryRun(this.api, tx, this._options, {
12795
+ tx = _context6.v;
12796
+ return _context6.a(2, buildDryRun(this.api, tx, this._options, {
12726
12797
  sentAssetMintMode: 'preview',
12727
12798
  mintFeeAssets: options === null || options === void 0 ? void 0 : options.mintFeeAssets
12728
12799
  }));
12729
12800
  }
12730
- }, _callee4, this);
12801
+ }, _callee6, this);
12731
12802
  }));
12732
- function dryRunPreview(_x2) {
12803
+ function dryRunPreview(_x5) {
12733
12804
  return _dryRunPreview.apply(this, arguments);
12734
12805
  }
12735
12806
  return dryRunPreview;
@@ -12742,22 +12813,22 @@ var GeneralBuilder = /*#__PURE__*/function () {
12742
12813
  }, {
12743
12814
  key: "getXcmFee",
12744
12815
  value: (function () {
12745
- var _getXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(options) {
12816
+ var _getXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(options) {
12746
12817
  var _options$disableFallb;
12747
- var _this$_options2, from, to, address, senderAddress, feeAsset, currency, tx, disableFallback;
12748
- return _regenerator().w(function (_context5) {
12749
- while (1) switch (_context5.p = _context5.n) {
12818
+ var _this$_options3, from, to, address, senderAddress, feeAsset, currency, tx, disableFallback;
12819
+ return _regenerator().w(function (_context7) {
12820
+ while (1) switch (_context7.p = _context7.n) {
12750
12821
  case 0:
12751
- _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;
12822
+ _this$_options3 = this._options, from = _this$_options3.from, to = _this$_options3.to, address = _this$_options3.address, senderAddress = _this$_options3.senderAddress, feeAsset = _this$_options3.feeAsset, currency = _this$_options3.currency;
12752
12823
  assertToIsString(to);
12753
12824
  assertAddressIsString(address);
12754
- _context5.n = 1;
12755
- return this.build();
12825
+ _context7.n = 1;
12826
+ return this.overrideTxAmount();
12756
12827
  case 1:
12757
- tx = _context5.v;
12828
+ tx = _context7.v;
12758
12829
  disableFallback = (_options$disableFallb = options === null || options === void 0 ? void 0 : options.disableFallback) !== null && _options$disableFallb !== void 0 ? _options$disableFallb : false;
12759
- _context5.p = 2;
12760
- _context5.n = 3;
12830
+ _context7.p = 2;
12831
+ _context7.n = 3;
12761
12832
  return getXcmFee({
12762
12833
  api: this.api,
12763
12834
  tx: tx,
@@ -12770,19 +12841,19 @@ var GeneralBuilder = /*#__PURE__*/function () {
12770
12841
  disableFallback: disableFallback
12771
12842
  });
12772
12843
  case 3:
12773
- return _context5.a(2, _context5.v);
12844
+ return _context7.a(2, _context7.v);
12774
12845
  case 4:
12775
- _context5.p = 4;
12776
- _context5.n = 5;
12846
+ _context7.p = 4;
12847
+ _context7.n = 5;
12777
12848
  return this.api.disconnect();
12778
12849
  case 5:
12779
- return _context5.f(4);
12850
+ return _context7.f(4);
12780
12851
  case 6:
12781
- return _context5.a(2);
12852
+ return _context7.a(2);
12782
12853
  }
12783
- }, _callee5, this, [[2,, 4, 6]]);
12854
+ }, _callee7, this, [[2,, 4, 6]]);
12784
12855
  }));
12785
- function getXcmFee$1(_x3) {
12856
+ function getXcmFee$1(_x6) {
12786
12857
  return _getXcmFee2.apply(this, arguments);
12787
12858
  }
12788
12859
  return getXcmFee$1;
@@ -12796,31 +12867,31 @@ var GeneralBuilder = /*#__PURE__*/function () {
12796
12867
  }, {
12797
12868
  key: "getOriginXcmFee",
12798
12869
  value: (function () {
12799
- var _getOriginXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
12870
+ var _getOriginXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
12800
12871
  var _ref,
12801
12872
  disableFallback,
12802
- _this$_options3,
12873
+ _this$_options4,
12803
12874
  from,
12804
12875
  to,
12805
12876
  senderAddress,
12806
12877
  currency,
12807
12878
  feeAsset,
12808
12879
  tx,
12809
- _args6 = arguments;
12810
- return _regenerator().w(function (_context6) {
12811
- while (1) switch (_context6.p = _context6.n) {
12880
+ _args8 = arguments;
12881
+ return _regenerator().w(function (_context8) {
12882
+ while (1) switch (_context8.p = _context8.n) {
12812
12883
  case 0:
12813
- _ref = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {
12884
+ _ref = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {
12814
12885
  disableFallback: false
12815
12886
  }, disableFallback = _ref.disableFallback;
12816
- _this$_options3 = this._options, from = _this$_options3.from, to = _this$_options3.to, senderAddress = _this$_options3.senderAddress, currency = _this$_options3.currency, feeAsset = _this$_options3.feeAsset;
12887
+ _this$_options4 = this._options, from = _this$_options4.from, to = _this$_options4.to, senderAddress = _this$_options4.senderAddress, currency = _this$_options4.currency, feeAsset = _this$_options4.feeAsset;
12817
12888
  assertToIsString(to);
12818
- _context6.n = 1;
12819
- return this.build();
12889
+ _context8.n = 1;
12890
+ return this.overrideTxAmount();
12820
12891
  case 1:
12821
- tx = _context6.v;
12822
- _context6.p = 2;
12823
- _context6.n = 3;
12892
+ tx = _context8.v;
12893
+ _context8.p = 2;
12894
+ _context8.n = 3;
12824
12895
  return getOriginXcmFee({
12825
12896
  api: this.api,
12826
12897
  tx: tx,
@@ -12832,17 +12903,17 @@ var GeneralBuilder = /*#__PURE__*/function () {
12832
12903
  disableFallback: disableFallback
12833
12904
  });
12834
12905
  case 3:
12835
- return _context6.a(2, _context6.v);
12906
+ return _context8.a(2, _context8.v);
12836
12907
  case 4:
12837
- _context6.p = 4;
12838
- _context6.n = 5;
12908
+ _context8.p = 4;
12909
+ _context8.n = 5;
12839
12910
  return this.api.disconnect();
12840
12911
  case 5:
12841
- return _context6.f(4);
12912
+ return _context8.f(4);
12842
12913
  case 6:
12843
- return _context6.a(2);
12914
+ return _context8.a(2);
12844
12915
  }
12845
- }, _callee6, this, [[2,, 4, 6]]);
12916
+ }, _callee8, this, [[2,, 4, 6]]);
12846
12917
  }));
12847
12918
  function getOriginXcmFee$1() {
12848
12919
  return _getOriginXcmFee2.apply(this, arguments);
@@ -12858,20 +12929,20 @@ var GeneralBuilder = /*#__PURE__*/function () {
12858
12929
  }, {
12859
12930
  key: "getXcmFeeEstimate",
12860
12931
  value: (function () {
12861
- var _getXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
12862
- var _this$_options4, from, to, address, senderAddress, currency, tx;
12863
- return _regenerator().w(function (_context7) {
12864
- while (1) switch (_context7.p = _context7.n) {
12932
+ var _getXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
12933
+ var _this$_options5, from, to, address, senderAddress, currency, tx;
12934
+ return _regenerator().w(function (_context9) {
12935
+ while (1) switch (_context9.p = _context9.n) {
12865
12936
  case 0:
12866
- _this$_options4 = this._options, from = _this$_options4.from, to = _this$_options4.to, address = _this$_options4.address, senderAddress = _this$_options4.senderAddress, currency = _this$_options4.currency;
12937
+ _this$_options5 = this._options, from = _this$_options5.from, to = _this$_options5.to, address = _this$_options5.address, senderAddress = _this$_options5.senderAddress, currency = _this$_options5.currency;
12867
12938
  assertToIsString(to);
12868
12939
  assertAddressIsString(address);
12869
- _context7.n = 1;
12870
- return this.build();
12940
+ _context9.n = 1;
12941
+ return this.buildInternal();
12871
12942
  case 1:
12872
- tx = _context7.v;
12873
- _context7.p = 2;
12874
- _context7.n = 3;
12943
+ tx = _context9.v;
12944
+ _context9.p = 2;
12945
+ _context9.n = 3;
12875
12946
  return getXcmFeeEstimate({
12876
12947
  api: this.api,
12877
12948
  tx: tx,
@@ -12882,17 +12953,17 @@ var GeneralBuilder = /*#__PURE__*/function () {
12882
12953
  currency: currency
12883
12954
  });
12884
12955
  case 3:
12885
- return _context7.a(2, _context7.v);
12956
+ return _context9.a(2, _context9.v);
12886
12957
  case 4:
12887
- _context7.p = 4;
12888
- _context7.n = 5;
12958
+ _context9.p = 4;
12959
+ _context9.n = 5;
12889
12960
  return this.api.disconnect();
12890
12961
  case 5:
12891
- return _context7.f(4);
12962
+ return _context9.f(4);
12892
12963
  case 6:
12893
- return _context7.a(2);
12964
+ return _context9.a(2);
12894
12965
  }
12895
- }, _callee7, this, [[2,, 4, 6]]);
12966
+ }, _callee9, this, [[2,, 4, 6]]);
12896
12967
  }));
12897
12968
  function getXcmFeeEstimate$1() {
12898
12969
  return _getXcmFeeEstimate2.apply(this, arguments);
@@ -12908,19 +12979,19 @@ var GeneralBuilder = /*#__PURE__*/function () {
12908
12979
  }, {
12909
12980
  key: "getOriginXcmFeeEstimate",
12910
12981
  value: (function () {
12911
- var _getOriginXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
12912
- var _this$_options5, from, to, senderAddress, currency, tx;
12913
- return _regenerator().w(function (_context8) {
12914
- while (1) switch (_context8.p = _context8.n) {
12982
+ var _getOriginXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
12983
+ var _this$_options6, from, to, senderAddress, currency, tx;
12984
+ return _regenerator().w(function (_context0) {
12985
+ while (1) switch (_context0.p = _context0.n) {
12915
12986
  case 0:
12916
- _this$_options5 = this._options, from = _this$_options5.from, to = _this$_options5.to, senderAddress = _this$_options5.senderAddress, currency = _this$_options5.currency;
12987
+ _this$_options6 = this._options, from = _this$_options6.from, to = _this$_options6.to, senderAddress = _this$_options6.senderAddress, currency = _this$_options6.currency;
12917
12988
  assertToIsString(to);
12918
- _context8.n = 1;
12919
- return this.build();
12989
+ _context0.n = 1;
12990
+ return this.buildInternal();
12920
12991
  case 1:
12921
- tx = _context8.v;
12922
- _context8.p = 2;
12923
- _context8.n = 3;
12992
+ tx = _context0.v;
12993
+ _context0.p = 2;
12994
+ _context0.n = 3;
12924
12995
  return getOriginXcmFeeEstimate({
12925
12996
  api: this.api,
12926
12997
  tx: tx,
@@ -12930,17 +13001,17 @@ var GeneralBuilder = /*#__PURE__*/function () {
12930
13001
  senderAddress: senderAddress
12931
13002
  });
12932
13003
  case 3:
12933
- return _context8.a(2, _context8.v);
13004
+ return _context0.a(2, _context0.v);
12934
13005
  case 4:
12935
- _context8.p = 4;
12936
- _context8.n = 5;
13006
+ _context0.p = 4;
13007
+ _context0.n = 5;
12937
13008
  return this.api.disconnect();
12938
13009
  case 5:
12939
- return _context8.f(4);
13010
+ return _context0.f(4);
12940
13011
  case 6:
12941
- return _context8.a(2);
13012
+ return _context0.a(2);
12942
13013
  }
12943
- }, _callee8, this, [[2,, 4, 6]]);
13014
+ }, _callee0, this, [[2,, 4, 6]]);
12944
13015
  }));
12945
13016
  function getOriginXcmFeeEstimate$1() {
12946
13017
  return _getOriginXcmFeeEstimate2.apply(this, arguments);
@@ -12956,18 +13027,18 @@ var GeneralBuilder = /*#__PURE__*/function () {
12956
13027
  }, {
12957
13028
  key: "getTransferableAmount",
12958
13029
  value: (function () {
12959
- var _getTransferableAmount2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
12960
- var _this$_options6, from, to, senderAddress, currency, feeAsset, tx;
12961
- return _regenerator().w(function (_context9) {
12962
- while (1) switch (_context9.n) {
13030
+ var _getTransferableAmount2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
13031
+ var _this$_options7, from, to, senderAddress, currency, feeAsset, tx;
13032
+ return _regenerator().w(function (_context1) {
13033
+ while (1) switch (_context1.n) {
12963
13034
  case 0:
12964
- _this$_options6 = this._options, from = _this$_options6.from, to = _this$_options6.to, senderAddress = _this$_options6.senderAddress, currency = _this$_options6.currency, feeAsset = _this$_options6.feeAsset;
13035
+ _this$_options7 = this._options, from = _this$_options7.from, to = _this$_options7.to, senderAddress = _this$_options7.senderAddress, currency = _this$_options7.currency, feeAsset = _this$_options7.feeAsset;
12965
13036
  assertToIsString(to);
12966
- _context9.n = 1;
12967
- return this.build();
13037
+ _context1.n = 1;
13038
+ return this.overrideTxAmount();
12968
13039
  case 1:
12969
- tx = _context9.v;
12970
- return _context9.a(2, getTransferableAmount({
13040
+ tx = _context1.v;
13041
+ return _context1.a(2, getTransferableAmount({
12971
13042
  api: this.api,
12972
13043
  tx: tx,
12973
13044
  origin: from,
@@ -12977,7 +13048,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
12977
13048
  currency: currency
12978
13049
  }));
12979
13050
  }
12980
- }, _callee9, this);
13051
+ }, _callee1, this);
12981
13052
  }));
12982
13053
  function getTransferableAmount$1() {
12983
13054
  return _getTransferableAmount2.apply(this, arguments);
@@ -12993,19 +13064,19 @@ var GeneralBuilder = /*#__PURE__*/function () {
12993
13064
  }, {
12994
13065
  key: "getMinTransferableAmount",
12995
13066
  value: (function () {
12996
- var _getMinTransferableAmount2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
12997
- var _this$_options7, from, to, senderAddress, address, currency, feeAsset, tx;
12998
- return _regenerator().w(function (_context0) {
12999
- while (1) switch (_context0.n) {
13067
+ var _getMinTransferableAmount2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
13068
+ var _this$_options8, from, to, senderAddress, address, currency, feeAsset, tx;
13069
+ return _regenerator().w(function (_context10) {
13070
+ while (1) switch (_context10.n) {
13000
13071
  case 0:
13001
- _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;
13072
+ _this$_options8 = this._options, from = _this$_options8.from, to = _this$_options8.to, senderAddress = _this$_options8.senderAddress, address = _this$_options8.address, currency = _this$_options8.currency, feeAsset = _this$_options8.feeAsset;
13002
13073
  assertToIsString(to);
13003
13074
  assertAddressIsString(address);
13004
- _context0.n = 1;
13005
- return this.build();
13075
+ _context10.n = 1;
13076
+ return this.overrideTxAmount();
13006
13077
  case 1:
13007
- tx = _context0.v;
13008
- return _context0.a(2, getMinTransferableAmount({
13078
+ tx = _context10.v;
13079
+ return _context10.a(2, getMinTransferableAmount({
13009
13080
  api: this.api,
13010
13081
  tx: tx,
13011
13082
  origin: from,
@@ -13017,7 +13088,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
13017
13088
  builder: this
13018
13089
  }));
13019
13090
  }
13020
- }, _callee0, this);
13091
+ }, _callee10, this);
13021
13092
  }));
13022
13093
  function getMinTransferableAmount$1() {
13023
13094
  return _getMinTransferableAmount2.apply(this, arguments);
@@ -13033,19 +13104,19 @@ var GeneralBuilder = /*#__PURE__*/function () {
13033
13104
  }, {
13034
13105
  key: "verifyEdOnDestination",
13035
13106
  value: (function () {
13036
- var _verifyEdOnDestination2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
13037
- var _this$_options8, from, to, address, currency, senderAddress, feeAsset, tx;
13038
- return _regenerator().w(function (_context1) {
13039
- while (1) switch (_context1.n) {
13107
+ var _verifyEdOnDestination2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
13108
+ var _this$_options9, from, to, address, currency, senderAddress, feeAsset, tx;
13109
+ return _regenerator().w(function (_context11) {
13110
+ while (1) switch (_context11.n) {
13040
13111
  case 0:
13041
- _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;
13112
+ _this$_options9 = this._options, from = _this$_options9.from, to = _this$_options9.to, address = _this$_options9.address, currency = _this$_options9.currency, senderAddress = _this$_options9.senderAddress, feeAsset = _this$_options9.feeAsset;
13042
13113
  assertToIsString(to);
13043
13114
  assertAddressIsString(address);
13044
- _context1.n = 1;
13045
- return this.build();
13115
+ _context11.n = 1;
13116
+ return this.overrideTxAmount();
13046
13117
  case 1:
13047
- tx = _context1.v;
13048
- return _context1.a(2, verifyEdOnDestination({
13118
+ tx = _context11.v;
13119
+ return _context11.a(2, verifyEdOnDestination({
13049
13120
  api: this.api,
13050
13121
  tx: tx,
13051
13122
  origin: from,
@@ -13056,7 +13127,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
13056
13127
  currency: currency
13057
13128
  }));
13058
13129
  }
13059
- }, _callee1, this);
13130
+ }, _callee11, this);
13060
13131
  }));
13061
13132
  function verifyEdOnDestination$1() {
13062
13133
  return _verifyEdOnDestination2.apply(this, arguments);
@@ -13072,19 +13143,19 @@ var GeneralBuilder = /*#__PURE__*/function () {
13072
13143
  }, {
13073
13144
  key: "getTransferInfo",
13074
13145
  value: (function () {
13075
- var _getTransferInfo2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
13076
- var _this$_options9, from, to, address, currency, ahAddress, senderAddress, feeAsset, tx;
13077
- return _regenerator().w(function (_context10) {
13078
- while (1) switch (_context10.n) {
13146
+ var _getTransferInfo2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
13147
+ var _this$_options0, from, to, address, currency, ahAddress, senderAddress, feeAsset, tx;
13148
+ return _regenerator().w(function (_context12) {
13149
+ while (1) switch (_context12.n) {
13079
13150
  case 0:
13080
- _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;
13151
+ _this$_options0 = this._options, from = _this$_options0.from, to = _this$_options0.to, address = _this$_options0.address, currency = _this$_options0.currency, ahAddress = _this$_options0.ahAddress, senderAddress = _this$_options0.senderAddress, feeAsset = _this$_options0.feeAsset;
13081
13152
  assertToIsString(to);
13082
13153
  assertAddressIsString(address);
13083
- _context10.n = 1;
13084
- return this.build();
13154
+ _context12.n = 1;
13155
+ return this.overrideTxAmount();
13085
13156
  case 1:
13086
- tx = _context10.v;
13087
- return _context10.a(2, getTransferInfo({
13157
+ tx = _context12.v;
13158
+ return _context12.a(2, getTransferInfo({
13088
13159
  api: this.api,
13089
13160
  tx: tx,
13090
13161
  origin: from,
@@ -13096,7 +13167,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
13096
13167
  feeAsset: feeAsset
13097
13168
  }));
13098
13169
  }
13099
- }, _callee10, this);
13170
+ }, _callee12, this);
13100
13171
  }));
13101
13172
  function getTransferInfo$1() {
13102
13173
  return _getTransferInfo2.apply(this, arguments);
@@ -13136,4 +13207,4 @@ var Builder = function Builder(api) {
13136
13207
  return new GeneralBuilder(api, new BatchTransactionManager());
13137
13208
  };
13138
13209
 
13139
- 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, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTypeAndThenCall, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, padFee, padFeeBy, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };
13210
+ 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, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTypeAndThenCall, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, padFee, padFeeBy, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };