@orderly.network/hooks 1.1.4-alpha.5 → 1.1.4-alpha.7
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 +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -25,7 +25,7 @@ declare global {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
declare const _default: "1.1.4-alpha.
|
|
28
|
+
declare const _default: "1.1.4-alpha.7";
|
|
29
29
|
|
|
30
30
|
type useQueryOptions<T> = SWRConfiguration & {
|
|
31
31
|
formatter?: (data: any) => T;
|
|
@@ -96,6 +96,8 @@ declare function useSessionStorage<T>(key: string, initialValue: T): [T, (data:
|
|
|
96
96
|
|
|
97
97
|
declare function useLocalStorage<T>(key: string, initialValue: T): [any, (value: T) => void];
|
|
98
98
|
|
|
99
|
+
declare function parseJSON<T>(value: string | null): T | undefined;
|
|
100
|
+
|
|
99
101
|
declare const useWS: () => WS;
|
|
100
102
|
|
|
101
103
|
declare const useConfig: <T>(key?: ConfigKey, defaultValue?: T | undefined) => ConfigStore | T;
|
|
@@ -554,4 +556,4 @@ declare const useCrossSwap: () => any;
|
|
|
554
556
|
/** @hidden */
|
|
555
557
|
declare const useSwap: () => any;
|
|
556
558
|
|
|
557
|
-
export { ConfigProviderProps, Favorite, FavoriteTab, MarketsType, OrderParams, OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, Recent, StatusContext, StatusContextState, StatusProvider, UseOrderEntryMetaState, WalletConnectorContext, WsNetworkStatus, cleanStringStyle, useAccount, useAccountInfo, useAccountInstance, useBoolean, useChain, useChains, useCollateral, useConfig, useCrossSwap, useDeposit, useEventEmitter, useFundingRate, useHoldingStream, useIndexPrice, useLazyQuery, useLeverage, useLocalStorage, useMarginRatio, useMarkPrice, useMarkPricesStream, useMarketTradeStream, useMarkets, useMarketsStream, useMaxQty, useMediaQuery, useMutation, useOrderEntry, useOrderStream, useOrderbookStream, usePositionStream, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useSessionStorage, useSettleSubscription, useSwap, useSymbolPriceRange, useSymbolsInfo, useTickerStream, useWS, useWalletConnector, useWalletSubscription, useWithdraw, useWooCrossSwapQuery, useWooSwapQuery, useWsStatus, _default as version };
|
|
559
|
+
export { ConfigProviderProps, Favorite, FavoriteTab, MarketsType, OrderParams, OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, Recent, StatusContext, StatusContextState, StatusProvider, UseOrderEntryMetaState, WalletConnectorContext, WsNetworkStatus, cleanStringStyle, parseJSON, useAccount, useAccountInfo, useAccountInstance, useBoolean, useChain, useChains, useCollateral, useConfig, useCrossSwap, useDeposit, useEventEmitter, useFundingRate, useHoldingStream, useIndexPrice, useLazyQuery, useLeverage, useLocalStorage, useMarginRatio, useMarkPrice, useMarkPricesStream, useMarketTradeStream, useMarkets, useMarketsStream, useMaxQty, useMediaQuery, useMutation, useOrderEntry, useOrderStream, useOrderbookStream, usePositionStream, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useSessionStorage, useSettleSubscription, useSwap, useSymbolPriceRange, useSymbolsInfo, useTickerStream, useWS, useWalletConnector, useWalletSubscription, useWithdraw, useWooCrossSwapQuery, useWooSwapQuery, useWsStatus, _default as version };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ declare global {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
declare const _default: "1.1.4-alpha.
|
|
28
|
+
declare const _default: "1.1.4-alpha.7";
|
|
29
29
|
|
|
30
30
|
type useQueryOptions<T> = SWRConfiguration & {
|
|
31
31
|
formatter?: (data: any) => T;
|
|
@@ -96,6 +96,8 @@ declare function useSessionStorage<T>(key: string, initialValue: T): [T, (data:
|
|
|
96
96
|
|
|
97
97
|
declare function useLocalStorage<T>(key: string, initialValue: T): [any, (value: T) => void];
|
|
98
98
|
|
|
99
|
+
declare function parseJSON<T>(value: string | null): T | undefined;
|
|
100
|
+
|
|
99
101
|
declare const useWS: () => WS;
|
|
100
102
|
|
|
101
103
|
declare const useConfig: <T>(key?: ConfigKey, defaultValue?: T | undefined) => ConfigStore | T;
|
|
@@ -554,4 +556,4 @@ declare const useCrossSwap: () => any;
|
|
|
554
556
|
/** @hidden */
|
|
555
557
|
declare const useSwap: () => any;
|
|
556
558
|
|
|
557
|
-
export { ConfigProviderProps, Favorite, FavoriteTab, MarketsType, OrderParams, OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, Recent, StatusContext, StatusContextState, StatusProvider, UseOrderEntryMetaState, WalletConnectorContext, WsNetworkStatus, cleanStringStyle, useAccount, useAccountInfo, useAccountInstance, useBoolean, useChain, useChains, useCollateral, useConfig, useCrossSwap, useDeposit, useEventEmitter, useFundingRate, useHoldingStream, useIndexPrice, useLazyQuery, useLeverage, useLocalStorage, useMarginRatio, useMarkPrice, useMarkPricesStream, useMarketTradeStream, useMarkets, useMarketsStream, useMaxQty, useMediaQuery, useMutation, useOrderEntry, useOrderStream, useOrderbookStream, usePositionStream, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useSessionStorage, useSettleSubscription, useSwap, useSymbolPriceRange, useSymbolsInfo, useTickerStream, useWS, useWalletConnector, useWalletSubscription, useWithdraw, useWooCrossSwapQuery, useWooSwapQuery, useWsStatus, _default as version };
|
|
559
|
+
export { ConfigProviderProps, Favorite, FavoriteTab, MarketsType, OrderParams, OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, Recent, StatusContext, StatusContextState, StatusProvider, UseOrderEntryMetaState, WalletConnectorContext, WsNetworkStatus, cleanStringStyle, parseJSON, useAccount, useAccountInfo, useAccountInstance, useBoolean, useChain, useChains, useCollateral, useConfig, useCrossSwap, useDeposit, useEventEmitter, useFundingRate, useHoldingStream, useIndexPrice, useLazyQuery, useLeverage, useLocalStorage, useMarginRatio, useMarkPrice, useMarkPricesStream, useMarketTradeStream, useMarkets, useMarketsStream, useMaxQty, useMediaQuery, useMutation, useOrderEntry, useOrderStream, useOrderbookStream, usePositionStream, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useSessionStorage, useSettleSubscription, useSwap, useSymbolPriceRange, useSymbolsInfo, useTickerStream, useWS, useWalletConnector, useWalletSubscription, useWithdraw, useWooCrossSwapQuery, useWooSwapQuery, useWsStatus, _default as version };
|
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.7";
|
|
32
32
|
}
|
|
33
|
-
var version_default = "1.1.4-alpha.
|
|
33
|
+
var version_default = "1.1.4-alpha.7";
|
|
34
34
|
var fetcher = (url, init = {}, queryOptions) => net.get(url, init, queryOptions?.formatter);
|
|
35
35
|
var OrderlyContext = React.createContext({
|
|
36
36
|
// configStore: new MemoryConfigStore(),
|
|
@@ -1201,6 +1201,15 @@ function baseInputHandle(inputs) {
|
|
|
1201
1201
|
config
|
|
1202
1202
|
];
|
|
1203
1203
|
}
|
|
1204
|
+
function orderTypeHandle(inputs) {
|
|
1205
|
+
const [values, input, value, markPrice, config] = inputs;
|
|
1206
|
+
if (value === types.OrderType.LIMIT || value === types.OrderType.STOP_LIMIT) {
|
|
1207
|
+
if (values.order_price === "") {
|
|
1208
|
+
values.total = "";
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
return [values, input, value, markPrice, config];
|
|
1212
|
+
}
|
|
1204
1213
|
function orderEntityFormatHandle(baseTick, quoteTick) {
|
|
1205
1214
|
return function(inputs) {
|
|
1206
1215
|
const [values, input, value, markPrice, config] = inputs;
|
|
@@ -1308,6 +1317,8 @@ function otherInputHandle(inputs) {
|
|
|
1308
1317
|
}
|
|
1309
1318
|
var getCalculateHandler = (fieldName) => {
|
|
1310
1319
|
switch (fieldName) {
|
|
1320
|
+
case "order_type":
|
|
1321
|
+
return orderTypeHandle;
|
|
1311
1322
|
case "order_quantity": {
|
|
1312
1323
|
return quantityInputHandle;
|
|
1313
1324
|
}
|
|
@@ -5375,6 +5386,7 @@ exports.StatusProvider = StatusProvider;
|
|
|
5375
5386
|
exports.WalletConnectorContext = WalletConnectorContext;
|
|
5376
5387
|
exports.WsNetworkStatus = WsNetworkStatus;
|
|
5377
5388
|
exports.cleanStringStyle = cleanStringStyle;
|
|
5389
|
+
exports.parseJSON = parseJSON;
|
|
5378
5390
|
exports.useAccount = useAccount;
|
|
5379
5391
|
exports.useAccountInfo = useAccountInfo;
|
|
5380
5392
|
exports.useAccountInstance = useAccountInstance;
|