@warren-bank/node-shapeshift-api
v1.0.1
Published
shapeshift.io API client library for Node.js
Downloads
16
Maintainers
Readme
Node.js ShapeShift API
Node.js Client Library for the ShapeShift (shapeshift.io) API
This is an asynchronous Promise-based Node.js client for the shapeshift.io API.
Installation:
npm install --save @warren-bank/node-shapeshift-api
Usage:
- class constructor:
- input:
config
(optional:{agent, timeout}
)
- input:
api()
method:- input:
method
(required),params
(varies by method) where:method
is one of the following values (as specified in the official API docs ):- 'rate',
{pair}
- 'limit',
{pair}
- 'marketinfo',
{pair}
- 'recenttx',
{max}
- 'txStat',
{address}
- 'timeremaining',
{address}
- 'getcoins',
{}
- 'txbyapikey',
{apiKey}
// PRIVATE api key - 'txbyaddress',
{address, apiKey}
// PRIVATE api key - 'validateAddress',
{address, coinSymbol}
- 'shift',
{withdrawal, pair, returnAddress, destTag, rsAddress, apiKey}
// PUBLIC api key - 'mail',
{email, txid}
- 'sendamount',
{amount, withdrawal, pair, returnAddress, destTag, rsAddress, apiKey}
// PUBLIC api key - 'cancelpending',
{address}
- 'rate',
- output: Promise
- input:
Example:
const shapeshiftClient = require('@warren-bank/node-shapeshift-api')
const shapeshift = new shapeshiftClient({timeout: 10000})
// get current rate for currency pair
shapeshift.api('rate', {pair: 'BTC_ETH'})
.then((result) => {
console.log(`pair: ${result.pair}`)
console.log(`rate: ${result.rate}`)
})
.catch((error) => {
console.log('Error:', error.message)
})
Legal:
- copyright: Warren Bank
- license: GPL-2.0