Loading proofofbrain-blog...

Ionomy API Client for Node JS

carbon.png

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. :)

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

npm i ionomy-node

Initialize Client

const Ionomy = require('ionomy-node');

const client = new Ionomy({
  apiKey: 'abcdapikey',
  apiSecret: 'abcdapisecret',
});

Public Methods

await client.markets();

Returns an array of all the available markets.

await client.currencies();

Returns an array of all the available currencies.

await client.orderBook({ market: 'btc-hive', type: 'both' });

Returns the buy/sell/both order book(s) of the provided market.

await client.marketSummaries();

Returns an array of summary of all available markets.

await client.marketSummary('btc-hive');

Returns market summary of the provided market.

await client.marketHistory('btc-hive');

Returns an array of buy and sell history of the provided market.

Market Methods

await client.limitBuy({ market: 'btc-hive', amount: '100', price: '0.00005' });

Places a limit buy order.

await client.limitSell({ market: 'btc-hive', amount: '100', price: '0.00005' });

Places a limit sell order.

await client.cancelOrder('5b8e8c980e454f2b807863ee');

Cancels an order with the provided ID.

await client.openOrders('btc-hive');

Returns all open orders in the provided market.

Account Methods

await client.balances();

Returns balance of every currency.

await client.balance('hive');

Returns balance of the provided currency.

await client.depositAddress('hive');

Returns the deposit address of the provided currency.

await client.depositHistory('hive');

Returns deposit history of the provided currency.

await client.withdraw({ currency: 'hive', amount: '100', address: 'reazuliqbal' });

Places a withdrawal request of the provided currency.

await client.withdrawalHistory('hive');

Returns withdrawal history of the provided currency.

await client.order('5b8e8c980e454f2b807863ee');

Returns order details of the provided order ID.

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.

Code screenshot generated using Carbon.



I am running a Hive Witness as @BDCommunity.

Please vote for @BDCommunity as a witness.

H2
H3
H4
3 columns
2 columns
1 column
9 Comments