Commit Graph

305 Commits

Author SHA1 Message Date
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
jmacxx
920e05562c
Feat: XMR subaddresses per account
incremente subaddress index at the start of the trade

Add subaccounts

Rename XmrAccountHelper to XmrAccountDelegate
Add map as final non null value

Persist subaccounts in User

Add display of used subaddresses and tradeId in account summary.
Main address and account index are the unique key for sub accounts.
Use the initial subaddress chosen by the user.

chimp1984 code review patch.

News badge/info for Account, disable old ones.

Show XMR subaddress popup info at Account (news badge), not startup.
2022-06-14 09:53:44 -05:00
Christoph Atteneder
98f355d3fa
Adapt navigational structure and offerbook handling to buy and sell different assets
Still missing correct create and take offer handling
2022-04-07 20:48:48 +02:00
ghubstan
a3990783a4
Send pretty payment details to api clients
Non-CLI clients need a better way of accessing payment details
than a contract json string.

- Add grpc.proto PaymentAccountPayloadInfo field: payment_details.
- Adjust proto wrapper PaymentAccountPayloadInfo to new field.
- Add test asserts to verify payment details are sent to client.
- Fix a test name: testKeepFunds -> testCloseTrade.

Based on branch `master` @ Sat 12 Mar 2022 01:42 PM -03 ,
         commit c6293b5273
2022-03-12 14:33:23 -03:00
ghubstan
b9b66b4826
Change grpc.proto TradeInfo field names
- is_fiat_sent		->	is_payment_started_message_sent
	Payment can be in altcoin.
- is_fiat_received	->	is_payment_received_message_sent
	Payment can be in altcoin.
- is_withdrawn		->	is_completed
	Trade can be closed with funds kept in Bisq wallet.
2022-02-27 18:09:36 -03:00
ghubstan
68ebdb2b08
Change grpc.proto field names to snake_case
Java client code can still use the camelCase field naming convention,
and other language bindings will not be forced to do the same.

Snake_case field names are also recommended in the Protocol Buffers
Sytle Guide:  https://developers.google.com/protocol-buffers/docs/style
2022-02-27 09:42:17 -03:00
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
Christoph Atteneder
1578f45ffc
Merge pull request #5812 from ghubstan/02-cli-console-formatting-api
Deprecate and replace hard-coded CLI console output formatters
2021-11-09 21:21:52 +01:00
ghubstan
20cc085dc8
Merge branch 'master' into 02-cli-console-formatting-api 2021-11-09 09:20:06 -03:00
chimp1984
7c32587453
Persist bsq blocks as buckets of 1000 blocks
Improve logging

Add BsqBlockStore to protobuf

Remove DaoStateMonitoringService field

Do not persist the blocks in daoState anymore.

This improves persistence performance and reduces memory
requirements for snapshots.
2021-11-09 13:01:19 +01:00
ghubstan
edd01418ca
Remove fields/methods/logic for creating redundant bsq-swap accounts
The user's default bsq-swap account is used instead.
2021-11-07 10:36:40 -03:00
chimp1984
1f929926cc
Remove prevHash from StateHash classes (the prevHash was only used for display.
For creating the hash we take the hash from the previous element. By removing it
we safe about 3 MB on data)

