Skip to content

Commit

Permalink
xcXRT integration with moonbase (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello authored Oct 28, 2022
1 parent 1d064a1 commit e9bdbfc
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/config/src/config/moonbase/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 '../moonbase.common';
import { MoonbaseXcmConfig } from '../moonbase.interfaces';

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

export const XRT: MoonbaseXcmConfig = {
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/moonbase/moonbase.assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const MOONBASE_ASSETS = <const>[
AssetSymbol.LIT,
AssetSymbol.TT1,
AssetSymbol.UNIT,
AssetSymbol.XRT,
];

export const MOONBASE_ASSETS_MAP: AssetsMap<MoonbaseAssets> = {
Expand Down Expand Up @@ -46,4 +47,9 @@ export const MOONBASE_ASSETS_MAP: AssetsMap<MoonbaseAssets> = {
[ChainKey.StatemineAlphanet]: 2,
},
},
[AssetSymbol.XRT]: {
id: '108036400430056508975016746969135344601',
erc20Id: '0xffffffff51470dca3dbe535bd2880a9ccdbc6bd9',
originSymbol: AssetSymbol.XRT,
},
};
8 changes: 8 additions & 0 deletions packages/config/src/config/moonbase/moonbase.chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const MOONBASE_CHAINS = <const>[
ChainKey.CloverAlphanet,
ChainKey.CrustShadowAlphanet,
ChainKey.LitentryAlphanet,
ChainKey.RobonomicsAlphanet,
ChainKey.StatemineAlphanet,
];

Expand Down Expand Up @@ -41,6 +42,13 @@ export const MOONBASE_CHAINS_MAP: ChainsMap<MoonbaseChains> = {
weight: 1_000_000_000,
parachainId: 2106,
},
[ChainKey.RobonomicsAlphanet]: {
key: ChainKey.RobonomicsAlphanet,
name: 'Robonomics Alphanet',
ws: 'wss://moonriver.rpc.robonomics.network',
weight: 1_000_000_000,
parachainId: 2048,
},
[ChainKey.StatemineAlphanet]: {
key: ChainKey.StatemineAlphanet,
name: 'Statemine Alphanet',
Expand Down
2 changes: 2 additions & 0 deletions packages/config/src/config/moonbase/moonbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DEV } from './assets/dev';
import { LIT } from './assets/lit';
import { TT1 } from './assets/tt1';
import { UNIT } from './assets/unit';
import { XRT } from './assets/xrt';

export const MOONBASE_CONFIGS: MoonbaseXcmConfigs = {
[AssetSymbol.CLV]: CLV,
Expand All @@ -15,4 +16,5 @@ export const MOONBASE_CONFIGS: MoonbaseXcmConfigs = {
[AssetSymbol.LIT]: LIT,
[AssetSymbol.TT1]: TT1,
[AssetSymbol.UNIT]: UNIT,
[AssetSymbol.XRT]: XRT,
};
1 change: 1 addition & 0 deletions packages/config/src/constants/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ export enum AssetSymbol {
TT1 = 'TT1',
UNIT = 'UNIT',
USDT = 'USDT',
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 @@ -58,6 +58,7 @@ export enum ChainKey {
ParallelHeiko = 'ParallelHeiko',
Phala = 'Phala',
Polkadot = 'Polkadot',
RobonomicsAlphanet = 'RobonomicsAlphanet',
Shiden = 'Shiden',
Statemine = 'Statemine',
StatemineAlphanet = 'StatemineAlphanet',
Expand Down

0 comments on commit e9bdbfc

Please sign in to comment.