2018-06-17 23:32:57 +03:00
|
|
|
declare module "utils/keccak256" {
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-17 23:32:57 +03:00
|
|
|
export function keccak256(data: Arrayish): string;
|
|
|
|
}
|
|
|
|
declare module "utils/properties" {
|
2018-06-18 12:42:41 +03:00
|
|
|
export function defineReadOnly(object: any, name: string, value: any): void;
|
|
|
|
export function defineFrozen(object: any, name: string, value: any): void;
|
2018-06-17 23:32:57 +03:00
|
|
|
export function resolveProperties(object: any): Promise<any>;
|
|
|
|
export function shallowCopy(object: any): any;
|
|
|
|
export function jsonCopy(object: any): any;
|
|
|
|
}
|
2018-06-14 12:38:37 +03:00
|
|
|
declare module "utils/errors" {
|
|
|
|
export const UNKNOWN_ERROR = "UNKNOWN_ERROR";
|
|
|
|
export const NOT_IMPLEMENTED = "NOT_IMPLEMENTED";
|
|
|
|
export const MISSING_NEW = "MISSING_NEW";
|
|
|
|
export const CALL_EXCEPTION = "CALL_EXCEPTION";
|
|
|
|
export const INVALID_ARGUMENT = "INVALID_ARGUMENT";
|
|
|
|
export const MISSING_ARGUMENT = "MISSING_ARGUMENT";
|
|
|
|
export const UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT";
|
|
|
|
export const NUMERIC_FAULT = "NUMERIC_FAULT";
|
|
|
|
export const UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION";
|
|
|
|
export function throwError(message: string, code: string, params: any): never;
|
|
|
|
export function checkNew(self: any, kind: any): void;
|
|
|
|
}
|
2018-06-17 23:32:57 +03:00
|
|
|
declare module "utils/secp256k1" {
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-17 23:32:57 +03:00
|
|
|
export const N: string;
|
|
|
|
export interface Signature {
|
|
|
|
r: string;
|
|
|
|
s: string;
|
|
|
|
recoveryParam: number;
|
|
|
|
v?: number;
|
|
|
|
}
|
|
|
|
export class KeyPair {
|
|
|
|
readonly privateKey: string;
|
|
|
|
readonly publicKey: string;
|
|
|
|
readonly compressedPublicKey: string;
|
|
|
|
readonly publicKeyBytes: Uint8Array;
|
|
|
|
constructor(privateKey: Arrayish);
|
|
|
|
sign(digest: Arrayish): Signature;
|
|
|
|
}
|
|
|
|
export function recoverPublicKey(digest: Arrayish, signature: Signature): string;
|
|
|
|
export function computePublicKey(key: Arrayish, compressed?: boolean): string;
|
|
|
|
export function recoverAddress(digest: Arrayish, signature: Signature): string;
|
|
|
|
export function computeAddress(key: string): string;
|
|
|
|
}
|
2018-06-17 23:47:28 +03:00
|
|
|
declare module "utils/bytes" {
|
2018-06-14 12:38:37 +03:00
|
|
|
/**
|
|
|
|
* Conversion Utilities
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
import { BigNumber } from "utils/bignumber";
|
2018-06-17 23:32:57 +03:00
|
|
|
import { Signature } from "utils/secp256k1";
|
2018-06-14 12:38:37 +03:00
|
|
|
export type Arrayish = string | ArrayLike<number>;
|
|
|
|
export function isArrayish(value: any): boolean;
|
|
|
|
export function arrayify(value: Arrayish | BigNumber): Uint8Array;
|
|
|
|
export function concat(objects: Array<Arrayish>): Uint8Array;
|
|
|
|
export function stripZeros(value: Arrayish): Uint8Array;
|
|
|
|
export function padZeros(value: Arrayish, length: number): Uint8Array;
|
|
|
|
export function isHexString(value: any, length?: number): boolean;
|
|
|
|
export function hexlify(value: Arrayish | BigNumber | number): string;
|
2018-06-17 23:32:57 +03:00
|
|
|
export function hexDataLength(data: string): number;
|
|
|
|
export function hexDataSlice(data: string, offset: number, length?: number): string;
|
2018-06-14 12:38:37 +03:00
|
|
|
export function hexStripZeros(value: string): string;
|
|
|
|
export function hexZeroPad(value: string, length: number): string;
|
|
|
|
export function splitSignature(signature: Arrayish): Signature;
|
2018-06-18 12:42:41 +03:00
|
|
|
export function joinSignature(signature: Signature): string;
|
2018-06-14 12:38:37 +03:00
|
|
|
}
|
|
|
|
declare module "utils/bignumber" {
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-14 12:38:37 +03:00
|
|
|
export type BigNumberish = BigNumber | string | number | Arrayish;
|
|
|
|
export class BigNumber {
|
2018-06-17 23:32:57 +03:00
|
|
|
private readonly _bn;
|
2018-06-14 12:38:37 +03:00
|
|
|
constructor(value: BigNumberish);
|
|
|
|
fromTwos(value: BigNumberish): BigNumber;
|
|
|
|
toTwos(value: BigNumberish): BigNumber;
|
|
|
|
add(other: BigNumberish): BigNumber;
|
|
|
|
sub(other: BigNumberish): BigNumber;
|
|
|
|
div(other: BigNumberish): BigNumber;
|
|
|
|
mul(other: BigNumberish): BigNumber;
|
|
|
|
mod(other: BigNumberish): BigNumber;
|
|
|
|
pow(other: BigNumberish): BigNumber;
|
|
|
|
maskn(value: BigNumberish): BigNumber;
|
|
|
|
eq(other: BigNumberish): boolean;
|
|
|
|
lt(other: BigNumberish): boolean;
|
|
|
|
lte(other: BigNumberish): boolean;
|
|
|
|
gt(other: BigNumberish): boolean;
|
|
|
|
gte(other: BigNumberish): boolean;
|
|
|
|
isZero(): boolean;
|
|
|
|
toNumber(): number;
|
|
|
|
toString(): string;
|
|
|
|
toHexString(): string;
|
|
|
|
}
|
|
|
|
export function isBigNumber(value: any): boolean;
|
|
|
|
export function bigNumberify(value: BigNumberish): BigNumber;
|
|
|
|
export const ConstantNegativeOne: BigNumber;
|
|
|
|
export const ConstantZero: BigNumber;
|
|
|
|
export const ConstantOne: BigNumber;
|
|
|
|
export const ConstantTwo: BigNumber;
|
|
|
|
export const ConstantWeiPerEther: BigNumber;
|
|
|
|
}
|
|
|
|
declare module "utils/rlp" {
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-14 12:38:37 +03:00
|
|
|
export function encode(object: any): string;
|
|
|
|
export function decode(data: Arrayish): any;
|
|
|
|
}
|
|
|
|
declare module "utils/address" {
|
|
|
|
import { BigNumber } from "utils/bignumber";
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-17 23:32:57 +03:00
|
|
|
export function getAddress(address: string): string;
|
|
|
|
export function getIcapAddress(address: string): string;
|
2018-06-14 12:38:37 +03:00
|
|
|
export function getContractAddress(transaction: {
|
|
|
|
from: string;
|
|
|
|
nonce: Arrayish | BigNumber | number;
|
|
|
|
}): string;
|
|
|
|
}
|
|
|
|
declare module "utils/utf8" {
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-14 12:38:37 +03:00
|
|
|
export enum UnicodeNormalizationForm {
|
|
|
|
current = "",
|
|
|
|
NFC = "NFC",
|
|
|
|
NFD = "NFD",
|
|
|
|
NFKC = "NFKC",
|
|
|
|
NFKD = "NFKD"
|
|
|
|
}
|
|
|
|
export function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm): Uint8Array;
|
|
|
|
export function toUtf8String(bytes: Arrayish): string;
|
|
|
|
}
|
|
|
|
declare module "utils/abi-coder" {
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-14 12:38:37 +03:00
|
|
|
export type CoerceFunc = (type: string, value: any) => any;
|
|
|
|
export type ParamType = {
|
|
|
|
name?: string;
|
|
|
|
type: string;
|
|
|
|
indexed?: boolean;
|
|
|
|
components?: Array<any>;
|
|
|
|
};
|
2018-06-15 11:18:17 +03:00
|
|
|
export const defaultCoerceFunc: CoerceFunc;
|
|
|
|
export type EventFragment = {
|
|
|
|
type: string;
|
|
|
|
name: string;
|
|
|
|
anonymous: boolean;
|
|
|
|
inputs: Array<ParamType>;
|
|
|
|
};
|
|
|
|
export type FunctionFragment = {
|
|
|
|
type: string;
|
|
|
|
name: string;
|
|
|
|
constant: boolean;
|
|
|
|
inputs: Array<ParamType>;
|
|
|
|
outputs: Array<ParamType>;
|
|
|
|
payable: boolean;
|
|
|
|
stateMutability: string;
|
|
|
|
};
|
2018-06-17 23:32:57 +03:00
|
|
|
export function parseParamType(type: string): ParamType;
|
2018-06-15 11:18:17 +03:00
|
|
|
export function parseSignature(fragment: string): EventFragment | FunctionFragment;
|
2018-06-14 12:38:37 +03:00
|
|
|
export class AbiCoder {
|
|
|
|
readonly coerceFunc: CoerceFunc;
|
|
|
|
constructor(coerceFunc?: CoerceFunc);
|
|
|
|
encode(types: Array<string | ParamType>, values: Array<any>): string;
|
|
|
|
decode(types: Array<string | ParamType>, data: Arrayish): any;
|
|
|
|
}
|
|
|
|
export const defaultAbiCoder: AbiCoder;
|
|
|
|
}
|
|
|
|
declare module "contracts/interface" {
|
|
|
|
import { ParamType } from "utils/abi-coder";
|
|
|
|
import { BigNumber, BigNumberish } from "utils/bignumber";
|
|
|
|
export class Description {
|
|
|
|
readonly type: string;
|
|
|
|
constructor(info: any);
|
|
|
|
}
|
2018-06-18 12:42:41 +03:00
|
|
|
export class Indexed extends Description {
|
2018-06-17 23:32:57 +03:00
|
|
|
readonly hash: string;
|
|
|
|
}
|
2018-06-14 12:38:37 +03:00
|
|
|
export class DeployDescription extends Description {
|
2018-06-18 12:42:41 +03:00
|
|
|
readonly inputs: Array<ParamType>;
|
2018-06-14 12:38:37 +03:00
|
|
|
readonly payable: boolean;
|
|
|
|
encode(bytecode: string, params: Array<any>): string;
|
|
|
|
}
|
|
|
|
export class FunctionDescription extends Description {
|
|
|
|
readonly name: string;
|
|
|
|
readonly signature: string;
|
|
|
|
readonly sighash: string;
|
2018-06-18 12:42:41 +03:00
|
|
|
readonly inputs: Array<ParamType>;
|
2018-06-14 12:38:37 +03:00
|
|
|
readonly outputs: Array<ParamType>;
|
|
|
|
readonly payable: boolean;
|
|
|
|
encode(params: Array<any>): string;
|
|
|
|
decode(data: string): any;
|
|
|
|
}
|
|
|
|
export class EventDescription extends Description {
|
|
|
|
readonly name: string;
|
|
|
|
readonly signature: string;
|
2018-06-18 12:42:41 +03:00
|
|
|
readonly inputs: Array<ParamType>;
|
2018-06-14 12:38:37 +03:00
|
|
|
readonly anonymous: boolean;
|
|
|
|
readonly topic: string;
|
|
|
|
decode(data: string, topics?: Array<string>): any;
|
|
|
|
}
|
2018-06-18 12:42:41 +03:00
|
|
|
class TransactionDescription extends Description {
|
|
|
|
readonly name: string;
|
|
|
|
readonly args: Array<any>;
|
|
|
|
readonly signature: string;
|
|
|
|
readonly sighash: string;
|
|
|
|
readonly decode: (data: string) => any;
|
|
|
|
readonly value: BigNumber;
|
|
|
|
}
|
|
|
|
class LogDescription extends Description {
|
|
|
|
readonly name: string;
|
|
|
|
readonly signature: string;
|
|
|
|
readonly topic: string;
|
|
|
|
readonly values: Array<any>;
|
|
|
|
}
|
2018-06-14 12:38:37 +03:00
|
|
|
export class Interface {
|
2018-06-15 11:18:17 +03:00
|
|
|
readonly abi: Array<any>;
|
2018-06-14 12:38:37 +03:00
|
|
|
readonly functions: Array<FunctionDescription>;
|
|
|
|
readonly events: Array<EventDescription>;
|
|
|
|
readonly deployFunction: DeployDescription;
|
|
|
|
constructor(abi: Array<string | ParamType> | string);
|
|
|
|
parseTransaction(tx: {
|
|
|
|
data: string;
|
|
|
|
value?: BigNumberish;
|
2018-06-18 12:42:41 +03:00
|
|
|
}): TransactionDescription;
|
|
|
|
parseLog(log: {
|
|
|
|
topics: Array<string>;
|
|
|
|
data: string;
|
|
|
|
}): LogDescription;
|
2018-06-14 12:38:37 +03:00
|
|
|
}
|
|
|
|
}
|
2018-06-18 12:42:41 +03:00
|
|
|
declare module "wallet/words" {
|
|
|
|
export function getWord(index: number): string;
|
|
|
|
export function getWordIndex(word: string): number;
|
2018-06-14 12:38:37 +03:00
|
|
|
}
|
2018-06-18 12:42:41 +03:00
|
|
|
declare module "utils/hmac" {
|
|
|
|
import { Arrayish } from "utils/bytes";
|
|
|
|
interface HashFunc {
|
|
|
|
(): HashFunc;
|
|
|
|
update(chunk: Uint8Array): HashFunc;
|
|
|
|
digest(encoding: string): string;
|
|
|
|
digest(): Uint8Array;
|
|
|
|
}
|
|
|
|
export interface HmacFunc extends HashFunc {
|
|
|
|
(hashFunc: HashFunc, key: Arrayish): HmacFunc;
|
|
|
|
}
|
|
|
|
export function createSha256Hmac(key: Arrayish): HmacFunc;
|
|
|
|
export function createSha512Hmac(key: Arrayish): HmacFunc;
|
|
|
|
}
|
|
|
|
declare module "utils/pbkdf2" {
|
|
|
|
import { Arrayish } from "utils/bytes";
|
|
|
|
import { HmacFunc } from "utils/hmac";
|
|
|
|
export interface CreateHmacFunc {
|
|
|
|
(key: Arrayish): HmacFunc;
|
|
|
|
}
|
|
|
|
export function pbkdf2(password: Arrayish, salt: Arrayish, iterations: number, keylen: number, createHmac: CreateHmacFunc): Uint8Array;
|
|
|
|
}
|
|
|
|
declare module "utils/sha2" {
|
|
|
|
import { Arrayish } from "utils/bytes";
|
|
|
|
export function sha256(data: Arrayish): string;
|
|
|
|
export function sha512(data: Arrayish): string;
|
|
|
|
}
|
|
|
|
declare module "wallet/hdnode" {
|
|
|
|
import { Arrayish } from "utils/bytes";
|
|
|
|
import { KeyPair } from "utils/secp256k1";
|
|
|
|
export const defaultPath = "m/44'/60'/0'/0/0";
|
|
|
|
export class HDNode {
|
|
|
|
private readonly keyPair;
|
|
|
|
readonly privateKey: string;
|
|
|
|
readonly publicKey: string;
|
|
|
|
readonly mnemonic: string;
|
|
|
|
readonly path: string;
|
|
|
|
readonly chainCode: string;
|
|
|
|
readonly index: number;
|
|
|
|
readonly depth: number;
|
|
|
|
constructor(keyPair: KeyPair, chainCode: Uint8Array, index: number, depth: number, mnemonic: string, path: string);
|
|
|
|
private _derive;
|
|
|
|
derivePath(path: string): HDNode;
|
|
|
|
}
|
|
|
|
export function fromMnemonic(mnemonic: string): HDNode;
|
|
|
|
export function fromSeed(seed: Arrayish): HDNode;
|
|
|
|
export function mnemonicToSeed(mnemonic: string, password?: string): string;
|
|
|
|
export function mnemonicToEntropy(mnemonic: string): string;
|
|
|
|
export function entropyToMnemonic(entropy: Arrayish): string;
|
|
|
|
export function isValidMnemonic(mnemonic: string): boolean;
|
|
|
|
}
|
|
|
|
declare module "utils/random-bytes" {
|
|
|
|
export function randomBytes(length: number): Uint8Array;
|
|
|
|
}
|
|
|
|
declare module "wallet/signing-key" {
|
|
|
|
import { Arrayish } from "utils/bytes";
|
|
|
|
import { HDNode } from "wallet/hdnode";
|
|
|
|
import { Signature } from "utils/secp256k1";
|
|
|
|
export class SigningKey {
|
|
|
|
readonly privateKey: string;
|
|
|
|
readonly publicKey: string;
|
|
|
|
readonly address: string;
|
|
|
|
readonly mnemonic: string;
|
|
|
|
readonly path: string;
|
|
|
|
private readonly keyPair;
|
|
|
|
constructor(privateKey: Arrayish | HDNode);
|
|
|
|
signDigest(digest: Arrayish): Signature;
|
|
|
|
}
|
|
|
|
export function recoverAddress(digest: Arrayish, signature: Signature): string;
|
|
|
|
export function computeAddress(key: string): string;
|
|
|
|
}
|
|
|
|
declare module "wallet/secret-storage" {
|
|
|
|
import { Arrayish } from "utils/bytes";
|
|
|
|
import { SigningKey } from "wallet/signing-key";
|
|
|
|
export interface ProgressCallback {
|
|
|
|
(percent: number): void;
|
|
|
|
}
|
|
|
|
export function isCrowdsaleWallet(json: string): boolean;
|
|
|
|
export function isValidWallet(json: string): boolean;
|
|
|
|
export function decryptCrowdsale(json: string, password: Arrayish | string): SigningKey;
|
|
|
|
export function decrypt(json: string, password: any, progressCallback?: ProgressCallback): Promise<SigningKey>;
|
|
|
|
export function encrypt(privateKey: Arrayish | SigningKey, password: Arrayish | string, options?: any, progressCallback?: ProgressCallback): Promise<string>;
|
|
|
|
}
|
|
|
|
declare module "utils/hash" {
|
|
|
|
import { Arrayish } from "utils/bytes";
|
|
|
|
export function namehash(name: string): string;
|
|
|
|
export function id(text: string): string;
|
|
|
|
export function hashMessage(message: Arrayish | string): string;
|
2018-06-14 12:38:37 +03:00
|
|
|
}
|
2018-06-17 23:32:57 +03:00
|
|
|
declare module "utils/transaction" {
|
|
|
|
import { BigNumber, BigNumberish } from "utils/bignumber";
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-17 23:32:57 +03:00
|
|
|
import { Signature } from "utils/secp256k1";
|
|
|
|
export interface UnsignedTransaction {
|
|
|
|
to?: string;
|
|
|
|
nonce?: number;
|
|
|
|
gasLimit?: BigNumberish;
|
|
|
|
gasPrice?: BigNumberish;
|
|
|
|
data?: Arrayish;
|
|
|
|
value?: BigNumberish;
|
|
|
|
chainId?: number;
|
|
|
|
}
|
|
|
|
export interface Transaction {
|
|
|
|
hash?: string;
|
|
|
|
to?: string;
|
|
|
|
from?: string;
|
|
|
|
nonce: number;
|
|
|
|
gasLimit: BigNumber;
|
|
|
|
gasPrice: BigNumber;
|
|
|
|
data: string;
|
|
|
|
value: BigNumber;
|
|
|
|
chainId: number;
|
|
|
|
r?: string;
|
|
|
|
s?: string;
|
|
|
|
v?: number;
|
|
|
|
}
|
|
|
|
export type SignDigestFunc = (digest: Arrayish) => Signature;
|
|
|
|
export function sign(transaction: UnsignedTransaction, signDigest: SignDigestFunc): string;
|
|
|
|
export function parse(rawTransaction: Arrayish): Transaction;
|
|
|
|
}
|
2018-06-18 12:42:41 +03:00
|
|
|
declare module "wallet/wallet" {
|
|
|
|
import { HDNode } from "wallet/hdnode";
|
|
|
|
import { ProgressCallback } from "wallet/secret-storage";
|
|
|
|
import { SigningKey } from "wallet/signing-key";
|
|
|
|
import { BlockTag, Provider, TransactionRequest, TransactionResponse } from "providers/provider";
|
|
|
|
import { BigNumber, BigNumberish } from "utils/bignumber";
|
|
|
|
import { Arrayish } from "utils/bytes";
|
|
|
|
export abstract class Signer {
|
|
|
|
provider?: Provider;
|
|
|
|
abstract getAddress(): Promise<string>;
|
|
|
|
abstract signMessage(transaction: Arrayish | string): Promise<string>;
|
|
|
|
abstract sendTransaction(transaction: TransactionRequest): Promise<TransactionResponse>;
|
|
|
|
}
|
|
|
|
export class Wallet extends Signer {
|
|
|
|
readonly address: string;
|
|
|
|
readonly privateKey: string;
|
|
|
|
readonly provider: Provider;
|
|
|
|
private mnemonic;
|
|
|
|
private path;
|
|
|
|
private readonly signingKey;
|
|
|
|
defaultGasLimit: number;
|
|
|
|
constructor(privateKey: SigningKey | HDNode | Arrayish, provider?: Provider);
|
|
|
|
connect(provider: Provider): Wallet;
|
|
|
|
getAddress(): Promise<string>;
|
|
|
|
sign(transaction: TransactionRequest): Promise<string>;
|
|
|
|
signMessage(message: Arrayish | string): Promise<string>;
|
|
|
|
getBalance(blockTag?: BlockTag): Promise<BigNumber>;
|
|
|
|
getTransactionCount(blockTag?: BlockTag): Promise<number>;
|
|
|
|
sendTransaction(transaction: TransactionRequest): Promise<TransactionResponse>;
|
|
|
|
send(addressOrName: string, amountWei: BigNumberish, options: any): Promise<TransactionResponse>;
|
|
|
|
encrypt(password: Arrayish | string, options: any, progressCallback: ProgressCallback): Promise<string>;
|
|
|
|
static createRandom(options: any): Wallet;
|
|
|
|
static isEncryptedWallet(json: string): boolean;
|
|
|
|
static fromEncryptedWallet(json: string, password: Arrayish, progressCallback: ProgressCallback): Promise<Wallet>;
|
|
|
|
static fromMnemonic(mnemonic: string, path?: string): Wallet;
|
|
|
|
static fromBrainWallet(username: Arrayish | string, password: Arrayish | string, progressCallback: ProgressCallback): Promise<Wallet>;
|
|
|
|
static verifyMessage(message: Arrayish | string, signature: string): string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
declare module "providers/networks" {
|
|
|
|
export type Network = {
|
|
|
|
name: string;
|
|
|
|
chainId: number;
|
|
|
|
ensAddress?: string;
|
|
|
|
};
|
|
|
|
export type Networkish = Network | string | number;
|
|
|
|
/**
|
|
|
|
* getNetwork
|
|
|
|
*
|
|
|
|
* If the network is a the name of a common network, return that network.
|
|
|
|
* Otherwise, if it is a network object, verify the chain ID is valid
|
|
|
|
* for that network. Otherwise, return the network.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
export function getNetwork(network: Networkish): Network;
|
|
|
|
}
|
2018-06-14 12:38:37 +03:00
|
|
|
declare module "providers/provider" {
|
2018-06-18 12:42:41 +03:00
|
|
|
import { Signer } from "wallet/wallet";
|
2018-06-14 12:38:37 +03:00
|
|
|
import { BigNumber, BigNumberish } from "utils/bignumber";
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-18 12:42:41 +03:00
|
|
|
import { Network, Networkish } from "providers/networks";
|
|
|
|
import { SignDigestFunc, Transaction } from "utils/transaction";
|
2018-06-14 12:38:37 +03:00
|
|
|
export type BlockTag = string | number;
|
2018-06-17 23:32:57 +03:00
|
|
|
export interface Block {
|
2018-06-14 12:38:37 +03:00
|
|
|
hash: string;
|
|
|
|
parentHash: string;
|
|
|
|
number: number;
|
|
|
|
timestamp: number;
|
|
|
|
nonce: string;
|
2018-06-18 12:42:41 +03:00
|
|
|
difficulty: number;
|
2018-06-14 12:38:37 +03:00
|
|
|
gasLimit: BigNumber;
|
|
|
|
gasUsed: BigNumber;
|
|
|
|
miner: string;
|
|
|
|
extraData: string;
|
|
|
|
transactions: Array<string>;
|
2018-06-17 23:32:57 +03:00
|
|
|
}
|
2018-06-14 12:38:37 +03:00
|
|
|
export type TransactionRequest = {
|
|
|
|
to?: string | Promise<string>;
|
|
|
|
from?: string | Promise<string>;
|
|
|
|
nonce?: number | string | Promise<number | string>;
|
|
|
|
gasLimit?: BigNumberish | Promise<BigNumberish>;
|
|
|
|
gasPrice?: BigNumberish | Promise<BigNumberish>;
|
|
|
|
data?: Arrayish | Promise<Arrayish>;
|
|
|
|
value?: BigNumberish | Promise<BigNumberish>;
|
|
|
|
chainId?: number | Promise<number>;
|
|
|
|
};
|
2018-06-17 23:32:57 +03:00
|
|
|
export interface TransactionResponse extends Transaction {
|
2018-06-14 12:38:37 +03:00
|
|
|
blockNumber?: number;
|
|
|
|
blockHash?: string;
|
2018-06-15 11:18:17 +03:00
|
|
|
timestamp?: number;
|
2018-06-17 23:32:57 +03:00
|
|
|
from: string;
|
|
|
|
wait: (timeout?: number) => Promise<TransactionResponse>;
|
|
|
|
}
|
|
|
|
export interface TransactionReceipt {
|
2018-06-14 12:38:37 +03:00
|
|
|
contractAddress?: string;
|
|
|
|
transactionIndex?: number;
|
|
|
|
root?: string;
|
|
|
|
gasUsed?: BigNumber;
|
|
|
|
logsBloom?: string;
|
|
|
|
blockHash?: string;
|
|
|
|
transactionHash?: string;
|
|
|
|
logs?: Array<Log>;
|
|
|
|
blockNumber?: number;
|
|
|
|
cumulativeGasUsed?: BigNumber;
|
|
|
|
status?: number;
|
2018-06-17 23:32:57 +03:00
|
|
|
}
|
2018-06-14 12:38:37 +03:00
|
|
|
export type Filter = {
|
|
|
|
fromBlock?: BlockTag;
|
|
|
|
toBlock?: BlockTag;
|
|
|
|
address?: string;
|
|
|
|
topics?: Array<any>;
|
|
|
|
};
|
2018-06-17 23:32:57 +03:00
|
|
|
export interface Log {
|
2018-06-14 12:38:37 +03:00
|
|
|
blockNumber?: number;
|
|
|
|
blockHash?: string;
|
|
|
|
transactionIndex?: number;
|
|
|
|
removed?: boolean;
|
|
|
|
address: string;
|
|
|
|
data?: string;
|
|
|
|
topics?: Array<string>;
|
|
|
|
transactionHash?: string;
|
|
|
|
logIndex?: number;
|
2018-06-17 23:32:57 +03:00
|
|
|
}
|
2018-06-15 11:18:17 +03:00
|
|
|
export function checkTransactionResponse(transaction: any): TransactionResponse;
|
2018-06-18 12:42:41 +03:00
|
|
|
export class ProviderSigner extends Signer {
|
|
|
|
readonly provider: Provider;
|
|
|
|
readonly signDigest: SignDigestFunc;
|
|
|
|
private _addressPromise;
|
|
|
|
constructor(address: string | Promise<string>, signDigest: SignDigestFunc, provider: Provider);
|
|
|
|
getAddress(): Promise<string>;
|
|
|
|
signMessage(message: Arrayish | string): Promise<string>;
|
|
|
|
sendTransaction(transaction: TransactionRequest): Promise<TransactionResponse>;
|
|
|
|
estimateGas(transaction: TransactionRequest): Promise<BigNumber>;
|
|
|
|
call(transaction: TransactionRequest): Promise<string>;
|
|
|
|
}
|
2018-06-14 12:38:37 +03:00
|
|
|
export class Provider {
|
|
|
|
private _network;
|
|
|
|
private _events;
|
|
|
|
protected _emitted: any;
|
|
|
|
private _pollingInterval;
|
|
|
|
private _poller;
|
|
|
|
private _lastBlockNumber;
|
|
|
|
private _balances;
|
|
|
|
/**
|
2018-06-17 23:32:57 +03:00
|
|
|
* ready
|
|
|
|
*
|
|
|
|
* A Promise<Network> that resolves only once the provider is ready.
|
|
|
|
*
|
|
|
|
* Sub-classes that call the super with a network without a chainId
|
|
|
|
* MUST set this. Standard named networks have a known chainId.
|
|
|
|
*
|
2018-06-14 12:38:37 +03:00
|
|
|
*/
|
2018-06-17 23:32:57 +03:00
|
|
|
protected ready: Promise<Network>;
|
2018-06-18 12:42:41 +03:00
|
|
|
constructor(network: Networkish | Promise<Network>);
|
2018-06-14 12:38:37 +03:00
|
|
|
private _doPoll;
|
2018-06-15 11:18:17 +03:00
|
|
|
resetEventsBlock(blockNumber: number): void;
|
2018-06-14 12:38:37 +03:00
|
|
|
readonly network: Network;
|
|
|
|
getNetwork(): Promise<Network>;
|
|
|
|
readonly blockNumber: number;
|
|
|
|
polling: boolean;
|
|
|
|
pollingInterval: number;
|
|
|
|
waitForTransaction(transactionHash: string, timeout?: number): Promise<TransactionResponse>;
|
|
|
|
getBlockNumber(): Promise<number>;
|
|
|
|
getGasPrice(): Promise<BigNumber>;
|
|
|
|
getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
|
|
|
|
getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
|
|
|
|
getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
|
|
getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
2018-06-17 23:32:57 +03:00
|
|
|
sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
|
2018-06-14 12:38:37 +03:00
|
|
|
call(transaction: TransactionRequest): Promise<string>;
|
|
|
|
estimateGas(transaction: TransactionRequest): Promise<BigNumber>;
|
|
|
|
getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
|
|
|
|
getTransaction(transactionHash: string): Promise<TransactionResponse>;
|
|
|
|
getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
|
|
|
|
getLogs(filter: Filter): Promise<Array<Log>>;
|
|
|
|
getEtherPrice(): Promise<number>;
|
2018-06-15 11:18:17 +03:00
|
|
|
_resolveNames(object: any, keys: Array<string>): Promise<any>;
|
|
|
|
_getResolver(name: string): Promise<string>;
|
2018-06-14 12:38:37 +03:00
|
|
|
resolveName(name: string | Promise<string>): Promise<string>;
|
|
|
|
lookupAddress(address: string | Promise<string>): Promise<string>;
|
|
|
|
doPoll(): void;
|
|
|
|
perform(method: string, params: any): Promise<any>;
|
|
|
|
_startPending(): void;
|
|
|
|
_stopPending(): void;
|
|
|
|
on(eventName: any, listener: any): Provider;
|
|
|
|
once(eventName: any, listener: any): Provider;
|
|
|
|
emit(eventName: any, ...args: any[]): boolean;
|
|
|
|
listenerCount(eventName?: any): number;
|
|
|
|
listeners(eventName: any): Array<any>;
|
|
|
|
removeAllListeners(eventName: any): Provider;
|
|
|
|
removeListener(eventName: any, listener: any): Provider;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
declare module "contracts/contract" {
|
|
|
|
import { Interface } from "contracts/interface";
|
|
|
|
import { Provider, TransactionResponse } from "providers/provider";
|
2018-06-17 23:32:57 +03:00
|
|
|
import { Signer } from "wallet/wallet";
|
2018-06-14 12:38:37 +03:00
|
|
|
import { ParamType } from "utils/abi-coder";
|
|
|
|
import { BigNumber } from "utils/bignumber";
|
|
|
|
export type ContractEstimate = (...params: Array<any>) => Promise<BigNumber>;
|
|
|
|
export type ContractFunction = (...params: Array<any>) => Promise<any>;
|
|
|
|
export type ContractEvent = (...params: Array<any>) => void;
|
|
|
|
interface Bucket<T> {
|
|
|
|
[name: string]: T;
|
|
|
|
}
|
|
|
|
export type Contractish = Array<string | ParamType> | Interface | string;
|
|
|
|
export class Contract {
|
|
|
|
readonly address: string;
|
|
|
|
readonly interface: Interface;
|
|
|
|
readonly signer: Signer;
|
|
|
|
readonly provider: Provider;
|
|
|
|
readonly estimate: Bucket<ContractEstimate>;
|
|
|
|
readonly functions: Bucket<ContractFunction>;
|
|
|
|
readonly events: Bucket<ContractEvent>;
|
|
|
|
readonly addressPromise: Promise<string>;
|
|
|
|
readonly deployTransaction: TransactionResponse;
|
|
|
|
constructor(addressOrName: string, contractInterface: Contractish, signerOrProvider: Signer | Provider);
|
|
|
|
connect(signerOrProvider: Signer | Provider): Contract;
|
|
|
|
deploy(bytecode: string, ...args: Array<any>): Promise<Contract>;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
declare module "contracts/index" {
|
|
|
|
import { Contract } from "contracts/contract";
|
|
|
|
import { Interface } from "contracts/interface";
|
|
|
|
export { Contract, Interface };
|
|
|
|
}
|
|
|
|
declare module "utils/base64" {
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-14 12:38:37 +03:00
|
|
|
export function decode(textData: string): Uint8Array;
|
|
|
|
export function encode(data: Arrayish): string;
|
|
|
|
}
|
|
|
|
declare module "utils/web" {
|
|
|
|
export type ConnectionInfo = {
|
|
|
|
url: string;
|
|
|
|
user?: string;
|
|
|
|
password?: string;
|
|
|
|
allowInsecure?: boolean;
|
|
|
|
};
|
|
|
|
export type ProcessFunc = (value: any) => any;
|
|
|
|
export function fetchJson(url: string | ConnectionInfo, json: string, processFunc: ProcessFunc): Promise<any>;
|
|
|
|
}
|
|
|
|
declare module "providers/etherscan-provider" {
|
|
|
|
import { Provider } from "providers/provider";
|
2018-06-18 12:42:41 +03:00
|
|
|
import { Networkish } from "providers/networks";
|
2018-06-14 12:38:37 +03:00
|
|
|
export class EtherscanProvider extends Provider {
|
|
|
|
readonly baseUrl: string;
|
|
|
|
readonly apiKey: string;
|
2018-06-18 12:42:41 +03:00
|
|
|
constructor(network?: Networkish, apiKey?: string);
|
2018-06-14 12:38:37 +03:00
|
|
|
perform(method: string, params: any): Promise<any>;
|
|
|
|
getHistory(addressOrName: any, startBlock: any, endBlock: any): Promise<any[]>;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
declare module "providers/fallback-provider" {
|
|
|
|
import { Provider } from "providers/provider";
|
|
|
|
export class FallbackProvider extends Provider {
|
|
|
|
private _providers;
|
|
|
|
constructor(providers: Array<Provider>);
|
|
|
|
readonly providers: Provider[];
|
|
|
|
perform(method: string, params: any): any;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
declare module "providers/json-rpc-provider" {
|
2018-06-18 12:42:41 +03:00
|
|
|
import { Networkish } from "providers/networks";
|
|
|
|
import { BlockTag, Provider, TransactionRequest, TransactionResponse } from "providers/provider";
|
|
|
|
import { Signer } from "wallet/wallet";
|
2018-06-14 12:38:37 +03:00
|
|
|
import { BigNumber } from "utils/bignumber";
|
2018-06-17 23:47:28 +03:00
|
|
|
import { Arrayish } from "utils/bytes";
|
2018-06-14 12:38:37 +03:00
|
|
|
import { ConnectionInfo } from "utils/web";
|
|
|
|
export function hexlifyTransaction(transaction: TransactionRequest): any;
|
2018-06-18 12:42:41 +03:00
|
|
|
export class JsonRpcSigner extends Signer {
|
2018-06-14 12:38:37 +03:00
|
|
|
readonly provider: JsonRpcProvider;
|
|
|
|
readonly _address: string;
|
|
|
|
constructor(provider: JsonRpcProvider, address?: string);
|
|
|
|
readonly address: string;
|
|
|
|
getAddress(): Promise<string>;
|
|
|
|
getBalance(blockTag?: BlockTag): Promise<BigNumber>;
|
|
|
|
getTransactionCount(blockTag: any): Promise<number>;
|
2018-06-18 12:42:41 +03:00
|
|
|
sendTransaction(transaction: TransactionRequest): Promise<TransactionResponse>;
|
2018-06-14 12:38:37 +03:00
|
|
|
signMessage(message: Arrayish | string): Promise<string>;
|
|
|
|
unlock(password: any): Promise<boolean>;
|
|
|
|
}
|
|
|
|
export class JsonRpcProvider extends Provider {
|
|
|
|
readonly connection: ConnectionInfo;
|
|
|
|
private _pendingFilter;
|
2018-06-18 12:42:41 +03:00
|
|
|
constructor(url?: ConnectionInfo | string, network?: Networkish);
|
2018-06-15 11:18:17 +03:00
|
|
|
getSigner(address: string): JsonRpcSigner;
|
|
|
|
listAccounts(): Promise<Array<string>>;
|
|
|
|
send(method: string, params: any): Promise<any>;
|
|
|
|
perform(method: string, params: any): Promise<any>;
|
2018-06-14 12:38:37 +03:00
|
|
|
_startPending(): void;
|
|
|
|
_stopPending(): void;
|
|
|
|
}
|
|
|
|
}
|
2018-06-18 12:42:41 +03:00
|
|
|
declare module "providers/ipc-provider" {
|
|
|
|
import { JsonRpcProvider } from "providers/json-rpc-provider";
|
|
|
|
import { Networkish } from "providers/networks";
|
|
|
|
export class IpcProvider extends JsonRpcProvider {
|
|
|
|
readonly path: string;
|
|
|
|
constructor(path: string, network?: Networkish);
|
|
|
|
send(method: string, params: any): Promise<any>;
|
|
|
|
}
|
|
|
|
}
|
2018-06-14 12:38:37 +03:00
|
|
|
declare module "providers/infura-provider" {
|
|
|
|
import { JsonRpcProvider, JsonRpcSigner } from "providers/json-rpc-provider";
|
2018-06-18 12:42:41 +03:00
|
|
|
import { Networkish } from "providers/networks";
|
2018-06-14 12:38:37 +03:00
|
|
|
export class InfuraProvider extends JsonRpcProvider {
|
|
|
|
readonly apiAccessToken: string;
|
2018-06-18 12:42:41 +03:00
|
|
|
constructor(network?: Networkish, apiAccessToken?: string);
|
2018-06-14 12:38:37 +03:00
|
|
|
_startPending(): void;
|
|
|
|
getSigner(address?: string): JsonRpcSigner;
|
2018-06-15 11:18:17 +03:00
|
|
|
listAccounts(): Promise<Array<string>>;
|
2018-06-14 12:38:37 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
declare module "providers/web3-provider" {
|
2018-06-18 12:42:41 +03:00
|
|
|
import { Networkish } from "providers/networks";
|
2018-06-14 12:38:37 +03:00
|
|
|
import { JsonRpcProvider } from "providers/json-rpc-provider";
|
|
|
|
export type Callback = (error: any, response: any) => void;
|
|
|
|
export type AsyncProvider = {
|
|
|
|
isMetaMask: boolean;
|
|
|
|
host?: string;
|
|
|
|
path?: string;
|
|
|
|
sendAsync: (request: any, callback: Callback) => void;
|
|
|
|
};
|
|
|
|
export class Web3Provider extends JsonRpcProvider {
|
|
|
|
readonly _web3Provider: AsyncProvider;
|
2018-06-18 12:42:41 +03:00
|
|
|
constructor(web3Provider: AsyncProvider, network?: Networkish);
|
2018-06-15 11:18:17 +03:00
|
|
|
send(method: string, params: any): Promise<any>;
|
2018-06-14 12:38:37 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
declare module "providers/index" {
|
2018-06-18 12:42:41 +03:00
|
|
|
import { Provider, ProviderSigner } from "providers/provider";
|
2018-06-14 12:38:37 +03:00
|
|
|
import { Network } from "providers/networks";
|
|
|
|
import { EtherscanProvider } from "providers/etherscan-provider";
|
|
|
|
import { FallbackProvider } from "providers/fallback-provider";
|
2018-06-18 12:42:41 +03:00
|
|
|
import { IpcProvider } from "providers/ipc-provider";
|
2018-06-14 12:38:37 +03:00
|
|
|
import { InfuraProvider } from "providers/infura-provider";
|
|
|
|
import { JsonRpcProvider } from "providers/json-rpc-provider";
|
|
|
|
import { Web3Provider } from "providers/web3-provider";
|
|
|
|
function getDefaultProvider(network?: Network | string): FallbackProvider;
|
2018-06-18 12:42:41 +03:00
|
|
|
export { Provider, getDefaultProvider, ProviderSigner, FallbackProvider, EtherscanProvider, InfuraProvider, JsonRpcProvider, Web3Provider, IpcProvider };
|
2018-06-14 12:38:37 +03:00
|
|
|
}
|
|
|
|
declare module "utils/solidity" {
|
|
|
|
export function pack(types: Array<string>, values: Array<any>): string;
|
|
|
|
export function keccak256(types: Array<string>, values: Array<any>): string;
|
|
|
|
export function sha256(types: Array<string>, values: Array<any>): string;
|
|
|
|
}
|
|
|
|
declare module "utils/units" {
|
2018-06-15 11:18:17 +03:00
|
|
|
import { BigNumber, BigNumberish } from "utils/bignumber";
|
|
|
|
export function formatUnits(value: BigNumberish, unitType?: string | number, options?: any): string;
|
|
|
|
export function parseUnits(value: string, unitType?: string | number): BigNumber;
|
|
|
|
export function formatEther(wei: BigNumberish, options: any): string;
|
|
|
|
export function parseEther(ether: string): BigNumber;
|
2018-06-14 12:38:37 +03:00
|
|
|
}
|
|
|
|
declare module "utils/index" {
|
2018-06-17 23:32:57 +03:00
|
|
|
import { getAddress, getContractAddress, getIcapAddress } from "utils/address";
|
2018-06-14 12:38:37 +03:00
|
|
|
import { AbiCoder, parseSignature } from "utils/abi-coder";
|
|
|
|
import * as base64 from "utils/base64";
|
|
|
|
import * as bigNumber from "utils/bignumber";
|
2018-06-17 23:47:28 +03:00
|
|
|
import * as bytes from "utils/bytes";
|
2018-06-18 12:42:41 +03:00
|
|
|
import { hashMessage, id, namehash } from "utils/hash";
|
2018-06-14 12:38:37 +03:00
|
|
|
import { keccak256 } from "utils/keccak256";
|
|
|
|
import * as sha2 from "utils/sha2";
|
|
|
|
import * as solidity from "utils/solidity";
|
|
|
|
import { randomBytes } from "utils/random-bytes";
|
2018-06-18 12:42:41 +03:00
|
|
|
import properties = require("utils/properties");
|
2018-06-14 12:38:37 +03:00
|
|
|
import * as RLP from "utils/rlp";
|
|
|
|
import * as utf8 from "utils/utf8";
|
|
|
|
import * as units from "utils/units";
|
|
|
|
import { fetchJson } from "utils/web";
|
2018-06-17 23:32:57 +03:00
|
|
|
import { parse as parseTransaction } from "utils/transaction";
|
2018-06-14 12:38:37 +03:00
|
|
|
const _default: {
|
|
|
|
AbiCoder: typeof AbiCoder;
|
|
|
|
defaultAbiCoder: AbiCoder;
|
|
|
|
parseSignature: typeof parseSignature;
|
|
|
|
RLP: typeof RLP;
|
|
|
|
fetchJson: typeof fetchJson;
|
2018-06-18 12:42:41 +03:00
|
|
|
defineReadOnly: typeof properties.defineReadOnly;
|
|
|
|
defineFrozen: typeof properties.defineFrozen;
|
|
|
|
resolveProperties: typeof properties.resolveProperties;
|
|
|
|
shallowCopy: typeof properties.shallowCopy;
|
2018-06-14 12:38:37 +03:00
|
|
|
etherSymbol: string;
|
2018-06-17 23:47:28 +03:00
|
|
|
arrayify: typeof bytes.arrayify;
|
|
|
|
concat: typeof bytes.concat;
|
|
|
|
padZeros: typeof bytes.padZeros;
|
|
|
|
stripZeros: typeof bytes.stripZeros;
|
2018-06-14 12:38:37 +03:00
|
|
|
base64: typeof base64;
|
|
|
|
bigNumberify: typeof bigNumber.bigNumberify;
|
|
|
|
BigNumber: typeof bigNumber.BigNumber;
|
2018-06-17 23:47:28 +03:00
|
|
|
hexlify: typeof bytes.hexlify;
|
2018-06-14 12:38:37 +03:00
|
|
|
toUtf8Bytes: typeof utf8.toUtf8Bytes;
|
|
|
|
toUtf8String: typeof utf8.toUtf8String;
|
2018-06-18 12:42:41 +03:00
|
|
|
hashMessage: typeof hashMessage;
|
2018-06-14 12:38:37 +03:00
|
|
|
namehash: typeof namehash;
|
|
|
|
id: typeof id;
|
|
|
|
getAddress: typeof getAddress;
|
2018-06-17 23:32:57 +03:00
|
|
|
getIcapAddress: typeof getIcapAddress;
|
2018-06-14 12:38:37 +03:00
|
|
|
getContractAddress: typeof getContractAddress;
|
|
|
|
formatEther: typeof units.formatEther;
|
|
|
|
parseEther: typeof units.parseEther;
|
|
|
|
formatUnits: typeof units.formatUnits;
|
|
|
|
parseUnits: typeof units.parseUnits;
|
|
|
|
keccak256: typeof keccak256;
|
|
|
|
sha256: typeof sha2.sha256;
|
|
|
|
randomBytes: typeof randomBytes;
|
|
|
|
solidityPack: typeof solidity.pack;
|
|
|
|
solidityKeccak256: typeof solidity.keccak256;
|
|
|
|
soliditySha256: typeof solidity.sha256;
|
2018-06-17 23:47:28 +03:00
|
|
|
splitSignature: typeof bytes.splitSignature;
|
2018-06-18 12:42:41 +03:00
|
|
|
joinSignature: typeof bytes.joinSignature;
|
2018-06-17 23:32:57 +03:00
|
|
|
parseTransaction: typeof parseTransaction;
|
2018-06-14 12:38:37 +03:00
|
|
|
};
|
|
|
|
export default _default;
|
|
|
|
}
|
|
|
|
declare module "wallet/index" {
|
|
|
|
import { Wallet } from "wallet/wallet";
|
|
|
|
import * as HDNode from "wallet/hdnode";
|
|
|
|
import { SigningKey } from "wallet/signing-key";
|
|
|
|
export { HDNode, SigningKey, Wallet };
|
|
|
|
}
|
|
|
|
declare module "index" {
|
|
|
|
import { Contract, Interface } from "contracts/index";
|
|
|
|
import * as providers from "providers/index";
|
|
|
|
import * as errors from "utils/errors";
|
2018-06-18 12:42:41 +03:00
|
|
|
import { getNetwork } from "providers/networks";
|
2018-06-14 12:38:37 +03:00
|
|
|
import utils from "utils/index";
|
|
|
|
import { HDNode, SigningKey, Wallet } from "wallet/index";
|
2018-06-18 12:42:41 +03:00
|
|
|
export { Wallet, HDNode, SigningKey, Contract, Interface, getNetwork, providers, errors, utils, };
|
2018-06-14 12:38:37 +03:00
|
|
|
}
|
|
|
|
//# sourceMappingURL=ethers.d.ts.map
|