UNPKG

2.32 kBTypeScriptView Raw
1import { Block, TransactionReceipt, TransactionResponse } from "@ethersproject/abstract-provider";
2import { BigNumber } from "@ethersproject/bignumber";
3import { AccessList } from "@ethersproject/transactions";
4export declare type FormatFunc = (value: any) => any;
5export declare type FormatFuncs = {
6 [key: string]: FormatFunc;
7};
8export declare type Formats = {
9 transaction: FormatFuncs;
10 transactionRequest: FormatFuncs;
11 receipt: FormatFuncs;
12 receiptLog: FormatFuncs;
13 block: FormatFuncs;
14 blockWithTransactions: FormatFuncs;
15 filter: FormatFuncs;
16 filterLog: FormatFuncs;
17};
18export declare class Formatter {
19 readonly formats: Formats;
20 constructor();
21 getDefaultFormats(): Formats;
22 accessList(accessList: Array<any>): AccessList;
23 number(number: any): number;
24 type(number: any): number;
25 bigNumber(value: any): BigNumber;
26 boolean(value: any): boolean;
27 hex(value: any, strict?: boolean): string;
28 data(value: any, strict?: boolean): string;
29 address(value: any): string;
30 callAddress(value: any): string;
31 contractAddress(value: any): string;
32 blockTag(blockTag: any): string;
33 hash(value: any, strict?: boolean): string;
34 difficulty(value: any): number;
35 uint256(value: any): string;
36 _block(value: any, format: any): Block;
37 block(value: any): Block;
38 blockWithTransactions(value: any): Block;
39 transactionRequest(value: any): any;
40 transactionResponse(transaction: any): TransactionResponse;
41 transaction(value: any): any;
42 receiptLog(value: any): any;
43 receipt(value: any): TransactionReceipt;
44 topics(value: any): any;
45 filter(value: any): any;
46 filterLog(value: any): any;
47 static check(format: {
48 [name: string]: FormatFunc;
49 }, object: any): any;
50 static allowNull(format: FormatFunc, nullValue?: any): FormatFunc;
51 static allowFalsish(format: FormatFunc, replaceValue: any): FormatFunc;
52 static arrayOf(format: FormatFunc): FormatFunc;
53}
54export interface CommunityResourcable {
55 isCommunityResource(): boolean;
56}
57export declare function isCommunityResourcable(value: any): value is CommunityResourcable;
58export declare function isCommunityResource(value: any): boolean;
59export declare function showThrottleMessage(): void;
60//# sourceMappingURL=formatter.d.ts.map
\No newline at end of file