@orderly.network/hooks 2.5.3-alpha.0 → 2.5.3

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 CHANGED
@@ -6,16 +6,16 @@ import * as swr_mutation from 'swr/mutation';
6
6
  import { SWRMutationConfiguration, SWRMutationResponse } from 'swr/mutation';
7
7
  import * as swr_infinite from 'swr/infinite';
8
8
  import { SWRInfiniteKeyLoader, SWRInfiniteConfiguration } from 'swr/infinite';
9
+ import * as react from 'react';
10
+ import { PropsWithChildren, FC, ReactNode } from 'react';
9
11
  import * as _orderly_network_types from '@orderly.network/types';
10
- import { NetworkId, TrackerEventName, API, Chain as Chain$1, ChainNamespace, WSMessage, OrderStatus, OrderSide, AlgoOrderRootType, OrderEntity, OrderlyOrder, OrderType, AlgoOrderEntity, AlgoOrderType, RequireKeys } from '@orderly.network/types';
12
+ import { NetworkId, TrackerEventName, API, Chain as Chain$1, ChainNamespace, WSMessage, OrderStatus, OrderSide, AlgoOrderRootType, OrderEntity, OrderlyOrder, OrderType, AlgoOrderEntity, AssetHistoryStatusEnum, AlgoOrderType, RequireKeys } from '@orderly.network/types';
11
13
  import * as _orderly_network_core from '@orderly.network/core';
12
14
  import { AccountState, Account, EventEmitter, ConfigStore, ConfigKey, SimpleDI, OrderlyKeyStore, WalletAdapter, IContract, DefaultConfigStore } from '@orderly.network/core';
13
15
  export { SubAccount, WalletAdapter } from '@orderly.network/core';
14
16
  import * as lodash from 'lodash';
15
17
  export { default as useConstant } from 'use-constant';
16
18
  import { WS } from '@orderly.network/net';
17
- import * as react from 'react';
18
- import { PropsWithChildren, FC, ReactNode } from 'react';
19
19
  import { EIP1193Provider } from '@web3-onboard/common';
20
20
  import { SolanaWalletProvider } from '@orderly.network/default-solana-adapter';
21
21
  import * as swr_subscription from 'swr/subscription';
@@ -32,7 +32,7 @@ declare global {
32
32
  };
33
33
  }
34
34
  }
35
- declare const _default: "2.5.3-alpha.0";
35
+ declare const _default: "2.5.3";
36
36
 
37
37
  declare const fetcher: (url: string, init: RequestInit | undefined, queryOptions: useQueryOptions<any>) => Promise<any>;
