@moonbeam-network/xcm-builder 1.0.0-dev.189 → 1.0.0-dev.190
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 +2 -1
- package/build/index.mjs +78 -1
- package/build/index.mjs.map +1 -1
- package/package.json +3 -3
package/build/index.d.ts
CHANGED
|
@@ -377,7 +377,8 @@ declare function polkadotXcm$1(): {
|
|
|
377
377
|
globalConsensusEthereum: () => ExtrinsicConfigBuilder;
|
|
378
378
|
};
|
|
379
379
|
transferAssetsToEcosystem: () => {
|
|
380
|
-
|
|
380
|
+
X1: () => ExtrinsicConfigBuilder;
|
|
381
|
+
X3: () => ExtrinsicConfigBuilder;
|
|
381
382
|
};
|
|
382
383
|
};
|
|
383
384
|
|
package/build/index.mjs
CHANGED
|
@@ -1918,7 +1918,7 @@ function polkadotXcm() {
|
|
|
1918
1918
|
transferAssetsToEcosystem: () => {
|
|
1919
1919
|
const func = "transferAssets";
|
|
1920
1920
|
return {
|
|
1921
|
-
|
|
1921
|
+
X1: () => ({
|
|
1922
1922
|
build: (params) => {
|
|
1923
1923
|
return new ExtrinsicConfig({
|
|
1924
1924
|
module: pallet2,
|
|
@@ -1984,6 +1984,83 @@ function polkadotXcm() {
|
|
|
1984
1984
|
}
|
|
1985
1985
|
});
|
|
1986
1986
|
}
|
|
1987
|
+
}),
|
|
1988
|
+
X3: () => ({
|
|
1989
|
+
build: (params) => {
|
|
1990
|
+
const assetInDestination = params.destination.getChainAsset(
|
|
1991
|
+
params.asset
|
|
1992
|
+
);
|
|
1993
|
+
return new ExtrinsicConfig({
|
|
1994
|
+
module: pallet2,
|
|
1995
|
+
func,
|
|
1996
|
+
getArgs: (extrinsicFunction) => {
|
|
1997
|
+
const version = getExtrinsicArgumentVersion(extrinsicFunction);
|
|
1998
|
+
const genesis = params.destination.key === "moonbase-stage" ? "0x64d25a5d58d8d330b8804103e6452be6258ebfd7c4f4c1294835130e75628401" : "0xe1ea3ab1d46ba8f4898b6b4b9c54ffc05282d299f89e84bd0fd08067758c9443";
|
|
1999
|
+
return [
|
|
2000
|
+
// dest
|
|
2001
|
+
{
|
|
2002
|
+
[version]: normalizeX1(version, {
|
|
2003
|
+
parents: 2,
|
|
2004
|
+
interior: {
|
|
2005
|
+
X2: [
|
|
2006
|
+
{
|
|
2007
|
+
GlobalConsensus: {
|
|
2008
|
+
ByGenesis: genesis
|
|
2009
|
+
// Relay of destination ecosystem
|
|
2010
|
+
}
|
|
2011
|
+
},
|
|
2012
|
+
{
|
|
2013
|
+
Parachain: params.destination.parachainId
|
|
2014
|
+
}
|
|
2015
|
+
]
|
|
2016
|
+
}
|
|
2017
|
+
})
|
|
2018
|
+
},
|
|
2019
|
+
// beneficiary
|
|
2020
|
+
{
|
|
2021
|
+
[version]: normalizeX1(version, {
|
|
2022
|
+
parents: 0,
|
|
2023
|
+
interior: {
|
|
2024
|
+
X1: getExtrinsicAccount(params.destinationAddress)
|
|
2025
|
+
}
|
|
2026
|
+
})
|
|
2027
|
+
},
|
|
2028
|
+
// assets
|
|
2029
|
+
{
|
|
2030
|
+
[version]: [
|
|
2031
|
+
{
|
|
2032
|
+
id: normalizeConcrete(version, {
|
|
2033
|
+
parents: 2,
|
|
2034
|
+
interior: {
|
|
2035
|
+
X3: [
|
|
2036
|
+
{
|
|
2037
|
+
GlobalConsensus: {
|
|
2038
|
+
ByGenesis: genesis
|
|
2039
|
+
}
|
|
2040
|
+
},
|
|
2041
|
+
{
|
|
2042
|
+
Parachain: params.destination.parachainId
|
|
2043
|
+
},
|
|
2044
|
+
{
|
|
2045
|
+
PalletInstance: assetInDestination.getAssetPalletInstance()
|
|
2046
|
+
}
|
|
2047
|
+
]
|
|
2048
|
+
}
|
|
2049
|
+
}),
|
|
2050
|
+
fun: {
|
|
2051
|
+
Fungible: params.asset.amount
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
]
|
|
2055
|
+
},
|
|
2056
|
+
// feeAssetItem
|
|
2057
|
+
0,
|
|
2058
|
+
// weightLimit
|
|
2059
|
+
"Unlimited"
|
|
2060
|
+
];
|
|
2061
|
+
}
|
|
2062
|
+
});
|
|
2063
|
+
}
|
|
1987
2064
|
})
|
|
1988
2065
|
};
|
|
1989
2066
|
}
|