(endpoint: string)
| 4 | import {HttpJsonRpcClient, WsJsonRpcClient} from './client'; |
| 5 | |
| 6 | export async function getGenesisHash(endpoint: string): Promise<string> { |
| 7 | const client = endpoint.startsWith('ws') ? new WsJsonRpcClient(endpoint) : new HttpJsonRpcClient(endpoint); |
| 8 | const genesisBlock = await client.send<string>('chain_getBlockHash', [0]); |
| 9 | (client as WsJsonRpcClient).destroy?.(); |
| 10 | return genesisBlock; |
| 11 | } |