@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.
- package/README.md +6 -6
- package/chains/dist/wagmi-core-chains.cjs.dev.js +4 -2
- package/chains/dist/wagmi-core-chains.cjs.prod.js +4 -2
- package/chains/dist/wagmi-core-chains.esm.js +2 -2
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +28 -26
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +28 -26
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +5 -3
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.dev.js +22 -23
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.prod.js +22 -23
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.esm.js +5 -6
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +33 -31
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +33 -31
- package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +6 -4
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +24 -25
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +24 -25
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +5 -6
- package/dist/{chains-b8e32454.cjs.prod.js → chains-acd25777.cjs.prod.js} +68 -9
- package/dist/{chains-174cf4b4.esm.js → chains-ce86f5e0.esm.js} +67 -10
- package/dist/{chains-ba6218fb.cjs.dev.js → chains-e81629e7.cjs.dev.js} +68 -9
- package/dist/declarations/src/actions/accounts/fetchBalance.d.ts +0 -1
- package/dist/declarations/src/actions/accounts/fetchSigner.d.ts +3 -3
- package/dist/declarations/src/actions/contracts/deprecatedWriteContract.d.ts +16 -0
- package/dist/declarations/src/actions/{tokens → contracts}/fetchToken.d.ts +0 -0
- package/dist/declarations/src/actions/contracts/index.d.ts +4 -1
- package/dist/declarations/src/actions/contracts/prepareWriteContract.d.ts +37 -0
- package/dist/declarations/src/actions/contracts/writeContract.d.ts +44 -8
- package/dist/declarations/src/actions/ens/fetchEnsAddress.d.ts +2 -1
- package/dist/declarations/src/actions/index.d.ts +2 -3
- package/dist/declarations/src/actions/transactions/deprecatedSendTransaction.d.ts +12 -0
- package/dist/declarations/src/actions/transactions/fetchTransaction.d.ts +21 -0
- package/dist/declarations/src/actions/transactions/index.d.ts +4 -1
- package/dist/declarations/src/actions/transactions/prepareSendTransaction.d.ts +36 -0
- package/dist/declarations/src/actions/transactions/sendTransaction.d.ts +43 -8
- package/dist/declarations/src/chains.d.ts +1 -1
- package/dist/declarations/src/client.d.ts +2 -2
- package/dist/declarations/src/connectors/base.d.ts +1 -2
- package/dist/declarations/src/connectors/coinbaseWallet.d.ts +2 -2
- package/dist/declarations/src/connectors/injected.d.ts +1 -1
- package/dist/declarations/src/connectors/mock/provider.d.ts +3 -2
- package/dist/declarations/src/connectors/walletConnect.d.ts +3 -2
- package/dist/declarations/src/constants/chains.d.ts +5 -0
- package/dist/declarations/src/constants/index.d.ts +1 -1
- package/dist/declarations/src/constants/rpcs.d.ts +5 -5
- package/dist/declarations/src/errors.d.ts +10 -3
- package/dist/declarations/src/index.d.ts +4 -4
- package/dist/declarations/src/providers/alchemy.d.ts +2 -3
- package/dist/declarations/src/providers/infura.d.ts +2 -3
- package/dist/declarations/src/providers/jsonRpc.d.ts +1 -2
- package/dist/declarations/src/providers/public.d.ts +2 -4
- package/dist/declarations/src/types/index.d.ts +6 -1
- package/dist/declarations/src/utils/configureChains.d.ts +3 -1
- package/dist/{client-fbdcbdb2.esm.js → getProvider-073f640f.esm.js} +369 -3
- package/dist/{client-4983a639.cjs.dev.js → getProvider-5c497ca0.cjs.dev.js} +436 -45
- package/dist/{client-dfad744f.cjs.prod.js → getProvider-868752e4.cjs.prod.js} +436 -45
- package/dist/{rpcs-1fd0a12f.cjs.prod.js → rpcs-3cf5a783.cjs.dev.js} +18 -12
- package/dist/{rpcs-f1d24f0e.cjs.dev.js → rpcs-afd1cc09.cjs.prod.js} +18 -12
- package/dist/{rpcs-b73a8f60.esm.js → rpcs-e837abf2.esm.js} +17 -11
- package/dist/wagmi-core.cjs.dev.js +586 -308
- package/dist/wagmi-core.cjs.prod.js +586 -308
- package/dist/wagmi-core.esm.js +493 -222
- package/package.json +9 -5
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.dev.js +5 -7
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.prod.js +5 -7
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.esm.js +5 -7
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.dev.js +5 -7
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.prod.js +5 -7
- package/providers/infura/dist/wagmi-core-providers-infura.esm.js +5 -7
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.dev.js +0 -2
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.prod.js +0 -2
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.esm.js +0 -2
- package/providers/public/dist/wagmi-core-providers-public.cjs.dev.js +0 -2
- package/providers/public/dist/wagmi-core-providers-public.cjs.prod.js +0 -2
- package/providers/public/dist/wagmi-core-providers-public.esm.js +0 -2
- package/dist/base-337e6424.cjs.prod.js +0 -343
- package/dist/base-bd337280.cjs.dev.js +0 -343
- package/dist/base-f1bbf263.esm.js +0 -316
- package/dist/declarations/src/actions/tokens/index.d.ts +0 -1
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var getProvider = require('../../../dist/getProvider-868752e4.cjs.prod.js');
|
|
6
6
|
var ethers = require('ethers');
|
|
7
7
|
var utils = require('ethers/lib/utils');
|
|
8
|
-
var client = require('../../../dist/client-dfad744f.cjs.prod.js');
|
|
9
|
-
require('eventemitter3');
|
|
10
|
-
require('../../../dist/chains-b8e32454.cjs.prod.js');
|
|
11
|
-
require('../../../dist/rpcs-1fd0a12f.cjs.prod.js');
|
|
12
|
-
require('zustand/vanilla');
|
|
13
8
|
require('zustand/middleware');
|
|
9
|
+
require('zustand/vanilla');
|
|
10
|
+
require('eventemitter3');
|
|
11
|
+
require('../../../dist/chains-acd25777.cjs.prod.js');
|
|
12
|
+
require('../../../dist/rpcs-afd1cc09.cjs.prod.js');
|
|
14
13
|
|
|
15
14
|
function _interopNamespace(e) {
|
|
16
15
|
if (e && e.__esModule) return e;
|
|
@@ -43,31 +42,31 @@ var _provider = /*#__PURE__*/new WeakMap();
|
|
|
43
42
|
|
|
44
43
|
var _switchChain = /*#__PURE__*/new WeakSet();
|
|
45
44
|
|
|
46
|
-
class WalletConnectConnector extends
|
|
45
|
+
class WalletConnectConnector extends getProvider.Connector {
|
|
47
46
|
constructor(config) {
|
|
48
47
|
super(config);
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
getProvider._classPrivateMethodInitSpec(this, _switchChain);
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
getProvider._defineProperty(this, "id", 'walletConnect');
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
getProvider._defineProperty(this, "name", 'WalletConnect');
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
getProvider._defineProperty(this, "ready", true);
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
getProvider._classPrivateFieldInitSpec(this, _provider, {
|
|
59
58
|
writable: true,
|
|
60
59
|
value: void 0
|
|
61
60
|
});
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
getProvider._defineProperty(this, "onAccountsChanged", accounts => {
|
|
64
63
|
if (accounts.length === 0) this.emit('disconnect');else this.emit('change', {
|
|
65
64
|
account: utils.getAddress(accounts[0])
|
|
66
65
|
});
|
|
67
66
|
});
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
const id =
|
|
68
|
+
getProvider._defineProperty(this, "onChainChanged", chainId => {
|
|
69
|
+
const id = getProvider.normalizeChainId(chainId);
|
|
71
70
|
const unsupported = this.isChainUnsupported(id);
|
|
72
71
|
this.emit('change', {
|
|
73
72
|
chain: {
|
|
@@ -77,7 +76,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
77
76
|
});
|
|
78
77
|
});
|
|
79
78
|
|
|
80
|
-
|
|
79
|
+
getProvider._defineProperty(this, "onDisconnect", () => {
|
|
81
80
|
this.emit('disconnect');
|
|
82
81
|
});
|
|
83
82
|
}
|
|
@@ -93,7 +92,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
93
92
|
let targetChainId = chainId;
|
|
94
93
|
|
|
95
94
|
if (!targetChainId) {
|
|
96
|
-
const lastUsedChainId =
|
|
95
|
+
const lastUsedChainId = getProvider.getClient().lastUsedChainId;
|
|
97
96
|
if (lastUsedChainId && !this.isChainUnsupported(lastUsedChainId)) targetChainId = lastUsedChainId;
|
|
98
97
|
}
|
|
99
98
|
|
|
@@ -115,7 +114,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
115
114
|
// Only enable for wallet options that do
|
|
116
115
|
|
|
117
116
|
const walletName = (_provider$connector$p = (_provider$connector = provider.connector) === null || _provider$connector === void 0 ? void 0 : (_provider$connector$p2 = _provider$connector.peerMeta) === null || _provider$connector$p2 === void 0 ? void 0 : _provider$connector$p2.name) !== null && _provider$connector$p !== void 0 ? _provider$connector$p : '';
|
|
118
|
-
if (switchChainAllowedRegex.test(walletName)) this.switchChain =
|
|
117
|
+
if (switchChainAllowedRegex.test(walletName)) this.switchChain = getProvider._classPrivateMethodGet(this, _switchChain, _switchChain2);
|
|
119
118
|
return {
|
|
120
119
|
account,
|
|
121
120
|
chain: {
|
|
@@ -125,7 +124,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
125
124
|
provider: new ethers.providers.Web3Provider(provider)
|
|
126
125
|
};
|
|
127
126
|
} catch (error) {
|
|
128
|
-
if (/user closed modal/i.test(error.message)) throw new
|
|
127
|
+
if (/user closed modal/i.test(error.message)) throw new getProvider.UserRejectedRequestError(error);
|
|
129
128
|
throw error;
|
|
130
129
|
}
|
|
131
130
|
}
|
|
@@ -148,7 +147,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
148
147
|
|
|
149
148
|
async getChainId() {
|
|
150
149
|
const provider = await this.getProvider();
|
|
151
|
-
const chainId =
|
|
150
|
+
const chainId = getProvider.normalizeChainId(provider.chainId);
|
|
152
151
|
return chainId;
|
|
153
152
|
}
|
|
154
153
|
|
|
@@ -159,7 +158,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
159
158
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
160
159
|
|
|
161
160
|
// Force create new provider
|
|
162
|
-
if (!
|
|
161
|
+
if (!getProvider._classPrivateFieldGet(this, _provider) || chainId || create) {
|
|
163
162
|
var _this$options, _this$options2;
|
|
164
163
|
|
|
165
164
|
const rpc = !((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.infuraId) ? this.chains.reduce((rpc, chain) => ({ ...rpc,
|
|
@@ -167,7 +166,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
167
166
|
}), {}) : {};
|
|
168
167
|
const WalletConnectProvider = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@walletconnect/ethereum-provider')); })).default;
|
|
169
168
|
|
|
170
|
-
|
|
169
|
+
getProvider._classPrivateFieldSet(this, _provider, new WalletConnectProvider({ ...this.options,
|
|
171
170
|
chainId,
|
|
172
171
|
rpc: { ...rpc,
|
|
173
172
|
...((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.rpc)
|
|
@@ -175,7 +174,7 @@ class WalletConnectConnector extends base.Connector {
|
|
|
175
174
|
}));
|
|
176
175
|
}
|
|
177
176
|
|
|
178
|
-
return
|
|
177
|
+
return getProvider._classPrivateFieldGet(this, _provider);
|
|
179
178
|
}
|
|
180
179
|
|
|
181
180
|
async getSigner() {
|
|
@@ -222,8 +221,8 @@ async function _switchChain2(chainId) {
|
|
|
222
221
|
};
|
|
223
222
|
} catch (error) {
|
|
224
223
|
const message = typeof error === 'string' ? error : error === null || error === void 0 ? void 0 : error.message;
|
|
225
|
-
if (/user rejected request/i.test(message)) throw new
|
|
226
|
-
throw new
|
|
224
|
+
if (/user rejected request/i.test(message)) throw new getProvider.UserRejectedRequestError(error);
|
|
225
|
+
throw new getProvider.SwitchChainError(error);
|
|
227
226
|
}
|
|
228
227
|
}
|
|
229
228
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as Connector, _ as _classPrivateMethodInitSpec, r as _defineProperty, s as _classPrivateFieldInitSpec, n as normalizeChainId, g as getClient, v as _classPrivateMethodGet, U as UserRejectedRequestError, t as _classPrivateFieldGet, u as _classPrivateFieldSet, o as SwitchChainError } from '../../../dist/getProvider-073f640f.esm.js';
|
|
2
2
|
import { providers } from 'ethers';
|
|
3
3
|
import { getAddress, hexValue } from 'ethers/lib/utils';
|
|
4
|
-
import { g as getClient } from '../../../dist/client-fbdcbdb2.esm.js';
|
|
5
|
-
import 'eventemitter3';
|
|
6
|
-
import '../../../dist/chains-174cf4b4.esm.js';
|
|
7
|
-
import '../../../dist/rpcs-b73a8f60.esm.js';
|
|
8
|
-
import 'zustand/vanilla';
|
|
9
4
|
import 'zustand/middleware';
|
|
5
|
+
import 'zustand/vanilla';
|
|
6
|
+
import 'eventemitter3';
|
|
7
|
+
import '../../../dist/chains-ce86f5e0.esm.js';
|
|
8
|
+
import '../../../dist/rpcs-e837abf2.esm.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Wallets that support chain switching through WalletConnect
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var rpcs = require('./rpcs-
|
|
3
|
+
var rpcs = require('./rpcs-afd1cc09.cjs.prod.js');
|
|
4
4
|
|
|
5
5
|
const etherscanBlockExplorers = {
|
|
6
6
|
mainnet: {
|
|
@@ -57,10 +57,12 @@ const chainId = {
|
|
|
57
57
|
kovan: 42,
|
|
58
58
|
optimism: 10,
|
|
59
59
|
optimismKovan: 69,
|
|
60
|
+
optimismGoerli: 420,
|
|
60
61
|
polygon: 137,
|
|
61
62
|
polygonMumbai: 80001,
|
|
62
63
|
arbitrum: 42161,
|
|
63
64
|
arbitrumRinkeby: 421611,
|
|
65
|
+
arbitrumGoerli: 421613,
|
|
64
66
|
localhost: 1337,
|
|
65
67
|
hardhat: 31337,
|
|
66
68
|
foundry: 31337
|
|
@@ -98,7 +100,7 @@ const ropsten = {
|
|
|
98
100
|
network: 'ropsten',
|
|
99
101
|
nativeCurrency: {
|
|
100
102
|
name: 'Ropsten Ether',
|
|
101
|
-
symbol: '
|
|
103
|
+
symbol: 'ETH',
|
|
102
104
|
decimals: 18
|
|
103
105
|
},
|
|
104
106
|
rpcUrls: {
|
|
@@ -126,7 +128,7 @@ const rinkeby = {
|
|
|
126
128
|
network: 'rinkeby',
|
|
127
129
|
nativeCurrency: {
|
|
128
130
|
name: 'Rinkeby Ether',
|
|
129
|
-
symbol: '
|
|
131
|
+
symbol: 'ETH',
|
|
130
132
|
decimals: 18
|
|
131
133
|
},
|
|
132
134
|
rpcUrls: {
|
|
@@ -154,7 +156,7 @@ const goerli = {
|
|
|
154
156
|
network: 'goerli',
|
|
155
157
|
nativeCurrency: {
|
|
156
158
|
name: 'Goerli Ether',
|
|
157
|
-
symbol: '
|
|
159
|
+
symbol: 'ETH',
|
|
158
160
|
decimals: 18
|
|
159
161
|
},
|
|
160
162
|
rpcUrls: {
|
|
@@ -182,7 +184,7 @@ const kovan = {
|
|
|
182
184
|
network: 'kovan',
|
|
183
185
|
nativeCurrency: {
|
|
184
186
|
name: 'Kovan Ether',
|
|
185
|
-
symbol: '
|
|
187
|
+
symbol: 'ETH',
|
|
186
188
|
decimals: 18
|
|
187
189
|
},
|
|
188
190
|
rpcUrls: {
|
|
@@ -231,7 +233,7 @@ const optimismKovan = {
|
|
|
231
233
|
network: 'optimism-kovan',
|
|
232
234
|
nativeCurrency: {
|
|
233
235
|
name: 'Kovan Ether',
|
|
234
|
-
symbol: '
|
|
236
|
+
symbol: 'ETH',
|
|
235
237
|
decimals: 18
|
|
236
238
|
},
|
|
237
239
|
rpcUrls: {
|
|
@@ -250,6 +252,33 @@ const optimismKovan = {
|
|
|
250
252
|
},
|
|
251
253
|
testnet: true
|
|
252
254
|
};
|
|
255
|
+
const optimismGoerli = {
|
|
256
|
+
id: chainId.optimismGoerli,
|
|
257
|
+
name: 'Optimism Goerli',
|
|
258
|
+
network: 'optimism-goerli',
|
|
259
|
+
nativeCurrency: {
|
|
260
|
+
name: 'Goerli Ether',
|
|
261
|
+
symbol: 'ETH',
|
|
262
|
+
decimals: 18
|
|
263
|
+
},
|
|
264
|
+
rpcUrls: {
|
|
265
|
+
alchemy: rpcs.alchemyRpcUrls.optimismGoerli,
|
|
266
|
+
default: rpcs.publicRpcUrls.optimismGoerli,
|
|
267
|
+
infura: rpcs.infuraRpcUrls.optimismGoerli,
|
|
268
|
+
public: rpcs.publicRpcUrls.optimismGoerli
|
|
269
|
+
},
|
|
270
|
+
blockExplorers: {
|
|
271
|
+
default: {
|
|
272
|
+
name: 'Blockscout',
|
|
273
|
+
url: 'https://blockscout.com/optimism/goerli'
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
multicall: {
|
|
277
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
|
278
|
+
blockCreated: 49461
|
|
279
|
+
},
|
|
280
|
+
testnet: true
|
|
281
|
+
};
|
|
253
282
|
const polygon = {
|
|
254
283
|
id: chainId.polygon,
|
|
255
284
|
name: 'Polygon',
|
|
@@ -333,7 +362,7 @@ const arbitrumRinkeby = {
|
|
|
333
362
|
network: 'arbitrum-rinkeby',
|
|
334
363
|
nativeCurrency: {
|
|
335
364
|
name: 'Arbitrum Rinkeby Ether',
|
|
336
|
-
symbol: '
|
|
365
|
+
symbol: 'ETH',
|
|
337
366
|
decimals: 18
|
|
338
367
|
},
|
|
339
368
|
rpcUrls: {
|
|
@@ -356,6 +385,33 @@ const arbitrumRinkeby = {
|
|
|
356
385
|
},
|
|
357
386
|
testnet: true
|
|
358
387
|
};
|
|
388
|
+
const arbitrumGoerli = {
|
|
389
|
+
id: chainId.arbitrumGoerli,
|
|
390
|
+
name: 'Arbitrum Goerli',
|
|
391
|
+
network: 'arbitrum-goerli',
|
|
392
|
+
nativeCurrency: {
|
|
393
|
+
name: 'Arbitrum Goerli Ether',
|
|
394
|
+
symbol: 'ETH',
|
|
395
|
+
decimals: 18
|
|
396
|
+
},
|
|
397
|
+
rpcUrls: {
|
|
398
|
+
alchemy: rpcs.alchemyRpcUrls.arbitrumGoerli,
|
|
399
|
+
default: rpcs.publicRpcUrls.arbitrumGoerli,
|
|
400
|
+
infura: rpcs.infuraRpcUrls.arbitrumGoerli,
|
|
401
|
+
public: rpcs.publicRpcUrls.arbitrumGoerli
|
|
402
|
+
},
|
|
403
|
+
blockExplorers: {
|
|
404
|
+
default: {
|
|
405
|
+
name: 'Arbitrum Explorer',
|
|
406
|
+
url: 'https://goerli-rollup-explorer.arbitrum.io'
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
multicall: {
|
|
410
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
|
411
|
+
blockCreated: 88114
|
|
412
|
+
},
|
|
413
|
+
testnet: true
|
|
414
|
+
};
|
|
359
415
|
const localhost = {
|
|
360
416
|
id: chainId.localhost,
|
|
361
417
|
name: 'Localhost',
|
|
@@ -396,17 +452,19 @@ const chain = {
|
|
|
396
452
|
polygon,
|
|
397
453
|
polygonMumbai,
|
|
398
454
|
arbitrum,
|
|
455
|
+
arbitrumGoerli,
|
|
399
456
|
arbitrumRinkeby,
|
|
400
457
|
localhost,
|
|
401
458
|
hardhat,
|
|
402
459
|
foundry
|
|
403
460
|
};
|
|
404
|
-
const allChains = [mainnet, ropsten, rinkeby, goerli, kovan, optimism, optimismKovan, polygon, polygonMumbai, arbitrum, arbitrumRinkeby, localhost, hardhat, foundry];
|
|
461
|
+
const allChains = [mainnet, ropsten, rinkeby, goerli, kovan, optimism, optimismKovan, optimismGoerli, polygon, polygonMumbai, arbitrum, arbitrumGoerli, arbitrumRinkeby, localhost, hardhat, foundry];
|
|
405
462
|
const defaultChains = [mainnet, ropsten, rinkeby, goerli, kovan];
|
|
406
|
-
const defaultL2Chains = [arbitrum, arbitrumRinkeby, optimism, optimismKovan];
|
|
463
|
+
const defaultL2Chains = [arbitrum, arbitrumRinkeby, arbitrumGoerli, optimism, optimismKovan, optimismGoerli];
|
|
407
464
|
|
|
408
465
|
exports.allChains = allChains;
|
|
409
466
|
exports.arbitrum = arbitrum;
|
|
467
|
+
exports.arbitrumGoerli = arbitrumGoerli;
|
|
410
468
|
exports.arbitrumRinkeby = arbitrumRinkeby;
|
|
411
469
|
exports.chain = chain;
|
|
412
470
|
exports.chainId = chainId;
|
|
@@ -420,6 +478,7 @@ exports.kovan = kovan;
|
|
|
420
478
|
exports.localhost = localhost;
|
|
421
479
|
exports.mainnet = mainnet;
|
|
422
480
|
exports.optimism = optimism;
|
|
481
|
+
exports.optimismGoerli = optimismGoerli;
|
|
423
482
|
exports.optimismKovan = optimismKovan;
|
|
424
483
|
exports.polygon = polygon;
|
|
425
484
|
exports.polygonMumbai = polygonMumbai;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as alchemyRpcUrls, p as publicRpcUrls, i as infuraRpcUrls } from './rpcs-
|
|
1
|
+
import { a as alchemyRpcUrls, p as publicRpcUrls, i as infuraRpcUrls } from './rpcs-e837abf2.esm.js';
|
|
2
2
|
|
|
3
3
|
const etherscanBlockExplorers = {
|
|
4
4
|
mainnet: {
|
|
@@ -55,10 +55,12 @@ const chainId = {
|
|
|
55
55
|
kovan: 42,
|
|
56
56
|
optimism: 10,
|
|
57
57
|
optimismKovan: 69,
|
|
58
|
+
optimismGoerli: 420,
|
|
58
59
|
polygon: 137,
|
|
59
60
|
polygonMumbai: 80001,
|
|
60
61
|
arbitrum: 42161,
|
|
61
62
|
arbitrumRinkeby: 421611,
|
|
63
|
+
arbitrumGoerli: 421613,
|
|
62
64
|
localhost: 1337,
|
|
63
65
|
hardhat: 31337,
|
|
64
66
|
foundry: 31337
|
|
@@ -96,7 +98,7 @@ const ropsten = {
|
|
|
96
98
|
network: 'ropsten',
|
|
97
99
|
nativeCurrency: {
|
|
98
100
|
name: 'Ropsten Ether',
|
|
99
|
-
symbol: '
|
|
101
|
+
symbol: 'ETH',
|
|
100
102
|
decimals: 18
|
|
101
103
|
},
|
|
102
104
|
rpcUrls: {
|
|
@@ -124,7 +126,7 @@ const rinkeby = {
|
|
|
124
126
|
network: 'rinkeby',
|
|
125
127
|
nativeCurrency: {
|
|
126
128
|
name: 'Rinkeby Ether',
|
|
127
|
-
symbol: '
|
|
129
|
+
symbol: 'ETH',
|
|
128
130
|
decimals: 18
|
|
129
131
|
},
|
|
130
132
|
rpcUrls: {
|
|
@@ -152,7 +154,7 @@ const goerli = {
|
|
|
152
154
|
network: 'goerli',
|
|
153
155
|
nativeCurrency: {
|
|
154
156
|
name: 'Goerli Ether',
|
|
155
|
-
symbol: '
|
|
157
|
+
symbol: 'ETH',
|
|
156
158
|
decimals: 18
|
|
157
159
|
},
|
|
158
160
|
rpcUrls: {
|
|
@@ -180,7 +182,7 @@ const kovan = {
|
|
|
180
182
|
network: 'kovan',
|
|
181
183
|
nativeCurrency: {
|
|
182
184
|
name: 'Kovan Ether',
|
|
183
|
-
symbol: '
|
|
185
|
+
symbol: 'ETH',
|
|
184
186
|
decimals: 18
|
|
185
187
|
},
|
|
186
188
|
rpcUrls: {
|
|
@@ -229,7 +231,7 @@ const optimismKovan = {
|
|
|
229
231
|
network: 'optimism-kovan',
|
|
230
232
|
nativeCurrency: {
|
|
231
233
|
name: 'Kovan Ether',
|
|
232
|
-
symbol: '
|
|
234
|
+
symbol: 'ETH',
|
|
233
235
|
decimals: 18
|
|
234
236
|
},
|
|
235
237
|
rpcUrls: {
|
|
@@ -248,6 +250,33 @@ const optimismKovan = {
|
|
|
248
250
|
},
|
|
249
251
|
testnet: true
|
|
250
252
|
};
|
|
253
|
+
const optimismGoerli = {
|
|
254
|
+
id: chainId.optimismGoerli,
|
|
255
|
+
name: 'Optimism Goerli',
|
|
256
|
+
network: 'optimism-goerli',
|
|
257
|
+
nativeCurrency: {
|
|
258
|
+
name: 'Goerli Ether',
|
|
259
|
+
symbol: 'ETH',
|
|
260
|
+
decimals: 18
|
|
261
|
+
},
|
|
262
|
+
rpcUrls: {
|
|
263
|
+
alchemy: alchemyRpcUrls.optimismGoerli,
|
|
264
|
+
default: publicRpcUrls.optimismGoerli,
|
|
265
|
+
infura: infuraRpcUrls.optimismGoerli,
|
|
266
|
+
public: publicRpcUrls.optimismGoerli
|
|
267
|
+
},
|
|
268
|
+
blockExplorers: {
|
|
269
|
+
default: {
|
|
270
|
+
name: 'Blockscout',
|
|
271
|
+
url: 'https://blockscout.com/optimism/goerli'
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
multicall: {
|
|
275
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
|
276
|
+
blockCreated: 49461
|
|
277
|
+
},
|
|
278
|
+
testnet: true
|
|
279
|
+
};
|
|
251
280
|
const polygon = {
|
|
252
281
|
id: chainId.polygon,
|
|
253
282
|
name: 'Polygon',
|
|
@@ -331,7 +360,7 @@ const arbitrumRinkeby = {
|
|
|
331
360
|
network: 'arbitrum-rinkeby',
|
|
332
361
|
nativeCurrency: {
|
|
333
362
|
name: 'Arbitrum Rinkeby Ether',
|
|
334
|
-
symbol: '
|
|
363
|
+
symbol: 'ETH',
|
|
335
364
|
decimals: 18
|
|
336
365
|
},
|
|
337
366
|
rpcUrls: {
|
|
@@ -354,6 +383,33 @@ const arbitrumRinkeby = {
|
|
|
354
383
|
},
|
|
355
384
|
testnet: true
|
|
356
385
|
};
|
|
386
|
+
const arbitrumGoerli = {
|
|
387
|
+
id: chainId.arbitrumGoerli,
|
|
388
|
+
name: 'Arbitrum Goerli',
|
|
389
|
+
network: 'arbitrum-goerli',
|
|
390
|
+
nativeCurrency: {
|
|
391
|
+
name: 'Arbitrum Goerli Ether',
|
|
392
|
+
symbol: 'ETH',
|
|
393
|
+
decimals: 18
|
|
394
|
+
},
|
|
395
|
+
rpcUrls: {
|
|
396
|
+
alchemy: alchemyRpcUrls.arbitrumGoerli,
|
|
397
|
+
default: publicRpcUrls.arbitrumGoerli,
|
|
398
|
+
infura: infuraRpcUrls.arbitrumGoerli,
|
|
399
|
+
public: publicRpcUrls.arbitrumGoerli
|
|
400
|
+
},
|
|
401
|
+
blockExplorers: {
|
|
402
|
+
default: {
|
|
403
|
+
name: 'Arbitrum Explorer',
|
|
404
|
+
url: 'https://goerli-rollup-explorer.arbitrum.io'
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
multicall: {
|
|
408
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
|
409
|
+
blockCreated: 88114
|
|
410
|
+
},
|
|
411
|
+
testnet: true
|
|
412
|
+
};
|
|
357
413
|
const localhost = {
|
|
358
414
|
id: chainId.localhost,
|
|
359
415
|
name: 'Localhost',
|
|
@@ -394,13 +450,14 @@ const chain = {
|
|
|
394
450
|
polygon,
|
|
395
451
|
polygonMumbai,
|
|
396
452
|
arbitrum,
|
|
453
|
+
arbitrumGoerli,
|
|
397
454
|
arbitrumRinkeby,
|
|
398
455
|
localhost,
|
|
399
456
|
hardhat,
|
|
400
457
|
foundry
|
|
401
458
|
};
|
|
402
|
-
const allChains = [mainnet, ropsten, rinkeby, goerli, kovan, optimism, optimismKovan, polygon, polygonMumbai, arbitrum, arbitrumRinkeby, localhost, hardhat, foundry];
|
|
459
|
+
const allChains = [mainnet, ropsten, rinkeby, goerli, kovan, optimism, optimismKovan, optimismGoerli, polygon, polygonMumbai, arbitrum, arbitrumGoerli, arbitrumRinkeby, localhost, hardhat, foundry];
|
|
403
460
|
const defaultChains = [mainnet, ropsten, rinkeby, goerli, kovan];
|
|
404
|
-
const defaultL2Chains = [arbitrum, arbitrumRinkeby, optimism, optimismKovan];
|
|
461
|
+
const defaultL2Chains = [arbitrum, arbitrumRinkeby, arbitrumGoerli, optimism, optimismKovan, optimismGoerli];
|
|
405
462
|
|
|
406
|
-
export { allChains as a, chainId as b, chain as c, defaultChains as d, defaultL2Chains as e, etherscanBlockExplorers as f, arbitrum as g,
|
|
463
|
+
export { allChains as a, chainId as b, chain as c, defaultChains as d, defaultL2Chains as e, etherscanBlockExplorers as f, arbitrum as g, arbitrumGoerli as h, arbitrumRinkeby as i, foundry as j, goerli as k, hardhat as l, kovan as m, localhost as n, mainnet as o, optimism as p, optimismKovan as q, optimismGoerli as r, polygon as s, polygonMumbai as t, rinkeby as u, ropsten as v };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var rpcs = require('./rpcs-
|
|
3
|
+
var rpcs = require('./rpcs-3cf5a783.cjs.dev.js');
|
|
4
4
|
|
|
5
5
|
const etherscanBlockExplorers = {
|
|
6
6
|
mainnet: {
|
|
@@ -57,10 +57,12 @@ const chainId = {
|
|
|
57
57
|
kovan: 42,
|
|
58
58
|
optimism: 10,
|
|
59
59
|
optimismKovan: 69,
|
|
60
|
+
optimismGoerli: 420,
|
|
60
61
|
polygon: 137,
|
|
61
62
|
polygonMumbai: 80001,
|
|
62
63
|
arbitrum: 42161,
|
|
63
64
|
arbitrumRinkeby: 421611,
|
|
65
|
+
arbitrumGoerli: 421613,
|
|
64
66
|
localhost: 1337,
|
|
65
67
|
hardhat: 31337,
|
|
66
68
|
foundry: 31337
|
|
@@ -98,7 +100,7 @@ const ropsten = {
|
|
|
98
100
|
network: 'ropsten',
|
|
99
101
|
nativeCurrency: {
|
|
100
102
|
name: 'Ropsten Ether',
|
|
101
|
-
symbol: '
|
|
103
|
+
symbol: 'ETH',
|
|
102
104
|
decimals: 18
|
|
103
105
|
},
|
|
104
106
|
rpcUrls: {
|
|
@@ -126,7 +128,7 @@ const rinkeby = {
|
|
|
126
128
|
network: 'rinkeby',
|
|
127
129
|
nativeCurrency: {
|
|
128
130
|
name: 'Rinkeby Ether',
|
|
129
|
-
symbol: '
|
|
131
|
+
symbol: 'ETH',
|
|
130
132
|
decimals: 18
|
|
131
133
|
},
|
|
132
134
|
rpcUrls: {
|
|
@@ -154,7 +156,7 @@ const goerli = {
|
|
|
154
156
|
network: 'goerli',
|
|
155
157
|
nativeCurrency: {
|
|
156
158
|
name: 'Goerli Ether',
|
|
157
|
-
symbol: '
|
|
159
|
+
symbol: 'ETH',
|
|
158
160
|
decimals: 18
|
|
159
161
|
},
|
|
160
162
|
rpcUrls: {
|
|
@@ -182,7 +184,7 @@ const kovan = {
|
|
|
182
184
|
network: 'kovan',
|
|
183
185
|
nativeCurrency: {
|
|
184
186
|
name: 'Kovan Ether',
|
|
185
|
-
symbol: '
|
|
187
|
+
symbol: 'ETH',
|
|
186
188
|
decimals: 18
|
|
187
189
|
},
|
|
188
190
|
rpcUrls: {
|
|
@@ -231,7 +233,7 @@ const optimismKovan = {
|
|
|
231
233
|
network: 'optimism-kovan',
|
|
232
234
|
nativeCurrency: {
|
|
233
235
|
name: 'Kovan Ether',
|
|
234
|
-
symbol: '
|
|
236
|
+
symbol: 'ETH',
|
|
235
237
|
decimals: 18
|
|
236
238
|
},
|
|
237
239
|
rpcUrls: {
|
|
@@ -250,6 +252,33 @@ const optimismKovan = {
|
|
|
250
252
|
},
|
|
251
253
|
testnet: true
|
|
252
254
|
};
|
|
255
|
+
const optimismGoerli = {
|
|
256
|
+
id: chainId.optimismGoerli,
|
|
257
|
+
name: 'Optimism Goerli',
|
|
258
|
+
network: 'optimism-goerli',
|
|
259
|
+
nativeCurrency: {
|
|
260
|
+
name: 'Goerli Ether',
|
|
261
|
+
symbol: 'ETH',
|
|
262
|
+
decimals: 18
|
|
263
|
+
},
|
|
264
|
+
rpcUrls: {
|
|
265
|
+
alchemy: rpcs.alchemyRpcUrls.optimismGoerli,
|
|
266
|
+
default: rpcs.publicRpcUrls.optimismGoerli,
|
|
267
|
+
infura: rpcs.infuraRpcUrls.optimismGoerli,
|
|
268
|
+
public: rpcs.publicRpcUrls.optimismGoerli
|
|
269
|
+
},
|
|
270
|
+
blockExplorers: {
|
|
271
|
+
default: {
|
|
272
|
+
name: 'Blockscout',
|
|
273
|
+
url: 'https://blockscout.com/optimism/goerli'
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
multicall: {
|
|
277
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
|
278
|
+
blockCreated: 49461
|
|
279
|
+
},
|
|
280
|
+
testnet: true
|
|
281
|
+
};
|
|
253
282
|
const polygon = {
|
|
254
283
|
id: chainId.polygon,
|
|
255
284
|
name: 'Polygon',
|
|
@@ -333,7 +362,7 @@ const arbitrumRinkeby = {
|
|
|
333
362
|
network: 'arbitrum-rinkeby',
|
|
334
363
|
nativeCurrency: {
|
|
335
364
|
name: 'Arbitrum Rinkeby Ether',
|
|
336
|
-
symbol: '
|
|
365
|
+
symbol: 'ETH',
|
|
337
366
|
decimals: 18
|
|
338
367
|
},
|
|
339
368
|
rpcUrls: {
|
|
@@ -356,6 +385,33 @@ const arbitrumRinkeby = {
|
|
|
356
385
|
},
|
|
357
386
|
testnet: true
|
|
358
387
|
};
|
|
388
|
+
const arbitrumGoerli = {
|
|
389
|
+
id: chainId.arbitrumGoerli,
|
|
390
|
+
name: 'Arbitrum Goerli',
|
|
391
|
+
network: 'arbitrum-goerli',
|
|
392
|
+
nativeCurrency: {
|
|
393
|
+
name: 'Arbitrum Goerli Ether',
|
|
394
|
+
symbol: 'ETH',
|
|
395
|
+
decimals: 18
|
|
396
|
+
},
|
|
397
|
+
rpcUrls: {
|
|
398
|
+
alchemy: rpcs.alchemyRpcUrls.arbitrumGoerli,
|
|
399
|
+
default: rpcs.publicRpcUrls.arbitrumGoerli,
|
|
400
|
+
infura: rpcs.infuraRpcUrls.arbitrumGoerli,
|
|
401
|
+
public: rpcs.publicRpcUrls.arbitrumGoerli
|
|
402
|
+
},
|
|
403
|
+
blockExplorers: {
|
|
404
|
+
default: {
|
|
405
|
+
name: 'Arbitrum Explorer',
|
|
406
|
+
url: 'https://goerli-rollup-explorer.arbitrum.io'
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
multicall: {
|
|
410
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
|
411
|
+
blockCreated: 88114
|
|
412
|
+
},
|
|
413
|
+
testnet: true
|
|
414
|
+
};
|
|
359
415
|
const localhost = {
|
|
360
416
|
id: chainId.localhost,
|
|
361
417
|
name: 'Localhost',
|
|
@@ -396,17 +452,19 @@ const chain = {
|
|
|
396
452
|
polygon,
|
|
397
453
|
polygonMumbai,
|
|
398
454
|
arbitrum,
|
|
455
|
+
arbitrumGoerli,
|
|
399
456
|
arbitrumRinkeby,
|
|
400
457
|
localhost,
|
|
401
458
|
hardhat,
|
|
402
459
|
foundry
|
|
403
460
|
};
|
|
404
|
-
const allChains = [mainnet, ropsten, rinkeby, goerli, kovan, optimism, optimismKovan, polygon, polygonMumbai, arbitrum, arbitrumRinkeby, localhost, hardhat, foundry];
|
|
461
|
+
const allChains = [mainnet, ropsten, rinkeby, goerli, kovan, optimism, optimismKovan, optimismGoerli, polygon, polygonMumbai, arbitrum, arbitrumGoerli, arbitrumRinkeby, localhost, hardhat, foundry];
|
|
405
462
|
const defaultChains = [mainnet, ropsten, rinkeby, goerli, kovan];
|
|
406
|
-
const defaultL2Chains = [arbitrum, arbitrumRinkeby, optimism, optimismKovan];
|
|
463
|
+
const defaultL2Chains = [arbitrum, arbitrumRinkeby, arbitrumGoerli, optimism, optimismKovan, optimismGoerli];
|
|
407
464
|
|
|
408
465
|
exports.allChains = allChains;
|
|
409
466
|
exports.arbitrum = arbitrum;
|
|
467
|
+
exports.arbitrumGoerli = arbitrumGoerli;
|
|
410
468
|
exports.arbitrumRinkeby = arbitrumRinkeby;
|
|
411
469
|
exports.chain = chain;
|
|
412
470
|
exports.chainId = chainId;
|
|
@@ -420,6 +478,7 @@ exports.kovan = kovan;
|
|
|
420
478
|
exports.localhost = localhost;
|
|
421
479
|
exports.mainnet = mainnet;
|
|
422
480
|
exports.optimism = optimism;
|
|
481
|
+
exports.optimismGoerli = optimismGoerli;
|
|
423
482
|
exports.optimismKovan = optimismKovan;
|
|
424
483
|
exports.polygon = polygon;
|
|
425
484
|
exports.polygonMumbai = polygonMumbai;
|
|
@@ -14,7 +14,6 @@ export declare type FetchBalanceResult = {
|
|
|
14
14
|
decimals: number;
|
|
15
15
|
formatted: string;
|
|
16
16
|
symbol: string;
|
|
17
|
-
unit: Unit | number;
|
|
18
17
|
value: BigNumber;
|
|
19
18
|
};
|
|
20
19
|
export declare function fetchBalance({ addressOrName, chainId, formatUnits: unit, token, }: FetchBalanceArgs): Promise<FetchBalanceResult>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Signer } from '
|
|
2
|
-
export declare type FetchSignerResult = Signer | null;
|
|
3
|
-
export declare function fetchSigner(): Promise<FetchSignerResult
|
|
1
|
+
import { Signer } from '../../types';
|
|
2
|
+
export declare type FetchSignerResult<TSigner extends Signer = Signer> = TSigner | null;
|
|
3
|
+
export declare function fetchSigner<TSigner extends Signer = Signer>(): Promise<FetchSignerResult<TSigner>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CallOverrides, Contract, providers } from 'ethers';
|
|
2
|
+
import { GetContractArgs } from './getContract';
|
|
3
|
+
export declare type DeprecatedWriteContractConfig = GetContractArgs & {
|
|
4
|
+
/**
|
|
5
|
+
* Chain id to use for write
|
|
6
|
+
* If signer is not active on this chain, it will attempt to programmatically switch
|
|
7
|
+
*/
|
|
8
|
+
chainId?: number;
|
|
9
|
+
/** Method to call on contract */
|
|
10
|
+
functionName: string;
|
|
11
|
+
/** Arguments to pass contract method */
|
|
12
|
+
args?: any | any[];
|
|
13
|
+
overrides?: CallOverrides;
|
|
14
|
+
};
|
|
15
|
+
export declare type DeprecatedWriteContractResult = providers.TransactionResponse;
|
|
16
|
+
export declare function deprecatedWriteContract<TContract extends Contract = Contract>({ addressOrName, args, chainId, contractInterface, functionName, overrides, signerOrProvider, }: DeprecatedWriteContractConfig): Promise<DeprecatedWriteContractResult>;
|
|
File without changes
|