Commit Graph

249 Commits

Author SHA1 Message Date
ghubstan
2e9e51eb41
Remove GetTradeStatistics service from grpc.proto
This protobuf definition and service stub has been in place since
the start of work on the API, but was never fully implmented, nor
intended to be included in the API beta & v1 releases.

Its presence added a useless section to the gRPC API Reference doc.

	https://ghubstan.github.io/slate

Based on branch `7-more-grpcproto-comments`,
PR https://github.com/bisq-network/bisq/pull/6068.
2022-02-26 11:11:26 -03:00
ghubstan
c0631eb31f
Fix file/merge conflict 2022-02-25 20:51:55 -03:00
Stan
1499465c11
Merge branch 'master' into 7-more-grpcproto-comments 2022-02-25 20:46:05 -03:00
ghubstan
464c5a81c9
Be consistent in use of apostrophe 2022-02-21 08:13:13 -03:00
ghubstan
6e56660394
Fix comment error 2022-02-21 08:09:42 -03:00
ghubstan
9f013bd6c2
Fix errors in comments 2022-02-21 08:00:31 -03:00
ghubstan
fcd9c7e4d3
Finish 1st full pass of documenting grpc.proto for API reference site 2022-02-21 07:48:02 -03:00
ghubstan
8271920943
New comments through "message TxInfo { ... }" 2022-02-20 20:20:33 -03:00
ghubstan
5cc928a7e5
Disambiguate grpc.proto offer pct literal field names
Rename double marketPriceMargin -> marketPriceMarginPct.
Rename double buyerSecurityDeposit -> buyerSecurityDepositPct.
2022-02-20 15:16:02 -03:00
ghubstan
3b22aeeb98
Change TradeInfo .proto's price & volume fields to string 2022-02-19 15:06:42 -03:00
ghubstan
d42c58073f
Change OfferInfo proto's volume fields' type to string 2022-02-18 16:43:23 -03:00
ghubstan
62a0a1405d
Change existing uint64 triggerPrice field type in grpc.proto to string triggerPrice. 2022-02-18 11:23:41 -03:00
ghubstan
89267e5851
Fix typo in comment 2022-02-17 18:11:46 -03:00
ghubstan
461edff631
Change OfferInfo proto's 'price' field type to string
Much less ambiguous field value at cost of breaking backward compat in API.
2022-02-17 17:27:15 -03:00
ghubstan
ddd3ec3243
Fix comment about changing "all" number fields to string
We will consider each problematic number field one at a time.

Note: changing field types in following commits will break
the API's backward compatibility, but devs agree it's OK since
it is still in beta.
2022-02-17 13:39:06 -03:00
ghubstan
4596960191
Prepare API Offers .proto defs for significant changes
This commit adds comments to grpc.proto to be pulled into a new API
reference doc.  Some of the comments highlight issues to be resolved
in following PRs.

The main focus is on documenting gRPC Offers service definitions in
grpc.proto:

- Comment each field in the Offers service's messages.
- Add TODO comments about fixing field defs with usability &
  consistency problems.

Other API reference doc related changes to grpc.proto:

- Comment each gRPC service's rpc method definitions, however briefly.
- Improve some existing rpc method comments.
2022-02-17 13:31:17 -03:00
ghubstan
bcfb1cbf87
Remove "has no parameters" comments from grpc.proto 2022-02-13 17:57:53 -03:00
ghubstan
0fe850bf0e
Begin commenting grpc.proto for bisq-grpc-api-doc
Banner comments were replace by simple service description comments.

Rpc methods were commented, some field level comments were moved to
to bisq-grpc-api-doc comment conventions.
2022-02-12 17:52:03 -03:00
ghubstan
62e5aaf4f8
Add license comment 2022-02-12 17:03:35 -03:00
ghubstan
459aea803f
Remove banner style comments from pb.proto
The bisq-grpc-api-doc generator needs comments spefic to protobuf
message definitions, not groups of message defs.  This kind of
information can be included in the message specific comments.

Also changed some existing comments, and added others to suggest
a commenting style for .proto message and field defs.
2022-02-12 16:57:11 -03:00
Christoph Atteneder
fcb13ed772
Merge pull request #5976 from ghubstan/1-gettrades
Add API 'gettrades' method
2022-02-01 11:10:45 +01:00
jmacxx
57821b7474
Clear account payload info & chats from closed trades & disputes. 2022-01-31 14:58:22 -06:00
ghubstan
0e020e8987
Add payout fields to trade proto msgs, show optional trade/tx fees in swaps 2022-01-23 17:03:43 -03:00
ghubstan
69e6c9ce70
Remove duplicated buyer/seller proto fields (already exist no OfferInfo) 2022-01-20 16:50:08 -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
55a54f39b4
Add GetTrades proto message, + needed TradeInfo fields 2022-01-16 16:36:27 -03:00
Bisq GitHub Admin
ddead5ef54
Merge pull request #5953 from jmacxx/logs_upload
Feature enabling log file upload to mediators
2022-01-12 09:41:32 +01: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
jmacxx
9334cffc89
Feature enabling log file upload to mediators 2022-01-06 13:22:44 -06: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
Stan
53d693d710
Merge branch 'master' into 7-deprecate-api-getmyoffer 2021-12-27 12:09:22 -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
sqrrm
cf81fd451c
Merge pull request #5876 from ghubstan/5-api-bsqswap-simulation-n-docs-update
API BSQ swap simulation script and doc updates #5
2021-12-14 15:47:51 +01:00
Steven Barclay
db6025a08d
Add separate ProofOfWork.solution proto field for Equihash
Avoid repurposing the 'ProofOfWork.payload' field for Equihash puzzle
solutions, as that may be of later use in interactive PoW schemes such
as P2P network DoS protection (where the challenge may be a random nonce
instead of derived from the offer ID). Instead, make the payload the
UTF-8 bytes of the offer ID, just as with Hashcash.

