2018-07-31 01:59:52 +03:00
|
|
|
import { HDNode } from './hdnode';
|
2018-07-24 02:21:42 +03:00
|
|
|
import { SigningKey } from './signing-key';
|
2018-07-31 01:59:52 +03:00
|
|
|
import { BigNumber } from '../utils/bignumber';
|
|
|
|
import { Wordlist } from '../wordlists/wordlist';
|
|
|
|
import { Signer as AbstractSigner } from './abstract-signer';
|
|
|
|
import { Provider } from '../providers/abstract-provider';
|
|
|
|
import { ProgressCallback } from './secret-storage';
|
|
|
|
import { Arrayish } from '../utils/bytes';
|
|
|
|
import { BlockTag, TransactionRequest, TransactionResponse } from '../providers/abstract-provider';
|
|
|
|
export declare class Wallet extends AbstractSigner {
|
|
|
|
readonly provider: Provider;
|
2018-07-24 02:21:42 +03:00
|
|
|
private readonly signingKey;
|
2018-07-31 01:59:52 +03:00
|
|
|
constructor(privateKey: SigningKey | HDNode | Arrayish, provider?: Provider);
|
2018-07-24 02:21:42 +03:00
|
|
|
readonly address: string;
|
|
|
|
readonly mnemonic: string;
|
|
|
|
readonly path: string;
|
|
|
|
readonly privateKey: string;
|
|
|
|
/**
|
|
|
|
* Create a new instance of this Wallet connected to provider.
|
|
|
|
*/
|
2018-07-31 01:59:52 +03:00
|
|
|
connect(provider: Provider): Wallet;
|
2018-07-24 02:21:42 +03:00
|
|
|
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>;
|
2018-08-05 02:40:06 +03:00
|
|
|
encrypt(password: Arrayish | string, options?: any, progressCallback?: ProgressCallback): Promise<string>;
|
2018-07-24 02:21:42 +03:00
|
|
|
/**
|
|
|
|
* Static methods to create Wallet instances.
|
|
|
|
*/
|
|
|
|
static createRandom(options?: any): Wallet;
|
|
|
|
static fromEncryptedJson(json: string, password: Arrayish, progressCallback: ProgressCallback): Promise<Wallet>;
|
|
|
|
static fromMnemonic(mnemonic: string, path?: string, wordlist?: Wordlist): Wallet;
|
|
|
|
}
|