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

52 lines
1022 B
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';
import { Network } from '../utils/types';
2018-06-13 22:39:39 +03:00
function getDefaultProvider(network?: Network | string): FallbackProvider {
return new FallbackProvider([
new InfuraProvider(network),
new EtherscanProvider(network),
]);
}
export {
Provider,
getDefaultProvider,
FallbackProvider,
EtherscanProvider,
InfuraProvider,
JsonRpcProvider,
Web3Provider,
IpcProvider,
JsonRpcSigner
2018-06-18 12:42:41 +03:00
};
export default {
Provider,
getDefaultProvider,
FallbackProvider,
EtherscanProvider,
InfuraProvider,
JsonRpcProvider,
Web3Provider,
IpcProvider,
JsonRpcSigner
};