Skip to content

Commit

Permalink
fix: broken tx table link on nft page (#913)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ckniffen authored Jan 6, 2024
1 parent d752492 commit bca4e12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rippled/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
}
Expand Down

0 comments on commit bca4e12

Please sign in to comment.