@orderly.network/hooks 2.7.1 → 2.7.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/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ export { unstable_serialize, default as useSWR, useSWRConfig } from 'swr';
|
|
|
6
6
|
import { TesntTokenFallback, ArbitrumSepoliaTokenInfo, SolanaDevnetTokenInfo, OrderType, OrderSide, SDKError, TrackerEventName, AccountStatusEnum, AlgoOrderType, AlgoOrderRootType, OrderStatus, EMPTY_LIST, EMPTY_OBJECT, ArbitrumSepoliaChainInfo, SolanaDevnetChainInfo, ARBITRUM_TESTNET_CHAINID, SOLANA_TESTNET_CHAINID, MONAD_TESTNET_CHAINID, ABSTRACT_TESTNET_CHAINID, BSC_TESTNET_CHAINID, nativeTokenAddress, ChainKey, chainsInfoMap, ARBITRUM_MAINNET_CHAINID, isNativeTokenChecker, ChainNamespace, MaxUint256, ETHEREUM_MAINNET_CHAINID, DEPOSIT_FEE_RATE, LedgerWalletKey, SolanaChains, PositionType, DistributionType, TriggerPriceType } from '@orderly.network/types';
|
|
7
7
|
import React2, { createContext, useContext, useCallback, useState, useEffect, useMemo, useRef, useId, useLayoutEffect } from 'react';
|
|
8
8
|
import useSWRMutation from 'swr/mutation';
|
|
9
|
-
import { zero, windowGuard, getTimestamp, getGlobalObject, Decimal, timeConvertString, isTestnet, getPrecisionByNumber, camelCaseToUnderscoreCase, commify, todpIfNeed, getTPSLDirection } from '@orderly.network/utils';
|
|
9
|
+
import { zero, windowGuard, getTimestamp, getGlobalObject, Decimal, timeConvertString, isTestnet, getPrecisionByNumber, getBBOType, camelCaseToUnderscoreCase, commify, todpIfNeed, getTPSLDirection } from '@orderly.network/utils';
|
|
10
10
|
import useConstant from 'use-constant';
|
|
11
11
|
export { default as useConstant } from 'use-constant';
|
|
12
12
|
import { SimpleDI, Account, EventEmitter, DefaultConfigStore, EVENT_NAMES, LocalStorageStore } from '@orderly.network/core';
|
|
@@ -36,9 +36,9 @@ var __export = (target, all) => {
|
|
|
36
36
|
// src/version.ts
|
|
37
37
|
if (typeof window !== "undefined") {
|
|
38
38
|
window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
|
|
39
|
-
window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.7.
|
|
39
|
+
window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.7.2";
|
|
40
40
|
}
|
|
41
|
-
var version_default = "2.7.
|
|
41
|
+
var version_default = "2.7.2";
|
|
42
42
|
var fetcher = (url, init2 = {}, queryOptions) => get(url, init2, queryOptions?.formatter);
|
|
43
43
|
var noCacheConfig = {
|
|
44
44
|
dedupingInterval: 0,
|
|
@@ -236,7 +236,7 @@ var useTrack = () => {
|
|
|
236
236
|
const ee = useEventEmitter();
|
|
237
237
|
const { wallet } = useWalletConnector();
|
|
238
238
|
const tracking = useCallback(
|
|
239
|
-
(eventName, params) => {
|
|
239
|
+
(eventName, params = {}) => {
|
|
240
240
|
windowGuard(() => {
|
|
241
241
|
const location = window.location;
|
|
242
242
|
const origin = location.origin;
|
|
@@ -17392,6 +17392,17 @@ var useOrderEntry2 = (symbol, options = {}) => {
|
|
|
17392
17392
|
tp_sl: hasTPSL(formattedOrder),
|
|
17393
17393
|
symbol: order.symbol
|
|
17394
17394
|
};
|
|
17395
|
+
if ([OrderType.ASK, OrderType.BID].includes(order.order_type)) {
|
|
17396
|
+
trackParams = {
|
|
17397
|
+
...trackParams,
|
|
17398
|
+
bbo: true,
|
|
17399
|
+
bbo_setting: getBBOType({
|
|
17400
|
+
type: order.order_type,
|
|
17401
|
+
side: order.side,
|
|
17402
|
+
level: order.level
|
|
17403
|
+
})
|
|
17404
|
+
};
|
|
17405
|
+
}
|
|
17395
17406
|
if (isScaledOrder) {
|
|
17396
17407
|
const skew = getScaledOrderSkew({
|
|
17397
17408
|
skew: order.skew,
|