A Node.js client library for using the Infura API.
npm install infura
Instantiate new instance of API client with a specified, Ethereum network.
Options are mainnet
(default), kovan
, rinkeby
, and ropsten
.
const Infura = require('infura');
const infura = new Infura('rinkeby');
Get available GET and POST methods.
infura.getClientMethods()
.then(({ get, post }) => /* handle */)
.catch(error => /* handle */);
Get available GET method.
infura.getClientMethod('eth_blockNumber')
.then(({ result }) => /* handle */)
.catch(error => /* handle */);
Post available POST method.
Get ticker symbols.
infura.getTickerSymbols()
.then(({ symbols }) => /* handle */)
.catch(error => /* handle */);
Get information about a ticker symbol.
infura.getTickerSymbol('ethusd')
.then(({
ask,
bid,
exchange,
num_exchanges,
quote,
timestamp
total_volume,
volume
}) => /* handle */)
.catch(error => /* handle */);
Get full information about a ticker symbol.
infura.getFullTickerSymbol('ethusd')
.then(({
base,
quote,
tickers
}) => /* handle */)
.catch(error => /* handle */);
Get blackist information.
infura.getFullTickerSymbol('ethusd')
.then(({
blacklist
fuzzlist,
tolerance,
version,
whitelist
}) => /* handle */)
.catch(error => /* handle */);
npm run test
npm run jsdoc