@orderly.network/hooks 1.1.4-alpha.7 → 1.1.4-alpha.8

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.mjs CHANGED
@@ -6,7 +6,7 @@ import useSWRMutation from 'swr/mutation';
6
6
  import useConstant4 from 'use-constant';
7
7
  export { default as useConstant } from 'use-constant';
8
8
  import { SimpleDI, Account, EventEmitter, DefaultConfigStore, LocalStorageStore, EtherAdapter, utils } from '@orderly.network/core';
9
- import { OrderType, AccountStatusEnum, SDKError, OrderStatus, OrderSide, chainsInfoMap, TestnetChains, ARBITRUM_TESTNET_CHAINID, ARBITRUM_MAINNET_CHAINID, MaxUint256, DEPOSIT_FEE_RATE, WS_WalletStatusEnum } from '@orderly.network/types';
9
+ import { OrderType, AccountStatusEnum, SDKError, OrderStatus, OrderSide, TestnetChains, chainsInfoMap, ARBITRUM_TESTNET_CHAINID, ARBITRUM_MAINNET_CHAINID, MaxUint256, DEPOSIT_FEE_RATE, WS_WalletStatusEnum } from '@orderly.network/types';
10
10
  import useSWRInfinite, { unstable_serialize } from 'swr/infinite';
11
11
  import { jsx } from 'react/jsx-runtime';
12
12
  import { useDebouncedCallback } from 'use-debounce';
@@ -20,9 +20,9 @@ import { createClient } from '@layerzerolabs/scan-client';
20
20
  // src/version.ts
21
21
  if (typeof window !== "undefined") {
22
22
  window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
23
- window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "1.1.4-alpha.7";
23
+ window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "1.1.4-alpha.8";
24
24
  }
25
- var version_default = "1.1.4-alpha.7";
25
+ var version_default = "1.1.4-alpha.8";
26
26
  var fetcher = (url, init = {}, queryOptions) => get(url, init, queryOptions?.formatter);
27
27
  var OrderlyContext = createContext({
28
28
  // configStore: new MemoryConfigStore(),
@@ -439,7 +439,7 @@ var useWS = () => {
439
439
  if (nextState.status === AccountStatusEnum.EnableTrading && nextState.accountId) {
440
440
  websocketClient.openPrivate(nextState.accountId);
441
441
  } else {
442
- websocketClient.closePrivate();
442
+ websocketClient.closePrivate(1e3, "switch account");
443
443
  }
444
444
  });
445
445
  if (typeof window !== "undefined") {
@@ -4184,6 +4184,7 @@ var useChains = (networkId, options = {}) => {
4184
4184
  const chains = useMemo(() => {
4185
4185
  let orderlyChainsArr = [];
4186
4186
  const orderlyChainIds = /* @__PURE__ */ new Set();
4187
+ let testnetArr = [...TestnetChains];
4187
4188
  orderlyChains?.forEach((item) => {
4188
4189
  item.chain_details.forEach((chain) => {
4189
4190
  const chainId = Number(chain.chain_id);
@@ -4222,7 +4223,6 @@ var useChains = (networkId, options = {}) => {
4222
4223
  orderlyChainsArr.push(_chain);
4223
4224
  });
4224
4225
  });
4225
- let testnetArr = [...TestnetChains];
4226
4226
  testnetArr.forEach((chain) => {
4227
4227
  map.current.set(chain.network_infos?.chain_id, chain);
4228
4228
  });