38
38
  type useQueryOptions<T> = SWRConfiguration & {
@@ -107,6 +107,9 @@ declare const useBoolean: (initialValue?: boolean) => [boolean, {
107
107
  toggle: () => void;
108
108
  }];
109
109
 
110
+ type NotFunction<T> = T extends (...args: any[]) => any ? never : T;
111
+ declare const useUpdatedRef: <T>(val: NotFunction<T>) => react.MutableRefObject<T>;
112
+
110
113
  type noop = (this: any, ...args: any[]) => any;
111
114
  type PickFunction<T extends noop> = (this: ThisParameterType<T>, ...args: Parameters<T>) => ReturnType<T>;
112
115
  declare const useMemoizedFn: <T extends noop>(fn: T) => PickFunction<T>;
@@ -250,6 +253,12 @@ interface OrderlyConfigContextState {
250
253
  * Custom orderbook default tick sizes.
251
254
  */
252
255
  defaultOrderbookTickSizes: Record<string, string>;
256
+ dataAdapter?: {
257
+ /**
258
+ * Custom `/v1/public/futures` response data.
259
+ */
260
+ symbolList?: (originalVal: API.MarketInfoExt[]) => any[];
261
+ };
253
262
  }
254
263
  declare const OrderlyContext: react.Context<OrderlyConfigContextState>;
255
264
  declare const OrderlyProvider: react.Provider<OrderlyConfigContextState>;
@@ -281,7 +290,7 @@ type BaseConfigProviderProps = {
281
290
  * Custom orderbook default tick sizes.
282
291
  */
283
292
  orderbookDefaultTickSizes?: Record<string, string>;
284
- } & Pick<OrderlyConfigContextState, "enableSwapDeposit" | "customChains" | "chainTransformer">;
293
+ } & Pick<OrderlyConfigContextState, "enableSwapDeposit" | "customChains" | "chainTransformer" | "dataAdapter">;
285
294
  type ExclusiveConfigProviderProps = {
286
295
  brokerId: string;
287
296
  brokerName?: string;
@@ -542,6 +551,7 @@ declare const useMarkPricesStream: () => {
542
551
 
543
552
  declare const useIndexPricesStream: () => {
544
553
  data: Record<string, number>;
554
+ getIndexPrice: (this: unknown, token: string) => number;
545
555
  };
546
556
 
547
557
  declare const useMarkPrice: (symbol: string) => {
@@ -973,6 +983,18 @@ declare const useWalletSubscription: (options?: {
973
983
  onMessage?: (data: any) => void;
974
984
  }) => swr_subscription.SWRSubscriptionResponse<any, any>;
975
985
 
986
+ declare const useBalanceSubscription: (options?: {
987
+ onMessage?: (data: any) => void;
988
+ }) => swr_subscription.SWRSubscriptionResponse<any, any>;
989
+
990
+ declare const useWalletTopic: (options: {
991
+ onMessage: (data: any) => void;
992
+ }) => void;
993
+
994
+ declare const useBalanceTopic: (options: {
995
+ onMessage: (data: any) => void;
996
+ }) => void;
997
+
976
998
  declare const useSettleSubscription: (options?: {
977
999
  onMessage?: (data: any) => void;
978
1000
  }) => swr_subscription.SWRSubscriptionResponse<any, any>;
@@ -1115,24 +1137,29 @@ position: Partial<API.PositionTPSLExt> & Pick<API.PositionTPSLExt, "symbol" | "a
1115
1137
  */
1116
1138
  declare const useSymbolLeverage: (symbol: string) => number | "-";
1117
1139
 
1118
- /**
1119
- * @deprecated use @orderly.network/types AssetHistoryStatusEnum
1120
- */
1121
- declare enum AssetHistoryStatusEnum {
1122
- NEW = "NEW",
1123
- CONFIRM = "CONFIRM",
1124
- PROCESSING = "PROCESSING",
1125
- COMPLETED = "COMPLETED",
1126
- FAILED = "FAILED",
1127
- PENDING_REBALANCE = "PENDING_REBALANCE"
1128
- }
1129
- declare const useAssetsHistory: (options: {
1140
+ type AssetHistoryOptions = {
1141
+ /** token name you want to search */
1142
+ token?: string;
1143
+ /** DEPOSIT、WITHDRAW, all */
1130
1144
  side?: string;
1131
- startTime?: string;
1132
- endTime?: string;
1145
+ status?: AssetHistoryStatusEnum;
1146
+ /** start time in milliseconds */
1147
+ startTime?: number;
1148
+ /** end time in milliseconds */
1149
+ endTime?: number;
1133
1150
  page?: number;
1134
1151
  pageSize?: number;
1135
- }) => readonly [API.AssetHistoryRow[], {
1152
+ };
1153
+ /**
1154
+ * Get asset history, including token deposits/withdrawals.
1155
+ * https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/private/get-asset-history#get-asset-history
1156
+ */
1157
+ declare const useAssetsHistory: (options: AssetHistoryOptions, config?: {
1158
+ /**
1159
+ * should update when wallet changed, default is update
1160
+ */
1161
+ shouldUpdateOnWalletChanged?: (data: any) => boolean;
1162
+ }) => readonly [any[], {
1136
1163
  readonly meta: API.RecordsMeta | undefined;
1137
1164
  readonly isLoading: boolean;
1138
1165
  }];
@@ -1217,6 +1244,7 @@ interface TransferHistorySearchParams {
1217
1244
  declare const useTransferHistory: (parmas: TransferHistorySearchParams) => readonly [API.TransferHistoryRow[], {
1218
1245
  readonly meta: API.RecordsMeta | undefined;
1219
1246
  readonly isLoading: boolean;
1247
+ readonly mutate: swr.KeyedMutator<API.TransferHistory>;
1220
1248
  }];
1221
1249
 
1222
1250
  /** 0 for nothing, 2 for maintenance */
@@ -1530,6 +1558,7 @@ declare function calcTPSL_ROI(inputs: {
1530
1558
 
1531
1559
  declare const index_calcTPSL_ROI: typeof calcTPSL_ROI;
1532
1560
  declare const index_cleanStringStyle: typeof cleanStringStyle;
1561
+ declare const index_fetcher: typeof fetcher;
1533
1562
  declare const index_findPositionTPSLFromOrders: typeof findPositionTPSLFromOrders;
1534
1563
  declare const index_findTPSLFromOrder: typeof findTPSLFromOrder;
1535
1564
  declare const index_findTPSLFromOrders: typeof findTPSLFromOrders;
@@ -1537,7 +1566,7 @@ declare const index_formatNumber: typeof formatNumber;
1537
1566
  declare const index_getPositionBySymbol: typeof getPositionBySymbol;
1538
1567
  declare const index_priceToPnl: typeof priceToPnl;
1539
1568
  declare namespace index {
1540
- export { index_calcTPSL_ROI as calcTPSL_ROI, index_cleanStringStyle as cleanStringStyle, index_findPositionTPSLFromOrders as findPositionTPSLFromOrders, index_findTPSLFromOrder as findTPSLFromOrder, index_findTPSLFromOrders as findTPSLFromOrders, index_formatNumber as formatNumber, index_getPositionBySymbol as getPositionBySymbol, index_priceToPnl as priceToPnl };
1569
+ export { index_calcTPSL_ROI as calcTPSL_ROI, index_cleanStringStyle as cleanStringStyle, index_fetcher as fetcher, index_findPositionTPSLFromOrders as findPositionTPSLFromOrders, index_findTPSLFromOrder as findTPSLFromOrder, index_findTPSLFromOrders as findTPSLFromOrders, index_formatNumber as formatNumber, index_getPositionBySymbol as getPositionBySymbol, index_priceToPnl as priceToPnl };
1541
1570
  }
1542
1571
 
1543
1572
  declare const useCommission: (options?: {
@@ -2107,6 +2136,7 @@ interface RestrictedInfoOptions {
2107
2136
  enableDefault?: boolean;
2108
2137
  customRestrictedIps?: string[];
2109
2138
  customRestrictedRegions?: string[];
2139
+ customUnblockRegions?: string[];
2110
2140
  content?: ReactNode | ((data: {
2111
2141
  ip: string;
2112
2142
  brokerName: string;
@@ -2189,7 +2219,7 @@ declare const useSubAccountWS: (options: Options) => WS;
2189
2219
  declare function useSubAccountMaxWithdrawal(options: {
2190
2220
  token?: string;
2191
2221
  unsettledPnL?: number;
2192
- freeCollateral: number;
2222
+ freeCollateral: Decimal;
2193
2223
  holdings?: API.Holding[];
2194
2224
  }): number;
2195
2225
 
@@ -2210,4 +2240,4 @@ declare const usePositionClose: (options: PositionCloseOptions) => {
2210
2240
  calculate: typeof calculate;
2211
2241
  };
2212
2242
 
2213
- 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, 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, StatusContext, type StatusContextState, type StatusInfo, 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, fetcher, type filteredChains$1 as filteredChains, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, 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, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, 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, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWithdraw, useWsStatus, index as utils, _default as version };
2243
+ 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, StatusContext, type StatusContextState, type StatusInfo, 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, fetcher, type filteredChains$1 as filteredChains, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, 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, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, 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 };
package/dist/index.d.ts CHANGED
@@ -6,16 +6,16 @@ import * as swr_mutation from 'swr/mutation';
6
6
  import { SWRMutationConfiguration, SWRMutationResponse } from 'swr/mutation';
7
7
  import * as swr_infinite from 'swr/infinite';
8
8
  import { SWRInfiniteKeyLoader, SWRInfiniteConfiguration } from 'swr/infinite';
9
+ import * as react from 'react';
10
+ import { PropsWithChildren, FC, ReactNode } from 'react';
9
11
  import * as _orderly_network_types from '@orderly.network/types';
10
- import { NetworkId, TrackerEventName, API, Chain as Chain$1, ChainNamespace, WSMessage, OrderStatus, OrderSide, AlgoOrderRootType, OrderEntity, OrderlyOrder, OrderType, AlgoOrderEntity, AlgoOrderType, RequireKeys } from '@orderly.network/types';
12
+ import { NetworkId, TrackerEventName, API, Chain as Chain$1, ChainNamespace, WSMessage, OrderStatus, OrderSide, AlgoOrderRootType, OrderEntity, OrderlyOrder, OrderType, AlgoOrderEntity, AssetHistoryStatusEnum, AlgoOrderType, RequireKeys } from '@orderly.network/types';
11
13
  import * as _orderly_network_core from '@orderly.network/core';
12
14
  import { AccountState, Account, EventEmitter, ConfigStore, ConfigKey, SimpleDI, OrderlyKeyStore, WalletAdapter, IContract, DefaultConfigStore } from '@orderly.network/core';
13
15
  export { SubAccount, WalletAdapter } from '@orderly.network/core';
14
16
  import * as lodash from 'lodash';
15
17
  export { default as useConstant } from 'use-constant';
16
18
  import { WS } from '@orderly.network/net';
17
- import * as react from 'react';
18
- import { PropsWithChildren, FC, ReactNode } from 'react';
19
19
  import { EIP1193Provider } from '@web3-onboard/common';
20
20
  import { SolanaWalletProvider } from '@orderly.network/default-solana-adapter';
21
21
  import * as swr_subscription from 'swr/subscription';
@@ -32,7 +32,7 @@ declare global {
32
32
  };
33
33
  }
34
34
  }
35
- declare const _default: "2.5.3-alpha.0";
35
+ declare const _default: "2.5.3";
36
36
 
37
37
  declare const fetcher: (url: string, init: RequestInit | undefined, queryOptions: useQueryOptions<any>) => Promise<any>;
38
38
  type useQueryOptions<T> = SWRConfiguration & {
@@ -107,6 +107,9 @@ declare const useBoolean: (initialValue?: boolean) => [boolean, {
107
107
  toggle: () => void;
108
108
  }];
109
109
 
110
+ type NotFunction<T> = T extends (...args: any[]) => any ? never : T;
111
+ declare const useUpdatedRef: <T>(val: NotFunction<T>) => react.MutableRefObject<T>;
112
+
110
113
  type noop = (this: any, ...args: any[]) => any;
111
114
  type PickFunction<T extends noop> = (this: ThisParameterType<T>, ...args: Parameters<T>) => ReturnType<T>;
112
115
  declare const useMemoizedFn: <T extends noop>(fn: T) => PickFunction<T>;
@@ -250,6 +253,12 @@ interface OrderlyConfigContextState {
250
253
  * Custom orderbook default tick sizes.
251
254
  */
252
255
  defaultOrderbookTickSizes: Record<string, string>;
256
+ dataAdapter?: {
257
+ /**
258
+ * Custom `/v1/public/futures` response data.
259
+ */
260
+ symbolList?: (originalVal: API.MarketInfoExt[]) => any[];
261
+ };
253
262
  }
254
263
  declare const OrderlyContext: react.Context<OrderlyConfigContextState>;
255
264
  declare const OrderlyProvider: react.Provider<OrderlyConfigContextState>;
@@ -281,7 +290,7 @@ type BaseConfigProviderProps = {
281
290
  * Custom orderbook default tick sizes.
282
291
  */
283
292
  orderbookDefaultTickSizes?: Record<string, string>;
284
- } & Pick<OrderlyConfigContextState, "enableSwapDeposit" | "customChains" | "chainTransformer">;
293
+ } & Pick<OrderlyConfigContextState, "enableSwapDeposit" | "customChains" | "chainTransformer" | "dataAdapter">;
285
294
  type ExclusiveConfigProviderProps = {
286
295
  brokerId: string;
287
296
  brokerName?: string;
@@ -542,6 +551,7 @@ declare const useMarkPricesStream: () => {
542
551
 
543
552
  declare const useIndexPricesStream: () => {
544
553
  data: Record<string, number>;
554
+ getIndexPrice: (this: unknown, token: string) => number;
545
555
  };
546
556
 
547
557
  declare const useMarkPrice: (symbol: string) => {
@@ -973,6 +983,18 @@ declare const useWalletSubscription: (options?: {
973
983
  onMessage?: (data: any) => void;
974
984
  }) => swr_subscription.SWRSubscriptionResponse<any, any>;
975
985
 
986
+ declare const useBalanceSubscription: (options?: {
987
+ onMessage?: (data: any) => void;
988
+ }) => swr_subscription.SWRSubscriptionResponse<any, any>;
989
+
990
+ declare const useWalletTopic: (options: {
991
+ onMessage: (data: any) => void;
992
+ }) => void;
993
+
994
+ declare const useBalanceTopic: (options: {
995
+ onMessage: (data: any) => void;
996
+ }) => void;
997
+
976
998
  declare const useSettleSubscription: (options?: {
977
999
  onMessage?: (data: any) => void;
978
1000
  }) => swr_subscription.SWRSubscriptionResponse<any, any>;
@@ -1115,24 +1137,29 @@ position: Partial<API.PositionTPSLExt> & Pick<API.PositionTPSLExt, "symbol" | "a
1115
1137
  */
1116
1138
  declare const useSymbolLeverage: (symbol: string) => number | "-";
1117
1139
 
1118
- /**
1119
- * @deprecated use @orderly.network/types AssetHistoryStatusEnum
1120
- */
1121
- declare enum AssetHistoryStatusEnum {
1122
- NEW = "NEW",
1123
- CONFIRM = "CONFIRM",
1124
- PROCESSING = "PROCESSING",
1125
- COMPLETED = "COMPLETED",
1126
- FAILED = "FAILED",
1127
- PENDING_REBALANCE = "PENDING_REBALANCE"
1128
- }
1129
- declare const useAssetsHistory: (options: {
1140
+ type AssetHistoryOptions = {
1141
+ /** token name you want to search */
1142
+ token?: string;
1143
+ /** DEPOSIT、WITHDRAW, all */
1130
1144
  side?: string;
1131
- startTime?: string;
1132
- endTime?: string;
1145
+ status?: AssetHistoryStatusEnum;
1146
+ /** start time in milliseconds */
1147
+ startTime?: number;
1148
+ /** end time in milliseconds */
1149
+ endTime?: number;
1133
1150
  page?: number;
1134
1151
  pageSize?: number;
1135
- }) => readonly [API.AssetHistoryRow[], {
1152
+ };
1153
+ /**
1154
+ * Get asset history, including token deposits/withdrawals.
1155
+ * https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/private/get-asset-history#get-asset-history
1156
+ */
1157
+ declare const useAssetsHistory: (options: AssetHistoryOptions, config?: {
1158
+ /**
1159
+ * should update when wallet changed, default is update
1160
+ */
1161
+ shouldUpdateOnWalletChanged?: (data: any) => boolean;
1162
+ }) => readonly [any[], {
1136
1163
  readonly meta: API.RecordsMeta | undefined;
1137
1164
  readonly isLoading: boolean;
1138
1165
  }];
@@ -1217,6 +1244,7 @@ interface TransferHistorySearchParams {
1217
1244
  declare const useTransferHistory: (parmas: TransferHistorySearchParams) => readonly [API.TransferHistoryRow[], {
1218
1245
  readonly meta: API.RecordsMeta | undefined;
1219
1246
  readonly isLoading: boolean;
1247
+ readonly mutate: swr.KeyedMutator<API.TransferHistory>;
1220
1248
  }];
1221
1249
 
1222
1250
  /** 0 for nothing, 2 for maintenance */
@@ -1530,6 +1558,7 @@ declare function calcTPSL_ROI(inputs: {
1530
1558
 
1531
1559
  declare const index_calcTPSL_ROI: typeof calcTPSL_ROI;
1532
1560
  declare const index_cleanStringStyle: typeof cleanStringStyle;
1561
+ declare const index_fetcher: typeof fetcher;
1533
1562
  declare const index_findPositionTPSLFromOrders: typeof findPositionTPSLFromOrders;
1534
1563
  declare const index_findTPSLFromOrder: typeof findTPSLFromOrder;
1535
1564
  declare const index_findTPSLFromOrders: typeof findTPSLFromOrders;
@@ -1537,7 +1566,7 @@ declare const index_formatNumber: typeof formatNumber;
1537
1566
  declare const index_getPositionBySymbol: typeof getPositionBySymbol;
1538
1567
  declare const index_priceToPnl: typeof priceToPnl;
1539
1568
  declare namespace index {
1540
- export { index_calcTPSL_ROI as calcTPSL_ROI, index_cleanStringStyle as cleanStringStyle, index_findPositionTPSLFromOrders as findPositionTPSLFromOrders, index_findTPSLFromOrder as findTPSLFromOrder, index_findTPSLFromOrders as findTPSLFromOrders, index_formatNumber as formatNumber, index_getPositionBySymbol as getPositionBySymbol, index_priceToPnl as priceToPnl };
1569
+ export { index_calcTPSL_ROI as calcTPSL_ROI, index_cleanStringStyle as cleanStringStyle, index_fetcher as fetcher, index_findPositionTPSLFromOrders as findPositionTPSLFromOrders, index_findTPSLFromOrder as findTPSLFromOrder, index_findTPSLFromOrders as findTPSLFromOrders, index_formatNumber as formatNumber, index_getPositionBySymbol as getPositionBySymbol, index_priceToPnl as priceToPnl };
1541
1570
  }
1542
1571
 
1543
1572
  declare const useCommission: (options?: {
@@ -2107,6 +2136,7 @@ interface RestrictedInfoOptions {
2107
2136
  enableDefault?: boolean;
2108
2137
  customRestrictedIps?: string[];
2109
2138
  customRestrictedRegions?: string[];
2139
+ customUnblockRegions?: string[];
2110
2140
  content?: ReactNode | ((data: {
2111
2141
  ip: string;
2112
2142
  brokerName: string;
@@ -2189,7 +2219,7 @@ declare const useSubAccountWS: (options: Options) => WS;
2189
2219
  declare function useSubAccountMaxWithdrawal(options: {
2190
2220
  token?: string;
2191
2221
  unsettledPnL?: number;
2192
- freeCollateral: number;
2222
+ freeCollateral: Decimal;
2193
2223
  holdings?: API.Holding[];
2194
2224
  }): number;
2195
2225
 
@@ -2210,4 +2240,4 @@ declare const usePositionClose: (options: PositionCloseOptions) => {
2210
2240
  calculate: typeof calculate;
2211
2241
  };
2212
2242
 
2213
- 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, 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, StatusContext, type StatusContextState, type StatusInfo, 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, fetcher, type filteredChains$1 as filteredChains, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, 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, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, 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, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWithdraw, useWsStatus, index as utils, _default as version };
2243
+ 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, StatusContext, type StatusContextState, type StatusInfo, 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, fetcher, type filteredChains$1 as filteredChains, getMinNotional, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, 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, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxQty, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, 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 };