ethers.js/src.ts/providers/index.ts

49 lines
1.0 KiB
TypeScript
Raw Normal View History

2018-06-13 22:39:39 +03:00
'use strict';
2018-07-12 09:49:09 +03:00
import { Provider } from './provider';
2018-06-13 22:39:39 +03:00
import { EtherscanProvider } from './etherscan-provider';
import { FallbackProvider } from './fallback-provider';
2018-06-18 12:42:41 +03:00
import { IpcProvider } from './ipc-provider';
2018-06-13 22:39:39 +03:00
import { InfuraProvider } from './infura-provider';
import { JsonRpcProvider, JsonRpcSigner } from './json-rpc-provider';
2018-06-13 22:39:39 +03:00
import { Web3Provider } from './web3-provider';
///////////////////////////////
// Imported Abstracts
import { Provider as AbstractProvider } from './abstract-provider';
///////////////////////////////
// Imported Types
import { Network } from '../utils/networks';
///////////////////////////////
function getDefaultProvider(network?: Network | string): Provider {
2018-06-13 22:39:39 +03:00
return new FallbackProvider([
new InfuraProvider(network),
new EtherscanProvider(network),
]);
}
export {
AbstractProvider,
2018-06-13 22:39:39 +03:00
Provider,
getDefaultProvider,
FallbackProvider,
EtherscanProvider,
InfuraProvider,
JsonRpcProvider,
Web3Provider,
IpcProvider,
JsonRpcSigner
2018-06-18 12:42:41 +03:00
};