1 | import { AbiDefinition, DecodedLogArgs, LogEntry, LogWithDecodedArgs, RawLog } from 'ethereum-types';
|
2 | import { DecodedCalldata } from './types';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export declare class AbiDecoder {
|
8 | private readonly _eventIds;
|
9 | private readonly _selectorToFunctionInfo;
|
10 | |
11 |
|
12 |
|
13 |
|
14 |
|
15 | private static _getFunctionSelector;
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 | constructor(abiArrays: AbiDefinition[][]);
|
22 | /**
|
23 | * Attempt to decode a log given the ABI's the AbiDecoder knows about.
|
24 | * @param log The log to attempt to decode
|
25 | * @return The decoded log if the requisite ABI was available. Otherwise the log unaltered.
|
26 | */
|
27 | tryToDecodeLogOrNoop<ArgsType extends DecodedLogArgs>(log: LogEntry): LogWithDecodedArgs<ArgsType> | RawLog;
|
28 | /**
|
29 | * Decodes calldata for a known ABI.
|
30 | * @param calldata hex-encoded calldata.
|
31 | * @param contractName used to disambiguate similar ABI's (optional).
|
32 | * @return Decoded calldata. Includes: function name and signature, along with the decoded arguments.
|
33 | */
|
34 | decodeCalldataOrThrow(calldata: string, contractName?: string): DecodedCalldata;
|
35 | /**
|
36 | * Adds a set of ABI definitions, after which calldata and logs targeting these ABI's can be decoded.
|
37 | * Additional properties can be included to disambiguate similar ABI's. For example, if two functions
|
38 | * have the same signature but different parameter names, then their ABI definitions can be disambiguated
|
39 | * by specifying a contract name.
|
40 | * @param abiDefinitions ABI definitions for a given contract.
|
41 | * @param contractName Name of contract that encapsulates the ABI definitions (optional).
|
42 | * This can be used when decoding calldata to disambiguate methods with
|
43 | * the same signature but different parameter names.
|
44 | */
|
45 | addABI(abiArray: AbiDefinition[], contractName?: string): void;
|
46 | private _addEventABI;
|
47 | private _addMethodABI;
|
48 | }
|
49 | //# sourceMappingURL=abi_decoder.d.ts.map |
\ | No newline at end of file |