Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bifrost LSD assets integration #137

Merged
merged 4 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/dirty-beans-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@moonbeam-network/xcm-config': patch
'@moonbeam-network/xcm-sdk': patch
---

Integrate Bifrost LSD assets
40 changes: 38 additions & 2 deletions packages/config/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ export const unit = new Asset({
});

export const usdc = new Asset({
key: 'usdc',
originSymbol: 'USDC',
key: 'usdcwh',
originSymbol: 'USDC.Wh',
});

export const usdt = new Asset({
Expand All @@ -230,6 +230,36 @@ export const wftm = new Asset({
originSymbol: 'wFTM',
});

export const vbnc = new Asset({
key: 'vbnc',
originSymbol: 'vBNC',
});

export const vdot = new Asset({
key: 'vdot',
originSymbol: 'vDOT',
});

export const vfil = new Asset({
key: 'vfil',
originSymbol: 'vFIL',
});

export const vglmr = new Asset({
key: 'vglmr',
originSymbol: 'vGLMR',
});

export const vksm = new Asset({
key: 'vksm',
originSymbol: 'vKSM',
});

export const vmovr = new Asset({
key: 'vmovr',
originSymbol: 'vMOVR',
});

export const xrt = new Asset({
key: 'xrt',
originSymbol: 'XRT',
Expand Down Expand Up @@ -278,6 +308,12 @@ export const assetsList: Asset[] = [
unit,
usdc,
usdt,
vbnc,
vdot,
vfil,
vglmr,
vksm,
vmovr,
xrt,
wbtc,
weth,
Expand Down
60 changes: 60 additions & 0 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ import {
unit,
usdc,
usdt,
vbnc,
vdot,
vfil,
vglmr,
vksm,
vmovr,
wbtc,
weth,
xrt,
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -808,6 +838,21 @@ export const moonbeam = new EvmParachain({
asset: usdt,
id: '311091173110107856861649819128533077277',
},
{
asset: vdot,
id: '0xFFFfffFf15e1b7E3dF971DD813Bc394deB899aBf',
metadataId: 0, // no metadata for ERC20 tokens
},
{
asset: vfil,
id: '0xFffffFffCd0aD0EA6576B7b285295c85E94cf4c1',
metadataId: 0, // no metadata for ERC20 tokens
},
{
asset: vglmr,
id: '0xFfFfFFff99dABE1a8De0EA22bAa6FD48fdE96F6c',
metadataId: 0, // no metadata for ERC20 tokens
},
{
asset: wbtc,
id: '0xE57eBd2d67B462E9926e04a8e33f01cD0D64346D',
Expand Down Expand Up @@ -914,6 +959,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:
Expand Down
50 changes: 49 additions & 1 deletion packages/config/src/configs/bifrostKusama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
});
50 changes: 49 additions & 1 deletion packages/config/src/configs/bifrostPolkadot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
});
48 changes: 48 additions & 0 deletions packages/config/src/configs/moonbeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import {
ring,
usdc,
usdt,
vdot,
vfil,
vglmr,
wbtc,
weth,
} from '../assets';
Expand Down Expand Up @@ -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(),
Expand Down
Loading
Loading