@orderly.network/hooks 2.1.0 → 2.1.1
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 +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +69 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -28,7 +28,7 @@ declare global {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
declare const _default: "2.1.
|
|
31
|
+
declare const _default: "2.1.1";
|
|
32
32
|
|
|
33
33
|
type useQueryOptions<T> = SWRConfiguration & {
|
|
34
34
|
formatter?: (data: any) => T;
|
|
@@ -70,12 +70,16 @@ declare const useMutation: <T, E>(url: string, method?: HTTP_METHOD, options?: S
|
|
|
70
70
|
* @param query
|
|
71
71
|
* @param options
|
|
72
72
|
*/
|
|
73
|
-
declare const usePrivateQuery: <T>(query:
|
|
73
|
+
declare const usePrivateQuery: <T>(query: Parameters<typeof swr__default>["0"], options?: useQueryOptions<T>) => SWRResponse<T>;
|
|
74
74
|
|
|
75
75
|
declare const usePrivateInfiniteQuery: <T>(getKey: SWRInfiniteKeyLoader, options?: SWRInfiniteConfiguration & {
|
|
76
76
|
formatter?: (data: any) => any;
|
|
77
77
|
}) => swr_infinite.SWRInfiniteResponse<T, any>;
|
|
78
78
|
|
|
79
|
+
declare const useInfiniteQuery: <T>(getKey: SWRInfiniteKeyLoader, options?: SWRInfiniteConfiguration & {
|
|
80
|
+
formatter?: (data: any) => any;
|
|
81
|
+
}) => swr_infinite.SWRInfiniteResponse<T, any>;
|
|
82
|
+
|
|
79
83
|
declare const useBoolean: (initialValue?: boolean) => [boolean, {
|
|
80
84
|
setTrue: () => void;
|
|
81
85
|
setFalse: () => void;
|
|
@@ -127,7 +131,7 @@ declare class AmplitudeTracker {
|
|
|
127
131
|
constructor(env: ENVType$1, sdkInfo: any);
|
|
128
132
|
setUserId(userId: string): void;
|
|
129
133
|
setSdkInfo(sdkInfo: any): void;
|
|
130
|
-
identify(
|
|
134
|
+
identify(properties: any): void;
|
|
131
135
|
track(eventName: keyof typeof TrackerListenerKeyMap, properties?: any): void;
|
|
132
136
|
private _bindEvents;
|
|
133
137
|
}
|
|
@@ -926,6 +930,11 @@ declare const useDistributionHistory: (parmas: DistributionSearchParams) => read
|
|
|
926
930
|
readonly isValidating: boolean;
|
|
927
931
|
}];
|
|
928
932
|
|
|
933
|
+
/** 0 for nothing, 2 for maintenance */
|
|
934
|
+
declare enum MaintenanceStatus {
|
|
935
|
+
None = 0,
|
|
936
|
+
Maintenance = 2
|
|
937
|
+
}
|
|
929
938
|
declare function useMaintenanceStatus(): {
|
|
930
939
|
status: number;
|
|
931
940
|
brokerName: string;
|
|
@@ -1783,4 +1792,4 @@ declare const useRestrictedInfo: (options?: RestrictedInfoOptions) => {
|
|
|
1783
1792
|
}) => ReactNode);
|
|
1784
1793
|
};
|
|
1785
1794
|
|
|
1786
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, AssetHistoryStatusEnum, type Brokers, type Chain, type Chains, type CheckReferralCodeReturns, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, DefaultLayoutConfig, DistributionId, type DrawOptions, ENVType, type EpochInfoItem, type EpochInfoType, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, MarketsStorageKey, MarketsType, type NewListing, type OrderBookItem, type OrderParams, type OrderValidationItem, type OrderValidationResult, type OrderbookData, type OrderbookOptions, type OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, type PosterLayoutConfig, type PriceMode, type Recent, RefferalAPI, type RestrictedInfoOptions, type RestrictedInfoReturns, ScopeType, StatusContext, type StatusContextState, StatusProvider, type SymbolInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, type filteredChains$1 as filteredChains, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useBoolean, useChain, useChains, useCheckReferralCode, useCollateral, useCommission, useConfig, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useKeyStore, useLazyQuery, useLeverage, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMutation, useNetworkInfo, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, usePositionActions, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useTPSLOrder, useTickerStream, useTrack, useTrackingInstance, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWithdraw, useWsStatus, index as utils, _default as version };
|
|
1795
|
+
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, AssetHistoryStatusEnum, type Brokers, type Chain, type Chains, type CheckReferralCodeReturns, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, DefaultLayoutConfig, DistributionId, type DrawOptions, ENVType, type EpochInfoItem, type EpochInfoType, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, MaintenanceStatus, MarketsStorageKey, MarketsType, type NewListing, type OrderBookItem, type OrderParams, type OrderValidationItem, type OrderValidationResult, type OrderbookData, type OrderbookOptions, type OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, type PosterLayoutConfig, type PriceMode, type Recent, RefferalAPI, type RestrictedInfoOptions, type RestrictedInfoReturns, ScopeType, StatusContext, type StatusContextState, StatusProvider, type SymbolInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, type filteredChains$1 as filteredChains, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useBoolean, useChain, useChains, useCheckReferralCode, useCollateral, useCommission, useConfig, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useInfiniteQuery, useKeyStore, useLazyQuery, useLeverage, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMutation, useNetworkInfo, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, usePositionActions, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useTPSLOrder, useTickerStream, useTrack, useTrackingInstance, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWithdraw, useWsStatus, index as utils, _default as version };
|
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare global {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
declare const _default: "2.1.
|
|
31
|
+
declare const _default: "2.1.1";
|
|
32
32
|
|
|
33
33
|
type useQueryOptions<T> = SWRConfiguration & {
|
|
34
34
|
formatter?: (data: any) => T;
|
|
@@ -70,12 +70,16 @@ declare const useMutation: <T, E>(url: string, method?: HTTP_METHOD, options?: S
|
|
|
70
70
|
* @param query
|
|
71
71
|
* @param options
|
|
72
72
|
*/
|
|
73
|
-
declare const usePrivateQuery: <T>(query:
|
|
73
|
+
declare const usePrivateQuery: <T>(query: Parameters<typeof swr__default>["0"], options?: useQueryOptions<T>) => SWRResponse<T>;
|
|
74
74
|
|
|
75
75
|
declare const usePrivateInfiniteQuery: <T>(getKey: SWRInfiniteKeyLoader, options?: SWRInfiniteConfiguration & {
|
|
76
76
|
formatter?: (data: any) => any;
|
|
77
77
|
}) => swr_infinite.SWRInfiniteResponse<T, any>;
|
|
78
78
|
|
|
79
|
+
declare const useInfiniteQuery: <T>(getKey: SWRInfiniteKeyLoader, options?: SWRInfiniteConfiguration & {
|
|
80
|
+
formatter?: (data: any) => any;
|
|
81
|
+
}) => swr_infinite.SWRInfiniteResponse<T, any>;
|
|
82
|
+
|
|
79
83
|
declare const useBoolean: (initialValue?: boolean) => [boolean, {
|
|
80
84
|
setTrue: () => void;
|
|
81
85
|
setFalse: () => void;
|
|
@@ -127,7 +131,7 @@ declare class AmplitudeTracker {
|
|
|
127
131
|
constructor(env: ENVType$1, sdkInfo: any);
|
|
128
132
|
setUserId(userId: string): void;
|
|
129
133
|
setSdkInfo(sdkInfo: any): void;
|
|
130
|
-
identify(
|
|
134
|
+
identify(properties: any): void;
|
|
131
135
|
track(eventName: keyof typeof TrackerListenerKeyMap, properties?: any): void;
|
|
132
136
|
private _bindEvents;
|
|
133
137
|
}
|
|
@@ -926,6 +930,11 @@ declare const useDistributionHistory: (parmas: DistributionSearchParams) => read
|
|
|
926
930
|
readonly isValidating: boolean;
|
|
927
931
|
}];
|
|
928
932
|
|
|
933
|
+
/** 0 for nothing, 2 for maintenance */
|
|
934
|
+
declare enum MaintenanceStatus {
|
|
935
|
+
None = 0,
|
|
936
|
+
Maintenance = 2
|
|
937
|
+
}
|
|
929
938
|
declare function useMaintenanceStatus(): {
|
|
930
939
|
status: number;
|
|
931
940
|
brokerName: string;
|
|
@@ -1783,4 +1792,4 @@ declare const useRestrictedInfo: (options?: RestrictedInfoOptions) => {
|
|
|
1783
1792
|
}) => ReactNode);
|
|
1784
1793
|
};
|
|
1785
1794
|
|
|
1786
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, AssetHistoryStatusEnum, type Brokers, type Chain, type Chains, type CheckReferralCodeReturns, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, DefaultLayoutConfig, DistributionId, type DrawOptions, ENVType, type EpochInfoItem, type EpochInfoType, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, MarketsStorageKey, MarketsType, type NewListing, type OrderBookItem, type OrderParams, type OrderValidationItem, type OrderValidationResult, type OrderbookData, type OrderbookOptions, type OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, type PosterLayoutConfig, type PriceMode, type Recent, RefferalAPI, type RestrictedInfoOptions, type RestrictedInfoReturns, ScopeType, StatusContext, type StatusContextState, StatusProvider, type SymbolInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, type filteredChains$1 as filteredChains, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useBoolean, useChain, useChains, useCheckReferralCode, useCollateral, useCommission, useConfig, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useKeyStore, useLazyQuery, useLeverage, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMutation, useNetworkInfo, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, usePositionActions, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useTPSLOrder, useTickerStream, useTrack, useTrackingInstance, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWithdraw, useWsStatus, index as utils, _default as version };
|
|
1795
|
+
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, AssetHistoryStatusEnum, type Brokers, type Chain, type Chains, type CheckReferralCodeReturns, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, DefaultLayoutConfig, DistributionId, type DrawOptions, ENVType, type EpochInfoItem, type EpochInfoType, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, MaintenanceStatus, MarketsStorageKey, MarketsType, type NewListing, type OrderBookItem, type OrderParams, type OrderValidationItem, type OrderValidationResult, type OrderbookData, type OrderbookOptions, type OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, type PosterLayoutConfig, type PriceMode, type Recent, RefferalAPI, type RestrictedInfoOptions, type RestrictedInfoReturns, ScopeType, StatusContext, type StatusContextState, StatusProvider, type SymbolInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, type filteredChains$1 as filteredChains, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useBoolean, useChain, useChains, useCheckReferralCode, useCollateral, useCommission, useConfig, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useInfiniteQuery, useKeyStore, useLazyQuery, useLeverage, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMutation, useNetworkInfo, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, usePositionActions, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useTPSLOrder, useTickerStream, useTrack, useTrackingInstance, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWithdraw, useWsStatus, index as utils, _default as version };
|
package/dist/index.js
CHANGED
|
@@ -61,9 +61,9 @@ var __export = (target, all) => {
|
|
|
61
61
|
// src/version.ts
|
|
62
62
|
if (typeof window !== "undefined") {
|
|
63
63
|
window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
|
|
64
|
-
window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.1.
|
|
64
|
+
window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.1.1";
|
|
65
65
|
}
|
|
66
|
-
var version_default = "2.1.
|
|
66
|
+
var version_default = "2.1.1";
|
|
67
67
|
var fetcher = (url, init2 = {}, queryOptions) => net.get(url, init2, queryOptions?.formatter);
|
|
68
68
|
var OrderlyContext = React.createContext({
|
|
69
69
|
// configStore: new MemoryConfigStore(),
|
|
@@ -249,13 +249,36 @@ var useEventEmitter = () => {
|
|
|
249
249
|
return ee;
|
|
250
250
|
});
|
|
251
251
|
};
|
|
252
|
+
var WalletConnectorContext = React.createContext({});
|
|
253
|
+
var useWalletConnector = () => {
|
|
254
|
+
return React.useContext(WalletConnectorContext);
|
|
255
|
+
};
|
|
252
256
|
|
|
253
257
|
// src/useTrack.ts
|
|
254
258
|
var useTrack = () => {
|
|
255
259
|
const ee = useEventEmitter();
|
|
260
|
+
const { wallet } = useWalletConnector();
|
|
256
261
|
const debouncedTrackFn = React.useCallback(
|
|
257
262
|
lodash.debounce((eventName, params) => {
|
|
258
|
-
|
|
263
|
+
utils.windowGuard(() => {
|
|
264
|
+
const location = window.location;
|
|
265
|
+
const origin = location.origin;
|
|
266
|
+
const url = location.pathname;
|
|
267
|
+
const title = document.title;
|
|
268
|
+
const userAgent = window.navigator.userAgent;
|
|
269
|
+
Object.assign(params, {
|
|
270
|
+
page_title: title,
|
|
271
|
+
page_url: url,
|
|
272
|
+
page_domain: origin,
|
|
273
|
+
user_agent: userAgent
|
|
274
|
+
});
|
|
275
|
+
if (eventName === types.EnumTrackerKeys.placeorderSuccess) {
|
|
276
|
+
Object.assign(params, {
|
|
277
|
+
wallet: wallet?.label || "QR code"
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
ee.emit(eventName, params);
|
|
281
|
+
});
|
|
259
282
|
}, 500),
|
|
260
283
|
[]
|
|
261
284
|
);
|
|
@@ -363,6 +386,21 @@ var usePrivateInfiniteQuery = (getKey, options) => {
|
|
|
363
386
|
);
|
|
364
387
|
return result;
|
|
365
388
|
};
|
|
389
|
+
var useInfiniteQuery = (getKey, options) => {
|
|
390
|
+
const { formatter, ...swrOptions } = options || {};
|
|
391
|
+
const apiBaseUrl = useConfig("apiBaseUrl");
|
|
392
|
+
const result = useSWRInfinite__default.default(
|
|
393
|
+
(pageIndex, previousPageData) => {
|
|
394
|
+
return getKey(pageIndex, previousPageData);
|
|
395
|
+
},
|
|
396
|
+
(url, init2) => {
|
|
397
|
+
const _url = url.startsWith("http") ? url : `${apiBaseUrl}${url}`;
|
|
398
|
+
return fetcher(_url, init2, { formatter });
|
|
399
|
+
},
|
|
400
|
+
swrOptions
|
|
401
|
+
);
|
|
402
|
+
return result;
|
|
403
|
+
};
|
|
366
404
|
var useBoolean = (initialValue = false) => {
|
|
367
405
|
const [value, setValue] = React.useState(initialValue);
|
|
368
406
|
const setTrue = React.useCallback(() => setValue(true), []);
|
|
@@ -550,15 +588,15 @@ var AmplitudeTracker = class {
|
|
|
550
588
|
setSdkInfo(sdkInfo) {
|
|
551
589
|
if (this._sdkInfoTag && sdkInfo.address === this._sdkInfoTag)
|
|
552
590
|
return;
|
|
591
|
+
this.identify(sdkInfo);
|
|
592
|
+
this._sdkInfoTag = sdkInfo.address;
|
|
593
|
+
}
|
|
594
|
+
identify(properties) {
|
|
553
595
|
const identify2 = new amplitude__namespace.Identify();
|
|
554
|
-
Object.entries(
|
|
596
|
+
Object.entries(properties).forEach(([key, value]) => {
|
|
555
597
|
identify2.set(key, value);
|
|
556
598
|
});
|
|
557
599
|
amplitude__namespace.identify(identify2);
|
|
558
|
-
this._sdkInfoTag = sdkInfo.address;
|
|
559
|
-
}
|
|
560
|
-
identify(identifyEvent) {
|
|
561
|
-
amplitude__namespace.identify(identifyEvent);
|
|
562
600
|
}
|
|
563
601
|
track(eventName, properties) {
|
|
564
602
|
amplitude__namespace.track(types.TrackerListenerKeyMap[eventName], properties);
|
|
@@ -3839,6 +3877,14 @@ var useMarginRatio = () => {
|
|
|
3839
3877
|
return { marginRatio, currentLeverage, mmr };
|
|
3840
3878
|
};
|
|
3841
3879
|
var TestNetWhiteList = [421614, 901901901, types.MONAD_TESTNET_CHAINID];
|
|
3880
|
+
var testnetTokenFallback = types.TesntTokenFallback([
|
|
3881
|
+
types.ArbitrumSepoliaTokenInfo,
|
|
3882
|
+
types.SolanaDevnetTokenInfo
|
|
3883
|
+
]);
|
|
3884
|
+
var testnetChainFallback = [
|
|
3885
|
+
types.ArbitrumSepoliaChainInfo,
|
|
3886
|
+
types.SolanaDevnetChainInfo
|
|
3887
|
+
];
|
|
3842
3888
|
function useChains(networkId, options = {}) {
|
|
3843
3889
|
const { pick: pickField, ...swrOptions } = options;
|
|
3844
3890
|
const {
|
|
@@ -3867,10 +3913,7 @@ function useChains(networkId, options = {}) {
|
|
|
3867
3913
|
"https://testnet-api.orderly.org/v1/public/token",
|
|
3868
3914
|
{
|
|
3869
3915
|
...commonSwrOpts,
|
|
3870
|
-
fallbackData:
|
|
3871
|
-
types.ArbitrumSepoliaTokenInfo,
|
|
3872
|
-
types.SolanaDevnetTokenInfo
|
|
3873
|
-
])
|
|
3916
|
+
fallbackData: testnetTokenFallback
|
|
3874
3917
|
}
|
|
3875
3918
|
);
|
|
3876
3919
|
const brokerId = configStore.get("brokerId");
|
|
@@ -3883,7 +3926,7 @@ function useChains(networkId, options = {}) {
|
|
|
3883
3926
|
needFetchFromAPI ? `https://testnet-api.orderly.org/v1/public/chain_info${brokerId !== "orderly" ? `?broker_id=${brokerId}` : ""}` : null,
|
|
3884
3927
|
{
|
|
3885
3928
|
...commonSwrOpts,
|
|
3886
|
-
fallbackData:
|
|
3929
|
+
fallbackData: testnetChainFallback,
|
|
3887
3930
|
onError: (error) => {
|
|
3888
3931
|
}
|
|
3889
3932
|
}
|
|
@@ -4154,7 +4197,7 @@ var useWithdraw = (options) => {
|
|
|
4154
4197
|
const { unsettledPnL, availableBalance, freeCollateral } = useCollateral();
|
|
4155
4198
|
const networkId = useConfig("networkId");
|
|
4156
4199
|
const [_, { findByChainId }] = useChains(void 0);
|
|
4157
|
-
|
|
4200
|
+
useEventEmitter();
|
|
4158
4201
|
const { track: track2 } = useTrack();
|
|
4159
4202
|
const { usdc } = useHoldingStream();
|
|
4160
4203
|
const maxAmount = React.useMemo(() => {
|
|
@@ -4197,7 +4240,7 @@ var useWithdraw = (options) => {
|
|
|
4197
4240
|
(inputs) => {
|
|
4198
4241
|
return account5.assetsManager.withdraw(inputs).then((res) => {
|
|
4199
4242
|
if (res.success) {
|
|
4200
|
-
|
|
4243
|
+
track2(types.EnumTrackerKeys.withdrawSuccess, {
|
|
4201
4244
|
wallet: state?.connectWallet?.name,
|
|
4202
4245
|
network: targetChain?.network_infos.name,
|
|
4203
4246
|
quantity: inputs.amount
|
|
@@ -6268,8 +6311,13 @@ var useDistributionHistory = (parmas) => {
|
|
|
6268
6311
|
}
|
|
6269
6312
|
];
|
|
6270
6313
|
};
|
|
6314
|
+
var MaintenanceStatus = /* @__PURE__ */ ((MaintenanceStatus2) => {
|
|
6315
|
+
MaintenanceStatus2[MaintenanceStatus2["None"] = 0] = "None";
|
|
6316
|
+
MaintenanceStatus2[MaintenanceStatus2["Maintenance"] = 2] = "Maintenance";
|
|
6317
|
+
return MaintenanceStatus2;
|
|
6318
|
+
})(MaintenanceStatus || {});
|
|
6271
6319
|
function useMaintenanceStatus() {
|
|
6272
|
-
const [status, setStatus] = React.useState(0);
|
|
6320
|
+
const [status, setStatus] = React.useState(0 /* None */);
|
|
6273
6321
|
const [startTime, setStartTime] = React.useState();
|
|
6274
6322
|
const [endTime, setEndTime] = React.useState();
|
|
6275
6323
|
const [brokerName, setBrokerName] = React.useState("Orderly network");
|
|
@@ -6295,8 +6343,8 @@ function useMaintenanceStatus() {
|
|
|
6295
6343
|
setStartTime(systemInfo.scheduled_maintenance.start_time);
|
|
6296
6344
|
setEndTime(systemInfo.scheduled_maintenance.end_time);
|
|
6297
6345
|
}
|
|
6298
|
-
if (systemInfo.status === 2) {
|
|
6299
|
-
setStatus(2);
|
|
6346
|
+
if (systemInfo.status === 2 /* Maintenance */) {
|
|
6347
|
+
setStatus(2 /* Maintenance */);
|
|
6300
6348
|
}
|
|
6301
6349
|
}, [systemInfo, config]);
|
|
6302
6350
|
React.useEffect(() => {
|
|
@@ -6840,10 +6888,6 @@ var OrderlyConfigProvider = (props) => {
|
|
|
6840
6888
|
}
|
|
6841
6889
|
);
|
|
6842
6890
|
};
|
|
6843
|
-
var WalletConnectorContext = React.createContext({});
|
|
6844
|
-
var useWalletConnector = () => {
|
|
6845
|
-
return React.useContext(WalletConnectorContext);
|
|
6846
|
-
};
|
|
6847
6891
|
var needNumberOnlyFields = [
|
|
6848
6892
|
"order_quantity",
|
|
6849
6893
|
"order_price",
|
|
@@ -14408,7 +14452,7 @@ var useOrderEntry2 = (symbol, options = {}) => {
|
|
|
14408
14452
|
side: order.side,
|
|
14409
14453
|
order_type: order.order_type,
|
|
14410
14454
|
tp_sl: hasTPSL(formattedOrder),
|
|
14411
|
-
|
|
14455
|
+
symbol: order.symbol
|
|
14412
14456
|
});
|
|
14413
14457
|
}
|
|
14414
14458
|
if (result.success && resetOnSuccess) {
|
|
@@ -14679,6 +14723,7 @@ exports.DefaultLayoutConfig = DefaultLayoutConfig;
|
|
|
14679
14723
|
exports.DistributionId = DistributionId;
|
|
14680
14724
|
exports.ENVType = ENVType2;
|
|
14681
14725
|
exports.ExtendedConfigStore = ExtendedConfigStore;
|
|
14726
|
+
exports.MaintenanceStatus = MaintenanceStatus;
|
|
14682
14727
|
exports.MarketsStorageKey = MarketsStorageKey;
|
|
14683
14728
|
exports.MarketsType = MarketsType;
|
|
14684
14729
|
exports.OrderlyConfigProvider = OrderlyConfigProvider;
|
|
@@ -14723,6 +14768,7 @@ exports.useGetEnv = useGetEnv;
|
|
|
14723
14768
|
exports.useGetReferralCode = useGetReferralCode;
|
|
14724
14769
|
exports.useHoldingStream = useHoldingStream;
|
|
14725
14770
|
exports.useIndexPrice = useIndexPrice;
|
|
14771
|
+
exports.useInfiniteQuery = useInfiniteQuery;
|
|
14726
14772
|
exports.useKeyStore = useKeyStore;
|
|
14727
14773
|
exports.useLazyQuery = useLazyQuery;
|
|
14728
14774
|
exports.useLeverage = useLeverage;
|