Use @polkadot/networks (#504)
* use @polkadot/networks * address comments * icon is set * pull latest beta * filtering out if no genesis Co-authored-by: Github Actions <action@github.com>
This commit is contained in:
co-authored by
Github Actions
parent
bc16cade94
commit
7d6542fba7
@@ -53,5 +53,8 @@
|
||||
"webpack": "^4.44.2",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-extension-manifest-plugin": "^0.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/networks": "3.6.0-beta.14"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,64 +2,15 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { MetadataDefBase } from '@polkadot/extension-inject/types';
|
||||
import networks from '@polkadot/networks';
|
||||
|
||||
const hashes: MetadataDefBase[] = [
|
||||
// keep at the top (favoritism)
|
||||
{
|
||||
chain: 'Polkadot',
|
||||
genesisHash: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3',
|
||||
icon: 'polkadot',
|
||||
ss58Format: 0
|
||||
},
|
||||
{
|
||||
chain: 'Kusama',
|
||||
genesisHash: '0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe',
|
||||
icon: 'polkadot',
|
||||
ss58Format: 2
|
||||
},
|
||||
// alphabetical to avoid (further) favorites
|
||||
{
|
||||
chain: 'Crab',
|
||||
genesisHash: '0x34f61bfda344b3fad3c3e38832a91448b3c613b199eb23e5110a635d71c13c65',
|
||||
icon: 'substrate',
|
||||
ss58Format: 42
|
||||
},
|
||||
{
|
||||
chain: 'Darwinia',
|
||||
genesisHash: '0x729cb8f2cf428adcf81fe69610edda32c5711b2ff17de747e8604a3587021db8',
|
||||
icon: 'substrate',
|
||||
ss58Format: 18
|
||||
},
|
||||
{
|
||||
chain: 'Edgeware',
|
||||
genesisHash: '0x742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b',
|
||||
icon: 'substrate',
|
||||
ss58Format: 7
|
||||
},
|
||||
{
|
||||
chain: 'Kulupu',
|
||||
genesisHash: '0xf7a99d3cb92853d00d5275c971c132c074636256583fee53b3bbe60d7b8769ba',
|
||||
icon: 'substrate',
|
||||
ss58Format: 16
|
||||
},
|
||||
{
|
||||
chain: 'Plasm',
|
||||
genesisHash: '0x3e86364d4b4894021cb2a0390bcf2feb5517d5292f2de2bb9404227e908b0b8b',
|
||||
icon: 'substrate',
|
||||
ss58Format: 5
|
||||
},
|
||||
{
|
||||
chain: 'Stafi',
|
||||
genesisHash: '0x290a4149f09ea0e402c74c1c7e96ae4239588577fe78932f94f5404c68243d80',
|
||||
icon: 'substrate',
|
||||
ss58Format: 20
|
||||
},
|
||||
{
|
||||
chain: 'Subsocial',
|
||||
genesisHash: '0x0bd72c1c305172e1275278aaeb3f161e02eccb7a819e63f62d47bd53a28189f8',
|
||||
icon: 'substrate',
|
||||
ss58Format: 28
|
||||
}
|
||||
];
|
||||
const hashes: MetadataDefBase[] = networks
|
||||
.filter(({ genesisHash }) => !!genesisHash.length)
|
||||
.map((network) => ({
|
||||
chain: network.displayName,
|
||||
genesisHash: network.genesisHash[0],
|
||||
icon: network.icon,
|
||||
ss58Format: network.prefix
|
||||
}));
|
||||
|
||||
export default hashes;
|
||||
|
||||
@@ -14,7 +14,7 @@ const hashes: Option[] = [
|
||||
value: ''
|
||||
},
|
||||
...chains.map(({ chain, genesisHash }) => ({
|
||||
text: `${chain} (${chain.startsWith('Kusama') ? 'canary' : 'live'})`,
|
||||
text: chain,
|
||||
value: genesisHash
|
||||
}))
|
||||
];
|
||||
|
||||
@@ -171,7 +171,7 @@ function Address ({ actions, address, children, className, genesisHash, isExtern
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{chain.name}
|
||||
{chain.name.replace('Relay Chain', '')}
|
||||
</div>
|
||||
)}
|
||||
<div className='addressDisplay'>
|
||||
|
||||
@@ -2086,6 +2086,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/networks@npm:3.6.0-beta.14":
|
||||
version: 3.6.0-beta.14
|
||||
resolution: "@polkadot/networks@npm:3.6.0-beta.14"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.11.2
|
||||
checksum: d66a52cef07632bd34811b23467101c1c2a50baf1a97fa8a8ab04f103add93936eeb0af533d7944605abec3cb9b35db1ee6095fe3e3ee9fd34fd8dc7ecca1e37
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/networks@npm:3.6.0-beta.9":
|
||||
version: 3.6.0-beta.9
|
||||
resolution: "@polkadot/networks@npm:3.6.0-beta.9"
|
||||
@@ -13727,6 +13736,7 @@ fsevents@^1.2.7:
|
||||
dependencies:
|
||||
"@babel/core": ^7.11.6
|
||||
"@polkadot/dev": ^0.58.1
|
||||
"@polkadot/networks": 3.6.0-beta.14
|
||||
"@polkadot/typegen": ^2.2.2-4
|
||||
"@types/jest": ^26.0.14
|
||||
babel-loader: ^8.1.0
|
||||
|
||||
Reference in New Issue
Block a user