Add isSelfCreated field to DaoStateHash (indicates if we have created
the hash by ourself or if we have received it from a peer -> will be
part of later commits)
2021-11-04 12:48:09 +01:00
chimp1984
1abe68637d
Add useFullModeDaoMonitor field to PreferencesPayload
Add toggle to PreferencesView
Set useFullModeDaoMonitor default to true for headless nodes
2021-11-04 12:48:08 +01:00
chimp1984
f7fcaa915e
Add BSQ swap code 2021-11-02 16:18:50 +01:00
chimp1984
14765d6caa
Move protobuf OfferPayload.Direction to OfferDirection 2021-10-21 15:36:21 +02:00
chimp1984
d063aff5bf
Let OfferPayload extend OfferPayloadBase 2021-10-21 13:50:15 +02:00
chimp1984
a927bea71f
Add scriptTypeId to RawTransactionInput
Add convenience methods
2021-10-20 13:36:41 +02:00
chimp1984
88198be7ff
Rename availableConfirmedBalance to availableBalance
It does not include only confirmed txs as we include
the unconfirmed own change outputs.
2021-10-20 13:25:29 +02:00
jmacxx
b72b70ee8c
Add payment methods Strike and Verse 2021-10-12 14:37:26 -05:00
Christoph Atteneder
9ad4671773
Merge pull request #5746 from jmacxx/missing_invalid_transaction_diagnostic
Fix issue of Trade Step 1 validation done too soon
2021-10-12 10:02:23 +02:00
jmacxx
9ab659ceac
Fix issue of Trade Step 1 validation done too soon
Deprecate 4 states which are not used.
ShareBuyerPaymentAccountMessage can arrive before deposit broadcast completes.
2021-10-11 09:31:57 -05:00
jmacxx
df2d0b3332
Add payment methods Monese and SatisPay 2021-10-07 17:28:42 -05:00
jmacxx
b156f034ad
add payment methods Bizum and Pix 2021-10-03 18:19:37 -05:00
jmacxx
f792db98d0
add Nequi payment method
Signed-off-by: jmacxx <47253594+jmacxx@users.noreply.github.com>
2021-09-28 07:51:06 -05:00
jmacxx
9e5a1c2fd4
add payment method CelPay
Signed-off-by: jmacxx <47253594+jmacxx@users.noreply.github.com>
2021-09-28 07:51:05 -05:00
Christoph Atteneder
14c2e37cca
Merge pull request #5704 from ghubstan/fix-cli-alt-trade-volume-bug
CLI bug fix: show trade's contract volume, not moving offer volume
2021-09-27 11:17:21 +02:00
ghubstan
484f882077
Show frozen fiat trade cost in CLI console
This is a bug fix for the CLI's displayed fiat trade cost
value, which should be trade.volume, not offer.volume.  Offer volume
varies with BTC volatility, and the CLI should be showing the trade.volume
value instead, frozen when the contract is made.
2021-09-17 16:25:37 -03:00
jmacxx
78cd61564c
Add five Indian payment methods 2021-09-15 15:25:43 -05:00
jmacxx
3430055144
add SWIFT payment method
rebased to master
2021-09-08 14:57:08 -05:00
sqrrm
58e09c96ee
Merge pull request #5666 from ghubstan/08-handle-extradata-in-editoffer
Adjust API 'editoffer' to PR 5651 (include extraData field when editing offer)
2021-08-30 10:46:23 +02:00
jmacxx
984a269776
Add Payment Methods: Paysera and Paxum 2021-08-25 13:38:54 -05:00
ghubstan
71a61c63da
Display Enabled=PENDING in CLI 'createoffer' output
A newly created offer has no OpenOffer+State (AVAILABLE || DEACTIVATED)
when displayed in the CLI's console.  This change adds a 'bool isMyPendingOffer'
to the OfferInfo proto + wrapper, and the CLI's console offer output formatter
uses it to determine if it should display a new offer's Enabled column value
as PENDING, instead of an ambiguous NO value.
2021-08-14 16:58:47 -03:00
ghubstan
b8379e2003
Merge branch 'master' into 05-update-api-beta-test-guide 2021-07-30 11:53:34 -03:00
BtcContributor
3be547c445
Add Capitual payment method. Waiting for final Info text to add. 2021-07-19 13:28:11 +02:00
Christoph Atteneder
e5765aeef2
Delay sending of payment account information during trade by @chimp1984
It also removes the op return from the multisig transaction
2021-06-28 09:47:52 +02:00
ghubstan
32688a713f
Add bool isMyOffer to OfferInfo proto 2021-06-15 11:17:02 -03:00
ghubstan
1daf4715f8
Add OfferInfo field isActivated, rpc EditOffer to proto 2021-06-13 11:59:58 -03:00
BtcContributor
8dfe2601df
Restore proto order and add backward compatibility 2021-05-18 18:10:20 +02:00
BtcContributor
2809e8d768
Add Account owner full name field to Uphold payment method 2021-05-17 11:24:07 +02:00
ghubstan
2308afb41b
Adjust to changing minimum tx fee rates
- Append minFeeServiceRate to TxFeeRateInfo proto.
- Display min rate in CLI console.
- Fix broken test due to changing min fee rate.
2021-04-19 12:08:52 -03:00
ghubstan
6bde12ba40
Improve takeoffer output and failure reason messaging
- Added AvailabilityResultWithDescription proto for better takeoffer failure msgs.
- Added VerifyBsqSentToAddress impl to api, but don't expose to CLI yet.
- Show BSQ Buyer Address in gettrade output (changed cli output formatting classes).
- Fixed api.model.PaymentAccountPayloadInfo altcoin instant acct support bug
2021-04-01 16:40:08 -03:00
ghubstan
6299dc33d9
Merge branch '01-api-add-createcryptopaymentacct' into 02-api-trade-contract-details 2021-04-01 15:58:59 -03:00
ghubstan
4fbdc32ba4
Remove space char 2021-04-01 15:45:53 -03:00
ghubstan
58c885efc1
Add support for creating instant altcoin payment accounts in api
- Added bool tradeInstant field to proto message def.
- Adjusted core createcryptopaymentacct impl to new tradeInstant request param.
- Adjusted cli side createcryptopaymentacct impl to new tradeInstant request param.
- Fixed CliMain's takeoffer help text (was missing the --payment-account opt).
2021-04-01 15:43:48 -03:00
ghubstan
2d66a5996d
Merge branch 'master' into 01-api-add-createcryptopaymentacct 2021-04-01 14:54:05 -03:00
ghubstan
9e035e5542
Provide more offer & contract detail available to CLI.
This change adds offer and trade contract detail to the API's Offer
and Trade protos, and improves CLI output formatting.

