IntersectMBO / plutus-apps

The Plutus application platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to get transactions ids from validator hash

volodyad opened this issue · comments

Describe the feature you'd like

At the moment we use waitForUpdateTimeout or awaitUtxoProduced to listen utxo created on the script,
but this approach only works when the listener contract is running while the utxo produced.

What if we have method like getTxIdsForValidatorAddress, getLastTxIdFromValidatorAdrress in contract effects, so all transactions ids executed on script could be retrieved.
In this case it would be possible to get last tx id from the chainindex and get the latest contract state even if there is not state utxo left.
It would be very usefull for retrieving last datum even if state machine utxo or contract state utxo ( like in uniswap) already consumed by owner and there is not state left on the validator script

Describe alternatives you've considered

No response

Have to echo this. The ability to get all transactions referencing a script is very useful in several use cases. We do it for security research as well. Could help implement this if the team is happy with it.

@kk-hainq are you following a similar approach to @volodyad by listening for events and storing those yourself?

We run periodic client requests (poll-style) so worse than listening to events!