@tokemak/hooks 0.0.2
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.ts +59 -0
- package/dist/index.js +1542 -0
- package/package.json +30 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as _tokemak_config from '@tokemak/config';
|
|
2
|
+
import { CoreNetworkConfig } from '@tokemak/config';
|
|
3
|
+
import * as viem from 'viem';
|
|
4
|
+
import * as react from 'react';
|
|
5
|
+
|
|
6
|
+
declare const useClipboard: () => {
|
|
7
|
+
isCopied: boolean;
|
|
8
|
+
copyToClipboard: (text: string) => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
declare const useInputErrors: (balance: string | undefined, amount: string) => {
|
|
12
|
+
hasError: boolean | undefined;
|
|
13
|
+
inputMsg: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare const useCoreConfig: (chainId?: number) => CoreNetworkConfig;
|
|
17
|
+
|
|
18
|
+
declare const useUserAccount: () => {
|
|
19
|
+
address: `0x${string}` | undefined;
|
|
20
|
+
ensName: viem.GetEnsNameReturnType | undefined;
|
|
21
|
+
ensAvatar: viem.GetEnsAvatarReturnType | undefined;
|
|
22
|
+
truncatedAddress: string | null;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare const useIsChainSupported: () => boolean;
|
|
26
|
+
|
|
27
|
+
declare const useMainnetConfig: () => _tokemak_config.MainnetNetworkConfig;
|
|
28
|
+
|
|
29
|
+
declare const useAmountPrice: (amount?: string, price?: number) => string;
|
|
30
|
+
|
|
31
|
+
interface AutoSlippageConfig {
|
|
32
|
+
estimatedPriceImpact?: number;
|
|
33
|
+
maxSlippage?: number;
|
|
34
|
+
margin?: number;
|
|
35
|
+
defaultSlippage?: number;
|
|
36
|
+
}
|
|
37
|
+
declare const useAutoSlippage: ({ estimatedPriceImpact, maxSlippage, margin, defaultSlippage, }: AutoSlippageConfig) => number;
|
|
38
|
+
|
|
39
|
+
declare const useDebounce: <T>(value: T, delay: number) => [T, boolean];
|
|
40
|
+
|
|
41
|
+
declare function useLocalStorageState<T>(key: string, defaultValue: T): readonly [T, react.Dispatch<react.SetStateAction<T>>];
|
|
42
|
+
|
|
43
|
+
declare const useIsDev: () => boolean;
|
|
44
|
+
|
|
45
|
+
declare const useBrowserDetect: () => {
|
|
46
|
+
isChrome: boolean;
|
|
47
|
+
isSafari: boolean;
|
|
48
|
+
isFirefox: boolean;
|
|
49
|
+
isEdge: boolean;
|
|
50
|
+
isOpera: boolean;
|
|
51
|
+
isIE: boolean;
|
|
52
|
+
isIOS: boolean;
|
|
53
|
+
isAndroid: boolean;
|
|
54
|
+
isWindows: boolean;
|
|
55
|
+
isMacOS: boolean;
|
|
56
|
+
isLinux: boolean;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { useAmountPrice, useAutoSlippage, useBrowserDetect, useClipboard, useCoreConfig, useDebounce, useInputErrors, useIsChainSupported, useIsDev, useLocalStorageState, useMainnetConfig, useUserAccount };
|