1

使用 Web3j 不是 Web3js,如何获取使用事务哈希传输的令牌的值?

4

1 回答 1

0

我为 web3j 找到了这个例子:

String transactionHash = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
TransactionReceipt transReceipt = web3j.ethGetTransactionReceipt(transactionHash).send().getTransactionReceipt();
Transaction transaction = ethTransaction.getResult();
int size = tokenImpl.getTransferEvents(transReceipt).size();
size = size -1;
BigInteger valueTransaction = tokenImpl.getTransferEvents(transReceipt).get(size).value;

该值将在 BigInteger 中收到

于 2021-06-08T13:26:41.377 回答