2016-08-04 02:36:44 +03:00
|
|
|
'use strict';
|
|
|
|
|
2018-04-14 01:21:48 +03:00
|
|
|
var Provider = require('./provider');
|
2016-08-04 02:36:44 +03:00
|
|
|
|
2018-04-14 01:21:48 +03:00
|
|
|
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');
|
2016-08-04 02:36:44 +03:00
|
|
|
|
2017-10-26 02:58:21 +03:00
|
|
|
function getDefaultProvider(network) {
|
2017-02-28 01:35:23 +03:00
|
|
|
return new FallbackProvider([
|
2017-10-26 02:58:21 +03:00
|
|
|
new InfuraProvider(network),
|
|
|
|
new EtherscanProvider(network),
|
2017-02-28 01:35:23 +03:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2018-04-14 01:21:48 +03:00
|
|
|
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,
|
2016-08-04 02:36:44 +03:00
|
|
|
|
2017-10-26 02:58:21 +03:00
|
|
|
isProvider: Provider.isProvider,
|
|
|
|
|
|
|
|
networks: Provider.networks,
|
2016-08-04 02:36:44 +03:00
|
|
|
|
2017-02-28 01:35:23 +03:00
|
|
|
getDefaultProvider:getDefaultProvider,
|
|
|
|
|
|
|
|
Provider: Provider,
|
2016-08-04 02:36:44 +03:00
|
|
|
}
|
2018-04-14 01:21:48 +03:00
|
|
|
|
|
|
|
// Only available in node, so we do not include it in browsers
|
|
|
|
if (IpcProvider) {
|
|
|
|
exports.IpcProvider = IpcProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports;
|