UNPKG

1.59 kBTypeScriptView Raw
1import { ContractAbi, DataItem, MethodAbi } from 'ethereum-types';
2declare type ParamName = null | string | NestedParamName;
3interface NestedParamName {
4 name: string | null;
5 names: ParamName[];
6}
7declare function parseEthersParams(params: DataItem[]): {
8 names: ParamName[];
9 types: string[];
10};
11declare function isAbiDataEqual(name: ParamName, type: string, x: any, y: any): boolean;
12declare function splitTupleTypes(type: string): string[];
13export declare const abiUtils: {
14 parseEthersParams: typeof parseEthersParams;
15 isAbiDataEqual: typeof isAbiDataEqual;
16 splitTupleTypes: typeof splitTupleTypes;
17 parseFunctionParam(param: DataItem): string;
18 getFunctionSignature(methodAbi: MethodAbi): string;
19 /**
20 * Solidity supports function overloading whereas TypeScript does not.
21 * See: https://solidity.readthedocs.io/en/v0.4.21/contracts.html?highlight=overload#function-overloading
22 * In order to support overloaded functions, we suffix overloaded function names with an index.
23 * This index should be deterministic, regardless of function ordering within the smart contract. To do so,
24 * we assign indexes based on the alphabetical order of function signatures.
25 *
26 * E.g
27 * ['f(uint)', 'f(uint,byte32)']
28 * Should always be renamed to:
29 * ['f1(uint)', 'f2(uint,byte32)']
30 * Regardless of the order in which these these overloaded functions are declared within the contract ABI.
31 */
32 renameOverloadedMethods(inputContractAbi: ContractAbi): ContractAbi;
33};
34export {};
35//# sourceMappingURL=abi_utils.d.ts.map
\No newline at end of file