@wagmi/core 0.4.0-test.0 → 0.4.0-test.1

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 (133) hide show
  1. package/chains/dist/wagmi-core-chains.cjs.d.ts +1 -11
  2. package/chains/dist/wagmi-core-chains.cjs.dev.js +23 -0
  3. package/chains/dist/wagmi-core-chains.cjs.js +6 -15
  4. package/chains/dist/wagmi-core-chains.cjs.prod.js +23 -0
  5. package/chains/dist/wagmi-core-chains.esm.js +2 -0
  6. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.d.ts +1 -11
  7. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +263 -0
  8. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.js +6 -15
  9. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +263 -0
  10. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +241 -0
  11. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.d.ts +1 -11
  12. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.dev.js +78 -0
  13. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.js +6 -15
  14. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.prod.js +78 -0
  15. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.esm.js +74 -0
  16. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.d.ts +1 -11
  17. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +260 -0
  18. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.js +6 -15
  19. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +260 -0
  20. package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +255 -0
  21. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.d.ts +1 -11
  22. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +226 -0
  23. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.js +6 -15
  24. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +226 -0
  25. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +204 -0
  26. package/dist/base-7f682723.cjs.prod.js +623 -0
  27. package/dist/base-ae774f26.cjs.dev.js +623 -0
  28. package/dist/base-c546f171.esm.js +603 -0
  29. package/dist/chains-7e369752.cjs.dev.js +364 -0
  30. package/dist/chains-d045862c.cjs.prod.js +364 -0
  31. package/dist/chains-fa406563.esm.js +343 -0
  32. package/dist/client-42cf11b7.cjs.dev.js +675 -0
  33. package/dist/client-60ee0298.esm.js +664 -0
  34. package/dist/client-ed3aaa6a.cjs.prod.js +675 -0
  35. package/dist/declarations/src/actions/accounts/connect.d.ts +18 -0
  36. package/dist/declarations/src/actions/accounts/disconnect.d.ts +1 -0
  37. package/dist/declarations/src/actions/accounts/fetchBalance.d.ts +20 -0
  38. package/dist/declarations/src/actions/accounts/fetchSigner.d.ts +3 -0
  39. package/dist/declarations/src/actions/accounts/getAccount.d.ts +7 -0
  40. package/dist/declarations/src/actions/accounts/getNetwork.d.ts +9 -0
  41. package/dist/declarations/src/actions/accounts/index.d.ts +12 -0
  42. package/dist/declarations/src/actions/accounts/signMessage.d.ts +9 -0
  43. package/dist/declarations/src/actions/accounts/signTypedData.d.ts +22 -0
  44. package/dist/declarations/src/actions/accounts/switchNetwork.d.ts +6 -0
  45. package/dist/declarations/src/actions/accounts/watchAccount.d.ts +4 -0
  46. package/dist/declarations/src/actions/accounts/watchNetwork.d.ts +3 -0
  47. package/dist/declarations/src/actions/accounts/watchSigner.d.ts +3 -0
  48. package/dist/declarations/src/actions/contracts/getContract.d.ts +10 -0
  49. package/dist/declarations/src/actions/contracts/index.d.ts +5 -0
  50. package/dist/declarations/src/actions/contracts/readContract.d.ts +14 -0
  51. package/dist/declarations/src/actions/contracts/watchContractEvent.d.ts +14 -0
  52. package/dist/declarations/src/actions/contracts/watchReadContract.d.ts +7 -0
  53. package/dist/declarations/src/actions/contracts/writeContract.d.ts +10 -0
  54. package/dist/declarations/src/actions/ens/fetchEnsAddress.d.ts +8 -0
  55. package/dist/declarations/src/actions/ens/fetchEnsAvatar.d.ts +8 -0
  56. package/dist/declarations/src/actions/ens/fetchEnsName.d.ts +8 -0
  57. package/dist/declarations/src/actions/ens/fetchEnsResolver.d.ts +9 -0
  58. package/dist/declarations/src/actions/ens/index.d.ts +4 -0
  59. package/dist/declarations/src/actions/index.d.ts +7 -0
  60. package/dist/declarations/src/actions/network-status/fetchBlockNumber.d.ts +5 -0
  61. package/dist/declarations/src/actions/network-status/fetchFeeData.d.ts +16 -0
  62. package/dist/declarations/src/actions/network-status/index.d.ts +3 -0
  63. package/dist/declarations/src/actions/network-status/watchBlockNumber.d.ts +6 -0
  64. package/dist/declarations/src/actions/providers/getProvider.d.ts +7 -0
  65. package/dist/declarations/src/actions/providers/getWebSocketProvider.d.ts +7 -0
  66. package/dist/declarations/src/actions/providers/index.d.ts +4 -0
  67. package/dist/declarations/src/actions/providers/watchProvider.d.ts +4 -0
  68. package/dist/declarations/src/actions/providers/watchWebSocketProvider.d.ts +4 -0
  69. package/dist/declarations/src/actions/tokens/fetchToken.d.ts +20 -0
  70. package/dist/declarations/src/actions/tokens/index.d.ts +1 -0
  71. package/dist/declarations/src/actions/transactions/index.d.ts +2 -0
  72. package/dist/declarations/src/actions/transactions/sendTransaction.d.ts +7 -0
  73. package/dist/declarations/src/actions/transactions/waitForTransaction.d.ts +17 -0
  74. package/dist/declarations/src/chains.d.ts +1 -0
  75. package/dist/declarations/src/client.d.ts +82 -0
  76. package/dist/declarations/src/connectors/base.d.ts +60 -0
  77. package/dist/declarations/src/connectors/coinbaseWallet.d.ts +54 -0
  78. package/dist/declarations/src/connectors/index.d.ts +2 -0
  79. package/dist/declarations/src/connectors/injected.d.ts +56 -0
  80. package/dist/declarations/src/connectors/metaMask.d.ts +13 -0
  81. package/dist/declarations/src/connectors/mock/connector.d.ts +41 -0
  82. package/dist/declarations/src/connectors/mock/index.d.ts +2 -0
  83. package/dist/declarations/src/connectors/mock/provider.d.ts +39 -0
  84. package/dist/declarations/src/connectors/walletConnect.d.ts +38 -0
  85. package/dist/declarations/src/constants/abis.d.ts +2 -0
  86. package/dist/declarations/src/constants/blockExplorers.d.ts +9 -0
  87. package/dist/declarations/src/constants/chains.d.ts +55 -0
  88. package/dist/declarations/src/constants/index.d.ts +7 -0
  89. package/dist/declarations/src/constants/rpcs.d.ts +9 -0
  90. package/dist/declarations/src/constants/units.d.ts +1 -0
  91. package/dist/declarations/src/errors.d.ts +72 -0
  92. package/dist/declarations/src/index.d.ts +13 -0
  93. package/dist/declarations/src/providers/alchemy.d.ts +7 -0
  94. package/dist/declarations/src/providers/infura.d.ts +7 -0
  95. package/dist/declarations/src/providers/jsonRpc.d.ts +11 -0
  96. package/dist/declarations/src/providers/public.d.ts +6 -0
  97. package/dist/declarations/src/storage.d.ts +12 -0
  98. package/dist/declarations/src/types/index.d.ts +151 -0
  99. package/dist/declarations/src/utils/configureChains.d.ts +20 -0
  100. package/dist/declarations/src/utils/eventemitter.d.ts +135 -0
  101. package/dist/declarations/src/utils/getInjectedName.d.ts +1 -0
  102. package/dist/declarations/src/utils/index.d.ts +5 -0
  103. package/dist/declarations/src/utils/normalizeChainId.d.ts +1 -0
  104. package/dist/declarations/src/utils/warn.d.ts +1 -0
  105. package/dist/rpcs-7cfbd91c.esm.js +30 -0
  106. package/dist/rpcs-9c4eb960.cjs.dev.js +35 -0
  107. package/dist/rpcs-b3c52116.cjs.prod.js +35 -0
  108. package/dist/wagmi-core.cjs.d.ts +1 -11
  109. package/dist/wagmi-core.cjs.dev.js +763 -0
  110. package/dist/wagmi-core.cjs.js +6 -15
  111. package/dist/wagmi-core.cjs.prod.js +763 -0
  112. package/dist/wagmi-core.esm.js +703 -0
  113. package/package.json +1 -1
  114. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.d.ts +1 -11
  115. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.dev.js +38 -0
  116. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.js +6 -15
  117. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.prod.js +38 -0
  118. package/providers/alchemy/dist/wagmi-core-providers-alchemy.esm.js +34 -0
  119. package/providers/infura/dist/wagmi-core-providers-infura.cjs.d.ts +1 -11
  120. package/providers/infura/dist/wagmi-core-providers-infura.cjs.dev.js +38 -0
  121. package/providers/infura/dist/wagmi-core-providers-infura.cjs.js +6 -15
  122. package/providers/infura/dist/wagmi-core-providers-infura.cjs.prod.js +38 -0
  123. package/providers/infura/dist/wagmi-core-providers-infura.esm.js +34 -0
  124. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.d.ts +1 -11
  125. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.dev.js +46 -0
  126. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.js +6 -15
  127. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.prod.js +46 -0
  128. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.esm.js +42 -0
  129. package/providers/public/dist/wagmi-core-providers-public.cjs.d.ts +1 -11
  130. package/providers/public/dist/wagmi-core-providers-public.cjs.dev.js +34 -0
  131. package/providers/public/dist/wagmi-core-providers-public.cjs.js +6 -15
  132. package/providers/public/dist/wagmi-core-providers-public.cjs.prod.js +34 -0
  133. package/providers/public/dist/wagmi-core-providers-public.esm.js +30 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wagmi/core",
