ethers.js/providers/index.js

34 lines
807 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');
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,
2017-02-25 09:23:48 +03:00
isProvder: Provider.isProvider,
getDefaultProvider:getDefaultProvider,
Provider: Provider,
}
require('ethers-utils/standalone.js')({
providers: module.exports
});