Prerequisite for next PR: Add API method 'gettrades'
The `gettrades` method will show 'open', 'closed', and 'failed' trades.
Users already needed to be able to fail and unfail trades for the
same reasons they do in the UI. API test cases will need to be able to
fail and unfail trades to check correct behavior of 'gettrades' method.
Based on branch `rename-keepfunds2closetrade`.
Trade proceeds and deposits have already been transfered to Bisq wallets
before the `keepfunds` command is (was) executed; `keepfunds` merely moves
open trades to closed trades lists and persistence files. Renaming `keepfunds`
as `closetrade` makes its purpose clear to API users.
The commit modifies only method names and comments in api server+cli classes,
apitest cases, and api trade simulation scripts.
Based on `master`
The method 'getoffer' should support looking up a user's open-offers, and other users' available offers.
- Adjust api-beta-test-guide.md to use only 'getoffer'.
- Adjust trade simulation scripts to use only 'getoffer'.
- Adjust api testcases to use 'getoffer' in place of 'getmyoffer'.
- Mark appropriate methods and protobuf msgs as deprecated.
There are no asserts, but helpful for looking at affects of CLI commands
from terminal because apitest cases use gRPC service stubs instead of terminal.
The OfferIdOptionParser superclass reduces duplication for parsing
offer-id parameters, but it needs to let subclass parsers' other
options pass validation.
- Made several adjustments to CLI's 'gettrade' output related code
so it can show single trade details for either Bisq v1 trades, or
BSQ swap trades.
- Did minor refactoring of API's core to retrieve # tx confirmations
for an addresses and transactions.
- Show # of tx confirmations in bsq swap trade detail.
This commit refactors the first cut of the BsqSwapTradeInfo and
TradeInfo gRPC proto defs and wrappers. The change avoids duplication
of fields between BsqSwapTradeInfo and TradeInfo, and adds a
bsqSwapTradeInfo field to the old TradeInfo proto & wrapper.
The immediate goal is moving towards getting the API's 'gettrade'
method to work for both Bisq v1 trades and BSQ swap trades: the TradeInfo
proto sent to the CLI should represent either a Bisq v1 trade or a BSQ
swap trade. A mid-term term goal is to also make a new 'gettrades' method
return a List<TradeInfo> to the CLI, where items in the List<TradeInfo>
can be either v1 trades or bsq-swap trades.
- Adjust to removal of BsqSwapOfferInfo proto, use ammended OfferInfo instead.
- Remove currency-code param from all get(My)BsqSwapOffer(s) requests.
- Add new OfferCategory getAvailableOfferCategory(String offerId) service.
CLI uses this to determine which kind of gRPC request object should be
sent with a 'takeoffer' request.
- Adjust GetOffersSmokeTest to help see offer/swap-offer CLI output.
If not present, a default BSQ swap account is saved when a User object
is initialized. Use the existing default account in API bsq-swap test
cases, and rename the legacy BSQ payment account fixtures to distinguish
them from the new default 'BSQ Swap' payment account.
Fixes problem simlar to other CLI output changes in this PR.
CLI's 'gettrade' output should show contracted trade.price instead of
moving offer.price value for price margin based altcoin offers.
This fixed bug did not affect any fiat or BSQ trades, only price margin
based XMR trades, and API support for XMR trading has not yet been
released.
This is a bug fix for the CLI's displayed altcoin trade amount
value, which should be trade.volume, not offer.volume. It has been
hidden by the stability of the BSQ price, and exposed while testing
API support for XMR trades.