Commit Graph

267 Commits

Author SHA1 Message Date
Steven Barclay
92da7956e6
Tidy logback files & add space back to log pattern
Uniformise the log patterns somewhat, by making the 'Logger' classname
field width either 15 for the seednode & statsnode, or 40 for the other
applications (lengthened from 30 in a few cases).

Also clean up the logback XML files somewhat, in particular removing
references to the old Thali (thaliproject/Tor_Onion_Proxy_Library) Tor
library, which was replaced years ago with our own fork of NetLayer
(https://github.com/cd2357/netlayer).

Finally, add a missing space back to the log pattern for bisq-desktop,
to prevent DEBUG, ERROR or TRACE lines appearing as follows:

  ... [JavaFX Application Thread] ERRORb.c.s.CommonSetup: ...

(It isn't clear whether this recently introduced behaviour was really
intentional, though it did prevent two consecutive spaces appearing in
the majority INFO log lines.)
2024-05-02 01:56:32 +02:00
jmacxx
9738d5387e
Add API for payment started with XMR auto conf params. 2024-02-26 08:39:39 -06:00
jmacxx
0eb50d420b
Expose isDaoStateReadyAndInSync status to API clients. 2024-02-09 13:30:28 -06:00
helixx87
9087e55218
API: gettransactions method - include in help 2023-06-08 10:32:19 +02:00
helixx87
aca897fa03
API: gettransactions method 2023-06-08 10:19:41 +02:00
helixx87
458f50dec9
Support "all" attribute in getoffers API method 2023-04-11 12:50:00 +02:00
ghubstan
23b9e1d9c2
Show CLI err msgs if invalid takeoffer params are used for taking bsq swap 2022-09-11 12:28:38 -03:00
ghubstan
2a5bc45af1
Add API CLI's takeoffer amount param 2022-08-06 15:09:52 -03:00
ghubstan
a12dd52b81
Add API method 'getavgbsqprice'
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.
2022-06-17 18:26:10 -03:00
ghubstan
b482618403
Move GetNetworkRequest down to WalletsServiceRequest 2022-06-16 15:45:51 -03:00
ghubstan
ae41e98db9
Add API API method 'getnetwork'
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.
2022-06-16 15:31:03 -03:00
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
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