## hashkey{docsify-ignore} **Kind**: global class **Extends**: Exchange * [fetchTime](#fetchtime) * [fetchStatus](#fetchstatus) * [fetchMarkets](#fetchmarkets) * [fetchCurrencies](#fetchcurrencies) * [fetchOrderBook](#fetchorderbook) * [fetchTrades](#fetchtrades) * [fetchMyTrades](#fetchmytrades) * [fetchOHLCV](#fetchohlcv) * [fetchTicker](#fetchticker) * [fetchTickers](#fetchtickers) * [fetchLastPrices](#fetchlastprices) * [fetchBalance](#fetchbalance) * [fetchDepositAddress](#fetchdepositaddress) * [fetchDeposits](#fetchdeposits) * [fetchWithdrawals](#fetchwithdrawals) * [withdraw](#withdraw) * [transfer](#transfer) * [fetchAccounts](#fetchaccounts) * [fetchLedger](#fetchledger) * [createOrder](#createorder) * [createMarketBuyOrderWithCost](#createmarketbuyorderwithcost) * [createSpotOrder](#createspotorder) * [createSwapOrder](#createswaporder) * [createOrders](#createorders) * [cancelOrder](#cancelorder) * [cancelAllOrders](#cancelallorders) * [cancelOrders](#cancelorders) * [fetchOrder](#fetchorder) * [fetchOpenOrders](#fetchopenorders) * [fetchCanceledAndClosedOrders](#fetchcanceledandclosedorders) * [fetchFundingRate](#fetchfundingrate) * [fetchFundingRates](#fetchfundingrates) * [fetchFundingRateHistory](#fetchfundingratehistory) * [fetchPositions](#fetchpositions) * [fetchPositionsForSymbol](#fetchpositionsforsymbol) * [fetchLeverage](#fetchleverage) * [setLeverage](#setleverage) * [fetchLeverageTiers](#fetchleveragetiers) * [fetchTradingFee](#fetchtradingfee) * [fetchTradingFees](#fetchtradingfees) * [watchOHLCV](#watchohlcv) * [watchTrades](#watchtrades) * [watchOrderBook](#watchorderbook) * [watchOrders](#watchorders) * [watchMyTrades](#watchmytrades) * [watchPositions](#watchpositions) * [watchBalance](#watchbalance) ### fetchTime{docsify-ignore} fetches the current integer timestamp in milliseconds from the exchange server **Kind**: instance method of [hashkey](#hashkey) **Returns**: int - the current integer timestamp in milliseconds from the exchange server **See**: https://hashkeyglobal-apidoc.readme.io/reference/check-server-time | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchTime ([params]) ``` ### fetchStatus{docsify-ignore} the latest known information on the availability of the exchange API **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [status structure](https://docs.ccxt.com/#/?id=exchange-status-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/test-connectivity | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchStatus ([params]) ``` ### fetchMarkets{docsify-ignore} retrieves data on all markets for the exchange **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - an array of objects representing market data **See**: https://hashkeyglobal-apidoc.readme.io/reference/exchangeinfo | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.symbol | string | No | the id of the market to fetch | ```javascript hashkey.fetchMarkets ([params]) ``` ### fetchCurrencies{docsify-ignore} fetches all available currencies on an exchange **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - an associative dictionary of currencies **See**: https://hashkeyglobal-apidoc.readme.io/reference/exchangeinfo | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchCurrencies ([params]) ``` ### fetchOrderBook{docsify-ignore} fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-order-book | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the order book for | | limit | int | No | the maximum amount of order book entries to return (maximum value is 200) | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchOrderBook (symbol[, limit, params]) ``` ### fetchTrades{docsify-ignore} get the list of most recent trades for a particular symbol **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<Trade> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-recent-trade-list | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch trades for | | since | int | No | timestamp in ms of the earliest trade to fetch | | limit | int | No | the maximum amount of trades to fetch (maximum value is 100) | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchTrades (symbol[, since, limit, params]) ``` ### fetchMyTrades{docsify-ignore} fetch all trades made by the user **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<Trade> - a list of [trade structures](https://github.com/ccxt/ccxt/wiki/Manual#trade-structure) **See** - https://hashkeyglobal-apidoc.readme.io/reference/get-account-trade-list - https://hashkeyglobal-apidoc.readme.io/reference/query-futures-trades - https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-user | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | *is mandatory for swap markets* unified market symbol | | since | int | No | the earliest time in ms to fetch trades for | | limit | int | No | the maximum amount of trades to fetch (default 200, max 500) | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | string | No | 'spot' or 'swap' - the type of the market to fetch trades for (default 'spot') | | params.until | int | No | the latest time in ms to fetch trades for, only supports the last 30 days timeframe | | params.fromId | string | No | srarting trade id | | params.toId | string | No | ending trade id | | params.clientOrderId | string | No | *spot markets only* filter trades by orderId | | params.accountId | string | No | account id to fetch the orders from | ```javascript hashkey.fetchMyTrades (symbol[, since, limit, params]) ``` ### fetchOHLCV{docsify-ignore} fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-kline | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch OHLCV data for | | timeframe | string | Yes | the length of time each candle represents | | since | int | No | timestamp in ms of the earliest candle to fetch | | limit | int | No | the maximum amount of candles to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | timestamp in ms of the latest candle to fetch | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript hashkey.fetchOHLCV (symbol, timeframe[, since, limit, params]) ``` ### fetchTicker{docsify-ignore} fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-24hr-ticker-price-change | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the ticker for | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchTicker (symbol[, params]) ``` ### fetchTickers{docsify-ignore} fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-24hr-ticker-price-change | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchTickers ([symbols, params]) ``` ### fetchLastPrices{docsify-ignore} fetches the last price for multiple markets **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a dictionary of lastprices structures **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-symbol-price-ticker | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | No | unified symbols of the markets to fetch the last prices | | params | object | No | extra parameters specific to the exchange API endpoint | | params.symbol | string | No | the id of the market to fetch last price for | ```javascript hashkey.fetchLastPrices ([symbols, params]) ``` ### fetchBalance{docsify-ignore} query for balance and get the amount of funds available for trading or funds locked in orders **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-account-information | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.accountId | string | No | account ID, for Master Key only | | params.type | string | No | 'spot' or 'swap' - the type of the market to fetch balance for (default 'spot') | ```javascript hashkey.fetchBalance ([params]) ``` ### fetchDepositAddress{docsify-ignore} fetch the deposit address for a currency associated with this account **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - an [address structure](https://docs.ccxt.com/#/?id=address-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-deposit-address | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code (default is 'USDT') | | params | object | No | extra parameters specific to the exchange API endpoint | | params.network | string | No | network for fetch deposit address (default is 'ETH') | ```javascript hashkey.fetchDepositAddress (code[, params]) ``` ### fetchDeposits{docsify-ignore} fetch all deposits made to an account **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [transfer structures](https://docs.ccxt.com/#/?id=transfer-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-deposit-history | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code of the currency transferred | | since | int | No | the earliest time in ms to fetch transfers for (default 24 hours ago) | | limit | int | No | the maximum number of transfer structures to retrieve (default 50, max 200) | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | the latest time in ms to fetch transfers for (default time now) | | params.fromId | int | No | starting ID (To be released) | ```javascript hashkey.fetchDeposits (code[, since, limit, params]) ``` ### fetchWithdrawals{docsify-ignore} fetch all withdrawals made from an account **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/withdrawal-records | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code of the currency transferred | | since | int | No | the earliest time in ms to fetch transfers for (default 24 hours ago) | | limit | int | No | the maximum number of transfer structures to retrieve (default 50, max 200) | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | the latest time in ms to fetch transfers for (default time now) | ```javascript hashkey.fetchWithdrawals (code[, since, limit, params]) ``` ### withdraw{docsify-ignore} make a withdrawal **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/withdraw | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | amount | float | Yes | the amount to withdraw | | address | string | Yes | the address to withdraw to | | tag | string | Yes | | | params | object | No | extra parameters specific to the exchange API endpoint | | params.network | string | No | network for withdraw | | params.clientOrderId | string | No | client order id | | params.platform | string | No | the platform to withdraw to (hashkey, HashKey HK) | ```javascript hashkey.withdraw (code, amount, address, tag[, params]) ``` ### transfer{docsify-ignore} transfer currency internally between wallets on the same account **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [transfer structure](https://docs.ccxt.com/#/?id=transfer-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/new-account-transfer | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | amount | float | Yes | amount to transfer | | fromAccount | string | Yes | account id to transfer from | | toAccount | string | Yes | account id to transfer to | | params | object | No | extra parameters specific to the exchange API endpoint | | params.clientOrderId | string | No | a unique id for the transfer | | params.remark | string | No | a note for the transfer | ```javascript hashkey.transfer (code, amount, fromAccount, toAccount[, params]) ``` ### fetchAccounts{docsify-ignore} fetch all the accounts associated with a profile **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a dictionary of [account structures](https://docs.ccxt.com/#/?id=account-structure) indexed by the account type **See**: https://hashkeyglobal-apidoc.readme.io/reference/query-sub-account | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchAccounts ([params]) ``` ### fetchLedger{docsify-ignore} fetch the history of changes, actions done by the user or operations that altered the balance of the user **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [ledger structure](https://docs.ccxt.com/#/?id=ledger) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-account-transaction-list | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | No | unified currency code, default is undefined (not used) | | since | int | No | timestamp in ms of the earliest ledger entry, default is undefined | | limit | int | No | max number of ledger entries to return, default is undefined | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | the latest time in ms to fetch entries for | | params.flowType | int | No | trade, fee, transfer, deposit, withdrawal | | params.accountType | int | No | spot, swap, custody | ```javascript hashkey.fetchLedger ([code, since, limit, params]) ``` ### createOrder{docsify-ignore} create a trade order **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://hashkeyglobal-apidoc.readme.io/reference/test-new-order - https://hashkeyglobal-apidoc.readme.io/reference/create-order - https://hashkeyglobal-apidoc.readme.io/reference/create-new-futures-order | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to create an order in | | type | string | Yes | 'market' or 'limit' or 'LIMIT_MAKER' for spot, 'market' or 'limit' or 'STOP' for swap | | side | string | Yes | 'buy' or 'sell' | | amount | float | Yes | how much of you want to trade in units of the base currency | | price | float | No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders | | params | object | No | extra parameters specific to the exchange API endpoint | | params.cost | float | No | *spot market buy only* the quote quantity that can be used as an alternative for the amount | | params.test | boolean | No | *spot markets only* whether to use the test endpoint or not, default is false | | params.postOnly | bool | No | if true, the order will only be posted to the order book and not executed immediately | | params.timeInForce | string | No | "GTC" or "IOC" or "PO" for spot, 'GTC' or 'FOK' or 'IOC' or 'LIMIT_MAKER' or 'PO' for swap | | params.clientOrderId | string | No | a unique id for the order - is mandatory for swap | | params.triggerPrice | float | No | *swap markets only* The price at which a trigger order is triggered at | ```javascript hashkey.createOrder (symbol, type, side, amount[, price, params]) ``` ### createMarketBuyOrderWithCost{docsify-ignore} create a market buy order by providing the symbol and cost **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to create an order in | | cost | float | Yes | how much you want to trade in units of the quote currency | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.createMarketBuyOrderWithCost (symbol, cost[, params]) ``` ### createSpotOrder{docsify-ignore} create a trade order on spot market **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://hashkeyglobal-apidoc.readme.io/reference/test-new-order - https://hashkeyglobal-apidoc.readme.io/reference/create-order | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to create an order in | | type | string | Yes | 'market' or 'limit' or 'LIMIT_MAKER' | | side | string | Yes | 'buy' or 'sell' | | amount | float | Yes | how much of you want to trade in units of the base currency | | price | float | No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders | | params | object | No | extra parameters specific to the exchange API endpoint | | params.cost | float | No | *market buy only* the quote quantity that can be used as an alternative for the amount | | params.test | bool | No | whether to use the test endpoint or not, default is false | | params.postOnly | bool | No | if true, the order will only be posted to the order book and not executed immediately | | params.timeInForce | string | No | 'GTC', 'IOC', or 'PO' | | params.clientOrderId | string | No | a unique id for the order | ```javascript hashkey.createSpotOrder (symbol, type, side, amount[, price, params]) ``` ### createSwapOrder{docsify-ignore} create a trade order on swap market **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/create-new-futures-order | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to create an order in | | type | string | Yes | 'market' or 'limit' or 'STOP' | | side | string | Yes | 'buy' or 'sell' | | amount | float | Yes | how much of you want to trade in units of the base currency | | price | float | No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders | | params | object | No | extra parameters specific to the exchange API endpoint | | params.postOnly | bool | No | if true, the order will only be posted to the order book and not executed immediately | | params.reduceOnly | bool | No | true or false whether the order is reduce only | | params.triggerPrice | float | No | The price at which a trigger order is triggered at | | params.timeInForce | string | No | 'GTC', 'FOK', 'IOC', 'LIMIT_MAKER' or 'PO' | | params.clientOrderId | string | No | a unique id for the order | ```javascript hashkey.createSwapOrder (symbol, type, side, amount[, price, params]) ``` ### createOrders{docsify-ignore} create a list of trade orders (all orders should be of the same symbol) **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://hashkeyglobal-apidoc.readme.io/reference/create-multiple-orders - https://hashkeyglobal-apidoc.readme.io/reference/batch-create-new-futures-order | Param | Type | Required | Description | | --- | --- | --- | --- | | orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params | | params | object | No | extra parameters specific to the api endpoint | ```javascript hashkey.createOrders (orders[, params]) ``` ### cancelOrder{docsify-ignore} cancels an open order **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - An [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://hashkeyglobal-apidoc.readme.io/reference/cancel-order - https://hashkeyglobal-apidoc.readme.io/reference/cancel-futures-order | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | order id | | symbol | string | Yes | unified symbol of the market the order was made in | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | string | No | 'spot' or 'swap' - the type of the market to fetch entry for (default 'spot') | | params.clientOrderId | string | No | a unique id for the order that can be used as an alternative for the id | | params.trigger | bool | No | *swap markets only* true for canceling a trigger order (default false) | | params.stop | bool | No | *swap markets only* an alternative for trigger param | ```javascript hashkey.cancelOrder (id, symbol[, params]) ``` ### cancelAllOrders{docsify-ignore} cancel all open orders **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - response from exchange **See** - https://hashkeyglobal-apidoc.readme.io/reference/cancel-all-open-orders - https://hashkeyglobal-apidoc.readme.io/reference/batch-cancel-futures-order | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined | | params | object | No | extra parameters specific to the exchange API endpoint | | params.side | string | No | 'buy' or 'sell' | ```javascript hashkey.cancelAllOrders (symbol[, params]) ``` ### cancelOrders{docsify-ignore} cancel multiple orders **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - an list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://hashkeyglobal-apidoc.readme.io/reference/cancel-multiple-orders - https://hashkeyglobal-apidoc.readme.io/reference/batch-cancel-futures-order-by-order-id | Param | Type | Required | Description | | --- | --- | --- | --- | | ids | Array<string> | Yes | order ids | | symbol | string | No | unified market symbol (not used by hashkey) | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | string | No | 'spot' or 'swap' - the type of the market to fetch entry for (default 'spot') | ```javascript hashkey.cancelOrders (ids[, symbol, params]) ``` ### fetchOrder{docsify-ignore} fetches information on an order made by the user **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - An [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://hashkeyglobal-apidoc.readme.io/reference/query-order - https://hashkeyglobal-apidoc.readme.io/reference/get-futures-order | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | the order id | | symbol | string | Yes | unified symbol of the market the order was made in | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | string | No | 'spot' or 'swap' - the type of the market to fetch entry for (default 'spot') | | params.clientOrderId | string | No | a unique id for the order that can be used as an alternative for the id | | params.accountId | string | No | *spot markets only* account id to fetch the order from | | params.trigger | bool | No | *swap markets only* true for fetching a trigger order (default false) | | params.stop | bool | No | *swap markets only* an alternative for trigger param | ```javascript hashkey.fetchOrder (id, symbol[, params]) ``` ### fetchOpenOrders{docsify-ignore} fetch all unfilled currently open orders **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://hashkeyglobal-apidoc.readme.io/reference/get-current-open-orders - https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-open-orders - https://hashkeyglobal-apidoc.readme.io/reference/sub - https://hashkeyglobal-apidoc.readme.io/reference/query-open-futures-orders | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | No | unified market symbol of the market orders were made in - is mandatory for swap markets | | since | int | No | the earliest time in ms to fetch orders for | | limit | int | No | the maximum number of order structures to retrieve - default 500, maximum 1000 | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | string | No | 'spot' or 'swap' - the type of the market to fetch entries for (default 'spot') | | params.orderId | string | No | *spot markets only* the id of the order to fetch | | params.side | string | No | *spot markets only* 'buy' or 'sell' - the side of the orders to fetch | | params.fromOrderId | string | No | *swap markets only* the id of the order to start from | | params.trigger | bool | No | *swap markets only* true for fetching trigger orders (default false) | | params.stop | bool | No | *swap markets only* an alternative for trigger param | | params.accountId | string | No | account id to fetch the orders from | ```javascript hashkey.fetchOpenOrders ([symbol, since, limit, params]) ``` ### fetchCanceledAndClosedOrders{docsify-ignore} fetches information on multiple canceled and closed orders made by the user **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://hashkeyglobal-apidoc.readme.io/reference/get-all-orders - https://hashkeyglobal-apidoc.readme.io/reference/query-futures-history-orders - https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-history-orders | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | *is mandatory for swap markets* unified market symbol of the market orders were made in | | since | int | No | the earliest time in ms to fetch orders for | | limit | int | No | the maximum number of order structures to retrieve - default 500, maximum 1000 | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | the latest time in ms to fetch entries for - only supports the last 90 days timeframe | | params.type | string | No | 'spot' or 'swap' - the type of the market to fetch entries for (default 'spot') | | params.orderId | string | No | *spot markets only* the id of the order to fetch | | params.side | string | No | *spot markets only* 'buy' or 'sell' - the side of the orders to fetch | | params.fromOrderId | string | No | *swap markets only* the id of the order to start from | | params.trigger | bool | No | *swap markets only* the id of the order to start from true for fetching trigger orders (default false) | | params.stop | bool | No | *swap markets only* the id of the order to start from an alternative for trigger param | | params.accountId | string | No | account id to fetch the orders from | ```javascript hashkey.fetchCanceledAndClosedOrders (symbol[, since, limit, params]) ``` ### fetchFundingRate{docsify-ignore} fetch the current funding rate **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [funding rate structure](https://docs.ccxt.com/#/?id=funding-rate-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-futures-funding-rate | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchFundingRate (symbol[, params]) ``` ### fetchFundingRates{docsify-ignore} fetch the funding rate for multiple markets **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [funding rate structures](https://docs.ccxt.com/#/?id=funding-rates-structure), indexed by market symbols **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-futures-funding-rate | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string>, undefined | Yes | list of unified market symbols | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchFundingRates (symbols[, params]) ``` ### fetchFundingRateHistory{docsify-ignore} fetches historical funding rate prices **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [funding rate structures](https://docs.ccxt.com/#/?id=funding-rate-history-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-futures-history-funding-rate | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the funding rate history for | | since | int | No | timestamp in ms of the earliest funding rate to fetch | | limit | int | No | the maximum amount of [funding rate structures](https://docs.ccxt.com/#/?id=funding-rate-history-structure) to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | | params.fromId | int | No | the id of the entry to start from | | params.endId | int | No | the id of the entry to end with | ```javascript hashkey.fetchFundingRateHistory (symbol[, since, limit, params]) ``` ### fetchPositions{docsify-ignore} fetch all open positions **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [position structure](https://docs.ccxt.com/#/?id=position-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-futures-positions | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string>, undefined | Yes | list of unified market symbols | | params | object | No | extra parameters specific to the exchange API endpoint | | params.side | string | No | 'LONG' or 'SHORT' - the direction of the position (if not provided, positions for both sides will be returned) | ```javascript hashkey.fetchPositions (symbols[, params]) ``` ### fetchPositionsForSymbol{docsify-ignore} fetch all open positions for specific symbol **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [position structure](https://docs.ccxt.com/#/?id=position-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/get-futures-positions | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | | params.side | string | No | 'LONG' or 'SHORT' - the direction of the position (if not provided, positions for both sides will be returned) | ```javascript hashkey.fetchPositionsForSymbol (symbol[, params]) ``` ### fetchLeverage{docsify-ignore} fetch the set leverage for a market **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [leverage structure](https://docs.ccxt.com/#/?id=leverage-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/query-futures-leverage-trade | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchLeverage (symbol[, params]) ``` ### setLeverage{docsify-ignore} set the level of leverage for a market **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - response from the exchange **See**: https://hashkeyglobal-apidoc.readme.io/reference/change-futures-leverage-trade | Param | Type | Required | Description | | --- | --- | --- | --- | | leverage | float | Yes | the rate of leverage | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.setLeverage (leverage, symbol[, params]) ``` ### fetchLeverageTiers{docsify-ignore} retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a dictionary of [leverage tiers structures](https://docs.ccxt.com/#/?id=leverage-tiers-structure), indexed by market symbols **See**: https://hashkeyglobal-apidoc.readme.io/reference/exchangeinfo | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string>, undefined | Yes | list of unified market symbols | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchLeverageTiers (symbols[, params]) ``` ### fetchTradingFee{docsify-ignore} fetch the trading fees for a market **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [fee structure](https://docs.ccxt.com/#/?id=fee-structure) **See** - https://developers.binance.com/docs/wallet/asset/trade-fee // spot - https://hashkeyglobal-apidoc.readme.io/reference/get-futures-commission-rate-request-weight // swap | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchTradingFee (symbol[, params]) ``` ### fetchTradingFees{docsify-ignore} *for spot markets only* fetch the trading fees for multiple markets **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a dictionary of [fee structures](https://docs.ccxt.com/#/?id=fee-structure) indexed by market symbols **See**: https://developers.binance.com/docs/wallet/asset/trade-fee | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.fetchTradingFees ([params]) ``` ### watchOHLCV{docsify-ignore} watches historical candlestick data containing the open, high, low, and close price, and the volume of a market **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume **See**: https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#public-stream | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch OHLCV data for | | timeframe | string | Yes | the length of time each candle represents | | since | int | No | timestamp in ms of the earliest candle to fetch | | limit | int | No | the maximum amount of candles to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | | params.binary | bool | No | true or false - default false | ```javascript hashkey.watchOHLCV (symbol, timeframe[, since, limit, params]) ``` ### watchTrades{docsify-ignore} watches information on multiple trades made in a market **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#public-stream | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the market trades were made in | | since | int | No | the earliest time in ms to fetch orders for | | limit | int | No | the maximum number of trade structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | | params.binary | bool | No | true or false - default false | ```javascript hashkey.watchTrades (symbol[, since, limit, params]) ``` ### watchOrderBook{docsify-ignore} watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See**: https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#public-stream | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the order book for | | limit | int | No | the maximum amount of order book entries to return. | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.watchOrderBook (symbol[, limit, params]) ``` ### watchOrders{docsify-ignore} watches information on multiple orders made by the user **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#private-stream | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the market orders were made in | | since | int | No | the earliest time in ms to fetch orders for | | limit | int | No | the maximum number of order structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.watchOrders (symbol[, since, limit, params]) ``` ### watchMyTrades{docsify-ignore} watches information on multiple trades made by the user **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#private-stream | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the market trades were made in | | since | int | No | the earliest time in ms to fetch trades for | | limit | int | No | the maximum number of trade structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript hashkey.watchMyTrades (symbol[, since, limit, params]) ``` ### watchPositions{docsify-ignore} watch all open positions **Kind**: instance method of [hashkey](#hashkey) **Returns**: Array<object> - a list of [position structure](https://docs.ccxt.com/en/latest/manual.html#position-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#private-stream | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | No | list of unified market symbols to watch positions for | | since | int | No | the earliest time in ms to fetch positions for | | limit | int | No | the maximum number of positions to retrieve | | params | object | Yes | extra parameters specific to the exchange API endpoint | ```javascript hashkey.watchPositions ([symbols, since, limit, params]) ``` ### watchBalance{docsify-ignore} watch balance and get the amount of funds available for trading or funds locked in orders **Kind**: instance method of [hashkey](#hashkey) **Returns**: object - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure) **See**: https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#private-stream | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | string | No | 'spot' or 'swap' - the type of the market to watch balance for (default 'spot') | ```javascript hashkey.watchBalance ([params]) ```