Getting NEAR RPC
NEAR ipRPC πͺβ
Lavaπ offers incentivized public RPC for NEAR. Developers can get free, public endpoints for all.
Mainnet πβ
Service π | URL π |
---|---|
π’ json-rpc | https://near.lava.build |
Testnet π§ͺβ
Service π | URL π |
---|---|
π’ json-rpc | https://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 π₯β
- BackEnd
- FrontEnd
// 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();
})();
// 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({
badge: {
badgeServerAddress: "https://badges.lavanet.xyz", // Or your own Badge-Server URL
projectId: "enter_your_project_id_here"
},
chainIds: 'NEAR',
rpcInterface: "rest",
});
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