How can i get transaction information by hash

I user eth_getTransactionByHash and eth_getTransactionReceipt to get information, but the response do not have message like " From 0x6748f50f686bfbca6fe8ad62b22228b87f31ff2bTo 0x39db096e741b4991529e986530f601b13bb84859For 980 ($984.22) " , the response only have the from address, not have the to address and the number. Any one can help me?

Hi @liuminert can you provide us with the Transaction Hash you’re using when forming your request?

0xc6eee520d8634c5426bd9f1040a8fc3dc3a4b0665d037bbae3e863b61e3bee0a

I user web3j to request.

Hi @liuminert , for web3j, I’m looking at https://web3j.readthedocs.io/en/latest/transactions.html and seeing that you can get the Receipt if you have the transaction hash

Optional<TransactionReceipt> transactionReceipt = 
    web3j.ethGetTransactionReceipt(txHash).send().getTransactionReceipt();

Also, if you’re asking about the input data to a transaction, you can use web3j.ethGetTransactionByHash to get the transaction object as specified in the Ethereum JSON RPC specs (github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionbyhash). It includes an input variable.

Thank you for your reply ! I transfer some usdt from one address to another address, i need the from address , to address and the transfer quantity. I tried it in two ways , eth_getTransactionReceipt and eth_getTransactionByHash, the from address is ok , the to address is contract address, there is No transfer quantity. How can i get the transfer quanity?

In addition, i use eth_getBlockByHash to get the block, but the result is null. why is that?

I have get the transfer result ,thank you for the help.
But eth_getBlockByHash still can’t work.

Hi @liuminert can you provide your code where you are generating these requests and the full response you are receiving?

Now there’s only one question , i use Postman to request , url is “https://mainnet.infura.io/v3/39bb15350b7e43338163d1e9ff618853”, body is “{“jsonrpc”:“2.0”, “id”:1, “method”:“eth_getBlockByHash”, “params”:[“0xc6eee520d8634c5426bd9f1040a8fc3dc3a4b0665d037bbae3e863b61e3bee0a”,false]}”, and the response is “{
“jsonrpc”: “2.0”,
“id”: 1,
“result”: null
}”