Commit Graph

222 Commits

Author SHA1 Message Date
ghubstan
3077be54f0
Remove API createoffer's paymentAcctId request param (BSQ swap) 2021-11-25 16:12:05 -03:00
ghubstan
0c5c343fe0
Adjust CLI to support getting/taking BSQ swaps
Also refactored some of the opt parsers.
2021-11-24 13:10:34 -03:00
ghubstan
d8f1e446ea
Try to hide from pesky codacy 2021-11-14 14:30:41 -03: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
ghubstan
fc53ca48c1
Add CLI output IntegerColumn 2021-11-14 13:40:59 -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
ghubstan
16be35790b
Paritally adjust bsq-swap-offer related gRPC CLI side classes
- Adjust to removal of BsqSwapOfferInfo proto, use ammended OfferInfo instead.

- Remove currency-code param from all get(My)BsqSwapOffer(s) requests.

- Add new OfferCategory getAvailableOfferCategory(String offerId) service.
  CLI uses this to determine which kind of gRPC request object should be
  sent with a 'takeoffer' request.

- Adjust GetOffersSmokeTest to help see offer/swap-offer CLI output.
2021-11-11 13:20:58 -03:00
ghubstan
3f61375622
Remove white space 2021-11-07 14:19:38 -03:00
ghubstan
eb57b7e75e
Merge branch '01-use-default-bsq-swap-acct' into 02-cli-console-formatting-api 2021-11-07 14:04:13 -03:00
ghubstan
1d403e7a42
Add CLI test dependency to check console output diffs, and tests 2021-11-07 14:01:36 -03:00
ghubstan
0341104823
Adjust CLI classes to new console output api 2021-11-07 13:59:58 -03:00
ghubstan
08d16e6040
Deprecate old CLI console output formatters
A minor refactoring of some deprecated classes is included.
2021-11-07 13:51:27 -03:00
ghubstan
19436c3e2f
Add new bisq.cli.table classes 2021-11-07 13:47:32 -03: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
ghubstan
eb234bf93a
Remove apitest's create bsq-swap account method
If not present, a default BSQ swap account is saved when a User object
is initialized.  Use the existing default account in API bsq-swap test
cases, and rename the legacy BSQ payment account fixtures to distinguish
them from the new default 'BSQ Swap' payment account.
2021-11-05 13:59:41 -03:00
chimp1984
1c1b2802cc
Apply codacy review suggestions 2021-11-02 16:18:50 +01:00
chimp1984
f7fcaa915e
Add BSQ swap code 2021-11-02 16:18:50 +01:00
chimp1984
54f17b00af
Cleanups 2021-10-21 17:44:48 +02:00
chimp1984
611b944609
Move protobuf OfferPayload.Direction to OfferDirection 2021-10-21 15:40:25 +02:00
ghubstan
55cb126e4f
Show trade.price in margin based altcoin 'gettrade' console output
Fixes problem simlar to other CLI output changes in this PR.
CLI's 'gettrade' output should show contracted trade.price instead of
moving offer.price value for price margin based altcoin offers.

This fixed bug did not affect any fiat or BSQ trades, only price margin
based XMR trades, and API support for XMR trading has not yet been
released.
2021-09-18 13:40:55 -03:00
ghubstan
542aa774b0
Fix typo in help text 2021-09-18 12:40:58 -03:00
ghubstan
a0f3d0a44c
Show correct altcoin trade amount (volume) in CLI console
This is a bug fix for the CLI's displayed altcoin trade amount
value, which should be trade.volume, not offer.volume.  It has been
hidden by the stability of the BSQ price, and exposed while testing
API support for XMR trades.
2021-09-17 16:28:07 -03: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
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
649c98a3f0
Always use Locale.US in CLI DecimalFormats
Avoid inconsistent CLI output decimal formats across different
systems' default locales.
2021-07-15 12:43:29 -03:00
ghubstan
eb62f9354a
Rename and move private function
And make sure function is not duplicated CLI side logic.
2021-07-12 11:28:33 -03:00
ghubstan
b74f084893
Optionally show ENABLED column in CLI's getoffer(bsq) output 2021-06-18 17:50:28 -03:00
ghubstan
063b52eb70
Add editoffer test case, suppress annoying warnings 2021-06-15 11:39:06 -03:00
ghubstan
4da64b9bd0
Improve 'editoffer' opt parsing, fix test pkg name 2021-06-15 11:27:23 -03:00
ghubstan
e2a205a31d
Show enable/trigger-price cols for 'getmyoffer' 2021-06-15 11:24:27 -03:00
ghubstan
05f3985447
Fix problems found in codacy check 2021-06-13 13:54:16 -03:00
ghubstan
be249c5e79
Add editoffer to CLI 2021-06-13 12:56:29 -03:00
ghubstan
d2939cc567
Add new EditOfferOptionParser and test 2021-06-13 12:43:02 -03:00
ghubstan
9231e48c43
Refactor GrpcClient: request builders moved bisq.cli.request pkg
Reduces size of GrpcClient while allowing for additional bot-friendly
variations of the new grpc editOffer method.
2021-06-13 12:35:43 -03:00
BtcContributor
a39da12ef6
Fix cli test that blocks building on Windows 2021-04-23 11:16:22 +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
40e76fb4ee
Remove white space in console msg 2021-04-15 14:57:44 -03:00
ghubstan
e96da16df8
Complete API support for BSQ/BTC trade pair
- Finished API server's verify bsq payment impl.
- Added verifybsqsenttoaddress method to CLI.
- Added verifybsqsenttoaddress-help.txt to server.
- Fixed client getoffers, getmyoffers to work with BSQ offers.
2021-04-15 14:21:25 -03:00
ghubstan
bddc273bb2
Fix spelling 2021-04-02 12:58:46 -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
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
aad998cf3a
Fix maker/taker fee format bug, rename methods 2021-03-28 16:42:55 -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
27b090005d
Add cli side help for createcryptopaymentacct 2021-03-25 18:46:41 -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
ghubstan
8f092a6b4d
Fix comment, left justify non-numeric column value 2021-03-20 19:08:21 -03:00
ghubstan
8783889c36
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-15 16:15:06 -03:00
ghubstan
588541ed15
Add bot convenience: getMyOffersSortedByDate(String currencyCode) 2021-03-15 13:48:32 -03:00
ghubstan
10e721767f
Add convenience (get all offers, both directions), and make sorter public 2021-03-15 13:20:05 -03:00