跳转到主要内容
POST
/
getBlocksWithLimit
curl --request POST \
  --url https://mainnet.helius-rpc.com/ \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "getBlocksWithLimit",
  "params": [
    5,
    3
  ]
}'
{
  "jsonrpc": "2.0",
  "id": "1",
  "result": [
    5,
    6,
    7
  ]
}

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:getBlocksWithLimit
required

要调用的RPC方法名称。

Available options:
getBlocksWithLimit
Example:

"getBlocksWithLimit"

params
object[]
required

方法的请求参数。

Response

成功检索到已确认的区块。

jsonrpc
enum<string>

JSON-RPC 协议版本。

Available options:
2.0
Example:

"2.0"

id
string

与请求匹配的标识符。

Example:

"1"

result
integer[]

从请求的插槽开始按升序排列的已确认 Solana 区块插槽编号列表。

Example:
[5, 6, 7]
I