Search in sources :

Example 1 with Status

use of com.asf.appcoins.sdk.iab.entity.Transaction.Status in project AppCoins-ethereumj by AppStoreFoundation.

the class TransactionFactory method fromEthGetTransactionReceipt.

public static Transaction fromEthGetTransactionReceipt(EthGetTransactionReceipt ethGetTransactionReceipt) {
    TransactionReceipt transactionReceipt = ethGetTransactionReceipt.getTransactionReceipt();
    String hash = transactionReceipt.getTransactionHash();
    String from = transactionReceipt.getFrom();
    Log log = transactionReceipt.getLogs().get(0);
    String to = log.getAddress();
    String value = extractValueFromEthGetTransactionReceipt(log.getData());
    Status status = parseStatus(transactionReceipt.getStatus());
    String contractAddress = ethGetTransactionReceipt.getTransactionReceipt().getTo();
    return new Transaction(hash, from, to, value, status);
}
Also used : Status(com.asf.appcoins.sdk.iab.entity.Transaction.Status) EthTransaction(org.web3j.protocol.core.methods.response.EthTransaction) Transaction(com.asf.appcoins.sdk.iab.entity.Transaction) Log(org.web3j.protocol.core.methods.response.Log) TransactionReceipt(org.web3j.protocol.core.methods.response.TransactionReceipt) EthGetTransactionReceipt(org.web3j.protocol.core.methods.response.EthGetTransactionReceipt)

Aggregations

Transaction (com.asf.appcoins.sdk.iab.entity.Transaction)1 Status (com.asf.appcoins.sdk.iab.entity.Transaction.Status)1 EthGetTransactionReceipt (org.web3j.protocol.core.methods.response.EthGetTransactionReceipt)1 EthTransaction (org.web3j.protocol.core.methods.response.EthTransaction)1 Log (org.web3j.protocol.core.methods.response.Log)1 TransactionReceipt (org.web3j.protocol.core.methods.response.TransactionReceipt)1