Ionomy API Client for Node JS
hive-139531·@reazuliqbal·
0.000 HBDIonomy API Client for Node JS
<center></center>
Ionomy exchange was quick to support and list Hive. That was the first time I heard about them. They don't have much liquidity yet. So, with the recent volatile market, there are many arbitrage opportunities if you act quickly enough.
To test my theory I went on to look for any available client library for them but found none. So, I wrote one modeled after another library named `bittrex-node`.
This is my first library published to [NPM](https://www.npmjs.com/package/ionomy-node). :)
## Repository
https://github.com/CodeBull/ionomy-node
## Usage
Get your API key and secret from https://ionomy.com/en/account/api. You need to enable 2FA before generating a key.
### Installation
```bash=
npm i ionomy-node
```
### Initialize Client
```javascript=
const Ionomy = require('ionomy-node');
const client = new Ionomy({
apiKey: 'abcdapikey',
apiSecret: 'abcdapisecret',
});
```
### Public Methods
```javascript=
await client.markets();
```
Returns an array of all the available markets.
```javascript=
await client.currencies();
```
Returns an array of all the available currencies.
```javascript=
await client.orderBook({ market: 'btc-hive', type: 'both' });
```
Returns the buy/sell/both order book(s) of the provided market.
```javascript=
await client.marketSummaries();
```
Returns an array of summary of all available markets.
```javascript=
await client.marketSummary('btc-hive');
```
Returns market summary of the provided market.
```javascript=
await client.marketHistory('btc-hive');
```
Returns an array of buy and sell history of the provided market.
### Market Methods
```javascript=
await client.limitBuy({ market: 'btc-hive', amount: '100', price: '0.00005' });
```
Places a limit buy order.
```javascript=
await client.limitSell({ market: 'btc-hive', amount: '100', price: '0.00005' });
```
Places a limit sell order.
```javascript=
await client.cancelOrder('5b8e8c980e454f2b807863ee');
```
Cancels an order with the provided ID.
```javascript=
await client.openOrders('btc-hive');
```
Returns all open orders in the provided market.
### Account Methods
```javascript=
await client.balances();
```
Returns balance of every currency.
```javascript=
await client.balance('hive');
```
Returns balance of the provided currency.
```javascript=
await client.depositAddress('hive');
```
Returns the deposit address of the provided currency.
```javascript=
await client.depositHistory('hive');
```
Returns deposit history of the provided currency.
```javascript=
await client.withdraw({ currency: 'hive', amount: '100', address: 'reazuliqbal' });
```
Places a withdrawal request of the provided currency.
```javascript=
await client.withdrawalHistory('hive');
```
Returns withdrawal history of the provided currency.
```javascript=
await client.order('5b8e8c980e454f2b807863ee');
```
Returns order details of the provided order ID.
```javascript=
await client.orderHistory('btc-hive');
```
Returns your order history of the provided market.
---
Please report any issue here in the comments or on the Github issues.
<sup>Code screenshot generated using [Carbon](https://carbon.now.sh).</sup>
___
<center>
I am running a Hive Witness as @BDCommunity.
**Please vote for [@BDCommunity](https://hivesigner.com/sign/account-witness-vote?witness=bdcommunity&approve=1) as a witness.**
</center>👍 brofund, yameen, xawi, swedishdragon76, dalz, revisesociology, enforcer48, roleerob, reazuliqbal, gerber, nealmcspadden, steemcityrewards, deathwing, emrebeyler, steemflagrewards, flagawhale, smartmeme, sfr-treasury, mys, trump3t, admiralbot, steemhistorian, dappcoder, huaren.news, goodreader, staryao, aivote, daan, exyle, shitsignals, pataty69, cadawg, bestboom, freddio, neutralizer, gallerani, triptolemus, creativeblue, merlin7, sfr-mod-fund, determine, permaculturedude, steem.leo, freddio.sport, asteroids, mapxv, leo.syndication, one.life, maxuvd, rafalski, caladan, blockbrothers, nateaguila, followjohngalt, flyingbolt, map10k, triplea.bot, ribary, thranax, tiffin, accelerator, coinmarketcal, elkaos, gerbo, watchlist, bdvoter, jonsnow1983, drillith, zaku, hafizullah, alamin33, swiftcash, swiftbot, engrsayful, r-sm, bilpcoinbpc, lovenfreedom, simplifylife, citizensmith, iamstan, hugo4u, chops.support, xawi-ag, calprut, chiema, sayee, filler, dagadu, cryptonik, ralph-rennoldson, double.bear.neox, sugar-cube, promo-mentors, dante31, ashleykalila, tpkidkai, kanabeatz, siniceku, boyacun123, thepen, adityajainxds, bala41288, c0ff33a, whiterosecoffee, mdosev, the.lazy.panda, sarakey, giftgiver, podanrj, nataly2317, bue, azircon, linco, shuvo35, szabolcs, diegor, chitty, denisdenis, rehan.neox, oaldamster, leoplaw, roundbeargames, bala-ag, hammadakhtar, erickpinos, rehan12, chugoi911, luismmolina, engrave, santarius, glodniwiedzy, ocisly, imperfect-one, aditor, spacesheep, acronyms, gameeit, ttg, bonzopoe, giuatt07, bela29, abrockman, colecornell, memehub, gitplait, tailah.bayu, goumao, wf9877, opidia, superhardness, techtek, womic, zaibkang, hellohive, neoxian, raymondspeaks, aamirijaz, justinparke, joedukeg, hetty-rowan, vxc-ag, jadnven, jeehun, shin0288, norbu, drakos, netuoso, steemik, steemseph, essejparr, zakia, pqlenator, atanas007, yoogyart, mountaingod, deepu7, godlovermel25, yuriy4, gangni, espoem, maxwellelisha19, mfblack, drag33, kotturinn, shadonchandra, neoxiancityvb, sameoldnilss, delso, shaotech, jexus77, cloris, alaydroes83, santoninoatocha, bahagia-arbi, grider123, edicted, tiababi, dudeontheweb, sekhet, udezee, leprechaun, amryksr, yehey, filipino, shares, branding, broadcast, automation, pesos, petscorner, mendoza, pinoy, keys-defender, marcocasario, diyhub, always1success, borysborys, phusionphil, steemvpn, zelegations, ahmedsy, r-ag, arabisouri, tripnwizard, ivario,