Skip to main content

Getting NEAR RPC

NEAR ipRPC πŸͺ™β€‹

LavaπŸŒ‹ offers incentivized public RPC for NEAR. Developers can get free, public endpoints for all.

Mainnet πŸŒβ€‹

Service πŸ”ŒURL πŸ”—
🟒 json-rpchttps://near.lava.build

Testnet πŸ§ͺ​

Service πŸ”ŒURL πŸ”—
🟒 json-rpchttps://near-testnet.lava.build

API Reference​

curl -X POST -H "Content-Type: application/json" https://g.w.lavanet.xyz:443/gateway/near/rpc-http/3dc655f970c930f1d3e78ee71beece18 --data '{"jsonrpc":"2.0","method":"block","params":{"finality":"final"},"id":1}'

Gateway​

To learn more about using the Lava Gateway visit the Getting Started guide

SDK​

To learn more about our SDK visit the Getting Started guide

Input πŸ“₯​

// Install lavaSDK with the following command:
// npm i @lavanet/lava-sdk
const { LavaSDK } = require("@lavanet/lava-sdk");

async function useNEARMainnet() {
const nearMainnet = await LavaSDK.create({
privateKey: process.env.PRIVATE_KEY, //hide your private key in an environmental variable
chainIds: "NEAR",
});

const nearBlockResponse = await nearMainnet.sendRelay({
method: "block",
params: { finality: "final" },
rpcInterface: "jsonrpc",
});

console.log(nearBlockResponse);
}

(async () => {
await useNEARMainnet();
})();

Output πŸ“€β€‹

To learn more about our SDK visit the Getting Started guide