* 0.69

* Adjust

* Adjust

* Update CHANGELOG.md
This commit is contained in:
Jaco Greeff
2021-02-07 14:55:32 +01:00
committed by GitHub
parent 68f3d13d09
commit d8237f0687
16 changed files with 1104 additions and 1000 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/ui-settings",
"version": "0.68.1",
"version": "0.69.0",
"description": "Manages app settings",
"main": "index.js",
"sideEffects": false,
@@ -8,9 +8,9 @@
"maintainers": [],
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/networks": "^5.5.1",
"@polkadot/util": "^5.5.1",
"@babel/runtime": "^7.12.13",
"@polkadot/networks": "^5.6.1",
"@polkadot/util": "^5.6.1",
"eventemitter3": "^4.0.7",
"store": "^2.0.12"
},
+8 -1
View File
@@ -1,12 +1,19 @@
// Copyright 2017-2021 @polkadot/ui-settings authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Network } from '@polkadot/networks/types';
import known from '@polkadot/networks';
type ChainDef = string[];
// NOTE This should be fixed by networks 5.7 (also in ss58)
interface NetworkNamed extends Network {
network: string;
}
const chains: Record <string, ChainDef> = known
.filter(({ genesisHash }) => genesisHash.length > 1)
.filter((n): n is NetworkNamed => n.genesisHash.length > 0 && !!n.network)
.reduce((chains, { genesisHash, network }) => ({ ...chains, [network]: genesisHash }), {});
export { chains };
+9 -5
View File
@@ -1,10 +1,16 @@
// Copyright 2017-2021 @polkadot/ui-settings authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Network } from '@polkadot/networks/types';
import type { Option } from '../types';
import { available } from '@polkadot/networks';
// NOTE This should be fixed by networks 5.7 (also in chains)
interface NetworkNamed extends Network {
network: string;
}
export const PREFIX_DEFAULT = -1;
const defaultNetwork: Option = {
@@ -13,10 +19,8 @@ const defaultNetwork: Option = {
value: -1
};
const networks = available.map(({ displayName, network, prefix }) => ({
info: network,
text: displayName,
value: prefix
}));
const networks = available
.filter((n): n is NetworkNamed => !!n.network)
.map(({ displayName, network, prefix }) => ({ info: network, text: displayName, value: prefix }));
export const PREFIXES: Option[] = [defaultNetwork, ...networks];