-
Notifications
You must be signed in to change notification settings - Fork 26
/
types.ts
120 lines (100 loc) · 2.49 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import { SingleValue } from "chakra-react-select";
import { JsonFragmentType, TransactionDescription } from "ethers";
export interface SelectedOption {
label: string;
value: number | string | boolean;
}
export type SelectedOptionState = SingleValue<SelectedOption>;
export interface ExplorersData {
[label: string]: ExplorerData;
}
export interface ExplorerData {
urlLayout: string;
chainIdToLabel: { [chainId: number]: string };
// some explorer favicons don't automatically work via gstatic
faviconUrl?: string;
// some icons can be entirely white in color, which would require the background color to change from white
faviconWhite?: boolean;
forContracts?: boolean;
}
export enum ExplorerType {
ADDRESS,
TX,
}
export interface ILeaderboard {
_id: string;
lastBlockNumber: number;
totalUSDAmount: number;
donorsCount: number;
topDonorsWithEns: { address: string; ens: string; usdAmount: number }[];
}
export type DecodeBytesParamResult = {
decoded: DecodeRecursiveResult;
};
export type DecodeTupleParamResult =
| {
name: string;
baseType: string;
type: string;
rawValue: any;
value: DecodeParamTypesResult;
}[]
| null;
export type DecodeArrayParamResult =
| {
name: string;
baseType: string;
type: string;
rawValue: any;
value: DecodeParamTypesResult;
}[];
export interface ParsedTransaction extends TransactionDescription {
txType?: "safeMultiSend";
}
export type DecodeParamTypesResult =
| string
| DecodeBytesParamResult
| DecodeTupleParamResult
| DecodeArrayParamResult;
export type Arg = {
name: string;
baseType: string;
type: string;
rawValue: any;
value: DecodeParamTypesResult;
};
export type DecodeRecursiveResult = {
functionName: string;
signature: string;
rawArgs: any;
args: Arg[];
} | null;
export type HighlightedText = {
text: string;
isHighlighted: boolean;
isCurrentResult: boolean;
};
export type HighlightedContent = string | HighlightedText[];
export interface ExtendedJsonFragmentType
extends Omit<JsonFragmentType, "name"> {
name?: HighlightedContent;
}
export interface SourceCode {
sources: Record<string, { content: string }>;
}
export interface ContractResult {
SourceCode: string;
ContractName: string;
ABI: string;
Implementation: string;
}
export interface ContractResponse {
status: string;
message: string;
result: ContractResult[];
}
export interface EVMParameter {
type: string;
name?: string;
components?: EVMParameter[];
}