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

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