@orderly.network/hooks 0.0.16 → 0.0.17
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.js +1 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1352,29 +1352,6 @@ var useOrderEntry = (symbol, side, reduceOnly = false, options) => {
|
|
|
1352
1352
|
symbolConfig: symbolInfo[symbol]()
|
|
1353
1353
|
};
|
|
1354
1354
|
};
|
|
1355
|
-
var WS_NAME2 = "websocketClient";
|
|
1356
|
-
var useWebSocketClient = () => {
|
|
1357
|
-
const ws = useConstant__default.default(() => {
|
|
1358
|
-
let websocketClient = core.SimpleDI.get(WS_NAME2);
|
|
1359
|
-
if (!websocketClient) {
|
|
1360
|
-
websocketClient = new net.WebSocketClient({
|
|
1361
|
-
accountId: "OqdphuyCtYWxwzhxyLLjOWNdFP7sQt8RPWzmb5xY",
|
|
1362
|
-
networkId: "testnet",
|
|
1363
|
-
onSigntureRequest: (accountId) => __async(void 0, null, function* () {
|
|
1364
|
-
const signer = core.getMockSigner();
|
|
1365
|
-
const timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
1366
|
-
const result = yield signer.signText(timestamp.toString());
|
|
1367
|
-
return __spreadProps(__spreadValues({}, result), { timestamp });
|
|
1368
|
-
})
|
|
1369
|
-
});
|
|
1370
|
-
core.SimpleDI.registerByName(WS_NAME2, websocketClient);
|
|
1371
|
-
}
|
|
1372
|
-
return websocketClient;
|
|
1373
|
-
});
|
|
1374
|
-
return ws;
|
|
1375
|
-
};
|
|
1376
|
-
|
|
1377
|
-
// src/orderly/useFetures.ts
|
|
1378
1355
|
var useFetures = () => {
|
|
1379
1356
|
const { data, isLoading, error } = useQuery(
|
|
1380
1357
|
`/v1/public/futures`,
|
|
@@ -1383,14 +1360,8 @@ var useFetures = () => {
|
|
|
1383
1360
|
}
|
|
1384
1361
|
);
|
|
1385
1362
|
const [sortedData, setSortedData] = React.useState(data);
|
|
1386
|
-
|
|
1363
|
+
useWS();
|
|
1387
1364
|
React.useEffect(() => {
|
|
1388
|
-
const sub = ws.observe(`tickers`).subscribe((value) => {
|
|
1389
|
-
console.log("useTickers", value);
|
|
1390
|
-
});
|
|
1391
|
-
return () => {
|
|
1392
|
-
sub.unsubscribe();
|
|
1393
|
-
};
|
|
1394
1365
|
}, []);
|
|
1395
1366
|
React.useEffect(() => {
|
|
1396
1367
|
if (data) {
|