@xapy/orderbook 0.1.1 → 0.1.2
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/dist/exchanges/bingx/index.cjs +5 -8
- package/dist/exchanges/bingx/index.cjs.map +1 -1
- package/dist/exchanges/bingx/index.d.cts +3 -0
- package/dist/exchanges/bingx/index.d.ts +3 -0
- package/dist/exchanges/bingx/index.js +5 -8
- package/dist/exchanges/bingx/index.js.map +1 -1
- package/dist/index.cjs +5 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1056,10 +1056,6 @@ function toBingxSymbol(symbol) {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
return `${base}_${quote}`.toUpperCase();
|
|
1058
1058
|
}
|
|
1059
|
-
function toBingxTopic(symbol, market, depth = 0.1) {
|
|
1060
|
-
const prefix = market === "spot" ? "market-depth" : "swap-depth";
|
|
1061
|
-
return `${prefix}.${toBingxSymbol(symbol)}.${depth}`;
|
|
1062
|
-
}
|
|
1063
1059
|
function fromBingxSymbol(s) {
|
|
1064
1060
|
return s.toUpperCase().replace("_", "/");
|
|
1065
1061
|
}
|
|
@@ -1124,9 +1120,10 @@ var WS_SPOT3 = "wss://open-api-ws.bingx.com/market";
|
|
|
1124
1120
|
var WS_SWAP = "wss://open-api-swap.bingx.com/swap-market";
|
|
1125
1121
|
function streamBingxOrderbook(opts) {
|
|
1126
1122
|
const isSpot = opts.market === "spot";
|
|
1127
|
-
const
|
|
1128
|
-
const
|
|
1129
|
-
const
|
|
1123
|
+
const wsSymbol = opts.symbol.toUpperCase().replace("/", "-");
|
|
1124
|
+
const level = opts.depth ?? 20;
|
|
1125
|
+
const interval = opts.interval ?? "500ms";
|
|
1126
|
+
const dataType = `${wsSymbol}@depth${level}@${interval}`;
|
|
1130
1127
|
const merger = new BookMerger();
|
|
1131
1128
|
let ws = null;
|
|
1132
1129
|
const stream = new OrderbookStream(() => ws?.close());
|
|
@@ -1161,7 +1158,7 @@ function streamBingxOrderbook(opts) {
|
|
|
1161
1158
|
if (!r.ok) return;
|
|
1162
1159
|
const book = {
|
|
1163
1160
|
exchange: "bingx",
|
|
1164
|
-
symbol:
|
|
1161
|
+
symbol: opts.symbol,
|
|
1165
1162
|
market: opts.market,
|
|
1166
1163
|
bids: r.bids,
|
|
1167
1164
|
asks: r.asks,
|