Use @polkadot/networks (#382)

* adapt ss58

* fix yarn.lock ?

* cater for kusama hashes

* yarn update-interactive

* much nicer chains
This commit is contained in:
Thibaut Sardan
2020-10-17 10:56:12 +02:00
committed by GitHub
parent 72127121ca
commit a1808f590e
3 changed files with 884 additions and 947 deletions
+5 -10
View File
@@ -1,17 +1,12 @@
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
// SPDX-License-Identifier: Apache-2.0
import known from '@polkadot/networks';
type ChainDef = string[];
const chains: Record<string, ChainDef> = {
kusama: [
'0x3fd7b9eb6a00376e5be61f01abb429ffb0b104be05eaff4d458da48fcd425baf', // Kusama CC1
'0xe3777fa922cafbff200cadeaea1a76bd7898ad5b89f7848999058b50e715f636', // Kusama CC2
'0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe' // Kusama CC3
],
polkadot: [
'0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3' // Polkadot CC1
]
};
const chains: Record <string, ChainDef> = known
.filter(({ genesisHash }) => genesisHash.length > 1)
.reduce((chains, { genesisHash, network }) => ({ ...chains, [network]: genesisHash }), {});
export default chains;
+14 -44
View File
@@ -2,50 +2,20 @@
// SPDX-License-Identifier: Apache-2.0
import { Option } from '../types';
import { available } from '@polkadot/networks';
export const PREFIX_DEFAULT = -1;
export const PREFIXES: Option[] = [
{
info: 'default',
text: 'Default for the connected node',
value: -1
},
// keep as first (well, after default)
{
info: 'substrate',
text: 'Substrate (generic)',
value: 42
},
// all in ascending order based on value
{
info: 'polkadot',
text: 'Polkadot (live)',
value: 0
},
{
info: 'kusama',
text: 'Kusama (canary)',
value: 2
},
{
info: 'edgeware',
text: 'Edgeware (live)',
value: 7
},
{
info: 'kulupu',
text: 'Kulupu (live)',
value: 16
},
{
info: 'darwinia',
text: 'Darwinia (live)',
value: 18
},
{
info: 'subsocial',
text: 'Subsocial (live)',
value: 28
}
];
const defaultNetwork: Option = {
info: 'default',
text: 'Default for the connected node',
value: -1
};
const networks = available.map(({ displayName, network, prefix }) => ({
info: network,
text: displayName,
value: prefix
}));
export const PREFIXES: Option[] = [defaultNetwork, ...networks];
+865 -893
View File
File diff suppressed because it is too large Load Diff