[bisq-network/bisq] Update api beta test guide: add 'editoffer' (#5577)

Christoph Atteneder notifications at github.com
Fri Jul 16 09:00:16 CEST 2021


> > When trying to use the API programatic I recognized that it is not 100% straight forward working with the API response. E.g. parsing through lines like this `'Sell BSQ (Buy BTC) 0.00003800 0,02000000 526.32 Altcoins 2021-07-13T09:31:56Z IRDQJ-30666af2-460b-4f23-94a5-ec632913b8d0-165 ` You can't simply split for spaces as the first value contains spaces as well. Maybe we could improve the layout so it is easier to work with (provide JSON response by using a parameter?)
> 
> To justify and align column values, I have to add quite a bit of right-padding and left-padding, and that's what's making parsing so difficult.
> 
> @dmos62 and I discussed this... he also wanted a more machine friendly CLI console output. I think Json is the answer. But that's another project/PR in itself and I don't think it should be rushed into this PR.
> 
> I work around this problem in the apitest trading simulation scripts: Look at line 234 in `trade-simulation-utils.sh`.
> 
> ```
> gettradedetail() {
>     TRADE_DESC="$1"
>     # Get 2nd line of gettrade cmd output, and squeeze multi space delimiters into one space.
>     TRADE_DETAIL=$(echo "$TRADE_DESC" | sed -n '2p' | tr -s ' ')
>     commandalert $? "Could not get trade detail (line 2 of gettrade output)."
>     echo "$TRADE_DETAIL"
> }
> ```
> 
> The bash function `gettradedetail` takes one parameter, the full, raw `gettrade` CLI output (the header and values rows).
> That raw `TRADE_DESC` variable gets squeezed into `TRADE_DETAIL`, where multi-space delimiters are replaced by single space delimiters.

Yes, I was able to work with the current format as well, it is just an additional mental hurdle for devs playing around with the API. Sure, no need to squeeze JSON support into this PR as well, but I think it would make the API way more accessible for other devs trying to implement their use cases.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5577#issuecomment-881223885
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210716/d387cc85/attachment.htm>


More information about the bisq-github mailing list