https://github.com/codechain-io/foundry-rpc-js
A thin wrapper of Foundry RPC
https://github.com/codechain-io/foundry-rpc-js
Last synced: 7 months ago
JSON representation
A thin wrapper of Foundry RPC
- Host: GitHub
- URL: https://github.com/codechain-io/foundry-rpc-js
- Owner: CodeChain-io
- License: isc
- Created: 2020-01-21T06:28:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-29T01:12:06.000Z (over 5 years ago)
- Last Synced: 2025-05-22T21:34:06.008Z (8 months ago)
- Language: TypeScript
- Homepage:
- Size: 64.5 KB
- Stars: 5
- Watchers: 9
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Foundry RPC JS [](https://travis-ci.org/CodeChain-io/foundry-rpc-js)
Foundry RPC JS is a JavaScript library that calls RPC to a Foundry node.
## How to install
If you are using NPM, use the command below:
```
npm install foundry-rpc --save
```
If you prefer Yarn, use the command below:
```
yarn add foundry-rpc
```
## Example
```
const RPC = require("foundry-rpc").default;
async function main() {
const rpc = new RPC("http://localhost:8080");
const blockNumber = await rpc.chain.getBestBlockNumber();
console.log(`Current best block number: ${blockNumber}`);
}
main().catch(console.error);
```
## RPC list
You can find the RPC list in [this link](https://github.com/CodeChain-io/codechain/blob/master/spec/JSON-RPC.md).