@wagmi/core 0.6.6 → 0.6.8

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 (37) hide show
  1. package/chains/dist/wagmi-core-chains.cjs.dev.js +2 -2
  2. package/chains/dist/wagmi-core-chains.cjs.prod.js +2 -2
  3. package/chains/dist/wagmi-core-chains.esm.js +2 -2
  4. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +3 -3
  5. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +3 -3
  6. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +3 -3
  7. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.dev.js +3 -3
  8. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.prod.js +3 -3
  9. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.esm.js +3 -3
  10. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +3 -3
  11. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +3 -3
  12. package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +3 -3
  13. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +3 -3
  14. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +3 -3
  15. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +3 -3
  16. package/dist/{chains-429056fc.cjs.prod.js → chains-73cc6c23.cjs.prod.js} +1 -1
  17. package/dist/{chains-1ebc77f8.esm.js → chains-8fce19d8.esm.js} +1 -1
  18. package/dist/{chains-67766349.cjs.dev.js → chains-fe1f4131.cjs.dev.js} +1 -1
  19. package/dist/declarations/src/constants/abis.d.ts +372 -0
  20. package/dist/declarations/src/constants/index.d.ts +1 -1
  21. package/dist/declarations/src/index.d.ts +1 -1
  22. package/dist/{getProvider-f1ff4e3e.cjs.dev.js → getProvider-3c075ea5.cjs.prod.js} +2 -1
  23. package/dist/{getProvider-73001454.cjs.prod.js → getProvider-4b611208.cjs.dev.js} +2 -1
  24. package/dist/{getProvider-2ff978f9.esm.js → getProvider-a56d1b85.esm.js} +2 -1
  25. package/dist/{rpcs-0d21dfe8.cjs.dev.js → rpcs-38f4faba.cjs.prod.js} +5 -5
  26. package/dist/{rpcs-c62bf9b0.cjs.prod.js → rpcs-52ea3d8d.cjs.dev.js} +5 -5
  27. package/dist/{rpcs-b4aa70b9.esm.js → rpcs-d533516e.esm.js} +5 -5
  28. package/dist/wagmi-core.cjs.dev.js +378 -4
  29. package/dist/wagmi-core.cjs.prod.js +378 -4
  30. package/dist/wagmi-core.esm.js +380 -7
  31. package/package.json +2 -2
  32. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.dev.js +1 -1
  33. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.prod.js +1 -1
  34. package/providers/alchemy/dist/wagmi-core-providers-alchemy.esm.js +1 -1
  35. package/providers/infura/dist/wagmi-core-providers-infura.cjs.dev.js +1 -1
  36. package/providers/infura/dist/wagmi-core-providers-infura.cjs.prod.js +1 -1
  37. package/providers/infura/dist/wagmi-core-providers-infura.esm.js +1 -1
@@ -5,7 +5,7 @@ var create = require('zustand/vanilla');
5
5
  var ethers = require('ethers');
6
6
  var utils = require('ethers/lib/utils');
7
7
  var EventEmitter = require('eventemitter3');
8
- var chains = require('./chains-67766349.cjs.dev.js');
8
+ var chains = require('./chains-73cc6c23.cjs.prod.js');
9
9
 
10
10
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
11
11
 
