@orderly.network/hooks 1.1.4-alpha.4 → 1.1.4-alpha.6
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -28,9 +28,9 @@ var useSWRSubscription__default = /*#__PURE__*/_interopDefault(useSWRSubscriptio
|
|
|
28
28
|
// src/version.ts
|
|
29
29
|
if (typeof window !== "undefined") {
|
|
30
30
|
window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
|
|
31
|
-
window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "1.1.4-alpha.
|
|
31
|
+
window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "1.1.4-alpha.6";
|
|
32
32
|
}
|
|
33
|
-
var version_default = "1.1.4-alpha.
|
|
33
|
+
var version_default = "1.1.4-alpha.6";
|
|
34
34
|
var fetcher = (url, init = {}, queryOptions) => net.get(url, init, queryOptions?.formatter);
|
|
35
35
|
var OrderlyContext = React.createContext({
|
|
36
36
|
// configStore: new MemoryConfigStore(),
|
|
@@ -972,20 +972,24 @@ var reduceOrderbook = (depth, level, data) => {
|
|
|
972
972
|
let bids = reduceItems(depth, level, data.bids);
|
|
973
973
|
if (asks.length !== 0 && bids.length !== 0 && asks[0][0] <= bids[0][0]) {
|
|
974
974
|
if (asks.length === 1) {
|
|
975
|
-
const [price, qty, newQuantity] = asks[0];
|
|
975
|
+
const [price, qty, newQuantity, newAmount] = asks[0];
|
|
976
976
|
asks.shift();
|
|
977
|
-
asks.push([price + (depth === void 0 ? 0 : depth), qty, newQuantity]);
|
|
977
|
+
asks.push([price + (depth === void 0 ? 0 : depth), qty, newQuantity, newAmount]);
|
|
978
978
|
} else {
|
|
979
979
|
const [bidPrice] = bids[0];
|
|
980
980
|
while (asks.length > 0) {
|
|
981
|
-
const [askPrice, askQty, newQuantity] = asks[0];
|
|
981
|
+
const [askPrice, askQty, newQuantity, newAmount] = asks[0];
|
|
982
982
|
if (askPrice <= bidPrice) {
|
|
983
983
|
asks.shift();
|
|
984
984
|
for (let index = 0; index < asks.length; index++) {
|
|
985
985
|
if (index === 0) {
|
|
986
|
-
asks[index][1]
|
|
986
|
+
const quantity = asks[index][1] + askQty;
|
|
987
|
+
asks[index][1] = quantity;
|
|
988
|
+
asks[index][2] = quantity;
|
|
989
|
+
asks[index][3] += newAmount;
|
|
990
|
+
} else {
|
|
991
|
+
asks[index][3] += newAmount;
|
|
987
992
|
}
|
|
988
|
-
asks[index][2] += newQuantity;
|
|
989
993
|
}
|
|
990
994
|
} else {
|
|
991
995
|
break;
|