跳转到主要内容
POST
/
getLatestBlockhash
curl --request POST \
  --url https://mainnet.helius-rpc.com/ \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "getLatestBlockhash",
  "params": [
    {
      "commitment": "已处理",
      "minContextSlot": 1000
    }
  ]
}'
{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "context": {
      "slot": 2792
    },
    "value": {
      "blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
      "lastValidBlockHeight": 3090
    }
  }
}

Authorizations

api-key
string
query
required

您的Helius API密钥。您可以在仪表板中免费获取一个。

Body

application/json
jsonrpc
enum<string>
default:2.0
required

JSON-RPC协议版本。

Available options:
2.0
Example:

"2.0"

id
string
default:1
required

请求的唯一标识符。

Example:

"1"

method
enum<string>
default:getLatestBlockhash
required

要调用的RPC方法名称。

Available options:
getLatestBlockhash
Example:

"getLatestBlockhash"

params
object[]

请求的可选配置对象。

Response

成功检索到最新的区块哈希信息。

jsonrpc
enum<string>

JSON-RPC协议版本。

Available options:
2.0
Example:

"2.0"

id
string

与请求匹配的标识符。

Example:

"1"

result
object

包含区块哈希信息的RpcResponse。

I