Initializes a new Binance API client.
The personal account API key.
The personal account API secret.
Interface to the "DELETE v3/order" Binance's API operation. Cancels a previously placed order.
The market on which the order was originally placed.
The wanted order ID.
The pre-cancel client given order ID (its description).
The post-cancel order ID (automatically generated if not passed).
The request validity maximum time frame (defaults to 5000 ms).
The just-canceled order data.
Interface to the "DELETE v1/userDataStream" Binance's API operation. Closes out a user data stream.
A string representing the stream's ID (returned by openUserStream).
Interface to the "GET v3/account" Binance's API operation. Get current account information.
The request validity maximum time frame (defaults to 5000 ms).
The current account information.
Interface to the "GET v1/klines" Binance's API operation. Get candlestick bars for the specified symbol, respecting all the other given constraints. Candlesticks are uniquely identified by their opening time.
The symbol for which we want to retrieve the candlesticks.
The interval which the requested candlesticks refer to.
The maximum number of candlesticks returned.
The time from which the candlesticks are returned.
The time until which the candlesticks are returned.
A candlesticks array respecting the given constraints.
Interface to the "GET v1/ticker/24hr" Binance's API operation. Get last 24 hours price change statistics.
The symbol for which we want to retrieve the last day ticker statistics.
The last 24-hour ticker statistics.
Interface to the "GET v1/ticker/allPrices" Binance's API operation. Get the latest price for all symbols.
A latest prices array for all the symbols.
Interface to the "GET v3/openOrders" Binance's API operation.
The symbol for which we want to retrieve the open orders (if any).
The request validity maximum time frame (defaults to 5000 ms).
An array representing all of the account's open orders.
Interface to the "GET v3/order" Binance's API operation. Gets a placed order detail given some constraints.
The market on which the order was originally placed.
The wanted order ID.
The wanted client given order ID (its description).
The request validity maximum time frame (defaults to 5000 ms).
The placed order detail respecting the given constraints.
Interface to the "GET v1/depth" Binance's API operation.
The symbol for which we want to retrieve the order book.
The maximum number of orders in the returned order book.
The order book respecting the given constraints.
Interface to the "GET v3/allOrders" Binance's API operation. Get all account orders (active, canceled, or filled).
The symbol for which we want to retrieve the orders.
The order ID from which we want to retrieve the orders (if set, the API will retrieve the orders with an ID greater or equal to the one specified, otherwise the most recent orders).
The maximum number of returned orders.
The request validity maximum time frame (defaults to 5000 ms).
An array representing all of the account's orders in every state.
Interface to the "GET v1/time" Binance's API operation.
The Binance's server time.
Interface to the "GET v1/ticker/allBookTickers" Binance's API operation. Get the best price/quantity in the order book for all symbols.
The best price/quantity in the order book for all symbols.
Interface to the "GET v3/myTrades" Binance's API operation. Get trades for a specific account and symbol.
The market on which the trades were originally executed.
The maximum number of returned trades.
The trade's ID to start fetching from. If not given, the API will retrieve the most recent trades first.
The request validity maximum time frame (defaults to 5000 ms).
The account's trade list respecting the given constraints.
Interface to the "PUT v1/userDataStream" Binance's API operation. Pings a user data stream in order to prevent a time out.
A string representing the stream's ID (returned by openUserStream).
Utility method that sets up and sends a request to the Binance's API, handling the authentication through the API key and API secret parameters possibly given when instantiating the client itself.
The HTTP method through which the specified API is accessed.
The API version at which the wanted resource can be accessed.
The Binance's API resource that we would like to access.
The authentication type required in order to access the specified resource.
The parameters which the accessed resource may use in order to give us the expected result.
Either the promise of the Binance's API JSON response, or the JSON response if using the await construct.
Initializes a web socket data stream that gives us information about Kline/candlestick updates. Stream keepalive is performed through keepAliveUserStream following the rules described here
The symbol of which we want to get the candlestick updates.
The interval to which the requested candlestick updates refer to.
A function to be called when a new update is received.
Timeout based on which the web socket connection is considered to be broken based on a heartbeat monitor.
A callback to be invoked when the web socket connection is detected as broken.
Initializes a web socket data stream that gives us information about a single symbol's order book updates. Stream keepalive is performed through keepAliveUserStream following the rules described here
The symbol of which we want to get the order book updates.
A function to be called when a new update is received.
Timeout based on which the web socket connection is considered to be broken based on a heartbeat monitor.
A callback to be invoked when the web socket connection is detected as broken.
Initializes a web socket data stream that gives us information about trade updates. Stream keepalive is performed through keepAliveUserStream following the rules described here
The symbol of which we want to get the trade updates.
A function to be called when a new update is received.
Timeout based on which the web socket connection is considered to be broken based on a heartbeat monitor.
A callback to be invoked when the web socket connection is detected as broken.
Initializes a web socket data stream that gives us information about the personal account updates. Stream keepalive is performed through keepAliveUserStream following the rules described here
The listen key returned when a user data stream gets initialized by openUserStream.
A function to be called when a new update is received.
Timeout based on which the web socket connection is considered to be broken based on a heartbeat monitor.
A callback to be invoked when the web socket connection is detected as broken.
Interface to the "POST v1/userDataStream" Binance's API operation. Initializes a new data stream.
A listen key to be passed as a parameter when starting a new data stream.
Interface to the "GET v1/ping" Binance's API operation.
Interface to the "POST v3/order" Binance's API operation. Places a new order respecting the given constraints.
The market on which the order is to be placed.
Whether the order is a buy or sell.
Whether the order is at limit or market.
Whether the time in force should be GTC or IOC.
The quantity of assets that is to be moved.
The price at which the order should be filled.
A unique ID associated with the order (automatically generated if not sent).
The price at which a stop order should be filled.
Only used with iceberg orders.
Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
The just-placed order data.
Utility method setting up the request in order to handle Binance's various authentication methods.
The HTTP method used to access the wanted resource (mainly used for error logging purposes).
The URL at which the wanted resource can be accessed.
The authentication method through which the wanted resource can be accessed through the specified URL.
Interface to the "POST v3/order/test" Binance's API operation. Places a new test order respecting the given constraints.
The market on which the order is to be placed.
Whether the order is a buy or sell.
Whether the order is at limit or market.
Whether the time in force should be GTC or IOC.
The quantity of assets that is to be moved.
The price at which the order should be filled.
A unique ID associated with the order. (automatically generated if not sent).
The price at which a stop order should be filled.
Only used with iceberg orders.
The request validity maximum time frame (defaults to 5000 ms).
Generated using TypeDoc
Represents a single Binance API client.