@liberfi.io/react 0.3.12 → 0.3.14
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/README.md +18 -19
- package/dist/index.d.mts +84 -92
- package/dist/index.d.ts +84 -92
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -33,12 +33,12 @@ The consumer must provide:
|
|
|
33
33
|
|
|
34
34
|
Provides the Dex client instances and configuration to all descendant hooks.
|
|
35
35
|
|
|
36
|
-
| Prop | Type
|
|
37
|
-
| ----------------- |
|
|
38
|
-
| `client` | `
|
|
39
|
-
| `subscribeClient` | `
|
|
40
|
-
| `queryKeyPrefix` | `string`
|
|
41
|
-
| `children` | `ReactNode`
|
|
36
|
+
| Prop | Type | Default | Description |
|
|
37
|
+
| ----------------- | ------------------ | ----------- | --------------------------------------- |
|
|
38
|
+
| `client` | `IClient` | (required) | REST/HTTP client instance. |
|
|
39
|
+
| `subscribeClient` | `ISubscribeClient` | (required) | WebSocket subscription client instance. |
|
|
40
|
+
| `queryKeyPrefix` | `string` | `"liberfi"` | Prefix for all TanStack Query keys. |
|
|
41
|
+
| `children` | `ReactNode` | (required) | Child components. |
|
|
42
42
|
|
|
43
43
|
### Hooks — Core
|
|
44
44
|
|
|
@@ -146,12 +146,12 @@ Each subscription hook manages WebSocket lifecycle automatically (subscribe on m
|
|
|
146
146
|
|
|
147
147
|
Creates a `useQuery`-based hook, its `queryKey` builder, and a standalone `fetch` function from a single declarative config.
|
|
148
148
|
|
|
149
|
-
| Config Field | Type
|
|
150
|
-
| ---------------- |
|
|
151
|
-
| `name` | `string`
|
|
152
|
-
| `queryKey` | `(params: TParams) => string[]`
|
|
153
|
-
| `fetch` | `(client:
|
|
154
|
-
| `defaultOptions` | `Partial<Omit<UseQueryOptions, "queryKey" \| "queryFn">>`
|
|
149
|
+
| Config Field | Type | Description |
|
|
150
|
+
| ---------------- | --------------------------------------------------------- | ---------------------------------------------- |
|
|
151
|
+
| `name` | `string` | Key name segment (e.g. `"token"`). |
|
|
152
|
+
| `queryKey` | `(params: TParams) => string[]` | Builds the variable segments of the query key. |
|
|
153
|
+
| `fetch` | `(client: IClient, params: TParams) => Promise<TData>` | Fetches data using the API client. |
|
|
154
|
+
| `defaultOptions` | `Partial<Omit<UseQueryOptions, "queryKey" \| "queryFn">>` | Default options merged below caller options. |
|
|
155
155
|
|
|
156
156
|
Returns `{ queryKey, fetch, useQuery }`.
|
|
157
157
|
|
|
@@ -159,11 +159,11 @@ Returns `{ queryKey, fetch, useQuery }`.
|
|
|
159
159
|
|
|
160
160
|
Creates a `useInfiniteQuery`-based hook and its `queryKey` builder for cursor-paginated endpoints. `TData` must extend `{ hasNext?: boolean; endCursor?: string }`.
|
|
161
161
|
|
|
162
|
-
| Config Field | Type
|
|
163
|
-
| ------------ |
|
|
164
|
-
| `name` | `string`
|
|
165
|
-
| `queryKey` | `(params: TParams) => string[]`
|
|
166
|
-
| `fetch` | `(client:
|
|
162
|
+
| Config Field | Type | Description |
|
|
163
|
+
| ------------ | ----------------------------------------------------------------------------------- | ---------------------------------------------- |
|
|
164
|
+
| `name` | `string` | Key name segment (e.g. `"walletPortfolios"`). |
|
|
165
|
+
| `queryKey` | `(params: TParams) => string[]` | Builds the variable segments of the query key. |
|
|
166
|
+
| `fetch` | `(client: IClient, params: TParams, cursor: string \| undefined) => Promise<TData>` | Fetches a single page of data. |
|
|
167
167
|
|
|
168
168
|
Returns `{ queryKey, useInfiniteQuery }`.
|
|
169
169
|
|
|
@@ -232,7 +232,7 @@ import { useTokenSubscription } from "@liberfi.io/react";
|
|
|
232
232
|
import { Chain, API } from "@liberfi.io/types";
|
|
233
233
|
|
|
234
234
|
function LiveTokenPrice({ address }: { address: string }) {
|
|
235
|
-
const handleUpdate = useCallback((updates:
|
|
235
|
+
const handleUpdate = useCallback((updates: TokenSubscribed[]) => {
|
|
236
236
|
for (const update of updates) {
|
|
237
237
|
console.log("New price:", update.marketData?.priceInUsd);
|
|
238
238
|
}
|
|
@@ -375,6 +375,5 @@ When the environment variables are not set, integration tests are automatically
|
|
|
375
375
|
|
|
376
376
|
- Add a standalone `fetch` function to infinite query hooks for API consistency.
|
|
377
377
|
- Add a mutation key to `useSendTxMutation` for cache introspection.
|
|
378
|
-
- Consolidate `version.ts` global side effect into a shared utility.
|
|
379
378
|
- Document subscription deps-stability best practices for consumers.
|
|
380
379
|
- Type `useSubscriptionEffect` deps more strictly (currently `unknown[]`).
|
package/dist/index.d.mts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import * as _liberfi_io_types from '@liberfi.io/types';
|
|
4
|
-
import {
|
|
4
|
+
import { IClient, ISubscribeClient, GetTokenListOptions, Chain, Token, LatestBlockParams, BlockchainLatestBlock, SearchTokensOptions, SearchTokenCursorList, SendTxParams, SendTxResult, SwapParams, SwapRoute, GetTokenCandlesOptions, TokenResolution, TokenCandle, GetTokenHoldersOptions, CursorList, TokenHolder, TokenMarketData, TokenSecurity, GetTokensByCreatorOptions, TokenStats, TokenHoldersSortBy, GetTradesOptions, Trade, GetWalletLimitOrdersOptions, LimitOrder, WalletPnlResolution, WalletPnl, GetWalletPortfolioPnlsOptions, WalletPortfolioPnls, PositionState, WalletPnlSortBy, WalletPortfolios, Portfolio, PortfolioPnl, GetActivitiesOptions, Activity, TokenSubscribed, WalletPnlSubscribed, PortfolioSubscribed, PortfolioPnlSubscribed } from '@liberfi.io/types';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { UseQueryOptions, UseQueryResult, UseInfiniteQueryOptions, InfiniteData, UseInfiniteQueryResult, QueryClient, UseMutationOptions } from '@tanstack/react-query';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
|
-
declare global {
|
|
10
|
-
interface Window {
|
|
11
|
-
__LIBERFI_VERSION__?: {
|
|
12
|
-
[key: string]: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
9
|
/**
|
|
18
10
|
* Default prefix prepended to every TanStack Query key produced by hooks in
|
|
19
11
|
* this package. Can be overridden via
|
|
@@ -25,10 +17,10 @@ declare const DEFAULT_QUERY_KEY_PREFIX = "liberfi";
|
|
|
25
17
|
* `useDexClient`.
|
|
26
18
|
*/
|
|
27
19
|
interface DexClientContextValue {
|
|
28
|
-
/** REST / HTTP client implementing `
|
|
29
|
-
client:
|
|
30
|
-
/** WebSocket subscription client implementing `
|
|
31
|
-
subscribeClient:
|
|
20
|
+
/** REST / HTTP client implementing `IClient`. */
|
|
21
|
+
client: IClient;
|
|
22
|
+
/** WebSocket subscription client implementing `ISubscribeClient`. */
|
|
23
|
+
subscribeClient: ISubscribeClient;
|
|
32
24
|
/** Prefix used in all query keys produced by hooks. */
|
|
33
25
|
queryKeyPrefix: string;
|
|
34
26
|
}
|
|
@@ -51,7 +43,7 @@ interface QueryHookConfig<TParams, TData> {
|
|
|
51
43
|
/** Builds the variable segments of the query key from `params`. */
|
|
52
44
|
queryKey: (params: TParams) => string[];
|
|
53
45
|
/** Fetches data using the API client. */
|
|
54
|
-
fetch: (client:
|
|
46
|
+
fetch: (client: IClient, params: TParams) => Promise<TData>;
|
|
55
47
|
/** Default options merged *below* caller-supplied options. */
|
|
56
48
|
defaultOptions?: Partial<Omit<UseQueryOptions<TData, Error, TData, string[]>, "queryKey" | "queryFn">>;
|
|
57
49
|
}
|
|
@@ -67,7 +59,7 @@ interface QueryHookReturn<TParams, TData> {
|
|
|
67
59
|
*/
|
|
68
60
|
queryKey: (params: TParams, prefix?: string) => string[];
|
|
69
61
|
/** Fetches data using the API client (for use outside React). */
|
|
70
|
-
fetch: (client:
|
|
62
|
+
fetch: (client: IClient, params: TParams) => Promise<TData>;
|
|
71
63
|
/** React hook that fetches and caches data via TanStack Query. */
|
|
72
64
|
useQuery: (params: TParams, options?: Omit<UseQueryOptions<TData, Error, TData, string[]>, "queryKey" | "queryFn">) => UseQueryResult<TData, Error>;
|
|
73
65
|
}
|
|
@@ -87,7 +79,7 @@ interface InfiniteQueryHookConfig<TParams, TData extends CursorPaginatedResult>
|
|
|
87
79
|
/** Builds the variable segments of the query key from `params`. */
|
|
88
80
|
queryKey: (params: TParams) => string[];
|
|
89
81
|
/** Fetches a single page of data. */
|
|
90
|
-
fetch: (client:
|
|
82
|
+
fetch: (client: IClient, params: TParams, cursor: string | undefined) => Promise<TData>;
|
|
91
83
|
}
|
|
92
84
|
interface InfiniteQueryHookReturn<TParams, TData extends CursorPaginatedResult> {
|
|
93
85
|
/**
|
|
@@ -123,19 +115,19 @@ declare function toKeySegment(value: string | number | boolean | Date | undefine
|
|
|
123
115
|
declare function toSortedKeySegment(value: unknown[] | undefined | null): string;
|
|
124
116
|
|
|
125
117
|
/** Parameters for {@link useFinalStretchTokensQuery}. */
|
|
126
|
-
interface UseFinalStretchTokensQueryParams extends
|
|
118
|
+
interface UseFinalStretchTokensQueryParams extends GetTokenListOptions {
|
|
127
119
|
chain: Chain;
|
|
128
120
|
}
|
|
129
121
|
declare const finalStretchTokensQueryKey: (params: UseFinalStretchTokensQueryParams, prefix?: string) => string[];
|
|
130
|
-
declare const fetchFinalStretchTokens: (client:
|
|
122
|
+
declare const fetchFinalStretchTokens: (client: _liberfi_io_types.IClient, params: UseFinalStretchTokensQueryParams) => Promise<Token[]>;
|
|
131
123
|
declare const useFinalStretchTokensQuery: (params: UseFinalStretchTokensQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<Token[], Error, Token[], string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
132
124
|
|
|
133
|
-
type UseLatestBlockQueryParams =
|
|
134
|
-
declare const latestBlockQueryKey: (params:
|
|
135
|
-
declare const fetchLatestBlock: (client:
|
|
136
|
-
declare const useLatestBlockQuery: (params:
|
|
125
|
+
type UseLatestBlockQueryParams = LatestBlockParams;
|
|
126
|
+
declare const latestBlockQueryKey: (params: LatestBlockParams, prefix?: string) => string[];
|
|
127
|
+
declare const fetchLatestBlock: (client: _liberfi_io_types.IClient, params: LatestBlockParams) => Promise<BlockchainLatestBlock>;
|
|
128
|
+
declare const useLatestBlockQuery: (params: LatestBlockParams, options?: Omit<_tanstack_react_query.UseQueryOptions<BlockchainLatestBlock, Error, BlockchainLatestBlock, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<BlockchainLatestBlock, Error>;
|
|
137
129
|
interface LatestBlockCacheResult {
|
|
138
|
-
data?:
|
|
130
|
+
data?: BlockchainLatestBlock;
|
|
139
131
|
dataUpdatedAt: number;
|
|
140
132
|
}
|
|
141
133
|
declare function getCachedLatestBlock(queryClient: QueryClient, params: UseLatestBlockQueryParams, prefix?: string): LatestBlockCacheResult;
|
|
@@ -143,19 +135,19 @@ declare function useCachedLatestBlock(params: UseLatestBlockQueryParams): Latest
|
|
|
143
135
|
declare function useLatestBlockCacheReader(params: UseLatestBlockQueryParams): () => LatestBlockCacheResult;
|
|
144
136
|
|
|
145
137
|
/** Parameters for {@link useMigratedTokensQuery}. */
|
|
146
|
-
interface UseMigratedTokensQueryParams extends
|
|
138
|
+
interface UseMigratedTokensQueryParams extends GetTokenListOptions {
|
|
147
139
|
chain: Chain;
|
|
148
140
|
}
|
|
149
141
|
declare const migratedTokensQueryKey: (params: UseMigratedTokensQueryParams, prefix?: string) => string[];
|
|
150
|
-
declare const fetchMigratedTokens: (client:
|
|
142
|
+
declare const fetchMigratedTokens: (client: _liberfi_io_types.IClient, params: UseMigratedTokensQueryParams) => Promise<Token[]>;
|
|
151
143
|
declare const useMigratedTokensQuery: (params: UseMigratedTokensQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<Token[], Error, Token[], string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
152
144
|
|
|
153
145
|
/** Parameters for {@link useNewTokensQuery}. */
|
|
154
|
-
interface UseNewTokensQueryParams extends
|
|
146
|
+
interface UseNewTokensQueryParams extends GetTokenListOptions {
|
|
155
147
|
chain: Chain;
|
|
156
148
|
}
|
|
157
149
|
declare const newTokensQueryKey: (params: UseNewTokensQueryParams, prefix?: string) => string[];
|
|
158
|
-
declare const fetchNewTokens: (client:
|
|
150
|
+
declare const fetchNewTokens: (client: _liberfi_io_types.IClient, params: UseNewTokensQueryParams) => Promise<Token[]>;
|
|
159
151
|
declare const useNewTokensQuery: (params: UseNewTokensQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<Token[], Error, Token[], string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
160
152
|
|
|
161
153
|
/**
|
|
@@ -165,57 +157,57 @@ declare const useNewTokensQuery: (params: UseNewTokensQueryParams, options?: Omi
|
|
|
165
157
|
*/
|
|
166
158
|
declare function presignedUploadUrlQueryKey(prefix?: string): string[];
|
|
167
159
|
/** Fetches a presigned upload URL (for use outside React). */
|
|
168
|
-
declare function fetchPresignedUploadUrl(client:
|
|
160
|
+
declare function fetchPresignedUploadUrl(client: IClient): Promise<string>;
|
|
169
161
|
/** Fetches a one-time presigned upload URL. `staleTime` defaults to `0`. */
|
|
170
162
|
declare function usePresignedUploadUrlQuery(options?: Omit<UseQueryOptions<string, Error, string, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<string, Error>;
|
|
171
163
|
|
|
172
|
-
type UseSearchTokensQueryParams =
|
|
173
|
-
declare const searchTokensQueryKey: (params:
|
|
174
|
-
declare const fetchSearchTokens: (client:
|
|
175
|
-
declare const useSearchTokensQuery: (params:
|
|
164
|
+
type UseSearchTokensQueryParams = SearchTokensOptions;
|
|
165
|
+
declare const searchTokensQueryKey: (params: SearchTokensOptions, prefix?: string) => string[];
|
|
166
|
+
declare const fetchSearchTokens: (client: _liberfi_io_types.IClient, params: SearchTokensOptions) => Promise<SearchTokenCursorList>;
|
|
167
|
+
declare const useSearchTokensQuery: (params: SearchTokensOptions, options?: Omit<_tanstack_react_query.UseQueryOptions<SearchTokenCursorList, Error, SearchTokenCursorList, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<SearchTokenCursorList, Error>;
|
|
176
168
|
|
|
177
169
|
/** Parameters for {@link useSearchTokensInfiniteQuery}. */
|
|
178
|
-
type UseSearchTokensInfiniteQueryParams = Omit<
|
|
170
|
+
type UseSearchTokensInfiniteQueryParams = Omit<SearchTokensOptions, "cursor" | "direction">;
|
|
179
171
|
declare const searchTokensInfiniteQueryKey: (params: UseSearchTokensInfiniteQueryParams, prefix?: string) => string[];
|
|
180
|
-
declare const useSearchTokensInfiniteQuery: (params: UseSearchTokensInfiniteQueryParams, options?: Omit<_tanstack_react_query.UseInfiniteQueryOptions<
|
|
172
|
+
declare const useSearchTokensInfiniteQuery: (params: UseSearchTokensInfiniteQueryParams, options?: Omit<_tanstack_react_query.UseInfiniteQueryOptions<SearchTokenCursorList, Error, _tanstack_react_query.InfiniteData<SearchTokenCursorList, unknown>, string[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam"> | undefined) => _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<SearchTokenCursorList, unknown>, Error>;
|
|
181
173
|
|
|
182
|
-
type UseSendTxMutationParams =
|
|
174
|
+
type UseSendTxMutationParams = SendTxParams;
|
|
183
175
|
/** Sends a transaction via the API client (for use outside React). */
|
|
184
|
-
declare function sendTx(client:
|
|
176
|
+
declare function sendTx(client: IClient, params: UseSendTxMutationParams): Promise<SendTxResult>;
|
|
185
177
|
/** Mutation hook that sends a transaction. */
|
|
186
|
-
declare function useSendTxMutation(options?: Omit<UseMutationOptions<
|
|
178
|
+
declare function useSendTxMutation(options?: Omit<UseMutationOptions<SendTxResult, Error, UseSendTxMutationParams>, "mutationFn">): _tanstack_react_query.UseMutationResult<SendTxResult, Error, SendTxParams, unknown>;
|
|
187
179
|
|
|
188
180
|
/** Parameters for {@link useStockTokensQuery}. */
|
|
189
|
-
interface UseStockTokensQueryParams extends
|
|
181
|
+
interface UseStockTokensQueryParams extends GetTokenListOptions {
|
|
190
182
|
chain: Chain;
|
|
191
183
|
}
|
|
192
184
|
declare const stockTokensQueryKey: (params: UseStockTokensQueryParams, prefix?: string) => string[];
|
|
193
|
-
declare const fetchStockTokens: (client:
|
|
185
|
+
declare const fetchStockTokens: (client: _liberfi_io_types.IClient, params: UseStockTokensQueryParams) => Promise<Token[]>;
|
|
194
186
|
declare const useStockTokensQuery: (params: UseStockTokensQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<Token[], Error, Token[], string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
195
187
|
|
|
196
|
-
type UseSwapRouteQueryParams =
|
|
197
|
-
declare const swapRouteQueryKey: (params:
|
|
198
|
-
declare const fetchSwapRoute: (client:
|
|
199
|
-
declare const useSwapRouteQuery: (params:
|
|
188
|
+
type UseSwapRouteQueryParams = SwapParams;
|
|
189
|
+
declare const swapRouteQueryKey: (params: SwapParams, prefix?: string) => string[];
|
|
190
|
+
declare const fetchSwapRoute: (client: _liberfi_io_types.IClient, params: SwapParams) => Promise<SwapRoute>;
|
|
191
|
+
declare const useSwapRouteQuery: (params: SwapParams, options?: Omit<_tanstack_react_query.UseQueryOptions<SwapRoute, Error, SwapRoute, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<SwapRoute, Error>;
|
|
200
192
|
|
|
201
193
|
/** Parameters for {@link useTokenCandlesQuery}. */
|
|
202
|
-
interface UseTokenCandlesQueryParams extends
|
|
194
|
+
interface UseTokenCandlesQueryParams extends GetTokenCandlesOptions {
|
|
203
195
|
chain: Chain;
|
|
204
196
|
address: string;
|
|
205
197
|
resolution: TokenResolution;
|
|
206
198
|
}
|
|
207
199
|
declare const tokenCandlesQueryKey: (params: UseTokenCandlesQueryParams, prefix?: string) => string[];
|
|
208
|
-
declare const fetchTokenCandles: (client:
|
|
200
|
+
declare const fetchTokenCandles: (client: _liberfi_io_types.IClient, params: UseTokenCandlesQueryParams) => Promise<TokenCandle[]>;
|
|
209
201
|
declare const useTokenCandlesQuery: (params: UseTokenCandlesQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<TokenCandle[], Error, TokenCandle[], string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<TokenCandle[], Error>;
|
|
210
202
|
|
|
211
203
|
/** Parameters for {@link useTokenHoldersQuery}. */
|
|
212
|
-
interface UseTokenHoldersQueryParams extends
|
|
204
|
+
interface UseTokenHoldersQueryParams extends GetTokenHoldersOptions {
|
|
213
205
|
chain: Chain;
|
|
214
206
|
address: string;
|
|
215
207
|
}
|
|
216
208
|
declare const tokenHoldersQueryKey: (params: UseTokenHoldersQueryParams, prefix?: string) => string[];
|
|
217
|
-
declare const fetchTokenHolders: (client:
|
|
218
|
-
declare const useTokenHoldersQuery: (params: UseTokenHoldersQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<
|
|
209
|
+
declare const fetchTokenHolders: (client: _liberfi_io_types.IClient, params: UseTokenHoldersQueryParams) => Promise<CursorList<TokenHolder>>;
|
|
210
|
+
declare const useTokenHoldersQuery: (params: UseTokenHoldersQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<CursorList<TokenHolder>, Error, CursorList<TokenHolder>, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<CursorList<TokenHolder>, Error>;
|
|
219
211
|
|
|
220
212
|
/** Parameters for {@link useTokenMarketDataQuery}. */
|
|
221
213
|
interface UseTokenMarketDataQueryParams {
|
|
@@ -254,7 +246,7 @@ declare const fetchTokens: (client: _liberfi_io_types.IClient, params: UseTokens
|
|
|
254
246
|
declare const useTokensQuery: (params: UseTokensQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<Token[], Error, Token[], string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
255
247
|
|
|
256
248
|
/** Parameters for {@link useTokensByCreatorQuery}. */
|
|
257
|
-
interface UseTokensByCreatorQueryParams extends
|
|
249
|
+
interface UseTokensByCreatorQueryParams extends GetTokensByCreatorOptions {
|
|
258
250
|
chain: Chain;
|
|
259
251
|
creator: string;
|
|
260
252
|
}
|
|
@@ -267,8 +259,8 @@ interface UseTokensByCreatorQueryParams extends API.GetTokensByCreatorOptions {
|
|
|
267
259
|
* `isNotImplementedError` to render an empty state.
|
|
268
260
|
*/
|
|
269
261
|
declare const tokensByCreatorQueryKey: (params: UseTokensByCreatorQueryParams, prefix?: string) => string[];
|
|
270
|
-
declare const fetchTokensByCreator: (client:
|
|
271
|
-
declare const useTokensByCreatorQuery: (params: UseTokensByCreatorQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<
|
|
262
|
+
declare const fetchTokensByCreator: (client: _liberfi_io_types.IClient, params: UseTokensByCreatorQueryParams) => Promise<CursorList<Token>>;
|
|
263
|
+
declare const useTokensByCreatorQuery: (params: UseTokensByCreatorQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<CursorList<Token>, Error, CursorList<Token>, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<CursorList<Token>, Error>;
|
|
272
264
|
|
|
273
265
|
/** Parameters for {@link useTokenStatsQuery}. */
|
|
274
266
|
interface UseTokenStatsQueryParams {
|
|
@@ -280,7 +272,7 @@ declare const fetchTokenStats: (client: _liberfi_io_types.IClient, params: UseTo
|
|
|
280
272
|
declare const useTokenStatsQuery: (params: UseTokenStatsQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<TokenStats, Error, TokenStats, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<TokenStats, Error>;
|
|
281
273
|
|
|
282
274
|
/** Parameters for {@link useTokenTopTradersQuery}. */
|
|
283
|
-
interface UseTokenTopTradersQueryParams extends Omit<
|
|
275
|
+
interface UseTokenTopTradersQueryParams extends Omit<GetTokenHoldersOptions, "sortBy"> {
|
|
284
276
|
chain: Chain;
|
|
285
277
|
address: string;
|
|
286
278
|
/**
|
|
@@ -289,7 +281,7 @@ interface UseTokenTopTradersQueryParams extends Omit<API.GetTokenHoldersOptions,
|
|
|
289
281
|
* backend has not yet enabled realized-PnL sorting on the holders
|
|
290
282
|
* endpoint.
|
|
291
283
|
*/
|
|
292
|
-
sortBy?:
|
|
284
|
+
sortBy?: TokenHoldersSortBy;
|
|
293
285
|
}
|
|
294
286
|
/**
|
|
295
287
|
* Fetch the "Top Traders" list for a token.
|
|
@@ -301,25 +293,25 @@ interface UseTokenTopTradersQueryParams extends Omit<API.GetTokenHoldersOptions,
|
|
|
301
293
|
* clear semantic name.
|
|
302
294
|
*/
|
|
303
295
|
declare const tokenTopTradersQueryKey: (params: UseTokenTopTradersQueryParams, prefix?: string) => string[];
|
|
304
|
-
declare const fetchTokenTopTraders: (client:
|
|
305
|
-
declare const useTokenTopTradersQuery: (params: UseTokenTopTradersQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<
|
|
296
|
+
declare const fetchTokenTopTraders: (client: _liberfi_io_types.IClient, params: UseTokenTopTradersQueryParams) => Promise<CursorList<TokenHolder>>;
|
|
297
|
+
declare const useTokenTopTradersQuery: (params: UseTokenTopTradersQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<CursorList<TokenHolder>, Error, CursorList<TokenHolder>, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<CursorList<TokenHolder>, Error>;
|
|
306
298
|
|
|
307
299
|
/** Parameters for {@link useTokenTradesQuery}. */
|
|
308
|
-
interface UseTokenTradesQueryParams extends
|
|
300
|
+
interface UseTokenTradesQueryParams extends GetTradesOptions {
|
|
309
301
|
chain: Chain;
|
|
310
302
|
address: string;
|
|
311
303
|
}
|
|
312
304
|
declare const tokenTradesQueryKey: (params: UseTokenTradesQueryParams, prefix?: string) => string[];
|
|
313
|
-
declare const fetchTokenTrades: (client:
|
|
314
|
-
declare const useTokenTradesQuery: (params: UseTokenTradesQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<
|
|
305
|
+
declare const fetchTokenTrades: (client: _liberfi_io_types.IClient, params: UseTokenTradesQueryParams) => Promise<CursorList<Trade>>;
|
|
306
|
+
declare const useTokenTradesQuery: (params: UseTokenTradesQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<CursorList<Trade>, Error, CursorList<Trade>, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<CursorList<Trade>, Error>;
|
|
315
307
|
|
|
316
308
|
/** Parameters for {@link useTrendingTokensQuery}. */
|
|
317
|
-
interface UseTrendingTokensQueryParams extends
|
|
309
|
+
interface UseTrendingTokensQueryParams extends GetTokenListOptions {
|
|
318
310
|
chain: Chain;
|
|
319
311
|
resolution: "1m" | "5m" | "1h" | "4h" | "24h";
|
|
320
312
|
}
|
|
321
313
|
declare const trendingTokensQueryKey: (params: UseTrendingTokensQueryParams, prefix?: string) => string[];
|
|
322
|
-
declare const fetchTrendingTokens: (client:
|
|
314
|
+
declare const fetchTrendingTokens: (client: _liberfi_io_types.IClient, params: UseTrendingTokensQueryParams) => Promise<Token[]>;
|
|
323
315
|
declare const useTrendingTokensQuery: (params: UseTrendingTokensQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<Token[], Error, Token[], string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
324
316
|
|
|
325
317
|
/** Parameters for {@link useTxSuccessQuery}. */
|
|
@@ -333,7 +325,7 @@ declare const fetchTxSuccess: (client: _liberfi_io_types.IClient, params: UseTxS
|
|
|
333
325
|
declare const useTxSuccessQuery: (params: UseTxSuccessQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<boolean, Error, boolean, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<boolean, Error>;
|
|
334
326
|
|
|
335
327
|
/** Parameters for {@link useWalletLimitOrdersQuery}. */
|
|
336
|
-
interface UseWalletLimitOrdersQueryParams extends
|
|
328
|
+
interface UseWalletLimitOrdersQueryParams extends GetWalletLimitOrdersOptions {
|
|
337
329
|
chain: Chain;
|
|
338
330
|
address: string;
|
|
339
331
|
}
|
|
@@ -346,26 +338,26 @@ interface UseWalletLimitOrdersQueryParams extends API.GetWalletLimitOrdersOption
|
|
|
346
338
|
* `isNotImplementedError` to render an "Orders coming soon" empty state.
|
|
347
339
|
*/
|
|
348
340
|
declare const walletLimitOrdersQueryKey: (params: UseWalletLimitOrdersQueryParams, prefix?: string) => string[];
|
|
349
|
-
declare const fetchWalletLimitOrders: (client:
|
|
350
|
-
declare const useWalletLimitOrdersQuery: (params: UseWalletLimitOrdersQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<
|
|
341
|
+
declare const fetchWalletLimitOrders: (client: _liberfi_io_types.IClient, params: UseWalletLimitOrdersQueryParams) => Promise<CursorList<LimitOrder>>;
|
|
342
|
+
declare const useWalletLimitOrdersQuery: (params: UseWalletLimitOrdersQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<CursorList<LimitOrder>, Error, CursorList<LimitOrder>, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<CursorList<LimitOrder>, Error>;
|
|
351
343
|
|
|
352
344
|
/** Parameters for {@link useWalletPnlQuery}. */
|
|
353
345
|
interface UseWalletPnlQueryParams {
|
|
354
346
|
chain: Chain;
|
|
355
347
|
address: string;
|
|
356
|
-
resolution?:
|
|
348
|
+
resolution?: WalletPnlResolution;
|
|
357
349
|
}
|
|
358
350
|
declare const walletPnlQueryKey: (params: UseWalletPnlQueryParams, prefix?: string) => string[];
|
|
359
351
|
declare const fetchWalletPnl: (client: _liberfi_io_types.IClient, params: UseWalletPnlQueryParams) => Promise<WalletPnl>;
|
|
360
352
|
declare const useWalletPnlQuery: (params: UseWalletPnlQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<WalletPnl, Error, WalletPnl, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<WalletPnl, Error>;
|
|
361
353
|
|
|
362
354
|
/** Parameters for {@link useWalletPortfolioPnlsQuery}. */
|
|
363
|
-
interface UseWalletPortfolioPnlsQueryParams extends
|
|
355
|
+
interface UseWalletPortfolioPnlsQueryParams extends GetWalletPortfolioPnlsOptions {
|
|
364
356
|
chain: Chain;
|
|
365
357
|
address: string;
|
|
366
358
|
}
|
|
367
359
|
declare const walletPortfolioPnlsQueryKey: (params: UseWalletPortfolioPnlsQueryParams, prefix?: string) => string[];
|
|
368
|
-
declare const fetchWalletPortfolioPnls: (client:
|
|
360
|
+
declare const fetchWalletPortfolioPnls: (client: _liberfi_io_types.IClient, params: UseWalletPortfolioPnlsQueryParams) => Promise<WalletPortfolioPnls>;
|
|
369
361
|
declare const useWalletPortfolioPnlsQuery: (params: UseWalletPortfolioPnlsQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<WalletPortfolioPnls, Error, WalletPortfolioPnls, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<WalletPortfolioPnls, Error>;
|
|
370
362
|
|
|
371
363
|
/** Parameters for {@link useWalletPortfolioPnlsInfiniteQuery}. */
|
|
@@ -374,11 +366,11 @@ interface UseWalletPortfolioPnlsInfiniteQueryParams {
|
|
|
374
366
|
address: string;
|
|
375
367
|
limit?: number;
|
|
376
368
|
/** Phase 3 statistics window (default 30d). */
|
|
377
|
-
resolution?:
|
|
369
|
+
resolution?: WalletPnlResolution;
|
|
378
370
|
/** Phase 3 position-state filter. */
|
|
379
|
-
positionState?:
|
|
371
|
+
positionState?: PositionState;
|
|
380
372
|
/** Phase 3 sort field. */
|
|
381
|
-
sortBy?:
|
|
373
|
+
sortBy?: WalletPnlSortBy;
|
|
382
374
|
}
|
|
383
375
|
declare const walletPortfolioPnlsInfiniteQueryKey: (params: UseWalletPortfolioPnlsInfiniteQueryParams, prefix?: string) => string[];
|
|
384
376
|
declare const useWalletPortfolioPnlsInfiniteQuery: (params: UseWalletPortfolioPnlsInfiniteQueryParams, options?: Omit<_tanstack_react_query.UseInfiniteQueryOptions<WalletPortfolioPnls, Error, _tanstack_react_query.InfiniteData<WalletPortfolioPnls, unknown>, string[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam"> | undefined) => _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<WalletPortfolioPnls, unknown>, Error>;
|
|
@@ -424,11 +416,11 @@ declare const fetchWalletPortfolioPnlsByTokens: (client: _liberfi_io_types.IClie
|
|
|
424
416
|
declare const useWalletPortfolioPnlsByTokensQuery: (params: UseWalletPortfolioPnlsByTokensQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<PortfolioPnl[], Error, PortfolioPnl[], string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<PortfolioPnl[], Error>;
|
|
425
417
|
|
|
426
418
|
/** Parameters for {@link useWalletTokenPositionsQuery}. */
|
|
427
|
-
interface UseWalletTokenPositionsQueryParams extends Omit<
|
|
419
|
+
interface UseWalletTokenPositionsQueryParams extends Omit<GetWalletPortfolioPnlsOptions, "positionState"> {
|
|
428
420
|
chain: Chain;
|
|
429
421
|
address: string;
|
|
430
422
|
/** Position state filter. Defaults to `open`. Pass `all` or `closed` as needed. */
|
|
431
|
-
positionState?:
|
|
423
|
+
positionState?: PositionState;
|
|
432
424
|
}
|
|
433
425
|
/**
|
|
434
426
|
* A wallet's token positions (the "Positions" tab).
|
|
@@ -443,38 +435,38 @@ interface UseWalletTokenPositionsQueryParams extends Omit<API.GetWalletPortfolio
|
|
|
443
435
|
* to the Positions view (`Bought / Sold / Remaining / PnL`).
|
|
444
436
|
*/
|
|
445
437
|
declare const walletTokenPositionsQueryKey: (params: UseWalletTokenPositionsQueryParams, prefix?: string) => string[];
|
|
446
|
-
declare const fetchWalletTokenPositions: (client:
|
|
438
|
+
declare const fetchWalletTokenPositions: (client: _liberfi_io_types.IClient, params: UseWalletTokenPositionsQueryParams) => Promise<WalletPortfolioPnls>;
|
|
447
439
|
declare const useWalletTokenPositionsQuery: (params: UseWalletTokenPositionsQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<WalletPortfolioPnls, Error, WalletPortfolioPnls, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<WalletPortfolioPnls, Error>;
|
|
448
440
|
|
|
449
441
|
/** Alias for consumers that only want the rows (not the wallet-level summary). */
|
|
450
442
|
type WalletTokenPosition = PortfolioPnl;
|
|
451
443
|
|
|
452
444
|
/** Parameters for {@link useWalletTradesQuery}. */
|
|
453
|
-
interface UseWalletTradesQueryParams extends
|
|
445
|
+
interface UseWalletTradesQueryParams extends GetTradesOptions {
|
|
454
446
|
chain: Chain;
|
|
455
447
|
address: string;
|
|
456
448
|
}
|
|
457
449
|
declare const walletTradesQueryKey: (params: UseWalletTradesQueryParams, prefix?: string) => string[];
|
|
458
|
-
declare const fetchWalletTrades: (client:
|
|
459
|
-
declare const useWalletTradesQuery: (params: UseWalletTradesQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<
|
|
450
|
+
declare const fetchWalletTrades: (client: _liberfi_io_types.IClient, params: UseWalletTradesQueryParams) => Promise<CursorList<Trade>>;
|
|
451
|
+
declare const useWalletTradesQuery: (params: UseWalletTradesQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<CursorList<Trade>, Error, CursorList<Trade>, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<CursorList<Trade>, Error>;
|
|
460
452
|
|
|
461
453
|
/** Parameters for {@link useTokenActivitiesQuery}. */
|
|
462
|
-
interface UseTokenActivitiesQueryParams extends
|
|
454
|
+
interface UseTokenActivitiesQueryParams extends GetActivitiesOptions {
|
|
463
455
|
chain: Chain;
|
|
464
456
|
address: string;
|
|
465
457
|
}
|
|
466
458
|
declare const tokenActivitiesQueryKey: (params: UseTokenActivitiesQueryParams, prefix?: string) => string[];
|
|
467
|
-
declare const fetchTokenActivities: (client:
|
|
468
|
-
declare const useTokenActivitiesQuery: (params: UseTokenActivitiesQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<
|
|
459
|
+
declare const fetchTokenActivities: (client: _liberfi_io_types.IClient, params: UseTokenActivitiesQueryParams) => Promise<CursorList<Activity>>;
|
|
460
|
+
declare const useTokenActivitiesQuery: (params: UseTokenActivitiesQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<CursorList<Activity>, Error, CursorList<Activity>, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<CursorList<Activity>, Error>;
|
|
469
461
|
|
|
470
462
|
/** Parameters for {@link useWalletActivitiesQuery}. */
|
|
471
|
-
interface UseWalletActivitiesQueryParams extends
|
|
463
|
+
interface UseWalletActivitiesQueryParams extends GetActivitiesOptions {
|
|
472
464
|
chain: Chain;
|
|
473
465
|
address: string;
|
|
474
466
|
}
|
|
475
467
|
declare const walletActivitiesQueryKey: (params: UseWalletActivitiesQueryParams, prefix?: string) => string[];
|
|
476
|
-
declare const fetchWalletActivities: (client:
|
|
477
|
-
declare const useWalletActivitiesQuery: (params: UseWalletActivitiesQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<
|
|
468
|
+
declare const fetchWalletActivities: (client: _liberfi_io_types.IClient, params: UseWalletActivitiesQueryParams) => Promise<CursorList<Activity>>;
|
|
469
|
+
declare const useWalletActivitiesQuery: (params: UseWalletActivitiesQueryParams, options?: Omit<_tanstack_react_query.UseQueryOptions<CursorList<Activity>, Error, CursorList<Activity>, string[]>, "queryKey" | "queryFn"> | undefined) => _tanstack_react_query.UseQueryResult<CursorList<Activity>, Error>;
|
|
478
470
|
|
|
479
471
|
/** Parameters for {@link useTokenSubscription}. */
|
|
480
472
|
interface UseTokenSubscriptionParams {
|
|
@@ -482,7 +474,7 @@ interface UseTokenSubscriptionParams {
|
|
|
482
474
|
address: string;
|
|
483
475
|
}
|
|
484
476
|
/** Subscribes to real-time updates for a single token. */
|
|
485
|
-
declare function useTokenSubscription(params: UseTokenSubscriptionParams, callback: (data: Array<
|
|
477
|
+
declare function useTokenSubscription(params: UseTokenSubscriptionParams, callback: (data: Array<TokenSubscribed>) => void, options?: SubscriptionOptions): void;
|
|
486
478
|
|
|
487
479
|
/** Parameters for {@link useTokenCandlesSubscription}. */
|
|
488
480
|
interface UseTokenCandlesSubscriptionParams {
|
|
@@ -507,7 +499,7 @@ interface UseWalletPnlSubscriptionParams {
|
|
|
507
499
|
address: string;
|
|
508
500
|
}
|
|
509
501
|
/** Subscribes to real-time wallet PnL updates. */
|
|
510
|
-
declare function useWalletPnlSubscription(params: UseWalletPnlSubscriptionParams, callback: (pnls: Array<
|
|
502
|
+
declare function useWalletPnlSubscription(params: UseWalletPnlSubscriptionParams, callback: (pnls: Array<WalletPnlSubscribed>) => void, options?: SubscriptionOptions): void;
|
|
511
503
|
|
|
512
504
|
/** Parameters for {@link useWalletPortfoliosSubscription}. */
|
|
513
505
|
interface UseWalletPortfoliosSubscriptionParams {
|
|
@@ -515,7 +507,7 @@ interface UseWalletPortfoliosSubscriptionParams {
|
|
|
515
507
|
address: string;
|
|
516
508
|
}
|
|
517
509
|
/** Subscribes to real-time wallet portfolio updates. */
|
|
518
|
-
declare function useWalletPortfoliosSubscription(params: UseWalletPortfoliosSubscriptionParams, callback: (portfolios: Array<
|
|
510
|
+
declare function useWalletPortfoliosSubscription(params: UseWalletPortfoliosSubscriptionParams, callback: (portfolios: Array<PortfolioSubscribed>) => void, options?: SubscriptionOptions): void;
|
|
519
511
|
|
|
520
512
|
/** Parameters for {@link useWalletPortfolioPnlsSubscription}. */
|
|
521
513
|
interface UseWalletPortfolioPnlsSubscriptionParams {
|
|
@@ -523,7 +515,7 @@ interface UseWalletPortfolioPnlsSubscriptionParams {
|
|
|
523
515
|
address: string;
|
|
524
516
|
}
|
|
525
517
|
/** Subscribes to real-time wallet portfolio PnL updates. */
|
|
526
|
-
declare function useWalletPortfolioPnlsSubscription(params: UseWalletPortfolioPnlsSubscriptionParams, callback: (portfolioPnls: Array<
|
|
518
|
+
declare function useWalletPortfolioPnlsSubscription(params: UseWalletPortfolioPnlsSubscriptionParams, callback: (portfolioPnls: Array<PortfolioPnlSubscribed>) => void, options?: SubscriptionOptions): void;
|
|
527
519
|
|
|
528
520
|
/** Parameters for {@link useWalletTradesSubscription}. */
|
|
529
521
|
interface UseWalletTradesSubscriptionParams {
|
|
@@ -554,39 +546,39 @@ interface UseNewTokensSubscriptionParams {
|
|
|
554
546
|
chain: Chain;
|
|
555
547
|
}
|
|
556
548
|
/** Subscribes to real-time new token listings. */
|
|
557
|
-
declare function useNewTokensSubscription(params: UseNewTokensSubscriptionParams, callback: (tokens: Array<
|
|
549
|
+
declare function useNewTokensSubscription(params: UseNewTokensSubscriptionParams, callback: (tokens: Array<TokenSubscribed>) => void, options?: SubscriptionOptions): void;
|
|
558
550
|
|
|
559
551
|
/** Parameters for {@link useTrendingTokensSubscription}. */
|
|
560
552
|
interface UseTrendingTokensSubscriptionParams {
|
|
561
553
|
chain: Chain;
|
|
562
554
|
}
|
|
563
555
|
/** Subscribes to real-time trending token updates. */
|
|
564
|
-
declare function useTrendingTokensSubscription(params: UseTrendingTokensSubscriptionParams, callback: (data: Array<
|
|
556
|
+
declare function useTrendingTokensSubscription(params: UseTrendingTokensSubscriptionParams, callback: (data: Array<TokenSubscribed>) => void, options?: SubscriptionOptions): void;
|
|
565
557
|
|
|
566
558
|
/** Parameters for {@link useMigratedTokensSubscription}. */
|
|
567
559
|
interface UseMigratedTokensSubscriptionParams {
|
|
568
560
|
chain: Chain;
|
|
569
561
|
}
|
|
570
562
|
/** Subscribes to real-time migrated token updates. */
|
|
571
|
-
declare function useMigratedTokensSubscription(params: UseMigratedTokensSubscriptionParams, callback: (data: Array<
|
|
563
|
+
declare function useMigratedTokensSubscription(params: UseMigratedTokensSubscriptionParams, callback: (data: Array<TokenSubscribed>) => void, options?: SubscriptionOptions): void;
|
|
572
564
|
|
|
573
565
|
/** Parameters for {@link useFinalStretchTokensSubscription}. */
|
|
574
566
|
interface UseFinalStretchTokensSubscriptionParams {
|
|
575
567
|
chain: Chain;
|
|
576
568
|
}
|
|
577
569
|
/** Subscribes to real-time final-stretch token updates. */
|
|
578
|
-
declare function useFinalStretchTokensSubscription(params: UseFinalStretchTokensSubscriptionParams, callback: (data: Array<
|
|
570
|
+
declare function useFinalStretchTokensSubscription(params: UseFinalStretchTokensSubscriptionParams, callback: (data: Array<TokenSubscribed>) => void, options?: SubscriptionOptions): void;
|
|
579
571
|
|
|
580
572
|
/** Parameters for {@link useStockTokensSubscription}. */
|
|
581
573
|
interface UseStockTokensSubscriptionParams {
|
|
582
574
|
chain: Chain;
|
|
583
575
|
}
|
|
584
576
|
/** Subscribes to real-time stock token updates. */
|
|
585
|
-
declare function useStockTokensSubscription(params: UseStockTokensSubscriptionParams, callback: (data: Array<
|
|
577
|
+
declare function useStockTokensSubscription(params: UseStockTokensSubscriptionParams, callback: (data: Array<TokenSubscribed>) => void, options?: SubscriptionOptions): void;
|
|
586
578
|
|
|
587
579
|
type DexClientProviderProps = PropsWithChildren<{
|
|
588
|
-
client:
|
|
589
|
-
subscribeClient:
|
|
580
|
+
client: IClient;
|
|
581
|
+
subscribeClient: ISubscribeClient;
|
|
590
582
|
/**
|
|
591
583
|
* Prefix prepended to every TanStack Query key produced by hooks in this
|
|
592
584
|
* package. Useful for avoiding collisions with other libraries.
|