1 | export interface ABIDefinition {
|
2 | constant?: boolean;
|
3 | payable?: boolean;
|
4 | anonymous?: boolean;
|
5 | inputs?: Array<{ name: string; type: ABIDataTypes; indexed?: boolean }>;
|
6 | name?: string;
|
7 | outputs?: Array<{ name: string; type: ABIDataTypes }>;
|
8 | type: "function" | "constructor" | "event" | "fallback";
|
9 | }
|
10 |
|
11 | type ABIDataTypes = "uint256" | "boolean" | "string" | "bytes" | string;
|
12 |
|
13 | export default interface ABI {
|
14 | decodeLog(inputs: object, hexString: string, topics: string[]): object;
|
15 | encodeParameter(type: string, parameter: any): string;
|
16 | encodeParameters(types: string[], paramaters: any[]): string;
|
17 | encodeEventSignature(name: string | object): string;
|
18 | encodeFunctionCall(jsonInterface: object, parameters: any[]): string;
|
19 | encodeFunctionSignature(name: string | object): string;
|
20 | decodeParameter(type: string, hex: string): any;
|
21 | decodeParameters(
|
22 | types: string[],
|
23 | hex: string
|
24 | ): EthAbiDecodeParametersResultArray;
|
25 | decodeParameters(
|
26 | types: EthAbiDecodeParametersType[],
|
27 | hex: string
|
28 | ): EthAbiDecodeParametersResultObject;
|
29 | }
|
30 |
|
31 | interface EthAbiDecodeParametersType {
|
32 | name: string;
|
33 | type: string;
|
34 | }
|
35 | interface EthAbiDecodeParametersResultArray {
|
36 | [index: number]: any;
|
37 | }
|
38 | type EthAbiDecodeParametersResultObject = EthAbiDecodeParametersResultArray & {
|
39 | [key: string]: any;
|
40 | };
|