ethers.js/packages/cli/lib/cli.d.ts

83 lines
3.0 KiB
TypeScript
Raw Permalink Normal View History

2019-05-14 18:48:48 -04:00
import { ethers } from "ethers";
export declare function dump(header: string, info: any): void;
declare class WrappedSigner extends ethers.Signer {
readonly addressPromise: Promise<string>;
readonly provider: ethers.providers.Provider;
readonly plugin: Plugin;
constructor(addressPromise: Promise<string>, signerFunc: () => Promise<ethers.Signer>, plugin: Plugin);
connect(provider?: ethers.providers.Provider): ethers.Signer;
getAddress(): Promise<string>;
signMessage(message: string | ethers.utils.Bytes): Promise<string>;
2019-07-02 16:13:03 -04:00
populateTransaction(transactionRequest: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionRequest>;
2019-05-14 18:48:48 -04:00
signTransaction(transactionRequest: ethers.providers.TransactionRequest): Promise<string>;
sendTransaction(transactionRequest: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;
unlock(): Promise<void>;
}
export declare class ArgParser {
readonly _args: Array<string>;
readonly _consumed: Array<boolean>;
constructor(args: Array<string>);
_finalizeArgs(): Array<string>;
_checkCommandIndex(): number;
consumeFlag(name: string): boolean;
consumeMultiOptions(names: Array<string>): Array<{
name: string;
value: string;
}>;
consumeOptions(name: string): Array<string>;
consumeOption(name: string): string;
}
export interface Help {
name: string;
help: string;
}
export interface PluginType {
new (...args: any[]): Plugin;
getHelp?: () => Help;
getOptionHelp?: () => Array<Help>;
}
2019-07-27 19:02:24 -03:00
export declare abstract class Plugin {
2019-05-14 18:48:48 -04:00
network: ethers.providers.Network;
provider: ethers.providers.Provider;
2020-02-06 18:21:34 -05:00
accounts: ReadonlyArray<WrappedSigner>;
2019-07-02 16:13:03 -04:00
mnemonicPassword: boolean;
2021-05-17 16:19:36 -04:00
mnemonicPath: string;
2019-07-20 20:13:00 -03:00
_xxxMnemonicPasswordHard: boolean;
2019-05-14 18:48:48 -04:00
gasLimit: ethers.BigNumber;
gasPrice: ethers.BigNumber;
nonce: number;
yes: boolean;
2019-08-05 14:31:04 -04:00
wait: boolean;
2019-05-14 18:48:48 -04:00
constructor();
static getHelp(): Help;
static getOptionHelp(): Array<Help>;
2020-01-09 03:32:50 -05:00
prepareOptions(argParser: ArgParser, verifyOnly?: boolean): Promise<void>;
2019-05-14 18:48:48 -04:00
prepareArgs(args: Array<string>): Promise<void>;
run(): Promise<void>;
getAddress(addressOrName: string, message?: string, allowZero?: boolean): Promise<string>;
2019-07-27 19:02:24 -03:00
dump(header: string, info: any): void;
2019-05-14 18:48:48 -04:00
throwUsageError(message?: string): never;
throwError(message: string): never;
}
2019-07-27 19:02:24 -03:00
export declare type Options = {
account?: boolean;
provider?: boolean;
transaction?: boolean;
2019-08-05 14:31:04 -04:00
version?: string;
2019-07-27 19:02:24 -03:00
};
2019-05-14 18:48:48 -04:00
export declare class CLI {
readonly defaultCommand: string;
readonly plugins: {
[command: string]: PluginType;
};
2019-07-27 19:02:24 -03:00
readonly standAlone: PluginType;
readonly options: Options;
constructor(defaultCommand?: string, options?: Options);
static getAppName(): string;
2019-05-14 18:48:48 -04:00
addPlugin(command: string, plugin: PluginType): void;
2019-07-27 19:02:24 -03:00
setPlugin(plugin: PluginType): void;
2019-05-14 18:48:48 -04:00
showUsage(message?: string, status?: number): never;
run(args: Array<string>): Promise<void>;
}
export {};
//# sourceMappingURL=cli.d.ts.map