An open API service indexing awesome lists of open source software.

https://github.com/damartripamungkas/client-blockchain-rpc

⛓️ Simple client blockchain rpc
https://github.com/damartripamungkas/client-blockchain-rpc

arbitrum blockchain blockchain-rpc client-blockchain-rpc ethereum jsonrpc solana

Last synced: 5 months ago
JSON representation

⛓️ Simple client blockchain rpc

Awesome Lists containing this project

README

        


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 :

```javascript
import { provider } from "client-blockchain-rpc";
const init = provider({
urlRpc: "https://bscrpc.com",
});
```

#### Usage

```javascript
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](./test)

### 🧾 Pre-Requisistes :

```
node.js >= 18
```

### 📝 License :

Licensed under the [MIT License](./LICENSE).