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

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 = [
@@ -3907,27 +3907,28 @@ var GATEWAY_ABI = [
3907
3907
  }
3908
3908
  ];
3909
3909
 
3910
- // src/mrl/providers/snowbridge/snowbridge/SnowbridgeConstants.ts
3911
- var GATEWAY_CONTRACT_ADDRESS = "0x503B4D684074888EB7fe82D4c5AB25E57de0e85c";
3912
- var GATEWAY_ABI2 = GATEWAY_ABI;
3913
-
3914
3910
  // src/fee/gateway/gateway.ts
3915
3911
  function gateway() {
3916
3912
  return {
3917
3913
  quoteSendTokenFee() {
3918
3914
  return {
3919
- build: ({ asset, destination }) => {
3915
+ build: ({ asset, destination, source }) => {
3920
3916
  if (!asset.address) {
3921
3917
  throw new Error(`Asset ${asset.key} has no address`);
3922
3918
  }
3919
+ if (!EvmChain.is(source) || !source.contracts?.Gateway) {
3920
+ throw new Error(
3921
+ "Source must be an EVMChain with the Gateway contract address configured for getting the quote send token fee for Gateway module"
3922
+ );
3923
+ }
3923
3924
  if (!EvmParachain2.isAnyParachain(destination)) {
3924
3925
  throw new Error(
3925
3926
  "Destination must be a Parachain or EvmParachain for getting the quote send token fee for Gateway module"
3926
3927
  );
3927
3928
  }
3928
3929
  return new ContractConfig({
3929
- address: GATEWAY_CONTRACT_ADDRESS,
3930
- abi: GATEWAY_ABI2,
3930
+ address: source.contracts.Gateway,
3931
+ abi: GATEWAY_ABI,
3931
3932
  args: [asset.address, destination.parachainId, 0n],
3932
3933
  func: "quoteSendTokenFee",
3933
3934
  module: "Gateway"
@@ -4773,7 +4774,7 @@ function ethereumTokenTransfers() {
4773
4774
  }
4774
4775
 
4775
4776
  // src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.ts
4776
- import { EvmChain } from "@moonbeam-network/xcm-types";
4777
+ import { EvmChain as EvmChain2 } from "@moonbeam-network/xcm-types";
4777
4778
 
4778
4779
  // src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.utils.ts
4779
4780
  function getGlobalConsensusArgs({
@@ -4836,7 +4837,7 @@ function xcmPallet2() {
4836
4837
  globalConsensus: () => ({
4837
4838
  provider,
4838
4839
  build: ({ asset, destination, destinationAddress }) => {
4839
- if (!EvmChain.is(destination)) {
4840
+ if (!EvmChain2.is(destination)) {
4840
4841
  throw new Error(
4841
4842
  "Destination must be an EVM chain for globalConsensus function"
4842
4843
  );
@@ -4875,7 +4876,7 @@ function xcmPallet2() {
4875
4876
  globalConsensusErc20: () => ({
4876
4877
  provider,
4877
4878
  build: ({ asset, destination, destinationAddress }) => {
4878
- if (!EvmChain.is(destination)) {
4879
+ if (!EvmChain2.is(destination)) {
4879
4880
  throw new Error(
4880
4881
  "Destination must be an EVM chain for globalConsensusErc20 function"
4881
4882
  );
@@ -5907,7 +5908,7 @@ var WormholeConfig = class _WormholeConfig {
5907
5908
  };
5908
5909
 
5909
5910
  // src/mrl/providers/wormhole/wormhole/wormhole.ts
5910
- import { EvmChain as EvmChain2, EvmParachain as EvmParachain7, Parachain as Parachain3 } from "@moonbeam-network/xcm-types";
5911
+ import { EvmChain as EvmChain3, EvmParachain as EvmParachain7, Parachain as Parachain3 } from "@moonbeam-network/xcm-types";
5911
5912
  import { getMultilocationDerivedAddresses as getMultilocationDerivedAddresses3 } from "@moonbeam-network/xcm-utils";
5912
5913
  import { evmToAddress as evmToAddress4 } from "@polkadot/util-crypto/address";
5913
5914
  import { Wormhole as Wormhole2 } from "@wormhole-foundation/sdk-connect";
@@ -5948,7 +5949,7 @@ function wormhole() {
5948
5949
  }) => {
5949
5950
  const isSourceParachain = Parachain3.is(source);
5950
5951
  const isDestinationMoonChain = destination.isEqual(moonChain);
5951
- const isDestinationEvmChain = EvmChain2.is(destination);
5952
+ const isDestinationEvmChain = EvmChain3.is(destination);
5952
5953
  const isNativeAsset = asset.isSame(
5953
5954
  isDestinationEvmChain ? moonChain.nativeAsset : source.nativeAsset
5954
5955
  );
@@ -7633,8 +7634,7 @@ export {
7633
7634
  ExtrinsicBuilder,
7634
7635
  ExtrinsicConfig,
7635
7636
  FeeBuilder,
7636
- GATEWAY_ABI2 as GATEWAY_ABI,
7637
- GATEWAY_CONTRACT_ADDRESS,
7637
+ GATEWAY_ABI,
7638
7638
  MonitoringBuilder,
7639
7639
  MrlBuilder,
7640
7640
  Protocols,