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

Zeitgeist - Moonbeam #152

Merged
merged 7 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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/stupid-islands-appear.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
---

Zeitgeist integration with Moonbeam
6 changes: 6 additions & 0 deletions packages/config/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ export const xrt = new Asset({
originSymbol: 'XRT',
});

export const ztg = new Asset({
key: 'ztg',
originSymbol: 'ZTG',
});

export const assetsList: Asset[] = [
aca,
alan,
Expand Down Expand Up @@ -342,6 +347,7 @@ export const assetsList: Asset[] = [
wbtc,
weth,
wftm,
ztg,
];

export const assetsMap = new Map<string, Asset>(
Expand Down
22 changes: 22 additions & 0 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import {
wbtc,
weth,
xrt,
ztg,
} from './assets';

export const acala = new Parachain({
Expand Down Expand Up @@ -898,6 +899,10 @@ export const moonbeam = new EvmParachain({
id: '0xab3f0245B83feB11d15AAffeFD7AD465a59817eD',
metadataId: 0, // no metadata for ERC20 tokens
},
{
asset: ztg,
id: '150874409661081770150564009349448205842',
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down Expand Up @@ -1307,6 +1312,22 @@ export const uniqueAlpha = new Parachain({
ws: 'wss://unique-alpha.unique.network',
});

export const zeitgeist = new Parachain({
assetsData: [
mmaurello marked this conversation as resolved.
Show resolved Hide resolved
{
asset: ztg,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
'0x1bf2a2ecb4a868de66ea8610f2ce7c8c43706561b6476031315f6640fe38e060',
key: 'zeitgeist',
name: 'Zeitgeist',
parachainId: 2092,
ss58Format: 73,
ws: 'wss://zeitgeist-rpc.dwellir.com',
});

export const chainsList: AnyChain[] = [
acala,
alphanetRelay,
Expand Down Expand Up @@ -1351,6 +1372,7 @@ export const chainsList: AnyChain[] = [
turing,
turingAlphanet,
uniqueAlpha,
zeitgeist,
];

export const chainsMap = new Map<string, AnyChain>(
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 @@ -43,6 +43,7 @@ import { shidenConfig } from './shiden';
import { turingConfig } from './turing';
import { turingAlphanetConfig } from './turingAlphanet';
import { uniqueAlphaConfig } from './uniqueAlpha';
import { zeitgeistConfig } from './zeitgeist';

export const chainsConfigList: ChainConfig[] = [
acalaConfig,
Expand Down Expand Up @@ -88,6 +89,7 @@ export const chainsConfigList: ChainConfig[] = [
turingConfig,
turingAlphanetConfig,
uniqueAlphaConfig,
zeitgeistConfig,
];

export const chainsConfigMap = new Map<string, ChainConfig>(
Expand Down
17 changes: 17 additions & 0 deletions packages/config/src/configs/moonbeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
vglmr,
wbtc,
weth,
ztg,
} from '../assets';
import {
acala,
Expand All @@ -44,6 +45,7 @@ import {
phala,
polkadot,
polkadotAssetHub,
zeitgeist,
} from '../chains';
import { AssetConfig } from '../types/AssetConfig';
import { ChainConfig } from '../types/ChainConfig';
Expand Down Expand Up @@ -528,6 +530,21 @@ export const moonbeamConfig = new ChainConfig({
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: ztg,
balance: BalanceBuilder().substrate().assets().account(),
contract: ContractBuilder().Xtokens().transfer(),
destination: zeitgeist,
destinationFee: {
amount: 0.01,
asset: ztg,
balance: BalanceBuilder().substrate().assets().account(),
},
fee: {
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
}),
],
chain: moonbeam,
});
26 changes: 26 additions & 0 deletions packages/config/src/configs/zeitgeist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {
BalanceBuilder,
ExtrinsicBuilder,
FeeBuilder,
} from '@moonbeam-network/xcm-builder';
import { ztg } from '../assets';
import { moonbeam, zeitgeist } from '../chains';
import { AssetConfig } from '../types/AssetConfig';
import { ChainConfig } from '../types/ChainConfig';

export const zeitgeistConfig = new ChainConfig({
assets: [
new AssetConfig({
asset: ztg,
balance: BalanceBuilder().substrate().system().account(),
destination: moonbeam,
destinationFee: {
amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(),
asset: ztg,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
],
chain: zeitgeist,
});
Loading