UNPKG

2.82 kBTypeScriptView Raw
1import { Provider, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
2import { Signer, TypedDataDomain, TypedDataField, TypedDataSigner } from "@ethersproject/abstract-signer";
3import { Bytes } from "@ethersproject/bytes";
4import { Network, Networkish } from "@ethersproject/networks";
5import { Deferrable } from "@ethersproject/properties";
6import { AccessList } from "@ethersproject/transactions";
7import { ConnectionInfo } from "@ethersproject/web";
8import { BaseProvider, Event } from "./base-provider";
9export declare class JsonRpcSigner extends Signer implements TypedDataSigner {
10 readonly provider: JsonRpcProvider;
11 _index: number;
12 _address: string;
13 constructor(constructorGuard: any, provider: JsonRpcProvider, addressOrIndex?: string | number);
14 connect(provider: Provider): JsonRpcSigner;
15 connectUnchecked(): JsonRpcSigner;
16 getAddress(): Promise<string>;
17 sendUncheckedTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
18 signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
19 sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
20 signMessage(message: Bytes | string): Promise<string>;
21 _legacySignMessage(message: Bytes | string): Promise<string>;
22 _signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
23 unlock(password: string): Promise<boolean>;
24}
25declare class UncheckedJsonRpcSigner extends JsonRpcSigner {
26 sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
27}
28export declare class JsonRpcProvider extends BaseProvider {
29 readonly connection: ConnectionInfo;
30 _pendingFilter: Promise<number>;
31 _nextId: number;
32 _eventLoopCache: Record<string, Promise<any>>;
33 get _cache(): Record<string, Promise<any>>;
34 constructor(url?: ConnectionInfo | string, network?: Networkish);
35 static defaultUrl(): string;
36 detectNetwork(): Promise<Network>;
37 _uncachedDetectNetwork(): Promise<Network>;
38 getSigner(addressOrIndex?: string | number): JsonRpcSigner;
39 getUncheckedSigner(addressOrIndex?: string | number): UncheckedJsonRpcSigner;
40 listAccounts(): Promise<Array<string>>;
41 send(method: string, params: Array<any>): Promise<any>;
42 prepareRequest(method: string, params: any): [string, Array<any>];
43 perform(method: string, params: any): Promise<any>;
44 _startEvent(event: Event): void;
45 _startPending(): void;
46 _stopEvent(event: Event): void;
47 static hexlifyTransaction(transaction: TransactionRequest, allowExtra?: {
48 [key: string]: boolean;
49 }): {
50 [key: string]: string | AccessList;
51 };
52}
53export {};
54//# sourceMappingURL=json-rpc-provider.d.ts.map
\No newline at end of file