@wagmi/core 0.4.9 → 0.5.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 (77) hide show
  1. package/README.md +6 -6
  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 +28 -26
  6. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +28 -26
  7. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +5 -3
  8. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.dev.js +22 -23
  9. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.prod.js +22 -23
  10. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.esm.js +5 -6
  11. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +33 -31
  12. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +33 -31
  13. package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +6 -4
  14. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +24 -25
  15. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +24 -25
  16. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +5 -6
  17. package/dist/{chains-b8e32454.cjs.prod.js → chains-acd25777.cjs.prod.js} +68 -9
  18. package/dist/{chains-174cf4b4.esm.js → chains-ce86f5e0.esm.js} +67 -10
  19. package/dist/{chains-ba6218fb.cjs.dev.js → chains-e81629e7.cjs.dev.js} +68 -9
  20. package/dist/declarations/src/actions/accounts/fetchBalance.d.ts +0 -1
  21. package/dist/declarations/src/actions/accounts/fetchSigner.d.ts +3 -3
  22. package/dist/declarations/src/actions/contracts/deprecatedWriteContract.d.ts +16 -0
  23. package/dist/declarations/src/actions/{tokens → contracts}/fetchToken.d.ts +0 -0
  24. package/dist/declarations/src/actions/contracts/index.d.ts +4 -1
  25. package/dist/declarations/src/actions/contracts/prepareWriteContract.d.ts +37 -0
  26. package/dist/declarations/src/actions/contracts/writeContract.d.ts +44 -8
  27. package/dist/declarations/src/actions/ens/fetchEnsAddress.d.ts +2 -1
  28. package/dist/declarations/src/actions/index.d.ts +2 -3
  29. package/dist/declarations/src/actions/transactions/deprecatedSendTransaction.d.ts +12 -0
  30. package/dist/declarations/src/actions/transactions/fetchTransaction.d.ts +21 -0
  31. package/dist/declarations/src/actions/transactions/index.d.ts +4 -1
  32. package/dist/declarations/src/actions/transactions/prepareSendTransaction.d.ts +36 -0
  33. package/dist/declarations/src/actions/transactions/sendTransaction.d.ts +43 -8
  34. package/dist/declarations/src/chains.d.ts +1 -1
  35. package/dist/declarations/src/client.d.ts +2 -2
  36. package/dist/declarations/src/connectors/base.d.ts +1 -2
  37. package/dist/declarations/src/connectors/coinbaseWallet.d.ts +2 -2
  38. package/dist/declarations/src/connectors/injected.d.ts +1 -1
  39. package/dist/declarations/src/connectors/mock/provider.d.ts +3 -2
  40. package/dist/declarations/src/connectors/walletConnect.d.ts +3 -2
  41. package/dist/declarations/src/constants/chains.d.ts +5 -0
  42. package/dist/declarations/src/constants/index.d.ts +1 -1
  43. package/dist/declarations/src/constants/rpcs.d.ts +5 -5
  44. package/dist/declarations/src/errors.d.ts +10 -3
  45. package/dist/declarations/src/index.d.ts +4 -4
  46. package/dist/declarations/src/providers/alchemy.d.ts +2 -3
  47. package/dist/declarations/src/providers/infura.d.ts +2 -3
  48. package/dist/declarations/src/providers/jsonRpc.d.ts +1 -2
  49. package/dist/declarations/src/providers/public.d.ts +2 -4
  50. package/dist/declarations/src/types/index.d.ts +6 -1
  51. package/dist/declarations/src/utils/configureChains.d.ts +3 -1
  52. package/dist/{client-fbdcbdb2.esm.js → getProvider-073f640f.esm.js} +369 -3
  53. package/dist/{client-4983a639.cjs.dev.js → getProvider-5c497ca0.cjs.dev.js} +436 -45
  54. package/dist/{client-dfad744f.cjs.prod.js → getProvider-868752e4.cjs.prod.js} +436 -45
  55. package/dist/{rpcs-1fd0a12f.cjs.prod.js → rpcs-3cf5a783.cjs.dev.js} +18 -12
  56. package/dist/{rpcs-f1d24f0e.cjs.dev.js → rpcs-afd1cc09.cjs.prod.js} +18 -12
  57. package/dist/{rpcs-b73a8f60.esm.js → rpcs-e837abf2.esm.js} +17 -11
  58. package/dist/wagmi-core.cjs.dev.js +586 -308
  59. package/dist/wagmi-core.cjs.prod.js +586 -308
  60. package/dist/wagmi-core.esm.js +493 -222
  61. package/package.json +9 -5
  62. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.dev.js +5 -7
  63. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.prod.js +5 -7
  64. package/providers/alchemy/dist/wagmi-core-providers-alchemy.esm.js +5 -7
  65. package/providers/infura/dist/wagmi-core-providers-infura.cjs.dev.js +5 -7
  66. package/providers/infura/dist/wagmi-core-providers-infura.cjs.prod.js +5 -7
  67. package/providers/infura/dist/wagmi-core-providers-infura.esm.js +5 -7
  68. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.dev.js +0 -2
  69. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.prod.js +0 -2
  70. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.esm.js +0 -2
  71. package/providers/public/dist/wagmi-core-providers-public.cjs.dev.js +0 -2
  72. package/providers/public/dist/wagmi-core-providers-public.cjs.prod.js +0 -2
  73. package/providers/public/dist/wagmi-core-providers-public.esm.js +0 -2
  74. package/dist/base-337e6424.cjs.prod.js +0 -343
  75. package/dist/base-bd337280.cjs.dev.js +0 -343
  76. package/dist/base-f1bbf263.esm.js +0 -316
  77. package/dist/declarations/src/actions/tokens/index.d.ts +0 -1
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.4.9",
6
- "repository": "tmm/wagmi",
5
+ "version": "0.5.1",
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,12 +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,
11
- pollingInterval,
10
+ apiKey = rpcs.defaultAlchemyApiKey,
12
11
  priority,
