File tree Expand file tree Collapse file tree 4 files changed +47
-13
lines changed Expand file tree Collapse file tree 4 files changed +47
-13
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @hyperbitjs/chains" ,
3
- "version" : " 1.10.0 " ,
3
+ "version" : " 1.10.1 " ,
4
4
"license" : " MIT" ,
5
5
"main" : " dist/index.js" ,
6
6
"typings" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -153,34 +153,61 @@ export type Algorithm =
153
153
| 'zhash' ;
154
154
155
155
export type Symbol =
156
- | 'btc'
157
156
| 'bch'
158
157
| 'blk'
158
+ | 'btc'
159
+ | 'btcz'
160
+ | 'btg'
161
+ | 'bze'
159
162
| 'cbn'
163
+ | 'cdy'
160
164
| 'city'
165
+ | 'clore'
166
+ | 'cmm'
161
167
| 'dash'
162
168
| 'dcr'
163
- | 'dnr'
164
169
| 'dgb'
165
- | 'xdn '
170
+ | 'dnr '
166
171
| 'doge'
172
+ | 'dogec'
173
+ | 'dyn'
167
174
| 'evr'
175
+ | 'fdr'
176
+ | 'firo'
177
+ | 'fls'
178
+ | 'flux'
179
+ | 'fren'
168
180
| 'ftc'
181
+ | 'glink'
169
182
| 'grs'
183
+ | 'ilc'
184
+ | 'kmd'
170
185
| 'ltc'
186
+ | 'ltz'
171
187
| 'mewc'
172
188
| 'mona'
173
- | 'nmc'
174
189
| 'nav'
175
- | 'xna'
176
190
| 'nbt'
177
- | 'ppc'
191
+ | 'neox'
192
+ | 'nmc'
178
193
| 'pgn'
194
+ | 'pivx'
195
+ | 'ppc'
179
196
| 'qtum'
180
- | 'rvn'
181
197
| 'rdd'
182
198
| 'rito'
183
- | 'vtc'
199
+ | 'rtm'
200
+ | 'rvc'
201
+ | 'rvn'
202
+ | 'satox'
203
+ | 'tls'
204
+ | 'vgc'
184
205
| 'via'
206
+ | 'vrsc'
207
+ | 'vtc'
185
208
| 'x42'
186
- | 'zec' ;
209
+ | 'xdn'
210
+ | 'xna'
211
+ | 'zec'
212
+ | 'zen'
213
+ | 'zer' ;
Original file line number Diff line number Diff line change @@ -70,9 +70,9 @@ export function findNetworkById(id: string): Network | undefined {
70
70
return undefined ;
71
71
}
72
72
73
- export function getChainIds ( symbol : Symbol ) : string [ ] {
73
+ export function getChainIds ( network : Network [ 'network' ] ) : string [ ] {
74
74
return Object . keys ( chains ) . reduce < string [ ] > ( ( acc : string [ ] , key : string ) => {
75
- const n = chains [ key as Symbol ] [ symbol ] ;
75
+ const n = chains [ key as Symbol ] [ network ] ;
76
76
if ( n ) {
77
77
return [ ...acc , n . id ] ;
78
78
}
Original file line number Diff line number Diff line change @@ -31,12 +31,19 @@ describe('chains', () => {
31
31
32
32
it ( 'should get a list of chain ids' , ( ) => {
33
33
const names = getChainIds ( 'mainnet' ) ;
34
- expect ( names ) . toContain ( 'E406C7BC-5DFD-461F-B67C-D8027DD72B96 ' ) ;
34
+ expect ( names ) . toContain ( 'A44223B1-CEE2-4EE6-B331-36A6BF608A69 ' ) ;
35
35
} ) ;
36
36
37
37
it ( 'should get chain networks by network type' , ( ) => {
38
38
const networks = getChainsByNetwork ( 'mainnet' ) ;
39
39
expect ( networks . length ) . toBeGreaterThan ( 0 ) ;
40
+ expect ( networks [ 0 ] . id ) . toBe ( 'A44223B1-CEE2-4EE6-B331-36A6BF608A69' ) ;
41
+ } ) ;
42
+
43
+ it ( 'should get chain networks by network and symbol' , ( ) => {
44
+ const networks = getChainsByNetwork ( 'mainnet' , 'btc' ) ;
45
+ expect ( networks . length ) . toBeGreaterThan ( 0 ) ;
40
46
expect ( networks [ 0 ] . id ) . toBe ( 'E406C7BC-5DFD-461F-B67C-D8027DD72B96' ) ;
47
+ expect ( networks [ 0 ] . name ) . toBe ( 'Bitcoin' ) ;
41
48
} ) ;
42
49
} ) ;
You can’t perform that action at this time.
0 commit comments