mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-11-01 06:09:49 +00:00
The connection list showed Pezkuwi, Zagros and Dicle; Dicle was never launched (none of its six RPC hosts resolves). The foreign endpoint lists inherited from upstream (prodChains, testChains, Paseo, zkVerify) were exported but used nowhere. Both are removed; the resulting list is the previous one without the Dicle header and its six entries.
75 lines
2.1 KiB
TypeScript
75 lines
2.1 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/apps-config authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { TFunction, TOptions } from '../types.js';
|
|
import type { LinkOption } from './types.js';
|
|
|
|
import { createCustom, createDev, createOwn } from './development.js';
|
|
import { prodRelayPezkuwi } from './production.js';
|
|
import { testRelayZagros } from './testing.js';
|
|
import { expandEndpoints } from './util.js';
|
|
|
|
export { CUSTOM_ENDPOINT_KEY } from './development.js';
|
|
export * from './production.js';
|
|
export * from './testing.js';
|
|
|
|
function defaultT (keyOrText: string, textOrOptions?: string | TOptions, options?: TOptions): string {
|
|
// as TFunction: the second argument is either the default text or the options
|
|
const [text, opts] = typeof textOrOptions === 'string'
|
|
? [textOrOptions, options]
|
|
: [undefined, textOrOptions];
|
|
|
|
return (
|
|
(opts?.replace?.host as string) ||
|
|
text ||
|
|
keyOrText
|
|
);
|
|
}
|
|
|
|
export function createWsEndpoints (t: TFunction = defaultT, firstOnly = false, withSort = true): LinkOption[] {
|
|
return [
|
|
...createCustom(t),
|
|
{
|
|
isDisabled: false,
|
|
isHeader: true,
|
|
isSpaced: true,
|
|
text: t('rpc.header.favorite', 'Favorite chains', { ns: 'apps-config' }),
|
|
textBy: '',
|
|
ui: {},
|
|
value: ''
|
|
},
|
|
{
|
|
isDisabled: false,
|
|
isHeader: true,
|
|
isSpaced: true,
|
|
text: t('rpc.header.pezkuwi.relay', 'Pezkuwi & teyrchains', { ns: 'apps-config' }),
|
|
textBy: '',
|
|
ui: {},
|
|
value: ''
|
|
},
|
|
...expandEndpoints(t, [prodRelayPezkuwi], firstOnly, withSort),
|
|
{
|
|
isDisabled: false,
|
|
isHeader: true,
|
|
isSpaced: true,
|
|
text: t('rpc.header.zagros.relay', 'Test Zagros & teyrchains', { ns: 'apps-config' }),
|
|
textBy: '',
|
|
ui: {},
|
|
value: ''
|
|
},
|
|
...expandEndpoints(t, [testRelayZagros], firstOnly, withSort),
|
|
{
|
|
isDevelopment: true,
|
|
isDisabled: false,
|
|
isHeader: true,
|
|
isSpaced: true,
|
|
text: t('rpc.header.dev', 'Development', { ns: 'apps-config' }),
|
|
textBy: '',
|
|
ui: {},
|
|
value: ''
|
|
},
|
|
...createDev(t),
|
|
...createOwn(t)
|
|
].filter(({ isDisabled }) => !isDisabled);
|
|
}
|