13
12
  stallTimeout,
14
13
  weight
@@ -18,19 +17,18 @@ function alchemyProvider() {
18
17
  return {
19
18
  chain: { ...chain,
20
19
  rpcUrls: { ...chain.rpcUrls,
21
- default: "".concat(chain.rpcUrls.alchemy, "/").concat(alchemyId)
20
+ default: "".concat(chain.rpcUrls.alchemy, "/").concat(apiKey)
22
21
  }
23
22
  },
24
23
  provider: () => {
25
- const provider = new ethers.providers.AlchemyProvider(chain.id, alchemyId);
26
- if (pollingInterval) provider.pollingInterval = pollingInterval;
24
+ const provider = new ethers.providers.AlchemyProvider(chain.id, apiKey);
27
25
  return Object.assign(provider, {
28
26
  priority,
29
27
  stallTimeout,
30
28
  weight
31
29
  });
32
30
  },
33
- webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, alchemyId)
31
+ webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, apiKey)
34
32
  };
35
33
  };
36
34
  }
@@ -3,12 +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,
11
- pollingInterval,
10
+ apiKey = rpcs.defaultAlchemyApiKey,
12
11
  priority,
13
12
  stallTimeout,
14
13
  weight
@@ -18,19 +17,18 @@ function alchemyProvider() {
18
17
  return {
19
18
  chain: { ...chain,
20
19
  rpcUrls: { ...chain.rpcUrls,
21
- default: "".concat(chain.rpcUrls.alchemy, "/").concat(alchemyId)
20
+ default: "".concat(chain.rpcUrls.alchemy, "/").concat(apiKey)
22
21
  }
23
22
  },
24
23
  provider: () => {
25
- const provider = new ethers.providers.AlchemyProvider(chain.id, alchemyId);
26
- if (pollingInterval) provider.pollingInterval = pollingInterval;
24
+ const provider = new ethers.providers.AlchemyProvider(chain.id, apiKey);
27
25
  return Object.assign(provider, {
28
26
  priority,
29
27
  stallTimeout,
30
28
  weight
31
29
  });
32
30
  },
33
- webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, alchemyId)
31
+ webSocketProvider: () => new ethers.providers.AlchemyWebSocketProvider(chain.id, apiKey)
34
32
  };
35
33
  };
36
34
  }
@@ -1,10 +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,
7
- pollingInterval,
6
+ apiKey = defaultAlchemyApiKey,
8
7
  priority,
