@pezkuwi/networks 14.0.8 → 14.0.9

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.
Files changed (106) hide show
  1. package/package.json +166 -5
  2. package/build/README.md +0 -5
  3. package/build/cjs/defaults/genesis.js +0 -216
  4. package/build/cjs/defaults/icons.js +0 -12
  5. package/build/cjs/defaults/index.js +0 -11
  6. package/build/cjs/defaults/ledger.js +0 -55
  7. package/build/cjs/defaults/testnets.js +0 -13
  8. package/build/cjs/index.js +0 -7
  9. package/build/cjs/interfaces.js +0 -46
  10. package/build/cjs/packageDetect.js +0 -5
  11. package/build/cjs/packageInfo.js +0 -4
  12. package/build/cjs/types.js +0 -2
  13. package/build/defaults/genesis.d.ts +0 -2
  14. package/build/defaults/genesis.js +0 -213
  15. package/build/defaults/icons.d.ts +0 -2
  16. package/build/defaults/icons.js +0 -9
  17. package/build/defaults/index.d.ts +0 -4
  18. package/build/defaults/index.js +0 -4
  19. package/build/defaults/ledger.d.ts +0 -2
  20. package/build/defaults/ledger.js +0 -52
  21. package/build/defaults/testnets.d.ts +0 -2
  22. package/build/defaults/testnets.js +0 -10
  23. package/build/index.d.ts +0 -2
  24. package/build/index.js +0 -2
  25. package/build/interfaces.d.ts +0 -4
  26. package/build/interfaces.js +0 -42
  27. package/build/package.json +0 -189
  28. package/build/packageDetect.d.ts +0 -1
  29. package/build/packageDetect.js +0 -3
  30. package/build/packageInfo.d.ts +0 -6
  31. package/build/packageInfo.js +0 -1
  32. package/build/types.d.ts +0 -31
  33. package/build/types.js +0 -1
  34. package/build-deno/README.md +0 -5
  35. package/build-deno/defaults/genesis.ts +0 -216
  36. package/build-deno/defaults/icons.ts +0 -12
  37. package/build-deno/defaults/index.ts +0 -5
  38. package/build-deno/defaults/ledger.ts +0 -55
  39. package/build-deno/defaults/testnets.ts +0 -13
  40. package/build-deno/index.ts +0 -4
  41. package/build-deno/interfaces.ts +0 -63
  42. package/build-deno/mod.ts +0 -2
  43. package/build-deno/packageDetect.ts +0 -7
  44. package/build-deno/packageInfo.ts +0 -3
  45. package/build-deno/types.ts +0 -41
  46. package/src/defaults/genesis.ts +0 -226
  47. package/src/defaults/icons.ts +0 -15
  48. package/src/defaults/index.ts +0 -7
  49. package/src/defaults/ledger.ts +0 -61
  50. package/src/defaults/testnets.ts +0 -16
  51. package/src/defaults.spec.ts +0 -59
  52. package/src/index.spec.ts +0 -120
  53. package/src/index.ts +0 -9
  54. package/src/interfaces.ts +0 -72
  55. package/src/mod.ts +0 -4
  56. package/src/packageDetect.ts +0 -11
  57. package/src/packageInfo.ts +0 -6
  58. package/src/ss58registry.spec.ts +0 -34
  59. package/src/types.ts +0 -43
  60. package/test/ss58registry.json +0 -1905
  61. package/tsconfig.build.json +0 -17
  62. package/tsconfig.build.tsbuildinfo +0 -1
  63. package/tsconfig.spec.json +0 -18
  64. package/tsconfig.spec.tsbuildinfo +0 -1
  65. /package/{build/LICENSE → LICENSE} +0 -0
  66. /package/{build-tsc → cjs}/defaults/genesis.d.ts +0 -0
  67. /package/{build-tsc-cjs → cjs}/defaults/genesis.js +0 -0
  68. /package/{build-tsc → cjs}/defaults/icons.d.ts +0 -0
  69. /package/{build-tsc-cjs → cjs}/defaults/icons.js +0 -0
  70. /package/{build-tsc → cjs}/defaults/index.d.ts +0 -0
  71. /package/{build-tsc-cjs → cjs}/defaults/index.js +0 -0
  72. /package/{build-tsc → cjs}/defaults/ledger.d.ts +0 -0
  73. /package/{build-tsc-cjs → cjs}/defaults/ledger.js +0 -0
  74. /package/{build-tsc → cjs}/defaults/testnets.d.ts +0 -0
  75. /package/{build-tsc-cjs → cjs}/defaults/testnets.js +0 -0
  76. /package/{build-tsc → cjs}/index.d.ts +0 -0
  77. /package/{build-tsc-cjs → cjs}/index.js +0 -0
  78. /package/{build-tsc → cjs}/interfaces.d.ts +0 -0
  79. /package/{build-tsc-cjs → cjs}/interfaces.js +0 -0
  80. /package/{build/cjs → cjs}/package.json +0 -0
  81. /package/{build-tsc → cjs}/packageDetect.d.ts +0 -0
  82. /package/{build-tsc-cjs → cjs}/packageDetect.js +0 -0
  83. /package/{build-tsc → cjs}/packageInfo.d.ts +0 -0
  84. /package/{build-tsc-cjs → cjs}/packageInfo.js +0 -0
  85. /package/{build-tsc → cjs}/types.d.ts +0 -0
  86. /package/{build-tsc-cjs → cjs}/types.js +0 -0
  87. /package/{build/cjs/defaults → defaults}/genesis.d.ts +0 -0
  88. /package/{build-tsc-esm/defaults → defaults}/genesis.js +0 -0
  89. /package/{build/cjs/defaults → defaults}/icons.d.ts +0 -0
  90. /package/{build-tsc-esm/defaults → defaults}/icons.js +0 -0
  91. /package/{build/cjs/defaults → defaults}/index.d.ts +0 -0
  92. /package/{build-tsc-esm/defaults → defaults}/index.js +0 -0
  93. /package/{build/cjs/defaults → defaults}/ledger.d.ts +0 -0
  94. /package/{build-tsc-esm/defaults → defaults}/ledger.js +0 -0
  95. /package/{build/cjs/defaults → defaults}/testnets.d.ts +0 -0
  96. /package/{build-tsc-esm/defaults → defaults}/testnets.js +0 -0
  97. /package/{build/cjs/index.d.ts → index.d.ts} +0 -0
  98. /package/{build-tsc-esm/index.js → index.js} +0 -0
  99. /package/{build/cjs/interfaces.d.ts → interfaces.d.ts} +0 -0
  100. /package/{build-tsc-esm/interfaces.js → interfaces.js} +0 -0
  101. /package/{build/cjs/packageDetect.d.ts → packageDetect.d.ts} +0 -0
  102. /package/{build-tsc-esm/packageDetect.js → packageDetect.js} +0 -0
  103. /package/{build/cjs/packageInfo.d.ts → packageInfo.d.ts} +0 -0
  104. /package/{build-tsc-esm/packageInfo.js → packageInfo.js} +0 -0
  105. /package/{build/cjs/types.d.ts → types.d.ts} +0 -0
  106. /package/{build-tsc-esm/types.js → types.js} +0 -0
