Commit Graph

272 Commits

Author SHA1 Message Date
ghubstan
b3e6160f19
Keep CLI console output text lowercase where possible
Be consistent.
2022-05-15 18:57:23 -03:00
ghubstan
8e5acf277d
Fix API CLI gettrades bug: category param can be upcase
When category param value was uppercase, e.g.,
  $ ./bisq-cli --password=xyz --port=9998 gettrades --category=OPEN
CLI validation failed:
  Error: No enum constant bisq.cli.opts.GetTradesOptionParser.CATEGORY.OPEN

This fixes the bug, and --category=open now passes CLI validation.

Based on `master`.
2022-05-15 16:26:29 -03:00
ghubstan
639d3994ca
Accept a VERSION parameter, default to SNAPSHOT 2022-03-28 11:05:13 -03:00
ghubstan
365ed4cc42
Comment the daemon & cli zipfile creation scripts 2022-03-28 10:50:17 -03:00
ghubstan
8382419a3b
Set execution bit on bash scripts 2022-03-26 14:02:36 -03:00
ghubstan
645b9d6046
Create API daemon & cli releases as zip files
Each distribution contains a runnable jar with a MANIFEST.MF
defining the classpath (all jar files in lib/).

To run daemon.jar:  $ java -jar daemon.jar --apiPassword=xyz
To run cli.jar:     $ java -jar cli.jar --password=xyz <cmd>

TODO Sign jar files, generate checksums.
2022-03-26 13:28:39 -03:00
ghubstan
784e2ae894
Send meaningful io.grpc.Status.Code to gRPC clients
Exceptions thrown by the core.api services for the daemon Grpc*Services
have to be converted into gRPC StatusRuntimeExceptions before being sent to
gRPC clients.  Most of these gRPC StatusRuntimeExceptions had a gRPC
Status.Code.UNKNOWN, which not helpful to client error handlers.

This change partially resolves the issue by sending more meaningful
io.grpc.Status.Codes to clients, where possible.  But it is not as
comprehensive as it an be for a webapp because HTTP has so many more
possible response status codes than the gRPC library (sixteen). See:
https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/Status.java

There are three types of changes:

- Create custom exceptions in bisq.core.api.exception.

- Map any custom bisq.core.api.exception to a meaningful
  io.grpc.Status.Code within daemon Grpc*Service classes.

- Adjust apitest cases to new grpc status codes.

Based on branch `move-cli-crypto-offer-filter-to-server`,  PR https://github.com/bisq-network/bisq/pull/6086
2022-03-05 20:31:50 -03:00
ghubstan
b7fb3df0d4
Move get (cryptocurrency) offer filter to daemon
Some API reference & Python bot examples exposed an API bug the Java CLI
has been hiding. Due due this Bisq v1 Offer entity design:

- In fiat offers, the baseCurrencyCode=BTC, counterCurrencyCode=FiatCode
- In altcoin offers, baseCurrencyCode=AltcoinCode, counterCurrencyCode=BTC,

new API examples were not doing what the CLI has been doing for several
months, which is get (cryptocurrency) all BTC offers from the server,
and filter on the altcoin code.  The CLI side filtering should have been
done on the server, as it is in this commit.

A lot of dead gRPC client side offer filtering code is removed as well.

Based on `master`.
2022-03-03 16:19:00 -03:00
ghubstan
82a0f0060c
Adjust to grpc.proto TradeInfo field name changes
See commit b9b66b4826.
2022-02-27 18:13:54 -03:00
ghubstan
5acef133ab
Delete dead code 2022-02-20 19:01:50 -03:00
ghubstan
fade8bc0d9
Show CLI gettrades' Deviation col-value with precision=2 (do something) 2022-02-20 18:52:56 -03:00
ghubstan
23303187be
Change mktPriceMarginOpt name to mktPriceMarginPctOpt
And validate the opt value.
2022-02-20 18:14:47 -03:00
ghubstan
8f93c27deb
Fix CLI gettrades' Deviation column value format (do nothing) 2022-02-20 18:11:24 -03:00
ghubstan
d2ba39b28c
Adjust cli module to new .proto *Pct field names 2022-02-20 15:21:13 -03:00
ghubstan
e49ab16a7a
Adjust cli to TradeInfo .proto's price & volume type change
Quite a bit of refactoring.  A lot of number-string formatting was removed.
2022-02-19 15:16:32 -03:00
ghubstan
31c8fbb679
Remove some dead code 2022-02-18 16:48:32 -03:00
ghubstan
2056e26384
Adjust cli module to grpc.proto::volume field type change (string) 2022-02-18 16:45:37 -03:00
ghubstan
68450c455f
Adjust to string triggerPrice change in API cli classes 2022-02-18 11:24:23 -03:00
ghubstan
3405dbf5c3
Adjust cli module to OfferInfo.price field change to string type 2022-02-17 17:57:45 -03:00
ghubstan
135a42ba45
Delete deprecated CLI console output formatting classes
The new console output formatting (tbl) api is working, and the
deprecated classes just add maintenance work.

