Skip to content

Commit

Permalink
Return message seq with mirrornode link to data.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsmithies committed Jul 20, 2024
1 parent 3caad27 commit 8b20058
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/hashgraph/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b20058

Please sign in to comment.