@@ -6,11 +6,16 @@ export interface SubstrateChain {
6
6
name : string
7
7
rpcUrls : [ string , ...string [ ] ]
8
8
ss58Prefix ?: number
9
- explorerUrls ?: string [ ]
9
+ explorerUrls ?: Partial < Record < SubstrateExplorer , string > >
10
10
testnet ?: boolean
11
11
faucetUrls ?: string [ ]
12
12
}
13
13
14
+ export enum SubstrateExplorer {
15
+ Subscan = 'subscan' ,
16
+ PolkadotJs = 'polkadotjs' ,
17
+ }
18
+
14
19
/**
15
20
* Defined Substrate Chain Constants
16
21
*/
@@ -21,9 +26,11 @@ export const development: SubstrateChain = {
21
26
name : 'Local Development' ,
22
27
ss58Prefix : 42 ,
23
28
rpcUrls : [ 'ws://127.0.0.1:9944' ] ,
24
- explorerUrls : [
25
- 'https://polkadot.js.org/apps/#/explorer?rpc=ws://127.0.0.1:9944' ,
26
- ] ,
29
+ explorerUrls : {
30
+ [ SubstrateExplorer . PolkadotJs ] : `https://polkadot.js.org/apps/?rpc=${ encodeURIComponent (
31
+ 'ws://127.0.0.1:9944' ,
32
+ ) } /#/explorer`,
33
+ } ,
27
34
testnet : true ,
28
35
faucetUrls : [
29
36
'https://polkadot.js.org/apps/#/accounts?rpc=ws://127.0.0.1:9944' ,
@@ -37,7 +44,11 @@ export const alephzeroTestnet: SubstrateChain = {
37
44
name : 'Aleph Zero Testnet' ,
38
45
ss58Prefix : 42 ,
39
46
rpcUrls : [ 'wss://ws.test.azero.dev' ] ,
40
- explorerUrls : [ 'https://azero.dev/?rpc=wss%3A%2F%2Fws.test.azero.dev' ] ,
47
+ explorerUrls : {
48
+ [ SubstrateExplorer . PolkadotJs ] : `https://test.azero.dev/?rpc=${ encodeURIComponent (
49
+ 'wss://ws.test.azero.dev' ,
50
+ ) } /#/explorer`,
51
+ } ,
41
52
testnet : true ,
42
53
faucetUrls : [ 'https://faucet.test.azero.dev' ] ,
43
54
}
@@ -46,19 +57,23 @@ export const rococo: SubstrateChain = {
46
57
network : 'rococo' ,
47
58
name : 'Rococo' ,
48
59
rpcUrls : [ 'wss://rococo-rpc.polkadot.io' ] ,
60
+ explorerUrls : {
61
+ [ SubstrateExplorer . Subscan ] : `https://rococo.subscan.io` ,
62
+ } ,
49
63
testnet : true ,
50
64
faucetUrls : [ 'https://matrix.to/#/#rococo-faucet:matrix.org' ] ,
51
- explorerUrls : [ 'https://rococo.subscan.io' ] ,
52
65
}
53
66
54
67
export const shibuya : SubstrateChain = {
55
68
network : 'shibuya' ,
56
69
name : 'Shibuya Testnet' ,
57
- testnet : true ,
58
70
ss58Prefix : 5 ,
59
71
rpcUrls : [ 'wss://shibuya-rpc.dwellir.com' ] ,
72
+ explorerUrls : {
73
+ [ SubstrateExplorer . Subscan ] : `https://shibuya.subscan.io` ,
74
+ } ,
75
+ testnet : true ,
60
76
faucetUrls : [ 'https://portal.astar.network/#/shibuya-testnet/assets' ] ,
61
- explorerUrls : [ 'https://shibuya.subscan.io' ] ,
62
77
}
63
78
64
79
/// Canary Networks (Kusama)
@@ -68,7 +83,9 @@ export const shiden: SubstrateChain = {
68
83
name : 'Shiden' ,
69
84
ss58Prefix : 5 ,
70
85
rpcUrls : [ 'wss://shiden-rpc.dwellir.com' ] ,
71
- explorerUrls : [ 'https://shiden.subscan.io' ] ,
86
+ explorerUrls : {
87
+ [ SubstrateExplorer . Subscan ] : `https://shiden.subscan.io` ,
88
+ } ,
72
89
}
73
90
74
91
/// Mainnets
@@ -78,16 +95,23 @@ export const alephzero: SubstrateChain = {
78
95
name : 'Aleph Zero' ,
79
96
ss58Prefix : 42 ,
80
97
rpcUrls : [ 'wss://ws.azero.dev' ] ,
81
- explorerUrls : [ 'https://azero.dev/?rpc=wss%3A%2F%2Fws.azero.dev' ] ,
98
+ explorerUrls : {
99
+ [ SubstrateExplorer . Subscan ] : `https://alephzero.subscan.io` ,
100
+ [ SubstrateExplorer . PolkadotJs ] : `https://azero.dev/?rpc=${ encodeURIComponent (
101
+ 'wss://ws.azero.dev' ,
102
+ ) } /#/explorer`,
103
+ } ,
82
104
}
83
105
84
106
export const astar : SubstrateChain = {
85
107
network : 'astar' ,
86
108
name : 'Astar' ,
87
109
ss58Prefix : 5 ,
88
110
rpcUrls : [ 'wss://astar-rpc.dwellir.com' ] ,
111
+ explorerUrls : {
112
+ [ SubstrateExplorer . Subscan ] : `https://astar.subscan.io` ,
113
+ } ,
89
114
faucetUrls : [ ] ,
90
- explorerUrls : [ 'https://astar.subscan.io' ] ,
91
115
}
92
116
93
117
/**
0 commit comments