From ff3ea32d43f82a9d5d6a3ec3676fa605212d25c1 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Thu, 25 Jan 2024 09:44:11 +0100 Subject: [PATCH] Add Paseo testnet (#10200) * Add Paseo Testnet * include locale * Update packages/apps-config/src/api/constants.ts Co-authored-by: Jaco * lint * Update packages/apps-config/src/endpoints/index.ts Co-authored-by: Jaco --------- Co-authored-by: Jaco --- packages/apps-config/src/api/constants.ts | 2 + packages/apps-config/src/endpoints/index.ts | 11 +++ .../src/endpoints/testingRelayPaseo.ts | 69 +++++++++++++++++++ .../apps/public/locales/en/apps-config.json | 1 + 4 files changed, 83 insertions(+) create mode 100644 packages/apps-config/src/endpoints/testingRelayPaseo.ts diff --git a/packages/apps-config/src/api/constants.ts b/packages/apps-config/src/api/constants.ts index 05e313f82f00..1d918da362f9 100644 --- a/packages/apps-config/src/api/constants.ts +++ b/packages/apps-config/src/api/constants.ts @@ -23,6 +23,8 @@ export const POLKADOT_DENOM_BLOCK = new BN(1248328); export const ROCOCO_GENESIS = getGenesis('rococo'); +export const PASEO_GENESIS = '0x74300973617e2936e22d46e94fee5016a1a514747ae108277b770d02b47d37d9'; + export const WESTEND_GENESIS = getGenesis('westend'); export const NEATCOIN_GENESIS = '0xfbb541421d30423c9a753ffa844b64fd44d823f513bf49e3b73b3a656309a595'; diff --git a/packages/apps-config/src/endpoints/index.ts b/packages/apps-config/src/endpoints/index.ts index e17bab0db779..3e9988d4f59d 100644 --- a/packages/apps-config/src/endpoints/index.ts +++ b/packages/apps-config/src/endpoints/index.ts @@ -7,6 +7,7 @@ import type { LinkOption } from './types.js'; import { createCustom, createDev, createOwn } from './development.js'; import { prodChains, prodRelayKusama, prodRelayPolkadot } from './production.js'; import { testChains, testRelayRococo, testRelayWestend } from './testing.js'; +import { testRelayPaseo } from './testingRelayPaseo.js'; import { expandEndpoints } from './util.js'; export { CUSTOM_ENDPOINT_KEY } from './development.js'; @@ -62,6 +63,16 @@ export function createWsEndpoints (t: TFunction = defaultT, firstOnly = false, w value: '' }, ...expandEndpoints(t, [testRelayRococo], firstOnly, withSort), + { + isDisabled: false, + isHeader: true, + isSpaced: true, + text: t('rpc.header.paseo.relay', 'Test Paseo & parachains', { ns: 'apps-config' }), + textBy: '', + ui: {}, + value: '' + }, + ...expandEndpoints(t, [testRelayPaseo], firstOnly, withSort), { isDisabled: false, isHeader: true, diff --git a/packages/apps-config/src/endpoints/testingRelayPaseo.ts b/packages/apps-config/src/endpoints/testingRelayPaseo.ts new file mode 100644 index 000000000000..eba2cbf1d076 --- /dev/null +++ b/packages/apps-config/src/endpoints/testingRelayPaseo.ts @@ -0,0 +1,69 @@ +// Copyright 2017-2024 @polkadot/apps-config authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { EndpointOption } from './types.js'; + +import { PASEO_GENESIS } from '../api/constants.js'; +import { } from '../ui/logos/chains/index.js'; +// import { testnetParachainSVG } from '../ui/logos/nodes/index.js'; +import { getTeleports } from './util.js'; + +// The available endpoints that will show in the dropdown. For the most part (with the exception of +// Polkadot) we try to keep this to live chains only, with RPCs hosted by the community/chain vendor +// info: The chain logo name as defined in ../ui/logos/index.ts in namedLogos (this also needs to align with @polkadot/networks) +// text: The text to display on the dropdown +// providers: The actual hosted secure websocket endpoint +// +// IMPORTANT: Alphabetical based on text +export const testParasPaseo: Omit[] = [ + // { + // homepage: 'https://testPaseoParachainExample.com', + // info: 'paseoparachain', + // paraId: 2345, + // providers: { + // Acurast: 'wss://paseo-parachain-testnet-ws.prod.gke.papers.tech' + // }, + // text: 'Testnet Parachain', + // ui: { + // color: '#000000', + // logo: testnetParachainSVG + // } + // } +]; + +export const testParasPaseoCommon: EndpointOption[] = [ + // { + // info: 'PaseoAssetHub', + // paraId: 1000, + // providers: { + // Dwellir: 'wss://paseo-asset-hub-rpc.dwellir.com', + // Parity: 'wss://paseo-asset-hub-rpc.polkadot.io' + // }, + // teleport: [-1], + // text: 'AssetHub', + // ui: { + // color: '#77bb77', + // logo: nodesAssetHubSVG + // } + // } +]; + +export const testRelayPaseo: EndpointOption = { + dnslink: 'paseo', + genesisHash: PASEO_GENESIS, + info: 'paseo', + linked: [ + ...testParasPaseoCommon, + ...testParasPaseo + ], + providers: { + Amforc: 'wss://paseo.rpc.amforc.com' + // 'light client': 'light://substrate-connect/paseo' + }, + teleport: getTeleports(testParasPaseoCommon), + text: 'Paseo', + ui: { + color: '#e6007a', + identityIcon: 'polkadot' + } +}; diff --git a/packages/apps/public/locales/en/apps-config.json b/packages/apps/public/locales/en/apps-config.json index 378309037e22..3bef3eb63b13 100644 --- a/packages/apps/public/locales/en/apps-config.json +++ b/packages/apps/public/locales/en/apps-config.json @@ -10,6 +10,7 @@ "rpc.header.live": "Live networks", "rpc.header.polkadot.relay": "Polkadot & parachains", "rpc.header.rococo.relay": "Test Rococo & parachains", + "rpc.header.paseo.relay": "Test Paseo & parachains", "rpc.header.test": "Test networks", "rpc.header.westend.relay": "Test Westend & parachains", "rpc.hosted.via": "via {{host}}",