@moonbeam-network/mrl 1.0.0-dev.162 → 1.0.0-dev.163

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
@@ -10996,6 +10996,10 @@ var WormholeService = class _WormholeService {
10996
10996
  this.#wh = wormholeFactory(chain);
10997
10997
  }
10998
10998
  async getFee(transfer) {
10999
+ const amount = transfer.args[1];
11000
+ if (amount === 0n) {
11001
+ return void 0;
11002
+ }
10999
11003
  const xfer = await this.#wh[transfer.func](...transfer.args);
11000
11004
  return TokenTransfer.quoteTransfer(
11001
11005
  this.#wh,
@@ -11498,6 +11502,7 @@ async function getFee({
11498
11502
  if (ContractConfig.is(transfer)) {
11499
11503
  return getContractFee({
11500
11504
  address: sourceAddress,
11505
+ balance,
11501
11506
  chain,
11502
11507
  contract: transfer,
11503
11508
  destinationFee,
@@ -11548,7 +11553,7 @@ async function getWormholeFee({
11548
11553
  const wh = WormholeService.create(chain);
11549
11554
  const fee = await wh.getFee(config);
11550
11555
  return AssetAmount2.fromChainAsset(chain.getChainAsset(asset), {
11551
- amount: fee.relayFee ? fee.relayFee.amount + safetyAmount : 0n
11556
+ amount: fee?.relayFee ? fee.relayFee.amount + safetyAmount : 0n
11552
11557
  });
11553
11558
  }
11554
11559
  return;