[Ethereum] Provided address is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can’t be converted

transactionsweb3js

Here is my transaction from ethereum.

transaction is shown as followed

{
    blockNumber:12,
    contractAddress:null,
    cumulativeGasUsed:22977,
    gasUsed:22977,
    status:1,
    transactionIndex:0,
tx:"0x92c1ec18a97bce88fca9649711280ec84241cd230ffa5dc51485a6637b238fc0"

}

Using the code below gives me a error,

var count = web3.eth.getTransactionCount(tx);


Error: Provided address "0x92c1ec18a97bce88fca9649711280ec84241cd230ffa5dc51485a6637b238fc0" 
is invalid, the capitalization checksum test failed, or its an indrect 
IBAN address which can't be converted.

update
I changed the transaction hash to the eth address, the call returns me

{
    _bitField:33554432
    _fulfillmentHandler0:undefined
    _promise0:undefined
    _receiver0:undefined
    _rejectionHandler0:155
}

instead of the count value

what is the problem?

Best Answer

txin your example is the transaction hash. Function getTransactionCount(...), however, needs an account as parameter.This is what is recognized, therefore the error.

If you want to get more information on the transaction, use web3.eth.getTransaction(tx). Here, tx has to be the transaction hash.

Related Topic