From 6b7c0f5eb5f4b590bfdfe48440f47f8b18d0be59 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Thu, 31 Oct 2024 16:08:46 +0100 Subject: [PATCH] add assets configurations --- packages/config/src/assets.ts | 12 +++++++ packages/config/src/chains.ts | 24 +++++++++++++ packages/config/src/configs/moonbeam.ts | 12 +++++++ .../config/src/configs/polkadotAssetHub.ts | 36 ++++++++++++++++++- 4 files changed, 83 insertions(+), 1 deletion(-) diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index c4b8cab4..4f7495ad 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -390,6 +390,16 @@ export const wbtce = new Asset({ originSymbol: 'WBTC.e', }); +export const wstethe = new Asset({ + key: 'wstethe', + originSymbol: 'wstETH.e', +}); + +export const wethe = new Asset({ + key: 'wethe', + originSymbol: 'WETH.e', +}); + export const assetsList: Asset[] = [ aca, alan, @@ -464,8 +474,10 @@ export const assetsList: Asset[] = [ wbtc, wbtce, weth, + wethe, wftm, wifd, + wstethe, xrt, ztg, ]; diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 0c849b09..8e07f152 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -77,7 +77,9 @@ import { wbtc, wbtce, weth, + wethe, wifd, + wstethe, xrt, ztg, } from './assets'; @@ -1107,6 +1109,18 @@ export const moonbeam = new EvmParachain({ asset: wifd, id: '61295607754960722617854661686514597014', }, + { + asset: wbtce, + id: '36282181791341254438422467838694599751', + }, + { + asset: wethe, + id: '178794693648360392906933130845919698647', + }, + { + asset: wstethe, + id: '124105859028862849477017063633156007283', + }, ], ecosystem: Ecosystem.Polkadot, genesisHash: @@ -1725,6 +1739,16 @@ export const polkadotAssetHub = new Parachain({ asset: wbtce, globalConcensusId: { ethereum: { chainId: 1 } }, }, + { + address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + asset: wethe, + globalConcensusId: { ethereum: { chainId: 1 } }, + }, + { + address: '0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0', + asset: wstethe, + globalConcensusId: { ethereum: { chainId: 1 } }, + }, ], checkSovereignAccountBalances: true, ecosystem: Ecosystem.Polkadot, diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index bb24a3d6..c8d666d0 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -37,6 +37,7 @@ import { vglmr, vmanta, wbtc, + wbtce, weth, wifd, ztg, @@ -951,6 +952,17 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().evm().erc20(), }, }), + new AssetConfig({ + asset: wbtce, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: polkadotAssetHub, + destinationFee: { + amount: 0.02, // TODO + asset: usdt, // TODO + balance: BalanceBuilder().substrate().assets().account(), + }, + }), ], chain: moonbeam, }); diff --git a/packages/config/src/configs/polkadotAssetHub.ts b/packages/config/src/configs/polkadotAssetHub.ts index 2d47b8c1..29617370 100644 --- a/packages/config/src/configs/polkadotAssetHub.ts +++ b/packages/config/src/configs/polkadotAssetHub.ts @@ -4,7 +4,17 @@ import { ExtrinsicBuilder, FeeBuilder, } from '@moonbeam-network/xcm-builder'; -import { apillon, ded, dot, pink, stink, usdc, usdt, wifd } from '../assets'; +import { + apillon, + ded, + dot, + pink, + stink, + usdc, + usdt, + wbtce, + wifd, +} from '../assets'; import { moonbeam, polkadotAssetHub } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -189,6 +199,30 @@ export const polkadotAssetHubConfig = new ChainConfig({ }, min: AssetMinBuilder().assets().asset(), }), + new AssetConfig({ + asset: wbtce, + balance: BalanceBuilder().substrate().foreignAssets().account(), + destination: moonbeam, + destinationFee: { + amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({ + isAssetReserveChain: false, + shouldTransferAssetPrecedeAsset: true, + }), + asset: usdt, + balance: BalanceBuilder().substrate().assets().account(), + }, + // TODO + extrinsic: ExtrinsicBuilder() + .polkadotXcm() + .limitedReserveTransferAssets() + .X2(), + fee: { + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + xcmDeliveryFeeAmount, + }, + min: AssetMinBuilder().assets().asset(), + }), ], chain: polkadotAssetHub, });