Update affected test cases.
2022-02-17 15:00:52 -03:00
ghubstan
ef00a2cc0f
Remove unused class 2022-01-25 18:14:58 -03:00
ghubstan
d902e77710
Add Bisq license banners 2022-01-25 11:44:42 -03:00
ghubstan
89c4ab3c61
Use toTradeFeeBtc, not toTradeFeeBsq 2022-01-23 17:13:52 -03:00
ghubstan
fdd91a8293
Fix displayed bsq-swap's optional trade & tx fees 2022-01-23 17:06:48 -03:00
ghubstan
2a3a2988ec
Fix maker/taker fee column headers & value func defs 2022-01-20 16:57:45 -03:00
ghubstan
b10cb119f2
Display trade.txFee for BSQ swap trades 2022-01-20 15:54:50 -03:00
ghubstan
3cd1e05a9f
Try to display accurate status of closed trades, or "Pending" if still open 2022-01-18 13:01:42 -03:00
ghubstan
ffa31b0af7
Support gRPC gettrades call in CLI 2022-01-16 16:51:28 -03:00
ghubstan
4c7ae49e18
Format gettrades CLI outout 2022-01-16 16:48:58 -03:00
ghubstan
7690ffd953
Add API methods 'failtrade', 'unfailtrade'
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`.
2022-01-07 19:11:34 -03:00
ghubstan
a9aaba87fa
Rename API method keepfunds -> closetrade
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`
2022-01-05 12:10:46 -03:00
ghubstan
cb4df2b1c3
Rename CLI opt '--payment-account' -> '--payment-account-id'
Adjust related docs and scripts.
2021-12-27 13:10:16 -03:00
ghubstan
5f571cccca
Deprecate API 'getmyoffer'
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.
2021-12-27 12:05:17 -03:00
ghubstan
98b41cb56c
Use string in BigDecimal ctor, and make codacy happy too 2021-12-03 13:33:20 -03:00
ghubstan
0f32fe2fc3
Merge branch '5-api-bsqswap-simulation-n-docs-update' into 6-api-xmr-trading 2021-12-03 13:16:26 -03:00
ghubstan
f195b76637
Tell user bsqswap offer cannot be edited, but can be canceled at no charge
Resolves issue described in https://github.com/bisq-network/bisq/pull/5876#pullrequestreview-822692137
2021-12-03 12:47:03 -03:00
ghubstan
65fb8e8225
Add CliMain.main(args) tests
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.
2021-12-02 19:17:03 -03:00
ghubstan
a45c5fa61f
Adjust CLI opts parsers & opt parsing test for XMR support 2021-12-02 19:09:54 -03:00
ghubstan
03b57916a5
Make altcoin offer sorting method names more generic 2021-12-02 19:07:49 -03:00
ghubstan
54f815eb4f
Adjust API cli-side CryptoCurrencyUtil & OffersServiceRequest for XMR support 2021-12-02 19:04:28 -03:00
ghubstan
b1dd20572c
Allow unrecognized options in OfferIdOptionParser where appropriate
The OfferIdOptionParser superclass reduces duplication for parsing
offer-id parameters, but it needs to let subclass parsers' other
options pass validation.
2021-11-29 12:30:13 -03:00
ghubstan
66115f3d81
Revert "There is no --swap opt in editoffer command"
This reverts commit b5981b5b71.

This was a mistake.  There is a swap opt in the createoffer command.
2021-11-28 14:56:57 -03:00
ghubstan
b5981b5b71
There is no --swap opt in editoffer command
BSQ swap offers cannot be edited
2021-11-27 14:17:52 -03:00
ghubstan
b95e4b37b6
Block attempts to edit BsqSwap offers from CLI 2021-11-27 14:01:38 -03:00
ghubstan
05d1916ae9
Fix help text typo 2021-11-26 10:54:28 -03:00
ghubstan
0aa0852407
Add CLI createoffer smoketest (for bsq swaps)
NEVER RUN ON MAINNET!
2021-11-25 18:21:06 -03:00
ghubstan
132ecc9ac3
Adjust CliMain's createoffer for BSQ swaps 2021-11-25 18:20:04 -03:00
ghubstan
eff10842b9
Tighten createoffer param validation (only bsq swaps supported) 2021-11-25 17:31:54 -03:00
ghubstan
35aeb61338
Adjust createoffer opt parser for bsq swaps 2021-11-25 17:10:19 -03:00
ghubstan
b1c872c515
Adjust createoffer opt parser/test for bsq swaps 2021-11-25 17:08:07 -03:00