ethers.js/packages/providers/lib.esm/json-rpc-provider.d.ts

48 lines
2.2 KiB
TypeScript
Raw Permalink Normal View History

2019-05-14 18:48:48 -04:00
import { Provider, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
import { Signer } from "@ethersproject/abstract-signer";
import { Bytes } from "@ethersproject/bytes";
2020-05-03 17:53:58 -04:00
import { Network, Networkish } from "@ethersproject/networks";
2020-06-01 05:04:12 -04:00
import { Deferrable } from "@ethersproject/properties";
2019-05-14 18:48:48 -04:00
import { ConnectionInfo } from "@ethersproject/web";
2020-03-12 19:14:50 +01:00
import { BaseProvider, Event } from "./base-provider";
2019-05-14 18:48:48 -04:00
export declare class JsonRpcSigner extends Signer {
readonly provider: JsonRpcProvider;
_index: number;
_address: string;
constructor(constructorGuard: any, provider: JsonRpcProvider, addressOrIndex?: string | number);
connect(provider: Provider): JsonRpcSigner;
connectUnchecked(): JsonRpcSigner;
getAddress(): Promise<string>;
2020-06-01 05:04:12 -04:00
sendUncheckedTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
2019-05-14 18:48:48 -04:00
signMessage(message: Bytes | string): Promise<string>;
unlock(password: string): Promise<boolean>;
}
declare class UncheckedJsonRpcSigner extends JsonRpcSigner {
2020-06-01 05:04:12 -04:00
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
2019-05-14 18:48:48 -04:00
}
export declare class JsonRpcProvider extends BaseProvider {
readonly connection: ConnectionInfo;
_pendingFilter: Promise<number>;
2019-05-24 18:15:42 -04:00
_nextId: number;
2019-05-14 18:48:48 -04:00
constructor(url?: ConnectionInfo | string, network?: Networkish);
2020-03-12 19:14:50 +01:00
static defaultUrl(): string;
2020-05-03 17:53:58 -04:00
detectNetwork(): Promise<Network>;
2019-05-14 18:48:48 -04:00
getSigner(addressOrIndex?: string | number): JsonRpcSigner;
getUncheckedSigner(addressOrIndex?: string | number): UncheckedJsonRpcSigner;
listAccounts(): Promise<Array<string>>;
2020-02-10 15:51:58 -05:00
send(method: string, params: Array<any>): Promise<any>;
2020-03-21 12:48:22 -04:00
prepareRequest(method: string, params: any): [string, Array<any>];
2019-05-14 18:48:48 -04:00
perform(method: string, params: any): Promise<any>;
2020-03-12 19:14:50 +01:00
_startEvent(event: Event): void;
2019-05-14 18:48:48 -04:00
_startPending(): void;
2020-03-12 19:14:50 +01:00
_stopEvent(event: Event): void;
2019-05-14 18:48:48 -04:00
static hexlifyTransaction(transaction: TransactionRequest, allowExtra?: {
[key: string]: boolean;
}): {
[key: string]: string;
};
}
export {};