mycelium-gear
v0.0.5
Published
An easy to use JavaScript API for Mycelium Gear's API
Downloads
10
Readme
Mycelium Gear JavaScript Client API
Because Mycelium Gear only has a Ruby implementation, it was clear a JavaScript implementation was in need.
Usage
Very easy to use!
const MyceliumGear = require('mycelium-gear')
const gateway = new MyceliumGear.Gateway('gateway-id', 'gateway-secret')
const order = new MyceliumGear.Order(gateway, 1000, 'callback-data')
order
.send()
.then((response) => {
response.json().then((json) => {
/* More computation with object returned from Mycelium Gear. */
})
})
.catch((error) => {
console.error(error)
})
There is no "listener" API for order status changes because it is already simple. Please look at Mycelium Gear documentation on how to get order status changes. There are 3 ways to check: a websocket, http request to a web server, and manual GET requests.