@liberfi.io/hooks 0.1.5 → 0.1.7
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 +9 -199
- package/dist/index.d.ts +9 -199
- package/dist/index.js +2 -489
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -426
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { API, Chain, Token, TokenResolution, TokenCandle, TokenHolder, TokenMarketData, TokenSecurity, TokenStats, TradeActivity, WalletPortfolios } from '@liberfi.io/types';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
|
-
import { UseQueryOptions, UseMutationOptions } from '@tanstack/react-query';
|
|
8
|
-
import * as _liberfi_io_core from '@liberfi.io/core';
|
|
9
|
-
import { WalletAdapter, EventEmitter, SimpleDI } from '@liberfi.io/core';
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { RefObject, useLayoutEffect } from 'react';
|
|
3
|
+
import { EventEmitter, SimpleDI } from '@liberfi.io/core';
|
|
10
4
|
export { default as useConstant } from 'use-constant';
|
|
11
5
|
export * from 'use-debounce';
|
|
12
6
|
|
|
@@ -17,191 +11,7 @@ declare global {
|
|
|
17
11
|
};
|
|
18
12
|
}
|
|
19
13
|
}
|
|
20
|
-
declare const _default: "0.1.
|
|
21
|
-
|
|
22
|
-
interface APIClientContextValue {
|
|
23
|
-
client: API.IClient;
|
|
24
|
-
subscribeClient: API.ISubscribeClient;
|
|
25
|
-
}
|
|
26
|
-
declare const APIClientContext: react.Context<APIClientContextValue>;
|
|
27
|
-
|
|
28
|
-
type APIClientProviderProps = PropsWithChildren<APIClientContextValue>;
|
|
29
|
-
declare function APIClientProvider({ client, subscribeClient, children, }: APIClientProviderProps): react_jsx_runtime.JSX.Element;
|
|
30
|
-
|
|
31
|
-
declare function useAPIClient(): APIClientContextValue;
|
|
32
|
-
|
|
33
|
-
interface UseFinalStretchTokensQueryParams extends API.GetTokenListOptions {
|
|
34
|
-
chain: Chain;
|
|
35
|
-
}
|
|
36
|
-
declare function finalStretchTokensQueryKey(params: UseFinalStretchTokensQueryParams): string[];
|
|
37
|
-
declare function fetchFinalStretchTokens(client: API.IClient, { chain, ...options }: UseFinalStretchTokensQueryParams): Promise<Token[]>;
|
|
38
|
-
declare function useFinalStretchTokensQuery(params: UseFinalStretchTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
39
|
-
|
|
40
|
-
interface UseMigratedTokensQueryParams extends API.GetTokenListOptions {
|
|
41
|
-
chain: Chain;
|
|
42
|
-
}
|
|
43
|
-
declare function migratedTokensQueryKey(params: UseMigratedTokensQueryParams): string[];
|
|
44
|
-
declare function fetchMigratedTokens(client: API.IClient, { chain, ...options }: UseMigratedTokensQueryParams): Promise<Token[]>;
|
|
45
|
-
declare function useMigratedTokensQuery(params: UseMigratedTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
46
|
-
|
|
47
|
-
interface UseNewTokensQueryParams extends API.GetTokenListOptions {
|
|
48
|
-
chain: Chain;
|
|
49
|
-
}
|
|
50
|
-
declare function newTokensQueryKey(params: UseNewTokensQueryParams): string[];
|
|
51
|
-
declare function fetchNewTokens(client: API.IClient, { chain, ...options }: UseNewTokensQueryParams): Promise<Token[]>;
|
|
52
|
-
declare function useNewTokensQuery(params: UseNewTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
53
|
-
|
|
54
|
-
declare function fetchPresignedUploadUrl(client: API.IClient): Promise<string>;
|
|
55
|
-
declare function usePresignedUploadUrlQuery(options?: Omit<UseQueryOptions<string, Error, string, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<string, Error>;
|
|
56
|
-
|
|
57
|
-
type UseSearchTokensQueryParams = API.SearchTokensOptions;
|
|
58
|
-
declare function searchTokensQueryKey(params: UseSearchTokensQueryParams): string[];
|
|
59
|
-
declare function fetchSearchTokens(client: API.IClient, params: UseSearchTokensQueryParams): Promise<_liberfi_io_types.SearchTokenCursorList>;
|
|
60
|
-
declare function useSearchTokensQuery(params: UseSearchTokensQueryParams, options?: Omit<UseQueryOptions<API.SearchTokenCursorList, Error, API.SearchTokenCursorList, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<_liberfi_io_types.SearchTokenCursorList, Error>;
|
|
61
|
-
|
|
62
|
-
type UseSendTxMutationParams = API.SendTxParams;
|
|
63
|
-
declare function sendTx(client: API.IClient, params: UseSendTxMutationParams): Promise<_liberfi_io_types.SendTxResult>;
|
|
64
|
-
declare function useSendTxMutation(options?: Omit<UseMutationOptions<API.SendTxResult, Error, UseSendTxMutationParams>, "mutationFn">): _tanstack_react_query.UseMutationResult<_liberfi_io_types.SendTxResult, Error, _liberfi_io_types.SendTxParams, unknown>;
|
|
65
|
-
|
|
66
|
-
interface UseStockTokensQueryParams extends API.GetTokenListOptions {
|
|
67
|
-
chain: Chain;
|
|
68
|
-
}
|
|
69
|
-
declare function stockTokensQueryKey(params: UseStockTokensQueryParams): string[];
|
|
70
|
-
declare function fetchStockTokens(client: API.IClient, { chain, ...options }: UseStockTokensQueryParams): Promise<Token[]>;
|
|
71
|
-
declare function useStockTokensQuery(params: UseStockTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
72
|
-
|
|
73
|
-
type UseSwapRouteQueryParams = API.SwapParams;
|
|
74
|
-
declare function swapRouteQueryKey(params: UseSwapRouteQueryParams): string[];
|
|
75
|
-
declare function fetchSwapRoute(client: API.IClient, params: UseSwapRouteQueryParams): Promise<_liberfi_io_types.SwapRoute>;
|
|
76
|
-
declare function useSwapRouteQuery(params: UseSwapRouteQueryParams, options?: Omit<UseQueryOptions<API.SwapRoute, Error, API.SwapRoute, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<_liberfi_io_types.SwapRoute, Error>;
|
|
77
|
-
|
|
78
|
-
interface UseTokenCandlesQueryParams extends API.GetTokenCandlesOptions {
|
|
79
|
-
chain: Chain;
|
|
80
|
-
address: string;
|
|
81
|
-
resolution: TokenResolution;
|
|
82
|
-
}
|
|
83
|
-
declare function tokenCandlesQueryKey(params: UseTokenCandlesQueryParams): string[];
|
|
84
|
-
declare function fetchTokenCandles(client: API.IClient, { chain, address, resolution, ...options }: UseTokenCandlesQueryParams): Promise<TokenCandle[]>;
|
|
85
|
-
declare function useTokenCandlesQuery(params: UseTokenCandlesQueryParams, options?: Omit<UseQueryOptions<Array<TokenCandle>, Error, Array<TokenCandle>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenCandle[], Error>;
|
|
86
|
-
|
|
87
|
-
interface UseTokenHoldersQueryParams extends API.CursorListOptions {
|
|
88
|
-
chain: Chain;
|
|
89
|
-
address: string;
|
|
90
|
-
}
|
|
91
|
-
declare function tokenHoldersQueryKey(params: UseTokenHoldersQueryParams): string[];
|
|
92
|
-
declare function fetchTokenHolders(client: API.IClient, { chain, address, ...options }: UseTokenHoldersQueryParams): Promise<_liberfi_io_types.CursorList<TokenHolder>>;
|
|
93
|
-
declare function useTokenHoldersQuery(params: UseTokenHoldersQueryParams, options?: Omit<UseQueryOptions<API.CursorList<TokenHolder>, Error, API.CursorList<TokenHolder>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<API.CursorList<TokenHolder>, Error>;
|
|
94
|
-
|
|
95
|
-
interface UseTokenMarketDataQueryParams {
|
|
96
|
-
chain: Chain;
|
|
97
|
-
address: string;
|
|
98
|
-
}
|
|
99
|
-
declare function tokenMarketDataQueryKey(params: UseTokenMarketDataQueryParams): string[];
|
|
100
|
-
declare function fetchTokenMarketData(client: API.IClient, { chain, address }: UseTokenMarketDataQueryParams): Promise<TokenMarketData>;
|
|
101
|
-
declare function useTokenMarketDataQuery(params: UseTokenMarketDataQueryParams, options?: Omit<UseQueryOptions<TokenMarketData, Error, TokenMarketData, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenMarketData, Error>;
|
|
102
|
-
|
|
103
|
-
interface UseTokenQueryParams {
|
|
104
|
-
chain: Chain;
|
|
105
|
-
address: string;
|
|
106
|
-
}
|
|
107
|
-
declare function tokenQueryKey(params: UseTokenQueryParams): string[];
|
|
108
|
-
declare function fetchToken(client: API.IClient, { chain, address }: UseTokenQueryParams): Promise<Token>;
|
|
109
|
-
declare function useTokenQuery(params: UseTokenQueryParams, options?: Omit<UseQueryOptions<Token, Error, Token, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token, Error>;
|
|
110
|
-
|
|
111
|
-
interface UseTokenSecurityQueryParams {
|
|
112
|
-
chain: Chain;
|
|
113
|
-
address: string;
|
|
114
|
-
}
|
|
115
|
-
declare function tokenSecurityQueryKey(params: UseTokenSecurityQueryParams): string[];
|
|
116
|
-
declare function fetchTokenSecurity(client: API.IClient, { chain, address }: UseTokenSecurityQueryParams): Promise<TokenSecurity>;
|
|
117
|
-
declare function useTokenSecurityQuery(params: UseTokenSecurityQueryParams, options?: Omit<UseQueryOptions<TokenSecurity, Error, TokenSecurity, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenSecurity, Error>;
|
|
118
|
-
|
|
119
|
-
interface UseTokensQueryParams {
|
|
120
|
-
chain: Chain;
|
|
121
|
-
addresses: Array<string>;
|
|
122
|
-
}
|
|
123
|
-
declare function tokensQueryKey(params: UseTokensQueryParams): string[];
|
|
124
|
-
declare function fetchTokens(client: API.IClient, { chain, addresses }: UseTokensQueryParams): Promise<Token[]>;
|
|
125
|
-
declare function useTokensQuery(params: UseTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
126
|
-
|
|
127
|
-
interface UseTokenStatsQueryParams {
|
|
128
|
-
chain: Chain;
|
|
129
|
-
address: string;
|
|
130
|
-
}
|
|
131
|
-
declare function tokenStatsQueryKey(params: UseTokenStatsQueryParams): string[];
|
|
132
|
-
declare function fetchTokenStats(client: API.IClient, { chain, address }: UseTokenStatsQueryParams): Promise<TokenStats>;
|
|
133
|
-
declare function useTokenStatsQuery(params: UseTokenStatsQueryParams, options?: Omit<UseQueryOptions<TokenStats, Error, TokenStats, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenStats, Error>;
|
|
134
|
-
|
|
135
|
-
interface UseTokenTradeActivitiesQueryParams extends API.GetTradeActivitiesOptions {
|
|
136
|
-
chain: Chain;
|
|
137
|
-
address: string;
|
|
138
|
-
}
|
|
139
|
-
declare function tokenTradeActivitiesQueryKey(params: UseTokenTradeActivitiesQueryParams): string[];
|
|
140
|
-
declare function fetchTokenTradeActivities(client: API.IClient, { chain, address, ...options }: UseTokenTradeActivitiesQueryParams): Promise<_liberfi_io_types.CursorList<TradeActivity>>;
|
|
141
|
-
declare function useTokenTradeActivitiesQuery(params: UseTokenTradeActivitiesQueryParams, options?: Omit<UseQueryOptions<API.CursorList<TradeActivity>, Error, API.CursorList<TradeActivity>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<API.CursorList<TradeActivity>, Error>;
|
|
142
|
-
|
|
143
|
-
interface UseTrendingTokensQueryParams extends API.GetTokenListOptions {
|
|
144
|
-
chain: Chain;
|
|
145
|
-
resolution: "1m" | "5m" | "1h" | "4h" | "24h";
|
|
146
|
-
}
|
|
147
|
-
declare function trendingTokensQueryKey(params: UseTrendingTokensQueryParams): string[];
|
|
148
|
-
declare function fetchTrendingTokens(client: API.IClient, { chain, resolution, ...options }: UseTrendingTokensQueryParams): Promise<Token[]>;
|
|
149
|
-
declare function useTrendingTokensQuery(params: UseTrendingTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
150
|
-
|
|
151
|
-
interface UseTxSuccessQueryParams {
|
|
152
|
-
chain: Chain;
|
|
153
|
-
txHash: string;
|
|
154
|
-
timeout?: number;
|
|
155
|
-
}
|
|
156
|
-
declare function txSuccessQueryKey(params: UseTxSuccessQueryParams): string[];
|
|
157
|
-
declare function fetchTxSuccess(client: API.IClient, { chain, txHash, timeout }: UseTxSuccessQueryParams): Promise<boolean>;
|
|
158
|
-
declare function useTxSuccessQuery(params: UseTxSuccessQueryParams, options?: Omit<UseQueryOptions<boolean, Error, boolean, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<boolean, Error>;
|
|
159
|
-
|
|
160
|
-
interface UseWalletPortfoliosQueryParams {
|
|
161
|
-
chain: Chain;
|
|
162
|
-
address: string;
|
|
163
|
-
}
|
|
164
|
-
declare function walletPortfoliosQueryKey(params: UseWalletPortfoliosQueryParams): string[];
|
|
165
|
-
declare function fetchWalletPortfolios(client: API.IClient, { chain, address }: UseWalletPortfoliosQueryParams): Promise<WalletPortfolios>;
|
|
166
|
-
declare function useWalletPortfoliosQuery(params: UseWalletPortfoliosQueryParams, options?: Omit<UseQueryOptions<WalletPortfolios, Error, WalletPortfolios, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<WalletPortfolios, Error>;
|
|
167
|
-
|
|
168
|
-
interface UseWalletTradeActivitiesQueryParams extends API.GetTradeActivitiesOptions {
|
|
169
|
-
chain: Chain;
|
|
170
|
-
address: string;
|
|
171
|
-
}
|
|
172
|
-
declare function walletTradeActivitiesQueryKey(params: UseWalletTradeActivitiesQueryParams): string[];
|
|
173
|
-
declare function fetchWalletTradeActivities(client: API.IClient, { chain, address, ...options }: UseWalletTradeActivitiesQueryParams): Promise<_liberfi_io_types.CursorList<TradeActivity>>;
|
|
174
|
-
declare function useWalletTradeActivitiesQuery(params: UseWalletTradeActivitiesQueryParams, options?: Omit<UseQueryOptions<API.CursorList<TradeActivity>, Error, API.CursorList<TradeActivity>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<API.CursorList<TradeActivity>, Error>;
|
|
175
|
-
|
|
176
|
-
interface WalletConnectorContextValue {
|
|
177
|
-
/**
|
|
178
|
-
* detecting: is detecting connected wallets
|
|
179
|
-
* connecting: is connecting to the first wallet
|
|
180
|
-
* connected: is connected to at least one wallet
|
|
181
|
-
* disconnecting: is disconnecting from the last connected wallet
|
|
182
|
-
* disconnected: is disconnected from all wallets
|
|
183
|
-
*/
|
|
184
|
-
status: "detecting" | "connecting" | "connected" | "disconnecting" | "disconnected";
|
|
185
|
-
wallets: Array<WalletAdapter>;
|
|
186
|
-
connect: () => Promise<void>;
|
|
187
|
-
disconnect: () => Promise<void>;
|
|
188
|
-
}
|
|
189
|
-
declare const WalletConnectorContext: react.Context<WalletConnectorContextValue>;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* use wallet connector hook
|
|
193
|
-
* @returns wallet connector
|
|
194
|
-
*/
|
|
195
|
-
declare function useWalletConnector(): WalletConnectorContextValue;
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* use wallets hook
|
|
199
|
-
* @returns all wallets that can be used to take onchain actions
|
|
200
|
-
*/
|
|
201
|
-
declare function useWallets(): _liberfi_io_core.WalletAdapter[];
|
|
202
|
-
|
|
203
|
-
type WalletConnectorProviderProps = PropsWithChildren<WalletConnectorContextValue>;
|
|
204
|
-
declare function WalletConnectorProvider({ children, ...value }: WalletConnectorProviderProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare const _default: "0.1.6";
|
|
205
15
|
|
|
206
16
|
type UseBooleanReturn = [
|
|
207
17
|
/** current state */
|
|
@@ -311,7 +121,7 @@ declare function useTickAge(birthday?: number | Date, interval?: number): number
|
|
|
311
121
|
declare function useValueRef<T>(value: T): RefObject<T>;
|
|
312
122
|
|
|
313
123
|
type NotFunction<T> = T extends (...args: any[]) => any ? never : T;
|
|
314
|
-
declare const useUpdatedRef: <T>(val: NotFunction<T>) =>
|
|
124
|
+
declare const useUpdatedRef: <T>(val: NotFunction<T>) => React$1.RefObject<T>;
|
|
315
125
|
|
|
316
126
|
type noop = (this: any, ...args: any[]) => any;
|
|
317
127
|
type PickFunction<T extends noop> = (this: ThisParameterType<T>, ...args: Parameters<T>) => ReturnType<T>;
|
|
@@ -322,9 +132,9 @@ interface AudioPlayerOptions {
|
|
|
322
132
|
loop?: boolean;
|
|
323
133
|
autoPlay?: boolean;
|
|
324
134
|
}
|
|
325
|
-
declare const useAudioPlayer: (src: string, options?: AudioPlayerOptions) => readonly [
|
|
135
|
+
declare const useAudioPlayer: (src: string, options?: AudioPlayerOptions) => readonly [React__default.DetailedReactHTMLElement<{
|
|
326
136
|
controls: boolean;
|
|
327
|
-
ref:
|
|
137
|
+
ref: React__default.RefObject<HTMLAudioElement | null>;
|
|
328
138
|
autoPlay: boolean | undefined;
|
|
329
139
|
src: string;
|
|
330
140
|
style: {
|
|
@@ -335,7 +145,7 @@ declare const useAudioPlayer: (src: string, options?: AudioPlayerOptions) => rea
|
|
|
335
145
|
onPause: () => void;
|
|
336
146
|
onEnded: () => void;
|
|
337
147
|
onError: () => void;
|
|
338
|
-
}, HTMLAudioElement>,
|
|
148
|
+
}, HTMLAudioElement>, React__default.RefObject<HTMLAudioElement | null>, "idle" | "play" | "playing" | "paused" | "ended" | "error"];
|
|
339
149
|
|
|
340
150
|
declare const useEventEmitter: () => EventEmitter<string | symbol, any>;
|
|
341
151
|
|
|
@@ -352,4 +162,4 @@ declare const useSimpleDI: <T>() => {
|
|
|
352
162
|
register: typeof SimpleDI.register;
|
|
353
163
|
};
|
|
354
164
|
|
|
355
|
-
export {
|
|
165
|
+
export { type TickCallback, type TickEvent, type UnsubscribeTick, type UseBooleanReturn, type UseResizeObserverOptions, parseJSON, useAudioPlayer, useBoolean, useCallbackRef, useEventEmitter, useIsMounted, useLocalStorage, useMemoizedFn, useResizeObserver, useSafeLayoutEffect, useSessionStorage, useSimpleDI, useTick, useTickAge, useUpdatedRef, useValueRef, _default as version };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { API, Chain, Token, TokenResolution, TokenCandle, TokenHolder, TokenMarketData, TokenSecurity, TokenStats, TradeActivity, WalletPortfolios } from '@liberfi.io/types';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
|
-
import { UseQueryOptions, UseMutationOptions } from '@tanstack/react-query';
|
|
8
|
-
import * as _liberfi_io_core from '@liberfi.io/core';
|
|
9
|
-
import { WalletAdapter, EventEmitter, SimpleDI } from '@liberfi.io/core';
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { RefObject, useLayoutEffect } from 'react';
|
|
3
|
+
import { EventEmitter, SimpleDI } from '@liberfi.io/core';
|
|
10
4
|
export { default as useConstant } from 'use-constant';
|
|
11
5
|
export * from 'use-debounce';
|
|
12
6
|
|
|
@@ -17,191 +11,7 @@ declare global {
|
|
|
17
11
|
};
|
|
18
12
|
}
|
|
19
13
|
}
|
|
20
|
-
declare const _default: "0.1.
|
|
21
|
-
|
|
22
|
-
interface APIClientContextValue {
|
|
23
|
-
client: API.IClient;
|
|
24
|
-
subscribeClient: API.ISubscribeClient;
|
|
25
|
-
}
|
|
26
|
-
declare const APIClientContext: react.Context<APIClientContextValue>;
|
|
27
|
-
|
|
28
|
-
type APIClientProviderProps = PropsWithChildren<APIClientContextValue>;
|
|
29
|
-
declare function APIClientProvider({ client, subscribeClient, children, }: APIClientProviderProps): react_jsx_runtime.JSX.Element;
|
|
30
|
-
|
|
31
|
-
declare function useAPIClient(): APIClientContextValue;
|
|
32
|
-
|
|
33
|
-
interface UseFinalStretchTokensQueryParams extends API.GetTokenListOptions {
|
|
34
|
-
chain: Chain;
|
|
35
|
-
}
|
|
36
|
-
declare function finalStretchTokensQueryKey(params: UseFinalStretchTokensQueryParams): string[];
|
|
37
|
-
declare function fetchFinalStretchTokens(client: API.IClient, { chain, ...options }: UseFinalStretchTokensQueryParams): Promise<Token[]>;
|
|
38
|
-
declare function useFinalStretchTokensQuery(params: UseFinalStretchTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
39
|
-
|
|
40
|
-
interface UseMigratedTokensQueryParams extends API.GetTokenListOptions {
|
|
41
|
-
chain: Chain;
|
|
42
|
-
}
|
|
43
|
-
declare function migratedTokensQueryKey(params: UseMigratedTokensQueryParams): string[];
|
|
44
|
-
declare function fetchMigratedTokens(client: API.IClient, { chain, ...options }: UseMigratedTokensQueryParams): Promise<Token[]>;
|
|
45
|
-
declare function useMigratedTokensQuery(params: UseMigratedTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
46
|
-
|
|
47
|
-
interface UseNewTokensQueryParams extends API.GetTokenListOptions {
|
|
48
|
-
chain: Chain;
|
|
49
|
-
}
|
|
50
|
-
declare function newTokensQueryKey(params: UseNewTokensQueryParams): string[];
|
|
51
|
-
declare function fetchNewTokens(client: API.IClient, { chain, ...options }: UseNewTokensQueryParams): Promise<Token[]>;
|
|
52
|
-
declare function useNewTokensQuery(params: UseNewTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
53
|
-
|
|
54
|
-
declare function fetchPresignedUploadUrl(client: API.IClient): Promise<string>;
|
|
55
|
-
declare function usePresignedUploadUrlQuery(options?: Omit<UseQueryOptions<string, Error, string, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<string, Error>;
|
|
56
|
-
|
|
57
|
-
type UseSearchTokensQueryParams = API.SearchTokensOptions;
|
|
58
|
-
declare function searchTokensQueryKey(params: UseSearchTokensQueryParams): string[];
|
|
59
|
-
declare function fetchSearchTokens(client: API.IClient, params: UseSearchTokensQueryParams): Promise<_liberfi_io_types.SearchTokenCursorList>;
|
|
60
|
-
declare function useSearchTokensQuery(params: UseSearchTokensQueryParams, options?: Omit<UseQueryOptions<API.SearchTokenCursorList, Error, API.SearchTokenCursorList, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<_liberfi_io_types.SearchTokenCursorList, Error>;
|
|
61
|
-
|
|
62
|
-
type UseSendTxMutationParams = API.SendTxParams;
|
|
63
|
-
declare function sendTx(client: API.IClient, params: UseSendTxMutationParams): Promise<_liberfi_io_types.SendTxResult>;
|
|
64
|
-
declare function useSendTxMutation(options?: Omit<UseMutationOptions<API.SendTxResult, Error, UseSendTxMutationParams>, "mutationFn">): _tanstack_react_query.UseMutationResult<_liberfi_io_types.SendTxResult, Error, _liberfi_io_types.SendTxParams, unknown>;
|
|
65
|
-
|
|
66
|
-
interface UseStockTokensQueryParams extends API.GetTokenListOptions {
|
|
67
|
-
chain: Chain;
|
|
68
|
-
}
|
|
69
|
-
declare function stockTokensQueryKey(params: UseStockTokensQueryParams): string[];
|
|
70
|
-
declare function fetchStockTokens(client: API.IClient, { chain, ...options }: UseStockTokensQueryParams): Promise<Token[]>;
|
|
71
|
-
declare function useStockTokensQuery(params: UseStockTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
72
|
-
|
|
73
|
-
type UseSwapRouteQueryParams = API.SwapParams;
|
|
74
|
-
declare function swapRouteQueryKey(params: UseSwapRouteQueryParams): string[];
|
|
75
|
-
declare function fetchSwapRoute(client: API.IClient, params: UseSwapRouteQueryParams): Promise<_liberfi_io_types.SwapRoute>;
|
|
76
|
-
declare function useSwapRouteQuery(params: UseSwapRouteQueryParams, options?: Omit<UseQueryOptions<API.SwapRoute, Error, API.SwapRoute, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<_liberfi_io_types.SwapRoute, Error>;
|
|
77
|
-
|
|
78
|
-
interface UseTokenCandlesQueryParams extends API.GetTokenCandlesOptions {
|
|
79
|
-
chain: Chain;
|
|
80
|
-
address: string;
|
|
81
|
-
resolution: TokenResolution;
|
|
82
|
-
}
|
|
83
|
-
declare function tokenCandlesQueryKey(params: UseTokenCandlesQueryParams): string[];
|
|
84
|
-
declare function fetchTokenCandles(client: API.IClient, { chain, address, resolution, ...options }: UseTokenCandlesQueryParams): Promise<TokenCandle[]>;
|
|
85
|
-
declare function useTokenCandlesQuery(params: UseTokenCandlesQueryParams, options?: Omit<UseQueryOptions<Array<TokenCandle>, Error, Array<TokenCandle>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenCandle[], Error>;
|
|
86
|
-
|
|
87
|
-
interface UseTokenHoldersQueryParams extends API.CursorListOptions {
|
|
88
|
-
chain: Chain;
|
|
89
|
-
address: string;
|
|
90
|
-
}
|
|
91
|
-
declare function tokenHoldersQueryKey(params: UseTokenHoldersQueryParams): string[];
|
|
92
|
-
declare function fetchTokenHolders(client: API.IClient, { chain, address, ...options }: UseTokenHoldersQueryParams): Promise<_liberfi_io_types.CursorList<TokenHolder>>;
|
|
93
|
-
declare function useTokenHoldersQuery(params: UseTokenHoldersQueryParams, options?: Omit<UseQueryOptions<API.CursorList<TokenHolder>, Error, API.CursorList<TokenHolder>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<API.CursorList<TokenHolder>, Error>;
|
|
94
|
-
|
|
95
|
-
interface UseTokenMarketDataQueryParams {
|
|
96
|
-
chain: Chain;
|
|
97
|
-
address: string;
|
|
98
|
-
}
|
|
99
|
-
declare function tokenMarketDataQueryKey(params: UseTokenMarketDataQueryParams): string[];
|
|
100
|
-
declare function fetchTokenMarketData(client: API.IClient, { chain, address }: UseTokenMarketDataQueryParams): Promise<TokenMarketData>;
|
|
101
|
-
declare function useTokenMarketDataQuery(params: UseTokenMarketDataQueryParams, options?: Omit<UseQueryOptions<TokenMarketData, Error, TokenMarketData, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenMarketData, Error>;
|
|
102
|
-
|
|
103
|
-
interface UseTokenQueryParams {
|
|
104
|
-
chain: Chain;
|
|
105
|
-
address: string;
|
|
106
|
-
}
|
|
107
|
-
declare function tokenQueryKey(params: UseTokenQueryParams): string[];
|
|
108
|
-
declare function fetchToken(client: API.IClient, { chain, address }: UseTokenQueryParams): Promise<Token>;
|
|
109
|
-
declare function useTokenQuery(params: UseTokenQueryParams, options?: Omit<UseQueryOptions<Token, Error, Token, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token, Error>;
|
|
110
|
-
|
|
111
|
-
interface UseTokenSecurityQueryParams {
|
|
112
|
-
chain: Chain;
|
|
113
|
-
address: string;
|
|
114
|
-
}
|
|
115
|
-
declare function tokenSecurityQueryKey(params: UseTokenSecurityQueryParams): string[];
|
|
116
|
-
declare function fetchTokenSecurity(client: API.IClient, { chain, address }: UseTokenSecurityQueryParams): Promise<TokenSecurity>;
|
|
117
|
-
declare function useTokenSecurityQuery(params: UseTokenSecurityQueryParams, options?: Omit<UseQueryOptions<TokenSecurity, Error, TokenSecurity, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenSecurity, Error>;
|
|
118
|
-
|
|
119
|
-
interface UseTokensQueryParams {
|
|
120
|
-
chain: Chain;
|
|
121
|
-
addresses: Array<string>;
|
|
122
|
-
}
|
|
123
|
-
declare function tokensQueryKey(params: UseTokensQueryParams): string[];
|
|
124
|
-
declare function fetchTokens(client: API.IClient, { chain, addresses }: UseTokensQueryParams): Promise<Token[]>;
|
|
125
|
-
declare function useTokensQuery(params: UseTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
126
|
-
|
|
127
|
-
interface UseTokenStatsQueryParams {
|
|
128
|
-
chain: Chain;
|
|
129
|
-
address: string;
|
|
130
|
-
}
|
|
131
|
-
declare function tokenStatsQueryKey(params: UseTokenStatsQueryParams): string[];
|
|
132
|
-
declare function fetchTokenStats(client: API.IClient, { chain, address }: UseTokenStatsQueryParams): Promise<TokenStats>;
|
|
133
|
-
declare function useTokenStatsQuery(params: UseTokenStatsQueryParams, options?: Omit<UseQueryOptions<TokenStats, Error, TokenStats, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenStats, Error>;
|
|
134
|
-
|
|
135
|
-
interface UseTokenTradeActivitiesQueryParams extends API.GetTradeActivitiesOptions {
|
|
136
|
-
chain: Chain;
|
|
137
|
-
address: string;
|
|
138
|
-
}
|
|
139
|
-
declare function tokenTradeActivitiesQueryKey(params: UseTokenTradeActivitiesQueryParams): string[];
|
|
140
|
-
declare function fetchTokenTradeActivities(client: API.IClient, { chain, address, ...options }: UseTokenTradeActivitiesQueryParams): Promise<_liberfi_io_types.CursorList<TradeActivity>>;
|
|
141
|
-
declare function useTokenTradeActivitiesQuery(params: UseTokenTradeActivitiesQueryParams, options?: Omit<UseQueryOptions<API.CursorList<TradeActivity>, Error, API.CursorList<TradeActivity>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<API.CursorList<TradeActivity>, Error>;
|
|
142
|
-
|
|
143
|
-
interface UseTrendingTokensQueryParams extends API.GetTokenListOptions {
|
|
144
|
-
chain: Chain;
|
|
145
|
-
resolution: "1m" | "5m" | "1h" | "4h" | "24h";
|
|
146
|
-
}
|
|
147
|
-
declare function trendingTokensQueryKey(params: UseTrendingTokensQueryParams): string[];
|
|
148
|
-
declare function fetchTrendingTokens(client: API.IClient, { chain, resolution, ...options }: UseTrendingTokensQueryParams): Promise<Token[]>;
|
|
149
|
-
declare function useTrendingTokensQuery(params: UseTrendingTokensQueryParams, options?: Omit<UseQueryOptions<Array<Token>, Error, Array<Token>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Token[], Error>;
|
|
150
|
-
|
|
151
|
-
interface UseTxSuccessQueryParams {
|
|
152
|
-
chain: Chain;
|
|
153
|
-
txHash: string;
|
|
154
|
-
timeout?: number;
|
|
155
|
-
}
|
|
156
|
-
declare function txSuccessQueryKey(params: UseTxSuccessQueryParams): string[];
|
|
157
|
-
declare function fetchTxSuccess(client: API.IClient, { chain, txHash, timeout }: UseTxSuccessQueryParams): Promise<boolean>;
|
|
158
|
-
declare function useTxSuccessQuery(params: UseTxSuccessQueryParams, options?: Omit<UseQueryOptions<boolean, Error, boolean, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<boolean, Error>;
|
|
159
|
-
|
|
160
|
-
interface UseWalletPortfoliosQueryParams {
|
|
161
|
-
chain: Chain;
|
|
162
|
-
address: string;
|
|
163
|
-
}
|
|
164
|
-
declare function walletPortfoliosQueryKey(params: UseWalletPortfoliosQueryParams): string[];
|
|
165
|
-
declare function fetchWalletPortfolios(client: API.IClient, { chain, address }: UseWalletPortfoliosQueryParams): Promise<WalletPortfolios>;
|
|
166
|
-
declare function useWalletPortfoliosQuery(params: UseWalletPortfoliosQueryParams, options?: Omit<UseQueryOptions<WalletPortfolios, Error, WalletPortfolios, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<WalletPortfolios, Error>;
|
|
167
|
-
|
|
168
|
-
interface UseWalletTradeActivitiesQueryParams extends API.GetTradeActivitiesOptions {
|
|
169
|
-
chain: Chain;
|
|
170
|
-
address: string;
|
|
171
|
-
}
|
|
172
|
-
declare function walletTradeActivitiesQueryKey(params: UseWalletTradeActivitiesQueryParams): string[];
|
|
173
|
-
declare function fetchWalletTradeActivities(client: API.IClient, { chain, address, ...options }: UseWalletTradeActivitiesQueryParams): Promise<_liberfi_io_types.CursorList<TradeActivity>>;
|
|
174
|
-
declare function useWalletTradeActivitiesQuery(params: UseWalletTradeActivitiesQueryParams, options?: Omit<UseQueryOptions<API.CursorList<TradeActivity>, Error, API.CursorList<TradeActivity>, string[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<API.CursorList<TradeActivity>, Error>;
|
|
175
|
-
|
|
176
|
-
interface WalletConnectorContextValue {
|
|
177
|
-
/**
|
|
178
|
-
* detecting: is detecting connected wallets
|
|
179
|
-
* connecting: is connecting to the first wallet
|
|
180
|
-
* connected: is connected to at least one wallet
|
|
181
|
-
* disconnecting: is disconnecting from the last connected wallet
|
|
182
|
-
* disconnected: is disconnected from all wallets
|
|
183
|
-
*/
|
|
184
|
-
status: "detecting" | "connecting" | "connected" | "disconnecting" | "disconnected";
|
|
185
|
-
wallets: Array<WalletAdapter>;
|
|
186
|
-
connect: () => Promise<void>;
|
|
187
|
-
disconnect: () => Promise<void>;
|
|
188
|
-
}
|
|
189
|
-
declare const WalletConnectorContext: react.Context<WalletConnectorContextValue>;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* use wallet connector hook
|
|
193
|
-
* @returns wallet connector
|
|
194
|
-
*/
|
|
195
|
-
declare function useWalletConnector(): WalletConnectorContextValue;
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* use wallets hook
|
|
199
|
-
* @returns all wallets that can be used to take onchain actions
|
|
200
|
-
*/
|
|
201
|
-
declare function useWallets(): _liberfi_io_core.WalletAdapter[];
|
|
202
|
-
|
|
203
|
-
type WalletConnectorProviderProps = PropsWithChildren<WalletConnectorContextValue>;
|
|
204
|
-
declare function WalletConnectorProvider({ children, ...value }: WalletConnectorProviderProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare const _default: "0.1.6";
|
|
205
15
|
|
|
206
16
|
type UseBooleanReturn = [
|
|
207
17
|
/** current state */
|
|
@@ -311,7 +121,7 @@ declare function useTickAge(birthday?: number | Date, interval?: number): number
|
|
|
311
121
|
declare function useValueRef<T>(value: T): RefObject<T>;
|
|
312
122
|
|
|
313
123
|
type NotFunction<T> = T extends (...args: any[]) => any ? never : T;
|
|
314
|
-
declare const useUpdatedRef: <T>(val: NotFunction<T>) =>
|
|
124
|
+
declare const useUpdatedRef: <T>(val: NotFunction<T>) => React$1.RefObject<T>;
|
|
315
125
|
|
|
316
126
|
type noop = (this: any, ...args: any[]) => any;
|
|
317
127
|
type PickFunction<T extends noop> = (this: ThisParameterType<T>, ...args: Parameters<T>) => ReturnType<T>;
|
|
@@ -322,9 +132,9 @@ interface AudioPlayerOptions {
|
|
|
322
132
|
loop?: boolean;
|
|
323
133
|
autoPlay?: boolean;
|
|
324
134
|
}
|
|
325
|
-
declare const useAudioPlayer: (src: string, options?: AudioPlayerOptions) => readonly [
|
|
135
|
+
declare const useAudioPlayer: (src: string, options?: AudioPlayerOptions) => readonly [React__default.DetailedReactHTMLElement<{
|
|
326
136
|
controls: boolean;
|
|
327
|
-
ref:
|
|
137
|
+
ref: React__default.RefObject<HTMLAudioElement | null>;
|
|
328
138
|
autoPlay: boolean | undefined;
|
|
329
139
|
src: string;
|
|
330
140
|
style: {
|
|
@@ -335,7 +145,7 @@ declare const useAudioPlayer: (src: string, options?: AudioPlayerOptions) => rea
|
|
|
335
145
|
onPause: () => void;
|
|
336
146
|
onEnded: () => void;
|
|
337
147
|
onError: () => void;
|
|
338
|
-
}, HTMLAudioElement>,
|
|
148
|
+
}, HTMLAudioElement>, React__default.RefObject<HTMLAudioElement | null>, "idle" | "play" | "playing" | "paused" | "ended" | "error"];
|
|
339
149
|
|
|
340
150
|
declare const useEventEmitter: () => EventEmitter<string | symbol, any>;
|
|
341
151
|
|
|
@@ -352,4 +162,4 @@ declare const useSimpleDI: <T>() => {
|
|
|
352
162
|
register: typeof SimpleDI.register;
|
|
353
163
|
};
|
|
354
164
|
|
|
355
|
-
export {
|
|
165
|
+
export { type TickCallback, type TickEvent, type UnsubscribeTick, type UseBooleanReturn, type UseResizeObserverOptions, parseJSON, useAudioPlayer, useBoolean, useCallbackRef, useEventEmitter, useIsMounted, useLocalStorage, useMemoizedFn, useResizeObserver, useSafeLayoutEffect, useSessionStorage, useSimpleDI, useTick, useTickAge, useUpdatedRef, useValueRef, _default as version };
|