@moonbeam-network/xcm-builder 4.4.2 → 4.4.3

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.d.ts CHANGED
@@ -608,6 +608,7 @@ interface SnowbridgeFunctionArgs {
608
608
  amount: bigint;
609
609
  bridgeFeeAmount: bigint;
610
610
  requiresApproval: boolean;
611
+ value: bigint;
611
612
  }
612
613
  interface SnowbridgeConfigConstructorParams {
613
614
  args: SnowbridgeFunctionArgs;
package/build/index.mjs CHANGED
@@ -4741,6 +4741,8 @@ function callSendToken(asset, protocolFee, destination, destinationAddress, requ
4741
4741
  "Destination must be a Parachain or EvmParachain for sending token with Gateway module"
4742
4742
  );
4743
4743
  }
4744
+ const isDifferentAsset = !asset.isSame(protocolFee);
4745
+ const value = requiresApproval || isDifferentAsset ? protocolFee.amount : asset.amount + protocolFee.amount;
4744
4746
  return new SnowbridgeConfig({
4745
4747
  args: {
4746
4748
  tokenAddress: asset.address,
@@ -4748,7 +4750,8 @@ function callSendToken(asset, protocolFee, destination, destinationAddress, requ
4748
4750
  destinationParaId: destination.parachainId,
4749
4751
  amount: asset.amount,
4750
4752
  bridgeFeeAmount: protocolFee.amount,
4751
- requiresApproval
4753
+ requiresApproval,
4754
+ value
4752
4755
  },
4753
4756
  func: "sendToken"
4754
4757
  });