ethers.js/packages/providers/lib/json-rpc-provider.d.ts
2021-01-19 05:22:54 -05:00

49 lines
2.5 KiB
TypeScript

import { Provider, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
import { Signer, TypedDataDomain, TypedDataField, TypedDataSigner } from "@ethersproject/abstract-signer";
import { Bytes } from "@ethersproject/bytes";
import { Network, Networkish } from "@ethersproject/networks";
import { Deferrable } from "@ethersproject/properties";
import { ConnectionInfo } from "@ethersproject/web";
import { BaseProvider, Event } from "./base-provider";
export declare class JsonRpcSigner extends Signer implements TypedDataSigner {
readonly provider: JsonRpcProvider;
_index: number;
_address: string;
constructor(constructorGuard: any, provider: JsonRpcProvider, addressOrIndex?: string | number);
connect(provider: Provider): JsonRpcSigner;
connectUnchecked(): JsonRpcSigner;
getAddress(): Promise<string>;
sendUncheckedTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
signMessage(message: Bytes | string): Promise<string>;
_signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
unlock(password: string): Promise<boolean>;
}
declare class UncheckedJsonRpcSigner extends JsonRpcSigner {
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
}
export declare class JsonRpcProvider extends BaseProvider {
readonly connection: ConnectionInfo;
_pendingFilter: Promise<number>;
_nextId: number;
constructor(url?: ConnectionInfo | string, network?: Networkish);
static defaultUrl(): string;
detectNetwork(): Promise<Network>;
getSigner(addressOrIndex?: string | number): JsonRpcSigner;
getUncheckedSigner(addressOrIndex?: string | number): UncheckedJsonRpcSigner;
listAccounts(): Promise<Array<string>>;
send(method: string, params: Array<any>): Promise<any>;
prepareRequest(method: string, params: any): [string, Array<any>];
perform(method: string, params: any): Promise<any>;
_startEvent(event: Event): void;
_startPending(): void;
_stopEvent(event: Event): void;
static hexlifyTransaction(transaction: TransactionRequest, allowExtra?: {
[key: string]: boolean;
}): {
[key: string]: string;
};
}
export {};
//# sourceMappingURL=json-rpc-provider.d.ts.map