@moonbeam-network/xcm-builder 1.0.0-dev.279 → 1.0.0-dev.280

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
@@ -417,7 +417,7 @@ declare function eqBalances(): {
417
417
  transferXcm: () => ExtrinsicConfigBuilder;
418
418
  };
419
419
 
420
- declare function polkadotXcm$2(): {
420
+ declare function polkadotXcm$1(): {
421
421
  limitedReserveTransferAssets: () => {
422
422
  here: () => ExtrinsicConfigBuilder;
423
423
  X1: () => ExtrinsicConfigBuilder;
@@ -478,7 +478,7 @@ declare function ExtrinsicBuilder(): {
478
478
  eqBalances: typeof eqBalances;
479
479
  xTokens: typeof xTokens;
480
480
  xTransfer: typeof xTransfer;
481
- polkadotXcm: typeof polkadotXcm$2;
481
+ polkadotXcm: typeof polkadotXcm$1;
482
482
  xcmPallet: typeof xcmPallet$1;
483
483
  };
484
484
 
@@ -1770,12 +1770,6 @@ declare function ethereumTokenTransfers(): {
1770
1770
  transferNativeToken: () => MrlConfigBuilder;
1771
1771
  };
1772
1772
 
1773
- declare function polkadotXcm$1(): {
1774
- transferAssetsUsingTypeAndThen: () => {
1775
- canonicalEth: () => MrlConfigBuilder;
1776
- };
1777
- };
1778
-
1779
1773
  declare function xcmPallet(): {
1780
1774
  transferAssets: () => {
1781
1775
  globalConsensus: () => MrlConfigBuilder;
@@ -1786,7 +1780,6 @@ declare function xcmPallet(): {
1786
1780
  declare function extrinsic$1(): {
1787
1781
  ethereumTokenTransfers: typeof ethereumTokenTransfers;
1788
1782
  xcmPallet: typeof xcmPallet;
1789
- polkadotXcm: typeof polkadotXcm$1;
1790
1783
  };
1791
1784
 
1792
1785
  declare function snowbridge(): {
package/build/index.mjs CHANGED
@@ -119,11 +119,11 @@ function AssetMinBuilder() {
119
119
  };
120
120
  }
121
121
  function assetRegistry() {
122
- const pallet9 = "assetRegistry";
122
+ const pallet8 = "assetRegistry";
123
123
  return {
124
124
  assetMetadatas: () => ({
125
125
  build: ({ asset }) => new SubstrateQueryConfig({
126
- module: pallet9,
126
+ module: pallet8,
127
127
  func: "assetMetadatas",
128
128
  args: [asset],
129
129
  // biome-ignore lint/suspicious/noExplicitAny: not sure how to fix this
@@ -132,7 +132,7 @@ function assetRegistry() {
132
132
  }),
133
133
  currencyMetadatas: () => ({
134
134
  build: ({ asset }) => new SubstrateQueryConfig({
135
- module: pallet9,
135
+ module: pallet8,
136
136
  func: "currencyMetadatas",
137
137
  args: [asset],
138
138
  // biome-ignore lint/suspicious/noExplicitAny: not sure how to fix this
@@ -141,7 +141,7 @@ function assetRegistry() {
141
141
  }),
142
142
  metadata: () => ({
143
143
  build: ({ asset }) => new SubstrateQueryConfig({
144
- module: pallet9,
144
+ module: pallet8,
145
145
  func: "metadata",
146
146
  args: [asset],
147
147
  // biome-ignore lint/suspicious/noExplicitAny: not sure how to fix this
@@ -3929,7 +3929,7 @@ function gateway() {
3929
3929
  return new ContractConfig({
3930
3930
  address: source.contracts.Gateway,
3931
3931
  abi: GATEWAY_ABI,
3932
- args: [asset.address, destination.parachainId, 10000000000000n],
3932
+ args: [asset.address, destination.parachainId, 0n],
3933
3933
  func: "quoteSendTokenFee",
3934
3934
  module: "Gateway"
3935
3935
  });
@@ -4780,158 +4780,8 @@ function ethereumTokenTransfers() {
4780
4780
  };
4781
4781
  }
4782
4782
 
4783
- // src/mrl/providers/snowbridge/extrinsic/polkadotXcm/polkadotXcm.ts
4784
- import { EvmChain as EvmChain2 } from "@moonbeam-network/xcm-types";
4785
- var pallet7 = "polkadotXcm";
4786
- function polkadotXcm2() {
4787
- return {
4788
- transferAssetsUsingTypeAndThen: () => {
4789
- const func = "transferAssetsUsingTypeAndThen";
4790
- const provider = "snowbridge" /* Snowbridge */;
4791
- return {
4792
- // TODO mjm rename
4793
- canonicalEth: () => ({
4794
- provider,
4795
- build: ({ asset, fee, destination, destinationAddress }) => {
4796
- if (!EvmChain2.is(destination)) {
4797
- throw new Error(
4798
- "Destination must be an EVM chain for globalConsensus function"
4799
- );
4800
- }
4801
- return new ExtrinsicConfig({
4802
- module: pallet7,
4803
- func,
4804
- getArgs: (extrinsicFunction) => {
4805
- const version = getExtrinsicArgumentVersion(extrinsicFunction);
4806
- const dest = {
4807
- [version]: {
4808
- parents: 1,
4809
- interior: "Here"
4810
- }
4811
- };
4812
- const assets3 = {
4813
- [version]: [
4814
- {
4815
- id: {
4816
- parents: 1,
4817
- interior: "Here"
4818
- },
4819
- fun: { Fungible: fee.amount }
4820
- },
4821
- {
4822
- id: {
4823
- parents: 2,
4824
- interior: {
4825
- X1: [
4826
- {
4827
- GlobalConsensus: {
4828
- Ethereum: { chainId: destination.id }
4829
- }
4830
- }
4831
- ]
4832
- }
4833
- },
4834
- fun: { Fungible: asset.amount }
4835
- }
4836
- ]
4837
- };
4838
- const assetsTransferType = 2 /* DestinationReserve */;
4839
- const remoteFeesId = {
4840
- [version]: {
4841
- parents: 1,
4842
- interior: "Here"
4843
- }
4844
- };
4845
- const feesTransferType = 2 /* DestinationReserve */;
4846
- const customXcmOnDest = {
4847
- [version]: [
4848
- {
4849
- InitiateReserveWithdraw: {
4850
- assets: {
4851
- Definite: [
4852
- {
4853
- id: {
4854
- parents: 1,
4855
- interior: {
4856
- X1: [
4857
- {
4858
- GlobalConsensus: {
4859
- Ethereum: { chainId: destination.id }
4860
- }
4861
- }
4862
- ]
4863
- }
4864
- },
4865
- fun: { Fungible: asset.amount }
4866
- }
4867
- ]
4868
- },
4869
- reserve: {
4870
- parents: 1,
4871
- interior: {
4872
- X1: [
4873
- {
4874
- GlobalConsensus: {
4875
- Ethereum: { chainId: destination.id }
4876
- }
4877
- }
4878
- ]
4879
- }
4880
- },
4881
- xcm: [
4882
- {
4883
- DepositAsset: {
4884
- Definite: [
4885
- {
4886
- id: {
4887
- parents: 0,
4888
- interior: "Here"
4889
- },
4890
- fun: { Fungible: asset.amount }
4891
- }
4892
- ]
4893
- }
4894
- }
4895
- ],
4896
- beneficiary: {
4897
- parents: 0,
4898
- interior: {
4899
- X1: [
4900
- {
4901
- AccountKey20: {
4902
- network: {
4903
- Ethereum: { chainId: destination.id }
4904
- },
4905
- key: destinationAddress
4906
- }
4907
- }
4908
- ]
4909
- }
4910
- }
4911
- }
4912
- }
4913
- ]
4914
- };
4915
- return [
4916
- dest,
4917
- assets3,
4918
- assetsTransferType,
4919
- remoteFeesId,
4920
- feesTransferType,
4921
- customXcmOnDest,
4922
- "Unlimited"
4923
- ];
4924
- }
4925
- });
4926
- }
4927
- })
4928
- };
4929
- }
4930
- };
4931
- }
4932
-
4933
4783
  // src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.ts
4934
- import { EvmChain as EvmChain3 } from "@moonbeam-network/xcm-types";
4784
+ import { EvmChain as EvmChain2 } from "@moonbeam-network/xcm-types";
4935
4785
 
4936
4786
  // src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.utils.ts
4937
4787
  function getGlobalConsensusArgs({
@@ -4984,7 +4834,7 @@ function getGlobalConsensusArgs({
4984
4834
  }
4985
4835
 
4986
4836
  // src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.ts
4987
- var pallet8 = "xcmPallet";
4837
+ var pallet7 = "xcmPallet";
4988
4838
  function xcmPallet2() {
4989
4839
  return {
4990
4840
  transferAssets: () => {
@@ -4994,13 +4844,13 @@ function xcmPallet2() {
4994
4844
  globalConsensus: () => ({
4995
4845
  provider,
4996
4846
  build: ({ asset, destination, destinationAddress }) => {
4997
- if (!EvmChain3.is(destination)) {
4847
+ if (!EvmChain2.is(destination)) {
4998
4848
  throw new Error(
4999
4849
  "Destination must be an EVM chain for globalConsensus function"
5000
4850
  );
5001
4851
  }
5002
4852
  return new ExtrinsicConfig({
5003
- module: pallet8,
4853
+ module: pallet7,
5004
4854
  func,
5005
4855
  getArgs: (extrinsicFunction) => {
5006
4856
  const assets3 = [
@@ -5033,14 +4883,14 @@ function xcmPallet2() {
5033
4883
  globalConsensusErc20: () => ({
5034
4884
  provider,
5035
4885
  build: ({ asset, destination, destinationAddress }) => {
5036
- if (!EvmChain3.is(destination)) {
4886
+ if (!EvmChain2.is(destination)) {
5037
4887
  throw new Error(
5038
4888
  "Destination must be an EVM chain for globalConsensusErc20 function"
5039
4889
  );
5040
4890
  }
5041
4891
  const assetInDestination = destination.getChainAsset(asset);
5042
4892
  return new ExtrinsicConfig({
5043
- module: pallet8,
4893
+ module: pallet7,
5044
4894
  func,
5045
4895
  getArgs: (extrinsicFunction) => {
5046
4896
  const assets3 = [
@@ -5085,7 +4935,7 @@ function xcmPallet2() {
5085
4935
 
5086
4936
  // src/mrl/providers/snowbridge/extrinsic/index.ts
5087
4937
  function extrinsic() {
5088
- return { ethereumTokenTransfers, xcmPallet: xcmPallet2, polkadotXcm: polkadotXcm2 };
4938
+ return { ethereumTokenTransfers, xcmPallet: xcmPallet2 };
5089
4939
  }
5090
4940
 
5091
4941
  // src/mrl/providers/snowbridge/index.ts
@@ -5112,7 +4962,7 @@ import {
5112
4962
  import { getMultilocationDerivedAddresses } from "@moonbeam-network/xcm-utils";
5113
4963
  var BUY_EXECUTION_FEE = 100000000000000000n;
5114
4964
  var CROSS_CHAIN_FEE = 100000000000000000n;
5115
- function polkadotXcm3() {
4965
+ function polkadotXcm2() {
5116
4966
  const provider = "wormhole" /* Wormhole */;
5117
4967
  return {
5118
4968
  send: () => ({
@@ -6065,7 +5915,7 @@ var WormholeConfig = class _WormholeConfig {
6065
5915
  };
6066
5916
 
6067
5917
  // src/mrl/providers/wormhole/wormhole/wormhole.ts
6068
- import { EvmChain as EvmChain4, EvmParachain as EvmParachain7, Parachain as Parachain3 } from "@moonbeam-network/xcm-types";
5918
+ import { EvmChain as EvmChain3, EvmParachain as EvmParachain7, Parachain as Parachain3 } from "@moonbeam-network/xcm-types";
6069
5919
  import { getMultilocationDerivedAddresses as getMultilocationDerivedAddresses3 } from "@moonbeam-network/xcm-utils";
6070
5920
  import { evmToAddress as evmToAddress4 } from "@polkadot/util-crypto/address";
6071
5921
  import { Wormhole as Wormhole2 } from "@wormhole-foundation/sdk-connect";
@@ -6106,7 +5956,7 @@ function wormhole() {
6106
5956
  }) => {
6107
5957
  const isSourceParachain = Parachain3.is(source);
6108
5958
  const isDestinationMoonChain = destination.isEqual(moonChain);
6109
- const isDestinationEvmChain = EvmChain4.is(destination);
5959
+ const isDestinationEvmChain = EvmChain3.is(destination);
6110
5960
  const isNativeAsset = asset.isSame(
6111
5961
  isDestinationEvmChain ? moonChain.nativeAsset : source.nativeAsset
6112
5962
  );
@@ -7760,7 +7610,7 @@ function ethereumXcm() {
7760
7610
 
7761
7611
  // src/mrl/providers/wormhole/extrinsic/index.ts
7762
7612
  function extrinsic2() {
7763
- return { ethereumXcm, polkadotXcm: polkadotXcm3 };
7613
+ return { ethereumXcm, polkadotXcm: polkadotXcm2 };
7764
7614
  }
7765
7615
 
7766
7616
  // src/mrl/providers/wormhole/index.ts