Open marcosh opened 5 years ago
/tx/<hash>
, like in Client.purs. Example invocation: Studio.purs. URL to use: ExampleData.purswhere should the API retrieve the data?
As a starting point, maybe you could return some hardcoded transactions. Some example transaction chains are here:
Should I use the transitions function
Eventually, yes, as well as other functions.
which format should I use to return the data?
Example: https://testapi.statebox.io/tx/zFsGM27eBJwszedPLyzbErav4PMkj8WgrnukEfpnXFqe5.
Should I use data types from Transactions.purs?
Si. :)
I just pushed an update on this with more or less all the scaffolding.
Now I'd like to proceed with the most relevant part, which is retrieving the transaction data from the hash and output its data in the response. I have some doubts regarding these:
where should I retrieve the transaction data? I saw that the code which does that at the moment is in https://github.com/statebox/cloud/blob/master/services/tx/process-tx.js and interacts directly with Firebase
. Is this code something we want to keep or something we want to rewrite in Purescript? Do we want to abstract the fact that we are using Firebase? In other words, should I just proxy the hash call to this service or do I need to replace that service?
looking at the types in https://github.com/statebox/purescript-studio/blob/development/stbx-core/src/Statebox/Core/Transaction.purs, should the return type of the API be something like Tx TxSum
?
check https://hackmd.io/bC26TmAGRTe9mQt9D9ritw?view#purescript-studio-api-inbox for more notes on this
create a GET endpoint to retrieve all the transactions of a given protocol/process (which is the correct one of the two?)