9
8
  stallTimeout,
10
9
  weight
@@ -14,19 +13,18 @@ function alchemyProvider() {
14
13
  return {
15
14
  chain: { ...chain,
16
15
  rpcUrls: { ...chain.rpcUrls,
17
- default: "".concat(chain.rpcUrls.alchemy, "/").concat(alchemyId)
16
+ default: "".concat(chain.rpcUrls.alchemy, "/").concat(apiKey)
18
17
  }
19
18
  },
20
19
  provider: () => {
21
- const provider = new providers.AlchemyProvider(chain.id, alchemyId);
22
- if (pollingInterval) provider.pollingInterval = pollingInterval;
20
+ const provider = new providers.AlchemyProvider(chain.id, apiKey);
23
21
  return Object.assign(provider, {
24
22
  priority,
25
23
  stallTimeout,
26
24
  weight
27
25
  });
28
26
  },
29
- webSocketProvider: () => new providers.AlchemyWebSocketProvider(chain.id, alchemyId)
27
+ webSocketProvider: () => new providers.AlchemyWebSocketProvider(chain.id, apiKey)
30
28
  };
31
29
  };
32
30
  }
@@ -3,12 +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,
11
- pollingInterval,
10
+ apiKey = rpcs.defaultInfuraApiKey,
12
11
  priority,
13
12
  stallTimeout,
14
13
  weight
@@ -18,19 +17,18 @@ function infuraProvider() {
18
17
  return {
19
18
  chain: { ...chain,
20
19
  rpcUrls: { ...chain.rpcUrls,
21
- default: "".concat(chain.rpcUrls.infura, "/").concat(infuraId)
20
+ default: "".concat(chain.rpcUrls.infura, "/").concat(apiKey)
22
21
  }
23
22
  },
24
23
  provider: () => {
25
- const provider = new ethers.providers.InfuraProvider(chain.id, infuraId);
26
- if (pollingInterval) provider.pollingInterval = pollingInterval;
24
+ const provider = new ethers.providers.InfuraProvider(chain.id, apiKey);
27
25
  return Object.assign(provider, {
28
26
  priority,
29
27
  stallTimeout,
30
28
  weight
31
29
  });
32
30
  },
33
- webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, infuraId)
31
+ webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, apiKey)
34
32
  };
35
33
  };
36
34
  }
@@ -3,12 +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,
11
- pollingInterval,
10
+ apiKey = rpcs.defaultInfuraApiKey,
12
11
  priority,
13
12
  stallTimeout,
14
13
  weight
@@ -18,19 +17,18 @@ function infuraProvider() {
18
17
  return {
19
18
  chain: { ...chain,
20
19
  rpcUrls: { ...chain.rpcUrls,
21
- default: "".concat(chain.rpcUrls.infura, "/").concat(infuraId)
20
+ default: "".concat(chain.rpcUrls.infura, "/").concat(apiKey)
22
21
  }
23
22
  },
24
23
  provider: () => {
25
- const provider = new ethers.providers.InfuraProvider(chain.id, infuraId);
26
- if (pollingInterval) provider.pollingInterval = pollingInterval;
24
+ const provider = new ethers.providers.InfuraProvider(chain.id, apiKey);
27
25
  return Object.assign(provider, {
28
26
  priority,
29
27
  stallTimeout,
30
28
  weight
31
29
  });
32
30
  },
33
- webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, infuraId)
31
+ webSocketProvider: () => new ethers.providers.InfuraWebSocketProvider(chain.id, apiKey)
34
32
  };
35
33
  };
36
34
  }
@@ -1,10 +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,
7
- pollingInterval,
6
+ apiKey = defaultInfuraApiKey,
8
7
  priority,
9
8
  stallTimeout,
10
9
  weight
