From bca4e124d66e4cce43b520e7a3864f13c5d20e19 Mon Sep 17 00:00:00 2001 From: Caleb Kniffen Date: Fri, 5 Jan 2024 18:52:45 -0600 Subject: [PATCH] fix: broken tx table link on nft page (#913) Clio changed the `nft_history` response to move `hash` up a level instead of `tx` when specifying api version 2. This bug is happening on devnet and testnet explorers. Related to #895 --- src/rippled/lib/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rippled/lib/utils.js b/src/rippled/lib/utils.js index cc04bf4da..2c95c4db4 100644 --- a/src/rippled/lib/utils.js +++ b/src/rippled/lib/utils.js @@ -77,6 +77,8 @@ const formatAccountInfo = (info, serverInfoValidated) => ({ const formatTransaction = (tx) => { // `tx` is the property for some v1 arrays of transactions such as account_tx and `tx_json` is used in v2 for all const txn = tx.tx || tx.tx_json || tx + // `hash` is up a level on v2 responses objects + const hash = txn.hash || tx.hash return { tx: { ...txn, @@ -90,7 +92,7 @@ const formatTransaction = (tx) => { date: txn.date ? convertRippleDate(txn.date) : undefined, }, meta: tx.meta || tx.metaData, - hash: txn.hash, + hash, ledger_index: txn.ledger_index, date: txn.date ? convertRippleDate(txn.date) : undefined, }