|
8 | 8 | import org.apache.commons.collections4.ListUtils;
|
9 | 9 | import rest.koios.client.backend.api.base.common.Asset;
|
10 | 10 | import rest.koios.client.backend.api.transactions.TransactionsService;
|
11 |
| -import rest.koios.client.backend.api.transactions.model.*; |
| 11 | +import rest.koios.client.backend.api.transactions.model.TxCertificate; |
| 12 | +import rest.koios.client.backend.api.transactions.model.TxIO; |
| 13 | +import rest.koios.client.backend.api.transactions.model.TxInfo; |
| 14 | +import rest.koios.client.backend.api.transactions.model.TxPlutusContract; |
12 | 15 |
|
13 | 16 | import java.util.ArrayList;
|
14 | 17 | import java.util.Collections;
|
@@ -91,9 +94,15 @@ private TransactionContent convertToTransactionContent(TxInfo txInfo) {
|
91 | 94 | TransactionContent transactionContent = new TransactionContent();
|
92 | 95 | transactionContent.setHash(txInfo.getTxHash());
|
93 | 96 | transactionContent.setBlock(txInfo.getBlockHash());
|
94 |
| - transactionContent.setBlockHeight(txInfo.getBlockHeight()); |
95 |
| - transactionContent.setBlockTime(txInfo.getTxTimestamp()); |
96 |
| - transactionContent.setSlot(txInfo.getAbsoluteSlot()); |
| 97 | + if (txInfo.getBlockHeight() != null) { |
| 98 | + transactionContent.setBlockHeight(txInfo.getBlockHeight().longValue()); |
| 99 | + } |
| 100 | + if (txInfo.getTxTimestamp() != null) { |
| 101 | + transactionContent.setBlockTime(txInfo.getTxTimestamp().longValue()); |
| 102 | + } |
| 103 | + if (txInfo.getAbsoluteSlot() != null) { |
| 104 | + transactionContent.setSlot(txInfo.getAbsoluteSlot().longValue()); |
| 105 | + } |
97 | 106 | transactionContent.setIndex(txInfo.getTxBlockIndex());
|
98 | 107 | List<TxOutputAmount> txOutputAmountList = new ArrayList<>();
|
99 | 108 | txOutputAmountList.add(new TxOutputAmount(LOVELACE, txInfo.getTotalOutput()));
|
|
0 commit comments