Skip to content

Commit

Permalink
feat: add getblockhash
Browse files Browse the repository at this point in the history
  • Loading branch information
gridcat committed Jul 6, 2021
1 parent e04a65c commit 6c4f010
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/RPC/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,15 @@ export class Network extends RPCBase {
public async getBlockCount(): Promise<number> {
return this.call('getblockcount');
}

/**
* Returns hash of block in best-block-chain at <index>
*
* @param {index} block - Block number for requested hash
* @returns {Promise<string>}
* @memberof Network
*/
public async getBlockHash(index: number): Promise<string> {
return this.call('getblockhash', index);
}
}

0 comments on commit 6c4f010

Please sign in to comment.