Skip to content

Commit

Permalink
Add peaq alphanet (#242)
Browse files Browse the repository at this point in the history
* add peaq alphanet

* add moonbase->peaq config

* fix the typo

* add to chainlist

* add missing config export

* -wip- fix config

* fix peaq config

* add changeset

* remomve redundant changeset

---------

Co-authored-by: Mario J Maurello <[email protected]>
Co-authored-by: mmaurello <[email protected]>
  • Loading branch information
3 people authored May 14, 2024
1 parent a883833 commit d8190e7
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-carrots-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@moonbeam-network/xcm-config': patch
---

Add PEAQ Alphanet configuration
6 changes: 6 additions & 0 deletions packages/config/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ export const aca = new Asset({
originSymbol: 'ACA',
});

export const agng = new Asset({
key: 'agng',
originSymbol: 'AGNG',
});

export const alan = new Asset({
key: 'alan',
originSymbol: 'ALAN',
Expand Down Expand Up @@ -358,6 +363,7 @@ export const ftmwh = new Asset({
export const assetsList: Asset[] = [
aca,
alan,
agng,
ampe,
aseed,
astr,
Expand Down
30 changes: 30 additions & 0 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from '@moonbeam-network/xcm-types';
import {
aca,
agng,
alan,
ampe,
aseed,
Expand Down Expand Up @@ -1232,6 +1233,34 @@ export const parallelHeiko = new Parachain({
ws: 'wss://heiko-rpc.parallel.fi',
});

export const peaqAlphanet = new Parachain({
assetsData: [
{
asset: agng,
id: 0,
},
{
asset: dev,
decimals: 18,
id: 1000,
},
{
asset: ftmwh,
decimals: 18,
id: 1001,
},
],
ecosystem: Ecosystem.AlphanetRelay,
genesisHash:
'0x2dfcd5c560f6db1667cbc2bc3791dfd337f88f400af6de39b1b8638ee7af6ed4',
isTestChain: true,
key: 'peaq-Alphanet',
name: 'Peaq Alphanet',
parachainId: 3013,
ss58Format: 42,
ws: 'wss://moonbeam.peaq.network',
});

export const pendulum = new Parachain({
assetsData: [
{
Expand Down Expand Up @@ -1567,6 +1596,7 @@ export const chainsList: AnyChain[] = [
originTrailAlphanet,
parallel,
parallelHeiko,
peaqAlphanet,
pendulum,
pendulumAlphanet,
phala,
Expand Down
2 changes: 2 additions & 0 deletions packages/config/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { nodleConfig } from './nodle';
import { originTrailAlphanetConfig } from './originTrailAlphanet';
import { parallelConfig } from './parallel';
import { parallelHeikoConfig } from './parallelHeiko';
import { peaqAlphanetConfig } from './peaqAlphanet';
import { pendulumConfig } from './pendulum';
import { pendulumAlphanetConfig } from './pendulumAlphanet';
import { phalaConfig } from './phala';
Expand Down Expand Up @@ -80,6 +81,7 @@ export const chainsConfigList: ChainConfig[] = [
originTrailAlphanetConfig,
parallelConfig,
parallelHeikoConfig,
peaqAlphanetConfig,
pendulumConfig,
pendulumAlphanetConfig,
phalaConfig,
Expand Down
42 changes: 42 additions & 0 deletions packages/config/src/configs/moonbaseAlpha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
moonbaseAlpha,
moonbaseBeta,
originTrailAlphanet,
peaqAlphanet,
pendulumAlphanet,
picassoAlphanet,
turingAlphanet,
Expand Down Expand Up @@ -238,6 +239,21 @@ export const moonbaseAlphaConfig = new ChainConfig({
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: ftmwh,
balance: BalanceBuilder().evm().erc20(),
contract: ContractBuilder().Xtokens().transfer(),
destination: peaqAlphanet,
destinationFee: {
amount: 0.01,
asset: ftmwh,
balance: BalanceBuilder().evm().erc20(),
},
fee: {
asset: dev,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: dev,
balance: BalanceBuilder().substrate().system().account(),
Expand All @@ -264,6 +280,32 @@ export const moonbaseAlphaConfig = new ChainConfig({
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: dev,
balance: BalanceBuilder().substrate().system().account(),
contract: ContractBuilder().Xtokens().transfer(),
destination: peaqAlphanet,
destinationFee: {
amount: 0.00000001,
asset: dev,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: ftmwh,
balance: BalanceBuilder().evm().erc20(),
contract: ContractBuilder().Xtokens().transfer(),
destination: peaqAlphanet,
destinationFee: {
amount: 0.01,
asset: ftmwh,
balance: BalanceBuilder().evm().erc20(),
},
fee: {
asset: dev,
balance: BalanceBuilder().substrate().system().account(),
},
}),
],
chain: moonbaseAlpha,
});
40 changes: 40 additions & 0 deletions packages/config/src/configs/peaqAlphanet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {
BalanceBuilder,
ExtrinsicBuilder,
} from '@moonbeam-network/xcm-builder';
import { agng, dev, ftmwh } from '../assets';
import { moonbaseAlpha, peaqAlphanet } from '../chains';
import { AssetConfig } from '../types/AssetConfig';
import { ChainConfig } from '../types/ChainConfig';

export const peaqAlphanetConfig = new ChainConfig({
assets: [
new AssetConfig({
asset: dev,
balance: BalanceBuilder().substrate().assets().account(),
destination: moonbaseAlpha,
destinationFee: {
amount: 0.01,
asset: dev,
balance: BalanceBuilder().substrate().assets().account(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetConfig({
asset: ftmwh,
balance: BalanceBuilder().substrate().assets().account(),
destination: moonbaseAlpha,
destinationFee: {
amount: 0.04,
asset: dev,
balance: BalanceBuilder().substrate().assets().account(),
},
extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(),
fee: {
asset: agng,
balance: BalanceBuilder().substrate().system().account(),
},
}),
],
chain: peaqAlphanet,
});

0 comments on commit d8190e7

Please sign in to comment.