File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 11import snapshot from '@snapshot-labs/snapshot.js' ;
2+ import networks from '@snapshot-labs/snapshot.js/src/networks.json' ;
23
34export type Block = {
45 number : number ;
@@ -17,10 +18,6 @@ interface EthereumBlockResponse {
1718
1819type BlockResponse = StarknetBlockResponse | EthereumBlockResponse ;
1920
20- const STARKNET_MAINNET_ID = '0x534e5f4d41494e' ;
21- const STARKNET_TESTNET_ID = '0x534e5f5345504f4c4941' ;
22- const STARKNET_NETWORKS = [ STARKNET_MAINNET_ID , STARKNET_TESTNET_ID ] ;
23-
2421export async function getBlockNumber (
2522 network : string ,
2623 blockNum : number | 'latest'
@@ -36,7 +33,7 @@ function interpretResult(network: string, result: BlockResponse | null): Block {
3633 throw new Error ( `Invalid block response for network ${ network } ` ) ;
3734 }
3835
39- if ( STARKNET_NETWORKS . includes ( network ) ) {
36+ if ( networks [ network ] . starknet ) {
4037 const starknetResult = result as StarknetBlockResponse ;
4138 return {
4239 number : starknetResult . block_number ,
You can’t perform that action at this time.
0 commit comments