ethers.js/providers/index.js

41 lines
1023 B
JavaScript
Raw Normal View History

'use strict';
var Provider = require('./provider');
var EtherscanProvider = require('./etherscan-provider');
var FallbackProvider = require('./fallback-provider');
var IpcProvider = require('./ipc-provider');
var InfuraProvider = require('./infura-provider');
var JsonRpcProvider = require('./json-rpc-provider');
var Web3Provider = require('./web3-provider');
2017-10-26 02:58:21 +03:00
function getDefaultProvider(network) {
return new FallbackProvider([
2017-10-26 02:58:21 +03:00
new InfuraProvider(network),
new EtherscanProvider(network),
]);
}
var exports = {
2017-02-25 09:23:48 +03:00
EtherscanProvider: EtherscanProvider,
FallbackProvider: FallbackProvider,
InfuraProvider: InfuraProvider,
JsonRpcProvider: JsonRpcProvider,
2018-01-17 02:55:56 +03:00
Web3Provider: Web3Provider,
2017-10-26 02:58:21 +03:00
isProvider: Provider.isProvider,
networks: Provider.networks,
getDefaultProvider:getDefaultProvider,
Provider: Provider,
}
// Only available in node, so we do not include it in browsers
if (IpcProvider) {
exports.IpcProvider = IpcProvider;
}
module.exports = exports;