Skip to content

Commit

Permalink
Crust Shadow + Calamari MOVR integration (#42)
Browse files Browse the repository at this point in the history
* Crust Shadow MOVR integration

* MOVR Calamari integration
  • Loading branch information
mmaurello authored Nov 14, 2022
1 parent f532eeb commit 957a389
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
41 changes: 41 additions & 0 deletions packages/config/src/config/moonriver/assets/movr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ import { MoonriverXcmConfig } from '../moonriver.interfaces';

const asset = assets[AssetSymbol.MOVR];
const bifrost = chains[ChainKey.Bifrost];
const calamari = chains[ChainKey.Calamari];
const crust = chains[ChainKey.CrustShadow];
const karura = chains[ChainKey.Karura];
const khala = chains[ChainKey.Khala];
const parallel = chains[ChainKey.Parallel];
const shiden = chains[ChainKey.Shiden];

const calamariMovrId = getMoonAssetId(calamari);
const crustMovrId = getMoonAssetId(crust);
const karuraMovrId = getMoonAssetId(karura);
const khalaMovrId = getMoonAssetId(khala);
const parallelMovrId = getMoonAssetId(parallel);
Expand All @@ -45,6 +49,32 @@ export const MOVR: MoonriverXcmConfig = {
[XTokensExtrinsicCurrencyTypes.Token]: asset.originSymbol,
}),
},
[calamari.key]: {
source: calamari,
balance: balance.assets(calamariMovrId),
sourceFeeBalance: balance.system(),
extrinsic: extrinsic
.xTokens()
.transfer()
.successEvent(XTokensExtrinsicSuccessEvent.TransferredMultiAssets)
.origin(calamari)
.asset({
[XTokensExtrinsicCurrencyTypes.MantaCurrency]: calamariMovrId,
}),
},
[crust.key]: {
source: crust,
balance: balance.assets(crustMovrId),
sourceFeeBalance: balance.system(),
extrinsic: extrinsic
.xTokens()
.transfer()
.successEvent(XTokensExtrinsicSuccessEvent.TransferredMultiAssets)
.origin(crust)
.asset({
[XTokensExtrinsicCurrencyTypes.OtherReserve]: crustMovrId,
}),
},
[karura.key]: {
source: karura,
balance: balance.tokens(karuraMovrId),
Expand Down Expand Up @@ -99,6 +129,17 @@ export const MOVR: MoonriverXcmConfig = {
destination: bifrost,
feePerWeight: 213_600,
}),
[calamari.key]: withdraw.xTokens({
balance: balance.assets(calamariMovrId),
destination: calamari,
feePerWeight: 50_000,
sourceMinBalance: balance.minAssetPallet(calamariMovrId),
}),
[crust.key]: withdraw.xTokens({
balance: balance.assets(crustMovrId),
destination: crust,
feePerWeight: 50_000,
}),
[karura.key]: withdraw.xTokens({
balance: balance.tokens(karuraMovrId),
destination: karura,
Expand Down
2 changes: 2 additions & 0 deletions packages/config/src/config/moonriver/moonriver.chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ export const MOONRIVER_CHAINS_MAP: ChainsMap<MoonriverChains> = {
ws: 'wss://ws.calamari.systems',
weight: 1_000_000_000,
parachainId: 2084,
moonAssetId: 11,
},
[ChainKey.CrustShadow]: {
key: ChainKey.CrustShadow,
name: 'Crust Shadow',
ws: 'wss://rpc2-shadow.crust.network',
weight: 1_000_000_000,
parachainId: 2012,
moonAssetId: 232263652204149413431520870009560565298n,
},
[ChainKey.Crab]: {
key: ChainKey.Crab,
Expand Down

0 comments on commit 957a389

Please sign in to comment.