File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ export class Provider {
4848 return this . baseUrl ;
4949 }
5050
51+ //** Returns the result from the officially hosted list of Blockcore supported chains. */
52+ public getNetworks < AxiosResponse > ( ) : Promise < AxiosResponse | undefined > {
53+ return this . executeGet ( 'https://chains.blockcore.net/CHAINS.json' )
54+ }
55+
5156 public getSupply < AxiosResponse > ( ) : Promise < AxiosResponse | undefined > {
5257 return this . executeGet ( this . baseUrl + "/api/insight/supply" )
5358 }
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ describe("Provider test suit", () => {
3636 // return expect(provider.getAddress(getSupplyMock)).resolves.toMatchObject(someResponse);
3737 // })
3838
39+ it ( 'should get networks' , async ( ) => {
40+ let result : any = await provider . getNetworks ( ) ;
41+ expect ( result . data [ 0 ] . symbol ) . toMatch ( 'BTC' ) ;
42+ } )
43+
3944 it ( 'should get correct network url' , async ( ) => {
4045 let result = await provider . getNetworkUrl ( 'CITY' ) ;
4146 expect ( result ) . toMatch ( 'https://city.indexer.blockcore.net' ) ;
You can’t perform that action at this time.
0 commit comments