Move Polkadex endpoints (#7624)

* Move Polkadex endpoints

* Dummy entries

* No providers with default isUnreachable

* Ordering
This commit is contained in:
Jaco 2022-05-23 07:58:49 +02:00 committed by GitHub
parent fd457832c7
commit 533edbb8d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 12 deletions

View File

@ -221,7 +221,8 @@ export const prodChains: EndpointOption[] = [
info: 'polkadex',
text: 'Polkadex',
providers: {
'Polkadex Team': 'wss://mainnet.polkadex.trade'
'Polkadex Team': 'wss://mainnet.polkadex.trade',
OnFinality: 'wss://polkadex.api.onfinality.io/public-ws'
}
},
{

View File

@ -326,14 +326,6 @@ export const prodParasKusama: EndpointOption[] = [
OnFinality: 'wss://robonomics.api.onfinality.io/public-ws'
}
},
{
info: 'trustbase',
isUnreachable: true, // no providers (yet)
homepage: 'https://trustbase.network/',
paraId: 2078,
text: 'TrustBase',
providers: {}
},
{
info: 'sakura',
homepage: 'https://clover.finance/',
@ -402,6 +394,14 @@ export const prodParasKusama: EndpointOption[] = [
DataHighway: 'wss://tanganika.datahighway.com'
}
},
{
info: 'trustbase',
isUnreachable: true, // no providers (yet)
homepage: 'https://trustbase.network/',
paraId: 2078,
text: 'TrustBase',
providers: {}
},
{
info: 'turing',
homepage: 'https://oak.tech',

View File

@ -254,12 +254,13 @@ export const prodParasPolkadot: EndpointOption[] = [
},
{
info: 'polkadex',
isUnreachable: true, // https://github.com/polkadot-js/apps/issues/7620
homepage: 'https://polkadex.trade/',
paraId: 2040,
text: 'Polkadex',
providers: {
// 'Polkadex Team': 'wss://mainnet.polkadex.trade/', // https://github.com/polkadot-js/apps/issues/7620
OnFinality: 'wss://polkadex.api.onfinality.io/public-ws'
// OnFinality: 'wss://polkadex.api.onfinality.io/public-ws' // https://github.com/polkadot-js/apps/issues/7620
}
},
{

View File

@ -8,6 +8,8 @@ interface SortOption {
isUnreachable?: boolean;
}
let dummyId = 0;
function sortNoop (): number {
return 0;
}
@ -41,20 +43,25 @@ function expandLinked (input: LinkOption[]): LinkOption[] {
}
function expandEndpoint (t: TFunction, { dnslink, genesisHash, homepage, info, isChild, isDisabled, isUnreachable, linked, paraId, providers, teleport, text }: EndpointOption, firstOnly: boolean, withSort: boolean): LinkOption[] {
const hasProviders = Object.keys(providers).length !== 0;
const base = {
genesisHash,
homepage,
info,
isChild,
isDisabled,
isUnreachable,
isUnreachable: isUnreachable || !hasProviders,
paraId,
teleport,
text
};
const result = Object
.entries(providers)
.entries(
hasProviders
? providers
: { Placeholder: `wss://${++dummyId}` }
)
.filter((_, index) => !firstOnly || index === 0)
.map(([host, value], index): LinkOption => ({
...base,