JSPM

@warren-bank/node-shapeshift-api

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q31071F
  • License GPL-2.0

shapeshift.io API client library for Node.js

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})
  • 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}
    • output: Promise

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)
})