@moonbeam-network/mrl 4.1.2 → 4.1.4

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/build/index.mjs CHANGED
@@ -16869,10 +16869,8 @@ var SnowbridgeService = class _SnowbridgeService {
16869
16869
  destinationAddress,
16870
16870
  destinationParaId,
16871
16871
  amount,
16872
- bridgeFeeAmount,
16873
- requiresApproval
16872
+ value
16874
16873
  } = args;
16875
- const value = requiresApproval ? bridgeFeeAmount : amount + bridgeFeeAmount;
16876
16874
  const contractArgs = [
16877
16875
  tokenAddress,
16878
16876
  destinationParaId,
@@ -17267,6 +17265,9 @@ async function getBridgeChainGasLimit(params) {
17267
17265
  return gasEstimation * 110n / 100n;
17268
17266
  }
17269
17267
  function getAmountForTransferSimulation(balance, protocolFee) {
17268
+ if (!balance.isSame(protocolFee)) {
17269
+ return balance;
17270
+ }
17270
17271
  return balance.copyWith({
17271
17272
  amount: balance.amount - protocolFee.amount > 0 ? balance.amount - protocolFee.amount : 0n
17272
17273
  });
@@ -17512,7 +17513,7 @@ async function getProtocolFee({
17512
17513
  source
17513
17514
  }) {
17514
17515
  if (typeof protocolFee === "number") {
17515
- return AssetAmount2.fromChainAsset(asset, {
17516
+ return AssetAmount2.fromChainAsset(feeAsset, {
17516
17517
  amount: protocolFee
17517
17518
  });
17518
17519
  }