Skip to content

Commit

Permalink
Add Nodle and Unique
Browse files Browse the repository at this point in the history
  • Loading branch information
green-jay committed Dec 31, 2023
1 parent d5721b5 commit 7991304
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/xcm-cfg/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ export const pha = new Asset({
originSymbol: 'PHA',
});

export const nodl = new Asset({
key: 'nodl',
originSymbol: 'NODL',
});

export const unq = new Asset({
key: 'unq',
originSymbol: 'UNQ',
});

export const assets: Asset[] = [
aca,
astr,
Expand All @@ -96,7 +106,9 @@ export const assets: Asset[] = [
hdx,
ibtc,
intr,
nodl,
sub,
unq,
usdc,
usdc_mwh,
usdt,
Expand Down
48 changes: 48 additions & 0 deletions packages/xcm-cfg/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import {
hdx,
ibtc,
intr,
nodl,
sub,
unq,
usdc,
usdc_mwh,
usdt,
Expand Down Expand Up @@ -201,11 +203,21 @@ export const hydraDX = new Parachain({
id: 17,
decimals: 10,
},
{
asset: nodl,
id: 26,
decimals: 11,
},
{
asset: sub,
id: 24,
decimals: 10,
},
{
asset: unq,
id: 25,
decimals: 18,
},
{
asset: usdc,
id: 1337,
Expand Down Expand Up @@ -410,6 +422,42 @@ export const phala = new Parachain({
ws: 'wss://api.phala.network/ws',
});

export const nodle = new Parachain({
assetsData: [
// NOTE: no meta for native token
{
asset: nodl,
metadataId: 99999999,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
'0x97da7ede98d7bad4e36b4d734b6055425a3be036da2a332ea5a7037656427a21',
key: 'nodle',
name: 'Nodle',
parachainId: 2026,
ss58Format: 37,
ws: 'wss://eden-rpc.dwellir.com',
});

export const unique = new Parachain({
assetsData: [
// NOTE: no meta for native token
{
asset: unq,
metadataId: 99999999,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
'0x84322d9cddbf35088f1e54e9a85c967a41a56a4f43445768125e61af166c7d31',
key: 'unique',
name: 'Unique network',
parachainId: 2037,
ss58Format: 7391,
ws: 'wss://unique-rpc.dwellir.com',
});

export const chains: AnyChain[] = [
acala,
assetHub,
Expand Down
42 changes: 42 additions & 0 deletions packages/xcm-cfg/src/configs/hydraDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import {
hdx,
ibtc,
intr,
nodl,
pha,
sub,
unq,
usdc,
usdc_mwh,
usdt,
Expand All @@ -42,8 +44,10 @@ import {
hydraDX,
interlay,
moonbeam,
nodle,
phala,
subsocial,
unique,
zeitgeist,
} from '../chains';
import { ExtrinsicBuilderV2 } from '../builders';
Expand Down Expand Up @@ -408,6 +412,42 @@ const toPhala: AssetConfig[] = [
}),
];

const toNodle: AssetConfig[] = [
new AssetConfig({
asset: nodl,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: nodle,
destinationFee: {
amount: 0.0018,
asset: nodl,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toUnique: AssetConfig[] = [
new AssetConfig({
asset: unq,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: unique,
destinationFee: {
amount: 0.000078,
asset: unq,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

export const hydraDxConfig = new ChainConfig({
assets: [
...toAcala,
Expand All @@ -417,8 +457,10 @@ export const hydraDxConfig = new ChainConfig({
...toCentrifuge,
...toInterlay,
...toMoonbeam,
...toNodle,
...toPolkadot,
...toSubsocial,
...toUnique,
...toZeitgeist,
...toPhala,
],
Expand Down
4 changes: 4 additions & 0 deletions packages/xcm-cfg/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import { centrifugeConfig } from './centrifuge';
import { hydraDxConfig } from './hydraDX';
import { interlayConfig } from './interlay';
import { moonbeamConfig } from './moonbeam';
import { nodleConfig } from './nodle';
import { polkadotConfig } from './polkadot';
import { subsocialConfig } from './subsocial';
import { uniqueConfig } from './unique';
import { zeitgeistConfig } from './zeitgeist';
import { phalaConfig } from './phala';

Expand All @@ -22,8 +24,10 @@ export const chainsConfig: ChainConfig[] = [
hydraDxConfig,
interlayConfig,
moonbeamConfig,
nodleConfig,
polkadotConfig,
subsocialConfig,
uniqueConfig,
zeitgeistConfig,
phalaConfig,
];
Expand Down
24 changes: 24 additions & 0 deletions packages/xcm-cfg/src/configs/nodle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {
BalanceBuilder,
ExtrinsicBuilder,
} from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';
import { nodl } from 'assets';
import { hydraDX, nodle } from '../chains';

export const nodleConfig = new ChainConfig({
assets: [
new AssetConfig({
asset: nodl,
balance: BalanceBuilder().substrate().system().account(),
destination: hydraDX,
destinationFee: {
amount: 1.8,
asset: nodl,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilder().xTransfer().transfer().here(),
}),
],
chain: nodle,
});
24 changes: 24 additions & 0 deletions packages/xcm-cfg/src/configs/unique.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {
BalanceBuilder,
ExtrinsicBuilder,
} from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';
import { unq } from 'assets';
import { hydraDX, unique } from '../chains';

export const uniqueConfig = new ChainConfig({
assets: [
new AssetConfig({
asset: unq,
balance: BalanceBuilder().substrate().system().account(),
destination: hydraDX,
destinationFee: {
amount: 1.8,
asset: unq,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilder().xTransfer().transfer().here(),
}),
],
chain: unique,
});

0 comments on commit 7991304

Please sign in to comment.