@@ -14,19 +13,18 @@ function infuraProvider() {
14
13
  return {
15
14
  chain: { ...chain,
16
15
  rpcUrls: { ...chain.rpcUrls,
17
- default: "".concat(chain.rpcUrls.infura, "/").concat(infuraId)
16
+ default: "".concat(chain.rpcUrls.infura, "/").concat(apiKey)
18
17
  }
19
18
  },
20
19
  provider: () => {
21
- const provider = new providers.InfuraProvider(chain.id, infuraId);
22
- if (pollingInterval) provider.pollingInterval = pollingInterval;
20
+ const provider = new providers.InfuraProvider(chain.id, apiKey);
23
21
  return Object.assign(provider, {
24
22
  priority,
25
23
  stallTimeout,
26
24
  weight
27
25
  });
28
26
  },
29
- webSocketProvider: () => new providers.InfuraWebSocketProvider(chain.id, infuraId)
27
+ webSocketProvider: () => new providers.InfuraWebSocketProvider(chain.id, apiKey)
30
28
  };
31
29
  };
32
30
  }
@@ -6,7 +6,6 @@ var ethers = require('ethers');
6
6
 
7
7
  function jsonRpcProvider(_ref) {
8
8
  let {
9
- pollingInterval,
10
9
  priority,
11
10
  rpc,
12
11
  stallTimeout,
@@ -31,7 +30,6 @@ function jsonRpcProvider(_ref) {
31
30
  chainId: chain.id,
32
31
  name: chain.network
33
32
  });
34
- if (pollingInterval) provider.pollingInterval = pollingInterval;
35
33
  return Object.assign(provider, {
36
34
  priority,
37
35
  stallTimeout,
@@ -6,7 +6,6 @@ var ethers = require('ethers');
6
6
 
7
7
  function jsonRpcProvider(_ref) {
8
8
  let {
9
- pollingInterval,
10
9
  priority,
11
10
  rpc,
12
11
  stallTimeout,
@@ -31,7 +30,6 @@ function jsonRpcProvider(_ref) {
31
30
  chainId: chain.id,
32
31
  name: chain.network
33
32
  });
34
- if (pollingInterval) provider.pollingInterval = pollingInterval;
35
33
  return Object.assign(provider, {
36
34
  priority,
37
35
  stallTimeout,
@@ -2,7 +2,6 @@ import { providers } from 'ethers';
2
2
 
3
3
  function jsonRpcProvider(_ref) {
4
4
  let {
5
- pollingInterval,
6
5
  priority,
7
6
  rpc,
8
7
  stallTimeout,
@@ -27,7 +26,6 @@ function jsonRpcProvider(_ref) {
27
26
  chainId: chain.id,
28
27
  name: chain.network
29
28
  });
30
- if (pollingInterval) provider.pollingInterval = pollingInterval;
31
29
  return Object.assign(provider, {
32
30
  priority,
33
31
  stallTimeout,
@@ -6,7 +6,6 @@ var ethers = require('ethers');
6
6
 
7
7
  function publicProvider() {
8
8
  let {
9
- pollingInterval,
10
9
  priority,
11
10
  stallTimeout,
12
11
  weight
@@ -20,7 +19,6 @@ function publicProvider() {
20
19
  chainId: chain.id,
21
20
  name: chain.network
22
21
  });
23
- if (pollingInterval) provider.pollingInterval = pollingInterval;
24
22
  return Object.assign(provider, {
25
23
  priority,
26
24
  stallTimeout,
@@ -6,7 +6,6 @@ var ethers = require('ethers');
6
6
 
7
7
  function publicProvider() {
8
8
  let {
9
- pollingInterval,
10
9
  priority,
11
10
  stallTimeout,
12
11
  weight
@@ -20,7 +19,6 @@ function publicProvider() {
20
19
  chainId: chain.id,
21
20
  name: chain.network
22
21
  });
23
- if (pollingInterval) provider.pollingInterval = pollingInterval;
24
22
  return Object.assign(provider, {
25
23
  priority,
26
24
  stallTimeout,
@@ -2,7 +2,6 @@ import { providers } from 'ethers';
2
2
 
3
3
  function publicProvider() {
4
4
  let {
5
- pollingInterval,
6
5
  priority,
7
6
  stallTimeout,
8
7
  weight
@@ -16,7 +15,6 @@ function publicProvider() {
16
15
  chainId: chain.id,
17
16
  name: chain.network
18
17
  });
19
- if (pollingInterval) provider.pollingInterval = pollingInterval;
20
18
  return Object.assign(provider, {
21
19
  priority,
22
20
  stallTimeout,