Here is a resolution of a solution to obtaining recent trade orders through Binax Achieve from Binax Aura, Webasocket Canal:
Obtaining Recent Trade Orders through Webasocat Canal on Webasocat EP ** node.js
In this article we will send them recent commercial orders using the Biniac API and send them as a websocket stream in Node.js.
Prerequisites
- You have a bancal account and have the authority to use API.
- You have installed the
Node-drunk-awe's package:
npm node-binnnes-api
Design
- Create a new file in your project catalog, eg,banned-merchant-orders. JSS
.
- 'Node-drunk-apipi
Package and create an example of the' API 'class.
Javascript
COM Binnas = need ('nodod-binnance-api') is required;
COMPI = New Bannine ({
// your API credentials
Clients: 'Your Server ID',
Server Secretary: 'Your Server Secret',
Server: 'Your_serside',
});
// Set Websocat options
Comp W Toxtion = {
Server: 'WS: //ws.binance.com/1/api/ws',
Friendly: True,
};
// make a websocot object
Col ws = api.ws (WStoptions);
// define a function to handle incoming orders
ASYNC function trad () {
Try {
// Send a Bay Command to obtain recent trades
Jack's response = WS.get ('Papiders', {Limit: 10, Expiry: 1000});
// set up the available data and store it in a array
RODMEDERMERS = RESTICE.data;
Console.log (descerders);
} Catch (error) {
Console. Error (error);
}
}
// Call trading performance to obtain recent trades
Merchants ();
How it works
- Let’s create your API credentials and server ID, and let us create a new chance of api class.
- Bancing API URL and WebSocket options (eg.
- A professional providing a paramarket (), we will define a function.
- In the function, we use the method of
WS.get (d) to send and obtain response.
- Preparing the data we received, storage and store it on, visit the console.
Note: : This execution is used for obtaining 10 trades at a time. You can change this value based on your performance requirements.
By following these measures, you should be able to obtain recent trade orders through webasocot on the WebSocket on WebSock on the WebSockope on Webasocket using the API Drink.
Leave a Reply