IntersectMBO / plutus

The Plutus language implementation and tools
Apache License 2.0
1.57k stars 479 forks source link

Is it possible to query blockchain datums, UTXOs by address over PAB API? #3418

Closed anton-k closed 3 years ago

anton-k commented 3 years ago

Area

[] Plutus Application Framework* Related to the Plutus application backend (PAB), emulator, Plutus libraries

Describe the feature you'd like

I'm writing an crypto-exchange platform. I would like to query the rate of exchange. I can easily do it in the Contract monad by reading corresponding datum. but is it possible to query this info over PAB servant API?

Am I missing some endpoint or is it not implemented yet?

ghost commented 3 years ago

Well, there is nothing special for this kind of operations in PAB. But it can be implemented as usual endpoint if I got the idea.

There is Plutus.PAB.Webserver.API that exports NewAPI — an interface for querying the contracts.

There is an example in plutus-pioneer-program in week06.

anton-k commented 3 years ago

Thanks, I see. I need to implement endpoint that saves the data that I need with tell of Contract monad. And then I can fetch it with status-method