ghost-portal/packages/apps-config/src/endpoints/index.ts
Jaco 3d6b6734dc
Chain types CI check (#5460)
* Chain types CI check

* SLOW for test
2021-06-05 13:58:33 +02:00

65 lines
1.8 KiB
TypeScript

// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { TFunction } from 'i18next';
import type { LinkOption } from './types';
import { createCustom, createDev, createOwn } from './development';
import { createProduction } from './production';
import { createProductionRelays } from './productionRelays';
import { createTesting } from './testing';
import { createTestingRelays } from './testingRelays';
export { CUSTOM_ENDPOINT_KEY } from './development';
export function createWsEndpoints (t: TFunction, firstOnly?: boolean): LinkOption[] {
return [
...createCustom(t),
{
isDisabled: false,
isHeader: true,
isSpaced: true,
text: t('rpc.header.live.relay', 'Live relays & parachains', { ns: 'apps-config' }),
textBy: '',
value: ''
},
...createProductionRelays(t, firstOnly),
{
isDisabled: false,
isHeader: true,
text: t('rpc.header.test.relay', 'Test relays & parachains', { ns: 'apps-config' }),
textBy: '',
value: ''
},
...createTestingRelays(t, firstOnly),
{
isDisabled: false,
isHeader: true,
isSpaced: true,
text: t('rpc.header.live', 'Live networks', { ns: 'apps-config' }),
textBy: '',
value: ''
},
...createProduction(t, firstOnly),
{
isDisabled: false,
isHeader: true,
text: t('rpc.header.test', 'Test networks', { ns: 'apps-config' }),
textBy: '',
value: ''
},
...createTesting(t, firstOnly),
{
isDevelopment: true,
isDisabled: false,
isHeader: true,
isSpaced: true,
text: t('rpc.header.dev', 'Development', { ns: 'apps-config' }),
textBy: '',
value: ''
},
...createDev(t),
...createOwn(t)
].filter(({ isDisabled }) => !isDisabled);
}