You can pass custom apiURL, wsURL and baseURL of the HollaEx-Enabled exchange to connect to. apiURL is https://api.hollaex.com for HollaEx Pro and for your custom exchange it would be something like https://myexchange.com/api.
wsURL is the websocket URL for the socket connection and you should pass your stream URL. For HollaEx Pro it is wss://api.hollaex.com/stream and for your exchange it would be something like wss://myexchange.com/stream. baseURL is not required and it is set by default to /v2 unless you need to connect to an older version of HollaEx.
You can also pass your apiKey and apiSecret generated from the HollaEx-Enabled exchange to use private requests that require authentication. For public endpoints apiKey and apiSecret are not required.
opts.userId: The identifier of the user to filter by
opts.currency: The currency to filter by, pass undefined to receive data on all currencies
opts.limit: Amount of deposits per page. Maximum: 50. Default: 50
opts.page: Page of deposit data. Default: 1
opts.orderBy: The field to order data by e.g. amount, id.
opts.order: Ascending (asc) or descending (desc).
opts.startDate: Start date of query in ISO8601 format.
opts.endDate: End date of query in ISO8601 format.
opts.status: Confirmed status of the deposits to get. Leave blank to get all confirmed and unconfirmed deposits
opts.dismissed: Dismissed status of the deposits to get. Leave blank to get all dismissed and undismissed
deposits
opts.rejected: Rejected status of the deposits to get. Leave blank to get all rejected and unrejected deposits
opts.processing: Processing status of the deposits to get. Leave blank to get all processing and unprocessing deposits
opts.waiting: Waiting status of the deposits to get. Leave blank to get all waiting and unwaiting deposits
opts.transactionId: Deposits with specific transaction ID.
opts.address: Deposits with specific address.
opts.format: Custom format of data set. Enum: ['all', 'csv']
Retrieve list of the user's deposits by admin
getExchangeWithdrawals
opts.userId: The identifier of the user to filter by
opts.currency: The currency to filter by, pass undefined to receive data on all currencies
opts.status: Confirmed status of the withdrawals to get. Leave blank to get all confirmed and unconfirmed withdrawals
opts.dismissed: Dismissed status of the withdrawals to get. Leave blank to get all dismissed and undismissed withdrawals
opts.rejected: Rejected status of the withdrawals to get. Leave blank to get all rejected and unrejected withdrawals
opts.processing: Processing status of the withdrawals to get. Leave blank to get all processing and unprocessing withdrawals
opts.waiting: Waiting status of the withdrawals to get. Leave blank to get all waiting and unwaiting withdrawals
opts.limit: Amount of withdrawals per page. Maximum: 50. Default: 50
opts.page: Page of withdrawal data. Default: 1
opts.orderBy: The field to order data by e.g. amount, id.
opts.order: Ascending (asc) or descending (desc).
opts.startDate: Start date of query in ISO8601 format.
opts.endDate: End date of query in ISO8601 format.
opts.transactionId: Withdrawals with specific transaction ID.
opts.address: Withdrawals with specific address.
opts.format: Custom format of data set. Enum: ['all', 'csv']
Retrieve list of the user's withdrawals by admin
getExchangeBalance
Retrieve admin's wallet balance
transferExchangeAsset
senderId: The identifier of the sender
receiverId: The identifier of the receiver
currency: The currency to specify
amount: The amount to specify
opts.description: The description field
opts.email: The email field
Transfer exchange asset by admin
createExchangeDeposit
userId: The identifier of the user
currency: The currency to specify
amount: The amount to specify
opts.transactionId: deposit with specific transaction ID.
opts.status: The status field to confirm the deposit
opts.email: The email field
opts.fee: The fee to specify
Create exchange deposit by admin
updateExchangeDeposit
transactionId: Deposits with specific transaction ID.
opts.updatedTransactionId: Deposits with updated transaction id
opts.updatedAddress: Deposits with updated address
opts.status: Confirmed status of the deposits to set.
opts.dismissed: Dismissed status of the deposits to set.
opts.rejected: Rejected status of the deposits to set.
opts.processing: Processing status of the deposits to set.
opts.waiting: Waiting status of the deposits to set.
opts.email: Email
Update exchange deposit by admin
createExchangeWithdrawal
userId: The identifier of the user
currency: The currency to specify
amount: The amount to specify
opts.transactionId: Withdrawal with specific transaction ID.
opts.status: The status field to confirm the withdrawal
opts.email: The email field
opts.fee: The fee to specify
Create exchange withdrawal by admin
updateExchangeWithdrawal
transactionId: Withdrawals with specific transaction ID.
opts.updatedTransactionId: Withdrawals with updated transaction id
opts.updatedAddress: Withdrawals with updated address
opts.status: Confirmed status of the withdrawals to set.
opts.dismissed: Dismissed status of the withdrawals to set.
opts.rejected: Rejected status of the withdrawals to set.
opts.processing: Processing status of the withdrawals to set.
opts.waiting: Waiting status of the withdrawals to set.
opts.email: Email
Update Exchange Withdrawal
checkExchangeDepositStatus
userId: The identifier of the user
currency: The currency to filter by, pass undefined to receive data on all currencies
transactionId: Deposits with specific transaction ID.
address: Deposits with specific address.
network: The network info
opts.isTestnet: The info on whether it's a testnet or not
Check exchange deposit status
settleExchangeFees
opts.userId: The identifier of the user
Set exchange fees by admin
getExchangeTrades
opts.userId: The identifier of the user
opts.side: The order side (buy or side)
opts.limit: Amount of trades per page. Maximum: 50. Default: 50
opts.page: Page of trades data. Default: 1
opts.symbol: The symbol-pair to filter by, pass undefined to receive data on all currencies
opts.orderBy: The field to trade data by e.g. amount, id.
opts.order: Ascending (asc) or descending (desc).
opts.startDate: Start date of query in ISO8601 format.
opts.endDate: End date of query in ISO8601 format.
opts.format: Custom format of data set. Enum: ['all', 'csv']
Retrieve user's trades by admin
getExchangeOrders
opts.userId: The identifier of the user
opts.side: The order side (buy or side)
opts.status: The order's status e.g open, filled, canceled etc
opts.open: The info on whether the order is active or not
opts.side: The order side (buy or side)
opts.limit: Amount of orders per page. Maximum: 50. Default: 50
opts.page: Page of order data. Default: 1
opts.symbol: The symbol-pair to filter by, pass undefined to receive data on all currencies
opts.orderBy: The field to order data by e.g. amount, id.
opts.order: Ascending (asc) or descending (desc).
opts.startDate: Start date of query in ISO8601 format.
opts.endDate: End date of query in ISO8601 format.
Retrieve user's orders by admin
cancelExchangeUserOrder
userId: The identifier of the user
orderId: The identifier of the order
Cancel user's order by order id
getExchangeUsers
opts: Optional parameters
opts.userId: The identifier of the user to filter by
opts.search: The search text to filter by, pass undefined to receive data on all fields
opts.pending: The pending field to filter by, pass undefined to receive all data
opts.pendingType: Th pending type info to filter by, pass undefined to receive data
opts.limit: Amount of users per page. Maximum: 50. Default: 50
opts.page: Page of user data. Default: 1
opts.orderBy: The field to order data by e.g. amount, id.
opts.order: Ascending (asc) or descending (desc).
opts.startDate: Start date of query in ISO8601 format.
opts.endDate: End date of query in ISO8601 format.
opts.format: Custom format of data set. Enum: ['all', 'csv']
Retrieve list of the user info by admin
createExchangeUser
email: The mail address for the user</li
password: The password for the user
Create exchange user
updateExchangeUser
userId: The identifier of the user to filter by
opts.meta: The field to update user meta info
opts.overwrite: the field to set overwrite option along with meta object
opts.role: The field to update user role ('admin', 'supervisor', 'support', 'kyc', 'communicator', 'user')
opts.note: The field to update user note
opts.verification_level: The field to set user's verification level
Update exchange user
createExchangeUserWallet
userId: The identifier of the user
crypto: The coin for the wallet e.g btc, eth
opts.network: The network info
Create wallet for exchange user
getExchangeUserWallet
opts.userId: The identifier of the user to filter by
opts.limit: Amount of users per page. Maximum: 50. Default: 50
opts.currency: The currency to filter by
opts.page: Page of user data. Default: 1
opts.orderBy: The field to order data by e.g. amount, id.
opts.order: Ascending (asc) or descending (desc).
opts.startDate: Start date of query in ISO8601 format.
opts.endDate: End date of query in ISO8601 format.
opts.address: Address of crypto
opts.isValid: Specify whether or not wallet is valid
opts.network: Crypto network of currency
opts.format: Custom format of data set. Enum: ['all', 'csv']
Retrieve users' wallets by admin
getExchangeUserBalance
userId: The identifier of the user
Retrieve user's login info by admin
createExchangeUserBank
userId: The identifier of the user
bankAccount: Array of objects with bank account info
Create bank account for user by admin
getExchangeUserLogins
opts.userId: The identifier of the user
opts.limit: Amount of logins per page. Maximum: 50. Default: 50
opts.page: Page of referral data. Default: 1
opts.orderBy: The field to order data by e.g. amount, id.
opts.order: Ascending (asc) or descending (desc).
opts.startDate: Start date of query in ISO8601 format.
opts.endDate: End date of query in ISO8601 format.
Retrieve user's login info by admin
deactivateExchangeUser
userId: The identifier of the user to deactivate their exchange account
Deactivate exchange user account by admin
deactivateExchangeUserOtp
userId: The identifier of the user to deactivate their otp
Deactivate user otp by admin
getExchangeUserReferrals
userId: The identifier of the user to filter by
opts.limit: Amount of referrals per page. Maximum: 50. Default: 50
opts.page: Page of referral data. Default: 1
opts.orderBy: The field to order data by e.g. amount, id.
opts.order: Ascending (asc) or descending (desc).
opts.startDate: Start date of query in ISO8601 format.
opts.endDate: End date of query in ISO8601 format.
Retrieve user's referrals info by admin
getExchangeUserReferrer
userId: The identifier of the user to filter by
Retrieve user's referer info by admin
sendExchangeUserEmail
userId: The identifier of the user
mailType: The mail type for the email payload
data: The content of the mail
Send email to exchange user account by admin
sendRawEmail
receivers: The array of emails to send mail
html: The stringified html content
opts.title: The title of the mail
opts.text: The text of the mail
Send email to users with custom html by admin
getOraclePrice
assets: Assets to convert
opts.quote: Quote coin to convert to
opts.amount: Amount to convert
Retrieve price conversion
getExchangeUserBalances
opts.userId: The identifier of the user to filter by
opts.currency: The currency to filter by, pass undefined to receive data on all currencies
opts.format: Custom format of data set. Enum: ['all', 'csv']
Retrieve user's balances by admin
Websocket
Functions
You can connect and subscribe to different websocket channels for realtime updates.
To connect, use the connect function with the channels you want to subscribe to in an array as the parameter. The connection will reconnect on it's own unless you call disconnect.
client.connect(['orderbook','trade']);
To disconnect the websocket, call disconnect.
client.disconnect();
To subscribe to more channels after connection, use subscribe.
client.subscribe(['order','wallet']);
To unsubscribe from channels after connection, use unsubscribe.
client.unsubscribe(['orderbook']);
Channels
Here is the list of channels you can subscribe to:
orderbook (Available publicly)
trade (Available publicly)
order (Only available with authentication. Receive order updates)
usertrade (Only available with authentication. Receive user trades)
wallet (Only available with authentication. Receive balance updates)
deposit (Only available with authentication. Receive deposit notifications)
withdrawal (Only available with authentication. Receive withdrawal notifications)
admin (Only available with authentication for the exchange administrator. Receive exchange operations such as deposits and withdrawals of all users)
For public channels (orderbook, trade), you can subscribe to specific symbols as follows:
orderbook:xht-usdt, trade:xht-usdt. Not passing a symbol will subscribe to all symbols.
Events
After connecting to the websocket, you can listen for events coming from the server by using the on function for the ws property of the client.
The events available are default websocket events e.g. message, open, close, error, unexpected-response, etc.
You can run the example by going to example folder and running:
node example/hollaex.js
Documentation
For adding additional functionalities simply go to index.js and add more features.
You can read more about api documentation at https://apidocs.hollaex.com
You should create your token on the platform in setting->api keys