@@ -1,61 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import type { KnownLedger } from '../types.js';
5
-
6
- // These match up with the keys of the ledgerApps object in the @pezkuwi/hw-ledger/defaults.ts
7
- // and maps to the known slip44 (minus the `0x8` hard derivation flag)
8
- //
9
- // NOTE: Any network here needs to have a genesisHash attached in the ./genesis.ts config
10
- export const knownLedger: KnownLedger = {
11
- acala: 0x00000313,
12
- ajuna: 0x00000162,
13
- 'aleph-node': 0x00000283,
14
- astar: 0x0000032a,
15
- bifrost: 0x00000314,
16
- 'bifrost-kusama': 0x00000314,
17
- bittensor: 0x00000162,
18
- centrifuge: 0x000002eb,
19
- composable: 0x00000162,
20
- creditcoin3: 0x00000162,
21
- darwinia: 0x00000162,
22
- dentnet: 0x000002de,
23
- 'dock-mainnet': 0x00000252,
24
- edgeware: 0x0000020b,
25
- encointer: 0x000001b2,
26
- enjin: 0x00000483,
27
- equilibrium: 0x05f5e0fd,
28
- frequency: 0x0000082b,
29
- genshiro: 0x05f5e0fc,
30
- hydradx: 0x00000162,
31
- integritee: 0x000007df,
32
- 'interlay-parachain': 0x00000162,
33
- karura: 0x000002ae,
34
- khala: 0x000001b2,
35
- kusama: 0x000001b2,
36
- liberland: 0x000002ff,
37
- matrixchain: 0x00000483,
38
- mythos: 0x0000003c,
39
- nodle: 0x000003eb,
40
- origintrail: 0x00000162,
41
- parallel: 0x00000162,
42
- peaq: 0x00000d0a,
43
- pendulum: 0x00000162,
44
- phala: 0x00000162,
45
- picasso: 0x000001b2,
46
- polimec: 0x00000d10,
47
- polkadex: 0x0000031f,
48
- polkadot: 0x00000162,
49
- polymesh: 0x00000253,
50
- quartz: 0x00000277,
51
- sora: 0x00000269,
52
- stafi: 0x0000038b,
53
- statemine: 0x000001b2, // common-good on Kusama, shares derivation
54
- statemint: 0x00000162, // common-good on Polkadot, shares derivation
55
- ternoa: 0x00003e3,
56
- unique: 0x00000295,
57
- vara: 0x00001370,
58
- vtb: 0x000002b6,
59
- xxnetwork: 0x000007a3,
60
- zeitgeist: 0x00000162
61
- };
@@ -1,16 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import type { KnownTestnet } from '../types.js';
5
-
6
- // testnets should not allow selection
7
- export const knownTestnet: KnownTestnet = {
8
- '': true, // this is the default non-network entry
9
- 'cess-testnet': true,
10
- 'dock-testnet': true,
11
- jupiter: true,
12
- 'mathchain-testnet': true,
13
- p3dt: true,
14
- subspace_testnet: true,
15
- 'zero-alphaville': true
16
- };
@@ -1,59 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /// <reference types="@pezkuwi/dev-test/globals.d.ts" />
5
-
6
- import { ledgerApps } from '@pezkuwi/hw-ledger/defaults';
7
- import { isHex } from '@pezkuwi/util';
8
-
9
- import { knownGenesis, knownLedger, knownTestnet } from './defaults/index.js';
10
-
11
- describe('defaults', (): void => {
12
- const genesisKeys = Object.keys(knownGenesis);
13
- const ledgerKeys = Object.keys(knownLedger);
14
-
15
- describe('genesis', (): void => {
16
- it('has hex values for all genesis chains', (): void => {
17
- expect(
18
- genesisKeys.filter((network) =>
19
- !knownGenesis[network].length ||
20
- knownGenesis[network].some((g) => !isHex(g, 256))
21
- )
22
- ).toEqual([]);
23
- });
24
-
25
- it('has no entries for testnets', (): void => {
26
- expect(
27
- genesisKeys.filter((network) =>
28
- knownTestnet[network]
29
- )
30
- ).toEqual([]);
31
- });
32
-
33
- it('has genesis for all Ledger chains', (): void => {
34
- expect(
35
- ledgerKeys.filter((network) =>
36
- !knownGenesis[network]
37
- )
38
- ).toEqual([]);
39
- });
40
- });
41
-
42
- describe('Ledger', (): void => {
43
- it('has entries for each of the apps (hwledger -> networks)', (): void => {
44
- expect(
45
- ledgerKeys.filter((network) =>
46
- !ledgerApps[network]
47
- )
48
- ).toEqual([]);
49
- });
50
-
51
- it('has entries for each of the apps (networks -> hwledger)', (): void => {
52
- expect(
53
- Object.keys(ledgerApps).filter((network) =>
54
- !knownLedger[network]
55
- )
56
- ).toEqual([]);
57
- });
58
- });
59
- });
package/src/index.spec.ts DELETED
@@ -1,120 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /// <reference types="@pezkuwi/dev-test/globals.d.ts" />
5
-
6
- import type { BizinikwiNetwork } from './types.js';
7
-
8
- import { knownGenesis, knownIcon, knownLedger, knownTestnet } from './defaults/index.js';
9
- import { allNetworks, availableNetworks, selectableNetworks } from './index.js';
10
-
11
- describe('availableNetworks', (): void => {
12
- it('has the correct starting order', (): void => {
13
- expect(availableNetworks.slice(0, 3).map(({ prefix }) => prefix)).toEqual([0, 2, 42]);
14
- });
15
-
16
- it('has a sorted list (first external, last external)', (): void => {
17
- expect(availableNetworks[3].displayName).toEqual('3DP network');
18
- expect(availableNetworks[availableNetworks.length - 1].displayName).toEqual('ZERO');
19
- });
20
-
21
- it('has no ignored networks', (): void => {
22
- expect(availableNetworks.some(({ isIgnored }) => isIgnored)).toEqual(false);
23
- });
24
-
25
- it('has no reserved networks', (): void => {
26
- expect(availableNetworks.some(({ prefix }) => prefix === 47)).toEqual(false);
27
- });
28
-
29
- it('has allNetworks genesis information', (): void => {
30
- expect(
31
- Object.entries(knownGenesis).filter(([network, genesisHash]) =>
32
- availableNetworks.some((a) =>
33
- a.network === network &&
34
- genesisHash.some((g, index) => a.genesisHash[index] !== g)
35
- )
36
- )
37
- ).toEqual([]);
38
- });
39
-
40
- it('has allNetworks ledger details', (): void => {
41
- expect(
42
- Object.entries(knownLedger).filter(([network, slip44]) =>
43
- availableNetworks.some((a) =>
44
- a.network === network && (
45
- a.slip44 !== slip44 ||
46
- !a.hasLedgerSupport ||
47
- !a.genesisHash.length
48
- )
49
- )
50
- )
51
- ).toEqual([]);
52
- });
53
-
54
- it('has no testnets exposed', (): void => {
55
- expect(
56
- Object.keys(knownTestnet).filter((network) =>
57
- availableNetworks.some((a) =>
58
- a.network === network
59
- )
60
- )
61
- ).toEqual([]);
62
- });
63
-
64
- it('has allNetworks icons, except for overrides', (): void => {
65
- expect(
66
- availableNetworks.filter(({ icon, network }) =>
67
- icon !== 'substrate' &&
68
- knownIcon[network] !== icon
69
- )
70
- ).toEqual([]);
71
- });
72
-
73
- it('has all the correct fields', (): void => {
74
- expect(availableNetworks[0]).toEqual({
75
- decimals: [10],
76
- displayName: 'Polkadot Relay Chain',
77
- genesisHash: [
78
- '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3'
79
- ],
80
- hasLedgerSupport: true,
81
- icon: 'polkadot',
82
- isIgnored: false,
83
- isTestnet: false,
84
- network: 'polkadot',
85
- prefix: 0,
86
- slip44: 354,
87
- standardAccount: '*25519',
88
- symbols: ['DOT'],
89
- website: 'https://polkadot.network'
90
- });
91
- });
92
- });
93
-
94
- describe('allNetworks', (): void => {
95
- it('has no ss58 duplicates', (): void => {
96
- const dupes: BizinikwiNetwork[] = [];
97
- const uniques: BizinikwiNetwork[] = [];
98
-
99
- allNetworks.forEach((a): void => {
100
- if (uniques.some((u) => u.prefix === a.prefix)) {
101
- dupes.push(a);
102
- } else {
103
- uniques.push(a);
104
- }
105
- });
106
-
107
- expect(dupes).toEqual([]);
108
- });
109
- });
110
-
111
- describe('selectableNetworks', (): void => {
112
- it('has the correct starting order', (): void => {
113
- expect(selectableNetworks.slice(0, 3).map(({ prefix }) => prefix)).toEqual([0, 2, 42]);
114
- });
115
-
116
- it('has a sorted list (first external, last external)', (): void => {
117
- expect(selectableNetworks[3].displayName).toEqual('3DP network');
118
- expect(selectableNetworks[selectableNetworks.length - 1].displayName).toEqual('Zeitgeist');
119
- });
120
- });
package/src/index.ts DELETED
@@ -1,9 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- // TODO: This was removed, really cannot recall the reason...
5
- // ... put it back, but keep it removed
6
- // import './packageDetect.js';
7
-
8
- export * from './interfaces.js';
9
- export { packageInfo } from './packageInfo.js';
package/src/interfaces.ts DELETED
@@ -1,72 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import type { KnownBizinikiwi, Network, BizinikwiNetwork } from './types.js';
5
-
6
- import knownBizinikiwi from '@substrate/ss58-registry';
7
-
8
- import { knownGenesis, knownIcon, knownLedger, knownTestnet } from './defaults/index.js';
9
-
10
- // These are known prefixes that are not sorted
11
- const UNSORTED = [0, 2, 42];
12
- const TESTNETS = ['testnet'];
13
-
14
- function toExpanded (o: KnownBizinikiwi): BizinikwiNetwork {
15
- const network = o.network || '';
16
- const nameParts = network.replace(/_/g, '-').split('-');
17
- const n = o as BizinikwiNetwork;
18
-
19
- // ledger additions
20
- n.slip44 = knownLedger[network];
21
- n.hasLedgerSupport = !!n.slip44;
22
-
23
- // general items
24
- n.genesisHash = knownGenesis[network] || [];
25
- n.icon = knownIcon[network] || 'substrate';
26
-
27
- // filtering
28
- n.isTestnet = !!knownTestnet[network] || TESTNETS.includes(nameParts[nameParts.length - 1]);
29
- n.isIgnored = n.isTestnet || (
30
- !(
31
- o.standardAccount &&
32
- o.decimals?.length &&
33
- o.symbols?.length
34
- ) &&
35
- o.prefix !== 42
36
- );
37
-
38
- return n;
39
- }
40
-
41
- function filterSelectable ({ genesisHash, prefix }: Network): boolean {
42
- return !!genesisHash.length || prefix === 42;
43
- }
44
-
45
- function filterAvailable (n: BizinikwiNetwork): n is Network {
46
- return !n.isIgnored && !!n.network;
47
- }
48
-
49
- function sortNetworks (a: Network, b: Network): number {
50
- const isUnSortedA = UNSORTED.includes(a.prefix);
51
- const isUnSortedB = UNSORTED.includes(b.prefix);
52
-
53
- return isUnSortedA === isUnSortedB
54
- ? isUnSortedA
55
- ? 0
56
- : a.displayName.localeCompare(b.displayName)
57
- : isUnSortedA
58
- ? -1
59
- : 1;
60
- }
61
-
62
- // This is all the Bizinikiwi networks with our additional information
63
- export const allNetworks = knownBizinikiwi.map(toExpanded);
64
-
65
- // The list of available/claimed prefixes
66
- // - no testnets
67
- // - we only include those where we have a standardAccount
68
- // - sort by name, however we keep 0, 2, 42 first in the list
69
- export const availableNetworks = allNetworks.filter(filterAvailable).sort(sortNetworks);
70
-
71
- // A filtered list of those chains we have details about (genesisHashes)
72
- export const selectableNetworks = availableNetworks.filter(filterSelectable);
package/src/mod.ts DELETED
@@ -1,4 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- export * from './index.js';
@@ -1,11 +0,0 @@
1
- // Copyright 2017-2026 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- // Do not edit, auto-generated by @pezkuwi/dev
5
- // (packageInfo imports will be kept as-is, user-editable)
6
-
7
- import { detectPackage } from '@pezkuwi/util';
8
-
9
- import { packageInfo } from './packageInfo.js';
10
-
11
- detectPackage(packageInfo, null, []);
@@ -1,6 +0,0 @@
1
- // Copyright 2017-2026 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- // Do not edit, auto-generated by @pezkuwi/dev
5
-
6
- export const packageInfo = { name: '@pezkuwi/networks', path: 'auto', type: 'auto', version: '14.0.8' };
@@ -1,34 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /// <reference types="@pezkuwi/dev-test/globals.d.ts" />
5
-
6
- import known from '@substrate/ss58-registry';
7
- import fs from 'node:fs';
8
-
9
- import { stringify } from '@pezkuwi/util';
10
-
11
- describe('@substrate/ss58-registry', (): void => {
12
- it('has known values', (): void => {
13
- const testUrl = new URL('../test/ss58registry.json', import.meta.url);
14
- const json = stringify(known, 2);
15
-
16
- try {
17
- expect(
18
- JSON.parse(json)
19
- ).toEqual(
20
- JSON.parse(
21
- fs.readFileSync(testUrl, 'utf-8')
22
- )
23
- );
24
- } catch (error) {
25
- if (process.env['GITHUB_REPOSITORY']) {
26
- console.error(json);
27
-
28
- throw error;
29
- }
30
-
31
- fs.writeFileSync(testUrl, json, { flag: 'w' });
32
- }
33
- });
34
- });
package/src/types.ts DELETED
@@ -1,43 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/networks authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import type { RegistryEntry } from '@substrate/ss58-registry';
5
- import type { HexString } from '@pezkuwi/util/types';
6
-
7
- export type Icon = 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate';
8
-
9
- export type KnownIcon = Record<string, Icon>;
10
-
11
- export type KnownLedger = Record<string, number>;
12
-
13
- export type KnownGenesis = Record<string, HexString[]>;
14
-
15
- export type KnownBizinikiwi = RegistryEntry;
16
-
17
- export type KnownTestnet = Record<string, true>;
18
-
19
- export interface BizinikwiNetwork extends KnownBizinikiwi {
20
- /** The genesisHash for the chain */
21
- genesisHash: HexString[];
22
- /** Does the chain has support for Ledger devices */
23
- hasLedgerSupport: boolean;
24
- /** The IdentityIcon to use for the chain */
25
- icon: Icon;
26
- /** Flag set when we don't include this chain */
27
- isIgnored: boolean;
28
- /** Flag to indicate a testnet */
29
- isTestnet: boolean;
30
- /** The Ledger-specific/required slip44 for the chain */
31
- slip44?: number | null;
32
- }
33
-
34
- export interface Network extends BizinikwiNetwork {
35
- /** The network assigned to this chain */
36
- network: string;
37
- }
38
-
39
- export interface Ss58Registry {
40
- registry: KnownBizinikiwi[];
41
- specification: string;
42
- schema: Record<keyof KnownBizinikiwi, string>;
43
- }