3
3
  "description": "Vanilla JS library for Ethereum",
4
4
  "license": "WAGMIT",
5
- "version": "0.4.0-test.0",
5
+ "version": "0.4.0-test.1",
6
6
  "repository": "tmm/wagmi",
7
7
  "author": "awkweb.eth",
8
8
  "ethereum": "awkweb.eth",
@@ -1,11 +1 @@
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";
1
+ export * from "../../../dist/declarations/src/providers/alchemy";
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ethers = require('ethers');
6
+ var rpcs = require('../../../dist/rpcs-9c4eb960.cjs.dev.js');
7
+
8
+ function alchemyProvider() {
9
+ let {
10
+ alchemyId = rpcs.defaultAlchemyId,
11
+ pollingInterval,
12
+ priority,
13
+ stallTimeout,
14
+ weight
15
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16
+ return function (chain) {
17
+ if (!chain.rpcUrls.alchemy) return null;
18
+ return {
19
+ chain: { ...chain,
20
+ rpcUrls: { ...chain.rpcUrls,
21
+ default: "".concat(chain.rpcUrls.alchemy, "/").concat(alchemyId)
22
+ }
23
+ },
24
+ provider: () => {
25
+ const provider = new ethers.providers.AlchemyProvider(chain.id, alchemyId);
26
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
27
+ return Object.assign(provider, {
28
+ priority,
29
+ stallTimeout,
30
+ weight
31
+ });
32
+ },
33
+ webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, alchemyId)
34
+ };
35
+ };
36
+ }
37
+
38
+ exports.alchemyProvider = alchemyProvider;
@@ -1,16 +1,7 @@
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
1
+ 'use strict';
9
2
 
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();
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./wagmi-core-providers-alchemy.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./wagmi-core-providers-alchemy.cjs.dev.js");
7
+ }
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ethers = require('ethers');
6
+ var rpcs = require('../../../dist/rpcs-b3c52116.cjs.prod.js');
7
+
8
+ function alchemyProvider() {
9
+ let {
10
+ alchemyId = rpcs.defaultAlchemyId,
11
+ pollingInterval,
12
+ priority,
13
+ stallTimeout,
14
+ weight
15
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16
+ return function (chain) {
17
+ if (!chain.rpcUrls.alchemy) return null;
18
+ return {
19
+ chain: { ...chain,
20
+ rpcUrls: { ...chain.rpcUrls,
21
+ default: "".concat(chain.rpcUrls.alchemy, "/").concat(alchemyId)
22
+ }
23
+ },
24
+ provider: () => {
25
+ const provider = new ethers.providers.AlchemyProvider(chain.id, alchemyId);
26
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
27
+ return Object.assign(provider, {
28
+ priority,
29
+ stallTimeout,
30
+ weight
31
+ });
32
+ },
33
+ webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, alchemyId)
34
+ };
35
+ };
36
+ }
37
+
38
+ exports.alchemyProvider = alchemyProvider;
@@ -0,0 +1,34 @@
1
+ import { providers } from 'ethers';
2
+ import { d as defaultAlchemyId } from '../../../dist/rpcs-7cfbd91c.esm.js';
3
+
4
+ function alchemyProvider() {
5
+ let {
6
+ alchemyId = defaultAlchemyId,
7
+ pollingInterval,
8
+ priority,
9
+ stallTimeout,
10
+ weight
11
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12
+ return function (chain) {
13
+ if (!chain.rpcUrls.alchemy) return null;
14
+ return {
15
+ chain: { ...chain,
16
+ rpcUrls: { ...chain.rpcUrls,
17
+ default: "".concat(chain.rpcUrls.alchemy, "/").concat(alchemyId)
18
+ }
19
+ },
20
+ provider: () => {
21
+ const provider = new providers.AlchemyProvider(chain.id, alchemyId);
22
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
23
+ return Object.assign(provider, {
24
+ priority,
25
+ stallTimeout,
26
+ weight
27
+ });
28
+ },
29
+ webSocketProvider: () => new providers.AlchemyWebSocketProvider(chain.id, alchemyId)
30
+ };
31
+ };
32
+ }
33
+
34
+ export { alchemyProvider };
@@ -1,11 +1 @@
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";
1
+ export * from "../../../dist/declarations/src/providers/infura";
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ethers = require('ethers');
6
+ var rpcs = require('../../../dist/rpcs-9c4eb960.cjs.dev.js');
7
+
8
+ function infuraProvider() {
9
+ let {
10
+ infuraId = rpcs.defaultInfuraId,
11
+ pollingInterval,
12
+ priority,
13
+ stallTimeout,
14
+ weight
15
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16
+ return function (chain) {
17
+ if (!chain.rpcUrls.infura) return null;
18
+ return {
19
+ chain: { ...chain,
20
+ rpcUrls: { ...chain.rpcUrls,
21
+ default: "".concat(chain.rpcUrls.infura, "/").concat(infuraId)
22
+ }
23
+ },
24
+ provider: () => {
25
+ const provider = new ethers.providers.InfuraProvider(chain.id, infuraId);
26
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
27
+ return Object.assign(provider, {
28
+ priority,
29
+ stallTimeout,
30
+ weight
31
+ });
32
+ },
33
+ webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, infuraId)
34
+ };
35
+ };
36
+ }
37
+
38
+ exports.infuraProvider = infuraProvider;
@@ -1,16 +1,7 @@
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
1
+ 'use strict';
9
2
 
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();
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./wagmi-core-providers-infura.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./wagmi-core-providers-infura.cjs.dev.js");
7
+ }
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ethers = require('ethers');
6
+ var rpcs = require('../../../dist/rpcs-b3c52116.cjs.prod.js');
7
+
8
+ function infuraProvider() {
9
+ let {
10
+ infuraId = rpcs.defaultInfuraId,
11
+ pollingInterval,
12
+ priority,
13
+ stallTimeout,
14
+ weight
15
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16
+ return function (chain) {
17
+ if (!chain.rpcUrls.infura) return null;
18
+ return {
19
+ chain: { ...chain,
20
+ rpcUrls: { ...chain.rpcUrls,
21
+ default: "".concat(chain.rpcUrls.infura, "/").concat(infuraId)
22
+ }
23
+ },
24
+ provider: () => {
25
+ const provider = new ethers.providers.InfuraProvider(chain.id, infuraId);
26
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
27
+ return Object.assign(provider, {
28
+ priority,
29
+ stallTimeout,
30
+ weight
31
+ });
32
+ },
33
+ webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, infuraId)
34
+ };
35
+ };
36
+ }
37
+
38
+ exports.infuraProvider = infuraProvider;
@@ -0,0 +1,34 @@
1
+ import { providers } from 'ethers';
2
+ import { b as defaultInfuraId } from '../../../dist/rpcs-7cfbd91c.esm.js';
3
+
4
+ function infuraProvider() {
5
+ let {
6
+ infuraId = defaultInfuraId,
7
+ pollingInterval,
8
+ priority,
9
+ stallTimeout,
10
+ weight
11
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12
+ return function (chain) {
13
+ if (!chain.rpcUrls.infura) return null;
14
+ return {
15
+ chain: { ...chain,
16
+ rpcUrls: { ...chain.rpcUrls,
17
+ default: "".concat(chain.rpcUrls.infura, "/").concat(infuraId)
18
+ }
19
+ },
20
+ provider: () => {
21
+ const provider = new providers.InfuraProvider(chain.id, infuraId);
22
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
23
+ return Object.assign(provider, {
24
+ priority,
25
+ stallTimeout,
26
+ weight
27
+ });
28
+ },
29
+ webSocketProvider: () => new providers.InfuraWebSocketProvider(chain.id, infuraId)
30
+ };
31
+ };
32
+ }
33
+
34
+ export { infuraProvider };
@@ -1,11 +1 @@
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";
1
+ export * from "../../../dist/declarations/src/providers/jsonRpc";
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ethers = require('ethers');
6
+
7
+ function jsonRpcProvider(_ref) {
8
+ let {
9
+ pollingInterval,
10
+ priority,
11
+ rpc,
12
+ stallTimeout,
13
+ static: static_ = true,
14
+ weight
15
+ } = _ref;
16
+ return function (chain) {
17
+ const rpcConfig = rpc(chain);
18
+ if (!rpcConfig || rpcConfig.http === '') return null;
19
+ return {
20
+ chain: { ...chain,
21
+ rpcUrls: { ...chain.rpcUrls,
22
+ default: rpcConfig.http
23
+ }
24
+ },
25
+ provider: () => {
26
+ const RpcProvider = static_ ? ethers.providers.StaticJsonRpcProvider : ethers.providers.JsonRpcProvider;
27
+ const provider = new RpcProvider(rpcConfig.http, {
28
+ ensAddress: chain.ensAddress,
29
+ chainId: chain.id,
30
+ name: chain.network
31
+ });
32
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
33
+ return Object.assign(provider, {
34
+ priority,
35
+ stallTimeout,
36
+ weight
37
+ });
38
+ },
39
+ ...(rpcConfig.webSocket && {
40
+ webSocketProvider: () => new ethers.providers.WebSocketProvider(rpcConfig.webSocket, chain.id)
41
+ })
42
+ };
43
+ };
44
+ }
45
+
46
+ exports.jsonRpcProvider = jsonRpcProvider;
@@ -1,16 +1,7 @@
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
1
+ 'use strict';
9
2
 
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();
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./wagmi-core-providers-jsonRpc.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./wagmi-core-providers-jsonRpc.cjs.dev.js");
7
+ }
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ethers = require('ethers');
6
+
7
+ function jsonRpcProvider(_ref) {
8
+ let {
9
+ pollingInterval,
10
+ priority,
11
+ rpc,
12
+ stallTimeout,
13
+ static: static_ = true,
14
+ weight
15
+ } = _ref;
16
+ return function (chain) {
17
+ const rpcConfig = rpc(chain);
18
+ if (!rpcConfig || rpcConfig.http === '') return null;
19
+ return {
20
+ chain: { ...chain,
21
+ rpcUrls: { ...chain.rpcUrls,
22
+ default: rpcConfig.http
23
+ }
24
+ },
25
+ provider: () => {
26
+ const RpcProvider = static_ ? ethers.providers.StaticJsonRpcProvider : ethers.providers.JsonRpcProvider;
27
+ const provider = new RpcProvider(rpcConfig.http, {
28
+ ensAddress: chain.ensAddress,
29
+ chainId: chain.id,
30
+ name: chain.network
31
+ });
32
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
33
+ return Object.assign(provider, {
34
+ priority,
35
+ stallTimeout,
36
+ weight
37
+ });
38
+ },
39
+ ...(rpcConfig.webSocket && {
40
+ webSocketProvider: () => new ethers.providers.WebSocketProvider(rpcConfig.webSocket, chain.id)
41
+ })
42
+ };
43
+ };
44
+ }
45
+
46
+ exports.jsonRpcProvider = jsonRpcProvider;
@@ -0,0 +1,42 @@
1
+ import { providers } from 'ethers';
2
+
3
+ function jsonRpcProvider(_ref) {
4
+ let {
5
+ pollingInterval,
6
+ priority,
7
+ rpc,
8
+ stallTimeout,
9
+ static: static_ = true,
10
+ weight
11
+ } = _ref;
12
+ return function (chain) {
13
+ const rpcConfig = rpc(chain);
14
+ if (!rpcConfig || rpcConfig.http === '') return null;
15
+ return {
16
+ chain: { ...chain,
17
+ rpcUrls: { ...chain.rpcUrls,
18
+ default: rpcConfig.http
19
+ }
20
+ },
21
+ provider: () => {
22
+ const RpcProvider = static_ ? providers.StaticJsonRpcProvider : providers.JsonRpcProvider;
23
+ const provider = new RpcProvider(rpcConfig.http, {
24
+ ensAddress: chain.ensAddress,
25
+ chainId: chain.id,
26
+ name: chain.network
27
+ });
28
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
29
+ return Object.assign(provider, {
30
+ priority,
31
+ stallTimeout,
32
+ weight
33
+ });
34
+ },
35
+ ...(rpcConfig.webSocket && {
36
+ webSocketProvider: () => new providers.WebSocketProvider(rpcConfig.webSocket, chain.id)
37
+ })
38
+ };
39
+ };
40
+ }
41
+
42
+ export { jsonRpcProvider };
@@ -1,11 +1 @@
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";
1
+ export * from "../../../dist/declarations/src/providers/public";
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ethers = require('ethers');
6
+
7
+ function publicProvider() {
8
+ let {
9
+ pollingInterval,
10
+ priority,
11
+ stallTimeout,
12
+ weight
13
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14
+ return function (chain) {
15
+ if (!chain.rpcUrls.default) return null;
16
+ return {
17
+ chain,
18
+ provider: () => {
19
+ const provider = new ethers.providers.StaticJsonRpcProvider(chain.rpcUrls.default, {
20
+ chainId: chain.id,
21
+ name: chain.network
22
+ });
23
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
24
+ return Object.assign(provider, {
25
+ priority,
26
+ stallTimeout,
27
+ weight
28
+ });
29
+ }
30
+ };
31
+ };
32
+ }
33
+
34
+ exports.publicProvider = publicProvider;
@@ -1,16 +1,7 @@
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
1
+ 'use strict';
9
2
 
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();
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./wagmi-core-providers-public.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./wagmi-core-providers-public.cjs.dev.js");
7
+ }
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ethers = require('ethers');
6
+
7
+ function publicProvider() {
8
+ let {
9
+ pollingInterval,
10
+ priority,
11
+ stallTimeout,
12
+ weight
13
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14
+ return function (chain) {
15
+ if (!chain.rpcUrls.default) return null;
16
+ return {
17
+ chain,
18
+ provider: () => {
19
+ const provider = new ethers.providers.StaticJsonRpcProvider(chain.rpcUrls.default, {
20
+ chainId: chain.id,
21
+ name: chain.network
22
+ });
23
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
24
+ return Object.assign(provider, {
25
+ priority,
26
+ stallTimeout,
27
+ weight
28
+ });
29
+ }
30
+ };
31
+ };
32
+ }
33
+
34
+ exports.publicProvider = publicProvider;
@@ -0,0 +1,30 @@
1
+ import { providers } from 'ethers';
2
+
3
+ function publicProvider() {
4
+ let {
5
+ pollingInterval,
6
+ priority,
7
+ stallTimeout,
8
+ weight
9
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10
+ return function (chain) {
11
+ if (!chain.rpcUrls.default) return null;
12
+ return {
13
+ chain,
14
+ provider: () => {
15
+ const provider = new providers.StaticJsonRpcProvider(chain.rpcUrls.default, {
16
+ chainId: chain.id,
17
+ name: chain.network
18
+ });
19
+ if (pollingInterval) provider.pollingInterval = pollingInterval;
20
+ return Object.assign(provider, {
21
+ priority,
22
+ stallTimeout,
23
+ weight
24
+ });
25
+ }
26
+ };
27
+ };
28
+ }
29
+
30
+ export { publicProvider };