From 196eb727ff083bd8790680c8c488b9a9635e15d3 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Fri, 22 Sep 2023 09:57:03 +0200 Subject: [PATCH 1/4] bifrost lsd asstes configuration --- packages/config/src/assets.ts | 38 +++++++++++- packages/config/src/chains.ts | 61 +++++++++++++++++++ packages/config/src/configs/bifrostKusama.ts | 50 ++++++++++++++- .../config/src/configs/bifrostPolkadot.ts | 50 ++++++++++++++- packages/config/src/configs/moonbeam.ts | 48 +++++++++++++++ packages/config/src/configs/moonriver.ts | 48 +++++++++++++++ 6 files changed, 292 insertions(+), 3 deletions(-) diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index f4392716..6e11f00e 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -207,7 +207,7 @@ export const unit = new Asset({ export const usdc = new Asset({ key: 'usdc', - originSymbol: 'USDC', + originSymbol: 'USDC.Wh', }); export const usdt = new Asset({ @@ -230,6 +230,36 @@ export const wftm = new Asset({ originSymbol: 'wFTM', }); +export const vbnc = new Asset({ + key: 'xcvbnc', + originSymbol: 'vBNC', +}); + +export const vDOT = new Asset({ + key: 'xcvdot', + originSymbol: 'vDOT', +}); + +export const vfil = new Asset({ + key: 'xcvfil', + originSymbol: 'vFIL', +}); + +export const vglmr = new Asset({ + key: 'xcvglmr', + originSymbol: 'vGLMR', +}); + +export const vksm = new Asset({ + key: 'xcvksm', + originSymbol: 'vKSM', +}); + +export const vmovr = new Asset({ + key: 'xcvmovr', + originSymbol: 'vMOVR', +}); + export const xrt = new Asset({ key: 'xrt', originSymbol: 'XRT', @@ -278,6 +308,12 @@ export const assetsList: Asset[] = [ unit, usdc, usdt, + vbnc, + vDOT, + vfil, + vglmr, + vksm, + vmovr, xrt, wbtc, weth, diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 9c258cd1..d5dd0fe5 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -48,6 +48,12 @@ import { unit, usdc, usdt, + vDOT, + vbnc, + vfil, + vglmr, + vksm, + vmovr, wbtc, weth, xrt, @@ -152,6 +158,18 @@ export const bifrostKusama = new Parachain({ asset: bnc, id: { Native: bnc.originSymbol }, }, + { + asset: vbnc, + id: { VToken: 'BNC' }, + }, + { + asset: vksm, + id: { VToken: 'KSM' }, + }, + { + asset: vmovr, + id: { VToken: 'MOVR' }, + }, ], ecosystem: Ecosystem.Kusama, genesisHash: @@ -173,6 +191,18 @@ export const bifrostPolkadot = new Parachain({ asset: bnc, id: { Native: bnc.originSymbol }, }, + { + asset: vDOT, + id: { VToken2: 0 }, + }, + { + asset: vfil, + id: { VToken2: 4 }, + }, + { + asset: vglmr, + id: { VToken2: 1 }, + }, ], ecosystem: Ecosystem.Polkadot, genesisHash: @@ -808,6 +838,22 @@ export const moonbeam = new EvmParachain({ asset: usdt, id: '311091173110107856861649819128533077277', }, + { + asset: vDOT, + id: '0xFFFfffFf15e1b7E3dF971DD813Bc394deB899aBf', + metadataId: 0, // no metadata for ERC20 tokens + }, + { + asset: vfil, + // id: '272547899416482196831721420898811311297', + id: '0xFffffFffCd0aD0EA6576B7b285295c85E94cf4c1', + metadataId: 0, // no metadata for ERC20 tokens + }, + { + asset: vglmr, + id: '0xFfFfFFff99dABE1a8De0EA22bAa6FD48fdE96F6c', + metadataId: 0, // no metadata for ERC20 tokens + }, { asset: wbtc, id: '0xE57eBd2d67B462E9926e04a8e33f01cD0D64346D', @@ -914,6 +960,21 @@ export const moonriver = new EvmParachain({ asset: xrt, id: '108036400430056508975016746969135344601', }, + { + asset: vbnc, + id: '0xFFffffff3646A00f78caDf8883c5A2791BfCDdc4', + metadataId: 0, + }, + { + asset: vksm, + id: '0xFFffffFFC6DEec7Fc8B11A2C8ddE9a59F8c62EFe', + metadataId: 0, + }, + { + asset: vmovr, + id: '0xfFfffFfF98e37bF6a393504b5aDC5B53B4D0ba11', + metadataId: 0, + }, ], ecosystem: Ecosystem.Kusama, genesisHash: diff --git a/packages/config/src/configs/bifrostKusama.ts b/packages/config/src/configs/bifrostKusama.ts index e43e799c..2fc3682b 100644 --- a/packages/config/src/configs/bifrostKusama.ts +++ b/packages/config/src/configs/bifrostKusama.ts @@ -4,7 +4,7 @@ import { ExtrinsicBuilder, FeeBuilder, } from '@moonbeam-network/xcm-builder'; -import { bnc, movr } from '../assets'; +import { bnc, movr, vbnc, vksm, vmovr } from '../assets'; import { bifrostKusama, moonriver } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -38,6 +38,54 @@ export const bifrostKusamaConfig = new ChainConfig({ }, min: AssetMinBuilder().assetRegistry().currencyMetadatas(), }), + new AssetConfig({ + asset: vbnc, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonriver, + destinationFee: { + amount: 0.2, + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + min: AssetMinBuilder().assetRegistry().currencyMetadatas(), + }), + new AssetConfig({ + asset: vksm, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonriver, + destinationFee: { + amount: 0.2, + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + min: AssetMinBuilder().assetRegistry().currencyMetadatas(), + }), + new AssetConfig({ + asset: vmovr, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonriver, + destinationFee: { + amount: 0.2, + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + min: AssetMinBuilder().assetRegistry().currencyMetadatas(), + }), ], chain: bifrostKusama, }); diff --git a/packages/config/src/configs/bifrostPolkadot.ts b/packages/config/src/configs/bifrostPolkadot.ts index 6db00afb..38564f92 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, glmr } from '../assets'; +import { bnc, glmr, vDOT, vfil, vglmr } from '../assets'; import { bifrostPolkadot, moonbeam } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -38,6 +38,54 @@ export const bifrostPolkadotConfig = new ChainConfig({ }, min: AssetMinBuilder().assetRegistry().currencyMetadatas(), }), + new AssetConfig({ + asset: vDOT, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbeam, + destinationFee: { + amount: 0.2, + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + min: AssetMinBuilder().assetRegistry().currencyMetadatas(), + }), + new AssetConfig({ + asset: vfil, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbeam, + destinationFee: { + amount: 0.2, + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(), + fee: { + asset: bnc, + balance: BalanceBuilder().substrate().system().account(), + }, + min: AssetMinBuilder().assetRegistry().currencyMetadatas(), + }), + new AssetConfig({ + asset: vglmr, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbeam, + destinationFee: { + amount: 0.2, + 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 fbc711d9..b64d318e 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -19,6 +19,9 @@ import { ring, usdc, usdt, + vDOT, + vfil, + vglmr, wbtc, weth, } from '../assets'; @@ -390,6 +393,51 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: vDOT, + balance: BalanceBuilder().evm().erc20(), + contract: ContractBuilder().Xtokens().transfer(), + destination: bifrostPolkadot, + destinationFee: { + amount: 0.0000001, + asset: vDOT, + balance: BalanceBuilder().evm().erc20(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + new AssetConfig({ + asset: vfil, + balance: BalanceBuilder().evm().erc20(), + contract: ContractBuilder().Xtokens().transfer(), + destination: bifrostPolkadot, + destinationFee: { + amount: 0.00000001, + asset: vfil, + balance: BalanceBuilder().evm().erc20(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + new AssetConfig({ + asset: vglmr, + balance: BalanceBuilder().evm().erc20(), + contract: ContractBuilder().Xtokens().transfer(), + destination: bifrostPolkadot, + destinationFee: { + amount: 0.00000001, + asset: vglmr, + balance: BalanceBuilder().evm().erc20(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: wbtc, balance: BalanceBuilder().evm().erc20(), diff --git a/packages/config/src/configs/moonriver.ts b/packages/config/src/configs/moonriver.ts index 0b68303f..4b556ee6 100644 --- a/packages/config/src/configs/moonriver.ts +++ b/packages/config/src/configs/moonriver.ts @@ -19,6 +19,9 @@ import { teer, tur, usdt, + vbnc, + vksm, + vmovr, xrt, } from '../assets'; import { @@ -429,6 +432,51 @@ export const moonriverConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: vbnc, + balance: BalanceBuilder().evm().erc20(), + contract: ContractBuilder().Xtokens().transfer(), + destination: bifrostKusama, + destinationFee: { + amount: 0.0001, + asset: vbnc, + balance: BalanceBuilder().evm().erc20(), + }, + fee: { + asset: movr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + new AssetConfig({ + asset: vksm, + balance: BalanceBuilder().evm().erc20(), + contract: ContractBuilder().Xtokens().transfer(), + destination: bifrostKusama, + destinationFee: { + amount: 0.0001, + asset: vksm, + balance: BalanceBuilder().evm().erc20(), + }, + fee: { + asset: movr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + new AssetConfig({ + asset: vmovr, + balance: BalanceBuilder().evm().erc20(), + contract: ContractBuilder().Xtokens().transfer(), + destination: bifrostKusama, + destinationFee: { + amount: 0.00000001, + asset: vmovr, + balance: BalanceBuilder().evm().erc20(), + }, + fee: { + asset: movr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), ], chain: moonriver, }); From 97be2938bfcbd9d7a8e225e6b8a162b748c08a77 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Fri, 22 Sep 2023 10:36:07 +0200 Subject: [PATCH 2/4] change asset names --- packages/config/src/assets.ts | 18 +++++++++--------- packages/config/src/chains.ts | 6 +++--- packages/config/src/configs/bifrostPolkadot.ts | 4 ++-- packages/config/src/configs/moonbeam.ts | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index 6e11f00e..f3c01f66 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -206,7 +206,7 @@ export const unit = new Asset({ }); export const usdc = new Asset({ - key: 'usdc', + key: 'usdcwh', originSymbol: 'USDC.Wh', }); @@ -231,32 +231,32 @@ export const wftm = new Asset({ }); export const vbnc = new Asset({ - key: 'xcvbnc', + key: 'vbnc', originSymbol: 'vBNC', }); -export const vDOT = new Asset({ - key: 'xcvdot', +export const vdot = new Asset({ + key: 'vdot', originSymbol: 'vDOT', }); export const vfil = new Asset({ - key: 'xcvfil', + key: 'vfil', originSymbol: 'vFIL', }); export const vglmr = new Asset({ - key: 'xcvglmr', + key: 'vglmr', originSymbol: 'vGLMR', }); export const vksm = new Asset({ - key: 'xcvksm', + key: 'vksm', originSymbol: 'vKSM', }); export const vmovr = new Asset({ - key: 'xcvmovr', + key: 'vmovr', originSymbol: 'vMOVR', }); @@ -309,7 +309,7 @@ export const assetsList: Asset[] = [ usdc, usdt, vbnc, - vDOT, + vdot, vfil, vglmr, vksm, diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index d5dd0fe5..1b5be37c 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -48,8 +48,8 @@ import { unit, usdc, usdt, - vDOT, vbnc, + vdot, vfil, vglmr, vksm, @@ -192,7 +192,7 @@ export const bifrostPolkadot = new Parachain({ id: { Native: bnc.originSymbol }, }, { - asset: vDOT, + asset: vdot, id: { VToken2: 0 }, }, { @@ -839,7 +839,7 @@ export const moonbeam = new EvmParachain({ id: '311091173110107856861649819128533077277', }, { - asset: vDOT, + asset: vdot, id: '0xFFFfffFf15e1b7E3dF971DD813Bc394deB899aBf', metadataId: 0, // no metadata for ERC20 tokens }, diff --git a/packages/config/src/configs/bifrostPolkadot.ts b/packages/config/src/configs/bifrostPolkadot.ts index 38564f92..02b7e896 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, glmr, vDOT, vfil, vglmr } from '../assets'; +import { bnc, glmr, vdot, vfil, vglmr } from '../assets'; import { bifrostPolkadot, moonbeam } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -39,7 +39,7 @@ export const bifrostPolkadotConfig = new ChainConfig({ min: AssetMinBuilder().assetRegistry().currencyMetadatas(), }), new AssetConfig({ - asset: vDOT, + asset: vdot, balance: BalanceBuilder().substrate().tokens().accounts(), destination: moonbeam, destinationFee: { diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index b64d318e..7182b306 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -19,7 +19,7 @@ import { ring, usdc, usdt, - vDOT, + vdot, vfil, vglmr, wbtc, @@ -394,13 +394,13 @@ export const moonbeamConfig = new ChainConfig({ }, }), new AssetConfig({ - asset: vDOT, + asset: vdot, balance: BalanceBuilder().evm().erc20(), contract: ContractBuilder().Xtokens().transfer(), destination: bifrostPolkadot, destinationFee: { amount: 0.0000001, - asset: vDOT, + asset: vdot, balance: BalanceBuilder().evm().erc20(), }, fee: { From 65ef45edaef1e677427a93c6af332b08cb8b8c20 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Fri, 22 Sep 2023 10:37:27 +0200 Subject: [PATCH 3/4] remove comment --- packages/config/src/chains.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 1b5be37c..92e5dbde 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -845,7 +845,6 @@ export const moonbeam = new EvmParachain({ }, { asset: vfil, - // id: '272547899416482196831721420898811311297', id: '0xFffffFffCd0aD0EA6576B7b285295c85E94cf4c1', metadataId: 0, // no metadata for ERC20 tokens }, From a137abd250b526ee1d1e16f0ff3b9d8a62860317 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Fri, 22 Sep 2023 11:11:46 +0200 Subject: [PATCH 4/4] add changeset --- .changeset/dirty-beans-share.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/dirty-beans-share.md diff --git a/.changeset/dirty-beans-share.md b/.changeset/dirty-beans-share.md new file mode 100644 index 00000000..664feea4 --- /dev/null +++ b/.changeset/dirty-beans-share.md @@ -0,0 +1,6 @@ +--- +'@moonbeam-network/xcm-config': patch +'@moonbeam-network/xcm-sdk': patch +--- + +Integrate Bifrost LSD assets