Skip to content

Commit

Permalink
Subsocial integration with Moonbeam
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Dec 1, 2023
1 parent 41fd972 commit 315db7c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/config/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -341,6 +346,7 @@ export const assetsList: Asset[] = [
rmrk,
sdn,
soon,
sub,
teer,
tt1,
tur,
Expand Down
17 changes: 17 additions & 0 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
rmrk,
sdn,
soon,
sub,
teer,
tt1,
tur,
Expand Down Expand Up @@ -871,6 +872,10 @@ export const moonbeam = new EvmParachain({
asset: ring,
id: '125699734534028342599692732320197985871',
},
{
asset: sub,
id: '89994634370519791027168048838578580624',
},
{
asset: usdc,
id: '0xFFfffffF7D2B0B761Af01Ca8e25242976ac0aD7D',
Expand Down Expand Up @@ -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: [
{
Expand Down Expand Up @@ -1411,6 +1427,7 @@ export const chainsList: AnyChain[] = [
kusamaAssetHub,
alphanetAssetHub,
polkadotAssetHub,
subsocial,
turing,
turingAlphanet,
uniqueAlpha,
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 @@ -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';
Expand Down Expand Up @@ -88,6 +89,7 @@ export const chainsConfigList: ChainConfig[] = [
alphanetAssetHubConfig,
kusamaAssetHubConfig,
polkadotAssetHubConfig,
subsocialConfig,
turingConfig,
turingAlphanetConfig,
uniqueAlphaConfig,
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 @@ -20,6 +20,7 @@ import {
para,
pha,
ring,
sub,
usdc,
usdcwh,
usdt,
Expand Down Expand Up @@ -47,6 +48,7 @@ import {
phala,
polkadot,
polkadotAssetHub,
subsocial,
zeitgeist,
} from '../chains';
import { AssetConfig } from '../types/AssetConfig';
Expand Down Expand Up @@ -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,
});
29 changes: 29 additions & 0 deletions packages/config/src/configs/subsocial.ts
Original file line number Diff line number Diff line change
@@ -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,
});

0 comments on commit 315db7c

Please sign in to comment.