You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+66-10Lines changed: 66 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,6 @@ color=blueviolet 🔵q
17
17
18
18
19
19
20
-
21
-
22
-
23
20
# Node Binance API
24
21
25
22
[](https://t.me/nodebinanceapi)[](https://www.npmjs.com/package/node-binance-api)[](https://x.com/jaggedsoft)
@@ -44,7 +41,7 @@ This project is designed to help you make your own projects that interact with t
**This project is powered by** <ahref="https://github.com/ccxt/ccxt"><imgsrc="https://avatars.githubusercontent.com/u/31901609"width=4%height=4%></a>
58
55
56
+
Actively maintained, typed, and safe SDK for the Binance REST APIs and Websockets. Supports ESM and CJS out of the box.
57
+
58
+
### Features
59
+
- Spot, Margin, Futures and Delivery API
60
+
- Portfolio Margin API *\*soon*\*
61
+
- Testnet support
62
+
- Proxy support (REST and WS)
63
+
- Customizable HTTP headers
64
+
- Customizable request parameters
65
+
- RSA/ECDSA support *\*soon*\*
66
+
- Websocket handling with automatic reconnection
67
+
- RecvWindow and automatic timestamps generation
68
+
- Ability to call any endpoint, even if not supported directly by the library
69
+
- Overridable hostnames (.us, .jp, etc)
70
+
- Verbose mode to debug http requests/responses
71
+
72
+
### Upgrading to v1.0.0+
73
+
74
+
The library was fully refactored to use modern and typed JavaScript/Typescript version, using the built-in await/async syntax and unifying some methods' signatures. Some important changes include the removal of callbacks as parameters of REST methods, adaptation of signatures to directly receive some important request values (symbol, orderId, ...), etc.
75
+
76
+
**We highly advise you to update from 0.0.X but minor adjustments might be needed.**
77
+
59
78
60
79
#### Getting started (ESM)
61
80
```javascript
@@ -70,7 +89,7 @@ async function run() {
70
89
#### Getting started (CJS)
71
90
```javascript
72
91
constBinance=require('node-binance-api');
73
-
constbinance=newBinance().options({
92
+
constbinance=newBinance({
74
93
APIKEY:'<key>',
75
94
APISECRET:'<secret>',
76
95
test:true, // if you want to use the sandbox/testnet
// Batch orders, remaining WebSocket streams, and better documentation will be come later
212
233
```
213
234
235
+
### Proxy support
236
+
237
+
In some specific cases using a proxy is required, for example:
238
+
- Exchange is not available in your location
239
+
- You need to make a large amount of requests without getting blocked
240
+
- ...
241
+
242
+
This package supports the following proxy types, `httpsProxy`, `proxyUrl` and `socksProxy`
243
+
244
+
#### httpsProxy
245
+
246
+
To set a real http(s) proxy for your scripts, you need to have an access to a remote http or https proxy, so calls will be made directly to the target exchange, tunneled through your proxy server:
247
+
248
+
```Js
249
+
client.httpsProxy='http://1.2.3.4:8080/';
250
+
```
251
+
252
+
#### proxyUrl
253
+
254
+
This property prepends an url to API requests. It might be useful for simple redirection or bypassing CORS browser restriction.
255
+
256
+
```Js
257
+
client.proxyUrl='YOUR_PROXY_URL';
258
+
```
259
+
260
+
#### socksProxy
261
+
262
+
Tou can also use socks proxy with the following format:
0 commit comments