@moonbeam-network/xcm-builder 1.0.0-dev.266 → 1.0.0-dev.267

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
@@ -620,10 +620,6 @@ declare class SnowbridgeConfig {
620
620
  constructor({ args, func }: SnowbridgeConfigConstructorParams);
621
621
  }
622
622
 
623
- /**
624
- * TODO mjm this can be configured for each chain.
625
- */
626
- declare const GATEWAY_CONTRACT_ADDRESS = "0x503B4D684074888EB7fe82D4c5AB25E57de0e85c";
627
623
  declare const GATEWAY_ABI: readonly [{
628
624
  readonly inputs: readonly [{
629
625
  readonly internalType: "address";
@@ -1923,4 +1919,4 @@ declare function MrlBuilder(): {
1923
1919
 
1924
1920
  declare const BATCH_CONTRACT_ADDRESS = "0x0000000000000000000000000000000000000808";
1925
1921
 
1926
- export { type AssetAddressFormat, AssetMinBuilder, type AssetMinConfigBuilder, type AssetMinConfigBuilderParams, type AssetMultilocation, BATCH_CONTRACT_ABI, BATCH_CONTRACT_ADDRESS, BalanceBuilder, type BalanceBuilderParams, type BalanceConfigBuilder, type BridgeFeeConfigBuilder, type BridgeFeeConfigBuilderParams, type BuilderParams, type ConfigBuilder, ContractBuilder, ContractConfig, type ContractConfigBuilder, type ContractConfigConstructorParams, type DestinationMultilocation, ERC20_ABI, type EquilibriumSystemBalanceData, type EventMonitoringConfig, type EvmFunctionArgs, EvmQueryConfig, type EvmQueryConfigParams, type EvmQueryFunctions, ExtrinsicBuilder, ExtrinsicConfig, type ExtrinsicConfigBuilder, type ExtrinsicConfigConstructorParams, FeeBuilder, type FeeConfigBuilder, type FeeConfigBuilderParams, GATEWAY_ABI, GATEWAY_CONTRACT_ADDRESS, type GetVersionedAssetId, MonitoringBuilder, type MonitoringBuilderConfig, type MoonbeamRuntimeXcmConfigAssetType, MrlBuilder, type MrlBuilderParams, type MrlConfigBuilder, type MrlExecuteBuilderParams, type MrlExecuteConfigBuilder, type PalletBalancesAccountDataOld, type Parents, Protocols, type Provider, type QueryConfigConstructorParams, SnowbridgeConfig, type SnowbridgeConfigConstructorParams, type SnowbridgeFunctionArgs, type SnowbridgeFunctions, SubstrateCallConfig, type SubstrateCallConfigConstructorParams, SubstrateQueryConfig, type TokensPalletAccountData, type Transact, TransferType, WormholeConfig, type WormholeConfigConstructorParams, type WormholeFunctionArgs, type WormholeTransferFunctions, type XcmPaymentFeeProps, XcmVersion, calculateSystemAccountBalance, evm, snowbridge, substrate, wormhole, wormholeFactory };
1922
+ export { type AssetAddressFormat, AssetMinBuilder, type AssetMinConfigBuilder, type AssetMinConfigBuilderParams, type AssetMultilocation, BATCH_CONTRACT_ABI, BATCH_CONTRACT_ADDRESS, BalanceBuilder, type BalanceBuilderParams, type BalanceConfigBuilder, type BridgeFeeConfigBuilder, type BridgeFeeConfigBuilderParams, type BuilderParams, type ConfigBuilder, ContractBuilder, ContractConfig, type ContractConfigBuilder, type ContractConfigConstructorParams, type DestinationMultilocation, ERC20_ABI, type EquilibriumSystemBalanceData, type EventMonitoringConfig, type EvmFunctionArgs, EvmQueryConfig, type EvmQueryConfigParams, type EvmQueryFunctions, ExtrinsicBuilder, ExtrinsicConfig, type ExtrinsicConfigBuilder, type ExtrinsicConfigConstructorParams, FeeBuilder, type FeeConfigBuilder, type FeeConfigBuilderParams, GATEWAY_ABI, type GetVersionedAssetId, MonitoringBuilder, type MonitoringBuilderConfig, type MoonbeamRuntimeXcmConfigAssetType, MrlBuilder, type MrlBuilderParams, type MrlConfigBuilder, type MrlExecuteBuilderParams, type MrlExecuteConfigBuilder, type PalletBalancesAccountDataOld, type Parents, Protocols, type Provider, type QueryConfigConstructorParams, SnowbridgeConfig, type SnowbridgeConfigConstructorParams, type SnowbridgeFunctionArgs, type SnowbridgeFunctions, SubstrateCallConfig, type SubstrateCallConfigConstructorParams, SubstrateQueryConfig, type TokensPalletAccountData, type Transact, TransferType, WormholeConfig, type WormholeConfigConstructorParams, type WormholeFunctionArgs, type WormholeTransferFunctions, type XcmPaymentFeeProps, XcmVersion, calculateSystemAccountBalance, evm, snowbridge, substrate, wormhole, wormholeFactory };
package/build/index.mjs CHANGED
@@ -3122,7 +3122,7 @@ function ExtrinsicBuilder() {
3122
3122
  }
3123
3123
 
3124
3124
  // src/fee/gateway/gateway.ts
3125
- import { EvmParachain as EvmParachain2 } from "@moonbeam-network/xcm-types";
3125
+ import { EvmChain, EvmParachain as EvmParachain2 } from "@moonbeam-network/xcm-types";
3126
3126
 
3127
3127
  // src/mrl/providers/snowbridge/contract/Gateway/GatewayAbi.ts
3128
3128
  var GATEWAY_ABI = [
@@ -3908,7 +3908,6 @@ var GATEWAY_ABI = [
3908
3908
  ];
3909
3909
 
3910
3910
  // src/mrl/providers/snowbridge/snowbridge/SnowbridgeConstants.ts
3911
- var GATEWAY_CONTRACT_ADDRESS = "0x503B4D684074888EB7fe82D4c5AB25E57de0e85c";
3912
3911
  var GATEWAY_ABI2 = GATEWAY_ABI;
3913
3912
 
3914
3913
  // src/fee/gateway/gateway.ts
@@ -3916,17 +3915,22 @@ function gateway() {
3916
3915
  return {
3917
3916
  quoteSendTokenFee() {
3918
3917
  return {
3919
- build: ({ asset, destination }) => {
3918
+ build: ({ asset, destination, source }) => {
3920
3919
  if (!asset.address) {
3921
3920
  throw new Error(`Asset ${asset.key} has no address`);
3922
3921
  }
3922
+ if (!EvmChain.is(source) || !source.contracts?.Gateway) {
3923
+ throw new Error(
3924
+ "Source must be an EVMChain with the Gateway contract address configured for getting the quote send token fee for Gateway module"
3925
+ );
3926
+ }
3923
3927
  if (!EvmParachain2.isAnyParachain(destination)) {
3924
3928
  throw new Error(
3925
3929
  "Destination must be a Parachain or EvmParachain for getting the quote send token fee for Gateway module"
3926
3930
  );
3927
3931
  }
3928
3932
  return new ContractConfig({
3929
- address: GATEWAY_CONTRACT_ADDRESS,
3933
+ address: source.contracts.Gateway,
3930
3934
  abi: GATEWAY_ABI2,
3931
3935
  args: [asset.address, destination.parachainId, 0n],
3932
3936
  func: "quoteSendTokenFee",
@@ -4773,7 +4777,7 @@ function ethereumTokenTransfers() {
4773
4777
  }
4774
4778
 
4775
4779
  // src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.ts
4776
- import { EvmChain } from "@moonbeam-network/xcm-types";
4780
+ import { EvmChain as EvmChain2 } from "@moonbeam-network/xcm-types";
4777
4781
 
4778
4782
  // src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.utils.ts
4779
4783
  function getGlobalConsensusArgs({
@@ -4836,7 +4840,7 @@ function xcmPallet2() {
4836
4840
  globalConsensus: () => ({
4837
4841
  provider,
4838
4842
  build: ({ asset, destination, destinationAddress }) => {
4839
- if (!EvmChain.is(destination)) {
4843
+ if (!EvmChain2.is(destination)) {
4840
4844
  throw new Error(
4841
4845
  "Destination must be an EVM chain for globalConsensus function"
4842
4846
  );
@@ -4875,7 +4879,7 @@ function xcmPallet2() {
4875
4879
  globalConsensusErc20: () => ({
4876
4880
  provider,
4877
4881
  build: ({ asset, destination, destinationAddress }) => {
4878
- if (!EvmChain.is(destination)) {
4882
+ if (!EvmChain2.is(destination)) {
4879
4883
  throw new Error(
4880
4884
  "Destination must be an EVM chain for globalConsensusErc20 function"
4881
4885
  );
@@ -5907,7 +5911,7 @@ var WormholeConfig = class _WormholeConfig {
5907
5911
  };
5908
5912
 
5909
5913
  // src/mrl/providers/wormhole/wormhole/wormhole.ts
5910
- import { EvmChain as EvmChain2, EvmParachain as EvmParachain7, Parachain as Parachain3 } from "@moonbeam-network/xcm-types";
5914
+ import { EvmChain as EvmChain3, EvmParachain as EvmParachain7, Parachain as Parachain3 } from "@moonbeam-network/xcm-types";
5911
5915
  import { getMultilocationDerivedAddresses as getMultilocationDerivedAddresses3 } from "@moonbeam-network/xcm-utils";
5912
5916
  import { evmToAddress as evmToAddress4 } from "@polkadot/util-crypto/address";
5913
5917
  import { Wormhole as Wormhole2 } from "@wormhole-foundation/sdk-connect";
@@ -5948,7 +5952,7 @@ function wormhole() {
5948
5952
  }) => {
5949
5953
  const isSourceParachain = Parachain3.is(source);
5950
5954
  const isDestinationMoonChain = destination.isEqual(moonChain);
5951
- const isDestinationEvmChain = EvmChain2.is(destination);
5955
+ const isDestinationEvmChain = EvmChain3.is(destination);
5952
5956
  const isNativeAsset = asset.isSame(
5953
5957
  isDestinationEvmChain ? moonChain.nativeAsset : source.nativeAsset
5954
5958
  );
@@ -7634,7 +7638,6 @@ export {
7634
7638
  ExtrinsicConfig,
7635
7639
  FeeBuilder,
7636
7640
  GATEWAY_ABI2 as GATEWAY_ABI,
7637
- GATEWAY_CONTRACT_ADDRESS,
7638
7641
  MonitoringBuilder,
7639
7642
  MrlBuilder,
7640
7643
  Protocols,