@moonbeam-network/xcm-builder 1.0.0-dev.185 → 1.0.0-dev.187
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 +3 -0
- package/build/index.mjs +82 -9
- package/build/index.mjs.map +1 -1
- package/package.json +5 -5
package/build/index.d.ts
CHANGED
|
@@ -376,6 +376,9 @@ declare function polkadotXcm$1(): {
|
|
|
376
376
|
here: () => ExtrinsicConfigBuilder;
|
|
377
377
|
globalConsensusEthereum: () => ExtrinsicConfigBuilder;
|
|
378
378
|
};
|
|
379
|
+
transferAssetsToEcosystem: () => {
|
|
380
|
+
byGenesis: () => ExtrinsicConfigBuilder;
|
|
381
|
+
};
|
|
379
382
|
};
|
|
380
383
|
|
|
381
384
|
declare function xTokens(): {
|
package/build/index.mjs
CHANGED
|
@@ -1489,6 +1489,7 @@ function getPolkadotXcmExtrinsicArgs({
|
|
|
1489
1489
|
}) {
|
|
1490
1490
|
const version = getExtrinsicArgumentVersion(func);
|
|
1491
1491
|
return [
|
|
1492
|
+
// dest
|
|
1492
1493
|
{
|
|
1493
1494
|
[version]: normalizeX1(version, {
|
|
1494
1495
|
parents,
|
|
@@ -1499,6 +1500,7 @@ function getPolkadotXcmExtrinsicArgs({
|
|
|
1499
1500
|
}
|
|
1500
1501
|
})
|
|
1501
1502
|
},
|
|
1503
|
+
// beneficiary
|
|
1502
1504
|
{
|
|
1503
1505
|
[version]: normalizeX1(version, {
|
|
1504
1506
|
parents: 0,
|
|
@@ -1507,10 +1509,13 @@ function getPolkadotXcmExtrinsicArgs({
|
|
|
1507
1509
|
}
|
|
1508
1510
|
})
|
|
1509
1511
|
},
|
|
1512
|
+
// assets
|
|
1510
1513
|
{
|
|
1511
1514
|
[version]: asset
|
|
1512
1515
|
},
|
|
1516
|
+
// feeAssetItem
|
|
1513
1517
|
feeIndex,
|
|
1518
|
+
// weightLimit
|
|
1514
1519
|
"Unlimited"
|
|
1515
1520
|
];
|
|
1516
1521
|
}
|
|
@@ -1909,6 +1914,76 @@ function polkadotXcm() {
|
|
|
1909
1914
|
})
|
|
1910
1915
|
})
|
|
1911
1916
|
};
|
|
1917
|
+
},
|
|
1918
|
+
transferAssetsToEcosystem: () => {
|
|
1919
|
+
const func = "transferAssets";
|
|
1920
|
+
return {
|
|
1921
|
+
byGenesis: () => ({
|
|
1922
|
+
build: (params) => {
|
|
1923
|
+
return new ExtrinsicConfig({
|
|
1924
|
+
module: pallet2,
|
|
1925
|
+
func,
|
|
1926
|
+
getArgs: (extrinsicFunction) => {
|
|
1927
|
+
const version = getExtrinsicArgumentVersion(extrinsicFunction);
|
|
1928
|
+
const genesis = params.destination.key === "moonbase-stage" ? "0x64d25a5d58d8d330b8804103e6452be6258ebfd7c4f4c1294835130e75628401" : "0xe1ea3ab1d46ba8f4898b6b4b9c54ffc05282d299f89e84bd0fd08067758c9443";
|
|
1929
|
+
return [
|
|
1930
|
+
// dest
|
|
1931
|
+
{
|
|
1932
|
+
[version]: normalizeX1(version, {
|
|
1933
|
+
parents: 2,
|
|
1934
|
+
interior: {
|
|
1935
|
+
X2: [
|
|
1936
|
+
{
|
|
1937
|
+
GlobalConsensus: {
|
|
1938
|
+
ByGenesis: genesis
|
|
1939
|
+
// Relay of destination ecosystem
|
|
1940
|
+
}
|
|
1941
|
+
},
|
|
1942
|
+
{
|
|
1943
|
+
Parachain: params.destination.parachainId
|
|
1944
|
+
}
|
|
1945
|
+
]
|
|
1946
|
+
}
|
|
1947
|
+
})
|
|
1948
|
+
},
|
|
1949
|
+
// beneficiary
|
|
1950
|
+
{
|
|
1951
|
+
[version]: normalizeX1(version, {
|
|
1952
|
+
parents: 0,
|
|
1953
|
+
interior: {
|
|
1954
|
+
X1: getExtrinsicAccount(params.destinationAddress)
|
|
1955
|
+
}
|
|
1956
|
+
})
|
|
1957
|
+
},
|
|
1958
|
+
// assets
|
|
1959
|
+
{
|
|
1960
|
+
[version]: {
|
|
1961
|
+
id: normalizeConcrete(
|
|
1962
|
+
version,
|
|
1963
|
+
normalizeX1(version, {
|
|
1964
|
+
parents: 0,
|
|
1965
|
+
interior: {
|
|
1966
|
+
X1: {
|
|
1967
|
+
PalletInstance: params.asset.getAssetPalletInstance()
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
})
|
|
1971
|
+
),
|
|
1972
|
+
fun: {
|
|
1973
|
+
Fungible: params.asset.amount
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
},
|
|
1977
|
+
// feeAssetItem
|
|
1978
|
+
0,
|
|
1979
|
+
// weightLimit
|
|
1980
|
+
"Unlimited"
|
|
1981
|
+
];
|
|
1982
|
+
}
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
})
|
|
1986
|
+
};
|
|
1912
1987
|
}
|
|
1913
1988
|
};
|
|
1914
1989
|
}
|
|
@@ -3639,7 +3714,7 @@ function Gmp() {
|
|
|
3639
3714
|
import { convertAddressTo32Bytes } from "@moonbeam-network/xcm-utils";
|
|
3640
3715
|
|
|
3641
3716
|
// src/mrl/providers/wormhole/wormhole/wormhole.ts
|
|
3642
|
-
import { EvmChain, EvmParachain as
|
|
3717
|
+
import { EvmChain, EvmParachain as EvmParachain4, Parachain as Parachain3 } from "@moonbeam-network/xcm-types";
|
|
3643
3718
|
import { getMultilocationDerivedAddresses as getMultilocationDerivedAddresses3 } from "@moonbeam-network/xcm-utils";
|
|
3644
3719
|
import { evmToAddress as evmToAddress4 } from "@polkadot/util-crypto/address";
|
|
3645
3720
|
import { Wormhole as Wormhole2 } from "@wormhole-foundation/sdk-connect";
|
|
@@ -3658,22 +3733,20 @@ var WormholeConfig = class _WormholeConfig {
|
|
|
3658
3733
|
};
|
|
3659
3734
|
|
|
3660
3735
|
// src/mrl/providers/wormhole/wormhole/wormholeFactory.ts
|
|
3736
|
+
import { EvmParachain as EvmParachain3 } from "@moonbeam-network/xcm-types";
|
|
3661
3737
|
import { Wormhole } from "@wormhole-foundation/sdk-connect";
|
|
3662
3738
|
import { EvmPlatform } from "@wormhole-foundation/sdk-evm";
|
|
3663
3739
|
function wormholeFactory(chain) {
|
|
3664
3740
|
return new Wormhole(
|
|
3665
3741
|
chain.isTestChain ? "Testnet" : "Mainnet",
|
|
3666
3742
|
[EvmPlatform],
|
|
3667
|
-
{
|
|
3743
|
+
EvmParachain3.isAnyEvmChain(chain) && chain.wh ? {
|
|
3668
3744
|
chains: {
|
|
3669
|
-
|
|
3670
|
-
rpc:
|
|
3671
|
-
},
|
|
3672
|
-
Moonbeam: {
|
|
3673
|
-
rpc: "https://rpc.api.moonbeam.network"
|
|
3745
|
+
[chain.wh.name]: {
|
|
3746
|
+
rpc: chain.rpc
|
|
3674
3747
|
}
|
|
3675
3748
|
}
|
|
3676
|
-
}
|
|
3749
|
+
} : void 0
|
|
3677
3750
|
);
|
|
3678
3751
|
}
|
|
3679
3752
|
|
|
@@ -3738,7 +3811,7 @@ function getPayload({
|
|
|
3738
3811
|
destination,
|
|
3739
3812
|
destinationAddress
|
|
3740
3813
|
}) {
|
|
3741
|
-
if (!
|
|
3814
|
+
if (!EvmParachain4.isAnyParachain(destination)) {
|
|
3742
3815
|
throw new Error(
|
|
3743
3816
|
`Destination ${destination.name} is not a Parachain or EvmParachain`
|
|
3744
3817
|
);
|