@moonbeam-network/xcm-builder 1.0.0-dev.283 → 1.0.0-dev.285
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 +14 -20
- package/build/index.mjs +28 -234
- package/build/index.mjs.map +1 -1
- package/package.json +3 -3
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$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$
|
|
481
|
+
polkadotXcm: typeof polkadotXcm$1;
|
|
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 BridgeFeeConfigBuilder = ConfigBuilder<SubstrateQueryConfig | ContractConfig, BridgeFeeConfigBuilderParams>;
|
|
498
498
|
interface FeeConfigBuilderParams {
|
|
499
499
|
address: string;
|
|
500
500
|
api: ApiPromise;
|
|
@@ -504,8 +504,13 @@ interface FeeConfigBuilderParams {
|
|
|
504
504
|
feeAsset: ChainAsset;
|
|
505
505
|
source: AnyChain;
|
|
506
506
|
}
|
|
507
|
-
interface
|
|
508
|
-
|
|
507
|
+
interface BridgeFeeConfigBuilderParams {
|
|
508
|
+
asset: ChainAsset;
|
|
509
|
+
feeAsset: ChainAsset;
|
|
510
|
+
address: string;
|
|
511
|
+
balance?: AssetAmount;
|
|
512
|
+
destination: AnyChain;
|
|
513
|
+
source: AnyChain;
|
|
509
514
|
}
|
|
510
515
|
interface XcmPaymentFeeProps {
|
|
511
516
|
isAssetReserveChain: boolean;
|
|
@@ -521,14 +526,11 @@ interface MoonbeamRuntimeXcmConfigAssetType extends Enum {
|
|
|
521
526
|
type GetVersionedAssetId = (params: FeeConfigBuilderParams) => Promise<object> | object;
|
|
522
527
|
|
|
523
528
|
declare function gateway(): {
|
|
524
|
-
quoteSendTokenFee():
|
|
529
|
+
quoteSendTokenFee(): BridgeFeeConfigBuilder;
|
|
525
530
|
};
|
|
526
531
|
|
|
527
532
|
declare function outboundQueueApi(): {
|
|
528
|
-
calculateFee: () =>
|
|
529
|
-
mintForeignToken: () => ProtocolFeeConfigBuilder;
|
|
530
|
-
agentExecute: () => ProtocolFeeConfigBuilder;
|
|
531
|
-
};
|
|
533
|
+
calculateFee: () => BridgeFeeConfigBuilder;
|
|
532
534
|
};
|
|
533
535
|
|
|
534
536
|
declare function xcmPaymentApi(): {
|
|
@@ -605,8 +607,8 @@ interface SnowbridgeFunctionArgs {
|
|
|
605
607
|
destinationParaId: number;
|
|
606
608
|
amount: bigint;
|
|
607
609
|
bridgeFeeAmount: bigint;
|
|
608
|
-
bridgeChainFee: bigint;
|
|
609
610
|
requiresApproval: boolean;
|
|
611
|
+
value: bigint;
|
|
610
612
|
}
|
|
611
613
|
interface SnowbridgeConfigConstructorParams {
|
|
612
614
|
args: SnowbridgeFunctionArgs;
|
|
@@ -1738,7 +1740,6 @@ type MrlExecuteConfigBuilder = ConfigBuilder<ContractConfig, MrlExecuteBuilderPa
|
|
|
1738
1740
|
interface MrlBuilderParams extends BuilderParams<AnyChain> {
|
|
1739
1741
|
isAutomatic: boolean;
|
|
1740
1742
|
protocolFee?: AssetAmount;
|
|
1741
|
-
bridgeChainFee?: AssetAmount;
|
|
1742
1743
|
moonApi: ApiPromise;
|
|
1743
1744
|
moonAsset: ChainAsset;
|
|
1744
1745
|
bridgeChain: AnyParachain;
|
|
@@ -1770,12 +1771,6 @@ declare function ethereumTokenTransfers(): {
|
|
|
1770
1771
|
transferNativeToken: () => MrlConfigBuilder;
|
|
1771
1772
|
};
|
|
1772
1773
|
|
|
1773
|
-
declare function polkadotXcm$1(): {
|
|
1774
|
-
transferAssetsUsingTypeAndThen: () => {
|
|
1775
|
-
canonicalEth: () => MrlConfigBuilder;
|
|
1776
|
-
};
|
|
1777
|
-
};
|
|
1778
|
-
|
|
1779
1774
|
declare function xcmPallet(): {
|
|
1780
1775
|
transferAssets: () => {
|
|
1781
1776
|
globalConsensus: () => MrlConfigBuilder;
|
|
@@ -1786,7 +1781,6 @@ declare function xcmPallet(): {
|
|
|
1786
1781
|
declare function extrinsic$1(): {
|
|
1787
1782
|
ethereumTokenTransfers: typeof ethereumTokenTransfers;
|
|
1788
1783
|
xcmPallet: typeof xcmPallet;
|
|
1789
|
-
polkadotXcm: typeof polkadotXcm$1;
|
|
1790
1784
|
};
|
|
1791
1785
|
|
|
1792
1786
|
declare function snowbridge(): {
|
|
@@ -1931,4 +1925,4 @@ declare function MrlBuilder(): {
|
|
|
1931
1925
|
|
|
1932
1926
|
declare const BATCH_CONTRACT_ADDRESS = "0x0000000000000000000000000000000000000808";
|
|
1933
1927
|
|
|
1934
|
-
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,
|
|
1928
|
+
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 MrlTransferConfig, type PalletBalancesAccountDataOld, type Parents, 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 pallet8 = "assetRegistry";
|
|
123
123
|
return {
|
|
124
124
|
assetMetadatas: () => ({
|
|
125
125
|
build: ({ asset }) => new SubstrateQueryConfig({
|
|
126
|
-
module:
|
|
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:
|
|
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:
|
|
144
|
+
module: pallet8,
|
|
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 }) => {
|
|
3916
3916
|
if (!asset.address) {
|
|
3917
3917
|
throw new Error(`Asset ${asset.key} has no address`);
|
|
3918
3918
|
}
|
|
@@ -3929,11 +3929,7 @@ function gateway() {
|
|
|
3929
3929
|
return new ContractConfig({
|
|
3930
3930
|
address: source.contracts.Gateway,
|
|
3931
3931
|
abi: GATEWAY_ABI,
|
|
3932
|
-
args: [
|
|
3933
|
-
asset.address,
|
|
3934
|
-
destination.parachainId,
|
|
3935
|
-
bridgeChainFee.amount
|
|
3936
|
-
],
|
|
3932
|
+
args: [asset.address, destination.parachainId, 0n],
|
|
3937
3933
|
func: "quoteSendTokenFee",
|
|
3938
3934
|
module: "Gateway"
|
|
3939
3935
|
});
|
|
@@ -3946,8 +3942,8 @@ function gateway() {
|
|
|
3946
3942
|
// src/fee/outboundQueueApi/outboundQueueApi.ts
|
|
3947
3943
|
function outboundQueueApi() {
|
|
3948
3944
|
return {
|
|
3949
|
-
calculateFee: () =>
|
|
3950
|
-
|
|
3945
|
+
calculateFee: () => {
|
|
3946
|
+
return {
|
|
3951
3947
|
build: ({ address, balance, feeAsset }) => {
|
|
3952
3948
|
const args = [
|
|
3953
3949
|
{
|
|
@@ -3967,34 +3963,8 @@ function outboundQueueApi() {
|
|
|
3967
3963
|
transform: async (data) => data.local.toBigInt() + data.remote.toBigInt()
|
|
3968
3964
|
});
|
|
3969
3965
|
}
|
|
3970
|
-
}
|
|
3971
|
-
|
|
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
|
-
})
|
|
3966
|
+
};
|
|
3967
|
+
}
|
|
3998
3968
|
};
|
|
3999
3969
|
}
|
|
4000
3970
|
|
|
@@ -4745,54 +4715,34 @@ function Gateway() {
|
|
|
4745
4715
|
return {
|
|
4746
4716
|
sendToken: () => ({
|
|
4747
4717
|
provider,
|
|
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
|
-
)
|
|
4718
|
+
build: ({ asset, destinationAddress, protocolFee, destination }) => callSendToken(asset, protocolFee, destination, destinationAddress)
|
|
4761
4719
|
}),
|
|
4762
4720
|
approveAndSendToken: () => ({
|
|
4763
4721
|
provider,
|
|
4764
|
-
build: ({
|
|
4765
|
-
asset,
|
|
4766
|
-
destinationAddress,
|
|
4767
|
-
protocolFee,
|
|
4768
|
-
destination,
|
|
4769
|
-
bridgeChainFee
|
|
4770
|
-
}) => {
|
|
4722
|
+
build: ({ asset, destinationAddress, protocolFee, destination }) => {
|
|
4771
4723
|
const requiresApproval = protocolFee && !protocolFee.isSame(asset);
|
|
4772
4724
|
return callSendToken(
|
|
4773
4725
|
asset,
|
|
4774
4726
|
protocolFee,
|
|
4775
4727
|
destination,
|
|
4776
4728
|
destinationAddress,
|
|
4777
|
-
bridgeChainFee,
|
|
4778
4729
|
requiresApproval
|
|
4779
4730
|
);
|
|
4780
4731
|
}
|
|
4781
4732
|
})
|
|
4782
4733
|
};
|
|
4783
4734
|
}
|
|
4784
|
-
function callSendToken(asset, protocolFee, destination, destinationAddress,
|
|
4735
|
+
function callSendToken(asset, protocolFee, destination, destinationAddress, requiresApproval = false) {
|
|
4785
4736
|
if (!protocolFee) {
|
|
4786
4737
|
throw new Error("Protocol fee is required for Gateway module");
|
|
4787
4738
|
}
|
|
4788
|
-
if (!bridgeChainFee) {
|
|
4789
|
-
throw new Error("Bridge chain fee is required for Gateway module");
|
|
4790
|
-
}
|
|
4791
4739
|
if (!EvmParachain4.isAnyParachain(destination)) {
|
|
4792
4740
|
throw new Error(
|
|
4793
4741
|
"Destination must be a Parachain or EvmParachain for sending token with Gateway module"
|
|
4794
4742
|
);
|
|
4795
4743
|
}
|
|
4744
|
+
const isDifferentAsset = !asset.isSame(protocolFee);
|
|
4745
|
+
const value = requiresApproval || isDifferentAsset ? protocolFee.amount : asset.amount + protocolFee.amount;
|
|
4796
4746
|
return new SnowbridgeConfig({
|
|
4797
4747
|
args: {
|
|
4798
4748
|
tokenAddress: asset.address,
|
|
@@ -4800,8 +4750,8 @@ function callSendToken(asset, protocolFee, destination, destinationAddress, brid
|
|
|
4800
4750
|
destinationParaId: destination.parachainId,
|
|
4801
4751
|
amount: asset.amount,
|
|
4802
4752
|
bridgeFeeAmount: protocolFee.amount,
|
|
4803
|
-
|
|
4804
|
-
|
|
4753
|
+
requiresApproval,
|
|
4754
|
+
value
|
|
4805
4755
|
},
|
|
4806
4756
|
func: "sendToken"
|
|
4807
4757
|
});
|
|
@@ -4833,164 +4783,8 @@ function ethereumTokenTransfers() {
|
|
|
4833
4783
|
};
|
|
4834
4784
|
}
|
|
4835
4785
|
|
|
4836
|
-
// src/mrl/providers/snowbridge/extrinsic/polkadotXcm/polkadotXcm.ts
|
|
4837
|
-
import { EvmChain as EvmChain2 } from "@moonbeam-network/xcm-types";
|
|
4838
|
-
var pallet7 = "polkadotXcm";
|
|
4839
|
-
function polkadotXcm2() {
|
|
4840
|
-
return {
|
|
4841
|
-
transferAssetsUsingTypeAndThen: () => {
|
|
4842
|
-
const func = "transferAssetsUsingTypeAndThen";
|
|
4843
|
-
const provider = "snowbridge" /* Snowbridge */;
|
|
4844
|
-
return {
|
|
4845
|
-
canonicalEth: () => ({
|
|
4846
|
-
provider,
|
|
4847
|
-
build: ({ asset, destination, destinationAddress, protocolFee }) => {
|
|
4848
|
-
if (!EvmChain2.is(destination)) {
|
|
4849
|
-
throw new Error(
|
|
4850
|
-
"Destination must be an EVM chain for globalConsensus function"
|
|
4851
|
-
);
|
|
4852
|
-
}
|
|
4853
|
-
if (!protocolFee) {
|
|
4854
|
-
throw new Error(
|
|
4855
|
-
"Bridge chain fee is required for the polkadotXcm.canonicalEth function"
|
|
4856
|
-
);
|
|
4857
|
-
}
|
|
4858
|
-
return new ExtrinsicConfig({
|
|
4859
|
-
module: pallet7,
|
|
4860
|
-
func,
|
|
4861
|
-
getArgs: (extrinsicFunction) => {
|
|
4862
|
-
const version = getExtrinsicArgumentVersion(extrinsicFunction);
|
|
4863
|
-
const dest = {
|
|
4864
|
-
[version]: {
|
|
4865
|
-
parents: 1,
|
|
4866
|
-
interior: "Here"
|
|
4867
|
-
}
|
|
4868
|
-
};
|
|
4869
|
-
const assets3 = {
|
|
4870
|
-
[version]: [
|
|
4871
|
-
{
|
|
4872
|
-
id: {
|
|
4873
|
-
parents: 1,
|
|
4874
|
-
interior: "Here"
|
|
4875
|
-
},
|
|
4876
|
-
fun: { Fungible: protocolFee.amount }
|
|
4877
|
-
},
|
|
4878
|
-
{
|
|
4879
|
-
id: {
|
|
4880
|
-
parents: 2,
|
|
4881
|
-
interior: {
|
|
4882
|
-
X1: [
|
|
4883
|
-
{
|
|
4884
|
-
GlobalConsensus: {
|
|
4885
|
-
Ethereum: { chainId: destination.id }
|
|
4886
|
-
}
|
|
4887
|
-
}
|
|
4888
|
-
]
|
|
4889
|
-
}
|
|
4890
|
-
},
|
|
4891
|
-
fun: { Fungible: asset.amount }
|
|
4892
|
-
}
|
|
4893
|
-
]
|
|
4894
|
-
};
|
|
4895
|
-
const assetsTransferType = 2 /* DestinationReserve */;
|
|
4896
|
-
const remoteFeesId = {
|
|
4897
|
-
[version]: {
|
|
4898
|
-
parents: 1,
|
|
4899
|
-
interior: "Here"
|
|
4900
|
-
}
|
|
4901
|
-
};
|
|
4902
|
-
const feesTransferType = 2 /* DestinationReserve */;
|
|
4903
|
-
const customXcmOnDest = {
|
|
4904
|
-
[version]: [
|
|
4905
|
-
{
|
|
4906
|
-
InitiateReserveWithdraw: {
|
|
4907
|
-
assets: {
|
|
4908
|
-
Definite: [
|
|
4909
|
-
{
|
|
4910
|
-
id: {
|
|
4911
|
-
parents: 1,
|
|
4912
|
-
interior: {
|
|
4913
|
-
X1: [
|
|
4914
|
-
{
|
|
4915
|
-
GlobalConsensus: {
|
|
4916
|
-
Ethereum: { chainId: destination.id }
|
|
4917
|
-
}
|
|
4918
|
-
}
|
|
4919
|
-
]
|
|
4920
|
-
}
|
|
4921
|
-
},
|
|
4922
|
-
fun: { Fungible: asset.amount }
|
|
4923
|
-
}
|
|
4924
|
-
]
|
|
4925
|
-
},
|
|
4926
|
-
reserve: {
|
|
4927
|
-
parents: 1,
|
|
4928
|
-
interior: {
|
|
4929
|
-
X1: [
|
|
4930
|
-
{
|
|
4931
|
-
GlobalConsensus: {
|
|
4932
|
-
Ethereum: { chainId: destination.id }
|
|
4933
|
-
}
|
|
4934
|
-
}
|
|
4935
|
-
]
|
|
4936
|
-
}
|
|
4937
|
-
},
|
|
4938
|
-
xcm: [
|
|
4939
|
-
{
|
|
4940
|
-
DepositAsset: {
|
|
4941
|
-
assets: {
|
|
4942
|
-
Definite: [
|
|
4943
|
-
{
|
|
4944
|
-
id: {
|
|
4945
|
-
parents: 0,
|
|
4946
|
-
interior: "Here"
|
|
4947
|
-
},
|
|
4948
|
-
fun: { Fungible: asset.amount }
|
|
4949
|
-
}
|
|
4950
|
-
]
|
|
4951
|
-
},
|
|
4952
|
-
beneficiary: {
|
|
4953
|
-
parents: 0,
|
|
4954
|
-
interior: {
|
|
4955
|
-
X1: [
|
|
4956
|
-
{
|
|
4957
|
-
AccountKey20: {
|
|
4958
|
-
network: {
|
|
4959
|
-
Ethereum: { chainId: destination.id }
|
|
4960
|
-
},
|
|
4961
|
-
key: destinationAddress
|
|
4962
|
-
}
|
|
4963
|
-
}
|
|
4964
|
-
]
|
|
4965
|
-
}
|
|
4966
|
-
}
|
|
4967
|
-
}
|
|
4968
|
-
}
|
|
4969
|
-
]
|
|
4970
|
-
}
|
|
4971
|
-
}
|
|
4972
|
-
]
|
|
4973
|
-
};
|
|
4974
|
-
return [
|
|
4975
|
-
dest,
|
|
4976
|
-
assets3,
|
|
4977
|
-
assetsTransferType,
|
|
4978
|
-
remoteFeesId,
|
|
4979
|
-
feesTransferType,
|
|
4980
|
-
customXcmOnDest,
|
|
4981
|
-
"Unlimited"
|
|
4982
|
-
];
|
|
4983
|
-
}
|
|
4984
|
-
});
|
|
4985
|
-
}
|
|
4986
|
-
})
|
|
4987
|
-
};
|
|
4988
|
-
}
|
|
4989
|
-
};
|
|
4990
|
-
}
|
|
4991
|
-
|
|
4992
4786
|
// src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.ts
|
|
4993
|
-
import { EvmChain as
|
|
4787
|
+
import { EvmChain as EvmChain2 } from "@moonbeam-network/xcm-types";
|
|
4994
4788
|
|
|
4995
4789
|
// src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.utils.ts
|
|
4996
4790
|
function getGlobalConsensusArgs({
|
|
@@ -5043,7 +4837,7 @@ function getGlobalConsensusArgs({
|
|
|
5043
4837
|
}
|
|
5044
4838
|
|
|
5045
4839
|
// src/mrl/providers/snowbridge/extrinsic/xcmPallet/xcmPallet.ts
|
|
5046
|
-
var
|
|
4840
|
+
var pallet7 = "xcmPallet";
|
|
5047
4841
|
function xcmPallet2() {
|
|
5048
4842
|
return {
|
|
5049
4843
|
transferAssets: () => {
|
|
@@ -5053,13 +4847,13 @@ function xcmPallet2() {
|
|
|
5053
4847
|
globalConsensus: () => ({
|
|
5054
4848
|
provider,
|
|
5055
4849
|
build: ({ asset, destination, destinationAddress }) => {
|
|
5056
|
-
if (!
|
|
4850
|
+
if (!EvmChain2.is(destination)) {
|
|
5057
4851
|
throw new Error(
|
|
5058
4852
|
"Destination must be an EVM chain for globalConsensus function"
|
|
5059
4853
|
);
|
|
5060
4854
|
}
|
|
5061
4855
|
return new ExtrinsicConfig({
|
|
5062
|
-
module:
|
|
4856
|
+
module: pallet7,
|
|
5063
4857
|
func,
|
|
5064
4858
|
getArgs: (extrinsicFunction) => {
|
|
5065
4859
|
const assets3 = [
|
|
@@ -5092,14 +4886,14 @@ function xcmPallet2() {
|
|
|
5092
4886
|
globalConsensusErc20: () => ({
|
|
5093
4887
|
provider,
|
|
5094
4888
|
build: ({ asset, destination, destinationAddress }) => {
|
|
5095
|
-
if (!
|
|
4889
|
+
if (!EvmChain2.is(destination)) {
|
|
5096
4890
|
throw new Error(
|
|
5097
4891
|
"Destination must be an EVM chain for globalConsensusErc20 function"
|
|
5098
4892
|
);
|
|
5099
4893
|
}
|
|
5100
4894
|
const assetInDestination = destination.getChainAsset(asset);
|
|
5101
4895
|
return new ExtrinsicConfig({
|
|
5102
|
-
module:
|
|
4896
|
+
module: pallet7,
|
|
5103
4897
|
func,
|
|
5104
4898
|
getArgs: (extrinsicFunction) => {
|
|
5105
4899
|
const assets3 = [
|
|
@@ -5144,7 +4938,7 @@ function xcmPallet2() {
|
|
|
5144
4938
|
|
|
5145
4939
|
// src/mrl/providers/snowbridge/extrinsic/index.ts
|
|
5146
4940
|
function extrinsic() {
|
|
5147
|
-
return { ethereumTokenTransfers, xcmPallet: xcmPallet2
|
|
4941
|
+
return { ethereumTokenTransfers, xcmPallet: xcmPallet2 };
|
|
5148
4942
|
}
|
|
5149
4943
|
|
|
5150
4944
|
// src/mrl/providers/snowbridge/index.ts
|
|
@@ -5171,7 +4965,7 @@ import {
|
|
|
5171
4965
|
import { getMultilocationDerivedAddresses } from "@moonbeam-network/xcm-utils";
|
|
5172
4966
|
var BUY_EXECUTION_FEE = 100000000000000000n;
|
|
5173
4967
|
var CROSS_CHAIN_FEE = 100000000000000000n;
|
|
5174
|
-
function
|
|
4968
|
+
function polkadotXcm2() {
|
|
5175
4969
|
const provider = "wormhole" /* Wormhole */;
|
|
5176
4970
|
return {
|
|
5177
4971
|
send: () => ({
|
|
@@ -6124,7 +5918,7 @@ var WormholeConfig = class _WormholeConfig {
|
|
|
6124
5918
|
};
|
|
6125
5919
|
|
|
6126
5920
|
// src/mrl/providers/wormhole/wormhole/wormhole.ts
|
|
6127
|
-
import { EvmChain as
|
|
5921
|
+
import { EvmChain as EvmChain3, EvmParachain as EvmParachain7, Parachain as Parachain3 } from "@moonbeam-network/xcm-types";
|
|
6128
5922
|
import { getMultilocationDerivedAddresses as getMultilocationDerivedAddresses3 } from "@moonbeam-network/xcm-utils";
|
|
6129
5923
|
import { evmToAddress as evmToAddress4 } from "@polkadot/util-crypto/address";
|
|
6130
5924
|
import { Wormhole as Wormhole2 } from "@wormhole-foundation/sdk-connect";
|
|
@@ -6165,7 +5959,7 @@ function wormhole() {
|
|
|
6165
5959
|
}) => {
|
|
6166
5960
|
const isSourceParachain = Parachain3.is(source);
|
|
6167
5961
|
const isDestinationMoonChain = destination.isEqual(moonChain);
|
|
6168
|
-
const isDestinationEvmChain =
|
|
5962
|
+
const isDestinationEvmChain = EvmChain3.is(destination);
|
|
6169
5963
|
const isNativeAsset = asset.isSame(
|
|
6170
5964
|
isDestinationEvmChain ? moonChain.nativeAsset : source.nativeAsset
|
|
6171
5965
|
);
|
|
@@ -7819,7 +7613,7 @@ function ethereumXcm() {
|
|
|
7819
7613
|
|
|
7820
7614
|
// src/mrl/providers/wormhole/extrinsic/index.ts
|
|
7821
7615
|
function extrinsic2() {
|
|
7822
|
-
return { ethereumXcm, polkadotXcm:
|
|
7616
|
+
return { ethereumXcm, polkadotXcm: polkadotXcm2 };
|
|
7823
7617
|
}
|
|
7824
7618
|
|
|
7825
7619
|
// src/mrl/providers/wormhole/index.ts
|