@orderly.network/hooks 2.6.0 → 2.6.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 +33 -5
- package/dist/index.d.ts +33 -5
- package/dist/index.js +97 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -39
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -32,7 +32,7 @@ declare global {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
declare const _default: "2.6.
|
|
35
|
+
declare const _default: "2.6.1";
|
|
36
36
|
|
|
37
37
|
declare const fetcher: (url: string, init: RequestInit | undefined, queryOptions: useQueryOptions<any>) => Promise<any>;
|
|
38
38
|
type useQueryOptions<T> = SWRConfiguration & {
|
|
@@ -287,9 +287,14 @@ interface OrderlyConfigContextState {
|
|
|
287
287
|
orderFilled?: {
|
|
288
288
|
/**
|
|
289
289
|
* Sound to play when an order is successful.
|
|
290
|
-
* @default
|
|
290
|
+
* @default undefined
|
|
291
291
|
*/
|
|
292
292
|
media?: string;
|
|
293
|
+
/**
|
|
294
|
+
* Whether to open the notification by default.
|
|
295
|
+
* @default false
|
|
296
|
+
*/
|
|
297
|
+
defaultOpen?: boolean;
|
|
293
298
|
};
|
|
294
299
|
};
|
|
295
300
|
}
|
|
@@ -1017,6 +1022,18 @@ declare const useTransfer: (options?: TransferOptions) => {
|
|
|
1017
1022
|
holding: _orderly_network_types.API.Holding[] | undefined;
|
|
1018
1023
|
};
|
|
1019
1024
|
|
|
1025
|
+
type InternalTransferInputs = {
|
|
1026
|
+
token: string;
|
|
1027
|
+
amount: string;
|
|
1028
|
+
receiver: string;
|
|
1029
|
+
/** orderly token decimals */
|
|
1030
|
+
decimals: number;
|
|
1031
|
+
};
|
|
1032
|
+
declare const useInternalTransfer: () => {
|
|
1033
|
+
submitting: boolean;
|
|
1034
|
+
transfer: (inputs: InternalTransferInputs) => Promise<any>;
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1020
1037
|
declare const useHoldingStream: () => {
|
|
1021
1038
|
data: API.Holding[] | undefined;
|
|
1022
1039
|
usdc: API.Holding | undefined;
|
|
@@ -1284,7 +1301,7 @@ declare const useDistributionHistory: (parmas: DistributionSearchParams) => read
|
|
|
1284
1301
|
readonly isValidating: boolean;
|
|
1285
1302
|
}];
|
|
1286
1303
|
|
|
1287
|
-
interface TransferHistorySearchParams {
|
|
1304
|
+
interface TransferHistorySearchParams$1 {
|
|
1288
1305
|
dataRange?: number[];
|
|
1289
1306
|
page: number;
|
|
1290
1307
|
size: number;
|
|
@@ -1299,12 +1316,23 @@ interface TransferHistorySearchParams {
|
|
|
1299
1316
|
*/
|
|
1300
1317
|
main_sub_only?: boolean;
|
|
1301
1318
|
}
|
|
1302
|
-
declare const useTransferHistory: (parmas: TransferHistorySearchParams) => readonly [API.TransferHistoryRow[], {
|
|
1319
|
+
declare const useTransferHistory: (parmas: TransferHistorySearchParams$1) => readonly [API.TransferHistoryRow[], {
|
|
1303
1320
|
readonly meta: API.RecordsMeta | undefined;
|
|
1304
1321
|
readonly isLoading: boolean;
|
|
1305
1322
|
readonly mutate: swr.KeyedMutator<API.TransferHistory>;
|
|
1306
1323
|
}];
|
|
1307
1324
|
|
|
1325
|
+
interface TransferHistorySearchParams {
|
|
1326
|
+
dataRange?: number[];
|
|
1327
|
+
page: number;
|
|
1328
|
+
size: number;
|
|
1329
|
+
}
|
|
1330
|
+
declare const useVaultsHistory: (parmas: TransferHistorySearchParams) => (API.StrategyVaultHistoryRow[] | {
|
|
1331
|
+
meta: API.RecordsMeta | undefined;
|
|
1332
|
+
isLoading: boolean;
|
|
1333
|
+
mutate: swr.KeyedMutator<API.StrategyVaultHistory>;
|
|
1334
|
+
})[];
|
|
1335
|
+
|
|
1308
1336
|
/** 0 for nothing, 2 for maintenance */
|
|
1309
1337
|
declare enum MaintenanceStatus {
|
|
1310
1338
|
None = 0,
|
|
@@ -2294,4 +2322,4 @@ declare const usePositionClose: (options: PositionCloseOptions) => {
|
|
|
2294
2322
|
declare const useMarketList: () => API.MarketInfoExt[];
|
|
2295
2323
|
declare const useMarketMap: () => Record<string, API.MarketInfoExt> | null;
|
|
2296
2324
|
|
|
2297
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, 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, EpochStatus, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, type FundingRates, MaintenanceStatus, type MarginRatioReturn, type MarketsItem, MarketsStorageKey, type MarketsStore, 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, type StatusInfo, StatusProvider, type SymbolInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletConnectorContextState, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, fetcher, type filteredChains$1 as filteredChains, findPositionTPSLFromOrders, findTPSLFromOrder, findTPSLOrderPriceFromOrder, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useAudioPlayer, useBalanceSubscription, useBalanceTopic, useBoolean, useChain, useChains, useCheckReferralCode, useCollateral, useCommission, useComputedLTV, useConfig, useConvert, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFundingDetails, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useFundingRatesStore, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useIndexPricesStream, useInfiniteQuery, useKeyStore, useLazyQuery, useLeverage, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketList, useMarketMap, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, useOrderlyContext, usePositionActions, usePositionClose, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSubAccountDataObserver, useSubAccountMaxWithdrawal, useSubAccountMutation, useSubAccountQuery, useSubAccountWS, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useSymbolsInfoStore, useTPSLOrder, useTickerStream, useTokenInfo, useTokensInfo, useTrack, useTrackingInstance, useTradingRewardsStatus, useTransfer, useTransferHistory, useUpdatedRef, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWalletTopic, useWithdraw, useWsStatus, index as utils, _default as version };
|
|
2325
|
+
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, 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, EpochStatus, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, type FundingRates, MaintenanceStatus, type MarginRatioReturn, type MarketsItem, MarketsStorageKey, type MarketsStore, 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, type StatusInfo, StatusProvider, type SymbolInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletConnectorContextState, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, fetcher, type filteredChains$1 as filteredChains, findPositionTPSLFromOrders, findTPSLFromOrder, findTPSLOrderPriceFromOrder, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useAudioPlayer, useBalanceSubscription, useBalanceTopic, useBoolean, useChain, useChains, useCheckReferralCode, useCollateral, useCommission, useComputedLTV, useConfig, useConvert, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFundingDetails, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useFundingRatesStore, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useIndexPricesStream, useInfiniteQuery, useInternalTransfer, useKeyStore, useLazyQuery, useLeverage, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketList, useMarketMap, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, useOrderlyContext, usePositionActions, usePositionClose, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSubAccountDataObserver, useSubAccountMaxWithdrawal, useSubAccountMutation, useSubAccountQuery, useSubAccountWS, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useSymbolsInfoStore, useTPSLOrder, useTickerStream, useTokenInfo, useTokensInfo, useTrack, useTrackingInstance, useTradingRewardsStatus, useTransfer, useTransferHistory, useUpdatedRef, useVaultsHistory, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWalletTopic, useWithdraw, useWsStatus, index as utils, _default as version };
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare global {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
declare const _default: "2.6.
|
|
35
|
+
declare const _default: "2.6.1";
|
|
36
36
|
|
|
37
37
|
declare const fetcher: (url: string, init: RequestInit | undefined, queryOptions: useQueryOptions<any>) => Promise<any>;
|
|
38
38
|
type useQueryOptions<T> = SWRConfiguration & {
|
|
@@ -287,9 +287,14 @@ interface OrderlyConfigContextState {
|
|
|
287
287
|
orderFilled?: {
|
|
288
288
|
/**
|
|
289
289
|
* Sound to play when an order is successful.
|
|
290
|
-
* @default
|
|
290
|
+
* @default undefined
|
|
291
291
|
*/
|
|
292
292
|
media?: string;
|
|
293
|
+
/**
|
|
294
|
+
* Whether to open the notification by default.
|
|
295
|
+
* @default false
|
|
296
|
+
*/
|
|
297
|
+
defaultOpen?: boolean;
|
|
293
298
|
};
|
|
294
299
|
};
|
|
295
300
|
}
|
|
@@ -1017,6 +1022,18 @@ declare const useTransfer: (options?: TransferOptions) => {
|
|
|
1017
1022
|
holding: _orderly_network_types.API.Holding[] | undefined;
|
|
1018
1023
|
};
|
|
1019
1024
|
|
|
1025
|
+
type InternalTransferInputs = {
|
|
1026
|
+
token: string;
|
|
1027
|
+
amount: string;
|
|
1028
|
+
receiver: string;
|
|
1029
|
+
/** orderly token decimals */
|
|
1030
|
+
decimals: number;
|
|
1031
|
+
};
|
|
1032
|
+
declare const useInternalTransfer: () => {
|
|
1033
|
+
submitting: boolean;
|
|
1034
|
+
transfer: (inputs: InternalTransferInputs) => Promise<any>;
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1020
1037
|
declare const useHoldingStream: () => {
|
|
1021
1038
|
data: API.Holding[] | undefined;
|
|
1022
1039
|
usdc: API.Holding | undefined;
|
|
@@ -1284,7 +1301,7 @@ declare const useDistributionHistory: (parmas: DistributionSearchParams) => read
|
|
|
1284
1301
|
readonly isValidating: boolean;
|
|
1285
1302
|
}];
|
|
1286
1303
|
|
|
1287
|
-
interface TransferHistorySearchParams {
|
|
1304
|
+
interface TransferHistorySearchParams$1 {
|
|
1288
1305
|
dataRange?: number[];
|
|
1289
1306
|
page: number;
|
|
1290
1307
|
size: number;
|
|
@@ -1299,12 +1316,23 @@ interface TransferHistorySearchParams {
|
|
|
1299
1316
|
*/
|
|
1300
1317
|
main_sub_only?: boolean;
|
|
1301
1318
|
}
|
|
1302
|
-
declare const useTransferHistory: (parmas: TransferHistorySearchParams) => readonly [API.TransferHistoryRow[], {
|
|
1319
|
+
declare const useTransferHistory: (parmas: TransferHistorySearchParams$1) => readonly [API.TransferHistoryRow[], {
|
|
1303
1320
|
readonly meta: API.RecordsMeta | undefined;
|
|
1304
1321
|
readonly isLoading: boolean;
|
|
1305
1322
|
readonly mutate: swr.KeyedMutator<API.TransferHistory>;
|
|
1306
1323
|
}];
|
|
1307
1324
|
|
|
1325
|
+
interface TransferHistorySearchParams {
|
|
1326
|
+
dataRange?: number[];
|
|
1327
|
+
page: number;
|
|
1328
|
+
size: number;
|
|
1329
|
+
}
|
|
1330
|
+
declare const useVaultsHistory: (parmas: TransferHistorySearchParams) => (API.StrategyVaultHistoryRow[] | {
|
|
1331
|
+
meta: API.RecordsMeta | undefined;
|
|
1332
|
+
isLoading: boolean;
|
|
1333
|
+
mutate: swr.KeyedMutator<API.StrategyVaultHistory>;
|
|
1334
|
+
})[];
|
|
1335
|
+
|
|
1308
1336
|
/** 0 for nothing, 2 for maintenance */
|
|
1309
1337
|
declare enum MaintenanceStatus {
|
|
1310
1338
|
None = 0,
|
|
@@ -2294,4 +2322,4 @@ declare const usePositionClose: (options: PositionCloseOptions) => {
|
|
|
2294
2322
|
declare const useMarketList: () => API.MarketInfoExt[];
|
|
2295
2323
|
declare const useMarketMap: () => Record<string, API.MarketInfoExt> | null;
|
|
2296
2324
|
|
|
2297
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, 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, EpochStatus, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, type FundingRates, MaintenanceStatus, type MarginRatioReturn, type MarketsItem, MarketsStorageKey, type MarketsStore, 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, type StatusInfo, StatusProvider, type SymbolInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletConnectorContextState, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, fetcher, type filteredChains$1 as filteredChains, findPositionTPSLFromOrders, findTPSLFromOrder, findTPSLOrderPriceFromOrder, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useAudioPlayer, useBalanceSubscription, useBalanceTopic, useBoolean, useChain, useChains, useCheckReferralCode, useCollateral, useCommission, useComputedLTV, useConfig, useConvert, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFundingDetails, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useFundingRatesStore, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useIndexPricesStream, useInfiniteQuery, useKeyStore, useLazyQuery, useLeverage, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketList, useMarketMap, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, useOrderlyContext, usePositionActions, usePositionClose, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSubAccountDataObserver, useSubAccountMaxWithdrawal, useSubAccountMutation, useSubAccountQuery, useSubAccountWS, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useSymbolsInfoStore, useTPSLOrder, useTickerStream, useTokenInfo, useTokensInfo, useTrack, useTrackingInstance, useTradingRewardsStatus, useTransfer, useTransferHistory, useUpdatedRef, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWalletTopic, useWithdraw, useWsStatus, index as utils, _default as version };
|
|
2325
|
+
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, 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, EpochStatus, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, type FundingRates, MaintenanceStatus, type MarginRatioReturn, type MarketsItem, MarketsStorageKey, type MarketsStore, 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, type StatusInfo, StatusProvider, type SymbolInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletConnectorContextState, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, fetcher, type filteredChains$1 as filteredChains, findPositionTPSLFromOrders, findTPSLFromOrder, findTPSLOrderPriceFromOrder, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useAudioPlayer, useBalanceSubscription, useBalanceTopic, useBoolean, useChain, useChains, useCheckReferralCode, useCollateral, useCommission, useComputedLTV, useConfig, useConvert, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFundingDetails, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useFundingRatesStore, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useIndexPricesStream, useInfiniteQuery, useInternalTransfer, useKeyStore, useLazyQuery, useLeverage, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketList, useMarketMap, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, useOrderlyContext, usePositionActions, usePositionClose, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSubAccountDataObserver, useSubAccountMaxWithdrawal, useSubAccountMutation, useSubAccountQuery, useSubAccountWS, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useSymbolsInfoStore, useTPSLOrder, useTickerStream, useTokenInfo, useTokensInfo, useTrack, useTrackingInstance, useTradingRewardsStatus, useTransfer, useTransferHistory, useUpdatedRef, useVaultsHistory, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWalletTopic, 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.6.
|
|
64
|
+
window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.6.1";
|
|
65
65
|
}
|
|
66
|
-
var version_default = "2.6.
|
|
66
|
+
var version_default = "2.6.1";
|
|
67
67
|
var fetcher = (url, init2 = {}, queryOptions) => net.get(url, init2, queryOptions?.formatter);
|
|
68
68
|
var OrderlyContext = React2.createContext({
|
|
69
69
|
// configStore: new MemoryConfigStore(),
|
|
@@ -3652,11 +3652,13 @@ var useFundingRateHistory = () => {
|
|
|
3652
3652
|
},
|
|
3653
3653
|
[]
|
|
3654
3654
|
);
|
|
3655
|
-
return {
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3655
|
+
return React2.useMemo(() => {
|
|
3656
|
+
return {
|
|
3657
|
+
data: historyData ?? types.EMPTY_LIST,
|
|
3658
|
+
isLoading,
|
|
3659
|
+
getPositiveRates
|
|
3660
|
+
};
|
|
3661
|
+
}, [historyData, isLoading, getPositiveRates]);
|
|
3660
3662
|
};
|
|
3661
3663
|
var findTPSLFromOrder = (order) => {
|
|
3662
3664
|
let tp_trigger_price;
|
|
@@ -3861,11 +3863,6 @@ var usePositionStream = (symbol = "all", options) => {
|
|
|
3861
3863
|
*/
|
|
3862
3864
|
loading: positionStatus.loading,
|
|
3863
3865
|
isLoading: positionStatus.loading
|
|
3864
|
-
// isValidating,
|
|
3865
|
-
// // showSymbol,
|
|
3866
|
-
// error,
|
|
3867
|
-
// // loadMore: () => {},
|
|
3868
|
-
// refresh: refreshPositions,
|
|
3869
3866
|
}
|
|
3870
3867
|
];
|
|
3871
3868
|
};
|
|
@@ -5244,6 +5241,7 @@ var useDeposit = (options) => {
|
|
|
5244
5241
|
fee: depositFee,
|
|
5245
5242
|
decimals: options.decimals,
|
|
5246
5243
|
token: options.srcToken,
|
|
5244
|
+
address: options.address,
|
|
5247
5245
|
vaultAddress
|
|
5248
5246
|
};
|
|
5249
5247
|
const depositPromise = isNativeToken ? account9.assetsManager.depositNativeToken(inputs) : account9.assetsManager.deposit(inputs);
|
|
@@ -5482,6 +5480,30 @@ var useTransfer = (options) => {
|
|
|
5482
5480
|
holding
|
|
5483
5481
|
};
|
|
5484
5482
|
};
|
|
5483
|
+
var useInternalTransfer = () => {
|
|
5484
|
+
const [submitting, setSubmitting] = React2.useState(false);
|
|
5485
|
+
const { account: account9 } = useAccount();
|
|
5486
|
+
const transfer = React2.useCallback(
|
|
5487
|
+
async (inputs) => {
|
|
5488
|
+
setSubmitting(true);
|
|
5489
|
+
return account9.assetsManager.internalTransfer(inputs).then((res) => {
|
|
5490
|
+
if (res.success) {
|
|
5491
|
+
return res;
|
|
5492
|
+
}
|
|
5493
|
+
throw res;
|
|
5494
|
+
}).catch((err) => {
|
|
5495
|
+
throw err;
|
|
5496
|
+
}).finally(() => {
|
|
5497
|
+
setSubmitting(false);
|
|
5498
|
+
});
|
|
5499
|
+
},
|
|
5500
|
+
[account9]
|
|
5501
|
+
);
|
|
5502
|
+
return {
|
|
5503
|
+
submitting,
|
|
5504
|
+
transfer
|
|
5505
|
+
};
|
|
5506
|
+
};
|
|
5485
5507
|
var useWalletSubscription = (options) => {
|
|
5486
5508
|
const ws = useWS();
|
|
5487
5509
|
const { state } = useAccount();
|
|
@@ -6228,7 +6250,7 @@ async function bracketOrderValidator(values2, config) {
|
|
|
6228
6250
|
);
|
|
6229
6251
|
}
|
|
6230
6252
|
if (Number(tp_trigger_price) > Number(tp_order_price)) {
|
|
6231
|
-
result.tp_trigger_price = OrderValidation.
|
|
6253
|
+
result.tp_trigger_price = OrderValidation.priceErrorMax("tp_trigger_price");
|
|
6232
6254
|
}
|
|
6233
6255
|
}
|
|
6234
6256
|
}
|
|
@@ -8454,13 +8476,10 @@ var useAssetsHistory = (options, config) => {
|
|
|
8454
8476
|
ee.off("wallet:changed", updateList);
|
|
8455
8477
|
};
|
|
8456
8478
|
}, []);
|
|
8457
|
-
return
|
|
8458
|
-
data?.rows
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
isLoading
|
|
8462
|
-
}
|
|
8463
|
-
];
|
|
8479
|
+
return React2.useMemo(
|
|
8480
|
+
() => [data?.rows ?? types.EMPTY_LIST, { meta: data?.meta, isLoading }],
|
|
8481
|
+
[data?.rows, data?.meta, isLoading]
|
|
8482
|
+
);
|
|
8464
8483
|
};
|
|
8465
8484
|
var useStatisticsDaily = (params, options) => {
|
|
8466
8485
|
const { startDate, endDate, page = 1 } = params;
|
|
@@ -8512,15 +8531,13 @@ var useStatisticsDaily = (params, options) => {
|
|
|
8512
8531
|
}
|
|
8513
8532
|
return { vol: vol.toNumber(), pnl: pnl.toNumber(), roi: roi.toNumber() };
|
|
8514
8533
|
}, [data]);
|
|
8515
|
-
return
|
|
8516
|
-
data
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
}
|
|
8520
|
-
];
|
|
8534
|
+
return React2.useMemo(
|
|
8535
|
+
() => [data ?? types.EMPTY_LIST, { aggregateValue }],
|
|
8536
|
+
[data, aggregateValue]
|
|
8537
|
+
);
|
|
8521
8538
|
};
|
|
8522
8539
|
var useFundingFeeHistory = (params, options) => {
|
|
8523
|
-
|
|
8540
|
+
const { symbol, dataRange, page = 1, pageSize = 10 } = params;
|
|
8524
8541
|
const infos = useSymbolsInfo();
|
|
8525
8542
|
const getKey = () => {
|
|
8526
8543
|
const search = new URLSearchParams();
|
|
@@ -8555,14 +8572,10 @@ var useFundingFeeHistory = (params, options) => {
|
|
|
8555
8572
|
};
|
|
8556
8573
|
});
|
|
8557
8574
|
}, [data, infos]);
|
|
8558
|
-
return
|
|
8559
|
-
parsedData,
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
isLoading,
|
|
8563
|
-
isValidating
|
|
8564
|
-
}
|
|
8565
|
-
];
|
|
8575
|
+
return React2.useMemo(
|
|
8576
|
+
() => [parsedData, { meta: data?.meta, isLoading, isValidating }],
|
|
8577
|
+
[parsedData, data?.meta, isLoading, isValidating]
|
|
8578
|
+
);
|
|
8566
8579
|
};
|
|
8567
8580
|
var useDistributionHistory = (parmas) => {
|
|
8568
8581
|
const { type, dataRange, page, pageSize } = parmas;
|
|
@@ -8598,12 +8611,18 @@ var useDistributionHistory = (parmas) => {
|
|
|
8598
8611
|
};
|
|
8599
8612
|
});
|
|
8600
8613
|
}, [data, infos]);
|
|
8601
|
-
return
|
|
8614
|
+
return React2.useMemo(
|
|
8615
|
+
() => [
|
|
8616
|
+
parsedData ?? types.EMPTY_LIST,
|
|
8617
|
+
{ meta: data?.meta, isLoading, isValidating }
|
|
8618
|
+
],
|
|
8619
|
+
[parsedData, data?.meta, isLoading, isValidating]
|
|
8620
|
+
);
|
|
8602
8621
|
};
|
|
8603
8622
|
var useTransferHistory = (parmas) => {
|
|
8604
8623
|
const { dataRange, page, size, side, fromId, toId, main_sub_only } = parmas;
|
|
8605
8624
|
const infos = useSymbolsInfo();
|
|
8606
|
-
const memoizedQueryKey =
|
|
8625
|
+
const memoizedQueryKey = React2.useMemo(() => {
|
|
8607
8626
|
const search = new URLSearchParams();
|
|
8608
8627
|
search.set("page", page.toString());
|
|
8609
8628
|
search.set("size", size.toString());
|
|
@@ -8626,13 +8645,51 @@ var useTransferHistory = (parmas) => {
|
|
|
8626
8645
|
errorRetryCount: 3
|
|
8627
8646
|
}
|
|
8628
8647
|
);
|
|
8648
|
+
const parsedData = React2.useMemo(() => {
|
|
8649
|
+
if (!Array.isArray(data?.rows) || !data?.rows.length || infos.isNil) {
|
|
8650
|
+
return [];
|
|
8651
|
+
}
|
|
8652
|
+
return data.rows;
|
|
8653
|
+
}, [data, infos]);
|
|
8654
|
+
return React2.useMemo(
|
|
8655
|
+
() => [
|
|
8656
|
+
parsedData ?? types.EMPTY_LIST,
|
|
8657
|
+
{ meta: data?.meta, isLoading, mutate: mutate5 }
|
|
8658
|
+
],
|
|
8659
|
+
[parsedData, data?.meta, isLoading, mutate5]
|
|
8660
|
+
);
|
|
8661
|
+
};
|
|
8662
|
+
var useVaultsHistory = (parmas) => {
|
|
8663
|
+
const { dataRange, page, size } = parmas;
|
|
8664
|
+
const infos = useSymbolsInfo();
|
|
8665
|
+
const memoizedQueryKey = React2__default.default.useMemo(() => {
|
|
8666
|
+
const search = new URLSearchParams();
|
|
8667
|
+
search.set("page", page.toString());
|
|
8668
|
+
search.set("size", size.toString());
|
|
8669
|
+
if (dataRange) {
|
|
8670
|
+
search.set("start_t", dataRange[0].toString());
|
|
8671
|
+
search.set("end_t", dataRange[1].toString());
|
|
8672
|
+
}
|
|
8673
|
+
return `/v1/account_sv_transaction_history?${search.toString()}`;
|
|
8674
|
+
}, [page, size, dataRange]);
|
|
8675
|
+
const { data, isLoading, mutate: mutate5 } = usePrivateQuery(
|
|
8676
|
+
memoizedQueryKey,
|
|
8677
|
+
{
|
|
8678
|
+
formatter: (data2) => data2,
|
|
8679
|
+
revalidateOnFocus: false,
|
|
8680
|
+
errorRetryCount: 3
|
|
8681
|
+
}
|
|
8682
|
+
);
|
|
8629
8683
|
const parsedData = React2__default.default.useMemo(() => {
|
|
8630
8684
|
if (!Array.isArray(data?.rows) || !data?.rows.length || infos.isNil) {
|
|
8631
8685
|
return [];
|
|
8632
8686
|
}
|
|
8633
8687
|
return data.rows;
|
|
8634
8688
|
}, [data, infos]);
|
|
8635
|
-
return
|
|
8689
|
+
return React2.useMemo(
|
|
8690
|
+
() => [parsedData ?? types.EMPTY_LIST, { meta: data?.meta, isLoading, mutate: mutate5 }],
|
|
8691
|
+
[parsedData, data?.meta, isLoading, mutate5]
|
|
8692
|
+
);
|
|
8636
8693
|
};
|
|
8637
8694
|
var MaintenanceStatus = /* @__PURE__ */ ((MaintenanceStatus2) => {
|
|
8638
8695
|
MaintenanceStatus2[MaintenanceStatus2["None"] = 0] = "None";
|
|
@@ -17356,6 +17413,7 @@ exports.useHoldingStream = useHoldingStream;
|
|
|
17356
17413
|
exports.useIndexPrice = useIndexPrice;
|
|
17357
17414
|
exports.useIndexPricesStream = useIndexPricesStream;
|
|
17358
17415
|
exports.useInfiniteQuery = useInfiniteQuery;
|
|
17416
|
+
exports.useInternalTransfer = useInternalTransfer;
|
|
17359
17417
|
exports.useKeyStore = useKeyStore;
|
|
17360
17418
|
exports.useLazyQuery = useLazyQuery;
|
|
17361
17419
|
exports.useLeverage = useLeverage;
|
|
@@ -17425,6 +17483,7 @@ exports.useTradingRewardsStatus = useTradingRewardsStatus;
|
|
|
17425
17483
|
exports.useTransfer = useTransfer;
|
|
17426
17484
|
exports.useTransferHistory = useTransferHistory;
|
|
17427
17485
|
exports.useUpdatedRef = useUpdatedRef;
|
|
17486
|
+
exports.useVaultsHistory = useVaultsHistory;
|
|
17428
17487
|
exports.useWS = useWS;
|
|
17429
17488
|
exports.useWalletConnector = useWalletConnector;
|
|
17430
17489
|
exports.useWalletRewardsHistory = useWalletRewardsHistory;
|