API clients looking at their BSQ swap trades -- BSQ buyers
specifically -- were seeing a 0.00 BSQ trade fee, due to an
incorrect assumption BSQ sellers paid the entire BSQ trade
fee for both sides. BSQ Swap execution via API has been
working just like the GUI (same code-base), but the reported
trade fee for the BSQ buy side was wrong.
This change shows the correct BSQ trade fee.
Partially addresses issue https://github.com/bisq-network/bisq/issues/6355
The transient currencyCode member is null until the getter method
has been used, so we should no access the variable directly.
This fixes a problem with OfferBook filtering, which was checking
for isFiat(currencyCode); the variable was null and isFiat returned
the wrong answer.
This API bug was relying on the UI purposed TaskRunner to bubble up an
insufficient funds error to the client, but it cannot do that.
This change blocks the takeoffer attempt if sufficient funds are not
found after the swap model calculates the taker's trade amounts.
Related: https://github.com/bisq-network/bisq/pull/6221
Based on https://github.com/bisq-network/bisq/pull/6250.
Based on branch `add-api-price-service-getaverageprice`.
Returns volume weighted average BSQ price in BTC and USD over N days.
The need for this arose while creating a Java BSQ Swap bot example
(PR pending). API bots can use this to determine whether or not to
take swap offers based on their price distance above or below the 30
(or 90) day trade price average.
Returns name of the BTC network API daemon is connected to.
I am working on some Java bot examples in another repo, and want to stop
worrying about accidentally simulating trade payments on mainnet, despite
all the warnings I add in comments. The 'getnetwork' method allows bots
to know what network the API daemon is connected to, and gives API bot
devs and users a way to avoid one potential source of costly mistakes.
API CLI manpage and apitest case are included in this commit.