moneroexamples / onion-monero-blockchain-explorer

Onion Monero Blockchain Explorer
https://xmrchain.net
BSD 3-Clause "New" or "Revised" License
362 stars 269 forks source link

Return related transaction to public keys in API #213

Closed SamsungGalaxyPlayer closed 3 years ago

SamsungGalaxyPlayer commented 4 years ago

The browser currently allows you to work backwards from a decoy output to the transaction that it is created in. This is not possible when using the API. The API presents the "block_no" and "public_key." While I can query the block for the list of transactions and build a local database to see which transaction matches the public key, I would rather the API return the transaction that the public_key is associated with like in the web version. This would save me multiple API requests when trying to work backwards from decoys.

moneroexamples commented 4 years ago

Thanks for the info. I will check that.

rbrunner7 commented 3 years ago

I stumbled over the same issue today. While the public keys that the API now returns in the mixin data are very hard to process further, transaction hashes would be much more useful and of course straightforward to process.

moneroexamples commented 3 years ago

You mean the following APi endpoint?

api/outputs?txhash=&address=&viewkey=&txprove=<0|1>

rbrunner7 commented 3 years ago

No, like most probably @SamsungGalaxyPlayer as well I refer to api/transaction/<tx_hash>. When it lists the "mixins" of the transaction, it gives "public_key". This is quite unwieldy to query further as far as I could see.

Imagine I want to use the API to produce a nice list of the ring members of a transaction, showing which transactions the decoy outputs are from, like the explorer does in HTML.

As a workaround I intend to use that, grab the HTML the explorer produces and locate the links to the ring members to get at the info, as an alternative to using the API.

moneroexamples commented 3 years ago

Added to branch https://github.com/moneroexamples/onion-monero-blockchain-explorer/tree/api_tx

The branch builds with monero's release-v0.17. If you have time, you can check if possible.

@SamsungGalaxyPlayer Sorry it took so long.

rbrunner7 commented 3 years ago

Tested, works. Thanks!

moneroexamples commented 3 years ago

@rbrunner7 Thanks. Soon will merge to master branch.

moneroexamples commented 3 years ago

Marge. Closing. https://github.com/moneroexamples/onion-monero-blockchain-explorer/pull/229