Skip to content

Commit

Permalink
Astar bifrost centrifuge
Browse files Browse the repository at this point in the history
  • Loading branch information
green-jay committed Oct 24, 2024
1 parent 49acafb commit c558a15
Show file tree
Hide file tree
Showing 5 changed files with 484 additions and 4 deletions.
70 changes: 70 additions & 0 deletions packages/xcm-cfg/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,55 @@ export const astar = new Parachain({
id: '4294969280',
metadataId: 0,
},
{
asset: bnc,
decimals: 12,
id: '18446744073709551623',
metadataId: 0,
min: 0.01,
},
{
asset: glmr,
decimals: 18,
id: '18446744073709551619',
metadataId: 0,
min: 0.01,
},
{
asset: ibtc,
decimals: 8,
id: '18446744073709551620',
metadataId: 0,
min: 0.000001,
},
{
asset: intr,
decimals: 10,
id: '18446744073709551621',
metadataId: 0,
min: 0.01,
},
{
asset: pha,
decimals: 12,
id: '18446744073709551622',
metadataId: 0,
min: 0.01,
},
{
asset: vdot,
decimals: 10,
id: '18446744073709551624',
metadataId: 0,
min: 0.01,
},
{
asset: vastr,
decimals: 18,
id: '18446744073709551632',
metadataId: 0,
min: 0.01,
},
],
ecosystem: Ecosystem.Polkadot,
explorer: 'https://astar.subscan.io',
Expand Down Expand Up @@ -344,6 +393,13 @@ export const bifrost = new Parachain({
metadataId: { Token2: 1 },
min: 0.00001,
},
{
asset: ibtc,
decimals: 8,
id: { Token2: 6 },
metadataId: { Token2: 6 },
min: 0.000001,
},
],
ecosystem: Ecosystem.Polkadot,
explorer: 'https://bifrost.subscan.io',
Expand All @@ -362,6 +418,20 @@ export const centrifuge = new Parachain({
asset: cfg,
id: 'Native',
},
{
asset: dot,
decimals: 10,
id: { ForeignAsset: 5 },
metadataId: { ForeignAsset: 5 },
min: 0.0001,
},
{
asset: glmr,
decimals: 18,
id: { ForeignAsset: 4 },
metadataId: { ForeignAsset: 4 },
min: 0.001,
},
],
ecosystem: Ecosystem.Polkadot,
explorer: 'https://centrifuge.subscan.io',
Expand Down
158 changes: 156 additions & 2 deletions packages/xcm-cfg/src/configs/polkadot/astar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AssetRoute, ChainRoutes } from '@galacticcouncil/xcm-core';

import { astr, dot } from '../../assets';
import { astr, bnc, dot, glmr, ibtc, intr, pha, vastr, vdot } from '../../assets';
import { astar, hydration } from '../../chains';
import { BalanceBuilder, ExtrinsicBuilder } from '../../builders';

Expand All @@ -26,7 +26,7 @@ const toHydration: AssetRoute[] = [
new AssetRoute({
source: {
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
Expand All @@ -45,6 +45,160 @@ const toHydration: AssetRoute[] = [
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: bnc,
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().assets().account(),
},
},
destination: {
chain: hydration,
asset: bnc,
fee: {
amount: 0.1,
asset: bnc,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: glmr,
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().assets().account(),
},
},
destination: {
chain: hydration,
asset: glmr,
fee: {
amount: 0.04,
asset: glmr,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: ibtc,
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().assets().account(),
},
},
destination: {
chain: hydration,
asset: ibtc,
fee: {
amount: 0.04,
asset: ibtc,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: intr,
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().assets().account(),
},
},
destination: {
chain: hydration,
asset: intr,
fee: {
amount: 0.2,
asset: intr,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: pha,
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().assets().account(),
},
},
destination: {
chain: hydration,
asset: pha,
fee: {
amount: 0.3,
asset: pha,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: vdot,
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().assets().account(),
},
},
destination: {
chain: hydration,
asset: vdot,
fee: {
amount: 0.0004,
asset: vdot,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: vastr,
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().assets().account(),
},
},
destination: {
chain: hydration,
asset: vastr,
fee: {
amount: 0.025,
asset: vastr,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
];

export const astarConfig = new ChainRoutes({
Expand Down
24 changes: 23 additions & 1 deletion packages/xcm-cfg/src/configs/polkadot/bifrost.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AssetRoute, ChainRoutes } from '@galacticcouncil/xcm-core';

import { bnc, dot, pink, usdc, usdt, vdot, vastr, astr, glmr } from '../../assets';
import { bnc, dot, pink, usdc, usdt, vdot, vastr, astr, glmr, ibtc } from '../../assets';
import { assetHub, bifrost, hydration, polkadot } from '../../chains';
import { BalanceBuilder, ExtrinsicBuilder } from '../../builders';

Expand Down Expand Up @@ -133,6 +133,28 @@ const toHydration: AssetRoute[] = [
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: ibtc,
balance: BalanceBuilder().substrate().tokens().accounts(),
fee: {
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().tokens().accounts(),
},
},
destination: {
chain: hydration,
asset: ibtc,
fee: {
amount: 0.000002,
asset: ibtc,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
];

const toPolkadot: AssetRoute[] = [
Expand Down
46 changes: 45 additions & 1 deletion packages/xcm-cfg/src/configs/polkadot/centrifuge.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AssetRoute, ChainRoutes } from '@galacticcouncil/xcm-core';

import { cfg } from '../../assets';
import { cfg, dot, glmr } from '../../assets';
import { centrifuge, hydration } from '../../chains';
import { BalanceBuilder, ExtrinsicBuilder } from '../../builders';

Expand All @@ -23,6 +23,50 @@ const toHydration: AssetRoute[] = [
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: dot,
balance: BalanceBuilder().substrate().ormlTokens().accounts(),
fee: {
asset: cfg,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().ormlTokens().accounts(),
},
},
destination: {
chain: hydration,
asset: dot,
fee: {
amount: 0.1,
asset: dot,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetRoute({
source: {
asset: glmr,
balance: BalanceBuilder().substrate().ormlTokens().accounts(),
fee: {
asset: cfg,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().ormlTokens().accounts(),
},
},
destination: {
chain: hydration,
asset: glmr,
fee: {
amount: 0.05,
asset: glmr,
},
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
];

export const centrifugeConfig = new ChainRoutes({
Expand Down
Loading

0 comments on commit c558a15

Please sign in to comment.