File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ const handleDecode = async (
26
26
"x-covalent-api-key"
27
27
] ;
28
28
const { chain_name, tx_hash } = req . body as DecodeTXRequest ;
29
- const tx = await fetchTxFromHash (
29
+ const rawTx = await fetchTxFromHash (
30
30
chain_name as Chain ,
31
31
tx_hash ,
32
32
covalentApiKey
@@ -37,22 +37,22 @@ const handleDecode = async (
37
37
nft_sale_details,
38
38
lending_details,
39
39
safe_details,
40
- ...metadata
41
- } = tx ;
40
+ ...tx
41
+ } = rawTx ;
42
42
const events = await decodeLogsfromTx (
43
43
chain_name as Chain ,
44
- tx ,
44
+ rawTx ,
45
45
covalentApiKey
46
46
) ;
47
- const parsedMetadata = JSON . parse (
48
- JSON . stringify ( metadata , ( _key , value ) => {
47
+ const parsedTx = JSON . parse (
48
+ JSON . stringify ( tx , ( _key , value ) => {
49
49
return typeof value === "bigint" ? value . toString ( ) : value ;
50
50
} )
51
51
) ;
52
52
res . json ( {
53
53
success : true ,
54
54
events : events ,
55
- metadata : parsedMetadata ,
55
+ tx : parsedTx ,
56
56
} ) ;
57
57
} catch ( error ) {
58
58
next ( error ) ;
You can’t perform that action at this time.
0 commit comments