From 85dc23d2531d4e5c28ee8617ee1e0c98bc5db27f Mon Sep 17 00:00:00 2001 From: green-jay Date: Mon, 21 Oct 2024 10:06:44 +0200 Subject: [PATCH 1/7] ASTR Hydration<>Bifrost --- examples/xcm-transfer/package.json | 6 ++++- examples/xcm-transfer/src/index.ts | 8 +++---- package-lock.json | 3 +++ packages/xcm-cfg/package.json | 4 +++- packages/xcm-cfg/src/chains.ts | 7 ++++++ .../xcm-cfg/src/configs/polkadot/bifrost.ts | 24 ++++++++++++++++++- .../src/configs/polkadot/hydration/index.ts | 19 +++++++++++++++ 7 files changed, 64 insertions(+), 7 deletions(-) diff --git a/examples/xcm-transfer/package.json b/examples/xcm-transfer/package.json index ef9f8d16..dc19274a 100644 --- a/examples/xcm-transfer/package.json +++ b/examples/xcm-transfer/package.json @@ -16,5 +16,9 @@ "@galacticcouncil/xcm-cfg": "^5.0.0", "@galacticcouncil/xcm-sdk": "^6.0.0", "@talismn/connect-wallets": "^1.2.5" - } + }, + "version": "1.0.0", + "author": "", + "license": "ISC", + "description": "" } diff --git a/examples/xcm-transfer/src/index.ts b/examples/xcm-transfer/src/index.ts index dda7b858..a40868a2 100644 --- a/examples/xcm-transfer/src/index.ts +++ b/examples/xcm-transfer/src/index.ts @@ -54,9 +54,9 @@ const wallet = new Wallet({ configureExternal(externals, configService); // Define transfer -const srcChain = configService.getChain('ethereum'); +const srcChain = configService.getChain('bifrost'); const destChain = configService.getChain('hydration'); -const asset = configService.getAsset('eth'); +const asset = configService.getAsset('astr'); const configBuilder = ConfigBuilder(configService); const { sourceChains } = configBuilder.assets().asset(asset); @@ -71,8 +71,8 @@ logDestChains(asset.key, destinationChains); logSrcChains(asset.key, sourceChains); // Define source & dest accounts -const srcAddr = 'INSERT_ADDRESS'; -const destAddr = 'INSERT_ADDRESS'; +const srcAddr = '7NPoMQbiA6trJKkjB35uk96MeJD4PGWkLQLH7k7hXEkZpiba'; +const destAddr = '7NPoMQbiA6trJKkjB35uk96MeJD4PGWkLQLH7k7hXEkZpiba'; // Subscribe source chain token balance const balanceObserver = (balances: AssetAmount[]) => console.log(balances); diff --git a/package-lock.json b/package-lock.json index a0beb7c5..b775844a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,6 +103,8 @@ } }, "examples/xcm-transfer": { + "version": "1.0.0", + "license": "ISC", "dependencies": { "@galacticcouncil/sdk": "^4.2.0", "@galacticcouncil/xcm-cfg": "^5.0.0", @@ -11993,6 +11995,7 @@ "packages/xcm-cfg": { "name": "@galacticcouncil/xcm-cfg", "version": "5.0.1", + "license": "ISC", "dependencies": { "@galacticcouncil/xcm-core": "^5.0.0" } diff --git a/packages/xcm-cfg/package.json b/packages/xcm-cfg/package.json index 41ea9072..fb2abf37 100644 --- a/packages/xcm-cfg/package.json +++ b/packages/xcm-cfg/package.json @@ -32,5 +32,7 @@ }, "dependencies": { "@galacticcouncil/xcm-core": "^5.0.0" - } + }, + "license": "ISC", + "homepage": "https://github.com/galacticcouncil/sdk#readme" } diff --git a/packages/xcm-cfg/src/chains.ts b/packages/xcm-cfg/src/chains.ts index 8176a3ac..d905f0ae 100644 --- a/packages/xcm-cfg/src/chains.ts +++ b/packages/xcm-cfg/src/chains.ts @@ -330,6 +330,13 @@ export const bifrost = new Parachain({ metadataId: 23, palletInstance: 50, }, + { + asset: astr, + decimals: 18, + id: { Token2: 3 }, + metadataId: { Token2: 3 }, + min: 0.01, + }, ], ecosystem: Ecosystem.Polkadot, explorer: 'https://bifrost.subscan.io', diff --git a/packages/xcm-cfg/src/configs/polkadot/bifrost.ts b/packages/xcm-cfg/src/configs/polkadot/bifrost.ts index 6b2faa30..41b28669 100644 --- a/packages/xcm-cfg/src/configs/polkadot/bifrost.ts +++ b/packages/xcm-cfg/src/configs/polkadot/bifrost.ts @@ -1,6 +1,6 @@ import { AssetRoute, ChainRoutes } from '@galacticcouncil/xcm-core'; -import { bnc, dot, pink, usdc, usdt, vdot, vastr } from '../../assets'; +import { bnc, dot, pink, usdc, usdt, vdot, vastr, astr } from '../../assets'; import { assetHub, bifrost, hydration, polkadot } from '../../chains'; import { BalanceBuilder, ExtrinsicBuilder } from '../../builders'; @@ -89,6 +89,28 @@ const toHydration: AssetRoute[] = [ }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), }), + new AssetRoute({ + source: { + asset: astr, + balance: BalanceBuilder().substrate().tokens().accounts(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + destinationFee: { + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + }, + destination: { + chain: hydration, + asset: astr, + fee: { + amount: 0.01, + asset: astr, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ]; const toPolkadot: AssetRoute[] = [ diff --git a/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts b/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts index 77a114fc..bce02985 100644 --- a/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts +++ b/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts @@ -338,6 +338,25 @@ const toBifrost: AssetRoute[] = [ }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), }), + new AssetRoute({ + source: { + asset: astr, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: bifrost, + asset: astr, + fee: { + amount: 0.00001, + asset: astr, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ]; const toCentrifuge: AssetRoute[] = [ From cbd74da79dc47e1e455048d7a56db40658c0da90 Mon Sep 17 00:00:00 2001 From: green-jay Date: Mon, 21 Oct 2024 10:09:54 +0200 Subject: [PATCH 2/7] add changeset --- .changeset/swift-insects-run.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/swift-insects-run.md diff --git a/.changeset/swift-insects-run.md b/.changeset/swift-insects-run.md new file mode 100644 index 00000000..c2022ba8 --- /dev/null +++ b/.changeset/swift-insects-run.md @@ -0,0 +1,6 @@ +--- +'xcm-transfer': major +'@galacticcouncil/xcm-cfg': major +--- + +ASTR Hydration<>Bifrost From cc3ce25976dc364be47bbc2268e3fc2be64b809b Mon Sep 17 00:00:00 2001 From: green-jay Date: Mon, 21 Oct 2024 10:21:02 +0200 Subject: [PATCH 3/7] fix changeset --- .changeset/swift-insects-run.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.changeset/swift-insects-run.md b/.changeset/swift-insects-run.md index c2022ba8..b64d6a44 100644 --- a/.changeset/swift-insects-run.md +++ b/.changeset/swift-insects-run.md @@ -1,6 +1,5 @@ --- -'xcm-transfer': major -'@galacticcouncil/xcm-cfg': major +'@galacticcouncil/xcm-cfg': minor --- ASTR Hydration<>Bifrost From 53d3d3fad5a35f14f6f9ca885c70a3b378c1f1da Mon Sep 17 00:00:00 2001 From: green-jay Date: Tue, 22 Oct 2024 12:57:50 +0200 Subject: [PATCH 4/7] Add GLMR and ASTR to Bifrost --- packages/xcm-cfg/src/chains.ts | 7 +++++ .../xcm-cfg/src/configs/polkadot/bifrost.ts | 26 +++++++++++++++++-- .../src/configs/polkadot/hydration/index.ts | 21 ++++++++++++++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/packages/xcm-cfg/src/chains.ts b/packages/xcm-cfg/src/chains.ts index d905f0ae..4901f80e 100644 --- a/packages/xcm-cfg/src/chains.ts +++ b/packages/xcm-cfg/src/chains.ts @@ -337,6 +337,13 @@ export const bifrost = new Parachain({ metadataId: { Token2: 3 }, min: 0.01, }, + { + asset: glmr, + decimals: 18, + id: { Token2: 1 }, + metadataId: { Token2: 1 }, + min: 0.00001, + }, ], ecosystem: Ecosystem.Polkadot, explorer: 'https://bifrost.subscan.io', diff --git a/packages/xcm-cfg/src/configs/polkadot/bifrost.ts b/packages/xcm-cfg/src/configs/polkadot/bifrost.ts index 41b28669..c3d57e8d 100644 --- a/packages/xcm-cfg/src/configs/polkadot/bifrost.ts +++ b/packages/xcm-cfg/src/configs/polkadot/bifrost.ts @@ -1,6 +1,6 @@ import { AssetRoute, ChainRoutes } from '@galacticcouncil/xcm-core'; -import { bnc, dot, pink, usdc, usdt, vdot, vastr, astr } from '../../assets'; +import { bnc, dot, pink, usdc, usdt, vdot, vastr, astr, glmr } from '../../assets'; import { assetHub, bifrost, hydration, polkadot } from '../../chains'; import { BalanceBuilder, ExtrinsicBuilder } from '../../builders'; @@ -105,12 +105,34 @@ const toHydration: AssetRoute[] = [ chain: hydration, asset: astr, fee: { - amount: 0.01, + amount: 0.5, asset: astr, }, }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), }), + new AssetRoute({ + source: { + asset: glmr, + balance: BalanceBuilder().substrate().tokens().accounts(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + destinationFee: { + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + }, + destination: { + chain: hydration, + asset: glmr, + fee: { + amount: 0.1, + asset: glmr, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ]; const toPolkadot: AssetRoute[] = [ diff --git a/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts b/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts index bce02985..767f5ec3 100644 --- a/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts +++ b/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts @@ -351,12 +351,31 @@ const toBifrost: AssetRoute[] = [ chain: bifrost, asset: astr, fee: { - amount: 0.00001, + amount: 0.5, asset: astr, }, }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), }), + new AssetRoute({ + source: { + asset: glmr, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: bifrost, + asset: glmr, + fee: { + amount: 0.1, + asset: glmr, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ]; const toCentrifuge: AssetRoute[] = [ From 494ff1284ddc801878c6b7a85197fd0d8b9f5804 Mon Sep 17 00:00:00 2001 From: green-jay Date: Tue, 22 Oct 2024 13:02:06 +0200 Subject: [PATCH 5/7] add changeset --- .changeset/poor-lemons-wink.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/poor-lemons-wink.md diff --git a/.changeset/poor-lemons-wink.md b/.changeset/poor-lemons-wink.md new file mode 100644 index 00000000..eb561636 --- /dev/null +++ b/.changeset/poor-lemons-wink.md @@ -0,0 +1,5 @@ +--- +'@galacticcouncil/xcm-cfg': patch +--- + +add ASTR and GLMR to bifrost From c558a15234ff791d0b31dc3c5686d63ad4156748 Mon Sep 17 00:00:00 2001 From: green-jay Date: Thu, 24 Oct 2024 10:44:25 +0200 Subject: [PATCH 6/7] Astar bifrost centrifuge --- packages/xcm-cfg/src/chains.ts | 70 +++++++ .../xcm-cfg/src/configs/polkadot/astar.ts | 158 ++++++++++++++- .../xcm-cfg/src/configs/polkadot/bifrost.ts | 24 ++- .../src/configs/polkadot/centrifuge.ts | 46 ++++- .../src/configs/polkadot/hydration/index.ts | 190 ++++++++++++++++++ 5 files changed, 484 insertions(+), 4 deletions(-) diff --git a/packages/xcm-cfg/src/chains.ts b/packages/xcm-cfg/src/chains.ts index 4901f80e..b721e63d 100644 --- a/packages/xcm-cfg/src/chains.ts +++ b/packages/xcm-cfg/src/chains.ts @@ -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', @@ -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', @@ -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', diff --git a/packages/xcm-cfg/src/configs/polkadot/astar.ts b/packages/xcm-cfg/src/configs/polkadot/astar.ts index c37c18bb..1704490c 100644 --- a/packages/xcm-cfg/src/configs/polkadot/astar.ts +++ b/packages/xcm-cfg/src/configs/polkadot/astar.ts @@ -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'; @@ -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(), @@ -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({ diff --git a/packages/xcm-cfg/src/configs/polkadot/bifrost.ts b/packages/xcm-cfg/src/configs/polkadot/bifrost.ts index c3d57e8d..8e95fa11 100644 --- a/packages/xcm-cfg/src/configs/polkadot/bifrost.ts +++ b/packages/xcm-cfg/src/configs/polkadot/bifrost.ts @@ -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'; @@ -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[] = [ diff --git a/packages/xcm-cfg/src/configs/polkadot/centrifuge.ts b/packages/xcm-cfg/src/configs/polkadot/centrifuge.ts index 77ede23e..14f3e2f9 100644 --- a/packages/xcm-cfg/src/configs/polkadot/centrifuge.ts +++ b/packages/xcm-cfg/src/configs/polkadot/centrifuge.ts @@ -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'; @@ -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({ diff --git a/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts b/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts index 14ddfcd8..41b69e19 100644 --- a/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts +++ b/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts @@ -281,6 +281,139 @@ const toAstar: AssetRoute[] = [ }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), }), + new AssetRoute({ + source: { + asset: bnc, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: astar, + asset: bnc, + fee: { + amount: 0.05, + asset: bnc, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), + new AssetRoute({ + source: { + asset: glmr, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: astar, + asset: glmr, + fee: { + amount: 0.025, + asset: glmr, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), + new AssetRoute({ + source: { + asset: ibtc, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: astar, + asset: ibtc, + fee: { + amount: 0.025, + asset: ibtc, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), + new AssetRoute({ + source: { + asset: intr, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: astar, + asset: intr, + fee: { + amount: 0.01, + asset: intr, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), + new AssetRoute({ + source: { + asset: pha, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: astar, + asset: pha, + fee: { + amount: 0.3, + asset: pha, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), + new AssetRoute({ + source: { + asset: vdot, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: astar, + asset: vdot, + fee: { + amount: 0.0004, + asset: vdot, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), + new AssetRoute({ + source: { + asset: vastr, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: astar, + asset: vastr, + fee: { + amount: 0.005, + asset: vastr, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ]; const toBifrost: AssetRoute[] = [ @@ -398,6 +531,25 @@ const toBifrost: AssetRoute[] = [ }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), }), + new AssetRoute({ + source: { + asset: ibtc, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: bifrost, + asset: ibtc, + fee: { + amount: 0.000002, + asset: glmr, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ]; const toCentrifuge: AssetRoute[] = [ @@ -420,6 +572,44 @@ const toCentrifuge: AssetRoute[] = [ }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), }), + new AssetRoute({ + source: { + asset: dot, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: centrifuge, + asset: dot, + fee: { + amount: 0.1, + asset: dot, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), + new AssetRoute({ + source: { + asset: glmr, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: centrifuge, + asset: glmr, + fee: { + amount: 0.05, + asset: glmr, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ]; const toInterlay: AssetRoute[] = [ From 8ec90b8892180645d30749b2468807a559c1eb8f Mon Sep 17 00:00:00 2001 From: green-jay Date: Mon, 4 Nov 2024 14:08:39 +0100 Subject: [PATCH 7/7] add vdot --- packages/xcm-cfg/src/chains.ts | 5 ++++ .../src/configs/polkadot/hydration/index.ts | 19 +++++++++++++++ .../xcm-cfg/src/configs/polkadot/interlay.ts | 24 ++++++++++++++++++- 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/packages/xcm-cfg/src/chains.ts b/packages/xcm-cfg/src/chains.ts index b721e63d..c9d3f7c8 100644 --- a/packages/xcm-cfg/src/chains.ts +++ b/packages/xcm-cfg/src/chains.ts @@ -729,6 +729,11 @@ export const interlay = new Parachain({ decimals: 12, id: { ForeignAsset: 13 }, }, + { + asset: vdot, + decimals: 10, + id: { ForeignAsset: 3 }, + }, ], ecosystem: Ecosystem.Polkadot, explorer: 'https://interlay.subscan.io', diff --git a/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts b/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts index 41b69e19..56bc83a6 100644 --- a/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts +++ b/packages/xcm-cfg/src/configs/polkadot/hydration/index.ts @@ -689,6 +689,25 @@ const toInterlay: AssetRoute[] = [ }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), }), + new AssetRoute({ + source: { + asset: vdot, + balance: balance(), + fee: fee(), + destinationFee: { + balance: balance(), + }, + }, + destination: { + chain: interlay, + asset: vdot, + fee: { + amount: 0.01, + asset: dot, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ]; const toMoonbeam: AssetRoute[] = [ diff --git a/packages/xcm-cfg/src/configs/polkadot/interlay.ts b/packages/xcm-cfg/src/configs/polkadot/interlay.ts index bdbe07c2..c16eb8c8 100644 --- a/packages/xcm-cfg/src/configs/polkadot/interlay.ts +++ b/packages/xcm-cfg/src/configs/polkadot/interlay.ts @@ -1,6 +1,6 @@ import { AssetRoute, ChainRoutes } from '@galacticcouncil/xcm-core'; -import { dot, hdx, ibtc, intr } from '../../assets'; +import { dot, hdx, ibtc, intr, vdot } from '../../assets'; import { hydration, interlay } from '../../chains'; import { BalanceBuilder, ExtrinsicBuilder } from '../../builders'; @@ -89,6 +89,28 @@ const toHydration: AssetRoute[] = [ }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), }), + new AssetRoute({ + source: { + asset: vdot, + balance: BalanceBuilder().substrate().tokens().accounts(), + fee: { + asset: intr, + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + destinationFee: { + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + }, + destination: { + chain: hydration, + asset: vdot, + fee: { + amount: 0.001, + asset: vdot, + }, + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ]; export const interlayConfig = new ChainRoutes({