ethers.js/providers/index.js

38 lines
924 B
JavaScript
Raw Normal View History

'use strict';
2017-02-25 09:23:48 +03:00
var Provider = require('./provider.js');
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');
2018-01-17 02:55:56 +03:00
var Web3Provider = require('./web3-provider.js');
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),
]);
}
2017-02-25 09:23:48 +03:00
module.exports = {
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,
}
require('ethers-utils/standalone.js')({
providers: module.exports
});