TriportRPC

blockSubscribe

Last updated:

Parameters

This method takes no parameters.

Returns

blockSubscribe return value
FieldType
resultobject

Examples

curl https://<your-endpoint>/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"blockSubscribe","params":[]}'
const res = await fetch("https://<your-endpoint>/", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "id": 1,
  "method": "blockSubscribe",
  "params": [],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"blockSubscribe","params":[],"jsonrpc":"2.0"})
print(resp.json())

Usage

  1. Transport: WebSocket.
  2. Networks: mainnet, devnet, testnet.
  3. Credit cost: 1 per call.

FAQ

What does blockSubscribe do?
blockSubscribe streams a notification for every new block matching the filter (all blocks, or only those mentioning a given account or program).
How many credits does blockSubscribe cost?
blockSubscribe costs 1 credit(s) per call on Triport by default.
Is blockSubscribe available over WebSocket?
Yes, blockSubscribe supports WebSocket.