client-blockchain-rpc
v1.1.5
Published
Simple client blockchain rpc
Downloads
8
Maintainers
Readme
📖 Description :
This very light package was created for those of you who want to interact directly with the EVM, SOLANA, and other blockchain.
- support network http
- support network websocket
- support network ipc
💻 Step to install :
npm install client-blockchain-rpc
✏️ Example :
import { provider } from "client-blockchain-rpc";
const init = provider({
urlRpc: "https://bscrpc.com",
});
Usage
const { provider } = require("..");
const init = provider({
urlRpc: "https://bscrpc.com",
});
(async () => {
// single request
const chainId = await init.send({
method: "eth_chainId",
params: [],
formatReturn: parseInt,
});
// batch request
const resBatch = await init.sendBatch([
{
method: "eth_chainId",
params: [],
formatReturn: BigInt,
},
{
method: "eth_gasPrice",
params: [],
formatReturn: BigInt,
},
]);
})();
full example see here
🧾 Pre-Requisistes :
node.js >= 18
📝 License :
Licensed under the MIT License.