@@ -913,6 +913,7 @@ class Client {
913
913
 
914
914
  clearState() {
915
915
  this.setState(x => ({ ...x,
916
+ chains: undefined,
916
917
  connector: undefined,
917
918
  data: undefined,
918
919
  error: undefined,
@@ -5,7 +5,7 @@ var create = require('zustand/vanilla');
5
5
  var ethers = require('ethers');
6
6
  var utils = require('ethers/lib/utils');
7
7
  var EventEmitter = require('eventemitter3');
8
- var chains = require('./chains-429056fc.cjs.prod.js');
8
+ var chains = require('./chains-fe1f4131.cjs.dev.js');
9
9
 
10
10
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
11
11
 
@@ -913,6 +913,7 @@ class Client {
913
913
 
914
914
  clearState() {
915
915
  this.setState(x => ({ ...x,
916
+ chains: undefined,
916
917
  connector: undefined,
917
918
  data: undefined,
918
919
  error: undefined,
@@ -3,7 +3,7 @@ import create from 'zustand/vanilla';
3
3
  import { providers } from 'ethers';
4
4
  import { getAddress, hexValue } from 'ethers/lib/utils';
5
5
  import EventEmitter from 'eventemitter3';
6
- import { d as defaultChains } from './chains-1ebc77f8.esm.js';
6
+ import { d as defaultChains } from './chains-8fce19d8.esm.js';
7
7
 
8
8
  function _checkPrivateRedeclaration(obj, privateCollection) {
9
9
  if (privateCollection.has(obj)) {
@@ -906,6 +906,7 @@ class Client {
906
906
 
907
907
  clearState() {
908
908
  this.setState(x => ({ ...x,
909
+ chains: undefined,
909
910
  connector: undefined,
910
911
  data: undefined,
911
912
  error: undefined,
@@ -34,11 +34,11 @@ const infuraRpcUrls = {
34
34
  arbitrumGoerli: 'https://arbitrum-goerli.infura.io/v3'
35
35
  };
36
36
  const publicRpcUrls = {
37
- mainnet: `${alchemyRpcUrls.mainnet}/${defaultAlchemyApiKey}`,
38
- ropsten: `${alchemyRpcUrls.ropsten}/${defaultAlchemyApiKey}`,
39
- rinkeby: `${alchemyRpcUrls.rinkeby}/${defaultAlchemyApiKey}`,
40
- goerli: `${alchemyRpcUrls.goerli}/${defaultAlchemyApiKey}`,
41
- kovan: `${alchemyRpcUrls.kovan}/${defaultAlchemyApiKey}`,
37
+ mainnet: 'https://cloudflare-eth.com',
38
+ ropsten: 'https://rpc.ankr.com/eth_ropsten',
39
+ rinkeby: 'https://rpc.ankr.com/eth_rinkeby',
40
+ goerli: 'https://rpc.ankr.com/eth_goerli',
41
+ kovan: `${infuraRpcUrls.kovan}/${defaultInfuraApiKey}`,
42
42
  sepolia: 'https://rpc.sepolia.org',
43
43
  optimism: 'https://mainnet.optimism.io',
44
44
  optimismKovan: 'https://kovan.optimism.io',
@@ -34,11 +34,11 @@ const infuraRpcUrls = {
34
34
  arbitrumGoerli: 'https://arbitrum-goerli.infura.io/v3'
35
35
  };
36
36
  const publicRpcUrls = {
37
- mainnet: `${alchemyRpcUrls.mainnet}/${defaultAlchemyApiKey}`,
38
- ropsten: `${alchemyRpcUrls.ropsten}/${defaultAlchemyApiKey}`,
39
- rinkeby: `${alchemyRpcUrls.rinkeby}/${defaultAlchemyApiKey}`,
40
- goerli: `${alchemyRpcUrls.goerli}/${defaultAlchemyApiKey}`,
41
- kovan: `${alchemyRpcUrls.kovan}/${defaultAlchemyApiKey}`,
37
+ mainnet: 'https://cloudflare-eth.com',
38
+ ropsten: 'https://rpc.ankr.com/eth_ropsten',
39
+ rinkeby: 'https://rpc.ankr.com/eth_rinkeby',
40
+ goerli: 'https://rpc.ankr.com/eth_goerli',
41
+ kovan: `${infuraRpcUrls.kovan}/${defaultInfuraApiKey}`,
42
42
  sepolia: 'https://rpc.sepolia.org',
43
43
  optimism: 'https://mainnet.optimism.io',
44
44
  optimismKovan: 'https://kovan.optimism.io',
@@ -32,11 +32,11 @@ const infuraRpcUrls = {
32
32
  arbitrumGoerli: 'https://arbitrum-goerli.infura.io/v3'
33
33
  };
34
34
  const publicRpcUrls = {
35
- mainnet: `${alchemyRpcUrls.mainnet}/${defaultAlchemyApiKey}`,
36
- ropsten: `${alchemyRpcUrls.ropsten}/${defaultAlchemyApiKey}`,
37
- rinkeby: `${alchemyRpcUrls.rinkeby}/${defaultAlchemyApiKey}`,
38
- goerli: `${alchemyRpcUrls.goerli}/${defaultAlchemyApiKey}`,
39
- kovan: `${alchemyRpcUrls.kovan}/${defaultAlchemyApiKey}`,
35
+ mainnet: 'https://cloudflare-eth.com',
36
+ ropsten: 'https://rpc.ankr.com/eth_ropsten',
37
+ rinkeby: 'https://rpc.ankr.com/eth_rinkeby',
38
+ goerli: 'https://rpc.ankr.com/eth_goerli',
39
+ kovan: `${infuraRpcUrls.kovan}/${defaultInfuraApiKey}`,
40
40
  sepolia: 'https://rpc.sepolia.org',
41
41
  optimism: 'https://mainnet.optimism.io',
42
42
  optimismKovan: 'https://kovan.optimism.io',
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var getProvider = require('./getProvider-f1ff4e3e.cjs.dev.js');
5
+ var getProvider = require('./getProvider-4b611208.cjs.dev.js');
6
6
  var ethers$1 = require('ethers/lib/ethers');
7
7
  var utils = require('ethers/lib/utils');
8
8
  var ethers = require('ethers');
9
- var chains = require('./chains-67766349.cjs.dev.js');
9
+ var chains = require('./chains-fe1f4131.cjs.dev.js');
10
10
  var shallow = require('zustand/shallow');
11
11
  var debounce = require('./debounce-46ac0312.cjs.dev.js');
12
- var rpcs = require('./rpcs-0d21dfe8.cjs.dev.js');
12
+ var rpcs = require('./rpcs-52ea3d8d.cjs.dev.js');
13
13
  require('zustand/middleware');
14
14
  require('zustand/vanilla');
15
15
  require('eventemitter3');
@@ -904,6 +904,379 @@ const multicallABI = [{
904
904
  stateMutability: 'view',
905
905
  type: 'function'
906
906
  }];
907
+ /**
908
+ * [ERC-4626 Tokenized Vaults Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-4626)
909
+ */
910
+
911
+ const erc4626ABI = [{
912
+ anonymous: false,
913
+ inputs: [{
914
+ indexed: true,
915
+ name: 'owner',
916
+ type: 'address'
917
+ }, {
918
+ indexed: true,
919
+ name: 'spender',
920
+ type: 'address'
921
+ }, {
922
+ indexed: false,
923
+ name: 'value',
924
+ type: 'uint256'
925
+ }],
926
+ name: 'Approval',
927
+ type: 'event'
928
+ }, {
929
+ anonymous: false,
930
+ inputs: [{
931
+ indexed: true,
932
+ name: 'sender',
933
+ type: 'address'
934
+ }, {
935
+ indexed: true,
936
+ name: 'receiver',
937
+ type: 'address'
938
+ }, {
939
+ indexed: false,
940
+ name: 'assets',
941
+ type: 'uint256'
942
+ }, {
943
+ indexed: false,
944
+ name: 'shares',
945
+ type: 'uint256'
946
+ }],
947
+ name: 'Deposit',
948
+ type: 'event'
949
+ }, {
950
+ anonymous: false,
951
+ inputs: [{
952
+ indexed: true,
953
+ name: 'from',
954
+ type: 'address'
955
+ }, {
956
+ indexed: true,
957
+ name: 'to',
958
+ type: 'address'
959
+ }, {
960
+ indexed: false,
961
+ name: 'value',
962
+ type: 'uint256'
963
+ }],
964
+ name: 'Transfer',
965
+ type: 'event'
966
+ }, {
967
+ anonymous: false,
968
+ inputs: [{
969
+ indexed: true,
970
+ name: 'sender',
971
+ type: 'address'
972
+ }, {
973
+ indexed: true,
974
+ name: 'receiver',
975
+ type: 'address'
976
+ }, {
977
+ indexed: true,
978
+ name: 'owner',
979
+ type: 'address'
980
+ }, {
981
+ indexed: false,
982
+ name: 'assets',
983
+ type: 'uint256'
984
+ }, {
985
+ indexed: false,
986
+ name: 'shares',
987
+ type: 'uint256'
988
+ }],
989
+ name: 'Withdraw',
990
+ type: 'event'
991
+ }, {
992
+ inputs: [{
993
+ name: 'owner',
994
+ type: 'address'
995
+ }, {
996
+ name: 'spender',
997
+ type: 'address'
998
+ }],
999
+ name: 'allowance',
1000
+ outputs: [{
1001
+ name: '',
1002
+ type: 'uint256'
1003
+ }],
1004
+ stateMutability: 'view',
1005
+ type: 'function'
1006
+ }, {
1007
+ inputs: [{
1008
+ name: 'spender',
1009
+ type: 'address'
1010
+ }, {
1011
+ name: 'amount',
1012
+ type: 'uint256'
1013
+ }],
1014
+ name: 'approve',
1015
+ outputs: [{
1016
+ name: '',
1017
+ type: 'bool'
1018
+ }],
1019
+ stateMutability: 'nonpayable',
1020
+ type: 'function'
1021
+ }, {
1022
+ inputs: [],
1023
+ name: 'asset',
1024
+ outputs: [{
1025
+ name: 'assetTokenAddress',
1026
+ type: 'address'
1027
+ }],
1028
+ stateMutability: 'view',
1029
+ type: 'function'
1030
+ }, {
1031
+ inputs: [{
1032
+ name: 'account',
1033
+ type: 'address'
1034
+ }],
1035
+ name: 'balanceOf',
1036
+ outputs: [{
1037
+ name: '',
1038
+ type: 'uint256'
1039
+ }],
1040
+ stateMutability: 'view',
1041
+ type: 'function'
1042
+ }, {
1043
+ inputs: [{
1044
+ name: 'shares',
1045
+ type: 'uint256'
1046
+ }],
1047
+ name: 'convertToAssets',
1048
+ outputs: [{
1049
+ name: 'assets',
1050
+ type: 'uint256'
1051
+ }],
1052
+ stateMutability: 'view',
1053
+ type: 'function'
1054
+ }, {
1055
+ inputs: [{
1056
+ name: 'assets',
1057
+ type: 'uint256'
1058
+ }],
1059
+ name: 'convertToShares',
1060
+ outputs: [{
1061
+ name: 'shares',
1062
+ type: 'uint256'
1063
+ }],
1064
+ stateMutability: 'view',
1065
+ type: 'function'
1066
+ }, {
1067
+ inputs: [{
1068
+ name: 'assets',
1069
+ type: 'uint256'
1070
+ }, {
1071
+ name: 'receiver',
1072
+ type: 'address'
1073
+ }],
1074
+ name: 'deposit',
1075
+ outputs: [{
1076
+ name: 'shares',
1077
+ type: 'uint256'
1078
+ }],
1079
+ stateMutability: 'nonpayable',
1080
+ type: 'function'
1081
+ }, {
1082
+ inputs: [{
1083
+ name: 'caller',
1084
+ type: 'address'
1085
+ }],
1086
+ name: 'maxDeposit',
1087
+ outputs: [{
1088
+ name: 'maxAssets',
1089
+ type: 'uint256'
1090
+ }],
1091
+ stateMutability: 'view',
1092
+ type: 'function'
1093
+ }, {
1094
+ inputs: [{
1095
+ name: 'caller',
1096
+ type: 'address'
1097
+ }],
1098
+ name: 'maxMint',
1099
+ outputs: [{
1100
+ name: 'maxShares',
1101
+ type: 'uint256'
1102
+ }],
1103
+ stateMutability: 'view',
1104
+ type: 'function'
1105
+ }, {
1106
+ inputs: [{
1107
+ name: 'owner',
1108
+ type: 'address'
1109
+ }],
1110
+ name: 'maxRedeem',
1111
+ outputs: [{
1112
+ name: 'maxShares',
1113
+ type: 'uint256'
1114
+ }],
1115
+ stateMutability: 'view',
1116
+ type: 'function'
1117
+ }, {
1118
+ inputs: [{
1119
+ name: 'owner',
1120
+ type: 'address'
1121
+ }],
1122
+ name: 'maxWithdraw',
1123
+ outputs: [{
1124
+ name: 'maxAssets',
1125
+ type: 'uint256'
1126
+ }],
1127
+ stateMutability: 'view',
1128
+ type: 'function'
1129
+ }, {
1130
+ inputs: [{
1131
+ name: 'shares',
1132
+ type: 'uint256'
1133
+ }, {
1134
+ name: 'receiver',
1135
+ type: 'address'
1136
+ }],
1137
+ name: 'mint',
1138
+ outputs: [{
1139
+ name: 'assets',
1140
+ type: 'uint256'
1141
+ }],
1142
+ stateMutability: 'nonpayable',
1143
+ type: 'function'
1144
+ }, {
1145
+ inputs: [{
1146
+ name: 'assets',
1147
+ type: 'uint256'
1148
+ }],
1149
+ name: 'previewDeposit',
1150
+ outputs: [{
1151
+ name: 'shares',
1152
+ type: 'uint256'
1153
+ }],
1154
+ stateMutability: 'view',
1155
+ type: 'function'
1156
+ }, {
1157
+ inputs: [{
1158
+ name: 'shares',
1159
+ type: 'uint256'
1160
+ }],
1161
+ name: 'previewMint',
1162
+ outputs: [{
1163
+ name: 'assets',
1164
+ type: 'uint256'
1165
+ }],
1166
+ stateMutability: 'view',
1167
+ type: 'function'
1168
+ }, {
1169
+ inputs: [{
1170
+ name: 'shares',
1171
+ type: 'uint256'
1172
+ }],
1173
+ name: 'previewRedeem',
1174
+ outputs: [{
1175
+ name: 'assets',
1176
+ type: 'uint256'
1177
+ }],
1178
+ stateMutability: 'view',
1179
+ type: 'function'
1180
+ }, {
1181
+ inputs: [{
1182
+ name: 'assets',
1183
+ type: 'uint256'
1184
+ }],
1185
+ name: 'previewWithdraw',
1186
+ outputs: [{
1187
+ name: 'shares',
1188
+ type: 'uint256'
1189
+ }],
1190
+ stateMutability: 'view',
1191
+ type: 'function'
1192
+ }, {
1193
+ inputs: [{
1194
+ name: 'shares',
1195
+ type: 'uint256'
1196
+ }, {
1197
+ name: 'receiver',
1198
+ type: 'address'
1199
+ }, {
1200
+ name: 'owner',
1201
+ type: 'address'
1202
+ }],
1203
+ name: 'redeem',
1204
+ outputs: [{
1205
+ name: 'assets',
1206
+ type: 'uint256'
1207
+ }],
1208
+ stateMutability: 'nonpayable',
1209
+ type: 'function'
1210
+ }, {
1211
+ inputs: [],
1212
+ name: 'totalAssets',
1213
+ outputs: [{
1214
+ name: 'totalManagedAssets',
1215
+ type: 'uint256'
1216
+ }],
1217
+ stateMutability: 'view',
1218
+ type: 'function'
1219
+ }, {
1220
+ inputs: [],
1221
+ name: 'totalSupply',
1222
+ outputs: [{
1223
+ name: '',
1224
+ type: 'uint256'
1225
+ }],
1226
+ stateMutability: 'view',
1227
+ type: 'function'
1228
+ }, {
1229
+ inputs: [{
1230
+ name: 'to',
1231
+ type: 'address'
1232
+ }, {
1233
+ name: 'amount',
1234
+ type: 'uint256'
1235
+ }],
1236
+ name: 'transfer',
1237
+ outputs: [{
1238
+ name: '',
1239
+ type: 'bool'
1240
+ }],
1241
+ stateMutability: 'nonpayable',
1242
+ type: 'function'
1243
+ }, {
1244
+ inputs: [{
1245
+ name: 'from',
1246
+ type: 'address'
1247
+ }, {
1248
+ name: 'to',
1249
+ type: 'address'
1250
+ }, {
1251
+ name: 'amount',
1252
+ type: 'uint256'
1253
+ }],
1254
+ name: 'transferFrom',
1255
+ outputs: [{
1256
+ name: '',
1257
+ type: 'bool'
1258
+ }],
1259
+ stateMutability: 'nonpayable',
1260
+ type: 'function'
1261
+ }, {
1262
+ inputs: [{
1263
+ name: 'assets',
1264
+ type: 'uint256'
1265
+ }, {
1266
+ name: 'receiver',
1267
+ type: 'address'
1268
+ }, {
1269
+ name: 'owner',
1270
+ type: 'address'
1271
+ }],
1272
+ name: 'withdraw',
1273
+ outputs: [{
1274
+ name: 'shares',
1275
+ type: 'uint256'
1276
+ }],
1277
+ stateMutability: 'nonpayable',
1278
+ type: 'function'
1279
+ }];
907
1280
 
908
1281
  // https://github.com/ethers-io/ethers.js/blob/master/packages/units/src.ts/index.ts#L10-L18
909
1282
  const units = ['wei', 'kwei', 'mwei', 'gwei', 'szabo', 'finney', 'ether'];
@@ -1660,7 +2033,7 @@ async function fetchEnsName(_ref) {
1660
2033
  const provider = getProvider.getProvider({
1661
2034
  chainId
1662
2035
  });
1663
- return provider.lookupAddress(address);
2036
+ return provider.lookupAddress(utils.getAddress(address));
1664
2037
  }
1665
2038
 
1666
2039
  async function fetchEnsResolver(_ref) {
@@ -2246,6 +2619,7 @@ exports.connect = connect;
2246
2619
  exports.deepEqual = deepEqual;
2247
2620
  exports.disconnect = disconnect;
2248
2621
  exports.erc20ABI = erc20ABI;
2622
+ exports.erc4626ABI = erc4626ABI;
2249
2623
  exports.erc721ABI = erc721ABI;
2250
2624
  exports.fetchBalance = fetchBalance;
2251
2625
  exports.fetchBlockNumber = fetchBlockNumber;