@polkadot/networks 8.3.3-3 → 8.3.4-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/interfaces.cjs CHANGED
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.selectableNetworks = exports.availableNetworks = exports.allNetworks = void 0;
7
9
 
8
- var _defaults = require("./defaults.cjs");
10
+ var _ss58Registry = _interopRequireDefault(require("@substrate/ss58-registry"));
9
11
 
10
- var _substrate = require("./substrate.cjs");
12
+ var _defaults = require("./defaults.cjs");
11
13
 
12
14
  // Copyright 2017-2022 @polkadot/networks authors & contributors
13
15
  // SPDX-License-Identifier: Apache-2.0
@@ -27,7 +29,7 @@ function toExpanded(o) {
27
29
  n.icon = _defaults.knownIcon[network] || 'substrate'; // filtering
28
30
 
29
31
  n.isTestnet = !!_defaults.knownTestnet[network] || TESTNETS.includes(nameParts[nameParts.length - 1]);
30
- n.isIgnored = n.isTestnet || !(o.standardAccount && o.decimals && o.symbols) && o.prefix !== 42;
32
+ n.isIgnored = n.isTestnet || !(o.standardAccount && o.decimals && o.decimals.length && o.symbols && o.symbols.length) && o.prefix !== 42;
31
33
  return n;
32
34
  }
33
35
 
@@ -50,7 +52,7 @@ function sortNetworks(a, b) {
50
52
  } // This is all the Substrate networks with our additional information
51
53
 
52
54
 
53
- const allNetworks = _substrate.knownSubstrate.map(toExpanded); // The list of available/claimed prefixes
55
+ const allNetworks = _ss58Registry.default.map(toExpanded); // The list of available/claimed prefixes
54
56
  // - no testnets
55
57
  // - we only include those where we have a standardAccount
56
58
  // - sort by name, however we keep 0, 2, 42 first in the list
package/interfaces.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Copyright 2017-2022 @polkadot/networks authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { knownGenesis, knownIcon, knownLedger, knownTestnet } from "./defaults.js";
4
- import { knownSubstrate } from "./substrate.js"; // These are known prefixes that are not sorted
3
+ import knownSubstrate from '@substrate/ss58-registry';
4
+ import { knownGenesis, knownIcon, knownLedger, knownTestnet } from "./defaults.js"; // These are known prefixes that are not sorted
5
5
 
6
6
  const UNSORTED = [0, 2, 42];
7
7
  const TESTNETS = ['testnet'];
@@ -18,7 +18,7 @@ function toExpanded(o) {
18
18
  n.icon = knownIcon[network] || 'substrate'; // filtering
19
19
 
20
20
  n.isTestnet = !!knownTestnet[network] || TESTNETS.includes(nameParts[nameParts.length - 1]);
21
- n.isIgnored = n.isTestnet || !(o.standardAccount && o.decimals && o.symbols) && o.prefix !== 42;
21
+ n.isIgnored = n.isTestnet || !(o.standardAccount && o.decimals && o.decimals.length && o.symbols && o.symbols.length) && o.prefix !== 42;
22
22
  return n;
23
23
  }
24
24
 
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "sideEffects": false,
19
19
  "type": "module",
20
- "version": "8.3.3-3",
20
+ "version": "8.3.4-2",
21
21
  "main": "index.cjs",
22
22
  "module": "index.js",
23
23
  "types": "index.d.ts",
@@ -60,11 +60,6 @@
60
60
  "require": "./packageInfo.cjs",
61
61
  "default": "./packageInfo.js"
62
62
  },
63
- "./substrate": {
64
- "types": "./substrate.d.ts",
65
- "require": "./substrate.cjs",
66
- "default": "./substrate.js"
67
- },
68
63
  "./types": {
69
64
  "types": "./types.d.ts",
70
65
  "require": "./types.cjs",
@@ -73,6 +68,7 @@
73
68
  },
74
69
  "dependencies": {
75
70
  "@babel/runtime": "^7.16.7",
76
- "@polkadot/util": "8.3.3-3"
71
+ "@polkadot/util": "8.3.4-2",
72
+ "@substrate/ss58-registry": "^1.12.0"
77
73
  }
78
74
  }
package/packageInfo.cjs CHANGED
@@ -11,6 +11,6 @@ const packageInfo = {
11
11
  name: '@polkadot/networks',
12
12
  path: typeof __dirname === 'string' ? __dirname : 'auto',
13
13
  type: 'cjs',
14
- version: '8.3.3-3'
14
+ version: '8.3.4-2'
15
15
  };
16
16
  exports.packageInfo = packageInfo;
package/packageInfo.js CHANGED
@@ -5,5 +5,5 @@ export const packageInfo = {
5
5
  name: '@polkadot/networks',
6
6
  path: new URL('.', import.meta.url).pathname,
7
7
  type: 'esm',
8
- version: '8.3.3-3'
8
+ version: '8.3.4-2'
9
9
  };
package/types.d.ts CHANGED
@@ -1,16 +1,9 @@
1
+ import type { RegistryEntry } from '@substrate/ss58-registry';
1
2
  export declare type Icon = 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate';
2
- export interface KnownSubstrate {
3
- decimals: number[] | null;
4
- displayName: string;
5
- network: string | null;
6
- prefix: number;
7
- standardAccount: '*25519' | 'Ed25519' | 'Sr25519' | 'secp256k1' | null;
8
- symbols: string[] | null;
9
- website: string | null;
10
- }
11
3
  export declare type KnownIcon = Record<string, Icon>;
12
4
  export declare type KnownLedger = Record<string, number>;
13
5
  export declare type KnownGenesis = Record<string, string[]>;
6
+ export declare type KnownSubstrate = RegistryEntry;
14
7
  export declare type KnownTestnet = Record<string, true>;
15
8
  export interface SubstrateNetwork extends KnownSubstrate {
16
9
  genesisHash: string[];