How to display information from a contract in the Dapp user interface?

Hi devs,

I would like to display some contract internal data in my application. Is it possible to trigger the request callback of a contract from external?

I found triggerContractByRequest but it seems to require the admin password. I don't want to provide the admin password to the user frontend. Do I need to manage this from an owned backend, that will request the data from the contract (including admin pw) and then publishes the data on a open API endpoint?

So far we've tried to send a message from the contract to the user account, but this turned out to be unstable in our case.

Is there maybe another way?

Thanks in advance

Using the triggerContractByRequest API and implementing public JO processRequest(RequestContext context) in the contract like in AllForOnePayment.java is indeed one way to do this.

The check for the admin password in this API is something we added back in 2018 for one of the first releases of the contract runner. Perhaps we can remove it for the next release since I can't think of a reason for such a strict restriction.

1 Like