Skip to main content

Quickstart

This guide uses the official Node.js library, hollaex-node-lib, which signs requests for you. If you prefer another language, see Signing Requests.

1. Install​

mkdir hollaex-quickstart && cd hollaex-quickstart
npm init -y
npm install hollaex-node-lib

2. Configure the client​

Keep credentials in environment variables:

export HOLLAEX_API_URL="https://<your-api-domain>" # no /v2 suffix
export HOLLAEX_WS_URL="wss://<your-api-domain>/stream"
export HOLLAEX_API_KEY="..."
export HOLLAEX_API_SECRET="..."
client.js
const hollaex = require('hollaex-node-lib');

module.exports = new hollaex({
apiURL: process.env.HOLLAEX_API_URL,
wsURL: process.env.HOLLAEX_WS_URL,
apiKey: process.env.HOLLAEX_API_KEY,
apiSecret: process.env.HOLLAEX_API_SECRET,
// apiExpiresAfter: 60, // seconds each signed request stays valid (default 60)
});

The library adds /v2 itself. Every method returns a Promise.

3. Public data (no key needed)​

public.js
const client = require('./client');

(async () => {
const ticker = await client.getTicker('btc-usdt');
console.log('BTC last price:', ticker.last);

const book = await client.getOrderbook('btc-usdt');
console.log('Best bid/ask:', book['btc-usdt'].bids[0], book['btc-usdt'].asks[0]);

const constants = await client.getConstants(); // coins, pairs, tick sizes, min/max sizes
console.log('Pairs:', Object.keys(constants.pairs));
})().catch((err) => console.error(err.message));

4. User calls (user key)​

trade.js
const client = require('./client');

(async () => {
const balance = await client.getBalance();
console.log('USDT available:', balance.usdt_available);

// Limit buy 0.001 BTC at 30,000 USDT
const order = await client.createOrder('btc-usdt', 'buy', 0.001, 'limit', 30000);
console.log('Order placed:', order.id, order.status);

const open = await client.getOrders({ symbol: 'btc-usdt', open: true });
console.log('Open orders:', open.count);

await client.cancelOrder(order.id);
console.log('Cancelled', order.id);
})().catch((err) => console.error(err.message));
tip

Read getConstants() before placing orders. Each pair has an increment_size, increment_price, min_size and max_size. Orders that don't respect them are rejected.

5. Admin calls (admin key)​

admin.js
const client = require('./client');

(async () => {
const info = await client.getExchangeInfo();
console.log('Exchange:', info.name);

const users = await client.getExchangeUsers({ limit: 10, order: 'desc' });
console.log(`${users.count} users, latest:`, users.data.map((u) => u.email));

const balance = await client.getExchangeUserBalance(users.data[0].id);
console.log('First user balance:', balance);
})().catch((err) => console.error(err.message));

For the full list of methods, see the library README. Each method maps to an endpoint in the API Reference.

Next steps​