Consensys / abi-decoder

Nodejs and Javascript library for decoding data params and events from ethereum transactions
GNU General Public License v3.0
633 stars 218 forks source link

Receiving undefined decode input from transacation #90

Open CovalentBond opened 1 year ago

CovalentBond commented 1 year ago

Hi, I am trying to decode input from transaction that I receive:

{
  from: '0x1987d1c15d95cab34c154ede0a4c3bf7dba5c287',
  input: '0xa9059cbb0000000000000000000000001987d1c15d95cab34c154ede0a4c3bf7dba5c287000000000000000000000000000000000000000000000000002386f26fc10000',
  to: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063',
}

The code looks like:

abiDecoder.addABI(ABI);
const decodedData = abiDecoder.decodeMethod("0xa9059cbb0000000000000000000000001987d1c15d95cab34c154ede0a4c3bf7dba5c287000000000000000000000000000000000000000000000000002386f26fc10000");
console.log(decodedData);

But this is returning undefined.

Any thing that I am missing.

sreyom31 commented 1 year ago

Hey @CovalentBond did you find any solution to this even I am facing the same issue?

longganggang commented 1 year ago

You can try to check the ABI.Especially the data type