@wagmi/core 0.5.0-prepare-hooks.0 → 0.5.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.
Files changed (65) hide show
  1. package/README.md +2 -2
  2. package/chains/dist/wagmi-core-chains.cjs.dev.js +4 -2
  3. package/chains/dist/wagmi-core-chains.cjs.prod.js +4 -2
  4. package/chains/dist/wagmi-core-chains.esm.js +2 -2
  5. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +4 -4
  6. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +4 -4
  7. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +4 -4
  8. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.dev.js +4 -4
  9. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.prod.js +4 -4
  10. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.esm.js +4 -4
  11. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +5 -5
  12. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +5 -5
  13. package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +5 -5
  14. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +4 -4
  15. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +4 -4
  16. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +4 -4
  17. package/dist/{chains-ba6218fb.cjs.dev.js → chains-3916cd7d.cjs.prod.js} +69 -9
  18. package/dist/{chains-174cf4b4.esm.js → chains-505e1070.esm.js} +68 -10
  19. package/dist/{chains-b8e32454.cjs.prod.js → chains-bd8ad853.cjs.dev.js} +69 -9
  20. package/dist/declarations/src/actions/accounts/fetchBalance.d.ts +0 -1
  21. package/dist/declarations/src/actions/contracts/deprecatedWriteContract.d.ts +16 -0
  22. package/dist/declarations/src/actions/{tokens → contracts}/fetchToken.d.ts +0 -0
  23. package/dist/declarations/src/actions/contracts/index.d.ts +2 -0
  24. package/dist/declarations/src/actions/contracts/writeContract.d.ts +2 -2
  25. package/dist/declarations/src/actions/index.d.ts +2 -3
  26. package/dist/declarations/src/actions/transactions/deprecatedSendTransaction.d.ts +12 -0
  27. package/dist/declarations/src/actions/transactions/fetchTransaction.d.ts +21 -0
  28. package/dist/declarations/src/actions/transactions/index.d.ts +2 -0
  29. package/dist/declarations/src/actions/transactions/sendTransaction.d.ts +2 -2
  30. package/dist/declarations/src/chains.d.ts +1 -1
  31. package/dist/declarations/src/connectors/coinbaseWallet.d.ts +1 -1
  32. package/dist/declarations/src/connectors/mock/connector.d.ts +1 -1
  33. package/dist/declarations/src/connectors/mock/provider.d.ts +4 -3
  34. package/dist/declarations/src/connectors/walletConnect.d.ts +1 -1
  35. package/dist/declarations/src/constants/chains.d.ts +6 -0
  36. package/dist/declarations/src/constants/index.d.ts +1 -1
  37. package/dist/declarations/src/constants/rpcs.d.ts +5 -5
  38. package/dist/declarations/src/index.d.ts +2 -2
  39. package/dist/declarations/src/providers/alchemy.d.ts +2 -2
  40. package/dist/declarations/src/providers/infura.d.ts +2 -2
  41. package/dist/declarations/src/types/index.d.ts +3 -0
  42. package/dist/{getProvider-ec251513.cjs.dev.js → getProvider-a1ad435d.cjs.prod.js} +58 -55
  43. package/dist/{getProvider-27edfd38.cjs.prod.js → getProvider-e2217cb6.cjs.dev.js} +58 -55
  44. package/dist/{getProvider-048a69c4.esm.js → getProvider-e3d84eba.esm.js} +59 -56
  45. package/dist/{rpcs-1fd0a12f.cjs.prod.js → rpcs-3cf5a783.cjs.dev.js} +18 -12
  46. package/dist/{rpcs-f1d24f0e.cjs.dev.js → rpcs-afd1cc09.cjs.prod.js} +18 -12
  47. package/dist/{rpcs-b73a8f60.esm.js → rpcs-e837abf2.esm.js} +17 -11
  48. package/dist/wagmi-core.cjs.dev.js +166 -49
  49. package/dist/wagmi-core.cjs.prod.js +166 -49
  50. package/dist/wagmi-core.esm.js +166 -52
  51. package/package.json +9 -5
  52. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.dev.js +5 -5
  53. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.prod.js +5 -5
  54. package/providers/alchemy/dist/wagmi-core-providers-alchemy.esm.js +5 -5
  55. package/providers/infura/dist/wagmi-core-providers-infura.cjs.dev.js +5 -5
  56. package/providers/infura/dist/wagmi-core-providers-infura.cjs.prod.js +5 -5
  57. package/providers/infura/dist/wagmi-core-providers-infura.esm.js +5 -5
  58. package/connectors/injected/dist/wagmi-core-connectors-injected.cjs.d.ts +0 -1
  59. package/connectors/injected/dist/wagmi-core-connectors-injected.cjs.dev.js +0 -200
  60. package/connectors/injected/dist/wagmi-core-connectors-injected.cjs.js +0 -7
  61. package/connectors/injected/dist/wagmi-core-connectors-injected.cjs.prod.js +0 -200
  62. package/connectors/injected/dist/wagmi-core-connectors-injected.esm.js +0 -196
  63. package/connectors/walletLink/dist/wagmi-core-connectors-walletLink.cjs.d.ts +0 -11
  64. package/connectors/walletLink/dist/wagmi-core-connectors-walletLink.cjs.js +0 -16
  65. package/dist/declarations/src/actions/tokens/index.d.ts +0 -1
