@orderly.network/hooks 2.5.2 → 2.5.3-alpha.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 +57 -28
- package/dist/index.d.ts +57 -28
- package/dist/index.js +283 -130
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +281 -131
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
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.
|
|
35
|
+
declare const _default: "2.5.3-alpha.1";
|
|
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) => {
|
|
@@ -866,13 +876,13 @@ declare const useChain: (token: string) => {
|
|
|
866
876
|
isLoading: boolean;
|
|
867
877
|
};
|
|
868
878
|
|
|
869
|
-
type UseWithdrawOptions
|
|
879
|
+
type UseWithdrawOptions = {
|
|
870
880
|
srcChainId?: number;
|
|
871
881
|
token?: string;
|
|
872
882
|
/** orderly token decimals */
|
|
873
883
|
decimals?: number;
|
|
874
884
|
};
|
|
875
|
-
declare const useWithdraw: (options: UseWithdrawOptions
|
|
885
|
+
declare const useWithdraw: (options: UseWithdrawOptions) => {
|
|
876
886
|
dst: {
|
|
877
887
|
symbol: string;
|
|
878
888
|
decimals: number;
|
|
@@ -886,7 +896,6 @@ declare const useWithdraw: (options: UseWithdrawOptions$1) => {
|
|
|
886
896
|
amount: string;
|
|
887
897
|
allowCrossChainWithdraw: boolean;
|
|
888
898
|
}) => Promise<any>;
|
|
889
|
-
isLoading: boolean;
|
|
890
899
|
maxAmount: number;
|
|
891
900
|
unsettledPnL: number;
|
|
892
901
|
availableBalance: number;
|
|
@@ -936,10 +945,10 @@ declare const useDeposit: (options: DepositOptions) => {
|
|
|
936
945
|
setQuantity: react.Dispatch<react.SetStateAction<string>>;
|
|
937
946
|
};
|
|
938
947
|
|
|
939
|
-
interface
|
|
948
|
+
interface ConvertOptions {
|
|
940
949
|
token?: string;
|
|
941
950
|
}
|
|
942
|
-
declare const useConvert: (options:
|
|
951
|
+
declare const useConvert: (options: ConvertOptions) => {
|
|
943
952
|
maxAmount: number;
|
|
944
953
|
convert: (inputs: {
|
|
945
954
|
amount: number;
|
|
@@ -974,6 +983,18 @@ declare const useWalletSubscription: (options?: {
|
|
|
974
983
|
onMessage?: (data: any) => void;
|
|
975
984
|
}) => swr_subscription.SWRSubscriptionResponse<any, any>;
|
|
976
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
|
+
|
|
977
998
|
declare const useSettleSubscription: (options?: {
|
|
978
999
|
onMessage?: (data: any) => void;
|
|
979
1000
|
}) => swr_subscription.SWRSubscriptionResponse<any, any>;
|
|
@@ -1116,24 +1137,29 @@ position: Partial<API.PositionTPSLExt> & Pick<API.PositionTPSLExt, "symbol" | "a
|
|
|
1116
1137
|
*/
|
|
1117
1138
|
declare const useSymbolLeverage: (symbol: string) => number | "-";
|
|
1118
1139
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
NEW = "NEW",
|
|
1124
|
-
CONFIRM = "CONFIRM",
|
|
1125
|
-
PROCESSING = "PROCESSING",
|
|
1126
|
-
COMPLETED = "COMPLETED",
|
|
1127
|
-
FAILED = "FAILED",
|
|
1128
|
-
PENDING_REBALANCE = "PENDING_REBALANCE"
|
|
1129
|
-
}
|
|
1130
|
-
declare const useAssetsHistory: (options: {
|
|
1140
|
+
type AssetHistoryOptions = {
|
|
1141
|
+
/** token name you want to search */
|
|
1142
|
+
token?: string;
|
|
1143
|
+
/** DEPOSIT、WITHDRAW, all */
|
|
1131
1144
|
side?: string;
|
|
1132
|
-
|
|
1133
|
-
|
|
1145
|
+
status?: AssetHistoryStatusEnum;
|
|
1146
|
+
/** start time in milliseconds */
|
|
1147
|
+
startTime?: number;
|
|
1148
|
+
/** end time in milliseconds */
|
|
1149
|
+
endTime?: number;
|
|
1134
1150
|
page?: number;
|
|
1135
1151
|
pageSize?: number;
|
|
1136
|
-
}
|
|
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[], {
|
|
1137
1163
|
readonly meta: API.RecordsMeta | undefined;
|
|
1138
1164
|
readonly isLoading: boolean;
|
|
1139
1165
|
}];
|
|
@@ -1218,6 +1244,7 @@ interface TransferHistorySearchParams {
|
|
|
1218
1244
|
declare const useTransferHistory: (parmas: TransferHistorySearchParams) => readonly [API.TransferHistoryRow[], {
|
|
1219
1245
|
readonly meta: API.RecordsMeta | undefined;
|
|
1220
1246
|
readonly isLoading: boolean;
|
|
1247
|
+
readonly mutate: swr.KeyedMutator<API.TransferHistory>;
|
|
1221
1248
|
}];
|
|
1222
1249
|
|
|
1223
1250
|
/** 0 for nothing, 2 for maintenance */
|
|
@@ -1531,6 +1558,7 @@ declare function calcTPSL_ROI(inputs: {
|
|
|
1531
1558
|
|
|
1532
1559
|
declare const index_calcTPSL_ROI: typeof calcTPSL_ROI;
|
|
1533
1560
|
declare const index_cleanStringStyle: typeof cleanStringStyle;
|
|
1561
|
+
declare const index_fetcher: typeof fetcher;
|
|
1534
1562
|
declare const index_findPositionTPSLFromOrders: typeof findPositionTPSLFromOrders;
|
|
1535
1563
|
declare const index_findTPSLFromOrder: typeof findTPSLFromOrder;
|
|
1536
1564
|
declare const index_findTPSLFromOrders: typeof findTPSLFromOrders;
|
|
@@ -1538,7 +1566,7 @@ declare const index_formatNumber: typeof formatNumber;
|
|
|
1538
1566
|
declare const index_getPositionBySymbol: typeof getPositionBySymbol;
|
|
1539
1567
|
declare const index_priceToPnl: typeof priceToPnl;
|
|
1540
1568
|
declare namespace index {
|
|
1541
|
-
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 };
|
|
1542
1570
|
}
|
|
1543
1571
|
|
|
1544
1572
|
declare const useCommission: (options?: {
|
|
@@ -2108,6 +2136,7 @@ interface RestrictedInfoOptions {
|
|
|
2108
2136
|
enableDefault?: boolean;
|
|
2109
2137
|
customRestrictedIps?: string[];
|
|
2110
2138
|
customRestrictedRegions?: string[];
|
|
2139
|
+
customUnblockRegions?: string[];
|
|
2111
2140
|
content?: ReactNode | ((data: {
|
|
2112
2141
|
ip: string;
|
|
2113
2142
|
brokerName: string;
|
|
@@ -2190,7 +2219,7 @@ declare const useSubAccountWS: (options: Options) => WS;
|
|
|
2190
2219
|
declare function useSubAccountMaxWithdrawal(options: {
|
|
2191
2220
|
token?: string;
|
|
2192
2221
|
unsettledPnL?: number;
|
|
2193
|
-
freeCollateral:
|
|
2222
|
+
freeCollateral: Decimal;
|
|
2194
2223
|
holdings?: API.Holding[];
|
|
2195
2224
|
}): number;
|
|
2196
2225
|
|
|
@@ -2211,4 +2240,4 @@ declare const usePositionClose: (options: PositionCloseOptions) => {
|
|
|
2211
2240
|
calculate: typeof calculate;
|
|
2212
2241
|
};
|
|
2213
2242
|
|
|
2214
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow,
|
|
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.
|
|
35
|
+
declare const _default: "2.5.3-alpha.1";
|
|
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) => {
|
|
@@ -866,13 +876,13 @@ declare const useChain: (token: string) => {
|
|
|
866
876
|
isLoading: boolean;
|
|
867
877
|
};
|
|
868
878
|
|
|
869
|
-
type UseWithdrawOptions
|
|
879
|
+
type UseWithdrawOptions = {
|
|
870
880
|
srcChainId?: number;
|
|
871
881
|
token?: string;
|
|
872
882
|
/** orderly token decimals */
|
|
873
883
|
decimals?: number;
|
|
874
884
|
};
|
|
875
|
-
declare const useWithdraw: (options: UseWithdrawOptions
|
|
885
|
+
declare const useWithdraw: (options: UseWithdrawOptions) => {
|
|
876
886
|
dst: {
|
|
877
887
|
symbol: string;
|
|
878
888
|
decimals: number;
|
|
@@ -886,7 +896,6 @@ declare const useWithdraw: (options: UseWithdrawOptions$1) => {
|
|
|
886
896
|
amount: string;
|
|
887
897
|
allowCrossChainWithdraw: boolean;
|
|
888
898
|
}) => Promise<any>;
|
|
889
|
-
isLoading: boolean;
|
|
890
899
|
maxAmount: number;
|
|
891
900
|
unsettledPnL: number;
|
|
892
901
|
availableBalance: number;
|
|
@@ -936,10 +945,10 @@ declare const useDeposit: (options: DepositOptions) => {
|
|
|
936
945
|
setQuantity: react.Dispatch<react.SetStateAction<string>>;
|
|
937
946
|
};
|
|
938
947
|
|
|
939
|
-
interface
|
|
948
|
+
interface ConvertOptions {
|
|
940
949
|
token?: string;
|
|
941
950
|
}
|
|
942
|
-
declare const useConvert: (options:
|
|
951
|
+
declare const useConvert: (options: ConvertOptions) => {
|
|
943
952
|
maxAmount: number;
|
|
944
953
|
convert: (inputs: {
|
|
945
954
|
amount: number;
|
|
@@ -974,6 +983,18 @@ declare const useWalletSubscription: (options?: {
|
|
|
974
983
|
onMessage?: (data: any) => void;
|
|
975
984
|
}) => swr_subscription.SWRSubscriptionResponse<any, any>;
|
|
976
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
|
+
|
|
977
998
|
declare const useSettleSubscription: (options?: {
|
|
978
999
|
onMessage?: (data: any) => void;
|
|
979
1000
|
}) => swr_subscription.SWRSubscriptionResponse<any, any>;
|
|
@@ -1116,24 +1137,29 @@ position: Partial<API.PositionTPSLExt> & Pick<API.PositionTPSLExt, "symbol" | "a
|
|
|
1116
1137
|
*/
|
|
1117
1138
|
declare const useSymbolLeverage: (symbol: string) => number | "-";
|
|
1118
1139
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
NEW = "NEW",
|
|
1124
|
-
CONFIRM = "CONFIRM",
|
|
1125
|
-
PROCESSING = "PROCESSING",
|
|
1126
|
-
COMPLETED = "COMPLETED",
|
|
1127
|
-
FAILED = "FAILED",
|
|
1128
|
-
PENDING_REBALANCE = "PENDING_REBALANCE"
|
|
1129
|
-
}
|
|
1130
|
-
declare const useAssetsHistory: (options: {
|
|
1140
|
+
type AssetHistoryOptions = {
|
|
1141
|
+
/** token name you want to search */
|
|
1142
|
+
token?: string;
|
|
1143
|
+
/** DEPOSIT、WITHDRAW, all */
|
|
1131
1144
|
side?: string;
|
|
1132
|
-
|
|
1133
|
-
|
|
1145
|
+
status?: AssetHistoryStatusEnum;
|
|
1146
|
+
/** start time in milliseconds */
|
|
1147
|
+
startTime?: number;
|
|
1148
|
+
/** end time in milliseconds */
|
|
1149
|
+
endTime?: number;
|
|
1134
1150
|
page?: number;
|
|
1135
1151
|
pageSize?: number;
|
|
1136
|
-
}
|
|
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[], {
|
|
1137
1163
|
readonly meta: API.RecordsMeta | undefined;
|
|
1138
1164
|
readonly isLoading: boolean;
|
|
1139
1165
|
}];
|
|
@@ -1218,6 +1244,7 @@ interface TransferHistorySearchParams {
|
|
|
1218
1244
|
declare const useTransferHistory: (parmas: TransferHistorySearchParams) => readonly [API.TransferHistoryRow[], {
|
|
1219
1245
|
readonly meta: API.RecordsMeta | undefined;
|
|
1220
1246
|
readonly isLoading: boolean;
|
|
1247
|
+
readonly mutate: swr.KeyedMutator<API.TransferHistory>;
|
|
1221
1248
|
}];
|
|
1222
1249
|
|
|
1223
1250
|
/** 0 for nothing, 2 for maintenance */
|
|
@@ -1531,6 +1558,7 @@ declare function calcTPSL_ROI(inputs: {
|
|
|
1531
1558
|
|
|
1532
1559
|
declare const index_calcTPSL_ROI: typeof calcTPSL_ROI;
|
|
1533
1560
|
declare const index_cleanStringStyle: typeof cleanStringStyle;
|
|
1561
|
+
declare const index_fetcher: typeof fetcher;
|
|
1534
1562
|
declare const index_findPositionTPSLFromOrders: typeof findPositionTPSLFromOrders;
|
|
1535
1563
|
declare const index_findTPSLFromOrder: typeof findTPSLFromOrder;
|
|
1536
1564
|
declare const index_findTPSLFromOrders: typeof findTPSLFromOrders;
|
|
@@ -1538,7 +1566,7 @@ declare const index_formatNumber: typeof formatNumber;
|
|
|
1538
1566
|
declare const index_getPositionBySymbol: typeof getPositionBySymbol;
|
|
1539
1567
|
declare const index_priceToPnl: typeof priceToPnl;
|
|
1540
1568
|
declare namespace index {
|
|
1541
|
-
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 };
|
|
1542
1570
|
}
|
|
1543
1571
|
|
|
1544
1572
|
declare const useCommission: (options?: {
|
|
@@ -2108,6 +2136,7 @@ interface RestrictedInfoOptions {
|
|
|
2108
2136
|
enableDefault?: boolean;
|
|
2109
2137
|
customRestrictedIps?: string[];
|
|
2110
2138
|
customRestrictedRegions?: string[];
|
|
2139
|
+
customUnblockRegions?: string[];
|
|
2111
2140
|
content?: ReactNode | ((data: {
|
|
2112
2141
|
ip: string;
|
|
2113
2142
|
brokerName: string;
|
|
@@ -2190,7 +2219,7 @@ declare const useSubAccountWS: (options: Options) => WS;
|
|
|
2190
2219
|
declare function useSubAccountMaxWithdrawal(options: {
|
|
2191
2220
|
token?: string;
|
|
2192
2221
|
unsettledPnL?: number;
|
|
2193
|
-
freeCollateral:
|
|
2222
|
+
freeCollateral: Decimal;
|
|
2194
2223
|
holdings?: API.Holding[];
|
|
2195
2224
|
}): number;
|
|
2196
2225
|
|
|
@@ -2211,4 +2240,4 @@ declare const usePositionClose: (options: PositionCloseOptions) => {
|
|
|
2211
2240
|
calculate: typeof calculate;
|
|
2212
2241
|
};
|
|
2213
2242
|
|
|
2214
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow,
|
|
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 };
|