@polkadot/networks
Advanced tools
Comparing version 3.6.0-beta.12 to 3.6.0-beta.13
import { Network, NetworkFromSubstrate } from './types'; | ||
declare const all: NetworkFromSubstrate[]; | ||
declare const prefixes: number[]; | ||
declare const available: Network[]; | ||
declare const filtered: Network[]; | ||
export { all, prefixes }; | ||
export { all, available }; | ||
export default filtered; |
24
index.js
@@ -8,3 +8,3 @@ "use strict"; | ||
}); | ||
exports.default = exports.prefixes = exports.all = void 0; | ||
exports.default = exports.available = exports.all = void 0; | ||
@@ -22,3 +22,3 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
// are provided, it needs to be in reverse order, i.e. most-recent first, oldest | ||
// last. This make lookups for current a case of genesisHash[0] | ||
// last. This make lookups for the current a simple genesisHash[0] | ||
// (See Kusama as an example) | ||
@@ -344,18 +344,16 @@ | ||
website: null | ||
}]; | ||
exports.all = all; | ||
const prefixes = all.filter(({ | ||
standardAccount | ||
}) => standardAccount === '*25519').map(({ | ||
prefix | ||
}) => prefix); // map, filter & sort to get a trimmed list | ||
// - we only include those where we have a genesisHash (and prefix 42) | ||
}]; // The list of available/claimed prefixes | ||
// - we only include those where we have a standardAccount | ||
// - when no icon has been specified, default to substrate | ||
// - sort by name, however we keep 0, 2, 42 first in the list | ||
exports.prefixes = prefixes; | ||
const filtered = all.filter(n => !!n.genesisHash || n.prefix === 42).map(n => _objectSpread(_objectSpread({}, n), {}, { | ||
exports.all = all; | ||
const available = all.filter(n => n.standardAccount === '*25519').map(n => _objectSpread(_objectSpread({}, n), {}, { | ||
genesisHash: n.genesisHash || [], | ||
icon: n.icon || 'substrate' | ||
})).sort((a, b) => UNSORTED.includes(a.prefix) && UNSORTED.includes(b.prefix) ? 0 : UNSORTED.includes(a.prefix) ? -1 : UNSORTED.includes(b.prefix) ? 1 : a.displayName.localeCompare(b.displayName)); | ||
})).sort((a, b) => UNSORTED.includes(a.prefix) && UNSORTED.includes(b.prefix) ? 0 : UNSORTED.includes(a.prefix) ? -1 : UNSORTED.includes(b.prefix) ? 1 : a.displayName.localeCompare(b.displayName)); // A filtered list of those chains we have details about (genesisHashes) | ||
exports.available = available; | ||
const filtered = available.filter(n => n.genesisHash.length || n.prefix === 42); | ||
var _default = filtered; | ||
exports.default = _default; |
{ | ||
"name": "@polkadot/networks", | ||
"version": "3.6.0-beta.12", | ||
"version": "3.6.0-beta.13", | ||
"description": "A list of all available Substrate networks and their applicable prefixes", | ||
@@ -33,5 +33,5 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@polkadot/util": "3.6.0-beta.12", | ||
"@polkadot/util": "3.6.0-beta.13", | ||
"@polkadot/x-fetch": "^0.3.2" | ||
} | ||
} |
@@ -14,3 +14,3 @@ export declare type Icon = 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate'; | ||
export interface Network extends NetworkFromSubstrate { | ||
genesisHash: string[] | null; | ||
genesisHash: string[]; | ||
icon: Icon; | ||
@@ -17,0 +17,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25119
434