@@ -1,13 +1,13 @@
1
- import { g as getClient, C as ConnectorAlreadyConnectedError, a as ConnectorNotFoundError, b as ContractMethodDoesNotExistError, c as getProvider, P as ProviderChainsNotFound, d as ChainDoesNotSupportMulticallError, e as ContractMethodNoResultError, f as ChainMismatchError, U as UserRejectedRequestError, n as normalizeChainId, S as SwitchChainNotSupportedError } from './getProvider-048a69c4.esm.js';
2
- export { A as AddChainError, d as ChainDoesNotSupportMulticallError, f as ChainMismatchError, k as ChainNotConfiguredError, i as Client, j as Connector, C as ConnectorAlreadyConnectedError, a as ConnectorNotFoundError, b as ContractMethodDoesNotExistError, e as ContractMethodNoResultError, I as InjectedConnector, P as ProviderChainsNotFound, l as ProviderRpcError, R as ResourceUnavailableError, m as RpcError, o as SwitchChainError, S as SwitchChainNotSupportedError, U as UserRejectedRequestError, h as createClient, p as createStorage, c as getProvider, q as noopStorage, n as normalizeChainId } from './getProvider-048a69c4.esm.js';
3
- import { Contract, logger } from 'ethers/lib/ethers';
4
- import { getAddress, isAddress, Logger, formatUnits } from 'ethers/lib/utils';
1
+ import { g as getClient, C as ConnectorAlreadyConnectedError, a as ConnectorNotFoundError, b as ChainMismatchError, U as UserRejectedRequestError, c as ContractMethodDoesNotExistError, d as getProvider, P as ProviderChainsNotFound, e as ChainDoesNotSupportMulticallError, f as ContractMethodNoResultError, n as normalizeChainId, S as SwitchChainNotSupportedError } from './getProvider-e3d84eba.esm.js';
2
+ export { A as AddChainError, e as ChainDoesNotSupportMulticallError, b as ChainMismatchError, k as ChainNotConfiguredError, i as Client, j as Connector, C as ConnectorAlreadyConnectedError, a as ConnectorNotFoundError, c as ContractMethodDoesNotExistError, f as ContractMethodNoResultError, I as InjectedConnector, P as ProviderChainsNotFound, l as ProviderRpcError, R as ResourceUnavailableError, m as RpcError, o as SwitchChainError, S as SwitchChainNotSupportedError, U as UserRejectedRequestError, h as createClient, p as createStorage, d as getProvider, q as noopStorage, n as normalizeChainId } from './getProvider-e3d84eba.esm.js';
5
3
  import { providers, Contract as Contract$1 } from 'ethers';
4
+ import { Contract, logger } from 'ethers/lib/ethers';
5
+ import { formatUnits, getAddress, isAddress, Logger } from 'ethers/lib/utils';
6
6
  import shallow from 'zustand/shallow';