Also, make the puzzle seed the SHA-256 hash of the payload concatenated
with the challenge, instead of just the 256-bit challenge on its own, so
that the PoW is tied to a particular payload and cannot be reused for
other payloads in the case of future randomly chosen challenges.
2021-12-07 02:22:33 +00:00
Steven Barclay
24d2a7f222
Code cleanup: proto fields, duplicated expr & null char separator
1. Reorder the PoW fields in the 'Filter' proto by field index, instead
 of contextually.
2. Deduplicate expression for 'pow' & replace if-block with boolean op
 to simplify 'FilterManager::isProofOfWorkValid'.
3. Avoid slightly confusing use of null char as a separator to prevent
 hashing collisions in 'EquihashProofOfWorkService::getChallenge'. Use
 comma separator and escape the 'itemId' & 'ownerId' arguments instead.

(based on PR #5858 review comments)
2021-12-06 22:55:14 +00:00
ghubstan
64f228d872
Make rpc GetOfferCategory service work for my+avail offers
There are some use cases where the CLI needs to know what kind of offer
is being acted on before the request is made, For example:

There are differences between a BsqSwap 'takeoffer'request, and a v1
'takeoffer' request.

A BsqSwap offer cannot be edited by an 'editoffer' request, and an
attempt should be blocked by the CLI.

- Append isMyOffer GetOfferCategoryRequest rpc msg def.

- Adjust daemon.grpc services for new boolean GetOfferCategoryRequest param.

- Adjust core.api for new boolean GetOfferCategoryRequest param.

- Add validation check in core.api EditOfferValidator to block attempt to
  edit a BsqSwap offer.

- Refactor CoreOffersService get*offer(id) methods to optionally throw
  excpetions.
2021-11-27 14:01:14 -03:00
Steven Barclay
e0595aa284
Store difficulty as floating point in Filter & PoW
Change the type of the 'difficulty' field in the Filter & ProofOfWork
proto objects from int32/bytes to double and make it use a linear scale,
in place of the original logarithmic scale which counts the (effective)
number of required zeros.

This allows fine-grained difficulty control for Equihash, though for
Hashcash it simply rounds up to the nearest power of 2 internally.

NOTE: This is a breaking change to PoW & filter serialisation (unlike
the earlier PR commits), as the proto field version nums aren't updated.
2021-11-26 04:08:15 +00:00
ghubstan
3077be54f0
Remove API createoffer's paymentAcctId request param (BSQ swap) 2021-11-25 16:12:05 -03:00
ghubstan
17277c4c67
Remove Get/Take BSQSwap Offer/Trade rpc service defs
The old GetTrade and TakeOffer rpc service defs will be used
for getting BSQ swap trades, and taking BSQ swap offers.
2021-11-24 12:52:58 -03:00
Steven Barclay
d8d8ec3f97
Add PoW version(-list) fields to ProofOfWork & Filter
Add a numeric version field to the 'ProofOfWork' protobuf object, along
with a list of allowed version numbers, 'enabled_pow_versions', to the
filter. The versions are taken to be in order of preference from most to
least preferred when creating a PoW, with an empty list signifying use
of the default algorithm only (that is, version 0: Hashcash).

An explicit list is used instead of an upper & lower version bound, in
case a new PoW algorithm (or changed algorithm params) turns out to
provide worse resistance than an earlier version.

(The fields are unused for now, to be enabled in a later commit.)
2021-11-24 15:07:42 +00:00
ghubstan
b65cc9c1f4
Merge branch 'master' into 1-basic-api-bsqswap-support 2021-11-23 17:02:49 -03:00
Christoph Atteneder
ef7ce109ac
Merge pull request #5834 from jmacxx/dispute_ui_add_penalty
Add penalty calculation to dispute agent UI
2021-11-18 17:57:54 +01:00
jmacxx
5c00e1974e
Add penalty calc to dispute UI 2021-11-18 08:43:06 -06:00
ghubstan
4ca878a8e1
Adjust API 'gettrade' for Bsq swaps
- 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.
2021-11-14 13:48:12 -03:00
chimp1984
a082fd4a84
Add fee fields to filter 2021-11-14 15:07:32 +01:00
ghubstan
9f01279141
Merge branch 'master' into 1-basic-api-bsqswap-support 2021-11-12 18:56:54 -03:00
ghubstan
564303ac20
Normalize API gRPC bsq-swap related protos & wrappers
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.
2021-11-12 18:48:35 -03:00
jmacxx
bf311e36fb
Add payment methods ACH Transfer and Domestic Wire Transfer 2021-11-12 11:50:43 -06:00
ghubstan
5924312e64
Adjust bsq-swap-offer related gRPC services & msgs
- Adjust GetBsqSwapOffer(s) rpc services to remove currency param.
- Adjust OfferInfo and remove BsqSwapOfferInfo.
- Add GetOfferCategory service so CLI can determine what kind of takeoffer service is to be used.
- Add comment about adding sub-message BsqSwapTradeInfo field to TradeInfo.
2021-11-11 12:51:00 -03:00
jmacxx
f72b6c0b0a
Add payment methods Tikkie and TransferWise-USD 2021-11-10 21:48:10 -06:00