@wagmi/core 0.2.0-next.8 → 0.2.0-next.9
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/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.d.ts +11 -1
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.js +15 -6
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.d.ts +11 -1
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.js +15 -6
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.d.ts +11 -1
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.js +15 -6
- package/dist/wagmi-core.cjs.d.ts +11 -1
- package/dist/wagmi-core.cjs.js +15 -6
- package/package.json +1 -2
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +0 -236
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +0 -236
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +0 -214
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +0 -247
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +0 -247
- package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +0 -238
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +0 -183
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +0 -183
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +0 -161
- package/dist/base-7ffc0425.cjs.prod.js +0 -541
- package/dist/base-82f423a9.esm.js +0 -515
- package/dist/base-b3073ce2.cjs.dev.js +0 -541
- package/dist/classPrivateMethodGet-0dc9fedc.cjs.dev.js +0 -19
- package/dist/classPrivateMethodGet-1c660f09.esm.js +0 -16
- package/dist/classPrivateMethodGet-c084b176.cjs.prod.js +0 -19
- package/dist/declarations/src/actions/accounts/connect.d.ts +0 -16
- package/dist/declarations/src/actions/accounts/disconnect.d.ts +0 -1
- package/dist/declarations/src/actions/accounts/fetchBalance.d.ts +0 -18
- package/dist/declarations/src/actions/accounts/fetchSigner.d.ts +0 -3
- package/dist/declarations/src/actions/accounts/getAccount.d.ts +0 -6
- package/dist/declarations/src/actions/accounts/getNetwork.d.ts +0 -9
- package/dist/declarations/src/actions/accounts/index.d.ts +0 -13
- package/dist/declarations/src/actions/accounts/signMessage.d.ts +0 -9
- package/dist/declarations/src/actions/accounts/signTypedData.d.ts +0 -13
- package/dist/declarations/src/actions/accounts/switchNetwork.d.ts +0 -6
- package/dist/declarations/src/actions/accounts/watchAccount.d.ts +0 -3
- package/dist/declarations/src/actions/accounts/watchBalance.d.ts +0 -3
- package/dist/declarations/src/actions/accounts/watchNetwork.d.ts +0 -3
- package/dist/declarations/src/actions/accounts/watchSigner.d.ts +0 -3
- package/dist/declarations/src/actions/contracts/getContract.d.ts +0 -11
- package/dist/declarations/src/actions/contracts/index.d.ts +0 -5
- package/dist/declarations/src/actions/contracts/readContract.d.ts +0 -11
- package/dist/declarations/src/actions/contracts/watchContractEvent.d.ts +0 -12
- package/dist/declarations/src/actions/contracts/watchReadContract.d.ts +0 -7
- package/dist/declarations/src/actions/contracts/writeContract.d.ts +0 -11
- package/dist/declarations/src/actions/ens/fetchEnsAddress.d.ts +0 -6
- package/dist/declarations/src/actions/ens/fetchEnsAvatar.d.ts +0 -6
- package/dist/declarations/src/actions/ens/fetchEnsName.d.ts +0 -6
- package/dist/declarations/src/actions/ens/fetchEnsResolver.d.ts +0 -7
- package/dist/declarations/src/actions/ens/index.d.ts +0 -8
- package/dist/declarations/src/actions/ens/watchEnsAddress.d.ts +0 -3
- package/dist/declarations/src/actions/ens/watchEnsAvatar.d.ts +0 -3
- package/dist/declarations/src/actions/ens/watchEnsName.d.ts +0 -3
- package/dist/declarations/src/actions/ens/watchEnsResolver.d.ts +0 -3
- package/dist/declarations/src/actions/index.d.ts +0 -7
- package/dist/declarations/src/actions/network-status/fetchBlockNumber.d.ts +0 -2
- package/dist/declarations/src/actions/network-status/fetchFeeData.d.ts +0 -14
- package/dist/declarations/src/actions/network-status/index.d.ts +0 -4
- package/dist/declarations/src/actions/network-status/watchBlockNumber.d.ts +0 -6
- package/dist/declarations/src/actions/network-status/watchFeeData.d.ts +0 -7
- package/dist/declarations/src/actions/providers/getProvider.d.ts +0 -3
- package/dist/declarations/src/actions/providers/getWebSocketProvider.d.ts +0 -3
- package/dist/declarations/src/actions/providers/index.d.ts +0 -4
- package/dist/declarations/src/actions/providers/watchProvider.d.ts +0 -3
- package/dist/declarations/src/actions/providers/watchWebSocketProvider.d.ts +0 -3
- package/dist/declarations/src/actions/tokens/fetchToken.d.ts +0 -24
- package/dist/declarations/src/actions/tokens/index.d.ts +0 -2
- package/dist/declarations/src/actions/tokens/watchToken.d.ts +0 -3
- package/dist/declarations/src/actions/transactions/index.d.ts +0 -2
- package/dist/declarations/src/actions/transactions/sendTransaction.d.ts +0 -7
- package/dist/declarations/src/actions/transactions/waitForTransaction.d.ts +0 -15
- package/dist/declarations/src/client.d.ts +0 -80
- package/dist/declarations/src/connectors/base.d.ts +0 -56
- package/dist/declarations/src/connectors/coinbaseWallet.d.ts +0 -52
- package/dist/declarations/src/connectors/index.d.ts +0 -2
- package/dist/declarations/src/connectors/injected.d.ts +0 -55
- package/dist/declarations/src/connectors/mock/connector.d.ts +0 -37
- package/dist/declarations/src/connectors/mock/index.d.ts +0 -2
- package/dist/declarations/src/connectors/mock/provider.d.ts +0 -40
- package/dist/declarations/src/connectors/walletConnect.d.ts +0 -32
- package/dist/declarations/src/constants/abis.d.ts +0 -2
- package/dist/declarations/src/constants/blockExplorers.d.ts +0 -9
- package/dist/declarations/src/constants/chains.d.ts +0 -20
- package/dist/declarations/src/constants/index.d.ts +0 -7
- package/dist/declarations/src/constants/keys.d.ts +0 -2
- package/dist/declarations/src/constants/rpcs.d.ts +0 -7
- package/dist/declarations/src/constants/units.d.ts +0 -1
- package/dist/declarations/src/errors.d.ts +0 -28
- package/dist/declarations/src/index.d.ts +0 -12
- package/dist/declarations/src/storage.d.ts +0 -12
- package/dist/declarations/src/types/declarations.d.ts +0 -52
- package/dist/declarations/src/types/index.d.ts +0 -19
- package/dist/declarations/src/utils/getInjectedName.d.ts +0 -1
- package/dist/declarations/src/utils/index.d.ts +0 -2
- package/dist/declarations/src/utils/normalizeChainId.d.ts +0 -1
- package/dist/wagmi-core.cjs.dev.js +0 -1193
- package/dist/wagmi-core.cjs.prod.js +0 -1193
- package/dist/wagmi-core.esm.js +0 -1124
|
@@ -1,541 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var EventEmitter = require('eventemitter3');
|
|
4
|
-
|
|
5
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
6
|
-
|
|
7
|
-
var EventEmitter__default = /*#__PURE__*/_interopDefault(EventEmitter);
|
|
8
|
-
|
|
9
|
-
function _checkPrivateRedeclaration(obj, privateCollection) {
|
|
10
|
-
if (privateCollection.has(obj)) {
|
|
11
|
-
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function _classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
16
|
-
_checkPrivateRedeclaration(obj, privateMap);
|
|
17
|
-
privateMap.set(obj, value);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function _defineProperty(obj, key, value) {
|
|
21
|
-
if (key in obj) {
|
|
22
|
-
Object.defineProperty(obj, key, {
|
|
23
|
-
value: value,
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true
|
|
27
|
-
});
|
|
28
|
-
} else {
|
|
29
|
-
obj[key] = value;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return obj;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function _classApplyDescriptorGet(receiver, descriptor) {
|
|
36
|
-
if (descriptor.get) {
|
|
37
|
-
return descriptor.get.call(receiver);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return descriptor.value;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) {
|
|
44
|
-
if (!privateMap.has(receiver)) {
|
|
45
|
-
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return privateMap.get(receiver);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function _classPrivateFieldGet(receiver, privateMap) {
|
|
52
|
-
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get");
|
|
53
|
-
return _classApplyDescriptorGet(receiver, descriptor);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) {
|
|
57
|
-
if (descriptor.set) {
|
|
58
|
-
descriptor.set.call(receiver, value);
|
|
59
|
-
} else {
|
|
60
|
-
if (!descriptor.writable) {
|
|
61
|
-
throw new TypeError("attempted to set read only private field");
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
descriptor.value = value;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _classPrivateFieldSet(receiver, privateMap, value) {
|
|
69
|
-
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set");
|
|
70
|
-
_classApplyDescriptorSet(receiver, descriptor, value);
|
|
71
|
-
return value;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const etherscanBlockExplorers = {
|
|
75
|
-
mainnet: {
|
|
76
|
-
name: 'Etherscan',
|
|
77
|
-
url: 'https://etherscan.io'
|
|
78
|
-
},
|
|
79
|
-
ropsten: {
|
|
80
|
-
name: 'Etherscan',
|
|
81
|
-
url: 'https://ropsten.etherscan.io'
|
|
82
|
-
},
|
|
83
|
-
rinkeby: {
|
|
84
|
-
name: 'Etherscan',
|
|
85
|
-
url: 'https://rinkeby.etherscan.io'
|
|
86
|
-
},
|
|
87
|
-
goerli: {
|
|
88
|
-
name: 'Etherscan',
|
|
89
|
-
url: 'https://goerli.etherscan.io'
|
|
90
|
-
},
|
|
91
|
-
kovan: {
|
|
92
|
-
name: 'Etherscan',
|
|
93
|
-
url: 'https://kovan.etherscan.io'
|
|
94
|
-
},
|
|
95
|
-
optimism: {
|
|
96
|
-
name: 'Etherscan',
|
|
97
|
-
url: 'https://optimistic.etherscan.io'
|
|
98
|
-
},
|
|
99
|
-
optimismKovan: {
|
|
100
|
-
name: 'Etherscan',
|
|
101
|
-
url: 'https://kovan-optimistic.etherscan.io'
|
|
102
|
-
},
|
|
103
|
-
polygon: {
|
|
104
|
-
name: 'PolygonScan',
|
|
105
|
-
url: 'https://polygonscan.com'
|
|
106
|
-
},
|
|
107
|
-
polygonMumbai: {
|
|
108
|
-
name: 'PolygonScan',
|
|
109
|
-
url: 'https://mumbai.polygonscan.com'
|
|
110
|
-
},
|
|
111
|
-
arbitrum: {
|
|
112
|
-
name: 'Arbiscan',
|
|
113
|
-
url: 'https://arbiscan.io'
|
|
114
|
-
},
|
|
115
|
-
arbitrumRinkeby: {
|
|
116
|
-
name: 'Arbiscan',
|
|
117
|
-
url: 'https://testnet.arbiscan.io'
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const defaultAlchemyId = '_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC';
|
|
122
|
-
|
|
123
|
-
const alchemyRpcUrls = {
|
|
124
|
-
mainnet: 'https://eth-mainnet.alchemyapi.io/v2',
|
|
125
|
-
ropsten: 'https://eth-ropsten.alchemyapi.io/v2',
|
|
126
|
-
rinkeby: 'https://eth-rinkeby.alchemyapi.io/v2',
|
|
127
|
-
goerli: 'https://eth-goerli.alchemyapi.io/v2',
|
|
128
|
-
kovan: 'https://eth-kovan.alchemyapi.io/v2',
|
|
129
|
-
optimism: 'https://opt-mainnet.g.alchemy.com/v2',
|
|
130
|
-
optimismKovan: 'https://opt-kovan.g.alchemy.com/v2',
|
|
131
|
-
polygon: 'https://polygon-mainnet.g.alchemy.com/v2',
|
|
132
|
-
polygonMumbai: 'https://polygon-mumbai.g.alchemy.com/v2',
|
|
133
|
-
arbitrum: 'https://arb-mainnet.g.alchemy.com/v2',
|
|
134
|
-
arbitrumRinkeby: 'https://arb-rinkeby.g.alchemy.com/v2'
|
|
135
|
-
};
|
|
136
|
-
const infuraRpcUrls = {
|
|
137
|
-
mainnet: 'https://mainnet.infura.io/v3',
|
|
138
|
-
ropsten: 'https://ropsten.infura.io/v3',
|
|
139
|
-
rinkeby: 'https://rinkeby.infura.io/v3',
|
|
140
|
-
goerli: 'https://goerli.infura.io/v3',
|
|
141
|
-
kovan: 'https://kovan.infura.io/v3',
|
|
142
|
-
optimism: 'https://optimism-mainnet.infura.io/v3',
|
|
143
|
-
optimismKovan: 'https://optimism-kovan.infura.io/v3',
|
|
144
|
-
polygon: 'https://polygon-mainnet.infura.io/v3',
|
|
145
|
-
polygonMumbai: 'https://polygon-mumbai.infura.io/v3',
|
|
146
|
-
arbitrum: 'https://arbitrum-mainnet.infura.io/v3',
|
|
147
|
-
arbitrumRinkeby: 'https://arbitrum-rinkeby.infura.io/v3'
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
const chainId = {
|
|
151
|
-
mainnet: 1,
|
|
152
|
-
ropsten: 3,
|
|
153
|
-
rinkeby: 4,
|
|
154
|
-
goerli: 5,
|
|
155
|
-
kovan: 42,
|
|
156
|
-
optimism: 10,
|
|
157
|
-
optimismKovan: 69,
|
|
158
|
-
polygon: 137,
|
|
159
|
-
polygonMumbai: 80001,
|
|
160
|
-
arbitrum: 42161,
|
|
161
|
-
arbitrumRinkeby: 421611,
|
|
162
|
-
localhost: 1337,
|
|
163
|
-
hardhat: 31337
|
|
164
|
-
};
|
|
165
|
-
const chain = {
|
|
166
|
-
mainnet: {
|
|
167
|
-
id: chainId.mainnet,
|
|
168
|
-
name: 'Mainnet',
|
|
169
|
-
nativeCurrency: {
|
|
170
|
-
name: 'Ether',
|
|
171
|
-
symbol: 'ETH',
|
|
172
|
-
decimals: 18
|
|
173
|
-
},
|
|
174
|
-
rpcUrls: {
|
|
175
|
-
alchemy: alchemyRpcUrls.mainnet,
|
|
176
|
-
infura: infuraRpcUrls.mainnet,
|
|
177
|
-
default: "".concat(alchemyRpcUrls.mainnet, "/").concat(defaultAlchemyId)
|
|
178
|
-
},
|
|
179
|
-
blockExplorers: {
|
|
180
|
-
etherscan: etherscanBlockExplorers.mainnet,
|
|
181
|
-
default: etherscanBlockExplorers.mainnet
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
ropsten: {
|
|
185
|
-
id: chainId.ropsten,
|
|
186
|
-
name: 'Ropsten',
|
|
187
|
-
nativeCurrency: {
|
|
188
|
-
name: 'Ropsten Ether',
|
|
189
|
-
symbol: 'ropETH',
|
|
190
|
-
decimals: 18
|
|
191
|
-
},
|
|
192
|
-
rpcUrls: {
|
|
193
|
-
alchemy: alchemyRpcUrls.ropsten,
|
|
194
|
-
infura: infuraRpcUrls.ropsten,
|
|
195
|
-
default: "".concat(alchemyRpcUrls.ropsten, "/").concat(defaultAlchemyId)
|
|
196
|
-
},
|
|
197
|
-
blockExplorers: {
|
|
198
|
-
etherscan: etherscanBlockExplorers.ropsten,
|
|
199
|
-
default: etherscanBlockExplorers.ropsten
|
|
200
|
-
},
|
|
201
|
-
testnet: true
|
|
202
|
-
},
|
|
203
|
-
rinkeby: {
|
|
204
|
-
id: chainId.rinkeby,
|
|
205
|
-
name: 'Rinkeby',
|
|
206
|
-
nativeCurrency: {
|
|
207
|
-
name: 'Rinkeby Ether',
|
|
208
|
-
symbol: 'rETH',
|
|
209
|
-
decimals: 18
|
|
210
|
-
},
|
|
211
|
-
rpcUrls: {
|
|
212
|
-
alchemy: alchemyRpcUrls.rinkeby,
|
|
213
|
-
infura: infuraRpcUrls.rinkeby,
|
|
214
|
-
default: "".concat(alchemyRpcUrls.rinkeby, "/").concat(defaultAlchemyId)
|
|
215
|
-
},
|
|
216
|
-
blockExplorers: {
|
|
217
|
-
etherscan: etherscanBlockExplorers.rinkeby,
|
|
218
|
-
default: etherscanBlockExplorers.rinkeby
|
|
219
|
-
},
|
|
220
|
-
testnet: true
|
|
221
|
-
},
|
|
222
|
-
goerli: {
|
|
223
|
-
id: chainId.goerli,
|
|
224
|
-
name: 'Goerli',
|
|
225
|
-
nativeCurrency: {
|
|
226
|
-
name: 'Goerli Ether',
|
|
227
|
-
symbol: 'gETH',
|
|
228
|
-
decimals: 18
|
|
229
|
-
},
|
|
230
|
-
rpcUrls: {
|
|
231
|
-
alchemy: alchemyRpcUrls.goerli,
|
|
232
|
-
infura: infuraRpcUrls.goerli,
|
|
233
|
-
default: "".concat(alchemyRpcUrls.goerli, "/").concat(defaultAlchemyId)
|
|
234
|
-
},
|
|
235
|
-
blockExplorers: {
|
|
236
|
-
etherscan: etherscanBlockExplorers.goerli,
|
|
237
|
-
default: etherscanBlockExplorers.goerli
|
|
238
|
-
},
|
|
239
|
-
testnet: true
|
|
240
|
-
},
|
|
241
|
-
kovan: {
|
|
242
|
-
id: chainId.kovan,
|
|
243
|
-
name: 'Kovan',
|
|
244
|
-
nativeCurrency: {
|
|
245
|
-
name: 'Kovan Ether',
|
|
246
|
-
symbol: 'kETH',
|
|
247
|
-
decimals: 18
|
|
248
|
-
},
|
|
249
|
-
rpcUrls: {
|
|
250
|
-
alchemy: alchemyRpcUrls.kovan,
|
|
251
|
-
infura: infuraRpcUrls.kovan,
|
|
252
|
-
default: "".concat(alchemyRpcUrls.kovan, "/").concat(defaultAlchemyId)
|
|
253
|
-
},
|
|
254
|
-
blockExplorers: {
|
|
255
|
-
etherscan: etherscanBlockExplorers.kovan,
|
|
256
|
-
default: etherscanBlockExplorers.kovan
|
|
257
|
-
},
|
|
258
|
-
testnet: true
|
|
259
|
-
},
|
|
260
|
-
optimism: {
|
|
261
|
-
id: chainId.optimism,
|
|
262
|
-
name: 'Optimism',
|
|
263
|
-
nativeCurrency: {
|
|
264
|
-
name: 'Ether',
|
|
265
|
-
symbol: 'ETH',
|
|
266
|
-
decimals: 18
|
|
267
|
-
},
|
|
268
|
-
rpcUrls: {
|
|
269
|
-
alchemy: alchemyRpcUrls.optimism,
|
|
270
|
-
infura: infuraRpcUrls.optimism,
|
|
271
|
-
default: ['https://mainnet.optimism.io']
|
|
272
|
-
},
|
|
273
|
-
blockExplorers: {
|
|
274
|
-
etherscan: etherscanBlockExplorers.optimism,
|
|
275
|
-
default: etherscanBlockExplorers.optimism
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
optimismKovan: {
|
|
279
|
-
id: chainId.optimismKovan,
|
|
280
|
-
name: 'Optimism Kovan',
|
|
281
|
-
nativeCurrency: {
|
|
282
|
-
name: 'Kovan Ether',
|
|
283
|
-
symbol: 'KOR',
|
|
284
|
-
decimals: 18
|
|
285
|
-
},
|
|
286
|
-
rpcUrls: {
|
|
287
|
-
alchemy: alchemyRpcUrls.optimismKovan,
|
|
288
|
-
infura: infuraRpcUrls.optimismKovan,
|
|
289
|
-
default: ['https://kovan.optimism.io']
|
|
290
|
-
},
|
|
291
|
-
blockExplorers: {
|
|
292
|
-
etherscan: etherscanBlockExplorers.optimismKovan,
|
|
293
|
-
default: etherscanBlockExplorers.optimismKovan
|
|
294
|
-
},
|
|
295
|
-
testnet: true
|
|
296
|
-
},
|
|
297
|
-
polygon: {
|
|
298
|
-
id: chainId.polygon,
|
|
299
|
-
name: 'Polygon Mainnet',
|
|
300
|
-
nativeCurrency: {
|
|
301
|
-
name: 'MATIC',
|
|
302
|
-
symbol: 'MATIC',
|
|
303
|
-
decimals: 18
|
|
304
|
-
},
|
|
305
|
-
rpcUrls: {
|
|
306
|
-
alchemy: alchemyRpcUrls.polygon,
|
|
307
|
-
infura: infuraRpcUrls.polygon,
|
|
308
|
-
default: ['https://polygon-rpc.com', 'https://rpc-mainnet.matic.network', 'https://matic-mainnet.chainstacklabs.com', 'https://rpc-mainnet.maticvigil.com', 'https://rpc-mainnet.matic.quiknode.pro', 'https://matic-mainnet-full-rpc.bwarelabs.com']
|
|
309
|
-
},
|
|
310
|
-
blockExplorers: {
|
|
311
|
-
etherscan: etherscanBlockExplorers.polygon,
|
|
312
|
-
default: etherscanBlockExplorers.polygon
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
polygonMumbai: {
|
|
316
|
-
id: chainId.polygonMumbai,
|
|
317
|
-
name: 'Mumbai',
|
|
318
|
-
nativeCurrency: {
|
|
319
|
-
name: 'MATIC',
|
|
320
|
-
symbol: 'MATIC',
|
|
321
|
-
decimals: 18
|
|
322
|
-
},
|
|
323
|
-
rpcUrls: {
|
|
324
|
-
alchemy: alchemyRpcUrls.polygonMumbai,
|
|
325
|
-
infura: infuraRpcUrls.polygonMumbai,
|
|
326
|
-
default: ['https://matic-mumbai.chainstacklabs.com', 'https://rpc-mumbai.maticvigil.com', 'https://matic-testnet-archive-rpc.bwarelabs.com']
|
|
327
|
-
},
|
|
328
|
-
blockExplorers: {
|
|
329
|
-
etherscan: etherscanBlockExplorers.polygonMumbai,
|
|
330
|
-
default: etherscanBlockExplorers.polygonMumbai
|
|
331
|
-
},
|
|
332
|
-
testnet: true
|
|
333
|
-
},
|
|
334
|
-
arbitrum: {
|
|
335
|
-
id: chainId.arbitrum,
|
|
336
|
-
name: 'Arbitrum One',
|
|
337
|
-
nativeCurrency: {
|
|
338
|
-
name: 'Ether',
|
|
339
|
-
symbol: 'AETH',
|
|
340
|
-
decimals: 18
|
|
341
|
-
},
|
|
342
|
-
rpcUrls: {
|
|
343
|
-
alchemy: alchemyRpcUrls.arbitrum,
|
|
344
|
-
infura: infuraRpcUrls.arbitrum,
|
|
345
|
-
default: ['https://arb1.arbitrum.io/rpc']
|
|
346
|
-
},
|
|
347
|
-
blockExplorers: {
|
|
348
|
-
etherscan: etherscanBlockExplorers.arbitrum,
|
|
349
|
-
default: [etherscanBlockExplorers.arbitrum, {
|
|
350
|
-
name: 'Arbitrum Explorer',
|
|
351
|
-
url: 'https://explorer.arbitrum.io'
|
|
352
|
-
}]
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
arbitrumRinkeby: {
|
|
356
|
-
id: chainId.arbitrumRinkeby,
|
|
357
|
-
name: 'Arbitrum Rinkeby',
|
|
358
|
-
nativeCurrency: {
|
|
359
|
-
name: 'Arbitrum Rinkeby Ether',
|
|
360
|
-
symbol: 'ARETH',
|
|
361
|
-
decimals: 18
|
|
362
|
-
},
|
|
363
|
-
rpcUrls: {
|
|
364
|
-
alchemy: alchemyRpcUrls.arbitrumRinkeby,
|
|
365
|
-
infura: infuraRpcUrls.arbitrumRinkeby,
|
|
366
|
-
default: ['https://rinkeby.arbitrum.io/rpc']
|
|
367
|
-
},
|
|
368
|
-
blockExplorers: {
|
|
369
|
-
etherscan: etherscanBlockExplorers.arbitrumRinkeby,
|
|
370
|
-
default: [etherscanBlockExplorers.arbitrumRinkeby, {
|
|
371
|
-
name: 'Arbitrum Explorer',
|
|
372
|
-
url: 'https://rinkeby-explorer.arbitrum.io'
|
|
373
|
-
}]
|
|
374
|
-
},
|
|
375
|
-
testnet: true
|
|
376
|
-
},
|
|
377
|
-
localhost: {
|
|
378
|
-
id: chainId.localhost,
|
|
379
|
-
name: 'Localhost',
|
|
380
|
-
rpcUrls: {
|
|
381
|
-
default: 'http://127.0.0.1:8545'
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
hardhat: {
|
|
385
|
-
id: chainId.hardhat,
|
|
386
|
-
name: 'Hardhat',
|
|
387
|
-
rpcUrls: {
|
|
388
|
-
default: 'http://127.0.0.1:8545'
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
const allChains = Object.values(chain);
|
|
393
|
-
const defaultChains = [chain.mainnet, chain.ropsten, chain.rinkeby, chain.goerli, chain.kovan];
|
|
394
|
-
|
|
395
|
-
function normalizeChainId(chainId) {
|
|
396
|
-
if (typeof chainId === 'string') return Number.parseInt(chainId, chainId.trim().substring(0, 2) === '0x' ? 16 : 10);
|
|
397
|
-
return chainId;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
class AddChainError extends Error {
|
|
401
|
-
constructor() {
|
|
402
|
-
super(...arguments);
|
|
403
|
-
|
|
404
|
-
_defineProperty(this, "name", 'AddChainError');
|
|
405
|
-
|
|
406
|
-
_defineProperty(this, "message", 'Error adding chain');
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
class ChainNotConfiguredError extends Error {
|
|
411
|
-
constructor() {
|
|
412
|
-
super(...arguments);
|
|
413
|
-
|
|
414
|
-
_defineProperty(this, "name", 'ChainNotConfigured');
|
|
415
|
-
|
|
416
|
-
_defineProperty(this, "message", 'Chain not configured');
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
}
|
|
420
|
-
class ConnectorAlreadyConnectedError extends Error {
|
|
421
|
-
constructor() {
|
|
422
|
-
super(...arguments);
|
|
423
|
-
|
|
424
|
-
_defineProperty(this, "name", 'ConnectorAlreadyConnectedError');
|
|
425
|
-
|
|
426
|
-
_defineProperty(this, "message", 'Connector already connected');
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
class ConnectorNotFoundError extends Error {
|
|
431
|
-
constructor() {
|
|
432
|
-
super(...arguments);
|
|
433
|
-
|
|
434
|
-
_defineProperty(this, "name", 'ConnectorNotFoundError');
|
|
435
|
-
|
|
436
|
-
_defineProperty(this, "message", 'Connector not found');
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
class SwitchChainError extends Error {
|
|
441
|
-
constructor() {
|
|
442
|
-
super(...arguments);
|
|
443
|
-
|
|
444
|
-
_defineProperty(this, "name", 'SwitchChainError');
|
|
445
|
-
|
|
446
|
-
_defineProperty(this, "message", 'Error switching chain');
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
}
|
|
450
|
-
class SwitchChainNotSupportedError extends Error {
|
|
451
|
-
constructor() {
|
|
452
|
-
super(...arguments);
|
|
453
|
-
|
|
454
|
-
_defineProperty(this, "name", 'SwitchChainNotSupportedError');
|
|
455
|
-
|
|
456
|
-
_defineProperty(this, "message", 'Switch chain not supported by connector');
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
class UserRejectedRequestError extends Error {
|
|
461
|
-
constructor() {
|
|
462
|
-
super(...arguments);
|
|
463
|
-
|
|
464
|
-
_defineProperty(this, "name", 'UserRejectedRequestError');
|
|
465
|
-
|
|
466
|
-
_defineProperty(this, "message", 'User rejected request');
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
class Connector extends EventEmitter__default["default"] {
|
|
472
|
-
/** Unique connector id */
|
|
473
|
-
|
|
474
|
-
/** Connector name */
|
|
475
|
-
|
|
476
|
-
/** Chains connector supports */
|
|
477
|
-
|
|
478
|
-
/** Options to use with connector */
|
|
479
|
-
|
|
480
|
-
/** Whether connector is usable */
|
|
481
|
-
constructor(_ref) {
|
|
482
|
-
let {
|
|
483
|
-
chains = defaultChains,
|
|
484
|
-
options
|
|
485
|
-
} = _ref;
|
|
486
|
-
super();
|
|
487
|
-
|
|
488
|
-
_defineProperty(this, "id", void 0);
|
|
489
|
-
|
|
490
|
-
_defineProperty(this, "name", void 0);
|
|
491
|
-
|
|
492
|
-
_defineProperty(this, "chains", void 0);
|
|
493
|
-
|
|
494
|
-
_defineProperty(this, "options", void 0);
|
|
495
|
-
|
|
496
|
-
_defineProperty(this, "ready", void 0);
|
|
497
|
-
|
|
498
|
-
this.chains = chains;
|
|
499
|
-
this.options = options;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
getBlockExplorerUrls(chain) {
|
|
503
|
-
var _chain$blockExplorers;
|
|
504
|
-
|
|
505
|
-
const blockExplorer = (_chain$blockExplorers = chain.blockExplorers) === null || _chain$blockExplorers === void 0 ? void 0 : _chain$blockExplorers.default;
|
|
506
|
-
if (Array.isArray(blockExplorer)) return blockExplorer.map(x => x.url);
|
|
507
|
-
if (blockExplorer !== null && blockExplorer !== void 0 && blockExplorer.url) return [blockExplorer.url];
|
|
508
|
-
return [];
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
getRpcUrls(chain) {
|
|
512
|
-
return typeof chain.rpcUrls.default === 'string' ? [chain.rpcUrls.default] : chain.rpcUrls.default;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
isChainUnsupported(chainId) {
|
|
516
|
-
return !this.chains.some(x => x.id === chainId);
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
exports.AddChainError = AddChainError;
|
|
522
|
-
exports.ChainNotConfiguredError = ChainNotConfiguredError;
|
|
523
|
-
exports.Connector = Connector;
|
|
524
|
-
exports.ConnectorAlreadyConnectedError = ConnectorAlreadyConnectedError;
|
|
525
|
-
exports.ConnectorNotFoundError = ConnectorNotFoundError;
|
|
526
|
-
exports.SwitchChainError = SwitchChainError;
|
|
527
|
-
exports.SwitchChainNotSupportedError = SwitchChainNotSupportedError;
|
|
528
|
-
exports.UserRejectedRequestError = UserRejectedRequestError;
|
|
529
|
-
exports._checkPrivateRedeclaration = _checkPrivateRedeclaration;
|
|
530
|
-
exports._classPrivateFieldGet = _classPrivateFieldGet;
|
|
531
|
-
exports._classPrivateFieldInitSpec = _classPrivateFieldInitSpec;
|
|
532
|
-
exports._classPrivateFieldSet = _classPrivateFieldSet;
|
|
533
|
-
exports._defineProperty = _defineProperty;
|
|
534
|
-
exports.alchemyRpcUrls = alchemyRpcUrls;
|
|
535
|
-
exports.allChains = allChains;
|
|
536
|
-
exports.chain = chain;
|
|
537
|
-
exports.chainId = chainId;
|
|
538
|
-
exports.defaultChains = defaultChains;
|
|
539
|
-
exports.etherscanBlockExplorers = etherscanBlockExplorers;
|
|
540
|
-
exports.infuraRpcUrls = infuraRpcUrls;
|
|
541
|
-
exports.normalizeChainId = normalizeChainId;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var base = require('./base-b3073ce2.cjs.dev.js');
|
|
4
|
-
|
|
5
|
-
function _classPrivateMethodInitSpec(obj, privateSet) {
|
|
6
|
-
base._checkPrivateRedeclaration(obj, privateSet);
|
|
7
|
-
privateSet.add(obj);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) {
|
|
11
|
-
if (!privateSet.has(receiver)) {
|
|
12
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return fn;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
exports._classPrivateMethodGet = _classPrivateMethodGet;
|
|
19
|
-
exports._classPrivateMethodInitSpec = _classPrivateMethodInitSpec;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { p as _checkPrivateRedeclaration } from './base-82f423a9.esm.js';
|
|
2
|
-
|
|
3
|
-
function _classPrivateMethodInitSpec(obj, privateSet) {
|
|
4
|
-
_checkPrivateRedeclaration(obj, privateSet);
|
|
5
|
-
privateSet.add(obj);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) {
|
|
9
|
-
if (!privateSet.has(receiver)) {
|
|
10
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return fn;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { _classPrivateMethodInitSpec as _, _classPrivateMethodGet as a };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var base = require('./base-7ffc0425.cjs.prod.js');
|
|
4
|
-
|
|
5
|
-
function _classPrivateMethodInitSpec(obj, privateSet) {
|
|
6
|
-
base._checkPrivateRedeclaration(obj, privateSet);
|
|
7
|
-
privateSet.add(obj);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) {
|
|
11
|
-
if (!privateSet.has(receiver)) {
|
|
12
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return fn;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
exports._classPrivateMethodGet = _classPrivateMethodGet;
|
|
19
|
-
exports._classPrivateMethodInitSpec = _classPrivateMethodInitSpec;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BaseProvider } from '@ethersproject/providers';
|
|
2
|
-
import { Client } from '../../client';
|
|
3
|
-
import { Connector, ConnectorData } from '../../connectors';
|
|
4
|
-
export declare type ConnectArgs = {
|
|
5
|
-
/** Connector to connect */
|
|
6
|
-
connector: Connector;
|
|
7
|
-
};
|
|
8
|
-
declare type Data = Required<ConnectorData<BaseProvider>>;
|
|
9
|
-
export declare type ConnectResult = {
|
|
10
|
-
account: Data['account'];
|
|
11
|
-
chain: Data['chain'];
|
|
12
|
-
connector: Client['connector'];
|
|
13
|
-
provider: Data['provider'];
|
|
14
|
-
};
|
|
15
|
-
export declare function connect({ connector, }: ConnectArgs): Promise<ConnectResult>;
|
|
16
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function disconnect(): Promise<void>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BigNumber } from 'ethers/lib/ethers';
|
|
2
|
-
import { Unit } from '../../types';
|
|
3
|
-
export declare type FetchBalanceArgs = {
|
|
4
|
-
/** Address or ENS name */
|
|
5
|
-
addressOrName: string;
|
|
6
|
-
/** Units for formatting output */
|
|
7
|
-
formatUnits?: Unit | number;
|
|
8
|
-
/** ERC-20 address */
|
|
9
|
-
token?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare type FetchBalanceResult = {
|
|
12
|
-
decimals: number;
|
|
13
|
-
formatted: string;
|
|
14
|
-
symbol: string;
|
|
15
|
-
unit: Unit | number;
|
|
16
|
-
value: BigNumber;
|
|
17
|
-
};
|
|
18
|
-
export declare function fetchBalance({ addressOrName, formatUnits: unit, token, }: FetchBalanceArgs): Promise<FetchBalanceResult>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { connect, type ConnectArgs, type ConnectResult } from './connect';
|
|
2
|
-
export { disconnect } from './disconnect';
|
|
3
|
-
export { fetchBalance, type FetchBalanceArgs, type FetchBalanceResult, } from './fetchBalance';
|
|
4
|
-
export { fetchSigner, type FetchSignerResult } from './fetchSigner';
|
|
5
|
-
export { getAccount, type GetAccountResult } from './getAccount';
|
|
6
|
-
export { getNetwork, type GetNetworkResult } from './getNetwork';
|
|
7
|
-
export { signMessage, type SignMessageArgs, type SignMessageResult, } from './signMessage';
|
|
8
|
-
export { signTypedData, type SignTypedDataArgs, type SignTypedDataResult, } from './signTypedData';
|
|
9
|
-
export { switchNetwork, type SwitchNetworkArgs, type SwitchNetworkResult, } from './switchNetwork';
|
|
10
|
-
export { watchAccount, type WatchAccountCallback } from './watchAccount';
|
|
11
|
-
export { watchBalance, type WatchBalanceCallback } from './watchBalance';
|
|
12
|
-
export { watchNetwork, type WatchNetworkCallback } from './watchNetwork';
|
|
13
|
-
export { watchSigner, type WatchSignerCallback } from './watchSigner';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Bytes } from 'ethers/lib/utils';
|
|
2
|
-
export declare type SignMessageArgs = {
|
|
3
|
-
/** Message to sign with wallet */
|
|
4
|
-
message: Bytes | string;
|
|
5
|
-
};
|
|
6
|
-
declare type Signature = string;
|
|
7
|
-
export declare type SignMessageResult = Signature;
|
|
8
|
-
export declare function signMessage(args: SignMessageArgs): Promise<SignMessageResult>;
|
|
9
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { providers } from 'ethers';
|
|
2
|
-
declare type SignTypedData = Parameters<providers.JsonRpcSigner['_signTypedData']>;
|
|
3
|
-
export declare type SignTypedDataArgs = {
|
|
4
|
-
/** Domain or domain signature for origin or contract */
|
|
5
|
-
domain: SignTypedData[0];
|
|
6
|
-
/** Named list of all type definitions */
|
|
7
|
-
types: SignTypedData[1];
|
|
8
|
-
/** Data to sign */
|
|
9
|
-
value: SignTypedData[2];
|
|
10
|
-
};
|
|
11
|
-
export declare type SignTypedDataResult = string;
|
|
12
|
-
export declare function signTypedData(args: SignTypedDataArgs): Promise<SignTypedDataResult>;
|
|
13
|
-
export {};
|