From c82166829ee427452ee97a92ab7074daa608c9b1 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Tue, 26 Dec 2023 16:52:59 +1300 Subject: [PATCH] -wip- initial commit --- packages/config/src/assets.ts | 6 +++ packages/config/src/chains.ts | 30 ++++++++++++++ packages/config/src/configs/index.ts | 2 + packages/config/src/configs/moonbaseAlpha.ts | 28 +++++++++++++ .../config/src/configs/pendulumAlphanet.ts | 41 +++++++++++++++++++ 5 files changed, 107 insertions(+) create mode 100644 packages/config/src/configs/pendulumAlphanet.ts diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index 59ae920e..cc0da809 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -10,6 +10,11 @@ export const alan = new Asset({ originSymbol: 'ALAN', }); +export const ampe = new Asset({ + key: 'ampe', + originSymbol: 'AMPE', +}); + export const astr = new Asset({ key: 'astr', originSymbol: 'ASTR', @@ -308,6 +313,7 @@ export const ztg = new Asset({ export const assetsList: Asset[] = [ aca, alan, + ampe, astr, atom, auq, diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 6b2acd87..896da50f 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -7,6 +7,7 @@ import { import { aca, alan, + ampe, aseed, astr, atom, @@ -689,6 +690,10 @@ export const moonbaseAlpha = new EvmParachain({ id: '0x9133c5a22024118804089f1fB752b7B2ce2a6351', metadataId: 0, // no metadata for ERC20 tokens }, + { + asset: ampe, + id: '170050401128744171791743427490841452054', + }, { asset: atom, id: '244316754493307480955066032215622931381', @@ -1150,6 +1155,30 @@ export const parallelHeiko = new Parachain({ ws: 'wss://heiko-rpc.parallel.fi', }); +export const pendulumAlphanet = new Parachain({ + assetsData: [ + { + asset: ampe, + id: 'Native', + metadataId: 0, + }, + { + asset: dev, + decimals: 18, + id: { XCM: 1 }, + }, + ], + ecosystem: Ecosystem.AlphanetRelay, + genesisHash: + '0x3db2074093ab964732631d842b99d6612a6dc75a379738a660642b05ccad59c8', + isTestChain: true, + key: 'pendulum-alphanet', + name: 'Foucoco', + parachainId: 2124, + ss58Format: 49, + ws: 'wss://moonbeam-00.pendulumchain.tech:443', +}); + export const phala = new Parachain({ assetsData: [ { @@ -1418,6 +1447,7 @@ export const chainsList: AnyChain[] = [ originTrailAlphanet, parallel, parallelHeiko, + pendulumAlphanet, phala, picasso, picassoAlphanet, diff --git a/packages/config/src/configs/index.ts b/packages/config/src/configs/index.ts index 77538590..f1597b49 100644 --- a/packages/config/src/configs/index.ts +++ b/packages/config/src/configs/index.ts @@ -34,6 +34,7 @@ import { originTrailConfig } from './originTrail'; import { originTrailAlphanetConfig } from './originTrailAlphanet'; import { parallelConfig } from './parallel'; import { parallelHeikoConfig } from './parallelHeiko'; +import { pendulumAlphanetConfig } from './pendulumAlphanet'; import { phalaConfig } from './phala'; import { picassoConfig } from './picasso'; import { picassoAlphanetConfig } from './picassoAlphanet'; @@ -80,6 +81,7 @@ export const chainsConfigList: ChainConfig[] = [ originTrailAlphanetConfig, parallelConfig, parallelHeikoConfig, + pendulumAlphanetConfig, phalaConfig, picassoConfig, picassoAlphanetConfig, diff --git a/packages/config/src/configs/moonbaseAlpha.ts b/packages/config/src/configs/moonbaseAlpha.ts index ee4d7478..dc0d36c9 100644 --- a/packages/config/src/configs/moonbaseAlpha.ts +++ b/packages/config/src/configs/moonbaseAlpha.ts @@ -1,6 +1,7 @@ import { BalanceBuilder, ContractBuilder } from '@moonbeam-network/xcm-builder'; import { alan, + ampe, atom, dev, eq, @@ -22,6 +23,7 @@ import { moonbaseAlpha, moonbaseBeta, originTrailAlphanet, + pendulumAlphanet, picassoAlphanet, turingAlphanet, } from '../chains'; @@ -63,6 +65,17 @@ export const moonbaseAlphaConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: dev, + balance: BalanceBuilder().substrate().system().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: pendulumAlphanet, + destinationFee: { + amount: 0.0000001, // TODO + asset: dev, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: dev, balance: BalanceBuilder().substrate().system().account(), @@ -104,6 +117,21 @@ export const moonbaseAlphaConfig = new ChainConfig({ // balance: BalanceBuilder().substrate().system().account(), // }, // }), + new AssetConfig({ + asset: ampe, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: pendulumAlphanet, + destinationFee: { + amount: 0.1, // TODO + asset: ampe, + balance: BalanceBuilder().substrate().assets().account(), + }, + fee: { + asset: dev, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: eq, balance: BalanceBuilder().substrate().assets().account(), diff --git a/packages/config/src/configs/pendulumAlphanet.ts b/packages/config/src/configs/pendulumAlphanet.ts new file mode 100644 index 00000000..6827d549 --- /dev/null +++ b/packages/config/src/configs/pendulumAlphanet.ts @@ -0,0 +1,41 @@ +import { + BalanceBuilder, + ExtrinsicBuilder, + FeeBuilder, +} from '@moonbeam-network/xcm-builder'; +import { ampe, dev } from '../assets'; +import { moonbaseAlpha, pendulumAlphanet } from '../chains'; +import { AssetConfig } from '../types/AssetConfig'; +import { ChainConfig } from '../types/ChainConfig'; + +export const pendulumAlphanetConfig = new ChainConfig({ + assets: [ + new AssetConfig({ + asset: ampe, + balance: BalanceBuilder().substrate().system().account(), + destination: moonbaseAlpha, + destinationFee: { + amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(), + asset: ampe, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), + new AssetConfig({ + asset: dev, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbaseAlpha, + destinationFee: { + amount: 0.01, + asset: dev, + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + fee: { + asset: ampe, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + ], + chain: pendulumAlphanet, +});