wagmi 0.0.14 → 0.1.0
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/LICENSE +1 -1
- package/README.md +11 -1
- package/connectors/injected/dist/wagmi-connectors-injected.cjs.d.ts +1 -0
- package/connectors/injected/dist/wagmi-connectors-injected.cjs.dev.js +12 -0
- package/connectors/injected/dist/wagmi-connectors-injected.cjs.js +7 -0
- package/connectors/injected/dist/wagmi-connectors-injected.cjs.prod.js +12 -0
- package/connectors/injected/dist/wagmi-connectors-injected.esm.js +1 -0
- package/connectors/injected/package.json +4 -0
- package/connectors/walletConnect/dist/wagmi-connectors-walletConnect.cjs.d.ts +1 -0
- package/connectors/walletConnect/dist/wagmi-connectors-walletConnect.cjs.dev.js +12 -0
- package/connectors/walletConnect/dist/wagmi-connectors-walletConnect.cjs.js +7 -0
- package/connectors/walletConnect/dist/wagmi-connectors-walletConnect.cjs.prod.js +12 -0
- package/connectors/walletConnect/dist/wagmi-connectors-walletConnect.esm.js +1 -0
- package/connectors/walletConnect/package.json +4 -0
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.cjs.d.ts +1 -0
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.cjs.dev.js +12 -0
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.cjs.js +7 -0
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.cjs.prod.js +12 -0
- package/connectors/walletLink/dist/wagmi-connectors-walletLink.esm.js +1 -0
- package/connectors/walletLink/package.json +4 -0
- package/dist/declarations/src/connectors/injected.d.ts +1 -0
- package/dist/declarations/src/connectors/walletConnect.d.ts +1 -0
- package/dist/declarations/src/connectors/walletLink.d.ts +1 -0
- package/dist/declarations/src/context.d.ts +1 -1
- package/dist/declarations/src/hooks/accounts/useBalance.d.ts +10 -4
- package/dist/declarations/src/hooks/accounts/useConnect.d.ts +5 -2
- package/dist/declarations/src/hooks/accounts/useNetwork.d.ts +7 -1
- package/dist/declarations/src/hooks/accounts/useSignMessage.d.ts +7 -1
- package/dist/declarations/src/hooks/contracts/useContractRead.d.ts +8 -2
- package/dist/declarations/src/hooks/contracts/useContractWrite.d.ts +8 -2
- package/dist/declarations/src/hooks/contracts/useToken.d.ts +13 -7
- package/dist/declarations/src/hooks/ens/useEnsLookup.d.ts +7 -1
- package/dist/declarations/src/hooks/ens/useEnsResolver.d.ts +7 -1
- package/dist/declarations/src/hooks/network-status/useBlockNumber.d.ts +7 -1
- package/dist/declarations/src/hooks/network-status/useFeeData.d.ts +7 -1
- package/dist/declarations/src/hooks/transactions/useTransaction.d.ts +7 -1
- package/dist/declarations/src/hooks/transactions/useWaitForTransaction.d.ts +7 -1
- package/dist/declarations/src/index.d.ts +1 -1
- package/dist/wagmi.cjs.dev.js +102 -35
- package/dist/wagmi.cjs.prod.js +102 -35
- package/dist/wagmi.esm.js +103 -28
- package/package.json +22 -6
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
**React Hooks library for Ethereum, built on [ethers.js](https://github.com/ethers-io/ethers.js).**
|
|
19
19
|
|
|
20
|
-
🚀
|
|
20
|
+
🚀 20+ hooks for working with wallets, ENS, contracts, transactions, signing, etc.
|
|
21
21
|
|
|
22
22
|
💼 Built-in wallet connectors for MetaMask, WalletConnect, and Coinbase Wallet
|
|
23
23
|
|
|
@@ -73,6 +73,16 @@ Every component inside the `Provider` is set up with the default `InjectedConnec
|
|
|
73
73
|
|
|
74
74
|
Want to learn more? Check out the [guides](https://wagmi-xyz.vercel.app/guides/connect-wallet) or browse the [API docs](https://wagmi-xyz.vercel.app/docs/provider).
|
|
75
75
|
|
|
76
|
+
## Community
|
|
77
|
+
|
|
78
|
+
Feel free to join the [discussions on GitHub](https://github.com/tmm/wagmi/discussions) or reach out [on Twitter](https://twitter.com/awkweb)!
|
|
79
|
+
|
|
80
|
+
## Support
|
|
81
|
+
|
|
82
|
+
- awkweb.eth
|
|
83
|
+
- [GitHub Sponsors](https://github.com/sponsors/tmm)
|
|
84
|
+
- Sign the [guestbook](https://github.com/tmm/wagmi/discussions/2)
|
|
85
|
+
|
|
76
86
|
## Thanks
|
|
77
87
|
|
|
78
88
|
- [ricmoo.eth](https://twitter.com/ricmoo) for creating and continued work on [ethers.js](https://github.com/ethers-io/ethers.js)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/declarations/src/connectors/injected";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var wagmiPrivate = require('wagmi-private');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'InjectedConnector', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return wagmiPrivate.InjectedConnector; }
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var wagmiPrivate = require('wagmi-private');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'InjectedConnector', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return wagmiPrivate.InjectedConnector; }
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InjectedConnector } from 'wagmi-private';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/declarations/src/connectors/walletConnect";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var walletConnect = require('wagmi-private/connectors/walletConnect');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'WalletConnectConnector', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return walletConnect.WalletConnectConnector; }
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var walletConnect = require('wagmi-private/connectors/walletConnect');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'WalletConnectConnector', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return walletConnect.WalletConnectConnector; }
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletConnectConnector } from 'wagmi-private/connectors/walletConnect';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/declarations/src/connectors/walletLink";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var walletLink = require('wagmi-private/connectors/walletLink');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'WalletLinkConnector', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return walletLink.WalletLinkConnector; }
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var walletLink = require('wagmi-private/connectors/walletLink');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'WalletLinkConnector', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return walletLink.WalletLinkConnector; }
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletLinkConnector } from 'wagmi-private/connectors/walletLink';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InjectedConnector } from 'wagmi-private';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletConnectConnector } from 'wagmi-private/connectors/walletConnect';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletLinkConnector } from 'wagmi-private/connectors/walletLink';
|
|
@@ -53,7 +53,7 @@ export declare type Props = {
|
|
|
53
53
|
webSocketProvider?: WebSocketProvider | ((config: {
|
|
54
54
|
chainId?: number;
|
|
55
55
|
connector?: Connector;
|
|
56
|
-
}) => WebSocketProvider);
|
|
56
|
+
}) => WebSocketProvider | undefined);
|
|
57
57
|
};
|
|
58
58
|
export declare const Provider: ({ autoConnect, children, connectors: connectors_, connectorStorageKey, provider: provider_, webSocketProvider: webSocketProvider_, }: React.PropsWithChildren<Props>) => React.FunctionComponentElement<React.ProviderProps<ContextValue | null>>;
|
|
59
59
|
export declare const useContext: () => ContextValue;
|
|
@@ -24,8 +24,14 @@ export declare const useBalance: ({ addressOrName, formatUnits, skip, token, wat
|
|
|
24
24
|
addressOrName: string;
|
|
25
25
|
formatUnits?: Config['formatUnits'];
|
|
26
26
|
token?: Config['token'];
|
|
27
|
-
} | undefined) => Promise<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
} | undefined) => Promise<{
|
|
28
|
+
data: {
|
|
29
|
+
formatted: string;
|
|
30
|
+
symbol: string;
|
|
31
|
+
value: BigNumber;
|
|
32
|
+
};
|
|
33
|
+
error: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
data: undefined;
|
|
36
|
+
error: Error;
|
|
31
37
|
}>];
|
|
@@ -7,7 +7,10 @@ export declare const useConnect: () => readonly [{
|
|
|
7
7
|
};
|
|
8
8
|
readonly error: Error | undefined;
|
|
9
9
|
readonly loading: boolean;
|
|
10
|
-
}, (connector: Connector) => Promise<
|
|
11
|
-
connector: Connector<any, any>;
|
|
10
|
+
}, (connector: Connector) => Promise<{
|
|
12
11
|
data: import("wagmi-private").Data<any>;
|
|
12
|
+
error: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
data: undefined;
|
|
15
|
+
error: Error;
|
|
13
16
|
} | undefined>];
|
|
@@ -21,4 +21,10 @@ export declare const useNetwork: () => readonly [{
|
|
|
21
21
|
};
|
|
22
22
|
readonly error: Error | undefined;
|
|
23
23
|
readonly loading: boolean | undefined;
|
|
24
|
-
}, ((chainId: number) => Promise<
|
|
24
|
+
}, ((chainId: number) => Promise<false | {
|
|
25
|
+
data: boolean;
|
|
26
|
+
error: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
data: undefined;
|
|
29
|
+
error: Error;
|
|
30
|
+
}>) | undefined];
|
|
@@ -9,4 +9,10 @@ export declare const useSignMessage: ({ message }?: Config) => readonly [{
|
|
|
9
9
|
readonly loading: boolean | undefined;
|
|
10
10
|
}, (config?: {
|
|
11
11
|
message?: Config['message'];
|
|
12
|
-
} | undefined) => Promise<
|
|
12
|
+
} | undefined) => Promise<{
|
|
13
|
+
data: string;
|
|
14
|
+
error: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
data: undefined;
|
|
17
|
+
error: Error;
|
|
18
|
+
}>];
|
|
@@ -12,6 +12,12 @@ export declare const useContractRead: <Contract extends ethers.Contract = ethers
|
|
|
12
12
|
readonly loading: boolean | undefined;
|
|
13
13
|
}, (config?: {
|
|
14
14
|
args?: Config['args'];
|
|
15
|
-
overrides
|
|
16
|
-
} | undefined) => Promise<
|
|
15
|
+
overrides?: Config['overrides'];
|
|
16
|
+
} | undefined) => Promise<{
|
|
17
|
+
data: ethers.utils.Result;
|
|
18
|
+
error: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
data: undefined;
|
|
21
|
+
error: Error;
|
|
22
|
+
}>];
|
|
17
23
|
export {};
|
|
@@ -10,6 +10,12 @@ export declare const useContractWrite: <Contract extends ethers.Contract = ether
|
|
|
10
10
|
readonly loading: boolean | undefined;
|
|
11
11
|
}, (config?: {
|
|
12
12
|
args?: Config['args'];
|
|
13
|
-
overrides
|
|
14
|
-
} | undefined) => Promise<
|
|
13
|
+
overrides?: Config['overrides'];
|
|
14
|
+
} | undefined) => Promise<{
|
|
15
|
+
data: ethers.providers.TransactionResponse;
|
|
16
|
+
error: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
data: undefined;
|
|
19
|
+
error: Error;
|
|
20
|
+
}>];
|
|
15
21
|
export {};
|
|
@@ -25,12 +25,18 @@ export declare const useToken: ({ address, formatUnits, skip, }?: Config) => rea
|
|
|
25
25
|
}) => Promise<boolean | Error>, (config?: {
|
|
26
26
|
address: string;
|
|
27
27
|
formatUnits?: Config['formatUnits'];
|
|
28
|
-
} | undefined) => Promise<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
} | undefined) => Promise<{
|
|
29
|
+
data: {
|
|
30
|
+
address: string;
|
|
31
|
+
decimals: any;
|
|
32
|
+
symbol: any;
|
|
33
|
+
totalSupply: {
|
|
34
|
+
formatted: string;
|
|
35
|
+
value: any;
|
|
36
|
+
};
|
|
35
37
|
};
|
|
38
|
+
error: undefined;
|
|
39
|
+
} | {
|
|
40
|
+
data: undefined;
|
|
41
|
+
error: Error;
|
|
36
42
|
}>];
|
|
@@ -10,5 +10,11 @@ export declare const useEnsLookup: ({ address, skip }?: Config) => readonly [{
|
|
|
10
10
|
readonly error: Error | undefined;
|
|
11
11
|
}, (config?: {
|
|
12
12
|
address: string;
|
|
13
|
-
} | undefined) => Promise<
|
|
13
|
+
} | undefined) => Promise<{
|
|
14
|
+
data: string | null;
|
|
15
|
+
error: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
data: undefined;
|
|
18
|
+
error: Error;
|
|
19
|
+
}>];
|
|
14
20
|
export {};
|
|
@@ -11,5 +11,11 @@ export declare const useEnsResolver: ({ name, skip }?: Config) => readonly [{
|
|
|
11
11
|
readonly error: Error | undefined;
|
|
12
12
|
}, (config?: {
|
|
13
13
|
name: Config['name'];
|
|
14
|
-
} | undefined) => Promise<
|
|
14
|
+
} | undefined) => Promise<{
|
|
15
|
+
data: import("@ethersproject/providers").Resolver | null;
|
|
16
|
+
error: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
data: undefined;
|
|
19
|
+
error: Error;
|
|
20
|
+
}>];
|
|
15
21
|
export {};
|
|
@@ -8,5 +8,11 @@ export declare const useBlockNumber: ({ skip, watch }?: Config) => readonly [{
|
|
|
8
8
|
readonly data: number | undefined;
|
|
9
9
|
readonly error: Error | undefined;
|
|
10
10
|
readonly loading: boolean | undefined;
|
|
11
|
-
}, () => Promise<
|
|
11
|
+
}, () => Promise<{
|
|
12
|
+
data: number;
|
|
13
|
+
error: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
data: undefined;
|
|
16
|
+
error: Error;
|
|
17
|
+
}>];
|
|
12
18
|
export {};
|
|
@@ -21,5 +21,11 @@ export declare const useFeeData: ({ formatUnits, skip, watch, }?: Config) => rea
|
|
|
21
21
|
} | undefined;
|
|
22
22
|
readonly loading: boolean | undefined;
|
|
23
23
|
readonly error: Error | undefined;
|
|
24
|
-
}, () => Promise<
|
|
24
|
+
}, () => Promise<{
|
|
25
|
+
data: FeeData;
|
|
26
|
+
error: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
data: undefined;
|
|
29
|
+
error: Error;
|
|
30
|
+
}>];
|
|
25
31
|
export {};
|
|
@@ -9,4 +9,10 @@ export declare const useTransaction: ({ request }?: Config) => readonly [{
|
|
|
9
9
|
readonly loading: boolean | undefined;
|
|
10
10
|
}, (config?: {
|
|
11
11
|
request: Config['request'];
|
|
12
|
-
} | undefined) => Promise<
|
|
12
|
+
} | undefined) => Promise<{
|
|
13
|
+
data: TransactionResponse;
|
|
14
|
+
error: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
data: undefined;
|
|
17
|
+
error: Error;
|
|
18
|
+
}>];
|
|
@@ -22,4 +22,10 @@ export declare const useWaitForTransaction: ({ confirmations, hash, skip, timeou
|
|
|
22
22
|
hash?: Config['hash'];
|
|
23
23
|
timeout?: Config['timeout'];
|
|
24
24
|
wait?: Config['wait'];
|
|
25
|
-
} | undefined) => Promise<
|
|
25
|
+
} | undefined) => Promise<{
|
|
26
|
+
data: TransactionReceipt;
|
|
27
|
+
error: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
data: undefined;
|
|
30
|
+
error: Error;
|
|
31
|
+
}>];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Provider, useContext } from './context';
|
|
2
2
|
export type { Props as ProviderProps } from './context';
|
|
3
3
|
export { useAccount, useBalance, useBlockNumber, useConnect, useContract, useContractEvent, useContractRead, useContractWrite, useEnsAvatar, useEnsLookup, useEnsResolver, useFeeData, useNetwork, useProvider, useSignMessage, useToken, useTransaction, useWaitForTransaction, useWebSocketProvider, } from './hooks';
|
|
4
|
-
export { Connector, InjectedConnector,
|
|
4
|
+
export { Connector, InjectedConnector, chain, defaultChains, defaultL2Chains, developmentChains, erc1155ABI, erc20ABI, erc721ABI, normalizeChainId, } from 'wagmi-private';
|
|
5
5
|
export type { Chain, Data } from 'wagmi-private';
|