2016-08-04 02:36:44 +03:00
|
|
|
'use strict';
|
|
|
|
|
2017-02-25 09:23:48 +03:00
|
|
|
var Provider = require('./provider.js');
|
2016-08-04 02:36:44 +03:00
|
|
|
|
2017-02-25 09:23:48 +03:00
|
|
|
var EtherscanProvider = require('./etherscan-provider.js');
|
|
|
|
var FallbackProvider = require('./fallback-provider.js');
|
|
|
|
var InfuraProvider = require('./infura-provider.js');
|
|
|
|
var JsonRpcProvider = require('./json-rpc-provider.js');
|
2016-08-04 02:36:44 +03:00
|
|
|
|
2017-02-28 01:35:23 +03:00
|
|
|
function getDefaultProvider(testnet) {
|
|
|
|
return new FallbackProvider([
|
|
|
|
new InfuraProvider(testnet),
|
|
|
|
new EtherscanProvider(testnet),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2017-02-25 09:23:48 +03:00
|
|
|
module.exports = {
|
|
|
|
EtherscanProvider: EtherscanProvider,
|
|
|
|
FallbackProvider: FallbackProvider,
|
|
|
|
InfuraProvider: InfuraProvider,
|
|
|
|
JsonRpcProvider: JsonRpcProvider,
|
2016-08-04 02:36:44 +03:00
|
|
|
|
2017-02-25 09:23:48 +03:00
|
|
|
isProvder: Provider.isProvider,
|
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
|
|
|
}
|
2017-02-28 01:35:23 +03:00
|
|
|
|
|
|
|
require('ethers-utils/standalone.js')({
|
|
|
|
providers: module.exports
|
|
|
|
});
|
|
|
|
|