wagmi 0.3.1 → 0.3.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.
@@ -0,0 +1 @@
1
+ export * from "../../../dist/declarations/src/connectors/metaMask";
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var metaMask = require('@wagmi/core/connectors/metaMask');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, 'MetaMaskConnector', {
10
+ enumerable: true,
11
+ get: function () { return metaMask.MetaMaskConnector; }
12
+ });
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./wagmi-connectors-metaMask.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./wagmi-connectors-metaMask.cjs.dev.js");
7
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var metaMask = require('@wagmi/core/connectors/metaMask');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, 'MetaMaskConnector', {
10
+ enumerable: true,
11
+ get: function () { return metaMask.MetaMaskConnector; }
12
+ });
@@ -0,0 +1 @@
1
+ export { MetaMaskConnector } from '@wagmi/core/connectors/metaMask';
@@ -0,0 +1,4 @@
1
+ {
2
+ "main": "dist/wagmi-connectors-metaMask.cjs.js",
3
+ "module": "dist/wagmi-connectors-metaMask.esm.js"
4
+ }
@@ -0,0 +1 @@
1
+ export { MetaMaskConnector } from '@wagmi/core/connectors/metaMask';
@@ -7,14 +7,14 @@ declare type UseContractReadArgs = Partial<ReadContractConfig> & {
7
7
  watch?: boolean;
8
8
  };
9
9
  export declare type UseContractReadConfig = QueryConfig<ReadContractResult, Error>;
10
- export declare const queryKey: ([contractConfig, functionName, { args, chainId, overrides }, { blockNumber },]: [import("@wagmi/core").GetContractArgs, string, Partial<ReadContractConfig>, {
10
+ export declare const queryKey: ([contractConfig, functionName, { args, chainId, overrides }, { blockNumber },]: [ReadContractArgs, string, Partial<ReadContractConfig>, {
11
11
  blockNumber?: number | undefined;
12
12
  }]) => readonly [{
13
13
  readonly entity: "readContract";
14
14
  readonly args: any;
15
15
  readonly blockNumber: number | undefined;
16
16
  readonly chainId: number | undefined;
17
- readonly contractConfig: import("@wagmi/core").GetContractArgs;
17
+ readonly contractConfig: ReadContractArgs;
18
18
  readonly functionName: string;
19
19
  readonly overrides: import("ethers").CallOverrides | undefined;
20
20
  }];
@@ -1213,11 +1213,7 @@ function useContractRead(contractConfig, functionName) {
1213
1213
  }]), [args, blockNumber, cacheOnBlock, chainId, contractConfig, functionName, overrides]);
1214
1214
  const enabled = React__namespace.useMemo(() => {
1215
1215
  let enabled = Boolean(enabled_ && contractConfig && functionName);
1216
-
1217
- if (cacheOnBlock) {
1218
- enabled = Boolean(enabled && blockNumber);
1219
- }
1220
-
1216
+ if (cacheOnBlock) enabled = Boolean(enabled && blockNumber);
1221
1217
  return enabled;
1222
1218
  }, [blockNumber, cacheOnBlock, contractConfig, enabled_, functionName]);
1223
1219
  const client = reactQuery.useQueryClient();
@@ -1225,12 +1221,13 @@ function useContractRead(contractConfig, functionName) {
1225
1221
  if (enabled) {
1226
1222
  const unwatch = core.watchReadContract(contractConfig, functionName, {
1227
1223
  args,
1224
+ chainId,
1228
1225
  overrides,
1229
1226
  listenToBlock: watch && !cacheOnBlock
1230
1227
  }, result => client.setQueryData(queryKey_, result));
1231
1228
  return unwatch;
1232
1229
  }
1233
- }, [args, cacheOnBlock, client, contractConfig, enabled, functionName, overrides, queryKey_, watch]);
1230
+ }, [args, cacheOnBlock, chainId, client, contractConfig, enabled, functionName, overrides, queryKey_, watch]);
1234
1231
  return useQuery(queryKey_, queryFn$6, {
1235
1232
  cacheTime,
1236
1233
  enabled,
@@ -1213,11 +1213,7 @@ function useContractRead(contractConfig, functionName) {
1213
1213
  }]), [args, blockNumber, cacheOnBlock, chainId, contractConfig, functionName, overrides]);
1214
1214
  const enabled = React__namespace.useMemo(() => {
1215
1215
  let enabled = Boolean(enabled_ && contractConfig && functionName);
1216
-
1217
- if (cacheOnBlock) {
1218
- enabled = Boolean(enabled && blockNumber);
1219
- }
1220
-
1216
+ if (cacheOnBlock) enabled = Boolean(enabled && blockNumber);
1221
1217
  return enabled;
1222
1218
  }, [blockNumber, cacheOnBlock, contractConfig, enabled_, functionName]);
1223
1219
  const client = reactQuery.useQueryClient();
