From be8f13a02806e9f63312d6d085219187a6807c28 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Thu, 23 Nov 2023 15:23:31 +0100 Subject: [PATCH] LDOT from Acala integration with Moonbeam --- packages/config/src/assets.ts | 6 ++++++ packages/config/src/chains.ts | 11 +++++++++++ packages/config/src/configs/acala.ts | 18 +++++++++++++++++- packages/config/src/configs/moonbeam.ts | 16 ++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index 3876cfce..085650ee 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -135,6 +135,11 @@ export const ksm = new Asset({ originSymbol: 'KSM', }); +export const ldot = new Asset({ + key: 'ldot', + originSymbol: 'LDOT', +}); + export const lit = new Asset({ key: 'lit', originSymbol: 'LIT', @@ -322,6 +327,7 @@ export const assetsList: Asset[] = [ kint, kma, ksm, + ldot, lit, mgx, movr, diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 4112cce5..6a9d117f 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -32,6 +32,7 @@ import { kint, kma, ksm, + ldot, lit, mgx, movr, @@ -84,6 +85,12 @@ export const acala = new Parachain({ metadataId: { ForeignAssetId: 0 }, minId: { ForeignAssetId: 0 }, }, + { + asset: ldot, + id: { Token: ldot.originSymbol }, + metadataId: { NativeAssetId: { Token: ldot.originSymbol } }, + minId: { NativeAssetId: { Token: ldot.originSymbol } }, + }, ], ecosystem: Ecosystem.Polkadot, genesisHash: @@ -840,6 +847,10 @@ export const moonbeam = new EvmParachain({ asset: intr, id: '101170542313601871197860408087030232491', }, + { + asset: ldot, + id: '225719522181998468294117309041779353812', + }, { asset: nodl, id: '309163521958167876851250718453738106865', diff --git a/packages/config/src/configs/acala.ts b/packages/config/src/configs/acala.ts index 92e2cdae..1ed10647 100644 --- a/packages/config/src/configs/acala.ts +++ b/packages/config/src/configs/acala.ts @@ -4,7 +4,7 @@ import { ExtrinsicBuilder, FeeBuilder, } from '@moonbeam-network/xcm-builder'; -import { aca, aseed, glmr } from '../assets'; +import { aca, aseed, glmr, ldot } from '../assets'; import { acala, moonbeam } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -54,6 +54,22 @@ export const acalaConfig = new ChainConfig({ }, min: AssetMinBuilder().assetRegistry().assetMetadatas(), }), + new AssetConfig({ + asset: ldot, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbeam, + destinationFee: { + amount: 0.005, + asset: ldot, + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + fee: { + asset: aca, + balance: BalanceBuilder().substrate().system().account(), + }, + min: AssetMinBuilder().assetRegistry().assetMetadatas(), + }), ], chain: acala, }); diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index 0e550fbc..cb4c693b 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -14,6 +14,7 @@ import { hdx, ibtc, intr, + ldot, nodl, otp, para, @@ -291,6 +292,21 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: ldot, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: acala, + destinationFee: { + amount: 0.001, + asset: ldot, + balance: BalanceBuilder().substrate().assets().account(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: nodl, balance: BalanceBuilder().substrate().assets().account(),