From 0bc9cbde8160f7f897d4bacac8d89e89f2bb405a Mon Sep 17 00:00:00 2001 From: jejolare Date: Thu, 21 Mar 2024 22:15:40 +0700 Subject: [PATCH] stringify ins/outs for txs from pool --- server/server.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/server/server.js b/server/server.js index 7ec657c..3828ba3 100644 --- a/server/server.js +++ b/server/server.js @@ -332,10 +332,22 @@ app.get( response.last_block = lastBlock.height res.json(response); } else { - let response = await get_tx_details(tx_hash) - let data = response.data + let response = await get_tx_details(tx_hash); - data.last_block = lastBlock.height + let data = response.data; + + if (data?.result?.tx_info) { + data.result.tx_info.last_block = lastBlock.height + + if (data?.result?.tx_info.ins && typeof data.result.tx_info.ins === 'object') { + data.result.tx_info.ins = JSON.stringify(data.result.tx_info.ins); + } + + if (data?.result?.tx_info.outs && typeof data.result.tx_info.outs === 'object') { + data.result.tx_info.outs = JSON.stringify(data.result.tx_info.outs); + } + + } if (data.result !== undefined) { res.json(data.result.tx_info)