From 42c84859b7ebb73b9c4dd6b059757998da0a0cde Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Mon, 12 Feb 2024 17:40:50 +1300 Subject: [PATCH] -wip- initial vastr and vmanta configuration --- packages/config/src/assets.ts | 12 +++++++ packages/config/src/chains.ts | 20 +++++++++++ .../config/src/configs/bifrostPolkadot.ts | 34 ++++++++++++++++++- packages/config/src/configs/moonbeam.ts | 32 +++++++++++++++++ 4 files changed, 97 insertions(+), 1 deletion(-) diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index d71c6471..375ea2b0 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -280,6 +280,11 @@ export const wftm = new Asset({ originSymbol: 'wFTM', }); +export const vastr = new Asset({ + key: 'vastr', + originSymbol: 'vASTR', +}); + export const vbnc = new Asset({ key: 'vbnc', originSymbol: 'vBNC', @@ -305,6 +310,11 @@ export const vksm = new Asset({ originSymbol: 'vKSM', }); +export const vmanta = new Asset({ + key: 'vmanta', + originSymbol: 'vMANTA', +}); + export const vmovr = new Asset({ key: 'vmovr', originSymbol: 'vMOVR', @@ -373,11 +383,13 @@ export const assetsList: Asset[] = [ usdcwh, usdt, usdtwh, + vastr, vbnc, vdot, vfil, vglmr, vksm, + vmanta, vmovr, xrt, wbtc, diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index cc0b609b..e3c44cb4 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -57,11 +57,13 @@ import { usdcwh, usdt, usdtwh, + vastr, vbnc, vdot, vfil, vglmr, vksm, + vmanta, vmovr, wbtc, weth, @@ -210,6 +212,10 @@ export const bifrostPolkadot = new Parachain({ asset: fil, id: { Token2: 4 }, }, + { + asset: vastr, + id: { VToken2: 3 }, + }, { asset: vdot, id: { VToken2: 0 }, @@ -223,6 +229,10 @@ export const bifrostPolkadot = new Parachain({ asset: vglmr, id: { VToken2: 1 }, }, + { + asset: vmanta, + id: { VToken2: 8 }, + }, ], ecosystem: Ecosystem.Polkadot, genesisHash: @@ -870,6 +880,11 @@ export const moonbeam = new EvmParachain({ asset: usdt, id: '311091173110107856861649819128533077277', }, + { + asset: vastr, + id: '0xFffFffff55C732C47639231a4C4373245763d26E', + metadataId: '114018676402354620972806895487280206446', // registered XC20 id for ERC20 tokens + }, { asset: vdot, id: '0xFFFfffFf15e1b7E3dF971DD813Bc394deB899aBf', @@ -885,6 +900,11 @@ export const moonbeam = new EvmParachain({ id: '0xFfFfFFff99dABE1a8De0EA22bAa6FD48fdE96F6c', metadataId: '204507659831918931608354793288110796652', // registered XC20 id for ERC20 tokens }, + { + asset: vmanta, + id: '0xFFfFFfFfdA2a05FB50e7ae99275F4341AEd43379', + metadataId: '289989900872525819559124583375550296953', // registered XC20 id for ERC20 tokens + }, { asset: wbtc, id: '0xE57eBd2d67B462E9926e04a8e33f01cD0D64346D', diff --git a/packages/config/src/configs/bifrostPolkadot.ts b/packages/config/src/configs/bifrostPolkadot.ts index f6d24020..1d0a9c53 100644 --- a/packages/config/src/configs/bifrostPolkadot.ts +++ b/packages/config/src/configs/bifrostPolkadot.ts @@ -4,7 +4,7 @@ import { ExtrinsicBuilder, FeeBuilder, } from '@moonbeam-network/xcm-builder'; -import { bnc, fil, glmr, vdot, vfil, vglmr } from '../assets'; +import { bnc, fil, glmr, vastr, vdot, vfil, vglmr, vmanta } from '../assets'; import { bifrostPolkadot, moonbeam } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -54,6 +54,22 @@ export const bifrostPolkadotConfig = new ChainConfig({ }, min: AssetMinBuilder().assetRegistry().currencyMetadatas(), }), + new AssetConfig({ + asset: vastr, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbeam, + destinationFee: { + amount: 0.01, // TODO + asset: vastr, + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + min: AssetMinBuilder().assetRegistry().currencyMetadatas(), + }), new AssetConfig({ asset: vdot, balance: BalanceBuilder().substrate().tokens().accounts(), @@ -102,6 +118,22 @@ export const bifrostPolkadotConfig = new ChainConfig({ }, min: AssetMinBuilder().assetRegistry().currencyMetadatas(), }), + new AssetConfig({ + asset: vmanta, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbeam, + destinationFee: { + amount: 0.2, // TODO + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + min: AssetMinBuilder().assetRegistry().currencyMetadatas(), + }), ], chain: bifrostPolkadot, }); diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index e5883d5a..fa141584 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -27,9 +27,11 @@ import { usdcwh, usdt, usdtwh, + vastr, vdot, vfil, vglmr, + vmanta, wbtc, weth, ztg, @@ -556,6 +558,21 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: vastr, + balance: BalanceBuilder().evm().erc20(), + contract: ContractBuilder().Xtokens().transfer(), + destination: bifrostPolkadot, + destinationFee: { + amount: 0.0000001, // TODO + asset: vastr, + balance: BalanceBuilder().evm().erc20(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: vdot, balance: BalanceBuilder().evm().erc20(), @@ -601,6 +618,21 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: vmanta, + balance: BalanceBuilder().evm().erc20(), + contract: ContractBuilder().Xtokens().transfer(), + destination: bifrostPolkadot, + destinationFee: { + amount: 0.00000001, + asset: vmanta, // TODO + balance: BalanceBuilder().evm().erc20(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: wbtc, balance: BalanceBuilder().evm().erc20(),