Skip to main content



  • decodeLog<ReturnType>(inputs: AbiParameter[], data: string, topics: string | string[]): ReturnType

  • Decodes ABI-encoded log data and indexed topic data.

    let res = web3.eth.abi.decodeLog(
    type: "string",
    name: "myString",
    type: "uint256",
    name: "myNumber",
    indexed: true,
    type: "uint8",
    name: "mySmallNumber",
    indexed: true,
    > {
    '0': 'Hello%!',
    '1': 62224n,
    '2': 16n,
    __length__: 3,
    myString: 'Hello%!',
    myNumber: 62224n,
    mySmallNumber: 16n

    Type parameters


    • inputs: AbiParameter[]

      A AbiParameter input array. See the Solidity documentation for a list of types.

    • data: string

      The ABI byte code in the data field of a log.

    • topics: string | string[]

      An array with the index parameter topics of the log, without the topic[0] if its a non-anonymous event, otherwise with topic[0]

    Returns ReturnType

    • The result object containing the decoded parameters.