0.0.6 • Published 9 years ago
@theblock/shapeshift-promise v0.0.6
shapeshift-promise
A thin ES6 promise wrapper around the shapeshift.io APIs as documented at https://shapeshift.io/api
polyfill dependencies
The environment needs to support ES6 Promises and the fetch api. To polyfill support in all browsers/environments, these are recommended -
- es6-promise (or any other Promise polyfill)
- isomorphic-fetch (or any other fetch polyfill, selected due to Node & browser applicability)
usage
installation -
npm install --save @theblock/shapeshift-promise
For browsers, include the node_modules/@theblock/shapeshift-promise/build/browser.js
into your HTML. (This exposes the shapeshift object on window.shapeshift
). Usage in Node -
const APIKEY = 'private affiliate key or undefined';
const shapeshift = require('@theblock/shapeshift-promise')(APIKEY);
// api calls goes here
api
queries -
getCoins()
https://shapeshift.io/api#api-104getMarketInfo(pair)
https://shapeshift.io/api#api-103getStatus(depositAddress)
https://shapeshift.io/api#api-5
transactions -
shift(toAddress, returnAddress, pair)
https://shapeshift.io/api#api-7