ethers.js/src.ts/ethers.ts

80 lines
1.4 KiB
TypeScript

'use strict';
import { Contract, ContractFactory, VoidSigner } from './contract';
import { Signer } from './abstract-signer';
import { Wallet } from './wallet';
import * as constants from './constants';
import * as errors from './errors';
import * as providers from './providers';
import * as utils from './utils';
import * as wordlists from './wordlists';
////////////////////////
// Compile-Time Constants
// This is empty in node, and used by browserify to inject extra goodies
import { platform } from './utils/shims';
// This is generated by "npm run dist"
import { version } from './_version';
////////////////////////
// Types
import { ContractFunction, ContractTransaction, Event, EventFilter } from './contract';
////////////////////////
// Helper Functions
function getDefaultProvider(network?: utils.Network | string): providers.BaseProvider {
return new providers.FallbackProvider([
new providers.InfuraProvider(network),
new providers.EtherscanProvider(network),
]);
}
////////////////////////
// Exports
export {
Signer,
Wallet,
VoidSigner,
getDefaultProvider,
providers,
Contract,
ContractFactory,
constants,
errors,
utils,
wordlists,
////////////////////////
// Compile-Time Constants
platform,
version,
////////////////////////
// Types
ContractFunction,
ContractTransaction,
Event,
EventFilter
};