From 2889a231d9deebf29f2a0b5d9d5ace628bcb6a47 Mon Sep 17 00:00:00 2001 From: green-jay Date: Tue, 16 Jan 2024 15:20:31 +0100 Subject: [PATCH 1/2] wip --- packages/xcm-cfg/src/configs/bifrost.ts | 25 ++++++++++++++++++++++-- packages/xcm-cfg/src/configs/polkadot.ts | 24 +++++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/packages/xcm-cfg/src/configs/bifrost.ts b/packages/xcm-cfg/src/configs/bifrost.ts index 4e232bde..8742a656 100644 --- a/packages/xcm-cfg/src/configs/bifrost.ts +++ b/packages/xcm-cfg/src/configs/bifrost.ts @@ -2,7 +2,7 @@ import { BalanceBuilder, ExtrinsicBuilder, } from '@moonbeam-network/xcm-builder'; -import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config'; +import { AssetConfig, ChainConfig, polkadot } from '@moonbeam-network/xcm-config'; import { bnc, vdot, dot } from '../assets'; import { bifrost, hydraDX } from '../chains'; @@ -52,7 +52,28 @@ const toHydraDX: AssetConfig[] = [ }), ]; +const toPolkadot: AssetConfig[] = [ + new AssetConfig({ + asset: dot, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: polkadot, + destinationFee: { + amount: 0.000469417452, + asset: dot, + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + extrinsic: ExtrinsicBuilderV2().xTokens().transfer(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + }), +]; + export const bifrostConfig = new ChainConfig({ - assets: [...toHydraDX], + assets: [ + ...toHydraDX, + ...toPolkadot, + ], chain: bifrost, }); diff --git a/packages/xcm-cfg/src/configs/polkadot.ts b/packages/xcm-cfg/src/configs/polkadot.ts index b218ee97..adcabc0a 100644 --- a/packages/xcm-cfg/src/configs/polkadot.ts +++ b/packages/xcm-cfg/src/configs/polkadot.ts @@ -9,7 +9,7 @@ import { } from '@moonbeam-network/xcm-config'; import { dot } from '../assets'; -import { hydraDX } from '../chains'; +import { bifrost, hydraDX } from '../chains'; const toHydraDX: AssetConfig[] = [ new AssetConfig({ @@ -28,7 +28,27 @@ const toHydraDX: AssetConfig[] = [ }), ]; +const toBifrost: AssetConfig[] = [ + new AssetConfig({ + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + destination: bifrost, + destinationFee: { + amount: 0.002172, + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder() + .xcmPallet() + .limitedReserveTransferAssets(0) + .here(), + }), +]; + export const polkadotConfig = new ChainConfig({ - assets: [...toHydraDX], + assets: [ + ...toHydraDX, + ...toBifrost, + ], chain: polkadot, }); From e8155ba5c25ea14afb7e92918d9f90ba730965db Mon Sep 17 00:00:00 2001 From: green-jay Date: Tue, 16 Jan 2024 15:54:24 +0100 Subject: [PATCH 2/2] Add DOT to bifrost and adjust fee for hydra --- packages/xcm-cfg/src/configs/bifrost.ts | 2 +- packages/xcm-cfg/src/configs/hydraDX.ts | 2 +- packages/xcm-cfg/src/configs/polkadot.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/xcm-cfg/src/configs/bifrost.ts b/packages/xcm-cfg/src/configs/bifrost.ts index 8742a656..8cc94388 100644 --- a/packages/xcm-cfg/src/configs/bifrost.ts +++ b/packages/xcm-cfg/src/configs/bifrost.ts @@ -58,7 +58,7 @@ const toPolkadot: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: polkadot, destinationFee: { - amount: 0.000469417452, + amount: 0.003, asset: dot, balance: BalanceBuilder().substrate().tokens().accounts(), }, diff --git a/packages/xcm-cfg/src/configs/hydraDX.ts b/packages/xcm-cfg/src/configs/hydraDX.ts index b02bdeba..d1e8ca5e 100644 --- a/packages/xcm-cfg/src/configs/hydraDX.ts +++ b/packages/xcm-cfg/src/configs/hydraDX.ts @@ -361,7 +361,7 @@ const toPolkadot: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: polkadot, destinationFee: { - amount: 0.000469417452, + amount: 0.003, asset: dot, balance: BalanceBuilder().substrate().tokens().accounts(), }, diff --git a/packages/xcm-cfg/src/configs/polkadot.ts b/packages/xcm-cfg/src/configs/polkadot.ts index adcabc0a..b4908718 100644 --- a/packages/xcm-cfg/src/configs/polkadot.ts +++ b/packages/xcm-cfg/src/configs/polkadot.ts @@ -34,7 +34,7 @@ const toBifrost: AssetConfig[] = [ balance: BalanceBuilder().substrate().system().account(), destination: bifrost, destinationFee: { - amount: 0.002172, + amount: 0.001, asset: dot, balance: BalanceBuilder().substrate().system().account(), },