From 8b200582fa6cee801424054a95d3261b971210cd Mon Sep 17 00:00:00 2001 From: Matt Smithies Date: Sat, 20 Jul 2024 21:55:25 +0100 Subject: [PATCH] Return message seq with mirrornode link to data. --- app/hashgraph/client.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/hashgraph/client.js b/app/hashgraph/client.js index 90dd4c4..91290c8 100644 --- a/app/hashgraph/client.js +++ b/app/hashgraph/client.js @@ -126,14 +126,17 @@ class HashgraphClient extends HashgraphClientContract { .setMaxTransactionFee(new Hbar(100, HbarUnit.Hbar)) .execute(client) - await transaction.getReceipt(client) + const receipt = await transaction.getReceipt(client) + const topicSequenceNumber = receipt.topicSequenceNumber.toString() // Remember to allow for mainnet links for explorer const messageTransactionResponse = { reference, topic_id, + topicSequenceNumber, transaction_id: transaction.transactionId.toString(), - explorer_url: Explorer.getExplorerUrl(transaction.transactionId) + explorer_url: Explorer.getExplorerUrl(transaction.transactionId), + mirror_node_query: `${Config.mirrornodeUrl}/api/v1/topics/${topic_id}/messages/${topicSequenceNumber}` } return messageTransactionResponse