wagmi 0.2.6 ā 0.2.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/README.md +7 -1
- package/dist/declarations/src/index.d.ts +1 -1
- package/dist/wagmi.cjs.dev.js +6 -0
- package/dist/wagmi.cjs.prod.js +6 -0
- package/dist/wagmi.esm.js +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p>
|
|
2
|
-
<a aria-label="
|
|
2
|
+
<a aria-label="Version" href="https://www.npmjs.com/package/wagmi">
|
|
3
3
|
<img
|
|
4
4
|
alt=""
|
|
5
5
|
src="https://img.shields.io/npm/v/wagmi.svg?style=for-the-badge&labelColor=161c22"
|
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
src="https://img.shields.io/github/sponsors/tmm.svg?style=for-the-badge&labelColor=161c22"
|
|
18
18
|
/>
|
|
19
19
|
</a>
|
|
20
|
+
<a aria-label="Downloads" href="https://www.npmjs.com/package/wagmi">
|
|
21
|
+
<img
|
|
22
|
+
alt=""
|
|
23
|
+
src="https://img.shields.io/npm/dm/wagmi.svg?style=for-the-badge&labelColor=161c22"
|
|
24
|
+
/>
|
|
25
|
+
</a>
|
|
20
26
|
</p>
|
|
21
27
|
|
|
22
28
|
# wagmi
|
|
@@ -1,6 +1,6 @@
|
|
|
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, useSigner, useSignMessage, useToken, useTransaction, useWaitForTransaction, useWebSocketProvider, } from './hooks';
|
|
4
|
-
export { Connector, InjectedConnector, chain, defaultChains, defaultL2Chains, developmentChains, erc1155ABI, erc20ABI, erc721ABI, normalizeChainId, } from 'wagmi-private';
|
|
4
|
+
export { Connector, InjectedConnector, chain, allChains, defaultChains, defaultL2Chains, developmentChains, erc1155ABI, erc20ABI, erc721ABI, normalizeChainId, } from 'wagmi-private';
|
|
5
5
|
export { Context } from './context';
|
|
6
6
|
export type { Chain, Data } from 'wagmi-private';
|
package/dist/wagmi.cjs.dev.js
CHANGED
|
@@ -1041,6 +1041,7 @@ var useContractRead = function useContractRead(contractConfig, functionName) {
|
|
|
1041
1041
|
};
|
|
1042
1042
|
var params = [...(Array.isArray(config_.args) ? config_.args : config_.args ? [config_.args] : []), ...(config_.overrides ? [config_.overrides] : [])];
|
|
1043
1043
|
setState(x => _objectSpread2(_objectSpread2({}, x), {}, {
|
|
1044
|
+
error: undefined,
|
|
1044
1045
|
loading: true
|
|
1045
1046
|
}));
|
|
1046
1047
|
var response = yield contract[functionName](...params);
|
|
@@ -1129,6 +1130,7 @@ var useContractWrite = function useContractWrite(contractConfig, functionName) {
|
|
|
1129
1130
|
if (!connector) throw new wagmiPrivate.ConnectorNotFoundError();
|
|
1130
1131
|
var params = [...(Array.isArray(config_.args) ? config_.args : config_.args ? [config_.args] : []), ...(config_.overrides ? [config_.overrides] : [])];
|
|
1131
1132
|
setState(x => _objectSpread2(_objectSpread2({}, x), {}, {
|
|
1133
|
+
error: undefined,
|
|
1132
1134
|
loading: true
|
|
1133
1135
|
}));
|
|
1134
1136
|
var signer = yield connector.getSigner();
|
|
@@ -1565,6 +1567,10 @@ Object.defineProperty(exports, 'InjectedConnector', {
|
|
|
1565
1567
|
enumerable: true,
|
|
1566
1568
|
get: function () { return wagmiPrivate.InjectedConnector; }
|
|
1567
1569
|
});
|
|
1570
|
+
Object.defineProperty(exports, 'allChains', {
|
|
1571
|
+
enumerable: true,
|
|
1572
|
+
get: function () { return wagmiPrivate.allChains; }
|
|
1573
|
+
});
|
|
1568
1574
|
Object.defineProperty(exports, 'chain', {
|
|
1569
1575
|
enumerable: true,
|
|
1570
1576
|
get: function () { return wagmiPrivate.chain; }
|
package/dist/wagmi.cjs.prod.js
CHANGED
|
@@ -1041,6 +1041,7 @@ var useContractRead = function useContractRead(contractConfig, functionName) {
|
|
|
1041
1041
|
};
|
|
1042
1042
|
var params = [...(Array.isArray(config_.args) ? config_.args : config_.args ? [config_.args] : []), ...(config_.overrides ? [config_.overrides] : [])];
|
|
1043
1043
|
setState(x => _objectSpread2(_objectSpread2({}, x), {}, {
|
|
1044
|
+
error: undefined,
|
|
1044
1045
|
loading: true
|
|
1045
1046
|
}));
|
|
1046
1047
|
var response = yield contract[functionName](...params);
|
|
@@ -1129,6 +1130,7 @@ var useContractWrite = function useContractWrite(contractConfig, functionName) {
|
|
|
1129
1130
|
if (!connector) throw new wagmiPrivate.ConnectorNotFoundError();
|
|
1130
1131
|
var params = [...(Array.isArray(config_.args) ? config_.args : config_.args ? [config_.args] : []), ...(config_.overrides ? [config_.overrides] : [])];
|
|
1131
1132
|
setState(x => _objectSpread2(_objectSpread2({}, x), {}, {
|
|
1133
|
+
error: undefined,
|
|
1132
1134
|
loading: true
|
|
1133
1135
|
}));
|
|
1134
1136
|
var signer = yield connector.getSigner();
|
|
@@ -1565,6 +1567,10 @@ Object.defineProperty(exports, 'InjectedConnector', {
|
|
|
1565
1567
|
enumerable: true,
|
|
1566
1568
|
get: function () { return wagmiPrivate.InjectedConnector; }
|
|
1567
1569
|
});
|
|
1570
|
+
Object.defineProperty(exports, 'allChains', {
|
|
1571
|
+
enumerable: true,
|
|
1572
|
+
get: function () { return wagmiPrivate.allChains; }
|
|
1573
|
+
});
|
|
1568
1574
|
Object.defineProperty(exports, 'chain', {
|
|
1569
1575
|
enumerable: true,
|
|
1570
1576
|
get: function () { return wagmiPrivate.chain; }
|
package/dist/wagmi.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getDefaultProvider } from '@ethersproject/providers';
|
|
3
3
|
import { erc20ABI, defaultChains, defaultL2Chains, allChains, SwitchChainError, ConnectorNotFoundError, UserRejectedRequestError, InjectedConnector } from 'wagmi-private';
|
|
4
|
-
export { Connector, InjectedConnector, chain, defaultChains, defaultL2Chains, developmentChains, erc1155ABI, erc20ABI, erc721ABI, normalizeChainId } from 'wagmi-private';
|
|
4
|
+
export { Connector, InjectedConnector, allChains, chain, defaultChains, defaultL2Chains, developmentChains, erc1155ABI, erc20ABI, erc721ABI, normalizeChainId } from 'wagmi-private';
|
|
5
5
|
import { utils, ethers, Contract } from 'ethers';
|
|
6
6
|
|
|
7
7
|
function _defineProperty(obj, key, value) {
|
|
@@ -1018,6 +1018,7 @@ var useContractRead = function useContractRead(contractConfig, functionName) {
|
|
|
1018
1018
|
};
|
|
1019
1019
|
var params = [...(Array.isArray(config_.args) ? config_.args : config_.args ? [config_.args] : []), ...(config_.overrides ? [config_.overrides] : [])];
|
|
1020
1020
|
setState(x => _objectSpread2(_objectSpread2({}, x), {}, {
|
|
1021
|
+
error: undefined,
|
|
1021
1022
|
loading: true
|
|
1022
1023
|
}));
|
|
1023
1024
|
var response = yield contract[functionName](...params);
|
|
@@ -1106,6 +1107,7 @@ var useContractWrite = function useContractWrite(contractConfig, functionName) {
|
|
|
1106
1107
|
if (!connector) throw new ConnectorNotFoundError();
|
|
1107
1108
|
var params = [...(Array.isArray(config_.args) ? config_.args : config_.args ? [config_.args] : []), ...(config_.overrides ? [config_.overrides] : [])];
|
|
1108
1109
|
setState(x => _objectSpread2(_objectSpread2({}, x), {}, {
|
|
1110
|
+
error: undefined,
|
|
1109
1111
|
loading: true
|
|
1110
1112
|
}));
|
|
1111
1113
|
var signer = yield connector.getSigner();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "wagmi",
|
|
3
3
|
"description": "React Hooks library for Ethereum",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.7",
|
|
6
6
|
"ethereum": "awkweb.eth",
|
|
7
7
|
"repository": "tmm/wagmi",
|
|
8
8
|
"homepage": "https://wagmi-xyz.vercel.app",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"walletlink": "^2.2.8",
|
|
60
60
|
"wagmi-testing": "0.1.7"
|
|
61
61
|
},
|
|
62
|
-
"readme": "<p>\n <a aria-label=\"
|
|
62
|
+
"readme": "<p>\n <a aria-label=\"Version\" href=\"https://www.npmjs.com/package/wagmi\">\n <img\n alt=\"\"\n src=\"https://img.shields.io/npm/v/wagmi.svg?style=for-the-badge&labelColor=161c22\"\n />\n </a>\n <a aria-label=\"License\" href=\"/LICENSE\">\n <img\n alt=\"\"\n src=\"https://img.shields.io/npm/l/wagmi.svg?style=for-the-badge&labelColor=161c22\"\n />\n </a>\n <a aria-label=\"Sponsors\" href=\"https://github.com/sponsors/tmm\">\n <img\n alt=\"\"\n src=\"https://img.shields.io/github/sponsors/tmm.svg?style=for-the-badge&labelColor=161c22\"\n />\n </a>\n <a aria-label=\"Downloads\" href=\"https://www.npmjs.com/package/wagmi\">\n <img\n alt=\"\"\n src=\"https://img.shields.io/npm/dm/wagmi.svg?style=for-the-badge&labelColor=161c22\"\n />\n </a>\n</p>\n\n# wagmi\n\n**React Hooks library for Ethereum, built on [ethers.js](https://github.com/ethers-io/ethers.js).**\n\nš 20+ hooks for working with wallets, ENS, contracts, transactions, signing, etc.\n\nš¼ Built-in wallet connectors for MetaMask, WalletConnect, and Coinbase Wallet\n\nš Auto-refresh data on wallet and network changes\n\nš¦ TypeScript ready\n\nšØ Zero-dependencies (besides ethers.js peer dependency)\n\nš³ Test suite and documentation\n\nš MIT License\n\n## Documentation\n\nVisit https://wagmi-xyz.vercel.app to view the full documentation.\n\n## Usage\n\n1. Install the dependencies.\n\n```bash\npnpm add wagmi ethers\n```\n\n2. Wrap your app with the `Provider` component.\n\n```tsx\nimport { Provider } from 'wagmi'\n\nconst App = () => (\n <Provider>\n <YourRoutes />\n </Provider>\n)\n```\n\n3. Use hooks.\n\n```tsx\nimport { useAccount } from 'wagmi'\n\nconst Page = () => {\n const [{ data, error, loading }, disconnect] = useAccount({\n fetchEns: true,\n })\n\n return ...\n}\n```\n\nEvery component inside the `Provider` is set up with the default `InjectedConnector` for connecting wallets and ethers.js [Default Provider](https://docs.ethers.io/v5/api/providers/#providers-getDefaultProvider) for fetching data.\n\nWant 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).\n\n## Community\n\nFeel free to join the [discussions on GitHub](https://github.com/tmm/wagmi/discussions) or reach out [on Twitter](https://twitter.com/awkweb)!\n\n## Support\n\n- awkweb.eth\n- [GitHub Sponsors](https://github.com/sponsors/tmm)\n- Sign the [guestbook](https://github.com/tmm/wagmi/discussions/2)\n\n## Thanks\n\n- [ricmoo.eth](https://twitter.com/ricmoo) for creating and continued work on [ethers.js](https://github.com/ethers-io/ethers.js)\n- [Mirror](https://mirror.xyz) for creating space to do good work\n\n## License\n\nMIT.\n\n<br />\n\nwagmi\n"
|
|
63
63
|
}
|