getSlot RPC 方法

返回已达到指定或默认确认级别的 slot

$ curl https://api.devnet.solana.com -s -X \
> POST -H "Content-Type: application/json" -d '
> {
> "jsonrpc": "2.0",
> "id": 1,
> "method": "getSlot",
> "params": [
> {
> "commitment": "finalized"
> }
> ]
> }
> '

params

objectoptional

包含以下字段的配置对象:

result

Response
{
"jsonrpc": "2.0",
"result": 1234,
"id": 1
}
u64

当前 slot

Is this page helpful?