Ask or search…
⌃K
Links

getbestblockhash

How to use it

TypeScript/JavaScript
1
// yarn add @tatumio/tatum
2
​
3
import { TatumSDK, Dogecoin, Network } from '@tatumio/tatum'
4
​
5
const tatum = await TatumSDK.init<Dogecoin>({network: DOGECOIN})
6
​
7
const result = await tatum.rpc.getBestBlockHash()
8
​
9
await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs

Overview

getbestblockhash is a Dogecoin RPC method that returns the hash of the best (tip) block in the longest blockchain. This method is useful for obtaining the latest block hash, which can be used to fetch block details or confirmations for transactions.

Parameters

This method does not have any parameters.

Return Object

The returned object is a string containing the hash of the best block.

JSON Examples

Request example:
1
{
2
"id": 1,
3
"jsonrpc": "2.0",
4
"method": "getbestblockhash"
5
}
Response example:
1
{
2
"id": 1,
3
"result": "0000000000000000000ef0e1f703b56f2b0d6724e4eeccf00e4f8d55b9c3c3f6e",
4
"error": null
5
}
\
© Tatum Technology, LLC