@orderly.network/hooks 0.0.95 → 0.0.96
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 +140 -139
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createContext, useContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
|
2
2
|
import useSWR, { useSWRConfig } from 'swr';
|
|
3
3
|
export { SWRConfig, default as useSWR } from 'swr';
|
|
4
4
|
import { WS, get, mutate } from '@orderly.network/net';
|
|
@@ -7,6 +7,7 @@ import useConstant from 'use-constant';
|
|
|
7
7
|
export { default as useConstant } from 'use-constant';
|
|
8
8
|
import { SimpleDI, Account, EventEmitter, utils } from '@orderly.network/core';
|
|
9
9
|
import { AccountStatusEnum, OrderStatus, OrderSide, chainsInfoMap, ARBITRUM_TESTNET_CHAINID, ARBITRUM_MAINNET_CHAINID, WS_WalletStatusEnum, OrderType } from '@orderly.network/types';
|
|
10
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
11
|
import { Decimal, zero, getPrecisionByNumber, timeConvertString } from '@orderly.network/utils';
|
|
11
12
|
import useSWRSubscription from 'swr/subscription';
|
|
12
13
|
import { pathOr, propOr, compose, head, prop, mergeDeepRight, pick, min } from 'ramda';
|
|
@@ -434,7 +435,7 @@ var DataSourceProvider = (props) => {
|
|
|
434
435
|
useAccountInstance();
|
|
435
436
|
useConstant(() => {
|
|
436
437
|
});
|
|
437
|
-
return /* @__PURE__ */
|
|
438
|
+
return /* @__PURE__ */ jsx(DataSourceContext.Provider, { value: {}, children: props.children });
|
|
438
439
|
};
|
|
439
440
|
var WS_NAME = "nativeWebsocketClient";
|
|
440
441
|
var useWS = () => {
|
|
@@ -1425,7 +1426,8 @@ var useOrderStream = ({
|
|
|
1425
1426
|
const cancelOrder = useCallback((orderId, symbol2) => {
|
|
1426
1427
|
return doCancelOrder(null, {
|
|
1427
1428
|
order_id: orderId,
|
|
1428
|
-
symbol: symbol2
|
|
1429
|
+
symbol: symbol2,
|
|
1430
|
+
source: "mweb"
|
|
1429
1431
|
}).then((res) => {
|
|
1430
1432
|
if (res.success) ; else {
|
|
1431
1433
|
throw new Error(res.message);
|