7
- export { a as alchemyRpcUrls, i as infuraRpcUrls, p as publicRpcUrls } from './rpcs-b73a8f60.esm.js';
8
- export { a as allChains, c as chain, b as chainId, d as defaultChains, e as defaultL2Chains, f as etherscanBlockExplorers } from './chains-174cf4b4.esm.js';
9
- import 'zustand/vanilla';
7
+ export { a as alchemyRpcUrls, i as infuraRpcUrls, p as publicRpcUrls } from './rpcs-e837abf2.esm.js';
8
+ export { a as allChains, c as chain, b as chainId, d as defaultChains, e as defaultL2Chains, f as etherscanBlockExplorers } from './chains-505e1070.esm.js';
10
9
  import 'zustand/middleware';
10
+ import 'zustand/vanilla';
11
11
  import 'eventemitter3';
12
12
 
13
13
  function configureChains(defaultChains, providers) {
@@ -295,6 +295,93 @@ function getContract(_ref) {
295
295
  return new Contract$1(addressOrName, contractInterface, signerOrProvider);
296
296
  }
297
297
 
298
+ async function deprecatedWriteContract(_ref) {
299
+ let {
300
+ addressOrName,
301
+ args,
302
+ chainId,
303
+ contractInterface,
304
+ functionName,
305
+ overrides,
306
+ signerOrProvider
307
+ } = _ref;
308
+ const {
309
+ connector
310
+ } = getClient();
311
+ if (!connector) throw new ConnectorNotFoundError();
312
+ const params = [...(Array.isArray(args) ? args : args ? [args] : []), ...(overrides ? [overrides] : [])];
313
+
314
+ try {
315
+ var _chain;
316
+
317
+ let chain;
318
+
319
+ if (chainId) {
320
+ const activeChainId = await connector.getChainId(); // Try to switch chain to provided `chainId`
321
+
322
+ if (chainId !== activeChainId) {
323
+ var _connector$chains$fin, _connector$chains$fin2, _connector$chains$fin3, _connector$chains$fin4;
324
+
325
+ if (connector.switchChain) chain = await connector.switchChain(chainId);else throw new ChainMismatchError({
326
+ activeChain: (_connector$chains$fin = (_connector$chains$fin2 = connector.chains.find(x => x.id === activeChainId)) === null || _connector$chains$fin2 === void 0 ? void 0 : _connector$chains$fin2.name) !== null && _connector$chains$fin !== void 0 ? _connector$chains$fin : "Chain ".concat(activeChainId),
327
+ targetChain: (_connector$chains$fin3 = (_connector$chains$fin4 = connector.chains.find(x => x.id === chainId)) === null || _connector$chains$fin4 === void 0 ? void 0 : _connector$chains$fin4.name) !== null && _connector$chains$fin3 !== void 0 ? _connector$chains$fin3 : "Chain ".concat(chainId)
328
+ });
329
+ }
330
+ }
331
+
332
+ const signer = await connector.getSigner({
333
+ chainId: (_chain = chain) === null || _chain === void 0 ? void 0 : _chain.id
334
+ });
335
+ const contract = getContract({
336
+ addressOrName,
337
+ contractInterface,
338
+ signerOrProvider
339
+ });
340
+ const contractWithSigner = contract.connect(signer);
341
+ const contractFunction = contractWithSigner[functionName];
342
+ if (!contractFunction) console.warn("\"".concat(functionName, "\" does not exist in interface for contract \"").concat(addressOrName, "\""));
343
+ return await contractFunction(...params);
344
+ } catch (error) {
345
+ if (error.code === 4001) throw new UserRejectedRequestError(error);
346
+ throw error;
347
+ }
348
+ }
349
+
350
+ async function fetchToken(_ref) {
351
+ let {
352
+ address,
353
+ chainId,
354
+ formatUnits: units = 'ether'
355
+ } = _ref;
356
+ const erc20Config = {
357
+ addressOrName: address,
358
+ contractInterface: erc20ABI,
359
+ chainId
360
+ };
361
+ const [decimals, name, symbol, totalSupply] = await readContracts({
362
+ allowFailure: false,
363
+ contracts: [{ ...erc20Config,
364
+ functionName: 'decimals'
365
+ }, { ...erc20Config,
366
+ functionName: 'name'
367
+ }, { ...erc20Config,
368
+ functionName: 'symbol'
369
+ }, { ...erc20Config,
370
+ functionName: 'totalSupply'
371
+ }]
372
+ });
373
+ return {
374
+ address,
375
+ decimals,
376
+ name,
377
+ symbol,
378
+ totalSupply: {
379
+ formatted: formatUnits(totalSupply, units),
380
+ value: totalSupply
381
+ }
382
+ };
383
+ }
384
+
298
385
  /**
299
386
  * @description Prepares the parameters required for a contract write transaction.
300
387
  *
@@ -712,6 +799,66 @@ function watchReadContracts(config, callback) {
712
799
  };
713
800
  }
714
801
 
802
+ async function deprecatedSendTransaction(_ref) {
803
+ let {
804
+ chainId,
805
+ request
806
+ } = _ref;
807
+ const {
808
+ connector
809
+ } = getClient();
810
+ if (!connector) throw new ConnectorNotFoundError();
811
+
812
+ try {
813
+ var _chain;
814
+
815
+ let chain;
816
+
817
+ if (chainId) {
818
+ const activeChainId = await connector.getChainId(); // Try to switch chain to provided `chainId`
819
+
820
+ if (chainId !== activeChainId) {
821
+ var _connector$chains$fin, _connector$chains$fin2, _connector$chains$fin3, _connector$chains$fin4;
822
+
823
+ if (connector.switchChain) chain = await connector.switchChain(chainId);else throw new ChainMismatchError({
824
+ activeChain: (_connector$chains$fin = (_connector$chains$fin2 = connector.chains.find(x => x.id === activeChainId)) === null || _connector$chains$fin2 === void 0 ? void 0 : _connector$chains$fin2.name) !== null && _connector$chains$fin !== void 0 ? _connector$chains$fin : "Chain ".concat(activeChainId),
825
+ targetChain: (_connector$chains$fin3 = (_connector$chains$fin4 = connector.chains.find(x => x.id === chainId)) === null || _connector$chains$fin4 === void 0 ? void 0 : _connector$chains$fin4.name) !== null && _connector$chains$fin3 !== void 0 ? _connector$chains$fin3 : "Chain ".concat(chainId)
826
+ });
827
+ }
828
+ }
829
+
830
+ const signer = await connector.getSigner({
831
+ chainId: (_chain = chain) === null || _chain === void 0 ? void 0 : _chain.id
832
+ });
833
+ return await signer.sendTransaction(request);
834
+ } catch (error) {
835
+ if (error.code === 4001) throw new UserRejectedRequestError(error);
836
+ throw error;
837
+ }
838
+ }
839
+
840
+ /**
841
+ * @description Fetches transaction for hash
842
+ *
843
+ * @example
844
+ * import { fetchTransaction } from '@wagmi/core'
845
+ *
846
+ * const transaction = await fetchTransaction({
847
+ * chainId: 1,
848
+ * hash: '0x...',
849
+ * })
850
+ */
851
+ async function fetchTransaction(_ref) {
852
+ let {
853
+ chainId,
854
+ hash
855
+ } = _ref;
856
+ const provider = getProvider({
857
+ chainId
858
+ });
859
+ return await provider.getTransaction(hash);
860
+ }
861
+
715
862
  async function fetchEnsAddress(_ref) {
716
863
  let {
717
864
  chainId,
@@ -786,7 +933,9 @@ async function prepareSendTransaction(_ref) {
786
933
  let {
787
934
  chainId,
788
935
  request,
789
- signerOrProvider = getProvider()
936
+ signerOrProvider = getProvider({
937
+ chainId
938
+ })
790
939
  } = _ref;
791
940
  const [to, gasLimit] = await Promise.all([isAddress(request.to) ? Promise.resolve(request.to) : fetchEnsAddress({
792
941
  name: request.to
@@ -861,6 +1010,8 @@ async function sendTransaction(_ref) {
861
1010
  }
862
1011
 
863
1012
  try {
1013
+ var _connectUnchecked, _ref2;
1014
+
864
1015
  // Why don't we just use `signer.sendTransaction`?
865
1016
  // The `signer.sendTransaction` method performs async
866
1017
  // heavy operations (such as fetching block number)
@@ -868,11 +1019,11 @@ async function sendTransaction(_ref) {
868
1019
  // Having async heavy operations has side effects
869
1020
  // when using it in a click handler (iOS deep linking issues,
870
1021
  // delay to open wallet, etc).
871
- const uncheckedSigner = signer.connectUnchecked();
1022
+ const uncheckedSigner = (_connectUnchecked = (_ref2 = signer).connectUnchecked) === null || _connectUnchecked === void 0 ? void 0 : _connectUnchecked.call(_ref2);
872
1023
  const {
873
1024
  hash,
874
1025
  wait
875
- } = await uncheckedSigner.sendTransaction(request);
1026
+ } = await (uncheckedSigner !== null && uncheckedSigner !== void 0 ? uncheckedSigner : signer).sendTransaction(request);
876
1027
  /********************************************************************/
877
1028
 
878
1029
  /** END: iOS App Link cautious code. */
@@ -969,7 +1120,7 @@ async function writeContract(_ref) {
969
1120
  if (!request_) throw new Error('`request` is required');
970
1121
  }
971
1122
 
972
- const request = mode === 'dangerouslyUnprepared' ? (await prepareWriteContract({
1123
+ const request = mode === 'recklesslyUnprepared' ? (await prepareWriteContract({
973
1124
  addressOrName,
974
1125
  args,
975
1126
  contractInterface,
@@ -997,7 +1148,7 @@ async function fetchBalance(_ref) {
997
1148
  let {
998
1149
  addressOrName,
999
1150
  chainId,
1000
- formatUnits: unit = 'ether',
1151
+ formatUnits: unit,
1001
1152
  token
1002
1153
  } = _ref;
1003
1154
  const client = getClient();
@@ -1034,9 +1185,8 @@ async function fetchBalance(_ref) {
1034
1185
  });
1035
1186
  return {
1036
1187
  decimals,
1037
- formatted: formatUnits(value !== null && value !== void 0 ? value : '0', unit),
1188
+ formatted: formatUnits(value !== null && value !== void 0 ? value : '0', unit !== null && unit !== void 0 ? unit : decimals),
1038
1189
  symbol,
1039
- unit,
1040
1190
  value
1041
1191
  };
1042
1192
  }
@@ -1046,9 +1196,8 @@ async function fetchBalance(_ref) {
1046
1196
  const chain = chains.find(x => x.id === provider.network.chainId);
1047
1197
  return {
1048
1198
  decimals: (_chain$nativeCurrency = chain === null || chain === void 0 ? void 0 : (_chain$nativeCurrency2 = chain.nativeCurrency) === null || _chain$nativeCurrency2 === void 0 ? void 0 : _chain$nativeCurrency2.decimals) !== null && _chain$nativeCurrency !== void 0 ? _chain$nativeCurrency : 18,
1049
- formatted: formatUnits(value !== null && value !== void 0 ? value : '0', unit),
1199
+ formatted: formatUnits(value !== null && value !== void 0 ? value : '0', unit !== null && unit !== void 0 ? unit : 'ether'),
1050
1200
  symbol: (_chain$nativeCurrency3 = chain === null || chain === void 0 ? void 0 : (_chain$nativeCurrency4 = chain.nativeCurrency) === null || _chain$nativeCurrency4 === void 0 ? void 0 : _chain$nativeCurrency4.symbol) !== null && _chain$nativeCurrency3 !== void 0 ? _chain$nativeCurrency3 : 'ETH',
1051
- unit,
1052
1201
  value
1053
1202
  };
1054
1203
  }
@@ -1289,39 +1438,4 @@ async function fetchFeeData() {
1289
1438
  };
1290
1439
  }
1291
1440
 
1292
- async function fetchToken(_ref) {
1293
- let {
1294
- address,
1295
- chainId,
1296
- formatUnits: units = 'ether'
1297
- } = _ref;
1298
- const erc20Config = {
1299
- addressOrName: address,
1300
- contractInterface: erc20ABI,
1301
- chainId
1302
- };
1303
- const [decimals, name, symbol, totalSupply] = await readContracts({
1304
- allowFailure: false,
1305
- contracts: [{ ...erc20Config,
1306
- functionName: 'decimals'
1307
- }, { ...erc20Config,
1308
- functionName: 'name'
1309
- }, { ...erc20Config,
1310
- functionName: 'symbol'
1311
- }, { ...erc20Config,
1312
- functionName: 'totalSupply'
1313
- }]
1314
- });
1315
- return {
1316
- address,
1317
- decimals,
1318
- name,
1319
- symbol,
1320
- totalSupply: {
1321
- formatted: formatUnits(totalSupply, units),
1322
- value: totalSupply
1323
- }
1324
- };
1325
- }
1326
-
1327
- export { configureChains, connect, deepEqual, disconnect, erc20ABI, erc721ABI, fetchBalance, fetchBlockNumber, fetchEnsAddress, fetchEnsAvatar, fetchEnsName, fetchEnsResolver, fetchFeeData, fetchSigner, fetchToken, getAccount, getContract, getNetwork, getWebSocketProvider, parseContractResult, prepareSendTransaction, prepareWriteContract, readContract, readContracts, sendTransaction, signMessage, signTypedData, switchNetwork, units, waitForTransaction, watchAccount, watchBlockNumber, watchContractEvent, watchNetwork, watchProvider, watchReadContract, watchReadContracts, watchSigner, watchWebSocketProvider, writeContract };
1441
+ export { configureChains, connect, deepEqual, deprecatedSendTransaction, deprecatedWriteContract, disconnect, erc20ABI, erc721ABI, fetchBalance, fetchBlockNumber, fetchEnsAddress, fetchEnsAvatar, fetchEnsName, fetchEnsResolver, fetchFeeData, fetchSigner, fetchToken, fetchTransaction, getAccount, getContract, getNetwork, getWebSocketProvider, parseContractResult, prepareSendTransaction, prepareWriteContract, readContract, readContracts, sendTransaction, signMessage, signTypedData, switchNetwork, units, waitForTransaction, watchAccount, watchBlockNumber, watchContractEvent, watchNetwork, watchProvider, watchReadContract, watchReadContracts, watchSigner, watchWebSocketProvider, writeContract };
package/package.json CHANGED
@@ -2,10 +2,14 @@
2
2
  "name": "@wagmi/core",
3
3
  "description": "Vanilla JS library for Ethereum",
4
4
  "license": "WAGMIT",
5
- "version": "0.5.0-prepare-hooks.0",
6
- "repository": "wagmi-dev/wagmi",
5
+ "version": "0.5.2",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/wagmi-dev/wagmi.git",
9
+ "directory": "packages/core"
10
+ },
7
11
  "author": "awkweb.eth",
8
- "ethereum": "awkweb.eth",
12
+ "ethereum": "wagmi-dev.eth",
9
13
  "funding": [
10
14
  {
11
15
  "type": "gitcoin",
@@ -13,10 +17,9 @@
13
17
  },
14
18
  {
15
19
  "type": "github",
16
- "url": "https://github.com/sponsors/tmm"
20
+ "url": "https://github.com/sponsors/wagmi-dev"
17
21
  }
18
22
  ],
19
- "sideEffects": false,
20
23
  "main": "dist/wagmi-core.cjs.js",
21
24
  "module": "dist/wagmi-core.esm.js",
22
25
  "types": "dist/wagmi-core.cjs.d.ts",
@@ -63,6 +66,7 @@
63
66
  "default": "./providers/public/dist/wagmi-core-providers-public.cjs.js"
64
67
  }
65
68
  },
69
+ "sideEffects": false,
66
70
  "files": [
67
71
  "/chains",
68
72
  "/connectors",
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var ethers = require('ethers');
6
- var rpcs = require('../../../dist/rpcs-f1d24f0e.cjs.dev.js');
6
+ var rpcs = require('../../../dist/rpcs-3cf5a783.cjs.dev.js');
7
7
 
8
8
  function alchemyProvider() {
9
9
  let {
10
- alchemyId = rpcs.defaultAlchemyId,
10
+ apiKey = rpcs.defaultAlchemyApiKey,
11
11
  priority,
12
12
  stallTimeout,
13
13
  weight
@@ -17,18 +17,18 @@ function alchemyProvider() {
17
17
  return {
18
18
  chain: { ...chain,
19
19
  rpcUrls: { ...chain.rpcUrls,
20
- default: "".concat(chain.rpcUrls.alchemy, "/").concat(alchemyId)
20
+ default: "".concat(chain.rpcUrls.alchemy, "/").concat(apiKey)
21
21
  }
22
22
  },
23
23
  provider: () => {
24
- const provider = new ethers.providers.AlchemyProvider(chain.id, alchemyId);
24
+ const provider = new ethers.providers.AlchemyProvider(chain.id, apiKey);
25
25
  return Object.assign(provider, {
26
26
  priority,
27
27
  stallTimeout,
28
28
  weight
29
29
  });
30
30
  },
31
- webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, alchemyId)
31
+ webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, apiKey)
32
32
  };
33
33
  };
34
34
  }
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var ethers = require('ethers');
6
- var rpcs = require('../../../dist/rpcs-1fd0a12f.cjs.prod.js');
6
+ var rpcs = require('../../../dist/rpcs-afd1cc09.cjs.prod.js');
7
7
 
8
8
  function alchemyProvider() {
9
9
  let {
10
- alchemyId = rpcs.defaultAlchemyId,
10
+ apiKey = rpcs.defaultAlchemyApiKey,
11
11
  priority,
12
12
  stallTimeout,
13
13
  weight
@@ -17,18 +17,18 @@ function alchemyProvider() {
17
17
  return {
18
18
  chain: { ...chain,
19
19
  rpcUrls: { ...chain.rpcUrls,
20
- default: "".concat(chain.rpcUrls.alchemy, "/").concat(alchemyId)
20
+ default: "".concat(chain.rpcUrls.alchemy, "/").concat(apiKey)
21
21
  }
22
22
  },
23
23
  provider: () => {
24
- const provider = new ethers.providers.AlchemyProvider(chain.id, alchemyId);
24
+ const provider = new ethers.providers.AlchemyProvider(chain.id, apiKey);
25
25
  return Object.assign(provider, {
26
26
  priority,
27
27
  stallTimeout,
28
28
  weight
29
29
  });
30
30
  },
31
- webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, alchemyId)
31
+ webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, apiKey)
32
32
  };
33
33
  };
34
34
  }
@@ -1,9 +1,9 @@
1
1
  import { providers } from 'ethers';
2
- import { d as defaultAlchemyId } from '../../../dist/rpcs-b73a8f60.esm.js';
2
+ import { d as defaultAlchemyApiKey } from '../../../dist/rpcs-e837abf2.esm.js';
3
3
 
4
4
  function alchemyProvider() {
5
5
  let {
6
- alchemyId = defaultAlchemyId,
6
+ apiKey = defaultAlchemyApiKey,
7
7
  priority,
8
8
  stallTimeout,
9
9
  weight
@@ -13,18 +13,18 @@ function alchemyProvider() {
13
13
  return {
14
14
  chain: { ...chain,
15
15
  rpcUrls: { ...chain.rpcUrls,
16
- default: "".concat(chain.rpcUrls.alchemy, "/").concat(alchemyId)
16
+ default: "".concat(chain.rpcUrls.alchemy, "/").concat(apiKey)
17
17
  }
18
18
  },
19
19
  provider: () => {
20
- const provider = new providers.AlchemyProvider(chain.id, alchemyId);
20
+ const provider = new providers.AlchemyProvider(chain.id, apiKey);
21
21
  return Object.assign(provider, {
22
22
  priority,
23
23
  stallTimeout,
24
24
  weight
25
25
  });
26
26
  },
27
- webSocketProvider: () => new providers.AlchemyWebSocketProvider(chain.id, alchemyId)
27
+ webSocketProvider: () => new providers.AlchemyWebSocketProvider(chain.id, apiKey)
28
28
  };
29
29
  };
30
30
  }
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var ethers = require('ethers');
6
- var rpcs = require('../../../dist/rpcs-f1d24f0e.cjs.dev.js');
6
+ var rpcs = require('../../../dist/rpcs-3cf5a783.cjs.dev.js');
7
7
 
8
8
  function infuraProvider() {
9
9
  let {
10
- infuraId = rpcs.defaultInfuraId,
10
+ apiKey = rpcs.defaultInfuraApiKey,
11
11
  priority,
12
12
  stallTimeout,
13
13
  weight
@@ -17,18 +17,18 @@ function infuraProvider() {
17
17
  return {
18
18
  chain: { ...chain,
19
19
  rpcUrls: { ...chain.rpcUrls,
20
- default: "".concat(chain.rpcUrls.infura, "/").concat(infuraId)
20
+ default: "".concat(chain.rpcUrls.infura, "/").concat(apiKey)
21
21
  }
22
22
  },
23
23
  provider: () => {
24
- const provider = new ethers.providers.InfuraProvider(chain.id, infuraId);
24
+ const provider = new ethers.providers.InfuraProvider(chain.id, apiKey);
25
25
  return Object.assign(provider, {
26
26
  priority,
27
27
  stallTimeout,
28
28
  weight
29
29
  });
30
30
  },
31
- webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, infuraId)
31
+ webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, apiKey)
32
32
  };
33
33
  };
34
34
  }
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var ethers = require('ethers');
6
- var rpcs = require('../../../dist/rpcs-1fd0a12f.cjs.prod.js');
6
+ var rpcs = require('../../../dist/rpcs-afd1cc09.cjs.prod.js');
7
7
 
8
8
  function infuraProvider() {
9
9
  let {
10
- infuraId = rpcs.defaultInfuraId,
10
+ apiKey = rpcs.defaultInfuraApiKey,
11
11
  priority,
12
12
  stallTimeout,
13
13
  weight
@@ -17,18 +17,18 @@ function infuraProvider() {
17
17
  return {
18
18
  chain: { ...chain,
19
19
  rpcUrls: { ...chain.rpcUrls,
20
- default: "".concat(chain.rpcUrls.infura, "/").concat(infuraId)
20
+ default: "".concat(chain.rpcUrls.infura, "/").concat(apiKey)
21
21
  }
22
22
  },
23
23
  provider: () => {
24
- const provider = new ethers.providers.InfuraProvider(chain.id, infuraId);
24
+ const provider = new ethers.providers.InfuraProvider(chain.id, apiKey);
25
25
  return Object.assign(provider, {
26
26
  priority,
27
27
  stallTimeout,
28
28
  weight
29
29
  });
30
30
  },
31
- webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, infuraId)
31
+ webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, apiKey)
32
32
  };
33
33
  };
34
34
  }
@@ -1,9 +1,9 @@
1
1
  import { providers } from 'ethers';
2
- import { b as defaultInfuraId } from '../../../dist/rpcs-b73a8f60.esm.js';
2
+ import { b as defaultInfuraApiKey } from '../../../dist/rpcs-e837abf2.esm.js';
3
3
 
4
4
  function infuraProvider() {
5
5
  let {
6
- infuraId = defaultInfuraId,
6
+ apiKey = defaultInfuraApiKey,
7
7
  priority,
8
8
  stallTimeout,
9
9
  weight
@@ -13,18 +13,18 @@ function infuraProvider() {
13
13
  return {
14
14
  chain: { ...chain,
15
15
  rpcUrls: { ...chain.rpcUrls,
16
- default: "".concat(chain.rpcUrls.infura, "/").concat(infuraId)
16
+ default: "".concat(chain.rpcUrls.infura, "/").concat(apiKey)
17
17
  }
18
18
  },
19
19
  provider: () => {
20
- const provider = new providers.InfuraProvider(chain.id, infuraId);
20
+ const provider = new providers.InfuraProvider(chain.id, apiKey);
21
21
  return Object.assign(provider, {
22
22
  priority,
23
23
  stallTimeout,
24
24
  weight
25
25
  });
26
26
  },
27
- webSocketProvider: () => new providers.InfuraWebSocketProvider(chain.id, infuraId)
27
+ webSocketProvider: () => new providers.InfuraWebSocketProvider(chain.id, apiKey)
28
28
  };
29
29
  };
30
30
  }
@@ -1 +0,0 @@
1
- export * from "../../../dist/declarations/src/connectors/injected";