-
Notifications
You must be signed in to change notification settings - Fork 482
/
Copy pathindex.d.ts
156 lines (150 loc) · 3.52 KB
/
index.d.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
declare module 'solc' {
export type Primitive =
'bool' |
'string' |
'address' |
'uint8' |
'uint16' |
'uint32' |
'uint64' |
'uint128' |
'uint256' |
'int8' |
'int16' |
'int32' |
'int64' |
'int128' |
'int256' |
'bytes' |
'bytes20' |
'bytes32' |
'bool[]' |
'string[]' |
'address[]' |
'uint8[]' |
'uint16[]' |
'uint32[]' |
'uint64[]' |
'uint128[]' |
'uint256[]' |
'int8[]' |
'int16[]' |
'int32[]' |
'int64[]' |
'int128[]' |
'int256[]' |
'bytes[]' |
'bytes20[]' |
'bytes32[]';
export interface AbiParameter {
name: string,
type: Primitive,
}
export interface AbiEventParameter extends AbiParameter {
indexed: boolean,
}
export interface AbiFunction {
name: string,
type: 'function' | 'constructor' | 'fallback',
stateMutability: 'pure' | 'view' | 'payable' | 'nonpayable',
constant: boolean,
payable: boolean,
inputs: Array<AbiParameter>,
outputs: Array<AbiParameter>,
}
export interface AbiEvent {
name: string,
type: 'event',
inputs: Array<AbiEventParameter>,
anonymous: boolean,
}
export type Abi = Array<AbiFunction | AbiEvent>;
interface CompilerInputSourceFile {
keccak256?: string;
urls: string[];
}
interface CompilerInputSourceCode {
keccak256?: string;
content: string;
}
interface CompilerInput {
language: "Solidity" | "serpent" | "lll" | "assembly";
settings?: any,
sources: {
[globalName: string]: CompilerInputSourceFile|CompilerInputSourceCode,
};
}
interface CompilerOutputError {
sourceLocation?: {
file: string;
start: number;
end: number;
};
type: "TypeError" | "InternalCompilerError" | "Exception";
component: "general" | "ewasm";
severity: "error" | "warning";
message: string;
formattedMessage?: string;
}
interface CompilerOutputEvmBytecode {
object?: string;
opcodes?: string;
sourceMap?: string;
linkReferences?: {} | {
[globalName: string]: {
[name: string]: {start: number, length: number}[];
};
};
}
interface CompilerOutputSources {
[globalName: string]: {
id: number;
ast?: any;
legacyAST?: any;
},
}
interface CompilerOutputContracts {
[globalName: string]: {
[contractName: string]: {
abi?: Abi;
metadata?: string;
userdoc?: any;
devdoc?: any;
ir?: string;
evm?: {
assembly?: string;
legacyAssembly?: any;
bytecode: CompilerOutputEvmBytecode;
deployedBytecode?: CompilerOutputEvmBytecode;
methodIdentifiers?: {
[methodName: string]: string;
};
gasEstimates?: {
creation: {
codeDepositCost: string;
executionCost: string;
totalCost: string;
};
external: {
[functionSignature: string]: string;
};
internal: {
[functionSignature: string]: string;
};
};
};
ewasm: {
wast?: string;
wasm?: string;
}
}
};
}
interface CompilerOutput {
errors: CompilerOutputError[];
sources: CompilerOutputSources;
contracts: CompilerOutputContracts;
}
type ReadCallback = (path: string) => { contents?: string, error?: string};
function compileStandardWrapper(input: string, readCallback?: ReadCallback): string;
}