@wagmi/core 0.10.7 → 0.10.8-cjs

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.
Files changed (39) hide show
  1. package/connectors/walletConnectV1/package.json +4 -0
  2. package/dist/chains.d.ts +1 -1
  3. package/dist/chains.js +171 -163
  4. package/dist/chunk-BVC4KGLQ.js +8 -8
  5. package/dist/chunk-EQOEZP46.js +5 -5
  6. package/dist/chunk-KFW652VN.js +6 -6
  7. package/dist/chunk-KX4UEHS5.js +1 -0
  8. package/dist/chunk-MQXBDTVK.js +7 -7
  9. package/dist/chunk-RIWXWG4Y.js +172 -0
  10. package/dist/{chunk-55IO54NW.js → chunk-VQG3VKOR.js} +253 -248
  11. package/dist/connectors/coinbaseWallet.js +5 -5
  12. package/dist/connectors/index.js +9 -9
  13. package/dist/connectors/injected.js +7 -7
  14. package/dist/connectors/ledger.js +5 -5
  15. package/dist/connectors/metaMask.js +5 -5
  16. package/dist/connectors/mock.js +9 -9
  17. package/dist/connectors/safe.js +5 -5
  18. package/dist/connectors/walletConnect.js +5 -5
  19. package/dist/connectors/walletConnectLegacy.js +5 -5
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +164 -164
  22. package/dist/internal/index.js +8 -8
  23. package/dist/internal/test.js +25 -25
  24. package/dist/providers/alchemy.js +11 -11
  25. package/dist/providers/infura.js +11 -11
  26. package/dist/providers/jsonRpc.js +8 -8
  27. package/dist/providers/public.js +7 -7
  28. package/internal/dist/wagmi-core-internal.cjs.d.ts +11 -0
  29. package/internal/dist/wagmi-core-internal.cjs.js +16 -0
  30. package/package.json +4 -5
  31. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.d.ts +11 -0
  32. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.js +16 -0
  33. package/providers/infura/dist/wagmi-core-providers-infura.cjs.d.ts +11 -0
  34. package/providers/infura/dist/wagmi-core-providers-infura.cjs.js +16 -0
  35. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.d.ts +11 -0
  36. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.js +16 -0
  37. package/providers/public/dist/wagmi-core-providers-public.cjs.d.ts +11 -0
  38. package/providers/public/dist/wagmi-core-providers-public.cjs.js +16 -0
  39. package/dist/chunk-FBIU3RX4.js +0 -164
@@ -1,7 +1,7 @@
1
- import "../chunk-MQXBDTVK.js";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-MQXBDTVK.js');
2
2
 
3
3
  // src/providers/infura.ts
