ES6+ compatible, isomorphic JSON-RPC module for node and the browser.
- Compatible with Bitcoin, Ethereum, Zcash, and many more.
- Supports on-the-fly RPC methods using Proxies
- Works in browser and in node
- Very small codebase
- Uses axios behind the scenes
const rpc = stdrpc({
url: "http://localhost:8332"
});
rpc.getbalance().then(balance => {
// woo!
});
Returns a proxied object, returning a function for every method.
Type: string
Address of the RPC server
Type: number
Connection timeout. Default 0 (no timeout)
Type: string
Username for authentication
Type: string
Password authentication
Type: function
Transform function for method names
const rpc = stdrpc({
url: "http://localhost:8545",
methodTransform: require("decamelize")
});
rpc.ethCoinbase() // becomes rpc.eth_coinbase()