[bisq-network/proposals] Use a GRPC API as core API and use wrappers around for other API types (#136)

chimp1984 notifications at github.com
Mon Nov 11 23:40:33 UTC 2019


@cbeams  
Thanks for looking into it! I did not had time to write a Readme, so great that you added those instructions how to get it running quickly.

For the headless/deamon version you use the `bisq.core.app.BisqHeadlessAppMain` and pass the same data directory (e.g. using `--appName=bisq-API-demo`) as you use in Desktop so you can setup all in a normal desktop app (like BTC funding, payment accounts) and then close it and start the headless app which will execute the API calls. 

Yes, I agree that current option keys are way too verbose ;-).
We also should add at least one option for the port.

I added just recently the placeOffer endpoint which allows you to create an offer via the API.
Here is an example call:
`placeOffer CNY BUY 750000000 true -0.2251 100000000 50000000 0.12 ea6b8f0d-217e-4190-8417-0f02cf90ab1e` 
The last param is the payment account ID which needs to be adjusted to the your custom accounts. You get all payment accounts with the `getPaymentAccounts` endpoint. 
Currency need to be adjusted as well....

Here are the all parameters for placeOffer:
`String currencyCode,
String directionAsString,
long priceAsLong,
boolean useMarketBasedPrice,
double marketPriceMargin,
long amountAsLong,
long minAmountAsLong,
double buyerSecurityDeposit,
String paymentAccountId`

The current state was just a proof of concept to let me see how much effort it is to get the main use cases implemented and it was surprisingly fast to get that working. The refactoring from code from the Desktop module to a new Core service class was also not too hard (about 3 hours work).

Whats mainly missing is an authentication mechanism, some more sophisticated input parser (atm it uses a scanner and splits parameters) and input validation. For the placeOffer use case it also misses atm the fee selection (BSQ or BTC) and it would require a bit more cross checks (e.g. check balance,...).  And of course some endpoint documentations.

I will not have time to continue to work on that so anyone who is interested is welcome to take over...

-- 
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/proposals/issues/136#issuecomment-552667760
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191111/2e3dc598/attachment.html>


More information about the bisq-github mailing list