4
- import { providers } from "ethers";
4
+ var _ethers = require('ethers');
5
5
  function infuraProvider({
6
6
  apiKey,
7
7
  priority,
@@ -9,38 +9,38 @@ function infuraProvider({
9
9
  weight
10
10
  }) {
11
11
  return function(chain) {
12
- if (!chain.rpcUrls.infura?.http[0])
12
+ if (!_optionalChain([chain, 'access', _ => _.rpcUrls, 'access', _2 => _2.infura, 'optionalAccess', _3 => _3.http, 'access', _4 => _4[0]]))
13
13
  return null;
14
14
  return {
15
15
  chain: {
16
16
  ...chain,
17
17
  rpcUrls: {
18
18
  ...chain.rpcUrls,
19
- default: { http: [`${chain.rpcUrls.infura?.http[0]}/${apiKey}`] }
19
+ default: { http: [`${_optionalChain([chain, 'access', _5 => _5.rpcUrls, 'access', _6 => _6.infura, 'optionalAccess', _7 => _7.http, 'access', _8 => _8[0]])}/${apiKey}`] }
20
20
  }
21
21
  },
22
22
  provider: () => {
23
- const provider = new providers.InfuraProvider(
23
+ const provider = new _ethers.providers.InfuraProvider(
24
24
  {
25
25
  chainId: chain.id,
26
26
  name: chain.network,
27
- ensAddress: chain.contracts?.ensRegistry?.address
27
+ ensAddress: _optionalChain([chain, 'access', _9 => _9.contracts, 'optionalAccess', _10 => _10.ensRegistry, 'optionalAccess', _11 => _11.address])
28
28
  },
29
29
  apiKey
30
30
  );
31
31
  return Object.assign(provider, { priority, stallTimeout, weight });
32
32
  },
33
- webSocketProvider: () => new providers.InfuraWebSocketProvider(
33
+ webSocketProvider: () => new _ethers.providers.InfuraWebSocketProvider(
34
34
  {
35
35
  chainId: chain.id,
36
36
  name: chain.network,
37
- ensAddress: chain.contracts?.ensRegistry?.address
37
+ ensAddress: _optionalChain([chain, 'access', _12 => _12.contracts, 'optionalAccess', _13 => _13.ensRegistry, 'optionalAccess', _14 => _14.address])
38
38
  },
39
39
  apiKey
40
40
  )
41
41
  };
42
42
  };
43
43
  }
44
- export {
45
- infuraProvider
46
- };
44
+
45
+
46
+ exports.infuraProvider = infuraProvider;
@@ -1,7 +1,7 @@
1
- import "../chunk-MQXBDTVK.js";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-MQXBDTVK.js');
2
2
 
3
3
  // src/providers/jsonRpc.ts
4
- import { providers } from "ethers";
4
+ var _ethers = require('ethers');
5
5
  function jsonRpcProvider({
6
6
  priority,
7
7
  rpc,
@@ -22,16 +22,16 @@ function jsonRpcProvider({
22
22
  }
23
23
  },
24
24
  provider: () => {
25
- const RpcProvider = static_ ? providers.StaticJsonRpcProvider : providers.JsonRpcProvider;
25
+ const RpcProvider = static_ ? _ethers.providers.StaticJsonRpcProvider : _ethers.providers.JsonRpcProvider;
26
26
  const provider = new RpcProvider(rpcConfig.http, {
27
- ensAddress: chain.contracts?.ensRegistry?.address,
27
+ ensAddress: _optionalChain([chain, 'access', _ => _.contracts, 'optionalAccess', _2 => _2.ensRegistry, 'optionalAccess', _3 => _3.address]),
28
28
  chainId: chain.id,
29
29
  name: chain.network
30
30
  });
31
31
  return Object.assign(provider, { priority, stallTimeout, weight });
32
32
  },
33
33
  ...rpcConfig.webSocket && {
34
- webSocketProvider: () => new providers.WebSocketProvider(
34
+ webSocketProvider: () => new _ethers.providers.WebSocketProvider(
35
35
  rpcConfig.webSocket,
36
36
  chain.id
37
37
  )
@@ -39,6 +39,6 @@ function jsonRpcProvider({
39
39
  };
40
40
  };
41
41
  }
42
- export {
43
- jsonRpcProvider
44
- };
42
+
43
+
44
+ exports.jsonRpcProvider = jsonRpcProvider;
@@ -1,7 +1,7 @@
1
- import "../chunk-MQXBDTVK.js";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-MQXBDTVK.js');
2
2
 
3
3
  // src/providers/public.ts
4
- import { providers } from "ethers";
4
+ var _ethers = require('ethers');
5
5
  function publicProvider({
6
6
  priority,
7
7
  stallTimeout,
@@ -13,12 +13,12 @@ function publicProvider({
13
13
  return {
14
14
  chain,
15
15
  provider: () => {
16
- const provider = new providers.StaticJsonRpcProvider(
16
+ const provider = new _ethers.providers.StaticJsonRpcProvider(
17
17
  chain.rpcUrls.default.http[0],
18
18
  {
19
19
  chainId: chain.id,
20
20
  name: chain.network,
21
- ensAddress: chain.contracts?.ensRegistry?.address
21
+ ensAddress: _optionalChain([chain, 'access', _ => _.contracts, 'optionalAccess', _2 => _2.ensRegistry, 'optionalAccess', _3 => _3.address])
22
22
  }
23
23
  );
24
24
  return Object.assign(provider, { priority, stallTimeout, weight });
@@ -26,6 +26,6 @@ function publicProvider({
26
26
  };
27
27
  };
28
28
  }
29
- export {
30
- publicProvider
31
- };
29
+
30
+
31
+ exports.publicProvider = publicProvider;
@@ -0,0 +1,11 @@
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/internal";
@@ -0,0 +1,16 @@
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
9
+
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/internal.ts");
15
+
16
+ unregister();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wagmi/core",
3
3
  "description": "Vanilla JS library for Ethereum",
4
4
  "license": "MIT",
5
- "version": "0.10.7",
5
+ "version": "0.10.8-cjs",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/wagmi-dev/wagmi.git",
@@ -23,7 +23,6 @@
23
23
  "url": "https://github.com/sponsors/wagmi-dev"
24
24
  }
25
25
  ],
26
- "type": "module",
27
26
  "main": "dist/index.js",
28
27
  "types": "dist/index.d.ts",
29
28
  "exports": {
@@ -115,11 +114,11 @@
115
114
  }
116
115
  },
117
116
  "dependencies": {
117
+ "@wagmi/chains": "0.2.15-cjs",
118
+ "@wagmi/connectors": "0.3.10-cjs",
118
119
  "abitype": "^0.3.0",
119
120
  "eventemitter3": "^4.0.7",
120
- "zustand": "^4.3.1",
121
- "@wagmi/chains": "0.2.14",
122
- "@wagmi/connectors": "0.3.10"
121
+ "zustand": "^4.3.1"
123
122
  },
124
123
  "devDependencies": {
125
124
  "ethers": "^5.7.1"
@@ -0,0 +1,11 @@
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/providers/alchemy";
@@ -0,0 +1,16 @@
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
9
+
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/providers/alchemy.ts");
15
+
16
+ unregister();
@@ -0,0 +1,11 @@
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/providers/infura";
@@ -0,0 +1,16 @@
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
9
+
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/providers/infura.ts");
15
+
16
+ unregister();
@@ -0,0 +1,11 @@
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/providers/jsonRpc";
@@ -0,0 +1,16 @@
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
9
+
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/providers/jsonRpc.ts");
15
+
16
+ unregister();
@@ -0,0 +1,11 @@
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/providers/public";
@@ -0,0 +1,16 @@
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
9
+
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/providers/public.ts");
15
+
16
+ unregister();
@@ -1,164 +0,0 @@
1
- // src/chains.ts
2
- import {
3
- arbitrum,
4
- arbitrumGoerli,
5
- aurora,
6
- auroraTestnet,
7
- avalanche,
8
- avalancheFuji,
9
- baseGoerli,
10
- boba,
11
- bronos,
12
- bronosTestnet,
13
- bsc,
14
- bscTestnet,
15
- canto,
16
- celo,
17
- celoAlfajores,
18
- cronos,
19
- crossbell,
20
- dfk,
21
- dogechain,
22
- evmos,
23
- evmosTestnet,
24
- fantom,
25
- fantomTestnet,
26
- filecoin,
27
- filecoinCalibration,
28
- filecoinHyperspace,
29
- flare,
30
- flareTestnet,
31
- foundry,
32
- iotex,
33
- iotexTestnet,
34
- goerli,
35
- gnosis,
36
- gnosisChiado,
37
- hardhat,
38
- harmonyOne,
39
- klaytn,
40
- localhost,
41
- mainnet,
42
- metis,
43
- metisGoerli,
44
- moonbaseAlpha,
45
- moonbeam,
46
- moonriver,
47
- okc,
48
- optimism,
49
- optimismGoerli,
50
- polygon,
51
- polygonMumbai,
52
- polygonZkEvmTestnet,
53
- scrollTestnet,
54
- sepolia,
55
- skaleBlockBrawlers,
56
- skaleCalypso,
57
- skaleCalypsoTestnet,
58
- skaleChaosTestnet,
59
- skaleCryptoBlades,
60
- skaleCryptoColosseum,
61
- skaleEuropa,
62
- skaleEuropaTestnet,
63
- skaleExorde,
64
- skaleHumanProtocol,
65
- skaleNebula,
66
- skaleNebulaTestnet,
67
- skaleRazor,
68
- skaleTitan,
69
- skaleTitanTestnet,
70
- songbird,
71
- songbirdTestnet,
72
- shardeumSphinx,
73
- taraxa,
74
- taraxaTestnet,
75
- telos,
76
- telosTestnet,
77
- wanchain,
78
- wanchainTestnet,
79
- zhejiang,
80
- zkSync,
81
- zkSyncTestnet
82
- } from "@wagmi/chains";
83
-
84
- export {
85
- arbitrum,
86
- arbitrumGoerli,
87
- aurora,
88
- auroraTestnet,
89
- avalanche,
90
- avalancheFuji,
91
- baseGoerli,
92
- boba,
93
- bronos,
94
- bronosTestnet,
95
- bsc,
96
- bscTestnet,
97
- canto,
98
- celo,
99
- celoAlfajores,
100
- cronos,
101
- crossbell,
102
- dfk,
103
- dogechain,
104
- evmos,
105
- evmosTestnet,
106
- fantom,
107
- fantomTestnet,
108
- filecoin,
109
- filecoinCalibration,
110
- filecoinHyperspace,
111
- flare,
112
- flareTestnet,
113
- foundry,
114
- iotex,
115
- iotexTestnet,
116
- goerli,
117
- gnosis,
118
- gnosisChiado,
119
- hardhat,
120
- harmonyOne,
121
- klaytn,
122
- localhost,
123
- mainnet,
124
- metis,
125
- metisGoerli,
126
- moonbaseAlpha,
127
- moonbeam,
128
- moonriver,
129
- okc,
130
- optimism,
131
- optimismGoerli,
132
- polygon,
133
- polygonMumbai,
134
- polygonZkEvmTestnet,
135
- scrollTestnet,
136
- sepolia,
137
- skaleBlockBrawlers,
138
- skaleCalypso,
139
- skaleCalypsoTestnet,
140
- skaleChaosTestnet,
141
- skaleCryptoBlades,
142
- skaleCryptoColosseum,
143
- skaleEuropa,
144
- skaleEuropaTestnet,
145
- skaleExorde,
146
- skaleHumanProtocol,
147
- skaleNebula,
148
- skaleNebulaTestnet,
149
- skaleRazor,
150
- skaleTitan,
151
- skaleTitanTestnet,
152
- songbird,
153
- songbirdTestnet,
154
- shardeumSphinx,
155
- taraxa,
156
- taraxaTestnet,
157
- telos,
158
- telosTestnet,
159
- wanchain,
160
- wanchainTestnet,
161
- zhejiang,
162
- zkSync,
163
- zkSyncTestnet
164
- };