@moonbeam-network/xcm-builder 4.4.3 → 4.4.5
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 +20 -13
- package/build/index.mjs +234 -24
- package/build/index.mjs.map +1 -1
- package/package.json +5 -5
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$
|
|
420
|
+
declare function polkadotXcm$2(): {
|
|
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$
|
|
481
|
+
polkadotXcm: typeof polkadotXcm$2;
|
|
482
482
|
xcmPallet: typeof xcmPallet$1;
|
|
483
483
|
};
|
|
484
484
|
|
|
@@ -494,7 +494,7 @@ declare class SubstrateCallConfig {
|
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
type FeeConfigBuilder = ConfigBuilder<SubstrateCallConfig | ContractConfig, FeeConfigBuilderParams>;
|
|
497
|
-
type
|
|
497
|
+
type ProtocolFeeConfigBuilder = ConfigBuilder<SubstrateQueryConfig | ContractConfig, ProtocolFeeConfigBuilderParams>;
|
|
498
498
|
interface FeeConfigBuilderParams {
|
|
499
499
|
address: string;
|
|
500
500
|
api: ApiPromise;
|
|
@@ -504,13 +504,8 @@ interface FeeConfigBuilderParams {
|
|
|
504
504
|
feeAsset: ChainAsset;
|
|
505
505
|
source: AnyChain;
|
|
506
506
|
}
|
|
507
|
-
interface
|
|
508
|
-
|
|
509
|
-
feeAsset: ChainAsset;
|
|
510
|
-
address: string;
|
|
511
|
-
balance?: AssetAmount;
|
|
512
|
-
destination: AnyChain;
|
|
513
|
-
source: AnyChain;
|
|
507
|
+
interface ProtocolFeeConfigBuilderParams extends Omit<FeeConfigBuilderParams, 'api'> {
|
|
508
|
+
bridgeChainFee: AssetAmount;
|
|
514
509
|
}
|
|
515
510
|
interface XcmPaymentFeeProps {
|
|
516
511
|
isAssetReserveChain: boolean;
|
|
@@ -526,11 +521,14 @@ interface MoonbeamRuntimeXcmConfigAssetType extends Enum {
|
|
|
526
521
|
type GetVersionedAssetId = (params: FeeConfigBuilderParams) => Promise<object> | object;
|
|
527
522
|
|
|
528
523
|
declare function gateway(): {
|
|
529
|
-
quoteSendTokenFee():
|
|
524
|
+
quoteSendTokenFee(): ProtocolFeeConfigBuilder;
|
|
530
525
|
};
|
|
531
526
|
|
|
532
527
|
declare function outboundQueueApi(): {
|
|
533
|
-
calculateFee: () =>
|
|
528
|
+
calculateFee: () => {
|
|
529
|
+
mintForeignToken: () => ProtocolFeeConfigBuilder;
|
|
530
|
+
agentExecute: () => ProtocolFeeConfigBuilder;
|
|
531
|
+
};
|
|
534
532
|
};
|
|
535
533
|
|
|
536
534
|
declare function xcmPaymentApi(): {
|
|
@@ -607,6 +605,7 @@ interface SnowbridgeFunctionArgs {
|
|
|
607
605
|
destinationParaId: number;
|
|
608
606
|
amount: bigint;
|
|
609
607
|
bridgeFeeAmount: bigint;
|
|
608
|
+
bridgeChainFee: bigint;
|
|
610
609
|
requiresApproval: boolean;
|
|
611
610
|
value: bigint;
|
|
612
611
|
}
|
|
@@ -1740,6 +1739,7 @@ type MrlExecuteConfigBuilder = ConfigBuilder<ContractConfig, MrlExecuteBuilderPa
|
|
|
1740
1739
|
interface MrlBuilderParams extends BuilderParams<AnyChain> {
|
|
1741
1740
|
isAutomatic: boolean;
|
|
1742
1741
|
protocolFee?: AssetAmount;
|
|
1742
|
+
bridgeChainFee?: AssetAmount;
|
|
1743
1743
|
moonApi: ApiPromise;
|
|
1744
1744
|
moonAsset: ChainAsset;
|
|
1745
1745
|
bridgeChain: AnyParachain;
|
|
@@ -1771,6 +1771,12 @@ declare function ethereumTokenTransfers(): {
|
|
|
1771
1771
|
transferNativeToken: () => MrlConfigBuilder;
|
|
1772
1772
|
};
|
|
1773
1773
|
|
|
1774
|
+
declare function polkadotXcm$1(): {
|
|
1775
|
+
transferAssetsUsingTypeAndThen: () => {
|
|
1776
|
+
canonicalEth: () => MrlConfigBuilder;
|
|
1777
|
+
};
|
|
1778
|
+
};
|
|
1779
|
+
|
|
1774
1780
|
declare function xcmPallet(): {
|
|
1775
1781
|
transferAssets: () => {
|
|
1776
1782
|
globalConsensus: () => MrlConfigBuilder;
|
|
@@ -1781,6 +1787,7 @@ declare function xcmPallet(): {
|
|
|
1781
1787
|
declare function extrinsic$1(): {
|
|
1782
1788
|
ethereumTokenTransfers: typeof ethereumTokenTransfers;
|
|
1783
1789
|
xcmPallet: typeof xcmPallet;
|
|
1790
|
+
polkadotXcm: typeof polkadotXcm$1;
|
|
1784
1791
|
};
|
|
1785
1792
|
|
|
1786
1793
|
declare function snowbridge(): {
|
|
@@ -1925,4 +1932,4 @@ declare function MrlBuilder(): {
|
|
|
1925
1932
|
|
|
1926
1933
|
declare const BATCH_CONTRACT_ADDRESS = "0x0000000000000000000000000000000000000808";
|
|
1927
1934
|
|
|
1928
|
-
export { type AssetAddressFormat, AssetMinBuilder, type AssetMinConfigBuilder, type AssetMinConfigBuilderParams, type AssetMultilocation, BATCH_CONTRACT_ABI, BATCH_CONTRACT_ADDRESS, BalanceBuilder, type BalanceBuilderParams, type BalanceConfigBuilder, type
|
|
1935
|
+
export { type AssetAddressFormat, AssetMinBuilder, type AssetMinConfigBuilder, type AssetMinConfigBuilderParams, type AssetMultilocation, BATCH_CONTRACT_ABI, BATCH_CONTRACT_ADDRESS, BalanceBuilder, type BalanceBuilderParams, type BalanceConfigBuilder, 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 MrlTransferConfig, type PalletBalancesAccountDataOld, type Parents, type ProtocolFeeConfigBuilder, type ProtocolFeeConfigBuilderParams, Protocols, 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
|
@@ -119,11 +119,11 @@ function AssetMinBuilder() {
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
function assetRegistry() {
|
|
122
|
-
const
|
|
122
|
+
const pallet9 = "assetRegistry";
|
|
123
123
|
return {
|
|
124
124
|
assetMetadatas: () => ({
|
|
125
125
|
build: ({ asset }) => new SubstrateQueryConfig({
|
|
126
|
-
module:
|
|
126
|
+
module: pallet9,
|
|
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:
|
|
135
|
+
module: pallet9,
|
|
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:
|
|
144
|
+
module: pallet9,
|
|
145
145
|
func: "metadata",
|
|
146
146
|
args: [asset],
|
|
147
147
|
// biome-ignore lint/suspicious/noExplicitAny: not sure how to fix this
|
|
@@ -3912,7 +3912,7 @@ function gateway() {
|
|
|
3912
3912
|
return {
|
|
3913
3913
|
quoteSendTokenFee() {
|
|
3914
3914
|
return {
|
|
3915
|
-
build: ({ asset, destination, source }) => {
|
|
3915
|
+
build: ({ asset, destination, source, bridgeChainFee }) => {
|
|
3916
3916
|
if (!asset.address) {
|
|
3917
3917
|
throw new Error(`Asset ${asset.key} has no address`);
|
|
3918
3918
|
}
|
|
@@ -3929,7 +3929,11 @@ function gateway() {
|
|
|
3929
3929
|
return new ContractConfig({
|
|
3930
3930
|
address: source.contracts.Gateway,
|
|
3931
3931
|
abi: GATEWAY_ABI,
|
|
3932
|
-
args: [
|
|
3932
|
+
args: [
|
|
3933
|
+
asset.address,
|
|
3934
|
+
destination.parachainId,
|
|
3935
|
+
bridgeChainFee.amount
|
|
3936
|
+
],
|
|
3933
3937
|
func: "quoteSendTokenFee",
|
|
3934
3938
|
module: "Gateway"
|
|
3935
3939
|
});
|
|
@@ -3942,8 +3946,8 @@ function gateway() {
|
|
|
3942
3946
|
// src/fee/outboundQueueApi/outboundQueueApi.ts
|
|
3943
3947
|
function outboundQueueApi() {
|
|
3944
3948
|
return {
|
|
3945
|
-
calculateFee: () => {
|
|
3946
|
-
|
|
3949
|
+
calculateFee: () => ({
|
|
3950
|
+
mintForeignToken: () => ({
|
|
3947
3951
|
build: ({ address, balance, feeAsset }) => {
|
|
3948
3952
|
const args = [
|
|
3949
3953
|
{
|
|
@@ -3963,8 +3967,34 @@ function outboundQueueApi() {
|
|
|
3963
3967
|
transform: async (data) => data.local.toBigInt() + data.remote.toBigInt()
|
|
3964
3968
|
});
|
|
3965
3969
|
}
|
|
3966
|
-
}
|
|
3967
|
-
|
|
3970
|
+
}),
|
|
3971
|
+
agentExecute: () => ({
|
|
3972
|
+
build: ({ address, balance, destination }) => {
|
|
3973
|
+
const assetInDestination = balance ? destination.getChainAsset(balance) : void 0;
|
|
3974
|
+
const args = [
|
|
3975
|
+
{
|
|
3976
|
+
AgentExecute: {
|
|
3977
|
+
agentId: "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
3978
|
+
// actual value is not important
|
|
3979
|
+
TokenTransfer: {
|
|
3980
|
+
tokenId: assetInDestination?.address,
|
|
3981
|
+
recipient: address,
|
|
3982
|
+
amount: balance?.amount
|
|
3983
|
+
}
|
|
3984
|
+
}
|
|
3985
|
+
},
|
|
3986
|
+
null
|
|
3987
|
+
];
|
|
3988
|
+
return new SubstrateQueryConfig({
|
|
3989
|
+
module: "outboundQueueApi",
|
|
3990
|
+
func: "calculateFee",
|
|
3991
|
+
args,
|
|
3992
|
+
queryType: "call",
|
|
3993
|
+
transform: async (data) => data.local.toBigInt() + data.remote.toBigInt()
|
|
3994
|
+
});
|
|
3995
|
+
}
|
|
3996
|
+
})
|
|
3997
|
+
})
|
|
3968
3998
|
};
|
|
3969
3999
|
}
|
|
3970
4000
|
|
|
@@ -4715,27 +4745,49 @@ function Gateway() {
|
|
|
4715
4745
|
return {
|
|
4716
4746
|
sendToken: () => ({
|
|
4717
4747
|
provider,
|
|
4718
|
-
build: ({
|
|
4748
|
+
build: ({
|
|
4749
|
+
asset,
|
|
4750
|
+
destinationAddress,
|
|
4751
|
+
protocolFee,
|
|
4752
|
+
destination,
|
|
4753
|
+
bridgeChainFee
|
|
4754
|
+
}) => callSendToken(
|
|
4755
|
+
asset,
|
|
4756
|
+
protocolFee,
|
|
4757
|
+
destination,
|
|
4758
|
+
destinationAddress,
|
|
4759
|
+
bridgeChainFee
|
|
4760
|
+
)
|
|
4719
4761
|
}),
|
|
4720
4762
|
approveAndSendToken: () => ({
|
|
4721
4763
|
provider,
|
|
4722
|
-
build: ({
|
|
4764
|
+
build: ({
|
|
4765
|
+
asset,
|
|
4766
|
+
destinationAddress,
|
|
4767
|
+
protocolFee,
|
|
4768
|
+
destination,
|
|
4769
|
+
bridgeChainFee
|
|
4770
|
+
}) => {
|
|
4723
4771
|
const requiresApproval = protocolFee && !protocolFee.isSame(asset);
|
|
4724
4772
|
return callSendToken(
|
|
4725
4773
|
asset,
|
|
4726
4774
|
protocolFee,
|
|
4727
4775
|
destination,
|
|
4728
4776
|
destinationAddress,
|
|
4777
|
+
bridgeChainFee,
|
|
4729
4778
|
requiresApproval
|
|
4730
4779
|
);
|
|
4731
4780
|
}
|
|
4732
4781
|
})
|
|
4733
4782
|
};
|
|
4734
4783
|
}
|
|
4735
|
-
function callSendToken(asset, protocolFee, destination, destinationAddress, requiresApproval = false) {
|
|
4784
|
+
function callSendToken(asset, protocolFee, destination, destinationAddress, bridgeChainFee, requiresApproval = false) {
|
|
4736
4785
|
if (!protocolFee) {
|
|
4737
4786
|
throw new Error("Protocol fee is required for Gateway module");
|
|
4738
4787
|
}
|
|
4788
|
+
if (!bridgeChainFee) {
|
|
4789
|
+
throw new Error("Bridge chain fee is required for Gateway module");
|
|
4790
|
+
}
|
|
4739
4791
|
if (!EvmParachain4.isAnyParachain(destination)) {
|
|
4740
4792
|
throw new Error(
|
|
4741
4793
|
"Destination must be a Parachain or EvmParachain for sending token with Gateway module"
|
|
@@ -4750,6 +4802,7 @@ function callSendToken(asset, protocolFee, destination, destinationAddress, requ
|
|
|
4750
4802
|
destinationParaId: destination.parachainId,
|
|
4751
4803
|
amount: asset.amount,
|
|
4752
4804
|
bridgeFeeAmount: protocolFee.amount,
|
|
4805
|
+
bridgeChainFee: bridgeChainFee.amount,
|
|
4753
4806
|
requiresApproval,
|
|
4754
4807
|
value
|
|
4755
4808
|
},
|
|
@@ -4783,8 +4836,165 @@ function ethereumTokenTransfers() {
|
|
|
4783
4836
|
};
|
|
4784
4837
|
}
|
|
4785
4838
|
|
|
4786
|
-
// src/mrl/providers/snowbridge/extrinsic/
|
|
4839
|
+
// src/mrl/providers/snowbridge/extrinsic/polkadotXcm/polkadotXcm.ts
|
|
4787
4840
|
import { EvmChain as EvmChain2 } from "@moonbeam-network/xcm-types";
|
|
4841
|
+
var pallet7 = "polkadotXcm";
|
|
4842
|
+
function polkadotXcm2() {
|
|
4843
|
+
return {
|
|
4844
|
+
transferAssetsUsingTypeAndThen: () => {
|
|
4845
|
+
const func = "transferAssetsUsingTypeAndThen";
|
|
4846
|
+
const provider = "snowbridge" /* Snowbridge */;
|
|
4847
|
+
return {
|
|
4848
|
+
canonicalEth: () => ({
|
|
4849
|
+
provider,
|
|
4850
|
+
build: ({ asset, destination, destinationAddress, protocolFee }) => {
|
|
4851
|
+
if (!EvmChain2.is(destination)) {
|
|
4852
|
+
throw new Error(
|
|
4853
|
+
"Destination must be an EVM chain for globalConsensus function"
|
|
4854
|
+
);
|
|
4855
|
+
}
|
|
4856
|
+
if (!protocolFee) {
|
|
4857
|
+
throw new Error(
|
|
4858
|
+
"Bridge chain fee is required for the polkadotXcm.canonicalEth function"
|
|
4859
|
+
);
|
|
4860
|
+
}
|
|
4861
|
+
const protocolFeeAmount = protocolFee.amount * 110n / 100n;
|
|
4862
|
+
return new ExtrinsicConfig({
|
|
4863
|
+
module: pallet7,
|
|
4864
|
+
func,
|
|
4865
|
+
getArgs: (extrinsicFunction) => {
|
|
4866
|
+
const version = getExtrinsicArgumentVersion(extrinsicFunction);
|
|
4867
|
+
const dest = {
|
|
4868
|
+
[version]: {
|
|
4869
|
+
parents: 1,
|
|
4870
|
+
interior: "Here"
|
|
4871
|
+
}
|
|
4872
|
+
};
|
|
4873
|
+
const assets3 = {
|
|
4874
|
+
[version]: [
|
|
4875
|
+
{
|
|
4876
|
+
id: {
|
|
4877
|
+
parents: 1,
|
|
4878
|
+
interior: "Here"
|
|
4879
|
+
},
|
|
4880
|
+
fun: { Fungible: protocolFeeAmount }
|
|
4881
|
+
},
|
|
4882
|
+
{
|
|
4883
|
+
id: {
|
|
4884
|
+
parents: 2,
|
|
4885
|
+
interior: {
|
|
4886
|
+
X1: [
|
|
4887
|
+
{
|
|
4888
|
+
GlobalConsensus: {
|
|
4889
|
+
Ethereum: { chainId: destination.id }
|
|
4890
|
+
}
|
|
4891
|
+
}
|
|
4892
|
+
]
|
|
4893
|
+
}
|
|
4894
|
+
},
|
|
4895
|
+
fun: { Fungible: asset.amount }
|
|
4896
|
+
}
|
|
4897
|
+
]
|
|
4898
|
+
};
|
|
4899
|
+
const assetsTransferType = 2 /* DestinationReserve */;
|
|
4900
|
+
const remoteFeesId = {
|
|
4901
|
+
[version]: {
|
|
4902
|
+
parents: 1,
|
|
4903
|
+
interior: "Here"
|
|
4904
|
+
}
|
|
4905
|
+
};
|
|
4906
|
+
const feesTransferType = 2 /* DestinationReserve */;
|
|
4907
|
+
const customXcmOnDest = {
|
|
4908
|
+
[version]: [
|
|
4909
|
+
{
|
|
4910
|
+
InitiateReserveWithdraw: {
|
|
4911
|
+
assets: {
|
|
4912
|
+
Definite: [
|
|
4913
|
+
{
|
|
4914
|
+
id: {
|
|
4915
|
+
parents: 1,
|
|
4916
|
+
interior: {
|
|
4917
|
+
X1: [
|
|
4918
|
+
{
|
|
4919
|
+
GlobalConsensus: {
|
|
4920
|
+
Ethereum: { chainId: destination.id }
|
|
4921
|
+
}
|
|
4922
|
+
}
|
|
4923
|
+
]
|
|
4924
|
+
}
|
|
4925
|
+
},
|
|
4926
|
+
fun: { Fungible: asset.amount }
|
|
4927
|
+
}
|
|
4928
|
+
]
|
|
4929
|
+
},
|
|
4930
|
+
reserve: {
|
|
4931
|
+
parents: 1,
|
|
4932
|
+
interior: {
|
|
4933
|
+
X1: [
|
|
4934
|
+
{
|
|
4935
|
+
GlobalConsensus: {
|
|
4936
|
+
Ethereum: { chainId: destination.id }
|
|
4937
|
+
}
|
|
4938
|
+
}
|
|
4939
|
+
]
|
|
4940
|
+
}
|
|
4941
|
+
},
|
|
4942
|
+
xcm: [
|
|
4943
|
+
{
|
|
4944
|
+
DepositAsset: {
|
|
4945
|
+
assets: {
|
|
4946
|
+
Definite: [
|
|
4947
|
+
{
|
|
4948
|
+
id: {
|
|
4949
|
+
parents: 0,
|
|
4950
|
+
interior: "Here"
|
|
4951
|
+
},
|
|
4952
|
+
fun: { Fungible: asset.amount }
|
|
4953
|
+
}
|
|
4954
|
+
]
|
|
4955
|
+
},
|
|
4956
|
+
beneficiary: {
|
|
4957
|
+
parents: 0,
|
|
4958
|
+
interior: {
|
|
4959
|
+
X1: [
|
|
4960
|
+
{
|
|
4961
|
+
AccountKey20: {
|
|
4962
|
+
network: {
|
|
4963
|
+
Ethereum: { chainId: destination.id }
|
|
4964
|
+
},
|
|
4965
|
+
key: destinationAddress
|
|
4966
|
+
}
|
|
4967
|
+
}
|
|
4968
|
+
]
|
|
4969
|
+
}
|
|
4970
|
+
}
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
]
|
|
4974
|
+
}
|
|
4975
|
+
}
|
|
4976
|
+
]
|
|
4977
|
+
};
|
|
4978
|
+
return [
|
|
4979
|
+
dest,
|
|
4980
|
+
assets3,
|
|
4981
|
+
assetsTransferType,
|
|
4982
|
+
remoteFeesId,
|
|
4983
|
+
feesTransferType,
|
|
4984
|
+
customXcmOnDest,
|
|
4985
|
+
"Unlimited"
|
|
4986
|
+
];
|
|
4987
|
+
}
|
|
4988
|
+
});
|
|
4989
|
+
}
|
|
4990
|
+
})
|
|
4991
|
+
};
|
|
4992
|
+
}
|
|
4993
|
+
};
|
|
4994
|
+
}
|
|
4995
|
+
|
|
4996
|
+
// src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.ts
|
|
4997
|
+
import { EvmChain as EvmChain3 } from "@moonbeam-network/xcm-types";
|
|
4788
4998
|
|
|
4789
4999
|
// src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.utils.ts
|
|
4790
5000
|
function getGlobalConsensusArgs({
|
|
@@ -4837,7 +5047,7 @@ function getGlobalConsensusArgs({
|
|
|
4837
5047
|
}
|
|
4838
5048
|
|
|
4839
5049
|
// src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.ts
|
|
4840
|
-
var
|
|
5050
|
+
var pallet8 = "xcmPallet";
|
|
4841
5051
|
function xcmPallet2() {
|
|
4842
5052
|
return {
|
|
4843
5053
|
transferAssets: () => {
|
|
@@ -4847,13 +5057,13 @@ function xcmPallet2() {
|
|
|
4847
5057
|
globalConsensus: () => ({
|
|
4848
5058
|
provider,
|
|
4849
5059
|
build: ({ asset, destination, destinationAddress }) => {
|
|
4850
|
-
if (!
|
|
5060
|
+
if (!EvmChain3.is(destination)) {
|
|
4851
5061
|
throw new Error(
|
|
4852
5062
|
"Destination must be an EVM chain for globalConsensus function"
|
|
4853
5063
|
);
|
|
4854
5064
|
}
|
|
4855
5065
|
return new ExtrinsicConfig({
|
|
4856
|
-
module:
|
|
5066
|
+
module: pallet8,
|
|
4857
5067
|
func,
|
|
4858
5068
|
getArgs: (extrinsicFunction) => {
|
|
4859
5069
|
const assets3 = [
|
|
@@ -4886,14 +5096,14 @@ function xcmPallet2() {
|
|
|
4886
5096
|
globalConsensusErc20: () => ({
|
|
4887
5097
|
provider,
|
|
4888
5098
|
build: ({ asset, destination, destinationAddress }) => {
|
|
4889
|
-
if (!
|
|
5099
|
+
if (!EvmChain3.is(destination)) {
|
|
4890
5100
|
throw new Error(
|
|
4891
5101
|
"Destination must be an EVM chain for globalConsensusErc20 function"
|
|
4892
5102
|
);
|
|
4893
5103
|
}
|
|
4894
5104
|
const assetInDestination = destination.getChainAsset(asset);
|
|
4895
5105
|
return new ExtrinsicConfig({
|
|
4896
|
-
module:
|
|
5106
|
+
module: pallet8,
|
|
4897
5107
|
func,
|
|
4898
5108
|
getArgs: (extrinsicFunction) => {
|
|
4899
5109
|
const assets3 = [
|
|
@@ -4938,7 +5148,7 @@ function xcmPallet2() {
|
|
|
4938
5148
|
|
|
4939
5149
|
// src/mrl/providers/snowbridge/extrinsic/index.ts
|
|
4940
5150
|
function extrinsic() {
|
|
4941
|
-
return { ethereumTokenTransfers, xcmPallet: xcmPallet2 };
|
|
5151
|
+
return { ethereumTokenTransfers, xcmPallet: xcmPallet2, polkadotXcm: polkadotXcm2 };
|
|
4942
5152
|
}
|
|
4943
5153
|
|
|
4944
5154
|
// src/mrl/providers/snowbridge/index.ts
|
|
@@ -4965,7 +5175,7 @@ import {
|
|
|
4965
5175
|
import { getMultilocationDerivedAddresses } from "@moonbeam-network/xcm-utils";
|
|
4966
5176
|
var BUY_EXECUTION_FEE = 100000000000000000n;
|
|
4967
5177
|
var CROSS_CHAIN_FEE = 100000000000000000n;
|
|
4968
|
-
function
|
|
5178
|
+
function polkadotXcm3() {
|
|
4969
5179
|
const provider = "wormhole" /* Wormhole */;
|
|
4970
5180
|
return {
|
|
4971
5181
|
send: () => ({
|
|
@@ -5918,7 +6128,7 @@ var WormholeConfig = class _WormholeConfig {
|
|
|
5918
6128
|
};
|
|
5919
6129
|
|
|
5920
6130
|
// src/mrl/providers/wormhole/wormhole/wormhole.ts
|
|
5921
|
-
import { EvmChain as
|
|
6131
|
+
import { EvmChain as EvmChain4, EvmParachain as EvmParachain7, Parachain as Parachain3 } from "@moonbeam-network/xcm-types";
|
|
5922
6132
|
import { getMultilocationDerivedAddresses as getMultilocationDerivedAddresses3 } from "@moonbeam-network/xcm-utils";
|
|
5923
6133
|
import { evmToAddress as evmToAddress4 } from "@polkadot/util-crypto/address";
|
|
5924
6134
|
import { Wormhole as Wormhole2 } from "@wormhole-foundation/sdk-connect";
|
|
@@ -5959,7 +6169,7 @@ function wormhole() {
|
|
|
5959
6169
|
}) => {
|
|
5960
6170
|
const isSourceParachain = Parachain3.is(source);
|
|
5961
6171
|
const isDestinationMoonChain = destination.isEqual(moonChain);
|
|
5962
|
-
const isDestinationEvmChain =
|
|
6172
|
+
const isDestinationEvmChain = EvmChain4.is(destination);
|
|
5963
6173
|
const isNativeAsset = asset.isSame(
|
|
5964
6174
|
isDestinationEvmChain ? moonChain.nativeAsset : source.nativeAsset
|
|
5965
6175
|
);
|
|
@@ -7613,7 +7823,7 @@ function ethereumXcm() {
|
|
|
7613
7823
|
|
|
7614
7824
|
// src/mrl/providers/wormhole/extrinsic/index.ts
|
|
7615
7825
|
function extrinsic2() {
|
|
7616
|
-
return { ethereumXcm, polkadotXcm:
|
|
7826
|
+
return { ethereumXcm, polkadotXcm: polkadotXcm3 };
|
|
7617
7827
|
}
|
|
7618
7828
|
|
|
7619
7829
|
// src/mrl/providers/wormhole/index.ts
|