7

In Lecture 10 from the Plutus Pioneer Programm there is a replica of the Uniswap Smart Contract built on top of Plutus. It is actually part of the standard Plutus use cases Plutus Uniswap

To have a better user experience and to get to know it better i wanted to build a GUI around it. If you are interested you can find it in this github repo

Now to my question. What is the reason behind the design decision for the Status endpoint of the Plutus PAB Rest API. In order to read the funds we have first to call the funds Endpoint which returns nothing and secondly you have to call the status endpoint.

This is the Frontend Code from Lars where he reads the funds

This makes it very difficult if you want to have concurrent calls one for the funds and one for the pools

Why is there not a dedicated status endpoint for funds and pools?

5
  • This got me wondering too. I posted a question but never got any answer: cardano.stackexchange.com/questions/4908/… It seems, the Plutus team is not active on this forum.
    – Jey
    Commented Jan 7, 2022 at 12:22
  • 1
    I just registered for the third cohort of the ppp. There i will ask this Question in the Q&A session. As soon as i know more i will post it here. Commented Jan 8, 2022 at 7:28
  • Great, I'm looking forward. I am not participating in the cohort, but I would have a lot of questions.
    – Jey
    Commented Jan 8, 2022 at 11:05
  • the link to frontend code is broken, can you please update?
    – LexTRX
    Commented Jan 30, 2022 at 15:56
  • 1
    Thank you @LexTRX it is updated now Commented Jan 31, 2022 at 16:56

1 Answer 1

-2

The only way to read a state of the smart contract is using a contract instance status endpoint (api/contract/instance/$INSTANCE_ID/status). Other endpoints can only trigger a change of the state but they cannot return it so it's always a two step process.

1
  • This does not really answer my question. I do already know how to read the different states. My question was why it is designed like this. It even contradicts completely the functional approach of Haskell Language. Commented Dec 10, 2021 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.