From f2f6daec87aa90c33352b8db3a7a65691fcac407 Mon Sep 17 00:00:00 2001 From: green-jay Date: Fri, 16 Feb 2024 14:25:35 +0100 Subject: [PATCH 1/2] Fixes --- packages/xcm-cfg/src/chains.ts | 6 +++ packages/xcm-cfg/src/configs/assethub.ts | 21 +-------- packages/xcm-cfg/src/configs/astar.ts | 12 +++--- packages/xcm-cfg/src/configs/bifrost.ts | 4 +- packages/xcm-cfg/src/configs/hydraDX.ts | 54 ++++++++++++------------ packages/xcm-cfg/src/configs/interlay.ts | 8 ++-- packages/xcm-cfg/src/configs/moonbeam.ts | 24 +++++++++-- packages/xcm-cfg/src/configs/polkadot.ts | 2 +- 8 files changed, 67 insertions(+), 64 deletions(-) diff --git a/packages/xcm-cfg/src/chains.ts b/packages/xcm-cfg/src/chains.ts index 6d899fc7..c34d81f8 100644 --- a/packages/xcm-cfg/src/chains.ts +++ b/packages/xcm-cfg/src/chains.ts @@ -410,6 +410,12 @@ export const moonbeam = new EvmParachain({ metadataId: 0, decimals: 6, }, + { + asset: usdc, + id: '166377000701797186346254371275954761085', + metadataId: 0, + decimals: 6, + }, ], ecosystem: Ecosystem.Polkadot, genesisHash: diff --git a/packages/xcm-cfg/src/configs/assethub.ts b/packages/xcm-cfg/src/configs/assethub.ts index 59c522e5..fa1b0205 100644 --- a/packages/xcm-cfg/src/configs/assethub.ts +++ b/packages/xcm-cfg/src/configs/assethub.ts @@ -52,25 +52,6 @@ const toHydraDX: AssetConfig[] = [ }, min: AssetMinBuilder().assets().asset(), }), - new AssetConfig({ - asset: dot, - balance: BalanceBuilder().substrate().system().account(), - destination: hydraDX, - destinationFee: { - amount: 0.02, - asset: dot, - balance: BalanceBuilder().substrate().system().account(), - }, - extrinsic: ExtrinsicBuilder() - .polkadotXcm() - .limitedReserveTransferAssets() - .X1(), - fee: { - asset: dot, - balance: BalanceBuilder().substrate().system().account(), - }, - min: AssetMinBuilder().assets().asset(), - }), ]; const toPolkadot: AssetConfig[] = [ @@ -79,7 +60,7 @@ const toPolkadot: AssetConfig[] = [ balance: BalanceBuilder().substrate().system().account(), destination: polkadot, destinationFee: { - amount: 0.02, + amount: 0.003, asset: dot, balance: BalanceBuilder().substrate().system().account(), }, diff --git a/packages/xcm-cfg/src/configs/astar.ts b/packages/xcm-cfg/src/configs/astar.ts index 0a22f45a..d033420b 100644 --- a/packages/xcm-cfg/src/configs/astar.ts +++ b/packages/xcm-cfg/src/configs/astar.ts @@ -25,9 +25,9 @@ const toHydraDX: AssetConfig[] = [ balance: BalanceBuilder().substrate().assets().account(), destination: hydraDX, destinationFee: { - amount: 0.6, - asset: hdx, - balance: BalanceBuilder().substrate().tokens().accounts(), + amount: 0.044306118, + asset: astr, + balance: BalanceBuilder().substrate().system().account(), }, fee: { asset: astr, @@ -40,9 +40,9 @@ const toHydraDX: AssetConfig[] = [ balance: BalanceBuilder().substrate().assets().account(), destination: hydraDX, destinationFee: { - amount: 0.6, - asset: hdx, - balance: BalanceBuilder().substrate().tokens().accounts(), + amount: 1.4, + asset: usdt, + balance: BalanceBuilder().substrate().assets().account(), }, fee: { asset: astr, diff --git a/packages/xcm-cfg/src/configs/bifrost.ts b/packages/xcm-cfg/src/configs/bifrost.ts index da55ab03..a6616207 100644 --- a/packages/xcm-cfg/src/configs/bifrost.ts +++ b/packages/xcm-cfg/src/configs/bifrost.ts @@ -52,8 +52,8 @@ const toHydraDX: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: hydraDX, destinationFee: { - amount: 0.0013, - asset: hdx, + amount: 1.4, + asset: usdt, balance: BalanceBuilder().substrate().tokens().accounts(), }, extrinsic: ExtrinsicBuilderV2().xTokens().transfer(), diff --git a/packages/xcm-cfg/src/configs/hydraDX.ts b/packages/xcm-cfg/src/configs/hydraDX.ts index 83542ab7..df17b003 100644 --- a/packages/xcm-cfg/src/configs/hydraDX.ts +++ b/packages/xcm-cfg/src/configs/hydraDX.ts @@ -131,21 +131,6 @@ const toAssetHub: AssetConfig[] = [ balance: BalanceBuilder().substrate().system().account(), }, }), - new AssetConfig({ - asset: dot, - balance: BalanceBuilder().substrate().tokens().accounts(), - destination: assetHub, - destinationFee: { - amount: 0.02, - asset: dot, - balance: BalanceBuilder().substrate().tokens().accounts(), - }, - extrinsic: ExtrinsicBuilderV2().xTokens().transfer(), - fee: { - asset: hdx, - balance: BalanceBuilder().substrate().system().account(), - }, - }), ]; const toAstar: AssetConfig[] = [ @@ -173,7 +158,7 @@ const toAstar: AssetConfig[] = [ asset: dot, balance: BalanceBuilder().substrate().tokens().accounts(), }, - extrinsic: ExtrinsicBuilder().xTokens().transfer(), + extrinsic: ExtrinsicBuilderV2().xTokens().transfer(), fee: { asset: hdx, balance: BalanceBuilder().substrate().system().account(), @@ -184,8 +169,8 @@ const toAstar: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: astar, destinationFee: { - amount: 0.004, - asset: astr, + amount: 1.4, + asset: usdt, balance: BalanceBuilder().substrate().tokens().accounts(), }, extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(1000).X3(), @@ -313,11 +298,11 @@ const toInterlay: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: interlay, destinationFee: { - amount: 0.0019213457, - asset: intr, + amount: 0.002, + asset: dot, balance: BalanceBuilder().substrate().tokens().accounts(), }, - extrinsic: ExtrinsicBuilder().xTokens().transfer(), + extrinsic: ExtrinsicBuilderV2().xTokens().transfer(), fee: { asset: hdx, balance: BalanceBuilder().substrate().system().account(), @@ -328,8 +313,8 @@ const toInterlay: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: interlay, destinationFee: { - amount: 0.0019213457, - asset: intr, + amount: 1.4, + asset: usdt, balance: BalanceBuilder().substrate().tokens().accounts(), }, extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(1000).X3(), @@ -433,11 +418,11 @@ const toMoonbeam: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: moonbeam, destinationFee: { - amount: 0.001, + amount: 0.003, asset: dot, balance: BalanceBuilder().substrate().tokens().accounts(), }, - extrinsic: ExtrinsicBuilder().xTokens().transfer(), + extrinsic: ExtrinsicBuilderV2().xTokens().transfer(), fee: { asset: hdx, balance: BalanceBuilder().substrate().system().account(), @@ -463,8 +448,23 @@ const toMoonbeam: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: moonbeam, destinationFee: { - amount: 0.04, - asset: glmr, + amount: 1.4, + asset: usdt, + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(1000).X3(), + fee: { + asset: hdx, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + new AssetConfig({ + asset: usdc, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbeam, + destinationFee: { + amount: 1.4, + asset: usdc, balance: BalanceBuilder().substrate().tokens().accounts(), }, extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(1000).X3(), diff --git a/packages/xcm-cfg/src/configs/interlay.ts b/packages/xcm-cfg/src/configs/interlay.ts index 1669f980..442ae6c1 100644 --- a/packages/xcm-cfg/src/configs/interlay.ts +++ b/packages/xcm-cfg/src/configs/interlay.ts @@ -39,8 +39,8 @@ const toHydraDX: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: hydraDX, destinationFee: { - amount: 0.6, - asset: hdx, + amount: 0.002, + asset: dot, balance: BalanceBuilder().substrate().tokens().accounts(), }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), @@ -54,8 +54,8 @@ const toHydraDX: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: hydraDX, destinationFee: { - amount: 0.6, - asset: hdx, + amount: 1.4, + asset: usdt, balance: BalanceBuilder().substrate().tokens().accounts(), }, extrinsic: ExtrinsicBuilder().xTokens().transfer(), diff --git a/packages/xcm-cfg/src/configs/moonbeam.ts b/packages/xcm-cfg/src/configs/moonbeam.ts index dfb15ad1..3c70258e 100644 --- a/packages/xcm-cfg/src/configs/moonbeam.ts +++ b/packages/xcm-cfg/src/configs/moonbeam.ts @@ -10,7 +10,8 @@ import { wbtc_mwh, weth_mwh, dot, - usdt + usdt, + usdc } from '../assets'; import { hydraDX, moonbeam } from '../chains'; @@ -122,7 +123,7 @@ const toHydraDX: AssetConfig[] = [ contract: ContractBuilder().Xtokens().transfer(), destination: hydraDX, destinationFee: { - amount: 0.02, + amount: 0.002, asset: dot, balance: BalanceBuilder().substrate().tokens().accounts(), }, @@ -137,8 +138,23 @@ const toHydraDX: AssetConfig[] = [ contract: ContractBuilder().Xtokens().transfer(), destination: hydraDX, destinationFee: { - amount: 0.6, - asset: hdx, + amount: 1.4, + asset: usdt, + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + new AssetConfig({ + asset: usdc, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: hydraDX, + destinationFee: { + amount: 1.4, + asset: usdc, balance: BalanceBuilder().substrate().tokens().accounts(), }, fee: { diff --git a/packages/xcm-cfg/src/configs/polkadot.ts b/packages/xcm-cfg/src/configs/polkadot.ts index 631aa4d2..fa6bf957 100644 --- a/packages/xcm-cfg/src/configs/polkadot.ts +++ b/packages/xcm-cfg/src/configs/polkadot.ts @@ -52,7 +52,7 @@ const toAssetHub: AssetConfig[] = [ balance: BalanceBuilder().substrate().system().account(), destination: assetHub, destinationFee: { - amount: 0.001, + amount: 0.00014, asset: dot, balance: BalanceBuilder().substrate().system().account(), }, From d87a989e6d9de40f4544005894803bb994be6341 Mon Sep 17 00:00:00 2001 From: green-jay Date: Fri, 16 Feb 2024 14:45:02 +0100 Subject: [PATCH 2/2] fix usdt amount to Bifrost --- packages/xcm-cfg/src/configs/hydraDX.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/xcm-cfg/src/configs/hydraDX.ts b/packages/xcm-cfg/src/configs/hydraDX.ts index df17b003..9c785a37 100644 --- a/packages/xcm-cfg/src/configs/hydraDX.ts +++ b/packages/xcm-cfg/src/configs/hydraDX.ts @@ -232,7 +232,7 @@ const toBifrost: AssetConfig[] = [ balance: BalanceBuilder().substrate().tokens().accounts(), destination: bifrost, destinationFee: { - amount: 0.7, + amount: 1.4, asset: usdt, balance: BalanceBuilder().substrate().tokens().accounts(), },