Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
/ stdrpc Public archive
forked from montyanderson/stdrpc

ES6+ compatible, isomorphic JSON-RPC module for node and the browser.

License

Notifications You must be signed in to change notification settings

HorizenOfficial/stdrpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stdrpc

ES6+ compatible, isomorphic JSON-RPC module for node and the browser.

Build Status Coverage Status

  • 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

Usage

const rpc = stdrpc({
	url: "http://localhost:8332"
});

rpc.getbalance().then(balance => {
	// woo!
});

API

stdrpc(options)

Returns a proxied object, returning a function for every method.

options

url

Type: string

Address of the RPC server

timeout

Type: number

Connection timeout. Default 0 (no timeout)

username

Type: string

Username for authentication

password

Type: string

Password authentication

methodTransform

Type: function

Transform function for method names

const rpc = stdrpc({
	url: "http://localhost:8545",
	methodTransform: require("decamelize")
});

rpc.ethCoinbase() // becomes rpc.eth_coinbase()

About

ES6+ compatible, isomorphic JSON-RPC module for node and the browser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%