wagmi 0.2.21 → 0.3.0-next.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/README.md +5 -3
- package/connectors/coinbaseWallet/dist/wagmi-connectors-coinbaseWallet.cjs.d.ts +1 -0
- package/connectors/coinbaseWallet/dist/wagmi-connectors-coinbaseWallet.cjs.dev.js +12 -0
- package/connectors/coinbaseWallet/dist/wagmi-connectors-coinbaseWallet.cjs.js +7 -0
- package/connectors/coinbaseWallet/dist/wagmi-connectors-coinbaseWallet.cjs.prod.js +12 -0
- package/connectors/coinbaseWallet/dist/wagmi-connectors-coinbaseWallet.esm.js +1 -0
- package/connectors/coinbaseWallet/package.json +4 -0
- package/connectors/injected/dist/wagmi-connectors-injected.cjs.dev.js +2 -2
- package/connectors/injected/dist/wagmi-connectors-injected.cjs.prod.js +2 -2
- package/connectors/injected/dist/wagmi-connectors-injected.esm.js +1 -1
- package/connectors/walletConnect/dist/wagmi-connectors-walletConnect.cjs.dev.js +1 -1
- package/connectors/walletConnect/dist/wagmi-connectors-walletConnect.cjs.prod.js +1 -1
- package/connectors/walletConnect/dist/wagmi-connectors-walletConnect.esm.js +1 -1
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.cjs.d.ts +11 -1
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.cjs.js +15 -6
- package/dist/declarations/src/connectors/coinbaseWallet.d.ts +1 -0
- package/dist/declarations/src/connectors/injected.d.ts +1 -1
- package/dist/declarations/src/connectors/walletConnect.d.ts +1 -1
- package/dist/declarations/src/context.d.ts +12 -59
- package/dist/declarations/src/hooks/accounts/index.d.ts +0 -1
- package/dist/declarations/src/hooks/accounts/useAccount.d.ts +179 -11
- package/dist/declarations/src/hooks/accounts/useBalance.d.ts +15 -26
- package/dist/declarations/src/hooks/accounts/useConnect.d.ts +95 -13
- package/dist/declarations/src/hooks/accounts/useNetwork.d.ts +87 -29
- package/dist/declarations/src/hooks/accounts/useSignMessage.d.ts +63 -15
- package/dist/declarations/src/hooks/accounts/useSigner.d.ts +117 -11
- package/dist/declarations/src/hooks/contracts/index.d.ts +1 -1
- package/dist/declarations/src/hooks/contracts/useContract.d.ts +3 -11
- package/dist/declarations/src/hooks/contracts/useContractEvent.d.ts +3 -4
- package/dist/declarations/src/hooks/contracts/useContractRead.d.ts +17 -22
- package/dist/declarations/src/hooks/contracts/useContractWrite.d.ts +69 -19
- package/dist/declarations/src/hooks/contracts/useToken.d.ts +13 -42
- package/dist/declarations/src/hooks/ens/index.d.ts +2 -2
- package/dist/declarations/src/hooks/ens/useEnsAddress.d.ts +17 -0
- package/dist/declarations/src/hooks/ens/useEnsAvatar.d.ts +15 -12
- package/dist/declarations/src/hooks/ens/useEnsName.d.ts +17 -0
- package/dist/declarations/src/hooks/ens/useEnsResolver.d.ts +15 -19
- package/dist/declarations/src/hooks/index.d.ts +4 -4
- package/dist/declarations/src/hooks/network-status/useBlockNumber.d.ts +10 -15
- package/dist/declarations/src/hooks/network-status/useFeeData.d.ts +12 -27
- package/dist/declarations/src/hooks/providers/useProvider.d.ts +1 -1
- package/dist/declarations/src/hooks/providers/useWebSocketProvider.d.ts +1 -1
- package/dist/declarations/src/hooks/transactions/index.d.ts +1 -1
- package/dist/declarations/src/hooks/transactions/useSendTransaction.d.ts +69 -0
- package/dist/declarations/src/hooks/transactions/useWaitForTransaction.d.ts +15 -31
- package/dist/declarations/src/hooks/utils/index.d.ts +1 -3
- package/dist/declarations/src/hooks/utils/useChainId.d.ts +1 -0
- package/dist/declarations/src/index.d.ts +3 -5
- package/dist/declarations/src/types/index.d.ts +50 -0
- package/dist/declarations/src/utils/deserialize.d.ts +2 -0
- package/dist/declarations/src/utils/index.d.ts +2 -0
- package/dist/declarations/src/utils/serialize.d.ts +7 -0
- package/dist/wagmi.cjs.dev.js +1103 -1646
- package/dist/wagmi.cjs.prod.js +1103 -1646
- package/dist/wagmi.esm.js +1086 -1603
- package/package.json +15 -17
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.cjs.dev.js +0 -12
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.cjs.prod.js +0 -12
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.esm.js +0 -1
- package/connectors/walletLink/package.json +0 -4
- package/dist/declarations/src/connectors/walletLink.d.ts +0 -1
- package/dist/declarations/src/hooks/accounts/useSignTypedData.d.ts +0 -33
- package/dist/declarations/src/hooks/ens/useEnsLookup.d.ts +0 -20
- package/dist/declarations/src/hooks/ens/useEnsResolveName.d.ts +0 -20
- package/dist/declarations/src/hooks/transactions/useTransaction.d.ts +0 -18
- package/dist/declarations/src/hooks/utils/useCacheBuster.d.ts +0 -1
- package/dist/declarations/src/hooks/utils/useCancel.d.ts +0 -3
- package/dist/declarations/src/hooks/utils/useLocalStorage.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
# wagmi [](https://www.npmjs.com/package/wagmi) [](https://www.npmjs.com/package/wagmi) [](https://github.com/sponsors/tmm)
|
|
1
|
+
# wagmi [](https://www.npmjs.com/package/wagmi) [](https://www.npmjs.com/package/wagmi) [](https://github.com/sponsors/tmm)
|
|
2
2
|
|
|
3
|
-
React Hooks
|
|
3
|
+
> React Hooks for Ethereum
|
|
4
|
+
|
|
5
|
+
**wagmi** is a collection of React Hooks containing everything you need to start working with Ethereum. wagmi makes it easy to "Connect Wallet," display ENS and balance information, sign messages, interact with contracts, and much more — all with caching, request deduplication, and persistence.
|
|
4
6
|
|
|
5
7
|
## Features
|
|
6
8
|
|
|
@@ -78,4 +80,4 @@ MIT.
|
|
|
78
80
|
|
|
79
81
|
<br />
|
|
80
82
|
|
|
81
|
-
wagmi
|
|
83
|
+
wagmi frens
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/declarations/src/connectors/coinbaseWallet";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var coinbaseWallet = require('@wagmi/core/connectors/coinbaseWallet');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'CoinbaseWalletConnector', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return coinbaseWallet.CoinbaseWalletConnector; }
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var coinbaseWallet = require('@wagmi/core/connectors/coinbaseWallet');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'CoinbaseWalletConnector', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return coinbaseWallet.CoinbaseWalletConnector; }
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CoinbaseWalletConnector } from '@wagmi/core/connectors/coinbaseWallet';
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var core = require('@wagmi/core');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, 'InjectedConnector', {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return core.InjectedConnector; }
|
|
12
12
|
});
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var core = require('@wagmi/core');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, 'InjectedConnector', {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return core.InjectedConnector; }
|
|
12
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { InjectedConnector } from 'wagmi
|
|
1
|
+
export { InjectedConnector } from '@wagmi/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { WalletConnectConnector } from 'wagmi
|
|
1
|
+
export { WalletConnectConnector } from '@wagmi/core/connectors/walletConnect';
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
// are you seeing an error that a default export doesn't exist but your source file has a default export?
|
|
2
|
+
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
+
|
|
4
|
+
// curious why you need to?
|
|
5
|
+
// this file exists so that you can import from the entrypoint normally
|
|
6
|
+
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
+
// which means we need to re-export all of the modules from your source file
|
|
8
|
+
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
+
// to check for a default export and re-export it if it exists
|
|
10
|
+
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
+
export * from "../../../src/connectors/walletLink";
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// this file might look strange and you might be wondering what it's for
|
|
3
|
+
// it's lets you import your source files by importing this entrypoint
|
|
4
|
+
// as you would import it if it was built with preconstruct build
|
|
5
|
+
// this file is slightly different to some others though
|
|
6
|
+
// it has a require hook which compiles your code with Babel
|
|
7
|
+
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
+
// but you can still require this module and it'll be compiled
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
// this bit of code imports the require hook and registers it
|
|
11
|
+
let unregister = require("../../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
|
|
12
|
+
|
|
13
|
+
// this re-exports the source file
|
|
14
|
+
module.exports = require("../../../src/connectors/walletLink.ts");
|
|
15
|
+
|
|
16
|
+
unregister();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CoinbaseWalletConnector } from '@wagmi/core/connectors/coinbaseWallet';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { InjectedConnector } from 'wagmi
|
|
1
|
+
export { InjectedConnector } from '@wagmi/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { WalletConnectConnector } from 'wagmi
|
|
1
|
+
export { WalletConnectConnector } from '@wagmi/core/connectors/walletConnect';
|
|
@@ -1,63 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
connector?: Connector;
|
|
8
|
-
data?: ConnectorData<Web3Provider>;
|
|
9
|
-
error?: Error;
|
|
2
|
+
import { WagmiClient, ClientConfig as WagmiClientConfig } from '@wagmi/core';
|
|
3
|
+
import { QueryClient } from 'react-query';
|
|
4
|
+
export declare const Context: React.Context<WagmiClient | undefined>;
|
|
5
|
+
export declare type ClientConfig = WagmiClientConfig & {
|
|
6
|
+
queryClient?: QueryClient;
|
|
10
7
|
};
|
|
11
|
-
declare
|
|
12
|
-
|
|
13
|
-
/** Flag for triggering refetch */
|
|
14
|
-
cacheBuster: State['cacheBuster'];
|
|
15
|
-
/** Flag for when connection is in progress */
|
|
16
|
-
connecting?: State['connecting'];
|
|
17
|
-
/** Active connector */
|
|
18
|
-
connector?: State['connector'];
|
|
19
|
-
/** Connectors used for linking accounts */
|
|
20
|
-
connectors: Connector[];
|
|
21
|
-
/** Active data */
|
|
22
|
-
data?: State['data'];
|
|
23
|
-
/** Interface for connecting to network */
|
|
24
|
-
provider: BaseProvider;
|
|
25
|
-
/** Interface for connecting to network */
|
|
26
|
-
webSocketProvider?: WebSocketProvider;
|
|
27
|
-
};
|
|
28
|
-
setState: React.Dispatch<React.SetStateAction<State>>;
|
|
29
|
-
setLastUsedConnector: (newValue: string | null) => void;
|
|
8
|
+
export declare function createClient({ queryClient, ...config }?: ClientConfig): WagmiClient & {
|
|
9
|
+
queryClient: QueryClient;
|
|
30
10
|
};
|
|
31
|
-
export declare
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
autoConnect?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Key for saving connector preference to browser
|
|
37
|
-
* @default 'wagmi.wallet'
|
|
38
|
-
*/
|
|
39
|
-
connectorStorageKey?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Connectors used for linking accounts
|
|
42
|
-
* @default [new InjectedConnector()]
|
|
43
|
-
*/
|
|
44
|
-
connectors?: Connector[] | ((config: {
|
|
45
|
-
chainId?: number;
|
|
46
|
-
}) => Connector[]);
|
|
47
|
-
/**
|
|
48
|
-
* Interface for connecting to network
|
|
49
|
-
* @default getDefaultProvider()
|
|
50
|
-
*/
|
|
51
|
-
provider?: BaseProvider | ((config: {
|
|
52
|
-
chainId?: number;
|
|
53
|
-
connector?: Connector;
|
|
54
|
-
}) => BaseProvider);
|
|
55
|
-
/** WebSocket interface for connecting to network */
|
|
56
|
-
webSocketProvider?: WebSocketProvider | ((config: {
|
|
57
|
-
chainId?: number;
|
|
58
|
-
connector?: Connector;
|
|
59
|
-
}) => WebSocketProvider | undefined);
|
|
11
|
+
export declare type ProviderProps = {
|
|
12
|
+
/** React-decorated WagmiClient instance */
|
|
13
|
+
client?: ReturnType<typeof createClient>;
|
|
60
14
|
};
|
|
61
|
-
export declare
|
|
62
|
-
export declare
|
|
63
|
-
export {};
|
|
15
|
+
export declare function Provider({ children, client, }: React.PropsWithChildren<ProviderProps>): JSX.Element;
|
|
16
|
+
export declare function useClient(): WagmiClient;
|
|
@@ -1,16 +1,184 @@
|
|
|
1
|
-
|
|
1
|
+
import { GetAccountResult, disconnect } from '@wagmi/core';
|
|
2
|
+
import { QueryConfig } from '../../types';
|
|
3
|
+
export declare type UseAccountArgs = {
|
|
2
4
|
/** Fetches ENS for connected account */
|
|
3
|
-
|
|
5
|
+
ens?: boolean | {
|
|
6
|
+
avatar?: boolean;
|
|
7
|
+
name?: boolean;
|
|
8
|
+
};
|
|
4
9
|
};
|
|
5
|
-
export declare
|
|
10
|
+
export declare type UseAccountConfig = QueryConfig<GetAccountResult, Error>;
|
|
11
|
+
export declare const queryKey: () => readonly [{
|
|
12
|
+
readonly entity: "account";
|
|
13
|
+
}];
|
|
14
|
+
export declare function useAccount({ ens, cacheTime, enabled, keepPreviousData, select, staleTime, suspense, onError, onSettled, onSuccess, }?: UseAccountArgs & UseAccountConfig): {
|
|
6
15
|
readonly data: {
|
|
7
|
-
address: string;
|
|
8
|
-
connector: import("wagmi-core").Connector<any, any> | undefined;
|
|
9
16
|
ens: {
|
|
10
|
-
avatar:
|
|
11
|
-
name:
|
|
12
|
-
}
|
|
17
|
+
avatar: import("@wagmi/core").FetchEnsAvatarResult | undefined;
|
|
18
|
+
name: import("@wagmi/core").FetchEnsNameResult | undefined;
|
|
19
|
+
};
|
|
20
|
+
address?: string | undefined;
|
|
21
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
22
|
+
} | {
|
|
23
|
+
ens?: undefined;
|
|
24
|
+
address?: string | undefined;
|
|
25
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
13
26
|
} | undefined;
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
|
|
27
|
+
readonly disconnect: typeof disconnect;
|
|
28
|
+
readonly error: Error | null;
|
|
29
|
+
readonly isError: boolean;
|
|
30
|
+
readonly isIdle: boolean;
|
|
31
|
+
readonly isLoading: boolean;
|
|
32
|
+
readonly isSuccess: boolean;
|
|
33
|
+
readonly status: "error" | "idle" | "loading" | "success";
|
|
34
|
+
readonly isLoadingError: false;
|
|
35
|
+
readonly isRefetchError: false;
|
|
36
|
+
readonly dataUpdatedAt: number;
|
|
37
|
+
readonly errorUpdatedAt: number;
|
|
38
|
+
readonly failureCount: number;
|
|
39
|
+
readonly isFetched: boolean;
|
|
40
|
+
readonly isFetchedAfterMount: boolean;
|
|
41
|
+
readonly isFetching: boolean;
|
|
42
|
+
readonly isPlaceholderData: boolean;
|
|
43
|
+
readonly isPreviousData: boolean;
|
|
44
|
+
readonly isRefetching: boolean;
|
|
45
|
+
readonly isStale: boolean;
|
|
46
|
+
readonly refetch: <TPageData>(options?: (import("react-query").RefetchOptions & import("react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("react-query").QueryObserverResult<GetAccountResult, Error>>;
|
|
47
|
+
readonly remove: () => void;
|
|
48
|
+
} | {
|
|
49
|
+
readonly data: {
|
|
50
|
+
ens: {
|
|
51
|
+
avatar: import("@wagmi/core").FetchEnsAvatarResult | undefined;
|
|
52
|
+
name: import("@wagmi/core").FetchEnsNameResult | undefined;
|
|
53
|
+
};
|
|
54
|
+
address?: string | undefined;
|
|
55
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
56
|
+
} | {
|
|
57
|
+
ens?: undefined;
|
|
58
|
+
address?: string | undefined;
|
|
59
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
readonly disconnect: typeof disconnect;
|
|
62
|
+
readonly error: Error | null;
|
|
63
|
+
readonly isError: boolean;
|
|
64
|
+
readonly isIdle: boolean;
|
|
65
|
+
readonly isLoading: boolean;
|
|
66
|
+
readonly isSuccess: boolean;
|
|
67
|
+
readonly status: "error" | "idle" | "loading" | "success";
|
|
68
|
+
readonly isLoadingError: true;
|
|
69
|
+
readonly isRefetchError: false;
|
|
70
|
+
readonly dataUpdatedAt: number;
|
|
71
|
+
readonly errorUpdatedAt: number;
|
|
72
|
+
readonly failureCount: number;
|
|
73
|
+
readonly isFetched: boolean;
|
|
74
|
+
readonly isFetchedAfterMount: boolean;
|
|
75
|
+
readonly isFetching: boolean;
|
|
76
|
+
readonly isPlaceholderData: boolean;
|
|
77
|
+
readonly isPreviousData: boolean;
|
|
78
|
+
readonly isRefetching: boolean;
|
|
79
|
+
readonly isStale: boolean;
|
|
80
|
+
readonly refetch: <TPageData>(options?: (import("react-query").RefetchOptions & import("react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("react-query").QueryObserverResult<GetAccountResult, Error>>;
|
|
81
|
+
readonly remove: () => void;
|
|
82
|
+
} | {
|
|
83
|
+
readonly data: {
|
|
84
|
+
ens: {
|
|
85
|
+
avatar: import("@wagmi/core").FetchEnsAvatarResult | undefined;
|
|
86
|
+
name: import("@wagmi/core").FetchEnsNameResult | undefined;
|
|
87
|
+
};
|
|
88
|
+
address?: string | undefined;
|
|
89
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
90
|
+
} | {
|
|
91
|
+
ens?: undefined;
|
|
92
|
+
address?: string | undefined;
|
|
93
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
94
|
+
} | undefined;
|
|
95
|
+
readonly disconnect: typeof disconnect;
|
|
96
|
+
readonly error: Error | null;
|
|
97
|
+
readonly isError: boolean;
|
|
98
|
+
readonly isIdle: boolean;
|
|
99
|
+
readonly isLoading: boolean;
|
|
100
|
+
readonly isSuccess: boolean;
|
|
101
|
+
readonly status: "error" | "idle" | "loading" | "success";
|
|
102
|
+
readonly isLoadingError: false;
|
|
103
|
+
readonly isRefetchError: false;
|
|
104
|
+
readonly dataUpdatedAt: number;
|
|
105
|
+
readonly errorUpdatedAt: number;
|
|
106
|
+
readonly failureCount: number;
|
|
107
|
+
readonly isFetched: boolean;
|
|
108
|
+
readonly isFetchedAfterMount: boolean;
|
|
109
|
+
readonly isFetching: boolean;
|
|
110
|
+
readonly isPlaceholderData: boolean;
|
|
111
|
+
readonly isPreviousData: boolean;
|
|
112
|
+
readonly isRefetching: boolean;
|
|
113
|
+
readonly isStale: boolean;
|
|
114
|
+
readonly refetch: <TPageData>(options?: (import("react-query").RefetchOptions & import("react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("react-query").QueryObserverResult<GetAccountResult, Error>>;
|
|
115
|
+
readonly remove: () => void;
|
|
116
|
+
} | {
|
|
117
|
+
readonly data: {
|
|
118
|
+
ens: {
|
|
119
|
+
avatar: import("@wagmi/core").FetchEnsAvatarResult | undefined;
|
|
120
|
+
name: import("@wagmi/core").FetchEnsNameResult | undefined;
|
|
121
|
+
};
|
|
122
|
+
address?: string | undefined;
|
|
123
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
124
|
+
} | {
|
|
125
|
+
ens?: undefined;
|
|
126
|
+
address?: string | undefined;
|
|
127
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
readonly disconnect: typeof disconnect;
|
|
130
|
+
readonly error: Error | null;
|
|
131
|
+
readonly isError: boolean;
|
|
132
|
+
readonly isIdle: boolean;
|
|
133
|
+
readonly isLoading: boolean;
|
|
134
|
+
readonly isSuccess: boolean;
|
|
135
|
+
readonly status: "error" | "idle" | "loading" | "success";
|
|
136
|
+
readonly isLoadingError: false;
|
|
137
|
+
readonly isRefetchError: true;
|
|
138
|
+
readonly dataUpdatedAt: number;
|
|
139
|
+
readonly errorUpdatedAt: number;
|
|
140
|
+
readonly failureCount: number;
|
|
141
|
+
readonly isFetched: boolean;
|
|
142
|
+
readonly isFetchedAfterMount: boolean;
|
|
143
|
+
readonly isFetching: boolean;
|
|
144
|
+
readonly isPlaceholderData: boolean;
|
|
145
|
+
readonly isPreviousData: boolean;
|
|
146
|
+
readonly isRefetching: boolean;
|
|
147
|
+
readonly isStale: boolean;
|
|
148
|
+
readonly refetch: <TPageData>(options?: (import("react-query").RefetchOptions & import("react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("react-query").QueryObserverResult<GetAccountResult, Error>>;
|
|
149
|
+
readonly remove: () => void;
|
|
150
|
+
} | {
|
|
151
|
+
readonly data: {
|
|
152
|
+
ens: {
|
|
153
|
+
avatar: import("@wagmi/core").FetchEnsAvatarResult | undefined;
|
|
154
|
+
name: import("@wagmi/core").FetchEnsNameResult | undefined;
|
|
155
|
+
};
|
|
156
|
+
address?: string | undefined;
|
|
157
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
158
|
+
} | {
|
|
159
|
+
ens?: undefined;
|
|
160
|
+
address?: string | undefined;
|
|
161
|
+
connector?: import("@wagmi/core").Connector<any, any> | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
readonly disconnect: typeof disconnect;
|
|
164
|
+
readonly error: Error | null;
|
|
165
|
+
readonly isError: boolean;
|
|
166
|
+
readonly isIdle: boolean;
|
|
167
|
+
readonly isLoading: boolean;
|
|
168
|
+
readonly isSuccess: boolean;
|
|
169
|
+
readonly status: "error" | "idle" | "loading" | "success";
|
|
170
|
+
readonly isLoadingError: false;
|
|
171
|
+
readonly isRefetchError: false;
|
|
172
|
+
readonly dataUpdatedAt: number;
|
|
173
|
+
readonly errorUpdatedAt: number;
|
|
174
|
+
readonly failureCount: number;
|
|
175
|
+
readonly isFetched: boolean;
|
|
176
|
+
readonly isFetchedAfterMount: boolean;
|
|
177
|
+
readonly isFetching: boolean;
|
|
178
|
+
readonly isPlaceholderData: boolean;
|
|
179
|
+
readonly isPreviousData: boolean;
|
|
180
|
+
readonly isRefetching: boolean;
|
|
181
|
+
readonly isStale: boolean;
|
|
182
|
+
readonly refetch: <TPageData>(options?: (import("react-query").RefetchOptions & import("react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("react-query").QueryObserverResult<GetAccountResult, Error>>;
|
|
183
|
+
readonly remove: () => void;
|
|
184
|
+
};
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare type
|
|
4
|
-
/** Disables fetching */
|
|
5
|
-
skip?: boolean;
|
|
1
|
+
import { FetchBalanceArgs, FetchBalanceResult } from '@wagmi/core';
|
|
2
|
+
import { QueryConfig } from '../../types';
|
|
3
|
+
export declare type UseBalanceArgs = Partial<FetchBalanceArgs> & {
|
|
6
4
|
/** Subscribe to changes */
|
|
7
5
|
watch?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
formatUnits?: Config['formatUnits'];
|
|
21
|
-
token?: Config['token'];
|
|
22
|
-
} | undefined) => Promise<{
|
|
23
|
-
data: import("wagmi-core").Balance;
|
|
24
|
-
error: undefined;
|
|
25
|
-
} | {
|
|
26
|
-
data: undefined;
|
|
27
|
-
error: Error;
|
|
28
|
-
}>];
|
|
6
|
+
};
|
|
7
|
+
export declare type UseBalanceConfig = QueryConfig<FetchBalanceResult, Error>;
|
|
8
|
+
export declare const queryKey: ({ addressOrName, chainId, formatUnits, token, }: Partial<FetchBalanceArgs> & {
|
|
9
|
+
chainId?: number | undefined;
|
|
10
|
+
}) => readonly [{
|
|
11
|
+
readonly entity: "balance";
|
|
12
|
+
readonly addressOrName: string | undefined;
|
|
13
|
+
readonly chainId: number | undefined;
|
|
14
|
+
readonly formatUnits: number | "wei" | "kwei" | "mwei" | "gwei" | "szabo" | "finney" | "ether" | undefined;
|
|
15
|
+
readonly token: string | undefined;
|
|
16
|
+
}];
|
|
17
|
+
export declare function useBalance({ addressOrName, formatUnits, token, watch, cacheTime, enabled, keepPreviousData, select, staleTime, suspense, onError, onSettled, onSuccess, }?: UseBalanceArgs & UseBalanceConfig): import("react-query").UseQueryResult<FetchBalanceResult, Error>;
|
|
@@ -1,13 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
error
|
|
13
|
-
|
|
1
|
+
import { ConnectResult, Connector } from '@wagmi/core';
|
|
2
|
+
import { UseMutationOptions } from 'react-query';
|
|
3
|
+
declare type MutationOptions = UseMutationOptions<ConnectResult, Error, Connector>;
|
|
4
|
+
export declare type UseConnectConfig = {
|
|
5
|
+
/**
|
|
6
|
+
* Function fires before connect function and is passed same variables connect function would receive.
|
|
7
|
+
* Value returned from this function will be passed to both onError and onSettled functions in event of a mutation failure.
|
|
8
|
+
*/
|
|
9
|
+
onBeforeConnect?: MutationOptions['onMutate'];
|
|
10
|
+
/** Function fires when connect is successful */
|
|
11
|
+
onConnect?: MutationOptions['onSuccess'];
|
|
12
|
+
/** Function fires if connect encounters error */
|
|
13
|
+
onError?: MutationOptions['onError'];
|
|
14
|
+
/** Function fires when connect is either successful or encounters error */
|
|
15
|
+
onSettled?: MutationOptions['onSettled'];
|
|
16
|
+
};
|
|
17
|
+
export declare const mutationKey = "connect";
|
|
18
|
+
export declare function useConnect({ onBeforeConnect, onConnect, onError, onSettled, }?: UseConnectConfig): {
|
|
19
|
+
readonly activeConnector: Connector<any, any> | undefined;
|
|
20
|
+
readonly connect: import("react-query").UseMutateFunction<ConnectResult, Error, Connector<any, any>, unknown>;
|
|
21
|
+
readonly connectAsync: import("react-query").UseMutateAsyncFunction<ConnectResult, Error, Connector<any, any>, unknown>;
|
|
22
|
+
readonly connector: Connector<any, any> | undefined;
|
|
23
|
+
readonly connectors: Connector<any, any>[];
|
|
24
|
+
readonly isConnected: boolean;
|
|
25
|
+
readonly isConnecting: boolean;
|
|
26
|
+
readonly isDisconnected: boolean;
|
|
27
|
+
readonly isIdle: boolean;
|
|
28
|
+
readonly isReconnecting: boolean;
|
|
29
|
+
readonly status: "error" | "connected" | "connecting" | "reconnecting" | "disconnected" | "idle";
|
|
30
|
+
readonly data: undefined;
|
|
31
|
+
readonly error: null;
|
|
32
|
+
readonly isError: false;
|
|
33
|
+
readonly reset: () => void;
|
|
34
|
+
readonly context: unknown;
|
|
35
|
+
readonly failureCount: number;
|
|
36
|
+
readonly isPaused: boolean;
|
|
37
|
+
} | {
|
|
38
|
+
readonly activeConnector: Connector<any, any> | undefined;
|
|
39
|
+
readonly connect: import("react-query").UseMutateFunction<ConnectResult, Error, Connector<any, any>, unknown>;
|
|
40
|
+
readonly connectAsync: import("react-query").UseMutateAsyncFunction<ConnectResult, Error, Connector<any, any>, unknown>;
|
|
41
|
+
readonly connector: Connector<any, any> | undefined;
|
|
42
|
+
readonly connectors: Connector<any, any>[];
|
|
43
|
+
readonly isConnected: boolean;
|
|
44
|
+
readonly isConnecting: boolean;
|
|
45
|
+
readonly isDisconnected: boolean;
|
|
46
|
+
readonly isIdle: boolean;
|
|
47
|
+
readonly isReconnecting: boolean;
|
|
48
|
+
readonly status: "error" | "connected" | "connecting" | "reconnecting" | "disconnected" | "idle";
|
|
49
|
+
readonly data: undefined;
|
|
50
|
+
readonly error: null;
|
|
51
|
+
readonly isError: false;
|
|
52
|
+
readonly reset: () => void;
|
|
53
|
+
readonly context: unknown;
|
|
54
|
+
readonly failureCount: number;
|
|
55
|
+
readonly isPaused: boolean;
|
|
56
|
+
} | {
|
|
57
|
+
readonly activeConnector: Connector<any, any> | undefined;
|
|
58
|
+
readonly connect: import("react-query").UseMutateFunction<ConnectResult, Error, Connector<any, any>, unknown>;
|
|
59
|
+
readonly connectAsync: import("react-query").UseMutateAsyncFunction<ConnectResult, Error, Connector<any, any>, unknown>;
|
|
60
|
+
readonly connector: Connector<any, any> | undefined;
|
|
61
|
+
readonly connectors: Connector<any, any>[];
|
|
62
|
+
readonly isConnected: boolean;
|
|
63
|
+
readonly isConnecting: boolean;
|
|
64
|
+
readonly isDisconnected: boolean;
|
|
65
|
+
readonly isIdle: boolean;
|
|
66
|
+
readonly isReconnecting: boolean;
|
|
67
|
+
readonly status: "error" | "connected" | "connecting" | "reconnecting" | "disconnected" | "idle";
|
|
68
|
+
readonly data: undefined;
|
|
69
|
+
readonly error: Error;
|
|
70
|
+
readonly isError: true;
|
|
71
|
+
readonly reset: () => void;
|
|
72
|
+
readonly context: unknown;
|
|
73
|
+
readonly failureCount: number;
|
|
74
|
+
readonly isPaused: boolean;
|
|
75
|
+
} | {
|
|
76
|
+
readonly activeConnector: Connector<any, any> | undefined;
|
|
77
|
+
readonly connect: import("react-query").UseMutateFunction<ConnectResult, Error, Connector<any, any>, unknown>;
|
|
78
|
+
readonly connectAsync: import("react-query").UseMutateAsyncFunction<ConnectResult, Error, Connector<any, any>, unknown>;
|
|
79
|
+
readonly connector: Connector<any, any> | undefined;
|
|
80
|
+
readonly connectors: Connector<any, any>[];
|
|
81
|
+
readonly isConnected: boolean;
|
|
82
|
+
readonly isConnecting: boolean;
|
|
83
|
+
readonly isDisconnected: boolean;
|
|
84
|
+
readonly isIdle: boolean;
|
|
85
|
+
readonly isReconnecting: boolean;
|
|
86
|
+
readonly status: "error" | "connected" | "connecting" | "reconnecting" | "disconnected" | "idle";
|
|
87
|
+
readonly data: ConnectResult;
|
|
88
|
+
readonly error: null;
|
|
89
|
+
readonly isError: false;
|
|
90
|
+
readonly reset: () => void;
|
|
91
|
+
readonly context: unknown;
|
|
92
|
+
readonly failureCount: number;
|
|
93
|
+
readonly isPaused: boolean;
|
|
94
|
+
};
|
|
95
|
+
export {};
|