@@ -1225,12 +1221,13 @@ function useContractRead(contractConfig, functionName) {
1225
1221
  if (enabled) {
1226
1222
  const unwatch = core.watchReadContract(contractConfig, functionName, {
1227
1223
  args,
1224
+ chainId,
1228
1225
  overrides,
1229
1226
  listenToBlock: watch && !cacheOnBlock
1230
1227
  }, result => client.setQueryData(queryKey_, result));
1231
1228
  return unwatch;
1232
1229
  }
1233
- }, [args, cacheOnBlock, client, contractConfig, enabled, functionName, overrides, queryKey_, watch]);
1230
+ }, [args, cacheOnBlock, chainId, client, contractConfig, enabled, functionName, overrides, queryKey_, watch]);
1234
1231
  return useQuery(queryKey_, queryFn$6, {
1235
1232
  cacheTime,
1236
1233
  enabled,
package/dist/wagmi.esm.js CHANGED
@@ -1190,11 +1190,7 @@ function useContractRead(contractConfig, functionName) {
1190
1190
  }]), [args, blockNumber, cacheOnBlock, chainId, contractConfig, functionName, overrides]);
1191
1191
  const enabled = React.useMemo(() => {
1192
1192
  let enabled = Boolean(enabled_ && contractConfig && functionName);
1193
-
1194
- if (cacheOnBlock) {
1195
- enabled = Boolean(enabled && blockNumber);
1196
- }
1197
-
1193
+ if (cacheOnBlock) enabled = Boolean(enabled && blockNumber);
1198
1194
  return enabled;
1199
1195
  }, [blockNumber, cacheOnBlock, contractConfig, enabled_, functionName]);
1200
1196
  const client = useQueryClient();
@@ -1202,12 +1198,13 @@ function useContractRead(contractConfig, functionName) {
1202
1198
  if (enabled) {
1203
1199
  const unwatch = watchReadContract(contractConfig, functionName, {
1204
1200
  args,
1201
+ chainId,
1205
1202
  overrides,
1206
1203
  listenToBlock: watch && !cacheOnBlock
1207
1204
  }, result => client.setQueryData(queryKey_, result));
1208
1205
  return unwatch;
1209
1206
  }
1210
- }, [args, cacheOnBlock, client, contractConfig, enabled, functionName, overrides, queryKey_, watch]);
1207
+ }, [args, cacheOnBlock, chainId, client, contractConfig, enabled, functionName, overrides, queryKey_, watch]);
1211
1208
  return useQuery(queryKey_, queryFn$6, {
1212
1209
  cacheTime,
1213
1210
  enabled,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "wagmi",
3
3
  "description": "React Hooks for Ethereum",
4
4
  "license": "WAGMIT",
5
- "version": "0.3.1",
5
+ "version": "0.3.2",
6
6
  "author": "awkweb.eth",
7
7
  "ethereum": "awkweb.eth",
8
8
  "repository": "tmm/wagmi",
@@ -24,6 +24,10 @@
24
24
  "module": "./connectors/injected/dist/wagmi-connectors-injected.esm.js",
25
25
  "default": "./connectors/injected/dist/wagmi-connectors-injected.cjs.js"
26
26
  },
27
+ "./connectors/metaMask": {
28
+ "module": "./connectors/metaMask/dist/wagmi-connectors-metaMask.esm.js",
29
+ "default": "./connectors/metaMask/dist/wagmi-connectors-metaMask.cjs.js"
30
+ },
27
31
  "./connectors/walletConnect": {
28
32
  "module": "./connectors/walletConnect/dist/wagmi-connectors-walletConnect.esm.js",
29
33
  "default": "./connectors/walletConnect/dist/wagmi-connectors-walletConnect.cjs.js"
@@ -38,6 +42,7 @@
38
42
  "index.ts",
39
43
  "connectors/coinbaseWallet.ts",
40
44
  "connectors/injected.ts",
45
+ "connectors/metaMask.ts",
41
46
  "connectors/walletConnect.ts"
42
47
  ]
43
48
  },
@@ -46,20 +51,20 @@
46
51
  "react": ">=17.0.0"
47
52
  },
48
53
  "dependencies": {
49
- "@coinbase/wallet-sdk": "^3.0.8",
50
- "@wagmi/core": "0.2.1",
51
- "@walletconnect/ethereum-provider": "1.7.5",
54
+ "@coinbase/wallet-sdk": "^3.0.11",
55
+ "@wagmi/core": "^0.2.2",
56
+ "@walletconnect/ethereum-provider": "^1.7.5",
52
57
  "react-query": "^4.0.0-beta.7",
53
- "use-sync-external-store": "^1.0.0"
58
+ "use-sync-external-store": "^1.1.0"
54
59
  },
55
60
  "devDependencies": {
56
61
  "@testing-library/react": "^13.0.0",
57
62
  "@testing-library/react-hooks": "^7.0.2",
58
- "@types/react": "18.0.5",
59
- "@types/react-dom": "^18.0.2",
63
+ "@types/react": "^18.0.5",
64
+ "@types/react-dom": "^18.0.3",
60
65
  "@types/use-sync-external-store": "^0.0.3",
61
66
  "ethers": "^5.6.4",
62
- "react": "18.0.0",
67
+ "react": "^18.1.0",
63
68
  "react-17": "npm:react@^17.0.2",
64
69
  "react-dom": "^18.0.0",
65
70
  "react-dom-17": "npm:react-dom@^17.0.2"