- Appended missing fields to OfferInfo proto message:
	uint64 sellerSecurityDeposit = 20;
	string offerFeePaymentTxId = 21;
	uint64 txFee = 22;
	uint64 makerFee = 23;

- Added new api proto messages ContractInfo and PaymentAccountPayloadInfo.
  Lighterweight protos are needed because core Trade/Contract classes are
  not visible to CLI.

- Appended ContractInfo field to api proto message TradeInfo.

- Added proto / model converters for ContractInfo and PaymentAccountPayloadInfo,
  and adjusted OfferInfo & TradeInfo.

- Improved CLI output formatting.  Added more trade detail to CLI's gettrade output,
  and prepared to support BTC/BSQ trading pair.  Note a reviewer is advised to
  look at the CLI outout formatting class files instead getting bogged down in the
  many commit changes.
2021-03-25 19:23:06 -03:00
ghubstan
c3f5669cf8
Add api method createcryptopaymentacct
This change supports creation of BSQ BLOCKCHAIN payment method accounts.

- Added proto message defs to grpc.proto.
- Added grpc server boilerplate to GrpcPaymentAccountsService.
- Added server impl to CoreApi, CorePaymentAccountsService.
- Added createcryptopaymentacct-help.txt.
- Added CLI side support for new api method.
- Added opt parsing unit tests to OptionParsersTest.

This is the 1st PR in a series, with the goal of supporting the BTC/BSQ trading
pair.  Support for other crypto currency payment accounts will be added later.
2021-03-25 18:36:26 -03:00
Steven Barclay
f21379160b
Merge branch 'release/v1.6.0' into implement-segwit-for-bsq 2021-03-20 23:18:49 +00:00
ghubstan
344f1613d1
Fix api getfundingaddresses bug
This change uses recently added walletService.isAddressUnused to ensure
the api's CoreWalletsService creates an unused address if none exists.

- grpc.proto:  Add bool isAddressUnused field to message AddressBalanceInfo.
- AddressBalanceInfo:  Adjust AddressBalanceInfo proto wrapper.
- CoreWalletsService:  Use walletService.isAddressUnused in getFundingAddresses.
- GrpcClient:  Adjust to modified AddressBalanceInfo.
- TableFormat, ColumnHeaderConstants:  Add 'Is Used' column to getfundingaddresses output.

Note: bugfix is out of scope for this PR, but the test case helped expose this bug.
2021-03-19 21:24:26 +01:00
ghubstan
9b62a005df
Refactor takeoffer reply proto & ErrorMessageHandler
- Add description msg TakeOfferReply proto, and fromProto method
  to core.offer.enum AvailabilityResult.  The description field
  maps a client usable error message to the enum.

- Adjust GrpcErrorMessageHandler to add AvailabilityResult.description()
  to takeoffer reply.

- Refactor (split up) GrpcClient's takeOffer.  Add getTakeOfferReply()
  to give clients a chance to make choices based on the reply's
  AvailabilityResult when the takeoffer command did not result in a
  trade. (Some errors are fatal, some not.)
2021-03-19 19:38:03 +01:00
ghubstan
d747acc567
Adjust protos for takeoffer error handing
- Add PRICE_CHECK_FAILED to enum AvailabilityResult.
- Add enum AvailabilityResult to TakeOfferReply message.
2021-03-19 19:36:48 +01:00