diff --git a/.changeset/unlucky-tables-hammer.md b/.changeset/unlucky-tables-hammer.md new file mode 100644 index 00000000..1e0fcb14 --- /dev/null +++ b/.changeset/unlucky-tables-hammer.md @@ -0,0 +1,6 @@ +--- +'@moonbeam-network/xcm-config': patch +'@moonbeam-network/xcm-sdk': patch +--- + +Subsocial integration with Moonbeam diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index 085650ee..59ae920e 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -205,6 +205,11 @@ export const soon = new Asset({ originSymbol: 'SOON', }); +export const sub = new Asset({ + key: 'sub', + originSymbol: 'SUB', +}); + export const teer = new Asset({ key: 'teer', originSymbol: 'TEER', @@ -341,6 +346,7 @@ export const assetsList: Asset[] = [ rmrk, sdn, soon, + sub, teer, tt1, tur, diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 6a9d117f..6b2acd87 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -46,6 +46,7 @@ import { rmrk, sdn, soon, + sub, teer, tt1, tur, @@ -871,6 +872,10 @@ export const moonbeam = new EvmParachain({ asset: ring, id: '125699734534028342599692732320197985871', }, + { + asset: sub, + id: '89994634370519791027168048838578580624', + }, { asset: usdc, id: '0xFFfffffF7D2B0B761Af01Ca8e25242976ac0aD7D', @@ -1295,6 +1300,17 @@ export const shiden = new Parachain({ ws: 'wss://shiden-rpc.dwellir.com', }); +export const subsocial = new Parachain({ + ecosystem: Ecosystem.Polkadot, + genesisHash: + '0x4a12be580bb959937a1c7a61d5cf24428ed67fa571974b4007645d1886e7c89f', + key: 'subsocial', + name: 'Subsocial', + parachainId: 2101, + ss58Format: 28, + ws: 'wss://para.subsocial.network', +}); + export const turing = new Parachain({ assetsData: [ { @@ -1411,6 +1427,7 @@ export const chainsList: AnyChain[] = [ kusamaAssetHub, alphanetAssetHub, polkadotAssetHub, + subsocial, turing, turingAlphanet, uniqueAlpha, diff --git a/packages/config/src/configs/index.ts b/packages/config/src/configs/index.ts index 6d0fb03a..77538590 100644 --- a/packages/config/src/configs/index.ts +++ b/packages/config/src/configs/index.ts @@ -41,6 +41,7 @@ import { polkadotConfig } from './polkadot'; import { polkadotAssetHubConfig } from './polkadotAssetHub'; import { robonomicsConfig } from './robonomics'; import { shidenConfig } from './shiden'; +import { subsocialConfig } from './subsocial'; import { turingConfig } from './turing'; import { turingAlphanetConfig } from './turingAlphanet'; import { uniqueAlphaConfig } from './uniqueAlpha'; @@ -88,6 +89,7 @@ export const chainsConfigList: ChainConfig[] = [ alphanetAssetHubConfig, kusamaAssetHubConfig, polkadotAssetHubConfig, + subsocialConfig, turingConfig, turingAlphanetConfig, uniqueAlphaConfig, diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index cb4c693b..ea6c8878 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -20,6 +20,7 @@ import { para, pha, ring, + sub, usdc, usdcwh, usdt, @@ -47,6 +48,7 @@ import { phala, polkadot, polkadotAssetHub, + subsocial, zeitgeist, } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; @@ -577,6 +579,21 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: sub, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: subsocial, + destinationFee: { + amount: 0.1, + asset: sub, + balance: BalanceBuilder().substrate().assets().account(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), ], chain: moonbeam, }); diff --git a/packages/config/src/configs/subsocial.ts b/packages/config/src/configs/subsocial.ts new file mode 100644 index 00000000..882f87fa --- /dev/null +++ b/packages/config/src/configs/subsocial.ts @@ -0,0 +1,29 @@ +import { + BalanceBuilder, + ExtrinsicBuilder, + FeeBuilder, +} from '@moonbeam-network/xcm-builder'; +import { sub } from '../assets'; +import { moonbeam, subsocial } from '../chains'; +import { AssetConfig } from '../types/AssetConfig'; +import { ChainConfig } from '../types/ChainConfig'; + +export const subsocialConfig = new ChainConfig({ + assets: [ + new AssetConfig({ + asset: sub, + balance: BalanceBuilder().substrate().system().account(), + destination: moonbeam, + destinationFee: { + amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(), + asset: sub, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder() + .polkadotXcm() + .limitedReserveTransferAssets() + .here(), + }), + ], + chain: subsocial, +});