client-blockchain-rpc
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

CLIENT-BLOCKCHAIN-RPC

GitHub top language Made by Repository size GitHub last commit


📖 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.

Package Sidebar

Install

npm i client-blockchain-rpc

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

12.2 kB

Total Files

7

Last publish

Collaborators

  • damartripamungkas