Package Exports
- @warren-bank/node-shapeshift-api
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@warren-bank/node-shapeshift-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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