https://github.com/codechain-io/codechain-rpc-js
A thin wrapper of CodeChain RPC
https://github.com/codechain-io/codechain-rpc-js
javascript rpc sdk
Last synced: 7 months ago
JSON representation
A thin wrapper of CodeChain RPC
- Host: GitHub
- URL: https://github.com/codechain-io/codechain-rpc-js
- Owner: CodeChain-io
- License: isc
- Created: 2019-06-06T07:48:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-29T01:14:17.000Z (almost 5 years ago)
- Last Synced: 2023-11-03T23:01:18.026Z (over 1 year ago)
- Topics: javascript, rpc, sdk
- Language: TypeScript
- Size: 26.4 KB
- Stars: 4
- Watchers: 8
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
CodeChain RPC JS
=================CodeChain RPC JS is a JavaScript library that calls RPC to a CodeChain node.
How to install
--------------If you are using NPM, use the command below:
```
npm install codechain-rpc --save
```If you prefer Yarn, use the command below:
```
yarn add codechain-rpc
```Example
-------```
const RPC = require("codechain-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).