Documentation Index
Fetch the complete documentation index at: https://chainstack-mintlify-flesh-empty-pages.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
No NEAR support
Chainstack deprecated support for NEAR nodes. This page here is for legacy and in case you may find it useful.
NEAR CLI
- Install the NEAR CLI.
- Use the
--node_url flag to operate through your NEAR node:
near COMMAND --node_url YOUR_CHAINSTACK_ENDPOINT
where
- COMMAND — a supported NEAR CLI command
- NEAR_ENDPOINT — your node HTTPS or WSS endpoint.
JSON-RPC API
Interact with your NEAR node using JSON-RPC API.
Use curl or Postman.
Example to get the latest block:
curl -H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": "1", "method": "block", "params": {"finality": "final"}}' \
NEAR_ENDPOINT
where
NEAR_ENDPOINT is your node HTTPS or WSS endpoint.
near-api-js
- Install near-api-js.
- Use
JsonRpcProvider to connect to your NEAR node.
const nearAPI = require("near-api-js");
const connectionInfo = {
url: "NEAR_ENDPOINT"
};
const provider = new nearAPI.providers.JsonRpcProvider(connectionInfo);
async function main() {
const response = await provider.block({
finality: "final",
});
console.log(response)
}
main();
where NEAR_ENDPOINT is your node HTTPS or WSS endpoint.