ethers.js/src.ts/ethers.ts

236 lines
5.8 KiB
TypeScript
Raw Normal View History

'use strict';
import { Contract, Interface } from './contracts';
2018-08-02 00:35:23 +03:00
import {
Provider,
getDefaultProvider,
FallbackProvider,
EtherscanProvider,
InfuraProvider,
JsonRpcProvider,
Web3Provider,
IpcProvider,
} from './providers';
2018-08-02 00:35:23 +03:00
import { JsonRpcSigner } from './providers/json-rpc-provider';
import { HDNode, SigningKey, Wallet } from './wallet';
import * as utils from './utils';
2018-08-02 00:35:23 +03:00
import * as wordlists from './wordlists';
import * as errors from './utils/errors';
2018-08-02 00:35:23 +03:00
// 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';
2018-08-02 00:35:23 +03:00
///////////////////////////////
// Imported Abstracts
import { Provider as _AbstractProvider } from './providers/abstract-provider';
import { Signer as _AbstractSigner } from './wallet/abstract-signer';
///////////////////////////////
// Imported Types
import {
ContractFunction as _ContractFunction,
Event as _Event,
EventFilter as _EventFilter
} from './contracts/contract';
import {
Indexed as _Indexed,
DeployDescription as _DeplyDescription,
EventDescription as _EventDescription,
FunctionDescription as _FunctionDescription,
LogDescription as _LogDescription,
TransactionDescription as _TransactionDescription
} from './contracts/interface';
import {
Block as _Block,
BlockTag as _BlockTag,
EventType as _EventType,
Filter as _Filter,
Log as _Log,
Listener as _Listener,
TransactionReceipt as _TransactionReceipt,
TransactionRequest as _TransactionRequest,
TransactionResponse as _TransactionResponse,
} from './providers/abstract-provider';
import { AsyncSendable as _AsyncSendable } from './providers/web3-provider';
import {
CoerceFunc as _CoerceFunc,
EventFragment as _EventFragment,
FunctionFragment as _FunctionFragment,
ParamType as _ParamType
} from './utils/abi-coder';
import { BigNumberish as _BigNumberish } from './utils/bignumber';
import {
Arrayish as _Arrayish,
Hexable as _Hexable,
Signature as _Signature
} from './utils/bytes';
import { SupportedAlgorithms as _SupportedAlgorithms } from './utils/hmac';
import {
Network as _Network,
Networkish as _Networkish
} from './utils/networks';
import {
Transaction as _Transaction,
UnsignedTransaction as _UnsignedTransaction
} from './utils/transaction';
import { UnicodeNormalizationForm as _UnicodeNotmalizationForm } from './utils/utf8';
import {
ConnectionInfo as _ConnectionInfo,
OnceBlockable as _OnceBlockable,
PollOptions as _PollOptions
} from './utils/web';
import {
EncryptOptions as _EncryptOptions,
ProgressCallback as _ProgressCallback
} from './wallet/secret-storage';
import { Wordlist as _Wordlist } from './wordlists/wordlist';
///////////////////////////////
// Exported Types
module types {
export const AbstractSigner = _AbstractSigner;
export const AbstractProvider = _AbstractProvider;
export type SignerOrProvider = _AbstractSigner | _AbstractProvider;
// ./contracts/contract
export type ContractFunction = _ContractFunction;
export type EventFilter = _EventFilter;
export interface Event extends _Event { };
// ./contracts/interface
export interface Indexed extends _Indexed { };
export interface DeployDescription extends _DeplyDescription { };
export interface EventDescription extends _EventDescription { };
export interface FunctionDescription extends _FunctionDescription { };
export interface LogDescription extends _LogDescription { };
export interface TransactionDescription extends _TransactionDescription { };
// ./providers/abstract-provider
export type BlockTag = _BlockTag;
export type EventType = _EventType;
export type Filter = _Filter;
export type Listener = _Listener;
export type TransactionRequest = _TransactionRequest;
export interface Block extends _Block { };
export interface Log extends _Log { };
export interface TransactionReceipt extends _TransactionReceipt { };
export interface TransactionResponse extends _TransactionResponse { }
// ./providers/web3-provider
export type AsyncSendable = _AsyncSendable;
// ./utils/abi-coder
export type CoerceFunc = _CoerceFunc;
export type EventFragment = _EventFragment;
export type FunctionFragment = _FunctionFragment;
export type ParamType = _ParamType;
// ./utils/bignumber
export type BigNumberish = _BigNumberish;
// ./utils/bytes
export type Arrayish = _Arrayish;
export type Hexable = _Hexable;
export type Signature = _Signature;
// ./utils/hmac
export const SupportedAlgorithms = _SupportedAlgorithms;
// ./utils/networks
export type Network = _Network;
export type Networkish = _Networkish;
// ./utils/transaction
export type UnsignedTransaction = _UnsignedTransaction;
export interface Transaction extends _Transaction { };
// ./utils/utf8
export const UnicodeNormalizationForm = _UnicodeNotmalizationForm;
// ./utils/web
export type ConnectionInfo = _ConnectionInfo;
export interface OnceBlockable extends _OnceBlockable { };
export type PollOptions = _PollOptions;
// ./wallet/secret-storage
export type EncryptOptions = _EncryptOptions;
export type ProgressCallback = _ProgressCallback;
// ./wordlists/wordlist
export const Wordlist = _Wordlist;
}
///////////////////////////////
const constants = utils.constants;
2018-08-02 00:35:23 +03:00
const providers = {
Provider,
FallbackProvider,
EtherscanProvider,
InfuraProvider,
IpcProvider,
JsonRpcProvider,
Web3Provider,
JsonRpcSigner
};
export {
Wallet,
HDNode,
SigningKey,
Contract,
Interface,
getDefaultProvider,
2018-08-02 00:35:23 +03:00
providers,
errors,
constants,
utils,
2018-08-02 00:35:23 +03:00
types,
wordlists,
2018-07-17 09:05:24 +03:00
platform,
version
};