From 491757cedc9d43975ea4b548ffa82d0c3e6d1af5 Mon Sep 17 00:00:00 2001 From: Alessio Date: Tue, 30 Jan 2024 15:29:34 +0100 Subject: [PATCH 1/6] removed duplicated pom dependency Signed-off-by: Alessio --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index 4a3354fd..902e47ed 100644 --- a/pom.xml +++ b/pom.xml @@ -66,12 +66,6 @@ spring-boot-starter-actuator - - org.springframework.boot - spring-boot-starter-test - test - - com.github.pengrad java-telegram-bot-api From 71816b9daafeaec354a27d424c89a8d25c1e674d Mon Sep 17 00:00:00 2001 From: Alessio Date: Wed, 7 Feb 2024 18:08:59 +0100 Subject: [PATCH 2/6] Issue #47 fix. Implemented from scratch the TX in/out tokens calculation Signed-off-by: Alessio --- .../scheduler/TransactionCheckerTaskV2.java | 121 +-- .../com/devpool/thothBot/IntegrationTest.java | 42 +- ...864a60600b9f52383fe418164574ffdeeed0_.json | 23 + ...83075b4baa8c5af14c88acaca47d5c251820_.json | 23 + ...1fa64b352a4d3887d6436904190b698f232e_.json | 23 + .../resources/test-data/fetch_issues_data.sh | 9 +- .../test-data/issues/47_account_utxos.json | 18 + .../test-data/issues/47_txs_info.json | 756 ++++++++++++++++++ 8 files changed, 954 insertions(+), 61 deletions(-) create mode 100644 src/test/resources/test-data/assets/asset_1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed0_.json create mode 100644 src/test/resources/test-data/assets/asset_416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c251820_.json create mode 100644 src/test/resources/test-data/assets/asset_f967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e_.json create mode 100644 src/test/resources/test-data/issues/47_account_utxos.json create mode 100644 src/test/resources/test-data/issues/47_txs_info.json diff --git a/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java b/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java index 004d4a91..a0cf1a4c 100644 --- a/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java +++ b/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java @@ -41,6 +41,7 @@ public class TransactionCheckerTaskV2 extends AbstractCheckerTask implements Run private static final String DELEGATION_CERTIFICATE = "delegation"; private static final String BLOCK_HEIGHT_FIELD = "block_height"; private static final int MAX_TX_IN_TELEGRAM_NOTIFICATION = 3; + @Value("${thoth.test.allow-jumbo-message}") private Boolean allowJumboMessage; @@ -342,11 +343,53 @@ else if (!allInputAddresses.contains(user.getAddress())) .filter(tx -> user.getAddress().equals(tx.getStakeAddr()) || user.getAddress().equals(tx.getPaymentAddr().getBech32())) .flatMap(io -> io.getAssetList().stream()).collect(Collectors.toSet()); - outputAssets.removeIf(a -> inputAssets.stream().map(Asset::getFingerprint).anyMatch(x -> x.equals(a.getFingerprint()))); + Map inputAssetValues = new HashMap<>(); + for (Asset ia : inputAssets) { + Double val = inputAssetValues.getOrDefault(ia.getFingerprint(), 0d); + val += Long.parseLong(ia.getQuantity()) / Math.pow(10, ia.getDecimals()); + inputAssetValues.put(ia.getFingerprint(), val); + } + + Map outputAssetValues = new HashMap<>(); + for (Asset oa : outputAssets) { + Double val = outputAssetValues.getOrDefault(oa.getFingerprint(), 0d); + val += Long.parseLong(oa.getQuantity()) / Math.pow(10, oa.getDecimals()); + outputAssetValues.put(oa.getFingerprint(), val); + } + + Map assetValues = new HashMap<>(inputAssetValues); + // Input tokens shall be negative because they are leaving the wallet + assetValues.replaceAll((k, v) -> v *= -1); - List allAssets = accountOutputs.stream().flatMap(tx -> tx.getAssetList().stream()).collect(Collectors.toList()); + for (Map.Entry a : outputAssetValues.entrySet()) { + if (assetValues.containsKey(a.getKey())) + assetValues.put(a.getKey(), assetValues.get(a.getKey()) + a.getValue()); + else + assetValues.put(a.getKey(), a.getValue()); + } - LOG.debug("All assets:\n{}\noutput assets:\n{}", allAssets, outputAssets); + Map allAssets = new HashMap<>(); + for (Map.Entry av : assetValues.entrySet()) { + // find the asset in input or output + Optional asset = inputAssets.stream().filter(a -> a.getFingerprint().equals(av.getKey())).findFirst(); + if (asset.isEmpty()) + asset = outputAssets.stream().filter(a -> a.getFingerprint().equals(av.getKey())).findFirst(); + + if (asset.isEmpty()) { + LOG.error("Cannot find the asset with fingerprint {} among input/output lists, in the Tx {}", + av.getKey(), txInfo.getTxHash()); + continue; + } + + if (av.getValue() != 0d) { + if (asset.get().getDecimals() > 0) + allAssets.put(asset.get(), av.getValue()); + else + allAssets.put(asset.get(), av.getValue().longValue()); + } + } + + LOG.debug("All assets in TX: {}", assetValues); double receivedOrSentFunds = accountOutputs.stream().mapToLong(tx -> Long.parseLong(tx.getValue())).sum() / LOVELACE; @@ -380,7 +423,7 @@ else if (!allInputAddresses.contains(user.getAddress())) List poolInfoList = null; try { - Result> poolInfoRes = this.koiosFacade.getKoiosService().getPoolService().getPoolInformation(Arrays.asList(delegateToPoolId), options); + Result> poolInfoRes = this.koiosFacade.getKoiosService().getPoolService().getPoolInformation(Collections.singletonList(delegateToPoolId), options); if (poolInfoRes.isSuccessful()) poolInfoList = poolInfoRes.getValue(); else LOG.warn("Cannot retrieve pool information due to {}", poolInfoRes.getResponse()); } catch (ApiException e) { @@ -411,11 +454,11 @@ else if (!allInputAddresses.contains(user.getAddress())) if (LOG.isDebugEnabled()) { LOG.debug("TX {} Amount {} Fees {} USD Price {} Pool Delegation {} ({}) Message {} Assets {}", txInfo.getTxHash(), receivedOrSentFunds, fee, latestCardanoPriceUsd, delegateToPoolName, delegateToPoolId, - metadataMessage, allAssets.stream().map(Asset::getFingerprint).collect(Collectors.joining("\n"))); + metadataMessage, allAssets.keySet().stream().map(Asset::getFingerprint).collect(Collectors.joining("\n"))); } StringBuilder sb = new StringBuilder(); - renderSingleTransactionMessage(sb, txInfo, allAssets, outputAssets, txType, latestCardanoPriceUsd, fee, + renderSingleTransactionMessage(sb, txInfo, allAssets, txType, latestCardanoPriceUsd, fee, receivedOrSentFunds, delegateToPoolName, delegateToPoolId, metadataMessage, totalWithdrawals); return sb; } @@ -463,13 +506,24 @@ private StringBuilder renderTransactionMessageHeader(User u, Map } private StringBuilder renderSingleTransactionMessage(StringBuilder messageBuilder, TxInfo txInfo, - List allAssets, Set outputAssets, TxType txType, + Map allAssets, TxType txType, Double latestCardanoPriceUsd, Double fee, double receivedOrSentFunds, String delegateToPoolName, String delegateToPoolId, String metadataMessage, double totalWithdrawals) { - String fundsTokenText = String.format("Funds %s", allAssets.isEmpty() ? "" : "and Tokens"); - if (!outputAssets.isEmpty()) + + String fundsTokenText = ""; + // Check how many received and sent tokens we have (negative is sent, positive is received) + boolean sentTokens = allAssets.values().stream().anyMatch(v -> v.doubleValue() < 0); + boolean receivedTokens = allAssets.values().stream().anyMatch(v -> v.doubleValue() > 0); + + if (sentTokens && receivedTokens) + fundsTokenText = "Funds, Sent and Received Tokens"; + else if (sentTokens) + fundsTokenText = "Funds and Sent Tokens"; + else if (receivedTokens) fundsTokenText = "Funds and Received Tokens"; + else + fundsTokenText = "Funds"; switch (txType) { case TX_RECEIVED: @@ -480,7 +534,7 @@ private StringBuilder renderSingleTransactionMessage(StringBuilder messageBuilde break; case TX_INTERNAL: messageBuilder.append(EmojiParser.parseToUnicode(":repeat: ")); - fundsTokenText = String.format("Transfer %s", allAssets.isEmpty() ? "" : "and Tokens"); + fundsTokenText += " (internal)"; break; } @@ -573,27 +627,19 @@ private StringBuilder renderSingleTransactionMessage(StringBuilder messageBuilde } // Any assets? - Collection uniqueAssets = allAssets.stream().collect(Collectors.toMap(Asset::getFingerprint, a -> a, (a, b) -> a)).values(); - Map quantities = computeAssetsQuantity(allAssets); - - if (!uniqueAssets.isEmpty()) { - for (Asset asset : uniqueAssets) { - Object assetQuantity = null; - String assetName = hexToAscii(asset.getAssetName(), asset.getPolicyId()); - try { - assetQuantity = this.assetFacade.getAssetQuantity(asset.getPolicyId(), asset.getAssetName(), - quantities.get(asset.getFingerprint())); - assetName = this.assetFacade.getAssetDisplayName(asset.getPolicyId(), asset.getAssetName()); - } catch (ApiException e) { - LOG.warn("Could not get the asset quantity for asset {}/{}: {}", - asset.getPolicyId(), asset.getAssetName(), e.toString()); - } - - messageBuilder - .append(EmojiParser.parseToUnicode("\n:small_orange_diamond:")) - .append(assetName).append(" ") - .append(this.assetFacade.formatAssetQuantity(assetQuantity)); + for (Map.Entry asset : allAssets.entrySet()) { + String assetName = hexToAscii(asset.getKey().getAssetName(), asset.getKey().getPolicyId()); + try { + assetName = this.assetFacade.getAssetDisplayName(asset.getKey().getPolicyId(), asset.getKey().getAssetName()); + } catch (ApiException e) { + LOG.warn("Could not get the asset quantity for asset {}/{}: {}", + asset.getKey().getPolicyId(), asset.getKey().getAssetName(), e.toString()); } + + messageBuilder + .append(EmojiParser.parseToUnicode("\n:small_orange_diamond:")) + .append(assetName).append(" ") + .append(this.assetFacade.formatAssetQuantity(asset.getValue())); } messageBuilder.append("\n\n"); // Some padding between TXs @@ -601,21 +647,6 @@ private StringBuilder renderSingleTransactionMessage(StringBuilder messageBuilde return messageBuilder; } - private Map computeAssetsQuantity(List assets) { - Map assetsQuantity = new HashMap<>(); - - for (Asset asset : assets) { - Long assetQuantity = Long.parseLong(asset.getQuantity()); - if (!assetsQuantity.containsKey(asset.getFingerprint())) { - assetsQuantity.put(asset.getFingerprint(), assetQuantity); - } else { - assetsQuantity.put(asset.getFingerprint(), assetsQuantity.get(asset.getFingerprint()) + assetQuantity); - } - } - - return assetsQuantity; - } - public Map getContracts() { return contracts; } diff --git a/src/test/java/com/devpool/thothBot/IntegrationTest.java b/src/test/java/com/devpool/thothBot/IntegrationTest.java index eccf1b2a..7730406d 100644 --- a/src/test/java/com/devpool/thothBot/IntegrationTest.java +++ b/src/test/java/com/devpool/thothBot/IntegrationTest.java @@ -294,7 +294,7 @@ public void scheduledNotificationsTest() throws Exception { Assertions.assertEquals(87, countTxForAddress(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32")); Assertions.assertEquals(41, countTxForAddress(allMessages, "stake1u9ttjzthgk2y7x55c9f363a6vpcthv0ukl2d5mhtxvv4kusv5fmtz")); Assertions.assertEquals(16, countTxForAddress(allMessages, "stake1uxpdrerp9wrxunfh6ukyv5267j70fzxgw0fr3z8zeac5vyqhf9jhy")); - Assertions.assertEquals(1, countTxForAddress(allMessages, "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7")); + Assertions.assertEquals(2, countTxForAddress(allMessages, "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7")); Assertions.assertEquals(5, countTxForAddress(allMessages, "addr1qy2jt0qpqz2z2z9zx5w4xemekkce7yderz53kjue53lpqv90lkfa9sgrfjuz6uvt4uqtrqhl2kj0a9lnr9ndzutx32gqleeckv")); Assertions.assertEquals(58, countTxForAddress(allMessages, "addr1wxwrp3hhg8xdddx7ecg6el2s2dj6h2c5g582yg2yxhupyns8feg4m")); Assertions.assertEquals(4, allMessages.stream().filter(m -> m.contains("reward(s)")).count()); @@ -341,32 +341,34 @@ public void scheduledNotificationsTest() throws Exception { message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", "3e2e4a2b7d78bc5994773805f1376d790c8169b63297d50ef4842e22aafb1f29"); Assertions.assertTrue(message.contains("Fee 0.39")); Assertions.assertTrue(message.contains("Sent -5.57")); - Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 1939 1")); - Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 3022 1")); - Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 2884 1")); - Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 5802 1")); + Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 1939 -1")); + Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 3022 -1")); + Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 2884 -1")); + Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 5802 -1")); // TX sent funds, jpeg store contract message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", "e9f577499a692fc07491cd7de013ea2c3b3a37b3df616aeb39f807ed5ced8d24"); Assertions.assertTrue(message.contains("Fee 0.46")); Assertions.assertTrue(message.contains("Sent -13.61")); Assertions.assertTrue(message.contains("JpegStore")); + Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 1501 1")); // TX received funds, jpeg store multiple (2) contracts message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", "b6170c1c89f91bb5f76c0810889ea110f34b63e7fde25b37abe269256ac2f45a"); Assertions.assertTrue(message.contains("Fee 1.11")); Assertions.assertTrue(message.contains("Received 18.00")); message = message.substring(message.indexOf("b6170c1c89f91bb5f76c0810889ea110f34b63e7fde25b37abe269256ac2f45a")); - Assertions.assertEquals(2, message.split("JpegStore").length - 1); + Assertions.assertEquals(2, message.split("\\[JpegStore]").length - 1); // TX with ada handle message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", "a6abf48aad975fac80416ce79f9a7969fe05e13a37eb8be1e917d5d84d6044"); Assertions.assertTrue(message.contains("$alessio.dev")); - // TX sent funds and tokens (with token hash) - message = retrieveMessageByString(allMessages, "stake1u9ttjzthgk2y7x55c9f363a6vpcthv0ukl2d5mhtxvv4kusv5fmtz", "69c2f2f96305b5d1eb46eb5180f9dfb0409c54919d2463ae61becf34570e504a"); - Assertions.assertTrue(message.contains("...9d660cf6a2 498,221,110")); - Assertions.assertTrue(message.contains("hvADA 2,528,098")); + // TX sent funds and received tokens + message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "2249e6906a7fba98247f22939ee102eb0ceeea207d3014a3b2cbd4944dd21513"); + Assertions.assertTrue(message.contains("Sent 1.39")); + Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 6808 1")); // Pool operator rewards message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", @@ -393,7 +395,7 @@ public void scheduledNotificationsTest() throws Exception { // TX received funds, received tokens message = retrieveMessageByString(allMessages, "stake1uxpdrerp9wrxunfh6ukyv5267j70fzxgw0fr3z8zeac5vyqhf9jhy", "083e302d0c5d11c07fa642c18df8fa290632c24157c676a754a5a763605ebe26"); - Assertions.assertTrue(message.contains("MACH 3,947.00")); + Assertions.assertTrue(message.contains("MACH 3,947")); Assertions.assertTrue(message.contains("1.73")); Assertions.assertTrue(message.contains("Received Funds and Received Tokens")); Assertions.assertFalse(message.contains("[JpegStore]")); @@ -416,18 +418,28 @@ public void scheduledNotificationsTest() throws Exception { message = retrieveMessageByString(allMessages, "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", "f5401d48ac42a1199c8fbb214e63e4f350ee5a4f099ff460ca7f8f7bdcfabd4c"); - Assertions.assertTrue(message.contains("Sent Funds and Tokens")); - Assertions.assertTrue(message.contains("Djed USD 746.00")); + Assertions.assertTrue(message.contains("Sent Funds and Sent Tokens")); + Assertions.assertTrue(message.contains("Djed USD -746.00")); Assertions.assertTrue(message.contains("-1.19")); Assertions.assertFalse(message.contains("iETH")); // Issue #39 message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", "0a416d362c9e1884292c4160254a7a8afc4b3921c783114d3d7574a8087ba3da"); - Assertions.assertTrue(message.contains("Sent Funds and Tokens")); + Assertions.assertTrue(message.contains("Sent Funds and Sent Tokens")); Assertions.assertTrue(message.contains("Dexhunter Trade")); - Assertions.assertTrue(message.contains("Empowa 3,025")); + Assertions.assertTrue(message.contains("Empowa -3,025.28")); Assertions.assertTrue(message.contains("Sent -14")); + Assertions.assertTrue(message.contains("Fee 0.25")); + + // Issue #47 + message = retrieveMessageByString(allMessages, "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", + "779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81"); + Assertions.assertTrue(message.contains("Sent Funds, Sent and Received Tokens")); + Assertions.assertTrue(message.contains("Fee 0.32")); + Assertions.assertTrue(message.contains("Sent -2.00")); + Assertions.assertTrue(message.contains("iUSD -2,369.08")); + Assertions.assertTrue(message.contains("qiUSD 116,002.71")); // check for null handles for (String m : allMessages) { diff --git a/src/test/resources/test-data/assets/asset_1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed0_.json b/src/test/resources/test-data/assets/asset_1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed0_.json new file mode 100644 index 00000000..a74ae27c --- /dev/null +++ b/src/test/resources/test-data/assets/asset_1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed0_.json @@ -0,0 +1,23 @@ +[ + { + "policy_id": "1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed0", + "asset_name": "", + "asset_name_ascii": "", + "fingerprint": "asset1ajv4exyhqq8zuxvpvnqcj5vtxks0xhqvkghmwq", + "minting_tx_hash": "9d810993d5b536496dbb5c3733bf4eb6c5acdbad6bdfb6b4b84c33315de66d7e", + "total_supply": "16", + "mint_cnt": 1, + "burn_cnt": 0, + "creation_time": 1685404800, + "minting_tx_metadata": null, + "token_registry_metadata": { + "url": "", + "logo": "", + "name": "Liqwid iUSD Action", + "ticker": "iUSDAXN", + "decimals": 0, + "description": "Utility token for Liqwid iUSD market" + }, + "cip68_metadata": null + } +] diff --git a/src/test/resources/test-data/assets/asset_416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c251820_.json b/src/test/resources/test-data/assets/asset_416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c251820_.json new file mode 100644 index 00000000..6ac9baea --- /dev/null +++ b/src/test/resources/test-data/assets/asset_416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c251820_.json @@ -0,0 +1,23 @@ +[ + { + "policy_id": "416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c251820", + "asset_name": "", + "asset_name_ascii": "", + "fingerprint": "asset1wjw72ah0ph7u60a7qd02xyw4mk0995wvhglwxa", + "minting_tx_hash": "9d810993d5b536496dbb5c3733bf4eb6c5acdbad6bdfb6b4b84c33315de66d7e", + "total_supply": "1", + "mint_cnt": 1, + "burn_cnt": 0, + "creation_time": 1685404800, + "minting_tx_metadata": null, + "token_registry_metadata": { + "url": "", + "logo": "", + "name": "Liqwid iUSD MarketState", + "ticker": "iUSDST", + "decimals": 0, + "description": "Utility token for Liqwid iUSD market" + }, + "cip68_metadata": null + } +] diff --git a/src/test/resources/test-data/assets/asset_f967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e_.json b/src/test/resources/test-data/assets/asset_f967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e_.json new file mode 100644 index 00000000..ec79361c --- /dev/null +++ b/src/test/resources/test-data/assets/asset_f967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e_.json @@ -0,0 +1,23 @@ +[ + { + "policy_id": "f967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e", + "asset_name": "", + "asset_name_ascii": "", + "fingerprint": "asset100qa7m200hgycvezpyyqxngz7c9606gne6etm6", + "minting_tx_hash": "9d810993d5b536496dbb5c3733bf4eb6c5acdbad6bdfb6b4b84c33315de66d7e", + "total_supply": "1", + "mint_cnt": 1, + "burn_cnt": 0, + "creation_time": 1685404800, + "minting_tx_metadata": null, + "token_registry_metadata": { + "url": "", + "logo": "", + "name": "Liqwid iUSD MarketParams", + "ticker": "iUSDPRM", + "decimals": 0, + "description": "Utility token for Liqwid iUSD market" + }, + "cip68_metadata": null + } +] diff --git a/src/test/resources/test-data/fetch_issues_data.sh b/src/test/resources/test-data/fetch_issues_data.sh index 98a06f86..d1e2f7a9 100755 --- a/src/test/resources/test-data/fetch_issues_data.sh +++ b/src/test/resources/test-data/fetch_issues_data.sh @@ -14,7 +14,14 @@ curl -s -X POST "https://api.koios.rest/api/v1/tx_info" \ -H "content-type: application/json" \ -d '{"_tx_hashes":["0a416d362c9e1884292c4160254a7a8afc4b3921c783114d3d7574a8087ba3da"]}' | jq > issues/39_txs_info.json +# Issue 47 +curl -s -X POST "https://api.koios.rest/api/v1/tx_info" \ + -H "accept: application/json"\ + -H "content-type: application/json" \ + -d '{"_tx_hashes":["779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81"]}' | jq > issues/47_txs_info.json + # Fetching assets echo "Fetching all assets in all TXs" download_assets "issues/43_txs_info.json" -download_assets "issues/39_txs_info.json" \ No newline at end of file +download_assets "issues/39_txs_info.json" +download_assets "issues/47_txs_info.json" \ No newline at end of file diff --git a/src/test/resources/test-data/issues/47_account_utxos.json b/src/test/resources/test-data/issues/47_account_utxos.json new file mode 100644 index 00000000..235a7bcc --- /dev/null +++ b/src/test/resources/test-data/issues/47_account_utxos.json @@ -0,0 +1,18 @@ +[ + { + "tx_hash": "779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81", + "tx_index": 3, + "address": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt", + "value": "10059221", + "stake_address": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", + "payment_cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "epoch_no": 1, + "block_height": 1, + "block_time": 1, + "datum_hash": null, + "inline_datum": null, + "reference_script": null, + "asset_list": null, + "is_spent": false + } +] \ No newline at end of file diff --git a/src/test/resources/test-data/issues/47_txs_info.json b/src/test/resources/test-data/issues/47_txs_info.json new file mode 100644 index 00000000..96866f39 --- /dev/null +++ b/src/test/resources/test-data/issues/47_txs_info.json @@ -0,0 +1,756 @@ +[ + { + "tx_hash": "779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81", + "block_hash": "51e69a9cc874758a568a93e40cb08390c254fd6a4665fa4bb26d4cf29e6819ba", + "block_height": 9873148, + "epoch_no": 464, + "epoch_slot": 46867, + "absolute_slot": 115131667, + "tx_timestamp": 1706697958, + "tx_block_index": 2, + "tx_size": 1078, + "total_output": "52749079", + "fee": "323560", + "deposit": "0", + "invalid_before": "115131645", + "invalid_after": "115131945", + "collateral_inputs": [ + { + "value": "47762479", + "tx_hash": "cdc89cf712d57ad99e78255d44f0b56e76a7e04896e72ee2548e8830e3333832", + "tx_index": 1, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", + "inline_datum": null, + "payment_addr": { + "cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "bech32": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt" + }, + "reference_script": null + } + ], + "collateral_output": { + "value": "44762479", + "tx_hash": "779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81", + "tx_index": 4, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", + "inline_datum": null, + "payment_addr": { + "cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "bech32": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt" + }, + "reference_script": null + }, + "reference_inputs": [ + { + "value": "3000000", + "tx_hash": "e829b60c236e9f82036db6ebd4efa6fc465f8394e0253ad98f3b65c180b62d81", + "tx_index": 1, + "asset_list": [ + { + "decimals": 0, + "quantity": "1", + "policy_id": "416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c251820", + "asset_name": "", + "fingerprint": "asset1wjw72ah0ph7u60a7qd02xyw4mk0995wvhglwxa" + } + ], + "datum_hash": "0d290e73d5c0aef8aa85ab73667f56310572d7b9611b5358389c6989a200b0f5", + "stake_addr": null, + "inline_datum": { + "bytes": "9f1b0000023204be35b51b00000001395c93051b000138f8626a348f1b0000042be4b20b571b00000007f30465901b003e2c4c187fec099fc24a0136bf7ee3e7f9646fa3c24c036986a49d20000000000000ff1b0000018d5f0088981b0000018d5f1e5d509f1b000006644573c57f1b000138f8626a348fff1a002dc6c0ff", + "value": { + "list": [ + { + "int": 2413851194805 + }, + { + "int": 5257335557 + }, + { + "int": 344114430882959 + }, + { + "int": 4586566978391 + }, + { + "int": 34141922704 + }, + { + "int": 17500153896233992 + }, + { + "list": [ + { + "int": 5732289379743732000000 + }, + { + "int": 1056028074220353400000000000 + } + ] + }, + { + "int": 1706695887000 + }, + { + "int": 1706697842000 + }, + { + "list": [ + { + "int": 7027731711359 + }, + { + "int": 344114430882959 + } + ] + }, + { + "int": 3000000 + } + ] + } + }, + "payment_addr": { + "cred": "6a836e8bb408ef5110a7477039a9f5fc41e55be9fc7eb5464def826b", + "bech32": "addr1w94gxm5tksyw75gs5arhqwdf7h7yre2ma878ad2xfhhcy6cq7q4tp" + }, + "reference_script": null + }, + { + "value": "3000000", + "tx_hash": "32536acbfa12b80a3c570b1dac7948187dfa66992460d11542f67ba357c0fd2c", + "tx_index": 0, + "asset_list": [ + { + "decimals": 0, + "quantity": "1", + "policy_id": "f967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e", + "asset_name": "", + "fingerprint": "asset100qa7m200hgycvezpyyqxngz7c9606gne6etm6" + } + ], + "datum_hash": "c8dc24a89bf943808bb905fd498e2d63e05a36a635d2146757add348a9122dc8", + "stake_addr": null, + "inline_datum": { + "bytes": "9f9f011832ff1a05f5e1009f0a080101ff1a000f42401a0007a120041a000493e01080581c854c7b463dca50b52be7448e586387200557a3feae51676aa855e77a1a001e84809f9f1acfa6ece31b0004000000000000ff9f1b000000014dd930af1b0008000000000000ff9f1b0000006b0892eb5b1b0010000000000000ff9f0d14ffff9f19031f1903e8ff9f0102ff069f011904e2ff9f0101ff9f0101ff9f0405ff9f1114ff581c14386d24c827f3ce74bdf6c875e548d928e12036c145ebec14f04df5581c9392bfc154f465f6788192c0176feca44c4b43318585b246712629db581c39fec77302f6a898a83df189926621566b246ea4686082a6ba830566d8799f43d87980ff581cc63f80127de4782c341171f9b2a3da087d99504e815718ca03943b45d8799f43d87980ff80000000d87a80d87a80d8799f9f090affffd87a80ff", + "value": { + "list": [ + { + "list": [ + { + "int": 1 + }, + { + "int": 50 + } + ] + }, + { + "int": 100000000 + }, + { + "list": [ + { + "int": 10 + }, + { + "int": 8 + }, + { + "int": 1 + }, + { + "int": 1 + } + ] + }, + { + "int": 1000000 + }, + { + "int": 500000 + }, + { + "int": 4 + }, + { + "int": 300000 + }, + { + "int": 16 + }, + { + "list": [] + }, + { + "bytes": "854c7b463dca50b52be7448e586387200557a3feae51676aa855e77a" + }, + { + "int": 2000000 + }, + { + "list": [ + { + "list": [ + { + "int": 3483823331 + }, + { + "int": 1125899906842624 + } + ] + }, + { + "list": [ + { + "int": 5601046703 + }, + { + "int": 2251799813685248 + } + ] + }, + { + "list": [ + { + "int": 459705346907 + }, + { + "int": 4503599627370496 + } + ] + }, + { + "list": [ + { + "int": 13 + }, + { + "int": 20 + } + ] + } + ] + }, + { + "list": [ + { + "int": 799 + }, + { + "int": 1000 + } + ] + }, + { + "list": [ + { + "int": 1 + }, + { + "int": 2 + } + ] + }, + { + "int": 6 + }, + { + "list": [ + { + "int": 1 + }, + { + "int": 1250 + } + ] + }, + { + "list": [ + { + "int": 1 + }, + { + "int": 1 + } + ] + }, + { + "list": [ + { + "int": 1 + }, + { + "int": 1 + } + ] + }, + { + "list": [ + { + "int": 4 + }, + { + "int": 5 + } + ] + }, + { + "list": [ + { + "int": 17 + }, + { + "int": 20 + } + ] + }, + { + "bytes": "14386d24c827f3ce74bdf6c875e548d928e12036c145ebec14f04df5" + }, + { + "bytes": "9392bfc154f465f6788192c0176feca44c4b43318585b246712629db" + }, + { + "bytes": "39fec77302f6a898a83df189926621566b246ea4686082a6ba830566" + }, + { + "fields": [ + { + "bytes": "d87980" + } + ], + "constructor": 0 + }, + { + "bytes": "c63f80127de4782c341171f9b2a3da087d99504e815718ca03943b45" + }, + { + "fields": [ + { + "bytes": "d87980" + } + ], + "constructor": 0 + }, + { + "list": [] + }, + { + "int": 0 + }, + { + "int": 0 + }, + { + "int": 0 + }, + { + "fields": [], + "constructor": 1 + }, + { + "fields": [], + "constructor": 1 + }, + { + "fields": [ + { + "list": [ + { + "int": 9 + }, + { + "int": 10 + } + ] + } + ], + "constructor": 0 + }, + { + "fields": [], + "constructor": 1 + } + ] + } + }, + "payment_addr": { + "cred": "b575da974ec756ba2afdccdc07cbd1839acaf0a24c4f80afd81d3fb6", + "bech32": "addr1wx6htk5hfmr4dw32lhxdcp7t6xpe4jhs5fxylq90mqwnldsvr87c6" + }, + "reference_script": null + }, + { + "value": "16623670", + "tx_hash": "89f6715ff7affd8bdeff696f47d7a08bd899cc9c627483a8885f9fd3943286a1", + "tx_index": 0, + "asset_list": [], + "datum_hash": "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec", + "stake_addr": null, + "inline_datum": null, + "payment_addr": { + "cred": "b61670381f47934a9f0aac56ba067733ccabe718b1dd8d6d0b469032", + "bech32": "addr1wxmpvupcrarexj5lp2k9dwsxwueue2l8rzcamrtdpdrfqvs6jk8k9" + }, + "reference_script": { + "hash": "14386d24c827f3ce74bdf6c875e548d928e12036c145ebec14f04df5", + "size": 3610, + "type": "plutusV2", + "bytes": "590e170100003333333333323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323222222222223222253330333375e00498010180001323232325333037323001222222333302123233332232323253330453370e900000108110a99982299b87480100084c084c13c0044cc8cc0908c888c00800cc138004dd48009bae304f001004304b002303e0013754004609460920020064a66608266e1ccc088014dd59825801240042603a6eb0c8c8c8c8c8c8c8c8c8c8c8c8c8c803d4ccc130004526163056006533304c3370e900000109919192999827a9982719b87001480004cdc3800a4070264649329998270008a4c2c60b00082c6e34004dd7000982b0008a99982619b87480080084c926533304a00114985858c148008c114004dd500098290009828003299982319b87480000084c8c8c8c8c8c8c926533304a001149858c1500194ccc128cdc3a40000042646464646464649329998270008a4c2c60b00066eb4004c15c004c15400ccc8c124894ccc130004414c4cc148c00cc160004c008c15c0048c94ccc134cdc39b8d001480e0400858dd70009bac00130540011630500023043001375400260a00022a66608c66e1d20020021324994ccc1100045261616304c002303f001375400260980026eb000440784894004c120c114c124c120c11400401094cc0f8ccc07928119180091119198209199998121191118010019bab304e00137520066eacc140c13cc130c140c13cc1300048cc10c94ccc120cdc4a40046eb4c13c0044c010dd718218008a5000114a0006466e212000330260010043232233300100b003002375c0046607a44a666080002201026608c60980026004609600200e60926090002266603c9408c8cdc49bad304b304a00133303e222533304200110021330033370000490011826800a4000664607e44a6660840022092264a66608a60080022660920026006609c00426006609c004609c00266444660060020044607e44a666084002294054ccc110cdd798270008018a5113002304d00100637586096002608c00260920022940c8c8c8c8c88cccccc00401801401000c038008dd59822982218220029bac30440043758608600a6eb0c108014dd598208010a4c2c605c607e002605c607c002607a0026072607a607200226464646464646464a6660766606e606a0260042a666076a66607600226464a66052604c66e1c00520001333302800a2304830473044001006222333302b00d2001008222533304353302f3233304433710900019b813302401d0043302401d007001302d0013371090000038981619b8748000cdc09981180e0019981180e0030a51163301d001003375c02426606e606a0240042c2a6660766606e606a0220042c2a6660766606e607a607c0206eb0c11401c584c8c8cc8cccccc0ec8888894ccc1080044cc0a800c0084c8c94ccc1194cc0c801c40184cc0b001401054ccc1194cc0c8c0bc01c4cc0b402c0044ccccc0212880309bac302e3050304f002004304f00315333046533032302f00613302d00a0011333330080074a200a26eb0c0b8c140c13c008c13c00c4ccccc02001c018014010c13c00cdd5982780098269825191827982718258009827000a504a02c2c0026eb0c11c02088c8c8c8c94ccc10d4cc0bcc0b0c0b40084c0b0c0b40045261333302e010200100b222323232323232323232533304f3370e90010010991919299982919b8748008008526153330523304353330523371200e90000a99982919b8700748000584c8c88cc00400c008c114020cdc119b80337060146eb4c17004c020c11120021322330010020093370066e0c028dd6982e0098041822982e0008a4c2c60b000460960026ea803854ccc13ccdc480219b83375a60b20026eb4c1640404c8c8c94ccc148cdc3a40040042930a99982919821a99982919b890074800054ccc148cdc3803a40002c26464466002006004608a01066e08cdc019b8300a375a60b80260106088900109911980080100499b80337060146eb4c17004c020c114c170004526163058002304b001375401c2c60aa00460900026ea8028cdc099b803370066e0c00cdd6982a80619b83375a60aa01a6eb4c154030008dd6982a982a0029bad305430533053003375a60a60046eb4c148c104c144028dd618288009bac002304c304b002304b0013038303430343034304900130330023044375801c60866eb003854ccc0ed4ccc0ec0044c8c94cc0a4c098cdc3800a40002666605001446090608e608800200c444666605601a4002010444a666086a6605e6466608866e212000337026604803a0086604803a00e002605a00266e2120000071302c3370e900019b813302301c0033302301c00614a22c6603a0020066eb80484cc0dcc0d404800854ccc0eccc0dcc0d40440085854ccc0eccc0dcc0f4c0f8040dd618228038b0991919919999981d911111299982100089981500180109919299982329981900388030998160028020a999823299819181780389981680580089999980425100613758605c60a0609e004008609e0062a66608ca66064605e00c26605a01400226666601000e9440144dd6181718281827801182780189999980400380300280218278019bab304f001304d304a32304f304e304b001304e0014a09405858004dd6182380411191919192999821a99817981618168010981618168008a4c2666605c0204002016444646464646464646464a66609e66e1d2002002132323253330523370e90010010a4c2a6660a466086a6660a466e2401d2000153330523370e00e90000b09919119800801801182280419b823370066e0c028dd6982e00980418222400426446600200401266e00cdc18051bad305c0130083045305c001149858c160008c12c004dd50070a99982799b89004337066eb4c164004dd6982c8080991919299982919b8748008008526153330523304353330523371200e90000a99982919b8700748000584c8c88cc00400c008c114020cdc119b80337060146eb4c17004c020c11120021322330010020093370066e0c028dd6982e0098041822982e0008a4c2c60b000460960026ea803858c154008c120004dd500519b813370066e00cdc18019bad305500c337066eb4c154034dd6982a8060011bad30553054005375a60a860a660a60066eb4c14c008dd69829182098288051bac3051001375800460986096004609600260706068606860686092002606600460886eb0038c10cdd60070a99981d9981b981a8088010a99981d9981b981e981f0081bac304500716149854ccc0eccc0dcc0f4c0f8040dd618228038a4c2c66ebc04d300108d87a9f9f4040ffff0037566086608460840066eb0c108008dd61820801981f800981f000981d181f181d001181d9bac007375c012444600400644a0024446604444a66604a002244a0022a66604e66ebcc088c0c40040104c014c0c40044c008c0c0004004888c8c8c94ccc09ccdc3a4004004200c2600a6062002605a00460400026ea800488c8c8c94ccc094cdc3a400000426600c6eb8c0bc0040104cc050c0b4dd618178008021815801180f0009baa0022233333300301c0283752004002466600e4466e00dd69815801000a40006eac004520002222333300533006004002001232223002003300400112250012301b22533301e00112250011333003302a0012223002003130023029001222533301f3375e00460060022446004006244a00244603444a66603a0022006266008605200260046050002446464466002006004a004a0044466e1ccc02800800520022323232533301c3370e9002001098130008b1811001180a8009baa00123330180014a09448c8c8c94ccc068cdc3a40040042940528981000118098009baa0012233014222533301a533006300a0011002100813232323232325333020001153330200081613232323253330243370e9002001099191199800805801801181780598170008b1815001180e8009baa302b302a006330094a200426601201000466e1c009200230270053300c0080013756604c002604800260406008604800294088ccc05800800400c5280b111801111980911299980a8008a4000264a66603066ebcc04c0040144c94ccc05c0045854ccc064c024c08800454ccc064cdd7980a181180080289bad3020302300116163756603e0022600660420046042002006ae8c88c00888c00c88cdc499b8200100433704004006466e0520000012323232233001003002375a603460320046eb4c064004dd60009180b18010009180a98010009180a18010009180998010009180918010009180898088009119baf30030010025573a4600444a66600a002294054cc018c00cc0440044c008c0400048c8c0088cc0080080048c0088cc00800800555cf919801000801ab9a14a24466ebcc8c02cc01c004c8c02cc01c004c028c024c0180040088cdd2a400466004002006ae812f5c0460046ea800555cf11919119800801801180218018011801800aba2574298010100004c011e581c9cae3d41ae05882f5f357f0042d71842f1cc8a8e5230411ddb4daf17004c0129d87a9f9f581cf66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b698804469555344ffff004c011e581c19312587e1c18ba062038d2f87d04da9021d247fda2a7f0d76496ad1004c011e581cd15c36d6dec655677acb3318294f116ce01d8d9def3cc54cdd78909b004c011e581c9a4b3374510d413193c606dc6ffc3ceb001acfe96e4827602771817b004c011e581c9392bfc154f465f6788192c0176feca44c4b43318585b246712629db004c01219f581c1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed040ff004c01219f581cf967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e40ff004c01219f581c416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c25182040ff0001", + "value": null + } + }, + { + "value": "14761750", + "tx_hash": "f5e77bc1f3c27dd95ec8a71c42b33f31df26fb2e37468df1a51e50cf1b868600", + "tx_index": 0, + "asset_list": [], + "datum_hash": "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec", + "stake_addr": null, + "inline_datum": null, + "payment_addr": { + "cred": "84ba5f03abefa84a86c32c3c4203bb5f5593536776e1abc905f2eff9", + "bech32": "addr1wxzt5hcr40h6sj5xcvkrcssrhd04ty6nvamwr27fqhewl7glyd5e0" + }, + "reference_script": { + "hash": "d15c36d6dec655677acb3318294f116ce01d8d9def3cc54cdd78909b", + "size": 3178, + "type": "plutusV2", + "bytes": "590c6701000033333323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232222222232333222533303b3375e004981018000132323232533303f323001222222333303d232333322323232533304d3370e9000001080f8a99982699b87480100084c078c14c0044cc8cc0848c888c00800cc148004dd48009bae3053001004304f002304c0013754004609c609a0020064a66609266e1ccc0f8014dd5982780124004260346eb0c8c8c8c8c8c8c8c8c8c8c8c8c8c803d4ccc15000452616305a00653330543370e90000010991919299982ba9981619b87001480004cdc3800a40702646493299982b0008a4c2c60b80082c6e34004dd7000982d0008a99982a19b87480080084c926533305200114985858c158008c14c004dd5000982b000982a003299982719b87480000084c8c8c8c8c8c8c9265333052001149858c1600194ccc148cdc3a400000426464646464646493299982b0008a4c2c60b80066eb4004c16c004c16400ccc8c144894ccc15000441104cc10cc00cc170004c008c16c0048c94ccc154cdc39b8d001480e0400858dd70009bac00130580011630540023051001375400260a80022a66609c66e1d20020021324994ccc13000452616163050002304d001375400260a00026eb0004406c4894004c130c124c134c130c12400401094cc070ccc07928119180091119198109199998109191118010019bab305200137520066eacc150c14cc140c150c14cc1400048cc08c94ccc140cdc4a40046eb4c14c0044c010dd718288008a5000114a0006466e212000330420010043232233300100b003002375c0046608a44a666090002201026606e60a00026004609e00200e609a6098002266603c9408c8cdc49bad304f304e001333046222533304a00110021330033370000490011828800a4000664608e44a6660940022074264a66609a6008002266074002600660a40042600660a400460a400266444660060020044608e44a666094002294054ccc130cdd798290008018a511300230510010063758609e0026094002609a0022940c8c8c8c8c88cccccc00401801401000c034008dd59824982418240029bac30480043758608e00a6eb0c118014dd598228010a4c2c60706086002607060840026082002607a6082607a0022660080040026eb802000c00888c8c8c8c8c8c8c94ccc100cdc3a400000426464646464646466466666608a444444a66609800226604c00600426464a6660a0a6606400e200c26605000a0082a6660a0a66064605c00e26605202c0022666660109440184dd61815182b182a801002182a8018a999828299819181700309981480a800899999804003a5100513758605460ac60aa00460aa00626666601000e00c00a00860aa0066eacc154004c14cc140c8c154c150c144004c1500052825016160013758609a00c44646464666604e026460a660a4609e0026eb0c148030888c8cccc0ac05c8004dd6182b0071111919299982a9981919819198191981919819198191981919baf0070035330373233305633710900019b813304a0240063304a02400a00130340013371090000080a9981b981999b8748000cdc099824811802998248118048a99982a99b8848000cdc0998248118029982481180489981a181a982d80500089981a000981a982d8051919baf374c00c6e98004c94ccc158cc88cc0e48c00cdd5982e000800919911981d118019bad305d001001233710900000080080088008b191999181d911ba63300337560046eac00488ccc0f088dd419b80375a0046eb4004008004028004cc8c8c94ccc160cdc3a40040042607e6eb0c1780044c0fccc88cc11cdd4801198239ba9001048375c60bc00209460b400460ae0026ea808ccdc0998248118029982481180499baf3333222232323232374e660946e9ccc128dd419b80375a60c6008010660946ea0cdc01bad30630030073304a30630023304a30630013304a3063306200104b3304a375000c09660c200260c000260be0026eb0c17c004cdc09982481180299824811804808198221bad305b305a00633049023005006374e00466e24dd6982d80619299982b19b89001480044c1240044004cdc0998248118029982481180499191919299982c99b87480080084ccccc164c8cdc3982d9baa00148008c17cc178011c4389375a60be00266e00dd6982f8079bad305f305e305e01016305b0023058001375460b800260ae6460b860b660b000260b660b402266e1cdd6982d982d001198221bad305b305a00633049023005337126eb4c16cc168028cccc11411d20002333304604848001d69bab0010051498594ccc150cdc4807a40002a6660a866e1c03d2000161323223300100300230480103370466e04cc120088010cc120088020c11d20021322330010020113370266090044008660900440106eb0008dd60011828000982798279827982798279822001182700119199918229112999824800880109980199802001182880098280009119b80002375a609800290000009bab304c0023304132322330010024c101400037520026eb8c12c018dd59825801182498248009824182400098238009823000982118230020b1821001181f8009baa30433042001303e004303f375800e607c6eb001cc0f4dd600411118010019128009111981691299981800089128008a99981919baf303330380010041300530380011300230370010012302a22533302d00114a02a660086006606a0022600460680024660580020042944888c8c8c94ccc0bccdc3a4004004200c2600a606a0026062004605c0026ea800488c8c88cc00400c0094009400888cdc399812801000a40044646464a66605466e1d20040021303000116302c002302900137540024466048444a666054a6601860520022004200c2646464646464a6660600022a6660600102c264646464a66606866e1d200400213232233300100b003002303b00b303a00116303600230330013754606e606c00c660129440084cc024020008cdc380124004606600a660520100026eacc0c8004c0c0004c0b0c010c0c0005280b11199812801000a5023330230014a094488c00888c00c88cdc499b820010043370400400646464644660020060046eb4c0a4c0a0008dd698140009bac0012301d22533302000114a22a660086006605000226004604e002446660400040020062940888cccc01000c880080080048c064c00800488c8c88cc00400c0088894ccc0780044cc03400c0084c8c8c94ccc08ccdd780100089980819bb0002330093026006302600333300822002005302800415333023337206eb8008dd70008998080031999804110008019814002002899808001999980411000803002981400218118011811002181300091299980e001080089999801910009812001181180100091299980d99b8700148000584ccc00cdd718108011bae30213020002001222533301b3370e002900008038998020019980280100091198021ba9002374c00244660066ea4008dd4000911980219bb00020010034bd6f7b6302ba04bd701119980999b8900200100200123002375200244446602044a666026002200a2a66602a66ebcc058c06c0040184c010c060c06c0044c008c06800400522100233702900000091191919299980899b87480000084cc018dd7180b800802099806980a9bac30170010043013002301000137540044466666600601c0206ea40080048ccc01c88cdc01bad301300200148000dd58008a40004444666600a6600c0080040024644460040066008002244a0024600e44a666014002244a002266600660240024446004006260046022002444a66601666ebc008c00c004488c00800c489400488c018894ccc024004400c4cc010c044004c008c0400048c030c0080048c02cc02c00488c00888cc014894ccc02000452000132533300b3375e601800200a264a6660140022c2a666018601660220022a66601866ebcc034c0480040144dd6980798090008b0b1bab300e00113003301000230100010032323002233002002001230022330020020015573eae8d5cd2ab9d230023754002aae788c8c88cc00400c008c010c00c008c00c0055d12ba14c11e581c9cae3d41ae05882f5f357f0042d71842f1cc8a8e5230411ddb4daf17004c01219f581c1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed040ff004c0129d87a9f9f581cf66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b698804469555344ffff004c01219f581cf967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e40ff004c01219f581c416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c25182040ff0001", + "value": null + } + } + ], + "inputs": [ + { + "value": "1155080", + "tx_hash": "31c2c4f22e5ae9a560a7b771e09bdd4e67e6804a510806df33712c4e44870803", + "tx_index": 0, + "asset_list": [ + { + "decimals": 6, + "quantity": "369083710", + "policy_id": "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880", + "asset_name": "69555344", + "fingerprint": "asset1rm38ahl5n88c3up6r67y7gn0ffxqwuw7thjxqr" + } + ], + "datum_hash": null, + "stake_addr": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", + "inline_datum": null, + "payment_addr": { + "cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "bech32": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt" + }, + "reference_script": null + }, + { + "value": "1155080", + "tx_hash": "3555f07416f4dc10caf0ff24ab0122adb61314403705afb66eadd374dec61543", + "tx_index": 0, + "asset_list": [ + { + "decimals": 6, + "quantity": "2000000000", + "policy_id": "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880", + "asset_name": "69555344", + "fingerprint": "asset1rm38ahl5n88c3up6r67y7gn0ffxqwuw7thjxqr" + } + ], + "datum_hash": null, + "stake_addr": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", + "inline_datum": null, + "payment_addr": { + "cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "bech32": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt" + }, + "reference_script": null + }, + { + "value": "47762479", + "tx_hash": "cdc89cf712d57ad99e78255d44f0b56e76a7e04896e72ee2548e8830e3333832", + "tx_index": 1, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", + "inline_datum": null, + "payment_addr": { + "cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "bech32": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt" + }, + "reference_script": null + }, + { + "value": "3000000", + "tx_hash": "e829b60c236e9f82036db6ebd4efa6fc465f8394e0253ad98f3b65c180b62d81", + "tx_index": 14, + "asset_list": [ + { + "decimals": 0, + "quantity": "1", + "policy_id": "1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed0", + "asset_name": "", + "fingerprint": "asset1ajv4exyhqq8zuxvpvnqcj5vtxks0xhqvkghmwq" + }, + { + "decimals": 6, + "quantity": "151194283147", + "policy_id": "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880", + "asset_name": "69555344", + "fingerprint": "asset1rm38ahl5n88c3up6r67y7gn0ffxqwuw7thjxqr" + } + ], + "datum_hash": "0a7958f6a705c4d9ab5c8fef8fe3c92c4cf81ef706defabd41ddd297b8da38d5", + "stake_addr": null, + "inline_datum": { + "bytes": "9f9f0000000000ff1a1395c930ff", + "value": { + "list": [ + { + "list": [ + { + "int": 0 + }, + { + "int": 0 + }, + { + "int": 0 + }, + { + "int": 0 + }, + { + "int": 0 + } + ] + }, + { + "int": 328583472 + } + ] + } + }, + "payment_addr": { + "cred": "14386d24c827f3ce74bdf6c875e548d928e12036c145ebec14f04df5", + "bech32": "addr1wy2rsmfyeqnl8nn5hhmvsa09frvj3cfqxmq5t6lvzncymagjtyla8" + }, + "reference_script": null + } + ], + "outputs": [ + { + "value": "19330648", + "tx_hash": "779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81", + "tx_index": 2, + "asset_list": [ + { + "decimals": 6, + "quantity": "58001352788", + "policy_id": "d15c36d6dec655677acb3318294f116ce01d8d9def3cc54cdd78909b", + "asset_name": "", + "fingerprint": "asset1dzjd56t50cr630ta8cakzl0v9y9u2hmhh9ymke" + } + ], + "datum_hash": null, + "stake_addr": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", + "inline_datum": null, + "payment_addr": { + "cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "bech32": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt" + }, + "reference_script": null + }, + { + "value": "28418431", + "tx_hash": "779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81", + "tx_index": 3, + "asset_list": [ + { + "decimals": 6, + "quantity": "58001352788", + "policy_id": "d15c36d6dec655677acb3318294f116ce01d8d9def3cc54cdd78909b", + "asset_name": "", + "fingerprint": "asset1dzjd56t50cr630ta8cakzl0v9y9u2hmhh9ymke" + } + ], + "datum_hash": null, + "stake_addr": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", + "inline_datum": null, + "payment_addr": { + "cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "bech32": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt" + }, + "reference_script": null + }, + { + "value": "2000000", + "tx_hash": "779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81", + "tx_index": 0, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1u8dr57ygnvekgmakcxcrp25jjr65meqp6lq66p67s8g7mmc9v5njz", + "inline_datum": null, + "payment_addr": { + "cred": "b1f2f20a8781a3ba967d8c7b5068d21d799e809dcce22f651679d661", + "bech32": "addr1qxcl9us2s7q68w5k0kx8k5rg6gwhn85qnhxwytm9zeuavcw68fug3xenv3hmdsdsxz4f9y84fhjqr47p45r4aqw3ahhssm52vc" + }, + "reference_script": null + }, + { + "value": "3000000", + "tx_hash": "779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81", + "tx_index": 1, + "asset_list": [ + { + "decimals": 0, + "quantity": "1", + "policy_id": "1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed0", + "asset_name": "", + "fingerprint": "asset1ajv4exyhqq8zuxvpvnqcj5vtxks0xhqvkghmwq" + }, + { + "decimals": 6, + "quantity": "153563366857", + "policy_id": "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880", + "asset_name": "69555344", + "fingerprint": "asset1rm38ahl5n88c3up6r67y7gn0ffxqwuw7thjxqr" + } + ], + "datum_hash": "93b2ed998057645fef100e489fef4519bef6f5909d01bb93ab6d5c68ce31241c", + "stake_addr": null, + "inline_datum": { + "bytes": "9f9f1a8d35593e1b0000001b024cd0a8000000ff1a1395c930ff", + "value": { + "list": [ + { + "list": [ + { + "int": 2369083710 + }, + { + "int": 116002705576 + }, + { + "int": 0 + }, + { + "int": 0 + }, + { + "int": 0 + } + ] + }, + { + "int": 328583472 + } + ] + } + }, + "payment_addr": { + "cred": "14386d24c827f3ce74bdf6c875e548d928e12036c145ebec14f04df5", + "bech32": "addr1wy2rsmfyeqnl8nn5hhmvsa09frvj3cfqxmq5t6lvzncymagjtyla8" + }, + "reference_script": null + } + ], + "withdrawals": [], + "assets_minted": [ + { + "decimals": 6, + "quantity": "116002705576", + "policy_id": "d15c36d6dec655677acb3318294f116ce01d8d9def3cc54cdd78909b", + "asset_name": "", + "fingerprint": "asset1dzjd56t50cr630ta8cakzl0v9y9u2hmhh9ymke" + } + ], + "metadata": null, + "certificates": [], + "native_scripts": [], + "plutus_contracts": [ + { + "size": 3610, + "input": { + "datum": { + "hash": "0a7958f6a705c4d9ab5c8fef8fe3c92c4cf81ef706defabd41ddd297b8da38d5", + "value": { + "list": [ + { + "list": [ + { + "int": 0 + }, + { + "int": 0 + }, + { + "int": 0 + }, + { + "int": 0 + }, + { + "int": 0 + } + ] + }, + { + "int": 328583472 + } + ] + } + }, + "redeemer": { + "fee": "30982", + "unit": { + "mem": "355616", + "steps": "145114160" + }, + "datum": { + "hash": "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec", + "value": { + "fields": [], + "constructor": 0 + } + }, + "purpose": "spend" + } + }, + "address": "addr1wy2rsmfyeqnl8nn5hhmvsa09frvj3cfqxmq5t6lvzncymagjtyla8", + "bytecode": "590e170100003333333333323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323222222222223222253330333375e00498010180001323232325333037323001222222333302123233332232323253330453370e900000108110a99982299b87480100084c084c13c0044cc8cc0908c888c00800cc138004dd48009bae304f001004304b002303e0013754004609460920020064a66608266e1ccc088014dd59825801240042603a6eb0c8c8c8c8c8c8c8c8c8c8c8c8c8c803d4ccc130004526163056006533304c3370e900000109919192999827a9982719b87001480004cdc3800a4070264649329998270008a4c2c60b00082c6e34004dd7000982b0008a99982619b87480080084c926533304a00114985858c148008c114004dd500098290009828003299982319b87480000084c8c8c8c8c8c8c926533304a001149858c1500194ccc128cdc3a40000042646464646464649329998270008a4c2c60b00066eb4004c15c004c15400ccc8c124894ccc130004414c4cc148c00cc160004c008c15c0048c94ccc134cdc39b8d001480e0400858dd70009bac00130540011630500023043001375400260a00022a66608c66e1d20020021324994ccc1100045261616304c002303f001375400260980026eb000440784894004c120c114c124c120c11400401094cc0f8ccc07928119180091119198209199998121191118010019bab304e00137520066eacc140c13cc130c140c13cc1300048cc10c94ccc120cdc4a40046eb4c13c0044c010dd718218008a5000114a0006466e212000330260010043232233300100b003002375c0046607a44a666080002201026608c60980026004609600200e60926090002266603c9408c8cdc49bad304b304a00133303e222533304200110021330033370000490011826800a4000664607e44a6660840022092264a66608a60080022660920026006609c00426006609c004609c00266444660060020044607e44a666084002294054ccc110cdd798270008018a5113002304d00100637586096002608c00260920022940c8c8c8c8c88cccccc00401801401000c038008dd59822982218220029bac30440043758608600a6eb0c108014dd598208010a4c2c605c607e002605c607c002607a0026072607a607200226464646464646464a6660766606e606a0260042a666076a66607600226464a66052604c66e1c00520001333302800a2304830473044001006222333302b00d2001008222533304353302f3233304433710900019b813302401d0043302401d007001302d0013371090000038981619b8748000cdc09981180e0019981180e0030a51163301d001003375c02426606e606a0240042c2a6660766606e606a0220042c2a6660766606e607a607c0206eb0c11401c584c8c8cc8cccccc0ec8888894ccc1080044cc0a800c0084c8c94ccc1194cc0c801c40184cc0b001401054ccc1194cc0c8c0bc01c4cc0b402c0044ccccc0212880309bac302e3050304f002004304f00315333046533032302f00613302d00a0011333330080074a200a26eb0c0b8c140c13c008c13c00c4ccccc02001c018014010c13c00cdd5982780098269825191827982718258009827000a504a02c2c0026eb0c11c02088c8c8c8c94ccc10d4cc0bcc0b0c0b40084c0b0c0b40045261333302e010200100b222323232323232323232533304f3370e90010010991919299982919b8748008008526153330523304353330523371200e90000a99982919b8700748000584c8c88cc00400c008c114020cdc119b80337060146eb4c17004c020c11120021322330010020093370066e0c028dd6982e0098041822982e0008a4c2c60b000460960026ea803854ccc13ccdc480219b83375a60b20026eb4c1640404c8c8c94ccc148cdc3a40040042930a99982919821a99982919b890074800054ccc148cdc3803a40002c26464466002006004608a01066e08cdc019b8300a375a60b80260106088900109911980080100499b80337060146eb4c17004c020c114c170004526163058002304b001375401c2c60aa00460900026ea8028cdc099b803370066e0c00cdd6982a80619b83375a60aa01a6eb4c154030008dd6982a982a0029bad305430533053003375a60a60046eb4c148c104c144028dd618288009bac002304c304b002304b0013038303430343034304900130330023044375801c60866eb003854ccc0ed4ccc0ec0044c8c94cc0a4c098cdc3800a40002666605001446090608e608800200c444666605601a4002010444a666086a6605e6466608866e212000337026604803a0086604803a00e002605a00266e2120000071302c3370e900019b813302301c0033302301c00614a22c6603a0020066eb80484cc0dcc0d404800854ccc0eccc0dcc0d40440085854ccc0eccc0dcc0f4c0f8040dd618228038b0991919919999981d911111299982100089981500180109919299982329981900388030998160028020a999823299819181780389981680580089999980425100613758605c60a0609e004008609e0062a66608ca66064605e00c26605a01400226666601000e9440144dd6181718281827801182780189999980400380300280218278019bab304f001304d304a32304f304e304b001304e0014a09405858004dd6182380411191919192999821a99817981618168010981618168008a4c2666605c0204002016444646464646464646464a66609e66e1d2002002132323253330523370e90010010a4c2a6660a466086a6660a466e2401d2000153330523370e00e90000b09919119800801801182280419b823370066e0c028dd6982e00980418222400426446600200401266e00cdc18051bad305c0130083045305c001149858c160008c12c004dd50070a99982799b89004337066eb4c164004dd6982c8080991919299982919b8748008008526153330523304353330523371200e90000a99982919b8700748000584c8c88cc00400c008c114020cdc119b80337060146eb4c17004c020c11120021322330010020093370066e0c028dd6982e0098041822982e0008a4c2c60b000460960026ea803858c154008c120004dd500519b813370066e00cdc18019bad305500c337066eb4c154034dd6982a8060011bad30553054005375a60a860a660a60066eb4c14c008dd69829182098288051bac3051001375800460986096004609600260706068606860686092002606600460886eb0038c10cdd60070a99981d9981b981a8088010a99981d9981b981e981f0081bac304500716149854ccc0eccc0dcc0f4c0f8040dd618228038a4c2c66ebc04d300108d87a9f9f4040ffff0037566086608460840066eb0c108008dd61820801981f800981f000981d181f181d001181d9bac007375c012444600400644a0024446604444a66604a002244a0022a66604e66ebcc088c0c40040104c014c0c40044c008c0c0004004888c8c8c94ccc09ccdc3a4004004200c2600a6062002605a00460400026ea800488c8c8c94ccc094cdc3a400000426600c6eb8c0bc0040104cc050c0b4dd618178008021815801180f0009baa0022233333300301c0283752004002466600e4466e00dd69815801000a40006eac004520002222333300533006004002001232223002003300400112250012301b22533301e00112250011333003302a0012223002003130023029001222533301f3375e00460060022446004006244a00244603444a66603a0022006266008605200260046050002446464466002006004a004a0044466e1ccc02800800520022323232533301c3370e9002001098130008b1811001180a8009baa00123330180014a09448c8c8c94ccc068cdc3a40040042940528981000118098009baa0012233014222533301a533006300a0011002100813232323232325333020001153330200081613232323253330243370e9002001099191199800805801801181780598170008b1815001180e8009baa302b302a006330094a200426601201000466e1c009200230270053300c0080013756604c002604800260406008604800294088ccc05800800400c5280b111801111980911299980a8008a4000264a66603066ebcc04c0040144c94ccc05c0045854ccc064c024c08800454ccc064cdd7980a181180080289bad3020302300116163756603e0022600660420046042002006ae8c88c00888c00c88cdc499b8200100433704004006466e0520000012323232233001003002375a603460320046eb4c064004dd60009180b18010009180a98010009180a18010009180998010009180918010009180898088009119baf30030010025573a4600444a66600a002294054cc018c00cc0440044c008c0400048c8c0088cc0080080048c0088cc00800800555cf919801000801ab9a14a24466ebcc8c02cc01c004c8c02cc01c004c028c024c0180040088cdd2a400466004002006ae812f5c0460046ea800555cf11919119800801801180218018011801800aba2574298010100004c011e581c9cae3d41ae05882f5f357f0042d71842f1cc8a8e5230411ddb4daf17004c0129d87a9f9f581cf66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b698804469555344ffff004c011e581c19312587e1c18ba062038d2f87d04da9021d247fda2a7f0d76496ad1004c011e581cd15c36d6dec655677acb3318294f116ce01d8d9def3cc54cdd78909b004c011e581c9a4b3374510d413193c606dc6ffc3ceb001acfe96e4827602771817b004c011e581c9392bfc154f465f6788192c0176feca44c4b43318585b246712629db004c01219f581c1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed040ff004c01219f581cf967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e40ff004c01219f581c416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c25182040ff0001", + "script_hash": "14386d24c827f3ce74bdf6c875e548d928e12036c145ebec14f04df5", + "valid_contract": true + }, + { + "size": 3178, + "input": { + "datum": null, + "redeemer": { + "fee": "85277", + "unit": { + "mem": "946873", + "steps": "424997702" + }, + "datum": { + "hash": "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314", + "value": { + "int": 0 + } + }, + "purpose": "mint" + } + }, + "address": null, + "bytecode": "590c6701000033333323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232222222232333222533303b3375e004981018000132323232533303f323001222222333303d232333322323232533304d3370e9000001080f8a99982699b87480100084c078c14c0044cc8cc0848c888c00800cc148004dd48009bae3053001004304f002304c0013754004609c609a0020064a66609266e1ccc0f8014dd5982780124004260346eb0c8c8c8c8c8c8c8c8c8c8c8c8c8c803d4ccc15000452616305a00653330543370e90000010991919299982ba9981619b87001480004cdc3800a40702646493299982b0008a4c2c60b80082c6e34004dd7000982d0008a99982a19b87480080084c926533305200114985858c158008c14c004dd5000982b000982a003299982719b87480000084c8c8c8c8c8c8c9265333052001149858c1600194ccc148cdc3a400000426464646464646493299982b0008a4c2c60b80066eb4004c16c004c16400ccc8c144894ccc15000441104cc10cc00cc170004c008c16c0048c94ccc154cdc39b8d001480e0400858dd70009bac00130580011630540023051001375400260a80022a66609c66e1d20020021324994ccc13000452616163050002304d001375400260a00026eb0004406c4894004c130c124c134c130c12400401094cc070ccc07928119180091119198109199998109191118010019bab305200137520066eacc150c14cc140c150c14cc1400048cc08c94ccc140cdc4a40046eb4c14c0044c010dd718288008a5000114a0006466e212000330420010043232233300100b003002375c0046608a44a666090002201026606e60a00026004609e00200e609a6098002266603c9408c8cdc49bad304f304e001333046222533304a00110021330033370000490011828800a4000664608e44a6660940022074264a66609a6008002266074002600660a40042600660a400460a400266444660060020044608e44a666094002294054ccc130cdd798290008018a511300230510010063758609e0026094002609a0022940c8c8c8c8c88cccccc00401801401000c034008dd59824982418240029bac30480043758608e00a6eb0c118014dd598228010a4c2c60706086002607060840026082002607a6082607a0022660080040026eb802000c00888c8c8c8c8c8c8c94ccc100cdc3a400000426464646464646466466666608a444444a66609800226604c00600426464a6660a0a6606400e200c26605000a0082a6660a0a66064605c00e26605202c0022666660109440184dd61815182b182a801002182a8018a999828299819181700309981480a800899999804003a5100513758605460ac60aa00460aa00626666601000e00c00a00860aa0066eacc154004c14cc140c8c154c150c144004c1500052825016160013758609a00c44646464666604e026460a660a4609e0026eb0c148030888c8cccc0ac05c8004dd6182b0071111919299982a9981919819198191981919819198191981919baf0070035330373233305633710900019b813304a0240063304a02400a00130340013371090000080a9981b981999b8748000cdc099824811802998248118048a99982a99b8848000cdc0998248118029982481180489981a181a982d80500089981a000981a982d8051919baf374c00c6e98004c94ccc158cc88cc0e48c00cdd5982e000800919911981d118019bad305d001001233710900000080080088008b191999181d911ba63300337560046eac00488ccc0f088dd419b80375a0046eb4004008004028004cc8c8c94ccc160cdc3a40040042607e6eb0c1780044c0fccc88cc11cdd4801198239ba9001048375c60bc00209460b400460ae0026ea808ccdc0998248118029982481180499baf3333222232323232374e660946e9ccc128dd419b80375a60c6008010660946ea0cdc01bad30630030073304a30630023304a30630013304a3063306200104b3304a375000c09660c200260c000260be0026eb0c17c004cdc09982481180299824811804808198221bad305b305a00633049023005006374e00466e24dd6982d80619299982b19b89001480044c1240044004cdc0998248118029982481180499191919299982c99b87480080084ccccc164c8cdc3982d9baa00148008c17cc178011c4389375a60be00266e00dd6982f8079bad305f305e305e01016305b0023058001375460b800260ae6460b860b660b000260b660b402266e1cdd6982d982d001198221bad305b305a00633049023005337126eb4c16cc168028cccc11411d20002333304604848001d69bab0010051498594ccc150cdc4807a40002a6660a866e1c03d2000161323223300100300230480103370466e04cc120088010cc120088020c11d20021322330010020113370266090044008660900440106eb0008dd60011828000982798279827982798279822001182700119199918229112999824800880109980199802001182880098280009119b80002375a609800290000009bab304c0023304132322330010024c101400037520026eb8c12c018dd59825801182498248009824182400098238009823000982118230020b1821001181f8009baa30433042001303e004303f375800e607c6eb001cc0f4dd600411118010019128009111981691299981800089128008a99981919baf303330380010041300530380011300230370010012302a22533302d00114a02a660086006606a0022600460680024660580020042944888c8c8c94ccc0bccdc3a4004004200c2600a606a0026062004605c0026ea800488c8c88cc00400c0094009400888cdc399812801000a40044646464a66605466e1d20040021303000116302c002302900137540024466048444a666054a6601860520022004200c2646464646464a6660600022a6660600102c264646464a66606866e1d200400213232233300100b003002303b00b303a00116303600230330013754606e606c00c660129440084cc024020008cdc380124004606600a660520100026eacc0c8004c0c0004c0b0c010c0c0005280b11199812801000a5023330230014a094488c00888c00c88cdc499b820010043370400400646464644660020060046eb4c0a4c0a0008dd698140009bac0012301d22533302000114a22a660086006605000226004604e002446660400040020062940888cccc01000c880080080048c064c00800488c8c88cc00400c0088894ccc0780044cc03400c0084c8c8c94ccc08ccdd780100089980819bb0002330093026006302600333300822002005302800415333023337206eb8008dd70008998080031999804110008019814002002899808001999980411000803002981400218118011811002181300091299980e001080089999801910009812001181180100091299980d99b8700148000584ccc00cdd718108011bae30213020002001222533301b3370e002900008038998020019980280100091198021ba9002374c00244660066ea4008dd4000911980219bb00020010034bd6f7b6302ba04bd701119980999b8900200100200123002375200244446602044a666026002200a2a66602a66ebcc058c06c0040184c010c060c06c0044c008c06800400522100233702900000091191919299980899b87480000084cc018dd7180b800802099806980a9bac30170010043013002301000137540044466666600601c0206ea40080048ccc01c88cdc01bad301300200148000dd58008a40004444666600a6600c0080040024644460040066008002244a0024600e44a666014002244a002266600660240024446004006260046022002444a66601666ebc008c00c004488c00800c489400488c018894ccc024004400c4cc010c044004c008c0400048c030c0080048c02cc02c00488c00888cc014894ccc02000452000132533300b3375e601800200a264a6660140022c2a666018601660220022a66601866ebcc034c0480040144dd6980798090008b0b1bab300e00113003301000230100010032323002233002002001230022330020020015573eae8d5cd2ab9d230023754002aae788c8c88cc00400c008c010c00c008c00c0055d12ba14c11e581c9cae3d41ae05882f5f357f0042d71842f1cc8a8e5230411ddb4daf17004c01219f581c1cc1aceaf5c7df55e270864a60600b9f52383fe418164574ffdeeed040ff004c0129d87a9f9f581cf66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b698804469555344ffff004c01219f581cf967b3a86a9880c876851fa64b352a4d3887d6436904190b698f232e40ff004c01219f581c416109f322b43051b80e83075b4baa8c5af14c88acaca47d5c25182040ff0001", + "script_hash": "d15c36d6dec655677acb3318294f116ce01d8d9def3cc54cdd78909b", + "valid_contract": true + } + ] + } +] From 2f61c0217924196e2d1dd6a2ea6dcfd764f66e55 Mon Sep 17 00:00:00 2001 From: Alessio Date: Sun, 11 Feb 2024 18:45:52 +0100 Subject: [PATCH 3/6] Fixed issue #48 and re-implemented the calculation of sent/received funds in TXs Signed-off-by: Alessio --- .../scheduler/TransactionCheckerTaskV2.java | 97 ++-- .../com/devpool/thothBot/IntegrationTest.java | 39 +- .../resources/test-data/fetch_issues_data.sh | 10 +- .../test-data/issues/43_account_utxos.json | 4 +- .../test-data/issues/47_account_utxos.json | 4 +- .../test-data/issues/48_account_utxos.json | 18 + .../test-data/issues/48_txs_info.json | 420 ++++++++++++++++++ 7 files changed, 519 insertions(+), 73 deletions(-) create mode 100644 src/test/resources/test-data/issues/48_account_utxos.json create mode 100644 src/test/resources/test-data/issues/48_txs_info.json diff --git a/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java b/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java index a0cf1a4c..2776b3e8 100644 --- a/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java +++ b/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java @@ -281,58 +281,35 @@ private void processUserTxs(User user, List uTxOS, Integer blockNo, Map allInputAddresses = txInfo.getInputs().stream().map(tx -> tx.getStakeAddr() != null ? tx.getStakeAddr() : tx.getPaymentAddr().getBech32()).collect(Collectors.toSet()); - Set allOutputAddresses = txInfo.getOutputs().stream().map(tx -> tx.getStakeAddr() != null ? tx.getStakeAddr() : tx.getPaymentAddr().getBech32()).collect(Collectors.toSet()); + long allInputValueLovelace = txInfo.getInputs() + .stream().filter(tx -> user.getAddress().equals(tx.getStakeAddr()) || + user.getAddress().equals(tx.getPaymentAddr().getBech32())) + .mapToLong(tx -> Long.parseLong(tx.getValue())).sum(); + long allOutputValueLovelace = txInfo.getOutputs().stream() + .filter(tx -> user.getAddress().equals(tx.getStakeAddr()) || + user.getAddress().equals(tx.getPaymentAddr().getBech32())) + .mapToLong(tx -> Long.parseLong(tx.getValue())).sum(); + long feeLovelace = Long.parseLong(txInfo.getFee()); + long txBalance = allOutputValueLovelace - allInputValueLovelace; + + long totalWithdrawalsLovelace = getWithdrawalLovelace(txInfo, user); + txBalance -= totalWithdrawalsLovelace; + + if (txBalance < 0 && allOutputValueLovelace > 0) + txBalance += feeLovelace; TxType txType; - if (allInputAddresses.size() == 1 && allOutputAddresses.size() == 1 && - allInputAddresses.contains(user.getAddress()) && allOutputAddresses.contains(user.getAddress())) + if (txBalance == 0) txType = TxType.TX_INTERNAL; - else if (!allInputAddresses.contains(user.getAddress())) + else if (txBalance > 0) txType = TxType.TX_RECEIVED; else txType = TxType.TX_SENT; - LOG.debug("User {} TX {} is of type {}", - user.getAddress(), txInfo.getTxHash(), txType); + LOG.debug("User {} TX {} is of type {}, with balance {}", + user.getAddress(), txInfo.getTxHash(), txType, txBalance); - Double fee = Long.parseLong(txInfo.getFee()) / LOVELACE; - - double totalWithdrawals = 0d; - if (txInfo.getWithdrawals() != null && !txInfo.getWithdrawals().isEmpty()) { - for (TxWithdrawal withdrawal : txInfo.getWithdrawals()) { - // Let's check if the withdrawals was for us - if (withdrawal.getStakeAddr().equals(user.getAddress())) - totalWithdrawals += Long.parseLong(withdrawal.getAmount()) / LOVELACE; - } - LOG.debug("Found {} ADA withdrawal for TX {}", totalWithdrawals, txInfo.getTxHash()); - - } - - // We check the inputs and outputs - List accountOutputs = Collections.emptyList(); - List accountInputs = txInfo.getInputs().stream() - .filter(tx -> user.getAddress().equals(tx.getStakeAddr()) || user.getAddress().equals(tx.getPaymentAddr().getBech32())) - .collect(Collectors.toList()); - - switch (txType) { - case TX_INTERNAL: { - accountInputs = Collections.emptyList(); - break; - } - case TX_RECEIVED: { - accountOutputs = txInfo.getOutputs().stream() - .filter(tx -> user.getAddress().equals(tx.getStakeAddr()) || user.getAddress().equals(tx.getPaymentAddr().getBech32())) - .collect(Collectors.toList()); - break; - } - case TX_SENT: { - accountOutputs = txInfo.getOutputs().stream() - .filter(tx -> !user.getAddress().equals(tx.getStakeAddr()) && !user.getAddress().equals(tx.getPaymentAddr().getBech32())) - .collect(Collectors.toList()); - break; - } - } + Double fee = feeLovelace / LOVELACE; // We need to check if there are new assets that we received, even if it's a "sent" TX // We make a diff between all input and output assets that belong to this account. The new ones are the received new assets @@ -390,23 +367,8 @@ else if (!allInputAddresses.contains(user.getAddress())) } LOG.debug("All assets in TX: {}", assetValues); - - double receivedOrSentFunds = accountOutputs.stream().mapToLong(tx -> Long.parseLong(tx.getValue())).sum() / LOVELACE; - - // If it's a SENT funds you need to subtract the value of receivedOrSentFunds to the sub of the input ones - if (txType == TxType.TX_SENT && !accountInputs.isEmpty()) { - List txOutputsBelongingToTheUser = txInfo.getOutputs().stream() - .filter(tx -> user.getAddress().equals(tx.getStakeAddr()) || user.getAddress().equals(tx.getPaymentAddr().getBech32())) - .collect(Collectors.toList()); - - Double inputFunds = accountInputs.stream().mapToLong(tx -> Long.valueOf(tx.getValue())).sum() / LOVELACE; - Double outputFunds = txOutputsBelongingToTheUser.stream().mapToLong(tx -> Long.valueOf(tx.getValue())).sum() / LOVELACE; - receivedOrSentFunds = inputFunds - outputFunds - fee; - } - - if (txType == TxType.TX_SENT) receivedOrSentFunds *= -1.0d; - - receivedOrSentFunds -= totalWithdrawals; + double totalWithdrawals = totalWithdrawalsLovelace / LOVELACE; + double receivedOrSentFunds = txBalance / LOVELACE; // Check for certificates in case it's a delegation TX String delegateToPoolName = null; @@ -505,6 +467,19 @@ private StringBuilder renderTransactionMessageHeader(User u, Map return messageBuilder; } + private long getWithdrawalLovelace(TxInfo txInfo, User user) { + long totalWithdrawals = 0; + if (txInfo.getWithdrawals() != null && !txInfo.getWithdrawals().isEmpty()) { + for (TxWithdrawal withdrawal : txInfo.getWithdrawals()) { + // Let's check if the withdrawals was for us + if (withdrawal.getStakeAddr().equals(user.getAddress())) + totalWithdrawals += Long.parseLong(withdrawal.getAmount()); + } + LOG.debug("Found {} ADA withdrawal for TX {}", totalWithdrawals, txInfo.getTxHash()); + } + + return totalWithdrawals; + } private StringBuilder renderSingleTransactionMessage(StringBuilder messageBuilder, TxInfo txInfo, Map allAssets, TxType txType, Double latestCardanoPriceUsd, Double fee, double receivedOrSentFunds, diff --git a/src/test/java/com/devpool/thothBot/IntegrationTest.java b/src/test/java/com/devpool/thothBot/IntegrationTest.java index 7730406d..9afa76c7 100644 --- a/src/test/java/com/devpool/thothBot/IntegrationTest.java +++ b/src/test/java/com/devpool/thothBot/IntegrationTest.java @@ -269,7 +269,7 @@ public void userCommandUnsubscribeTest() throws Exception { public void scheduledNotificationsTest() throws Exception { Mockito.verify(this.telegramFacadeMock, Mockito.timeout(60 * 1000) - .times(79)) + .times(80)) .sendMessageTo(this.chatIdArgCaptor.capture(), this.messageArgCaptor.capture()); List allUsers = this.userDao.getUsers(); @@ -287,11 +287,12 @@ public void scheduledNotificationsTest() throws Exception { //Expected transactions for addresses addr1qy2jt0qpqz2z2z9zx5w4xemekkce7yderz53kjue53lpqv90lkfa9sgrfjuz6uvt4uqtrqhl2kj0a9lnr9ndzutx32gqleeckv: 5 //Expected transactions for addresses addr1wxwrp3hhg8xdddx7ecg6el2s2dj6h2c5g582yg2yxhupyns8feg4m: 58 //Total expected transactions for accounts+addresses 214 + // Numbers below differs from this due to the data added from issues List allMessages = messageArgCaptor.getAllValues(); Assertions.assertEquals(8, countTxForAddress(allMessages, "stake1u8lffpd48ss4f2pe0rhhj4n2edkgwl38scl09f9f43y0azcnhxhwr")); - Assertions.assertEquals(87, countTxForAddress(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32")); + Assertions.assertEquals(88, countTxForAddress(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32")); Assertions.assertEquals(41, countTxForAddress(allMessages, "stake1u9ttjzthgk2y7x55c9f363a6vpcthv0ukl2d5mhtxvv4kusv5fmtz")); Assertions.assertEquals(16, countTxForAddress(allMessages, "stake1uxpdrerp9wrxunfh6ukyv5267j70fzxgw0fr3z8zeac5vyqhf9jhy")); Assertions.assertEquals(2, countTxForAddress(allMessages, "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7")); @@ -316,17 +317,21 @@ public void scheduledNotificationsTest() throws Exception { Assertions.assertTrue(message.contains("Sent -55.00")); // TX catalyst new airdrop method - message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", "19c57aec14b9cefd4b1025c09c64bf857a4d2e3c0ee184d62b2eca8dfceb929b"); - Assertions.assertTrue(message.contains("59.54")); + message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "19c57aec14b9cefd4b1025c09c64bf857a4d2e3c0ee184d62b2eca8dfceb929b"); + Assertions.assertTrue(message.contains("Received 59.54")); + Assertions.assertTrue(message.contains("Fee 0.87")); Assertions.assertTrue(message.contains("Fund10 Voter rewards")); // TX received funds, 1 token - message = retrieveMessageByString(allMessages, "addr1wxwrp3hhg8xdddx7ecg6el2s2dj6h2c5g582yg2yxhupyns8feg4m", "9f8067d6565c5e189551b9ca820ff27ec87dc955420ab9d8a6ce4107d5d27743"); + message = retrieveMessageByString(allMessages, "addr1wxwrp3hhg8xdddx7ecg6el2s2dj6h2c5g582yg2yxhupyns8feg4m", + "9f8067d6565c5e189551b9ca820ff27ec87dc955420ab9d8a6ce4107d5d27743"); Assertions.assertTrue(message.contains("wide open 1")); Assertions.assertTrue(message.contains("Received 1.04")); // TX received funds, with message - message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", "773b01dfcd7a0398a8576129410084c8797906b913bdf6437289daebb672f085"); + message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "773b01dfcd7a0398a8576129410084c8797906b913bdf6437289daebb672f085"); Assertions.assertTrue(message.contains("DEV Pool patron rewards for epoch 377")); Assertions.assertTrue(message.contains("Sent -55.00")); Assertions.assertTrue(message.contains("Fee 0.20")); @@ -367,7 +372,9 @@ public void scheduledNotificationsTest() throws Exception { // TX sent funds and received tokens message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", "2249e6906a7fba98247f22939ee102eb0ceeea207d3014a3b2cbd4944dd21513"); - Assertions.assertTrue(message.contains("Sent 1.39")); + Assertions.assertTrue(message.contains("Received 1.09")); + Assertions.assertTrue(message.contains("Fee 0.30")); + Assertions.assertTrue(message.contains("Received Funds and Received Tokens")); Assertions.assertTrue(message.contains("Cardano Summit 2023 NFT 6808 1")); // Pool operator rewards @@ -414,6 +421,16 @@ public void scheduledNotificationsTest() throws Exception { Assertions.assertFalse(message.contains("Withdrawal")); Assertions.assertTrue(message.contains("Received 300")); + // TX with no input but just output (simple received NFT + funds from a friend) + message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "2c122a05b4cc3121e2e7225374ae8cfe74d947aa8169264878d2fd1dc0a40702"); + Assertions.assertTrue(message.contains("Received Funds and Received Tokens")); + Assertions.assertTrue(message.contains("Fee 0.17")); + Assertions.assertTrue(message.contains("Received 1.19")); + Assertions.assertTrue(message.contains("CARDANO PETS-0026 1")); + + + // Issue #43 message = retrieveMessageByString(allMessages, "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", "f5401d48ac42a1199c8fbb214e63e4f350ee5a4f099ff460ca7f8f7bdcfabd4c"); @@ -441,6 +458,14 @@ public void scheduledNotificationsTest() throws Exception { Assertions.assertTrue(message.contains("iUSD -2,369.08")); Assertions.assertTrue(message.contains("qiUSD 116,002.71")); + // Issue #47 - received funds and sent tokens + message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "24188c3d4aa6efad2c1250705a9ee5f8acd8c59cf9e4eebf9541477af7b10d15"); + Assertions.assertTrue(message.contains("Received Funds and Sent Tokens")); + Assertions.assertTrue(message.contains("Received 16.07")); + Assertions.assertTrue(message.contains("Fee 0.40")); + Assertions.assertTrue(message.contains("MalTheTrader12416 -1")); + // check for null handles for (String m : allMessages) { Assertions.assertFalse(m.contains("null"), "message contains 'null': " + m); diff --git a/src/test/resources/test-data/fetch_issues_data.sh b/src/test/resources/test-data/fetch_issues_data.sh index d1e2f7a9..ae49eed0 100755 --- a/src/test/resources/test-data/fetch_issues_data.sh +++ b/src/test/resources/test-data/fetch_issues_data.sh @@ -20,8 +20,16 @@ curl -s -X POST "https://api.koios.rest/api/v1/tx_info" \ -H "content-type: application/json" \ -d '{"_tx_hashes":["779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81"]}' | jq > issues/47_txs_info.json +# Issue 48 +curl -s -X POST "https://api.koios.rest/api/v1/tx_info" \ + -H "accept: application/json"\ + -H "content-type: application/json" \ + -d '{"_tx_hashes":["24188c3d4aa6efad2c1250705a9ee5f8acd8c59cf9e4eebf9541477af7b10d15"]}' | jq > issues/48_txs_info.json + + # Fetching assets echo "Fetching all assets in all TXs" download_assets "issues/43_txs_info.json" download_assets "issues/39_txs_info.json" -download_assets "issues/47_txs_info.json" \ No newline at end of file +download_assets "issues/47_txs_info.json" +download_assets "issues/48_txs_info.json" \ No newline at end of file diff --git a/src/test/resources/test-data/issues/43_account_utxos.json b/src/test/resources/test-data/issues/43_account_utxos.json index 0f57c4f8..bc31fa1b 100644 --- a/src/test/resources/test-data/issues/43_account_utxos.json +++ b/src/test/resources/test-data/issues/43_account_utxos.json @@ -2,10 +2,10 @@ { "tx_hash": "f5401d48ac42a1199c8fbb214e63e4f350ee5a4f099ff460ca7f8f7bdcfabd4c", "tx_index": 3, - "address": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt", + "address": "whatever", "value": "10059221", "stake_address": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", - "payment_cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "payment_cred": "whatever", "epoch_no": 1, "block_height": 1, "block_time": 1, diff --git a/src/test/resources/test-data/issues/47_account_utxos.json b/src/test/resources/test-data/issues/47_account_utxos.json index 235a7bcc..18c7ab50 100644 --- a/src/test/resources/test-data/issues/47_account_utxos.json +++ b/src/test/resources/test-data/issues/47_account_utxos.json @@ -2,10 +2,10 @@ { "tx_hash": "779133d969dc88440d18741dc17e536b8b1b21ac0fdb431f4d2850f028839d81", "tx_index": 3, - "address": "addr1q8euez0khcvekzl2h56tyzqtwc9gjghclz2ccx4edwj4lm84f4slgr6fu7vkrsurz6q3etyael7e5pctng7fd8gt79us0gkzmt", + "address": "whatever", "value": "10059221", "stake_address": "stake1u8656c05pay70xtpcwp3dqgu4jwullv6qu9e50ykn59lz7g7vzwt7", - "payment_cred": "f3cc89f6be199b0beabd34b2080b760a8922f8f8958c1ab96ba55fec", + "payment_cred": "whatever", "epoch_no": 1, "block_height": 1, "block_time": 1, diff --git a/src/test/resources/test-data/issues/48_account_utxos.json b/src/test/resources/test-data/issues/48_account_utxos.json new file mode 100644 index 00000000..e00ae566 --- /dev/null +++ b/src/test/resources/test-data/issues/48_account_utxos.json @@ -0,0 +1,18 @@ +[ + { + "tx_hash": "24188c3d4aa6efad2c1250705a9ee5f8acd8c59cf9e4eebf9541477af7b10d15", + "tx_index": 3, + "address": "whatever", + "value": "10059221", + "stake_address": "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "payment_cred": "whatever", + "epoch_no": 1, + "block_height": 1, + "block_time": 1, + "datum_hash": null, + "inline_datum": null, + "reference_script": null, + "asset_list": null, + "is_spent": false + } +] \ No newline at end of file diff --git a/src/test/resources/test-data/issues/48_txs_info.json b/src/test/resources/test-data/issues/48_txs_info.json new file mode 100644 index 00000000..428fb048 --- /dev/null +++ b/src/test/resources/test-data/issues/48_txs_info.json @@ -0,0 +1,420 @@ +[ + { + "tx_hash": "24188c3d4aa6efad2c1250705a9ee5f8acd8c59cf9e4eebf9541477af7b10d15", + "block_hash": "4387f691ae91db1fbbefb19a1c71d6d78f529bc7637ca213339e506f33d52923", + "block_height": 9919673, + "epoch_no": 466, + "epoch_slot": 150398, + "absolute_slot": 116099198, + "tx_timestamp": 1707665489, + "tx_block_index": 36, + "tx_size": 1202, + "total_output": "27603024", + "fee": "396976", + "deposit": "0", + "invalid_before": null, + "invalid_after": "116100030", + "collateral_inputs": [ + { + "value": "5000000", + "tx_hash": "14e209e32fd73f8bd37de7939dd80803799b8a7f30a72721ba78c16dd70537ff", + "tx_index": 0, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "inline_datum": null, + "payment_addr": { + "cred": "9771b28872b7bcd12d7385ee8a9919d2a81ede1ec89f08fc2b2348a6", + "bech32": "addr1qxthrv5gw2mme5fdwwz7az5er8f2s8k7rmyf7z8u9v353fhenvmnavwv0xtlw7998wfk944qq6r6lhq75y03p0myzhmsv39e4u" + }, + "reference_script": null + } + ], + "collateral_output": { + "value": "4404536", + "tx_hash": "24188c3d4aa6efad2c1250705a9ee5f8acd8c59cf9e4eebf9541477af7b10d15", + "tx_index": 4, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "inline_datum": null, + "payment_addr": { + "cred": "9771b28872b7bcd12d7385ee8a9919d2a81ede1ec89f08fc2b2348a6", + "bech32": "addr1qxthrv5gw2mme5fdwwz7az5er8f2s8k7rmyf7z8u9v353fhenvmnavwv0xtlw7998wfk944qq6r6lhq75y03p0myzhmsv39e4u" + }, + "reference_script": null + }, + "reference_inputs": [ + { + "value": "40000000", + "tx_hash": "9a32459bd4ef6bbafdeb8cf3b909d0e3e2ec806e4cc6268529280b0fc1d06f5b", + "tx_index": 0, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1uxqh9rn76n8nynsnyvf4ulndjv0srcc8jtvumut3989cqmgjt49h6", + "inline_datum": null, + "payment_addr": { + "cred": "9068a7a3f008803edac87af1619860f2cdcde40c26987325ace138ad", + "bech32": "addr1zxgx3far7qygq0k6epa0zcvcvrevmn0ypsnfsue94nsn3tvpw288a4x0xf8pxgcntelxmyclq83s0ykeehchz2wtspks905plm" + }, + "reference_script": { + "hash": "9068a7a3f008803edac87af1619860f2cdcde40c26987325ace138ad", + "size": 2561, + "type": "plutusV2", + "bytes": "5909fe010000323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232222323232533535533357346064606a0062646464642466002008004a666ae68c0d8c0e00044c848c004008c078d5d0981b8008191baa357426ae88c0d80154ccd5cd1819981b0008991919191919191919191919191919191919191919190919999999999980080b80a8098088078068058048038028018011aba135744004666068eb88004d5d08009aba2002357420026ae88008cc0c9d71aba1001357440046ae84004d5d10011aba1001357440046ae84004d5d10011aba1001357440046ae84004d5d10011981300f1aba1001357440046ae84004d5d1181b001198111192999ab9a30353038001132321233001003002301d357426ae88c0e0008c078d5d0981b8008191baa00135742606a0020606ea8d5d0981a001817911a8011111111111111a80691919299aa99a998149aa99a80109815a481035054380022100203d00303903a03a1533501213302549101350033302330340362350012232333027303803a235001223500122533533302b0440040062153353333026303e040223500222533500321533533303104a0030062153353302b0010031303f3305722533500104c221350022253353305100200a100313304d33047002001300600300215335330370010031303f333302d04b0043370200200600409209008e60720020044266060920102313000333573466e20ccd54c0fc104c0a8cc0f1c024000400266aa608008246a00209600200809208e266ae712410231310004813357389201023132000470023335530360393501b0403501b04233355303603922533535002222253353302200800413038003042213303d001002100103f010333301c303403622350022253353303c00b002100313333020303803a235001222533533302a0210030012133330260220043355303e03f235001223303d002333500120012235002223500322330433370000800466aa608e09046a002446608c004666a0024002e008004ccc0c013400c0048004ccc09c11000c0040084cccc09408400c00800400c0040f140044cc0952410134003330233034036235001223303b00a0025001153353355303403523500122350012222302c533350021303104821001213304e2253350011303404a221350022253353304800200710011300600300c0011302a49010136002213355303603723500122350012222302e533350021303304a2100121330502253350011303604c221350022253353304a00200710011300600300e0033335530310342253353353530283500203f03d203f253353303c001330482253350011302e044221350022253353303000200a135302f001223350022303504b20011300600301003b1302c4901013300133037002001100103a00d1120011533573892010350543500165333573460640020502a666ae68c0c400409c0b8c0ccdd50019baa00133019223355301f020235001223301e002335530220232350012233021002333500137009000380233700002900000099aa980f81011a800911980f001199a800919aa981181211a8009119811001180880080091199806815001000919aa981181211a80091198110011809000800999804012801000812111919807198021a8018139a801013a99a9a80181490a99a8011099a801119a80111980400100091101711119a80210171112999ab9a3370e00c0062a666ae68cdc38028010998068020008158158120a99a80090120121a8008141119a801119a8011198128010009014119a801101411981280100091199ab9a3370e00400204604a44446666aa00866032444600660040024002006002004444466aa603803a46a0024466036004666a0024002052400266600a0080026603c66030006004046444666aa603003603866aa603403646a00244660320046010002666aa6030036446a00444a66a666aa603a03e60106603444a66a00404a200204e46a002446601400400a00c200626604000800604200266aa603403646a00244660320046605e44a66a002260160064426a00444a66a6601800401022444660040140082600c00600800446602644666a0060420040026a00204242444600600842444600200844604e44a66a0020364426a00444a66a6601000400e2602a0022600c0064466aa0046602000603600244a66a004200202e44a66a00202e266ae7000806c8c94ccd5cd180f9811000899190919800801801198079192999ab9a3022302500113232123300100300233301075c464a666ae68c094c0a00044c8cc0514cd4cc028005200110011300e4901022d330033301375c464a66a660180029000080089808249022d3200375a0026ae84d5d118140011bad35742604e0020446ea8004d5d09aba23025002300c35742604800203e6ea8004d5d09aba23022002375c6ae84c084004070dd500091199ab9a3371200400203202e46a002444400844a666ae68cdc79a80100b1a80080b0999ab9a3370e6a0040306a00203002a02e024464a666ae68c06cc0780044c8c8c8c8c8c8c8c848cccc00402401c00c008d5d09aba20045333573466e1d2004001132122230020043574260460042a666ae68c0880044c84888c004010dd71aba1302300215333573460420022244400603c60460026ea8d5d08009aba200233300a75c66014eb9d69aba100135744603c004600a6ae84c074004060dd50009299ab9c001162325333573460326038002264646424660020060046eb4d5d09aba2301d003533357346034603a00226eb8d5d0980e00080b9baa35742603600202c6ea80048c94ccd5cd180c180d80089919191909198008028012999ab9a301b00113232300953335734603c00226464646424466600200c0080066eb4d5d09aba2002375a6ae84004d5d118100019bad35742603e0042a666ae68c0740044c8488c00800cc020d5d0980f80100d180f8009baa35742603a0042a666ae68c070004044060c074004dd51aba135744603600460066ae84c068004054dd5000919192999ab9a30190011321223001003375c6ae84c06800854ccd5cd180c00089909118010019bae35742603400402a60340026ea80048488c00800c888cc06888cccd55cf800900911919807198041803980e8009803180e00098021aba2003357420040166eac0048848cc00400c00888cc05c88cccd55cf800900791980518029aba10023003357440040106eb0004c05088448894cd40044008884cc014008ccd54c01c028014010004c04c88448894cd40044d400c040884ccd4014040c010008ccd54c01c024014010004c0488844894cd4004024884cc020c010008cd54c01801c0100044800488488cc00401000cc03c8894cd40080108854cd4cc02000800c01c4cc01400400c4014400888ccd5cd19b8f0020010030051001220021001220011533573892010350543100164901022d31004901013700370e90001b874800955cf2ab9d2323001001223300330020020011", + "value": null + } + } + ], + "inputs": [ + { + "value": "5000000", + "tx_hash": "a9dfab96e6e0c88f8fe00d23b4a9c72f73e855b91b7fa40996be96d4479b989e", + "tx_index": 4, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "inline_datum": null, + "payment_addr": { + "cred": "bb184210659414a1ed1eeac58d574e6d4e097c70505720188799d076", + "bech32": "addr1qxa3ssssvk2pfg0drm4vtr2hfek5uztuwpg9wgqcs7vaqahenvmnavwv0xtlw7998wfk944qq6r6lhq75y03p0myzhmsfknztr" + }, + "reference_script": null + }, + { + "value": "3000000", + "tx_hash": "617b449dc4ca0c25c7d768a88e5273ee64cf0ff0ccc39c44232d08f2c2c5c411", + "tx_index": 0, + "asset_list": [ + { + "decimals": 0, + "quantity": "1", + "policy_id": "6666666f2a796df09b5e3f16aff0112ed7caa5a4bbf6596fa414dc5c", + "asset_name": "4d616c5468655472616465723132343136", + "fingerprint": "asset1ee4le9z8eznagetr36c4mt9w5wd3rye4hyyym0" + } + ], + "datum_hash": null, + "stake_addr": "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "inline_datum": null, + "payment_addr": { + "cred": "9771b28872b7bcd12d7385ee8a9919d2a81ede1ec89f08fc2b2348a6", + "bech32": "addr1qxthrv5gw2mme5fdwwz7az5er8f2s8k7rmyf7z8u9v353fhenvmnavwv0xtlw7998wfk944qq6r6lhq75y03p0myzhmsv39e4u" + }, + "reference_script": null + }, + { + "value": "20000000", + "tx_hash": "05f8e03cc3ca0388dd2b9887d3514d87689f47463eab8976a1cf3d94a7bb7ac0", + "tx_index": 8, + "asset_list": [], + "datum_hash": "36818a0910b43d055bf8f1896e8c4ee48bc8104cca50b24e70f6ffd75ce78451", + "stake_addr": "stake1uxqh9rn76n8nynsnyvf4ulndjv0srcc8jtvumut3989cqmgjt49h6", + "inline_datum": null, + "payment_addr": { + "cred": "9068a7a3f008803edac87af1619860f2cdcde40c26987325ace138ad", + "bech32": "addr1zxgx3far7qygq0k6epa0zcvcvrevmn0ypsnfsue94nsn3tvpw288a4x0xf8pxgcntelxmyclq83s0ykeehchz2wtspks905plm" + }, + "reference_script": null + } + ], + "outputs": [ + { + "value": "1000000", + "tx_hash": "24188c3d4aa6efad2c1250705a9ee5f8acd8c59cf9e4eebf9541477af7b10d15", + "tx_index": 0, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1uy0832h8eyxvxmtzfaanhdkcddfxjmwgfeys7dp7h2ysqhckdgvzv", + "inline_datum": null, + "payment_addr": { + "cred": "70e60f3b5ea7153e0acc7a803e4401d44b8ed1bae1c7baaad1a62a72", + "bech32": "addr1q9cwvremt6n320s2e3agq0jyq82yhrk3htsu0w426xnz5us70z4w0jgvcdkkynmm8wmds66jd9kusnjfpu6raw5fqp0sr07p5w" + }, + "reference_script": null + }, + { + "value": "24069154", + "tx_hash": "24188c3d4aa6efad2c1250705a9ee5f8acd8c59cf9e4eebf9541477af7b10d15", + "tx_index": 3, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", + "inline_datum": null, + "payment_addr": { + "cred": "9771b28872b7bcd12d7385ee8a9919d2a81ede1ec89f08fc2b2348a6", + "bech32": "addr1qxthrv5gw2mme5fdwwz7az5er8f2s8k7rmyf7z8u9v353fhenvmnavwv0xtlw7998wfk944qq6r6lhq75y03p0myzhmsv39e4u" + }, + "reference_script": null + }, + { + "value": "1193870", + "tx_hash": "24188c3d4aa6efad2c1250705a9ee5f8acd8c59cf9e4eebf9541477af7b10d15", + "tx_index": 2, + "asset_list": [ + { + "decimals": 0, + "quantity": "1", + "policy_id": "6666666f2a796df09b5e3f16aff0112ed7caa5a4bbf6596fa414dc5c", + "asset_name": "4d616c5468655472616465723132343136", + "fingerprint": "asset1ee4le9z8eznagetr36c4mt9w5wd3rye4hyyym0" + } + ], + "datum_hash": null, + "stake_addr": "stake1u8uewal50cmmyunm53szt2qvu924eclwwlk5dfwr52lnjcskrs93u", + "inline_datum": null, + "payment_addr": { + "cred": "2a67aa315c1c0ae0e0d926b0c5fee716b014af4ad14968f551da9ec9", + "bech32": "addr1qy4x0233tswq4c8qmyntp307uuttq990ftg5j68428dfaj0ejamlgl3hkfe8hfrqyk5qec24tn37ualdg6ju8g4l893qz2g3hx" + }, + "reference_script": null + }, + { + "value": "1340000", + "tx_hash": "24188c3d4aa6efad2c1250705a9ee5f8acd8c59cf9e4eebf9541477af7b10d15", + "tx_index": 1, + "asset_list": [], + "datum_hash": null, + "stake_addr": "stake1uxuqd08gmpw7dxdxv7hmlg0lg48a3zlqljsswlc2qx6dnzg5yunhe", + "inline_datum": null, + "payment_addr": { + "cred": "28f0a6b63b9a66337d03b703b38eb5abac0e33f70613ffd711f1fc14", + "bech32": "addr1qy50pf4k8wdxvvmaqwms8vuwkk46cr3n7urp8l7hz8clc99cq67w3kzau6v6vea0h7sl7320mz97pl9pqals5qd5mxys78l2zr" + }, + "reference_script": null + } + ], + "withdrawals": [], + "assets_minted": [], + "metadata": null, + "certificates": [], + "native_scripts": [], + "plutus_contracts": [ + { + "size": 2561, + "input": { + "datum": { + "hash": "36818a0910b43d055bf8f1896e8c4ee48bc8104cca50b24e70f6ffd75ce78451", + "value": { + "fields": [ + { + "bytes": "2a67aa315c1c0ae0e0d926b0c5fee716b014af4ad14968f551da9ec9" + }, + { + "list": [ + { + "fields": [ + { + "fields": [ + { + "fields": [ + { + "bytes": "70e60f3b5ea7153e0acc7a803e4401d44b8ed1bae1c7baaad1a62a72" + } + ], + "constructor": 0 + }, + { + "fields": [ + { + "fields": [ + { + "fields": [ + { + "bytes": "1e78aae7c90cc36d624f7b3bb6d86b52696dc84e490f343eba89005f" + } + ], + "constructor": 0 + } + ], + "constructor": 0 + } + ], + "constructor": 0 + } + ], + "constructor": 0 + }, + { + "map": [ + { + "k": { + "bytes": "" + }, + "v": { + "fields": [ + { + "int": 0 + }, + { + "map": [ + { + "k": { + "bytes": "" + }, + "v": { + "int": 1000000 + } + } + ] + } + ], + "constructor": 0 + } + } + ] + } + ], + "constructor": 0 + }, + { + "fields": [ + { + "fields": [ + { + "fields": [ + { + "bytes": "28f0a6b63b9a66337d03b703b38eb5abac0e33f70613ffd711f1fc14" + } + ], + "constructor": 0 + }, + { + "fields": [ + { + "fields": [ + { + "fields": [ + { + "bytes": "b806bce8d85de699a667afbfa1ff454fd88be0fca1077f0a01b4d989" + } + ], + "constructor": 0 + } + ], + "constructor": 0 + } + ], + "constructor": 0 + } + ], + "constructor": 0 + }, + { + "map": [ + { + "k": { + "bytes": "" + }, + "v": { + "fields": [ + { + "int": 0 + }, + { + "map": [ + { + "k": { + "bytes": "" + }, + "v": { + "int": 1340000 + } + } + ] + } + ], + "constructor": 0 + } + } + ] + } + ], + "constructor": 0 + }, + { + "fields": [ + { + "fields": [ + { + "fields": [ + { + "bytes": "2a67aa315c1c0ae0e0d926b0c5fee716b014af4ad14968f551da9ec9" + } + ], + "constructor": 0 + }, + { + "fields": [ + { + "fields": [ + { + "fields": [ + { + "bytes": "f99777f47e37b2727ba46025a80ce1555ce3ee77ed46a5c3a2bf3962" + } + ], + "constructor": 0 + } + ], + "constructor": 0 + } + ], + "constructor": 0 + } + ], + "constructor": 0 + }, + { + "map": [ + { + "k": { + "bytes": "6666666f2a796df09b5e3f16aff0112ed7caa5a4bbf6596fa414dc5c" + }, + "v": { + "fields": [ + { + "int": 1 + }, + { + "map": [] + } + ], + "constructor": 0 + } + } + ] + } + ], + "constructor": 0 + } + ] + } + ], + "constructor": 0 + } + }, + "redeemer": { + "fee": "188663", + "unit": { + "mem": "2421496", + "steps": "678815396" + }, + "datum": { + "hash": "8392f0c940435c06888f9bdb8c74a95dc69f156367d6a089cf008ae05caae01e", + "value": { + "fields": [], + "constructor": 1 + } + }, + "purpose": "spend" + } + }, + "address": "addr1zxgx3far7qygq0k6epa0zcvcvrevmn0ypsnfsue94nsn3tvpw288a4x0xf8pxgcntelxmyclq83s0ykeehchz2wtspks905plm", + "bytecode": "5909fe010000323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232222323232533535533357346064606a0062646464642466002008004a666ae68c0d8c0e00044c848c004008c078d5d0981b8008191baa357426ae88c0d80154ccd5cd1819981b0008991919191919191919191919191919191919191919190919999999999980080b80a8098088078068058048038028018011aba135744004666068eb88004d5d08009aba2002357420026ae88008cc0c9d71aba1001357440046ae84004d5d10011aba1001357440046ae84004d5d10011aba1001357440046ae84004d5d10011981300f1aba1001357440046ae84004d5d1181b001198111192999ab9a30353038001132321233001003002301d357426ae88c0e0008c078d5d0981b8008191baa00135742606a0020606ea8d5d0981a001817911a8011111111111111a80691919299aa99a998149aa99a80109815a481035054380022100203d00303903a03a1533501213302549101350033302330340362350012232333027303803a235001223500122533533302b0440040062153353333026303e040223500222533500321533533303104a0030062153353302b0010031303f3305722533500104c221350022253353305100200a100313304d33047002001300600300215335330370010031303f333302d04b0043370200200600409209008e60720020044266060920102313000333573466e20ccd54c0fc104c0a8cc0f1c024000400266aa608008246a00209600200809208e266ae712410231310004813357389201023132000470023335530360393501b0403501b04233355303603922533535002222253353302200800413038003042213303d001002100103f010333301c303403622350022253353303c00b002100313333020303803a235001222533533302a0210030012133330260220043355303e03f235001223303d002333500120012235002223500322330433370000800466aa608e09046a002446608c004666a0024002e008004ccc0c013400c0048004ccc09c11000c0040084cccc09408400c00800400c0040f140044cc0952410134003330233034036235001223303b00a0025001153353355303403523500122350012222302c533350021303104821001213304e2253350011303404a221350022253353304800200710011300600300c0011302a49010136002213355303603723500122350012222302e533350021303304a2100121330502253350011303604c221350022253353304a00200710011300600300e0033335530310342253353353530283500203f03d203f253353303c001330482253350011302e044221350022253353303000200a135302f001223350022303504b20011300600301003b1302c4901013300133037002001100103a00d1120011533573892010350543500165333573460640020502a666ae68c0c400409c0b8c0ccdd50019baa00133019223355301f020235001223301e002335530220232350012233021002333500137009000380233700002900000099aa980f81011a800911980f001199a800919aa981181211a8009119811001180880080091199806815001000919aa981181211a80091198110011809000800999804012801000812111919807198021a8018139a801013a99a9a80181490a99a8011099a801119a80111980400100091101711119a80210171112999ab9a3370e00c0062a666ae68cdc38028010998068020008158158120a99a80090120121a8008141119a801119a8011198128010009014119a801101411981280100091199ab9a3370e00400204604a44446666aa00866032444600660040024002006002004444466aa603803a46a0024466036004666a0024002052400266600a0080026603c66030006004046444666aa603003603866aa603403646a00244660320046010002666aa6030036446a00444a66a666aa603a03e60106603444a66a00404a200204e46a002446601400400a00c200626604000800604200266aa603403646a00244660320046605e44a66a002260160064426a00444a66a6601800401022444660040140082600c00600800446602644666a0060420040026a00204242444600600842444600200844604e44a66a0020364426a00444a66a6601000400e2602a0022600c0064466aa0046602000603600244a66a004200202e44a66a00202e266ae7000806c8c94ccd5cd180f9811000899190919800801801198079192999ab9a3022302500113232123300100300233301075c464a666ae68c094c0a00044c8cc0514cd4cc028005200110011300e4901022d330033301375c464a66a660180029000080089808249022d3200375a0026ae84d5d118140011bad35742604e0020446ea8004d5d09aba23025002300c35742604800203e6ea8004d5d09aba23022002375c6ae84c084004070dd500091199ab9a3371200400203202e46a002444400844a666ae68cdc79a80100b1a80080b0999ab9a3370e6a0040306a00203002a02e024464a666ae68c06cc0780044c8c8c8c8c8c8c8c848cccc00402401c00c008d5d09aba20045333573466e1d2004001132122230020043574260460042a666ae68c0880044c84888c004010dd71aba1302300215333573460420022244400603c60460026ea8d5d08009aba200233300a75c66014eb9d69aba100135744603c004600a6ae84c074004060dd50009299ab9c001162325333573460326038002264646424660020060046eb4d5d09aba2301d003533357346034603a00226eb8d5d0980e00080b9baa35742603600202c6ea80048c94ccd5cd180c180d80089919191909198008028012999ab9a301b00113232300953335734603c00226464646424466600200c0080066eb4d5d09aba2002375a6ae84004d5d118100019bad35742603e0042a666ae68c0740044c8488c00800cc020d5d0980f80100d180f8009baa35742603a0042a666ae68c070004044060c074004dd51aba135744603600460066ae84c068004054dd5000919192999ab9a30190011321223001003375c6ae84c06800854ccd5cd180c00089909118010019bae35742603400402a60340026ea80048488c00800c888cc06888cccd55cf800900911919807198041803980e8009803180e00098021aba2003357420040166eac0048848cc00400c00888cc05c88cccd55cf800900791980518029aba10023003357440040106eb0004c05088448894cd40044008884cc014008ccd54c01c028014010004c04c88448894cd40044d400c040884ccd4014040c010008ccd54c01c024014010004c0488844894cd4004024884cc020c010008cd54c01801c0100044800488488cc00401000cc03c8894cd40080108854cd4cc02000800c01c4cc01400400c4014400888ccd5cd19b8f0020010030051001220021001220011533573892010350543100164901022d31004901013700370e90001b874800955cf2ab9d2323001001223300330020020011", + "script_hash": "9068a7a3f008803edac87af1619860f2cdcde40c26987325ace138ad", + "valid_contract": true + } + ] + } +] From ca8f0e29d0eba330069c0f91f6d0466346f7696c Mon Sep 17 00:00:00 2001 From: Alessio Date: Mon, 12 Feb 2024 13:17:01 +0100 Subject: [PATCH 4/6] Applied hotfix from 1.5.2 Signed-off-by: Alessio --- src/main/java/com/devpool/thothBot/dao/AssetsDao.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/devpool/thothBot/dao/AssetsDao.java b/src/main/java/com/devpool/thothBot/dao/AssetsDao.java index 2949801b..e61edd29 100644 --- a/src/main/java/com/devpool/thothBot/dao/AssetsDao.java +++ b/src/main/java/com/devpool/thothBot/dao/AssetsDao.java @@ -57,7 +57,7 @@ public void addNewAsset(String policyId, String assetName, String displayName, I MapSqlParameterSource paramSource = new MapSqlParameterSource(); paramSource.addValue(FIELD_POLICY_ID, policyId); paramSource.addValue(FIELD_ASSET_NAME, assetName); - paramSource.addValue(FIELD_ASSET_DISPLAY_NAME, displayName); + paramSource.addValue(FIELD_ASSET_DISPLAY_NAME, displayName.replace("\u0000", "")); paramSource.addValue(FIELD_DECIMALS, decimals); namedParameterJdbcTemplate.update("insert into assets (policy_id, asset_name, asset_display_name, decimals) values (:policy_id, :asset_name, :asset_display_name, :decimals)", paramSource); From ae4a24cabf10b3db0e05430666a0786816f53c1b Mon Sep 17 00:00:00 2001 From: Alessio Date: Wed, 14 Feb 2024 15:03:10 +0100 Subject: [PATCH 5/6] minor fixes Signed-off-by: Alessio --- .../devpool/thothBot/scheduler/TransactionCheckerTaskV2.java | 1 - src/test/java/com/devpool/thothBot/IntegrationTest.java | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java b/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java index 2776b3e8..3ea7a864 100644 --- a/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java +++ b/src/main/java/com/devpool/thothBot/scheduler/TransactionCheckerTaskV2.java @@ -509,7 +509,6 @@ else if (receivedTokens) break; case TX_INTERNAL: messageBuilder.append(EmojiParser.parseToUnicode(":repeat: ")); - fundsTokenText += " (internal)"; break; } diff --git a/src/test/java/com/devpool/thothBot/IntegrationTest.java b/src/test/java/com/devpool/thothBot/IntegrationTest.java index 9afa76c7..9af317ff 100644 --- a/src/test/java/com/devpool/thothBot/IntegrationTest.java +++ b/src/test/java/com/devpool/thothBot/IntegrationTest.java @@ -303,10 +303,12 @@ public void scheduledNotificationsTest() throws Exception { String message = retrieveMessageByString(allMessages, "stake1u8uekde7k8x8n9lh0zjnhymz66sqdpa0ms02z8cshajptac0d3j32", "3af819e5583709c9e7b5b84614c60015b9bf10deb2b20756118cba707e531e53"); Assertions.assertTrue(message.contains("Fee 0.18")); + Assertions.assertTrue(message.contains("Internal Funds")); // TX internal, pool delegation message = retrieveMessageByString(allMessages, "stake1u8lffpd48ss4f2pe0rhhj4n2edkgwl38scl09f9f43y0azcnhxhwr", "3f31f56afbfa4c4bdd7c33d1f1d4ae0cedece2fa2bfb2934b914ea5e0dfb0142"); + Assertions.assertTrue(message.contains("Internal Funds")); Assertions.assertTrue(message.contains("[DEV]")); // TX sent funds, with message From 09b92c8ddb6f97340f2ededf7da1b58490ce289e Mon Sep 17 00:00:00 2001 From: Alessio Date: Wed, 14 Feb 2024 15:07:10 +0100 Subject: [PATCH 6/6] Version 1.5.3 --- pom.xml | 2 +- scripts/start.sh | 2 +- .../java/com/devpool/thothBot/telegram/command/HelpCmd.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 902e47ed..e397ac81 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.devpool thoth-bot - 1.5.2 + 1.5.3 Thoth Bot Cardano A Telegram Bot for the Cardano blockchain that monitors wallet activities and notifies users about TXs, etc. diff --git a/scripts/start.sh b/scripts/start.sh index 5d0cd50b..ab836aca 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -8,7 +8,7 @@ DB_PASSWORD="postgres" DB_HOST="localhost" DB_PORT="5432" DB_NAME="thoth" -THOTH_VERSION="1.5.2" +THOTH_VERSION="1.5.3" LOGS_FOLDER="${DIR}/logs" ADMIN_USERNAME="CHANGE_ME" diff --git a/src/main/java/com/devpool/thothBot/telegram/command/HelpCmd.java b/src/main/java/com/devpool/thothBot/telegram/command/HelpCmd.java index 090581a8..b3d7f60c 100644 --- a/src/main/java/com/devpool/thothBot/telegram/command/HelpCmd.java +++ b/src/main/java/com/devpool/thothBot/telegram/command/HelpCmd.java @@ -32,7 +32,7 @@ public class HelpCmd implements IBotCommand { * Some global constants */ public static final Map CONSTANTS = Map.of( - "$thoth.version", "1.5.2", + "$thoth.version", "1.5.3", "$donation.handle", "$thoth-bot", "$url", "https://github.com/DevStakePool/thoth-bot");