bybit-api 4.7.1 → 4.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Node.js & JavaScript SDK for Bybit REST API, WebSocket API & WebSocket Events
|
|
2
2
|
|
|
3
|
-
[](https://github.com/sieblyio/bybit-api/actions/workflows/e2etest.yml)
|
|
4
4
|
[][1]
|
|
5
5
|
[][1]
|
|
6
6
|
[][1]
|
|
7
|
-
[][1]
|
|
8
|
+
[](https://www.codefactor.io/repository/github/sieblyio/bybit-api)
|
|
9
9
|
[](https://t.me/nodetraders)
|
|
10
|
-
[](https://deepwiki.com/
|
|
10
|
+
[](https://deepwiki.com/sieblyio/bybit-api)
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
13
|
<a href="https://www.npmjs.com/package/bybit-api">
|
|
14
14
|
<picture>
|
|
15
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/
|
|
16
|
-
<img alt="SDK Logo" src="https://github.com/
|
|
15
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/sieblyio/bybit-api/blob/master/docs/images/logoDarkMode2.svg?raw=true#gh-dark-mode-only">
|
|
16
|
+
<img alt="SDK Logo" src="https://github.com/sieblyio/bybit-api/blob/master/docs/images/logoBrightMode2.svg?raw=true#gh-light-mode-only">
|
|
17
17
|
</picture>
|
|
18
18
|
</a>
|
|
19
19
|
</p>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
[1]: https://www.npmjs.com/package/bybit-api
|
|
22
22
|
|
|
23
23
|
> [!TIP]
|
|
24
|
-
> Upcoming change: As part of the [Siebly.io](https://siebly.io/) brand, this SDK
|
|
24
|
+
> Upcoming change: As part of the [Siebly.io](https://siebly.io/) brand, this SDK is now hosted under our [Siebly.io GitHub organisation](https://github.com/sieblyio). The migration is seamless and requires no user changes.
|
|
25
25
|
|
|
26
26
|
Professional Node.js, JavaScript & TypeScript SDK for the Bybit REST APIs, WebSocket APIs & WebSocket Events:
|
|
27
27
|
|
|
@@ -32,7 +32,7 @@ Professional Node.js, JavaScript & TypeScript SDK for the Bybit REST APIs, WebSo
|
|
|
32
32
|
- All qualified API requests made with this SDK are automatically subject to significantly higher rate limits.
|
|
33
33
|
- Rate limits are raised to 400 requests per second, higher than the highest VIP tier.
|
|
34
34
|
- No action required. This is automatic for any API calls made with this SDK, for any user.
|
|
35
|
-
- Read more in the announcement: [here](https://github.com/
|
|
35
|
+
- Read more in the announcement: [here](https://github.com/sieblyio/bybit-api/issues/458).
|
|
36
36
|
- Lower minimum order notional value with this SDK!\*
|
|
37
37
|
- Place orders with a notional value as low as $1.
|
|
38
38
|
- Lower than the default minimum notional order value $5.
|
|
@@ -113,7 +113,7 @@ Professional Node.js, JavaScript & TypeScript SDK for the Bybit REST APIs, WebSo
|
|
|
113
113
|
|
|
114
114
|
## Issues & Discussion
|
|
115
115
|
|
|
116
|
-
- Issues? Check the [issues tab](https://github.com/
|
|
116
|
+
- Issues? Check the [issues tab](https://github.com/sieblyio/bybit-api/issues).
|
|
117
117
|
- Discuss & collaborate with other node devs? Join our [Node.js Algo Traders](https://t.me/nodetraders) engineering community on telegram.
|
|
118
118
|
- Follow our announcement channel for real-time updates on [X/Twitter](https://x.com/sieblyio)
|
|
119
119
|
|
|
@@ -138,7 +138,7 @@ Check out our JavaScript/TypeScript/Node.js SDKs & Projects:
|
|
|
138
138
|
- [OrderBooks Node.js: orderbooks](https://www.npmjs.com/package/orderbooks)
|
|
139
139
|
- [Crypto Exchange Account State Cache: accountstate](https://www.npmjs.com/package/accountstate)
|
|
140
140
|
- Check out my examples:
|
|
141
|
-
- [awesome-crypto-examples Node.js](https://github.com/
|
|
141
|
+
- [awesome-crypto-examples Node.js](https://github.com/sieblyio/awesome-crypto-examples)
|
|
142
142
|
<!-- template_related_projects_end -->
|
|
143
143
|
|
|
144
144
|
## Documentation
|
|
@@ -165,7 +165,7 @@ The SDK is written in TypeScript, but fully compatible with both TypeScript and
|
|
|
165
165
|
Examples for using each client can be found in:
|
|
166
166
|
|
|
167
167
|
- the [examples](./examples) folder.
|
|
168
|
-
- the [awesome-crypto-examples](https://github.com/
|
|
168
|
+
- the [awesome-crypto-examples](https://github.com/sieblyio/awesome-crypto-examples) repository.
|
|
169
169
|
|
|
170
170
|
If you're missing an example, you're welcome to request one. Priority will be given to [github sponsors](https://github.com/sponsors/tiagosiebler).
|
|
171
171
|
|
|
@@ -224,7 +224,7 @@ const restClientOptions = {
|
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
226
|
* Enable keep alive for REST API requests (via axios).
|
|
227
|
-
* See: https://github.com/
|
|
227
|
+
* See: https://github.com/sieblyio/bybit-api/issues/368
|
|
228
228
|
*/
|
|
229
229
|
// keepAlive: true,
|
|
230
230
|
|
|
@@ -683,7 +683,7 @@ This file contains AI optimised structure of all the functions in this package,
|
|
|
683
683
|
|
|
684
684
|
## Used By
|
|
685
685
|
|
|
686
|
-
[](https://github.com/sieblyio/bybit-api/network/dependents)
|
|
687
687
|
|
|
688
688
|
---
|
|
689
689
|
|
|
@@ -723,6 +723,6 @@ Contributions are encouraged, I will review any incoming pull requests. See the
|
|
|
723
723
|
|
|
724
724
|
## Star History
|
|
725
725
|
|
|
726
|
-
[](https://star-history.com/#sieblyio/bybit-api&sieblyio/okx-api&sieblyio/binance&sieblyio/bitget-api&sieblyio/htx-api&sieblyio/gateio-api&sieblyio/kucoin-api&sieblyio/coinbase-api&sieblyio/orderbooks&sieblyio/accountstate&sieblyio/awesome-crypto-examples&Date)
|
|
727
727
|
|
|
728
728
|
<!-- template_star_history_end -->
|
|
@@ -68,16 +68,33 @@ const PRIVATE_TOPICS = [
|
|
|
68
68
|
'user.wallet.contractAccount',
|
|
69
69
|
// v5
|
|
70
70
|
'position',
|
|
71
|
+
'position.linear',
|
|
72
|
+
'position.inverse',
|
|
73
|
+
'position.option',
|
|
71
74
|
'execution',
|
|
72
|
-
'
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
+
'execution.spot',
|
|
76
|
+
'execution.linear',
|
|
77
|
+
'execution.inverse',
|
|
78
|
+
'execution.option',
|
|
75
79
|
// v5 fast execution topics are private
|
|
76
80
|
'execution.fast',
|
|
77
81
|
'execution.fast.linear',
|
|
78
82
|
'execution.fast.inverse',
|
|
79
83
|
'execution.fast.spot',
|
|
80
84
|
'execution.fast.option',
|
|
85
|
+
'order',
|
|
86
|
+
'order.spot',
|
|
87
|
+
'order.linear',
|
|
88
|
+
'order.inverse',
|
|
89
|
+
'order.option',
|
|
90
|
+
'wallet',
|
|
91
|
+
'greeks',
|
|
92
|
+
// v5 DCP topics
|
|
93
|
+
'dcp.future',
|
|
94
|
+
'dcp.spot',
|
|
95
|
+
'dcp.option',
|
|
96
|
+
// Strategy
|
|
97
|
+
'strategy',
|
|
81
98
|
];
|
|
82
99
|
exports.WS_BASE_URL_MAP = {
|
|
83
100
|
v5: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket-util.js","sourceRoot":"","sources":["../../../src/util/websockets/websocket-util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"websocket-util.js","sourceRoot":"","sources":["../../../src/util/websockets/websocket-util.ts"],"names":[],"mappings":";;;AA0NA,4CAEC;AAED,4CAyCC;AAED,4BAkDC;AAED,sEAgBC;AAcD,0CAgBC;AAMD,oEAKC;AAOD,gEAoBC;AASD,8CAgCC;AA/aD,8CAA2C;AAE9B,QAAA,UAAU,GAAG;IACxB,YAAY,EAAE,cAAc;IAC5B,cAAc,EAAE,gBAAgB;IAChC,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,SAAS,EAAE,WAAW;IACtB;;OAEG;IACH,cAAc,EAAE,gBAAgB;CACxB,CAAC;AAEE,QAAA,uBAAuB,GAAY;IAC9C,kBAAU,CAAC,SAAS;IACpB,kBAAU,CAAC,cAAc;CAC1B,CAAC;AAEW,QAAA,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,MAAiB,EACjB,uBAAyC,EACzC,KAAa,EACb,cAAwB;IAIxB,MAAM,cAAc,GAAmD,EAAE,CAAC;IAE1E,qFAAqF;IACrF,KAAK,MAAM,YAAY,IAAI,uBAAuB,EAAE,CAAC;QACnD,MAAM,YAAY,GAChB,KAAK;YACL,gBAAgB,CACd,MAAM,EACN,YAAY,CAAC,KAAK,EAClB,cAAc,EACd,YAAY,CAAC,QAAQ,CACtB,CAAC;QAEJ,IACE,CAAC,cAAc,CAAC,YAAY,CAAC;YAC7B,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,EAC5C,CAAC;YACD,cAAc,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QACpC,CAAC;QAED,cAAc,CAAC,YAAY,CAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bybit-api",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.3",
|
|
4
4
|
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"license": "MIT",
|
|
74
74
|
"repository": {
|
|
75
75
|
"type": "git",
|
|
76
|
-
"url": "https://github.com/
|
|
76
|
+
"url": "git+https://github.com/sieblyio/bybit-api.git"
|
|
77
77
|
},
|
|
78
78
|
"bugs": {
|
|
79
|
-
"url": "https://github.com/
|
|
79
|
+
"url": "https://github.com/bybit/bybit-api/issues"
|
|
80
80
|
},
|
|
81
|
-
"homepage": "https://
|
|
81
|
+
"homepage": "https://siebly.io/sdk/bybit/javascript/tutorial"
|
|
82
82
|
}
|