@moonbeam-network/xcm-builder 1.0.0-dev.289 → 1.0.0-dev.290

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
@@ -1800,7 +1800,7 @@ declare function Batch(): {
1800
1800
  * Transfers assets and XCM message using XTokens contract for multi-currency transfer.
1801
1801
  * Uses parents: 1 for multilocation derivation.
1802
1802
  */
1803
- transferAssetsAndMessageViaXTokens: () => MrlConfigBuilder;
1803
+ transferAssetsAndMessageViaXtokens: () => MrlConfigBuilder;
1804
1804
  transferAssetsAndMessageViaXcmPrecompile: () => MrlConfigBuilder;
1805
1805
  };
1806
1806
 
package/build/index.mjs CHANGED
@@ -5162,7 +5162,6 @@ function snowbridge() {
5162
5162
 
5163
5163
  // src/mrl/providers/wormhole/contract/Batch/Batch.ts
5164
5164
  import {
5165
- AssetAmount as AssetAmount2,
5166
5165
  EvmParachain as EvmParachain5
5167
5166
  } from "@moonbeam-network/xcm-types";
5168
5167
  import { getMultilocationDerivedAddresses as getMultilocationDerivedAddresses2 } from "@moonbeam-network/xcm-utils";
@@ -6021,7 +6020,7 @@ function Batch() {
6021
6020
  * Transfers assets and XCM message using XTokens contract for multi-currency transfer.
6022
6021
  * Uses parents: 1 for multilocation derivation.
6023
6022
  */
6024
- transferAssetsAndMessageViaXTokens: () => ({
6023
+ transferAssetsAndMessageViaXtokens: () => ({
6025
6024
  provider,
6026
6025
  build: (params) => {
6027
6026
  const { source, sourceAddress, sourceApi } = params;
@@ -6109,9 +6108,12 @@ function Batch() {
6109
6108
  if (!sourceApi) {
6110
6109
  throw new Error("Source API needs to be defined");
6111
6110
  }
6111
+ if (!params.bridgeChainFee) {
6112
+ throw new Error("Bridge chain fee is required");
6113
+ }
6112
6114
  if (!source.contracts?.XcmUtils || !source.contracts?.Batch || !source.contracts?.XcmPrecompile) {
6113
6115
  throw new Error(
6114
- "Source chain needs to have the XcmUtils and Batch contract addresses configured"
6116
+ "Source chain needs to have the XcmUtils, Batch and XcmPrecompile contract addresses configured"
6115
6117
  );
6116
6118
  }
6117
6119
  const { address20: computedOriginAccount } = getMultilocationDerivedAddresses2({
@@ -6137,17 +6139,10 @@ function Batch() {
6137
6139
  transact: params.transact
6138
6140
  });
6139
6141
  const { BatchAbi, XcmUtilsAbi } = getAbisForChain(source);
6140
- const bridgeChainFee = AssetAmount2.fromChainAsset(
6141
- params.bridgeChain.getChainAsset(params.moonAsset),
6142
- {
6143
- // TODO mjm get from the config, after merging the changes from Tanssi Demo, which brings bridgeChainFee to the params of this function
6144
- amount: 0.03
6145
- }
6146
- );
6147
6142
  const transferAssetsCall = ContractBuilder().XcmPrecompile().transferAssetsLocation().foreignErc20().build({
6148
6143
  sourceApi,
6149
6144
  asset: params.asset,
6150
- fee: bridgeChainFee,
6145
+ fee: params.bridgeChainFee,
6151
6146
  destination: params.bridgeChain,
6152
6147
  destinationAddress: computedOriginAccount,
6153
6148
  source,