Commit Graph

288 Commits

Author SHA1 Message Date
jmacxx
0eb50d420b
Expose isDaoStateReadyAndInSync status to API clients. 2024-02-09 13:30:28 -06:00
Alva Swanson
c8f686ba56
Apply AppStartPlugin to all desktop applications 2023-09-10 22:10:09 +02:00
Alva Swanson
9ce8f83719
Gradle: Centralize application setup 2023-08-05 15:14:04 +02: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
Alva Swanson
52ab467a65
Remove redundant 'useJUnitPlatform()' declarations 2023-05-13 23:05:04 +07:00
Alva Swanson
796205c7a6
Remove redundant 'testRuntimeOnly libs.junit.jupiter.engine' 2023-05-13 23:05:04 +07:00
Alva Swanson
6e0e5028a3
Move JUnit dependency definition to bisq.java-conventions 2023-05-08 17:51:05 +10:00
helixx87
458f50dec9
Support "all" attribute in getoffers API method 2023-04-11 12:50:00 +02:00
Alva Swanson
c1c4caf87f
Gradle: Apply bisq.java-conventions to all projects 2023-02-05 22:02:13 +01:00
Alva Swanson
0dd7fc630b
Create build.gradle for cli module 2023-01-16 17:26:30 +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
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