diff --git a/packages/apps-config/src/api/spec/index.ts b/packages/apps-config/src/api/spec/index.ts index 5142cca2f0..c0bd6ea6a7 100644 --- a/packages/apps-config/src/api/spec/index.ts +++ b/packages/apps-config/src/api/spec/index.ts @@ -78,6 +78,7 @@ import snowbridge from './snowbridge'; import soraSubstrate from './soraSubstrate'; import stafi from './stafi'; import subdao from './subdao'; +import subgame from './subgame'; import subsocial from './subsocial'; import ternoa from './ternoa'; import trustbase from './trustbase'; @@ -191,6 +192,7 @@ const spec: Record = { stafi, steam: eave, subdao, + subgame, subsocial, subzero: zero, ternoa, diff --git a/packages/apps-config/src/api/spec/subgame.ts b/packages/apps-config/src/api/spec/subgame.ts new file mode 100644 index 0000000000..b3443ed5c5 --- /dev/null +++ b/packages/apps-config/src/api/spec/subgame.ts @@ -0,0 +1,56 @@ +// Copyright 2017-2021 @polkadot/apps-config authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { OverrideBundleDefinition } from '@polkadot/types/types'; + +// structs need to be in order +/* eslint-disable sort-keys */ + +const definitions: OverrideBundleDefinition = { + types: [ + { + // on all versions + minmax: [0, undefined], + types: { + GameIndex: 'u32', + GameMode: 'u8', + CommodityId: 'u128', + CommodityInfo: 'Vec', + CommodityLimit: 'u128', + UserCommodityLimit: 'u64', + ChipBalance: 'u128', + ChipsDetail: { + balance: 'u128', + reserve: 'u128' + }, + GameInfo: { + owner: 'AccountId', + block_number: 'u32', + bet_block_number: 'u32', + amount: 'u128' + }, + BetInfo: { + user: 'AccountId', + game_id: 'u32', + amount: 'u128', + game_mode: 'u8' // 1 = odd , 2 = even + }, + Template: { + template_id: 'u32', + template_name: 'Vec' + }, + GameInstance: { + game_instance_id: 'u32', + owner: 'AccountId', + bet_block_number: 'u32', + chips_pool: 'u128', + game_over: 'bool' + }, + GameInstanceId: 'u32', + AccountInfo: 'AccountInfoWithDualRefCount' + } + } + ] +}; + +export default definitions; diff --git a/packages/apps-config/src/endpoints/production.ts b/packages/apps-config/src/endpoints/production.ts index dd72892b08..12f347dd06 100644 --- a/packages/apps-config/src/endpoints/production.ts +++ b/packages/apps-config/src/endpoints/production.ts @@ -145,6 +145,13 @@ export function createProduction (t: TFunction, firstOnly?: boolean): LinkOption 'Patract Elara': 'wss://stafi.elara.patract.io' } }, + { + info: 'subgame', + text: t('rpc.prod.subgame', 'SubGame', { ns: 'apps-config' }), + providers: { + SubGame: 'wss://mainnet.subgame.org/' + } + }, { info: 'subsocial', text: t('rpc.prod.subsocial', 'Subsocial', { ns: 'apps-config' }), diff --git a/packages/apps-config/src/endpoints/productionRelayKusama.ts b/packages/apps-config/src/endpoints/productionRelayKusama.ts index 11a8566ab4..68706b977d 100644 --- a/packages/apps-config/src/endpoints/productionRelayKusama.ts +++ b/packages/apps-config/src/endpoints/productionRelayKusama.ts @@ -193,6 +193,15 @@ export function createKusama (t: TFunction): EndpointOption { providers: { StakeTechnologies: 'wss://rpc.shiden.plasmnet.io' } + }, + { + info: 'subgame', + homepage: 'http://subgame.org/', + paraId: 2018, + text: t('rpc.kusama.subgame', 'SubGame Gamma', { ns: 'apps-config' }), + providers: { + SubGame: 'wss://gamma.subgame.org/' + } } ] }; diff --git a/packages/apps-config/src/endpoints/testing.ts b/packages/apps-config/src/endpoints/testing.ts index 317a823fe0..e629b28af1 100644 --- a/packages/apps-config/src/endpoints/testing.ts +++ b/packages/apps-config/src/endpoints/testing.ts @@ -345,6 +345,13 @@ export function createTesting (t: TFunction, firstOnly?: boolean): LinkOption[] Soramitsu: 'wss://ws.stage.sora2.soramitsu.co.jp' } }, + { + info: 'subgame', + text: t('rpc.test.subgame', 'SubGame Staging', { ns: 'apps-config' }), + providers: { + SubGame: 'wss://staging.subgame.org' + } + }, { info: 'ternoa-chaos', text: t('rpc.test.ternoa-chaos', 'Ternoa Chaos', { ns: 'apps-config' }), diff --git a/packages/apps-config/src/ui/colors.ts b/packages/apps-config/src/ui/colors.ts index bc7cfdb3bf..f6e0d7a609 100644 --- a/packages/apps-config/src/ui/colors.ts +++ b/packages/apps-config/src/ui/colors.ts @@ -139,6 +139,7 @@ const nodeWestlake = chainWestlake; const nodeZeitgeist = 'linear-gradient(180deg, rgba(32,90,172,1) 0%, rgba(26,72,138,1) 50%, rgba(13,36,69,1) 100%)'; const nodeZero = '#0099cc'; const nodeZenlink = 'linear-gradient(45deg, #F20082 0%, #FF4D4D 100%)'; +const nodeSubGame = '#EB027D'; // based on the spec name const specShell = '#2e86ab'; // '#0596FC'; @@ -251,6 +252,9 @@ export const chainColors: Record = Object.entries({ 'Statemint Test': specStatemint, 'Steam PC': chainRococoEave, 'SubDAO PC1': chainSubDAO, + subgame: nodeSubGame, + 'SubGame Gamma': nodeSubGame, + 'SubGame Staging': nodeSubGame, 'Subsocial PC1': chainSubsocial, Tick: chainRoccoTick, Track: chainRoccoTrack, @@ -325,6 +329,9 @@ export const nodeColors = Object.entries({ 'Statemine Collator': specStatemint, 'Statemint Collator': specStatemint, 'SubDAO Collator': nodeSubDAO, + subgame: nodeSubGame, + 'SubGame Gamma': nodeSubGame, + 'SubGame Staging': nodeSubGame, 'subsocial node': nodeSubsocial, 'subzero node': nodeZero, 'Ternoa Node': nodeTernoa, diff --git a/packages/apps-config/src/ui/logos/index.ts b/packages/apps-config/src/ui/logos/index.ts index dea7a68945..9759e67389 100644 --- a/packages/apps-config/src/ui/logos/index.ts +++ b/packages/apps-config/src/ui/logos/index.ts @@ -105,6 +105,7 @@ import nodeSora from './nodes/sora-substrate.svg'; import nodeStafi from './nodes/stafi.png'; import nodeStatemine from './nodes/statemine.svg'; import nodeSubDAO from './nodes/subdao.png'; +import nodeSubGame from './nodes/subgame.svg'; import nodeSubsocial from './nodes/subsocial.svg'; import nodeSubstrate from './nodes/substrate-hexagon.svg'; import nodeTernoa from './nodes/ternoa.svg'; @@ -206,6 +207,9 @@ export const chainLogos = Object.entries({ 'Statemint Test': nodeStatemine, 'Steam PC': nodeEave, 'SubDAO PC1': nodeSubDAO, + subgame: nodeSubGame, + 'SubGame Gamma': nodeSubGame, + 'SubGame Staging': nodeSubGame, Subsocial: nodeSubsocial, 'Subsocial PC': nodeSubsocial, Tick: chainRococoTick, @@ -328,6 +332,9 @@ export const nodeLogos = Object.entries({ 'Statemine Collator': nodeStatemine, 'Statemint Collator': nodeStatemine, 'SubDAO Collator': nodeSubDAO, + subgame: nodeSubGame, + 'SubGame Gamma': nodeSubGame, + 'SubGame Staging': nodeSubGame, 'Subsocial Node': nodeSubsocial, 'Subsocial PC': nodeSubsocial, 'subsocial-node': nodeSubsocial, @@ -506,6 +513,9 @@ export const namedLogos: Record = { stafi: nodeStafi, statemine: nodeStatemine, statemint: nodeStatemine, + subgame: nodeSubGame, + 'SubGame Gamma': nodeSubGame, + 'SubGame Staging': nodeSubGame, subsocial: nodeSubsocial, substrate: nodeSubstrate, 'ternoa-chaos': nodeTernoa, diff --git a/packages/apps-config/src/ui/logos/nodes/subgame.svg b/packages/apps-config/src/ui/logos/nodes/subgame.svg new file mode 100644 index 0000000000..a96181a582 --- /dev/null +++ b/packages/apps-config/src/ui/logos/nodes/subgame.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/apps/public/locales/en/apps-config.json b/packages/apps/public/locales/en/apps-config.json index 21c3864d37..e53c9d03ef 100644 --- a/packages/apps/public/locales/en/apps-config.json +++ b/packages/apps/public/locales/en/apps-config.json @@ -29,6 +29,7 @@ "rpc.kusama.shell": "Shell", "rpc.kusama.sherpax": "SherpaX", "rpc.kusama.shiden": "Shiden", + "rpc.kusama.subgame": "SubGame Gamma", "rpc.kusama.statemine": "Statemine", "rpc.kylin-node.co.uk": "Kylin Network", "rpc.manta": "Manta Testnet", @@ -55,6 +56,7 @@ "rpc.prod.riochain": "RioChain", "rpc.prod.sora-substrate": "SORA", "rpc.prod.stafi": "Stafi", + "rpc.prod.subgame": "SubGame", "rpc.prod.subsocial": "Subsocial", "rpc.prod.uniarts": "UniArts", "rpc.prod.westlake": "Westlake", @@ -151,6 +153,7 @@ "rpc.test.realis": "Realis.Network", "rpc.test.riochain": "RioChain", "rpc.test.sora-substrate-staging": "SORA-staging", + "rpc.test.subgame": "SubGame Staging", "rpc.test.ternoa-chaos": "Ternoa Chaos", "rpc.test.turbulence": "Turbulence", "rpc.test.uniarts": "UniArts",