Skip to content

Commit

Permalink
Robonomics xcXRT integration with Moonriver (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello authored Nov 22, 2022
1 parent afb7b73 commit 15eaf5e
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/config/src/config/moonriver/assets/xrt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { AssetSymbol, ChainKey } from '../../../constants';
import { PolkadotXcmExtrinsicSuccessEvent } from '../../../extrinsic';
import {
assets,
balance,
chains,
extrinsic,
withdraw,
} from '../moonriver.common';
import { MoonriverXcmConfig } from '../moonriver.interfaces';

const asset = assets[AssetSymbol.XRT];
const origin = chains[ChainKey.Robonomics];

export const XRT: MoonriverXcmConfig = {
asset,
origin,
deposit: {
[origin.key]: {
source: origin,
balance: balance.system(),
extrinsic: extrinsic
.polkadotXcm()
.limitedReserveTransferAssets()
.successEvent(PolkadotXcmExtrinsicSuccessEvent.Attempted)
.origin(origin)
.V1()
.here(),
},
},
withdraw: {
[origin.key]: withdraw.xTokens({
balance: balance.system(),
destination: origin,
feePerWeight: 0.000008,
}),
},
};
6 changes: 6 additions & 0 deletions packages/config/src/config/moonriver/moonriver.assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const MOONRIVER_ASSETS = <const>[
AssetSymbol.SDN,
AssetSymbol.TEER,
AssetSymbol.USDT,
AssetSymbol.XRT,
];

export const MOONRIVER_ASSETS_MAP: AssetsMap<MoonriverAssets> = {
Expand Down Expand Up @@ -115,4 +116,9 @@ export const MOONRIVER_ASSETS_MAP: AssetsMap<MoonriverAssets> = {
[ChainKey.Statemine]: 1984,
},
},
[AssetSymbol.XRT]: {
id: '108036400430056508975016746969135344601',
erc20Id: '0xffffffff51470dca3dbe535bd2880a9ccdbc6bd9',
originSymbol: AssetSymbol.XRT,
},
};
8 changes: 8 additions & 0 deletions packages/config/src/config/moonriver/moonriver.chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const MOONRIVER_CHAINS = <const>[
ChainKey.Kusama,
ChainKey.Litmus,
ChainKey.Parallel,
ChainKey.Robonomics,
ChainKey.Shiden,
ChainKey.Statemine,
];
Expand Down Expand Up @@ -102,6 +103,13 @@ export const MOONRIVER_CHAINS_MAP: ChainsMap<MoonriverChains> = {
parachainId: 2085,
moonAssetId: 113,
},
[ChainKey.Robonomics]: {
key: ChainKey.Robonomics,
name: 'Robonomics',
ws: 'wss://robonomics.api.onfinality.io/public-ws',
weight: 1_000_000_000,
parachainId: 2048,
},
[ChainKey.Shiden]: {
key: ChainKey.Shiden,
name: 'Shiden',
Expand Down
2 changes: 2 additions & 0 deletions packages/config/src/config/moonriver/moonriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { RMRK } from './assets/rmrk';
import { SDN } from './assets/sdn';
import { TEER } from './assets/teer';
import { USDT } from './assets/usdt';
import { XRT } from './assets/xrt';

export const MOONRIVER_CONFIGS: MoonriverXcmConfigs = {
[AssetSymbol.AUSD]: AUSD,
Expand All @@ -37,4 +38,5 @@ export const MOONRIVER_CONFIGS: MoonriverXcmConfigs = {
[AssetSymbol.SDN]: SDN,
[AssetSymbol.TEER]: TEER,
[AssetSymbol.USDT]: USDT,
[AssetSymbol.XRT]: XRT,
};
1 change: 1 addition & 0 deletions packages/config/src/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export enum ChainKey {
ParallelHeiko = 'ParallelHeiko',
Phala = 'Phala',
Polkadot = 'Polkadot',
Robonomics = 'Robonomics',
RobonomicsAlphanet = 'RobonomicsAlphanet',
Shiden = 'Shiden',
Statemine = 'Statemine',
Expand Down

0 comments on commit 15eaf5e

Please sign in to comment.