Skip to content

Commit

Permalink
TEER (Integritee) support
Browse files Browse the repository at this point in the history
  • Loading branch information
nohaapav committed Mar 12, 2024
1 parent 21eff79 commit 8e8620e
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 4 deletions.
3 changes: 3 additions & 0 deletions packages/xcm-cfg/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
intr,
kar,
ksm,
teer,
usdc,
usdt,
vdot,
Expand All @@ -33,6 +34,7 @@ export {
ibtc,
kar,
ksm,
teer,
usdc,
usdt,
vdot,
Expand Down Expand Up @@ -134,6 +136,7 @@ export const assets: Asset[] = [
nodl,
pha,
sub,
teer,
tnkr,
unq,
usdc,
Expand Down
16 changes: 14 additions & 2 deletions packages/xcm-cfg/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
ksm,
pha,
nodl,
teer,
tnkr,
sub,
unq,
Expand Down Expand Up @@ -593,6 +594,11 @@ export const basilisk = new Parachain({
palletInstance: 50,
decimals: 6,
},
{
asset: teer,
id: 17,
decimals: 12,
},
{
asset: tnkr,
id: 6,
Expand Down Expand Up @@ -649,14 +655,20 @@ export const karura = new Parachain({
});

export const integritee = new Parachain({
assetsData: [
{
asset: teer,
id: 0,
},
],
ecosystem: Ecosystem.Kusama,
genesisHash:
'0xcdedc8eadbfa209d3f207bba541e57c3c58a667b05a2e1d1e86353c9000758da',
key: 'integritee',
name: 'Integritee Network',
name: 'Integritee',
parachainId: 2015,
ss58Format: 13,
ws: 'wss://kusama.api.integritee.network/rpc',
ws: 'wss://kusama.api.integritee.network',
});

export const kusama = new Parachain({
Expand Down
27 changes: 25 additions & 2 deletions packages/xcm-cfg/src/configs/kusama/basilisk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import {
BalanceBuilder,
ExtrinsicBuilder,
} from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';
import {
AssetConfig,
ChainConfig,
integritee,
} from '@moonbeam-network/xcm-config';

import { bsx, ksm, tnkr, usdt, xrt } from '../../assets';
import { bsx, ksm, teer, tnkr, usdt, xrt } from '../../assets';
import {
basilisk,
karura,
Expand Down Expand Up @@ -85,6 +89,24 @@ const toKusama: AssetConfig[] = [
}),
];

const toIntegritee: AssetConfig[] = [
new AssetConfig({
asset: teer,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: integritee,
destinationFee: {
amount: 0.000004,
asset: teer,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transfer(),
fee: {
asset: bsx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toRobonomics: AssetConfig[] = [
new AssetConfig({
asset: xrt,
Expand Down Expand Up @@ -126,6 +148,7 @@ export const basiliskConfig = new ChainConfig({
...toAssetHub,
...toKarura,
...toKusama,
...toIntegritee,
...toRobonomics,
...toTinkernet,
],
Expand Down
2 changes: 2 additions & 0 deletions packages/xcm-cfg/src/configs/kusama/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ChainConfig } from '@moonbeam-network/xcm-config';

import { assetHubConfig } from './assethub';
import { basiliskConfig } from './basilisk';
import { integriteeConfig } from './integritee';
import { karuraConfig } from './karura';
import { kusamaConfig } from './kusama';
import { tinkernetConfig } from './tinkernet';
Expand All @@ -10,6 +11,7 @@ import { robonomicsConfig } from './robonomics';
export const kusamaChainsConfig: ChainConfig[] = [
assetHubConfig,
basiliskConfig,
integriteeConfig,
karuraConfig,
kusamaConfig,
tinkernetConfig,
Expand Down
24 changes: 24 additions & 0 deletions packages/xcm-cfg/src/configs/kusama/integritee.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 { teer } from '../../assets';
import { basilisk, integritee } from '../../chains';

export const integriteeConfig = new ChainConfig({
assets: [
new AssetConfig({
asset: teer,
balance: BalanceBuilder().substrate().system().account(),
destination: basilisk,
destinationFee: {
amount: 0.00275,
asset: teer,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
],
chain: integritee,
});

0 comments on commit 8e8620e

Please sign in to comment.