From 45b8fdaf6bd1c2699b59967bd5c534c0e5799399 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Wed, 27 Sep 2023 14:16:06 +0200 Subject: [PATCH 1/4] OriginTrail integration with moonbeam --- packages/config/src/chains.ts | 23 +++++++++++++++++ packages/config/src/configs/index.ts | 2 ++ packages/config/src/configs/moonbeam.ts | 17 +++++++++++++ packages/config/src/configs/originTrail.ts | 29 ++++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 packages/config/src/configs/originTrail.ts diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 92e5dbde..ff86603e 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -817,6 +817,10 @@ export const moonbeam = new EvmParachain({ asset: nodl, id: '309163521958167876851250718453738106865', }, + { + asset: otp, + id: '238111524681612888331172110363070489924', + }, { asset: para, id: '32615670524745285411807346420584982855', @@ -1022,6 +1026,24 @@ export const nodleEden = new Parachain({ ws: 'wss://node-7047027111071080448.jm.onfinality.io/ws?apikey=c49e30e4-3601-48f4-9629-57fa13cb97c0', }); +export const originTrail = new Parachain({ + assetsData: [ + { + asset: otp, + metadataId: 0, + palletInstance: 10, + }, + ], + ecosystem: Ecosystem.Polkadot, + genesisHash: + '0xe7e0962324a3b86c83404dbea483f25fb5dab4c224791c81b756cfc948006174', + key: 'origin-trail', + name: 'OriginTrail', + parachainId: 2043, + ss58Format: 101, + ws: 'wss://origintrail.api.onfinality.io/public-ws', +}); + export const originTrailAlphanet = new Parachain({ assetsData: [ { @@ -1288,6 +1310,7 @@ export const chainsList: AnyChain[] = [ moonriver, nodle, nodleEden, + originTrail, originTrailAlphanet, parallel, parallelHeiko, diff --git a/packages/config/src/configs/index.ts b/packages/config/src/configs/index.ts index d483bcf0..4d80eb2b 100644 --- a/packages/config/src/configs/index.ts +++ b/packages/config/src/configs/index.ts @@ -31,6 +31,7 @@ import { moonbeamConfig } from './moonbeam'; import { moonriverConfig } from './moonriver'; import { nodleConfig } from './nodle'; import { nodleEdenConfig } from './nodleEden'; +import { originTrailConfig } from './originTrail'; import { originTrailAlphanetConfig } from './originTrailAlphanet'; import { parallelConfig } from './parallel'; import { parallelHeikoConfig } from './parallelHeiko'; @@ -74,6 +75,7 @@ export const chainsConfigList: ChainConfig[] = [ moonriverConfig, nodleConfig, nodleEdenConfig, + originTrailConfig, originTrailAlphanetConfig, parallelConfig, parallelHeikoConfig, diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index 7182b306..2e3d3849 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -14,6 +14,7 @@ import { ibtc, intr, nodl, + otp, para, pha, ring, @@ -36,6 +37,7 @@ import { interlay, moonbeam, nodle, + originTrail, parallel, phala, polkadot, @@ -288,6 +290,21 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: otp, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: originTrail, + destinationFee: { + amount: 0.004, + asset: otp, + balance: BalanceBuilder().substrate().assets().account(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: para, balance: BalanceBuilder().substrate().assets().account(), diff --git a/packages/config/src/configs/originTrail.ts b/packages/config/src/configs/originTrail.ts new file mode 100644 index 00000000..5a1d2d8b --- /dev/null +++ b/packages/config/src/configs/originTrail.ts @@ -0,0 +1,29 @@ +import { + BalanceBuilder, + ExtrinsicBuilder, + FeeBuilder, +} from '@moonbeam-network/xcm-builder'; +import { otp } from '../assets'; +import { moonbeam, originTrail } from '../chains'; +import { AssetConfig } from '../types/AssetConfig'; +import { ChainConfig } from '../types/ChainConfig'; + +export const originTrailConfig = new ChainConfig({ + assets: [ + new AssetConfig({ + asset: otp, + balance: BalanceBuilder().substrate().system().account(), + destination: moonbeam, + destinationFee: { + amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(), + asset: otp, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder() + .polkadotXcm() + .limitedReserveTransferAssets() + .X1(), + }), + ], + chain: originTrail, +}); From 76ec3185d9e3f6466f236af9edf0473d72824343 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Wed, 27 Sep 2023 14:21:58 +0200 Subject: [PATCH 2/4] remove nodle eden integration due to not working nor necessary anymore --- packages/config/src/chains.ts | 23 ----------------- packages/config/src/configs/index.ts | 2 -- packages/config/src/configs/moonbaseAlpha.ts | 17 ------------- packages/config/src/configs/nodleEden.ts | 26 -------------------- 4 files changed, 68 deletions(-) delete mode 100644 packages/config/src/configs/nodleEden.ts diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index ff86603e..02e28c00 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -685,10 +685,6 @@ export const moonbaseAlpha = new EvmParachain({ asset: lit, id: '65216491554813189869575508812319036608', }, - { - asset: nodl, - id: '128910205779035707777113095265150484699', - }, { asset: otp, id: '238111524681612888331172110363070489924', @@ -1008,24 +1004,6 @@ export const nodle = new Parachain({ ws: 'wss://nodle-parachain.api.onfinality.io/public-ws', }); -export const nodleEden = new Parachain({ - assetsData: [ - { - asset: nodl, - id: 'NodleNative', - }, - ], - ecosystem: Ecosystem.AlphanetRelay, - genesisHash: - '0x3e1f1e6e22ab28e0ee6dc39f3bb3ea6dd2e8501790df0541a7e1fbad44d612ec', - isTestChain: true, - key: 'nodle-eden', - name: 'Nodle Eden', - parachainId: 2036, - ss58Format: 37, - ws: 'wss://node-7047027111071080448.jm.onfinality.io/ws?apikey=c49e30e4-3601-48f4-9629-57fa13cb97c0', -}); - export const originTrail = new Parachain({ assetsData: [ { @@ -1309,7 +1287,6 @@ export const chainsList: AnyChain[] = [ moonbeam, moonriver, nodle, - nodleEden, originTrail, originTrailAlphanet, parallel, diff --git a/packages/config/src/configs/index.ts b/packages/config/src/configs/index.ts index 4d80eb2b..f34e8852 100644 --- a/packages/config/src/configs/index.ts +++ b/packages/config/src/configs/index.ts @@ -30,7 +30,6 @@ import { moonbaseBetaConfig } from './moonbaseBeta'; import { moonbeamConfig } from './moonbeam'; import { moonriverConfig } from './moonriver'; import { nodleConfig } from './nodle'; -import { nodleEdenConfig } from './nodleEden'; import { originTrailConfig } from './originTrail'; import { originTrailAlphanetConfig } from './originTrailAlphanet'; import { parallelConfig } from './parallel'; @@ -74,7 +73,6 @@ export const chainsConfigList: ChainConfig[] = [ moonbeamConfig, moonriverConfig, nodleConfig, - nodleEdenConfig, originTrailConfig, originTrailAlphanetConfig, parallelConfig, diff --git a/packages/config/src/configs/moonbaseAlpha.ts b/packages/config/src/configs/moonbaseAlpha.ts index 93626368..20c44e93 100644 --- a/packages/config/src/configs/moonbaseAlpha.ts +++ b/packages/config/src/configs/moonbaseAlpha.ts @@ -5,7 +5,6 @@ import { eq, eqd, lit, - nodl, otp, paring, soon, @@ -21,7 +20,6 @@ import { litentryAlphanet, moonbaseAlpha, moonbaseBeta, - nodleEden, originTrailAlphanet, subsocialAlphanet, turingAlphanet, @@ -139,21 +137,6 @@ export const moonbaseAlphaConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), - new AssetConfig({ - asset: nodl, - balance: BalanceBuilder().substrate().assets().account(), - contract: ContractBuilder().Xtokens().transfer(), - destination: nodleEden, - destinationFee: { - amount: 0.02, - asset: nodl, - balance: BalanceBuilder().substrate().assets().account(), - }, - fee: { - asset: dev, - balance: BalanceBuilder().substrate().system().account(), - }, - }), new AssetConfig({ asset: otp, balance: BalanceBuilder().substrate().assets().account(), diff --git a/packages/config/src/configs/nodleEden.ts b/packages/config/src/configs/nodleEden.ts deleted file mode 100644 index a803187b..00000000 --- a/packages/config/src/configs/nodleEden.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { - BalanceBuilder, - ExtrinsicBuilder, - FeeBuilder, -} from '@moonbeam-network/xcm-builder'; -import { nodl } from '../assets'; -import { moonbaseAlpha, nodleEden } from '../chains'; -import { AssetConfig } from '../types/AssetConfig'; -import { ChainConfig } from '../types/ChainConfig'; - -export const nodleEdenConfig = new ChainConfig({ - assets: [ - new AssetConfig({ - asset: nodl, - balance: BalanceBuilder().substrate().system().account(), - destination: moonbaseAlpha, - destinationFee: { - amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(), - asset: nodl, - balance: BalanceBuilder().substrate().system().account(), - }, - extrinsic: ExtrinsicBuilder().xTokens().transfer(), - }), - ], - chain: nodleEden, -}); From 61e43480fab2ccfda8bfc2f031dfd23a9d67f4b7 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Wed, 27 Sep 2023 14:23:34 +0200 Subject: [PATCH 3/4] add changeset --- .changeset/thin-fishes-juggle.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/thin-fishes-juggle.md diff --git a/.changeset/thin-fishes-juggle.md b/.changeset/thin-fishes-juggle.md new file mode 100644 index 00000000..36e3620a --- /dev/null +++ b/.changeset/thin-fishes-juggle.md @@ -0,0 +1,6 @@ +--- +'@moonbeam-network/xcm-config': patch +'@moonbeam-network/xcm-sdk': patch +--- + +OriginTrail integration with Moonbeam - remove Nodle Eden integration with Moonbase From 53f957ae7c55ef3ed986ec8cf04a8fc23fd9f334 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Thu, 28 Sep 2023 09:12:12 +0200 Subject: [PATCH 4/4] remove image from readme --- packages/sdk/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/sdk/README.md b/packages/sdk/README.md index 136a0a66..6f265a7e 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -1,5 +1,3 @@ -![Moonbeam](https://docs.moonbeam.network/images/builders/interoperability/xcm/sdk/xcm-sdk-banner.png) - The Moonbeam XCM SDK enables developers to easily transfer assets between chains, either between parachains or between a parachain and the relay chain, within the Polkadot/Kusama ecosystem. With the SDK, you don't need to worry about determining the multilocation of the origin or destination assets or which extrinsics are used on which networks to send XCM transfers. The XCM SDK offers helper functions, that provide a very simple interface to execute XCM transfers between chains in the Polkadot/Kusama ecosystem. In addition, the XCM config package allows any parachain project to add their information in a standard way, so they can be immediately supported by the XCM SDK.