UNPKG

1.39 kBTypeScriptView Raw
1/*
2 This file is part of confluxWeb.
3 confluxWeb is free software: you can redistribute it and/or modify
4 it under the terms of the GNU Lesser General Public License as published by
5 the Free Software Foundation, either version 3 of the License, or
6 (at your option) any later version.
7 confluxWeb is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU Lesser General Public License for more details.
11 You should have received a copy of the GNU Lesser General Public License
12 along with confluxWeb. If not, see <http://www.gnu.org/licenses/>.
13*/
14
15import {AbiInput, AbiItem} from 'conflux-web-utils';
16
17export class AbiCoder {
18 encodeFunctionSignature(functionName: string | AbiItem): string;
19
20 encodeEventSignature(functionName: string | AbiItem): string;
21
22 encodeParameter(type: string | {}, parameter: any): string;
23
24 encodeParameters(types: Array<string | {}>, paramaters: any[]): string;
25
26 encodeFunctionCall(abiItem: AbiItem, params: string[]): string;
27
28 decodeParameter(type: string | {}, hex: string): {[key: string]: any;};
29
30 decodeParameters(types: Array<string | {}>, hex: string): {[key: string]: any;};
31
32 decodeLog(inputs: AbiInput[], hex: string, topics: string[]): {[key: string]: string;};
33}