Commit Graph

5071 Commits

Author SHA1 Message Date
ghubstan
c25debaf99
Add new (gson) PaymentAccountTypeAdapter to core.api.model
This class does most of the work of the api's (create) PaymentAccount
json form serialization/de-serialization.
2020-11-18 16:12:42 -03:00
ghubstan
7d0648afd0
Make codacy happy again 2020-11-18 13:10:39 -03:00
ghubstan
0e0af20900
Avoid codacy issue over use of fully qualified name
Changed the core getPaymentMethods() -> getFiatPaymentMethods() to avoid

"Unnecessary use of fully qualified name 'PaymentMethod.getPaymentMethods'
due to existing static import 'bisq.core.payment.payload.PaymentMethod.*'"
2020-11-18 12:58:58 -03:00
ghubstan
0046b08f9d
Revert "Avoid codacy issue over use of fully qualified name"
This reverts commit a46526198d.

The service side method name change is not correct.
2020-11-18 12:47:12 -03:00
ghubstan
a46526198d
Avoid codacy issue over use of fully qualified name
Had to change the getPaymentMethods() names to getPaymentMethodIds() to
avoid this codacy issue:

"Unnecessary use of fully qualified name 'PaymentMethod.getPaymentMethods'
due to existing static import 'bisq.core.payment.payload.PaymentMethod.*'"

If 'PaymentMethod.getPaymentMethods' was changed to 'getPaymentMethods',
a recursive loop would result, ending in an out of stack heap crash.

This renaming of the method on the server is correct, but the CLI's
'getpaymentmethods' name was not changed.
2020-11-18 12:29:59 -03:00
ghubstan
ec381522ff
Add api method 'getpaymentmethods'
Returns a list of supported payment method IDs.  This gives CLI users
the correct payment method id for creating a new payment account.

- Added gRPC service GetPaymentMethods to grpc.proto.

- Added gRPC boilerplate method to GrpcPaymentAccountsService.

- Added implimentation to CoreApi -> CorePaymentAccountsService.

- Refactored PaymentAccountTest hierarchy.

- Add api method to CLI.
2020-11-18 12:03:22 -03:00
ghubstan
530a9f95a4
Remove unused imports 2020-11-14 13:34:59 -03:00
ghubstan
187a85f95b
Fix typo 2020-11-14 13:19:24 -03:00
ghubstan
7e9ab22d65
Refactor api getbalance methods.
This change fixes the recently bloated wallet balances api.  Now there
is one CLI getbalance [bsq|btc] method that calls a getbalances(currency-code)
on the server.  The server returns full wallet balance information for
BSQ, BTC, or both if the CLI's currency argument is absent.

- grpc.proto:  Reduced number of getbalance(s) proto services from
  four to one.

- GrpcWalletsService:  Reduced number of getbalance(s) gRPC service
  boilerplate methods from four to one.

- CoreApi, CoreWalletsService:  Reduced number of getbalance(s) gRPC
  service implementation methods from four to one.

- CliMain:  Reduced number of getbalance(s) commands from four to one.

- BalancesInfo: Changed BsqBalanceInfo & BtcBalanceInfo field names
  to bsq and btc, respectively, to make calling their accessors
  more readable, less verbose.

- BtcBalanceInfo, BsqBalanceInfo: Defined static final EMPTY instances
  as place holders in a BalancesInfo returned by the gRPC server, when
  one or the other balance types is not requested.  Would be nice
  to serve Optional.empty() instead, but protobuf does not support
  it or null.

- Adjusted affected api tests and build doc.
2020-11-14 13:08:10 -03:00
ghubstan
722460e7e5
Support paying trade fees in bsq or btc (api)
- Add optional makerFeeCurrencyCode argument to CLI's 'createoffer'.

- Add optional takerFeeCurrencyCode argument to CLI's 'takeoffer'.

- Add isCurrencyForMakerFeeBtc field to OfferInfo proto wrapper.

- Pass fee currency argument down to CoreOffersService and CoreTradesService's
  create and take offer methods.

- Add maybeSetFeePaymentCurrencyPreference method to OfferUtil to
  conditionally set the 'payFeeInBtc' preference before creating
  or taking an offer.

- Adjust affected tests.
2020-11-13 16:36:06 -03:00
ghubstan
4a90b4008a
Resolve 'Avoid creating BigDecimal with a decimal' issue for codacy 2020-11-13 15:52:30 -03:00
ghubstan
446bd328d8
Refactor desktop's BsqSendView, share with api
Moved just enough code out of BsqSendView to avoid desktop/api
'sendbsq' duplication, at the cost of adding 1 new method to
BsqSendView.

- Created new BsqTransferModel to hold tx details shared by desktop and api.

- Created new BsqTransferService to send bsq using a BsqTransferModel shared
  by desktop and api.

- Uncommented CoreWalletsService#sendBsq implementation.

- Uncommented sendbsq tests.
2020-11-13 15:34:18 -03:00
ghubstan
0d3b3a6ead
Stub out api method 'sendbsq' in core
All the boilerplate for this method is included in this change, but
the implementation in CoreWalletsService#sendBsq is commented out
until the needed logic to send bsq is refactored out of desktop's
BsqSendView class -- to be included in the next PR.

- Added new method to CLI.

- Added the gRPC server boilerplate.

- Added the core implementation, commented out.

- Enabled tests.
2020-11-13 14:57:28 -03:00
ghubstan
208a37b339
Implement and test new getbalance(s) api methods
- Added three new methods to CLI:

      getbalances   ...	returns complete bsq and btc balance info
      getbsqbalance ...	returns complete bsq balance info
      getbtcbalance ...	returns complete btc balance info

      The old getbalance method is deprecated and will be removed
      if there is agreement to do that.

- Made the needed changes in the CLI's output formatting classes.

- Added new tests to existing BsqWalletTest, added new BtcWalletTest
  and WalletBalancesTest.

- Added disabled tests for funding a bsq wallet (todo in next PR).
2020-11-13 14:21:26 -03:00
ghubstan
c1c099c832
Implement and test api method 'getunusedbsqaddress'
- Added new method to CLI, split some long msg strings into two lines,
  and added a white space after a braceless else statement.

- Added the gRPC server boilerplate.

- Added the core implementation.

- Added a test, and moved method wallet tests into their own package.
2020-11-13 12:40:16 -03:00
ghubstan
faf45ec301
Add proto wrappers for serving bsq, btc or all balances
This change adds proto wrappers for sending bsq, btc, or all balances
to the CLI.  They will be used in future api method implementations:
getbsqbalance, getbtcbalance and getbalances.
2020-11-13 11:24:08 -03:00
Christoph Atteneder
61c8d55a6f
Merge pull request #4791 from wiz/remove-legacy-bsq-explorers
Remove legacy BSQ explorers
2020-11-13 14:07:02 +01:00
wiz
5a08c8b7ba
Remove legacy BSQ explorers 2020-11-13 21:29:36 +09:00
wiz
c2baf3fa7d
Temporarily disable wiz's monero explorer node
Will re-enable later after making a new monero node on a new server
2020-11-13 21:03:30 +09:00
Christoph Atteneder
50c7d6c126
Merge pull request #4774 from deusmax/market_offers_chart
Market Offers chart modifications
2020-11-12 14:34:39 +01:00
Christoph Atteneder
64fd3a607a
Merge pull request #4782 from sqrrm/cleanup-signed-witness
Refactor trade limit check
2020-11-12 09:38:03 +01:00
Christoph Atteneder
def2b7cc68
Merge pull request #4783 from m52go/account-limits-text
Adapt account limits language for 1.5.0
2020-11-12 09:30:51 +01:00
Christoph Atteneder
34c802d505
Merge pull request #4780 from jmacxx/fix_issue_4719
Add encrypted wallet password prompt when sending funds from BSQ wallet
2020-11-12 09:06:27 +01:00
m52go
adc58bf4d8
Adapt account limits language for 1.5.0 2020-11-11 10:14:19 -05:00
sqrrm
4180ea08fd
Refactor trade limit check
Return early for anything that doesn't have age dependent trade limits
Remove unnecessary method
Fix switch case
2020-11-11 15:15:51 +01:00
Christoph Atteneder
c707e63f35
Merge pull request #4781 from chimp1984/use-30-day-average-for-marektcap
Use 30 days average USD/BSQ price for market cap
2020-11-11 11:10:54 +01:00
Christoph Atteneder
0c47cf0e20
Merge pull request #4764 from jmacxx/fix_issue_4727
Don't allow trade start if BitcoinJ is not fully synced
2020-11-11 10:44:07 +01:00
jmacxx
48a515be01
Add encrypted wallet password prompt when sending funds from BSQ wallet
Correct wording of transaction confirmation popup to use 'mining fee'
instead of 'transaction fee' to make it consistent with wording of
the BTC confirmation popup.
2020-11-10 20:14:44 -06:00
chimp1984
9135397ded
Use 30 days average USD/BSQ price for market cap 2020-11-10 20:51:13 -05:00
Deus Max
c9936c5595
Improve view of market offers chart
* Both axes use autoRange, which results in better
    rounded values for the tick mark labels numbers.
  * Filter-out data outside the factor limits.
  * New constant chartDataFactor for factor limits.
  * Formatted tick label currency numbers:
    - Fiat: display with grouping separators
    - Cryptos: remove trailing zeros in fractional parts
  * Add CSS class axisy for y-axis formatting.
2020-11-10 22:27:04 +02:00
jmacxx
0ddd333ce6
Don't allow trade start if BitcoinJ is not fully synced
Adds a check that chain height is within 3 blocks of the reported
height from bitcoin peers -> if not the user cannot take an offer
or have an existing offer taken.  It shows a message informing the
user that Bisq is not currently synced, advising them to do an
SPV resync if necessary.

Additionally under Settings/Network a field has been added
to show the chain height of Bisq vs the Peer group.

Added after discussion with chimp1984:
- Correct initialization of chainHeight property
- Rename "Latest BTC block height" display field for clarity
- Enforce chain sync rule for Take Offer scenario
- Enforce chain synch rule for Check offer availability scenario
- change method name to be clearer
2020-11-10 14:15:39 -06:00
Christoph Atteneder
0345c795e2
Merge pull request #4767 from jmacxx/fix_issue_4765
Remove default fee rate from Bisq startup screen
2020-11-09 10:00:25 +01:00
Christoph Atteneder
470685b729
Merge pull request #4768 from chimp1984/add-new-birningman-address
Add new burningman address for delayed payout txs
2020-11-09 09:23:57 +01:00
chimp1984
8ab16e5e3a
Add new burningman address for delayed payout txs
See; https://github.com/bisq-network/roles/issues/80#issuecomment-723577776
2020-11-08 18:38:02 -05:00
jmacxx
8484398dee
Remove default fee rate from Bisq startup screen
The display of fee rate on the startup screen is misleading because
at startup a fee has not been received from the mempool fee service
and instead the default value of 50 sats is shown.

This change causes the fee rate not to be displayed until a response
has been received from the service.

Fixes #4765
2020-11-08 08:38:05 -06:00
chimp1984
f835396d71
Change log level 2020-11-05 15:50:02 -05:00
Bayer
7163344084
Update core/src/main/resources/i18n/displayStrings.properties
Co-authored-by: m52go <mfiver@gmail.com>
2020-11-05 09:47:31 +01:00
Bayer
80d87a728d
Apply suggestions from code review
Co-authored-by: m52go <mfiver@gmail.com>
2020-11-05 09:47:22 +01:00
Bayer
90c00097ac
Fix display strings lines 2968-3437 2020-11-05 09:47:11 +01:00
Christoph Atteneder
b8fbc74d6c
Merge pull request #4744 from sqrrm/cleanup-signed-witness
Cleanup signed witness
2020-11-05 09:42:46 +01:00
chimp1984
5817525776
Check for 0 and only apply the value in that case.
See comment at change for more background.
2020-11-04 12:54:35 -05:00
chimp1984
c9b3f9d457
Set initial value for bsqAverageTrimThreshold to 5% in case of an
update (using persisted preferences which would
have value set to 0 as it was not existing in old version)
2020-11-04 11:34:10 -05:00
chimp1984
5c7906980c
Clean up mailbox messages for closed trades
Util for removing pending mailbox messages in case the
trade has been closed by the seller after confirming receipt
and a AckMessage as mailbox message will be sent by the
buyer once they go online. In that case the seller's trade
is closed already and the TradeProtocol is not executing
the message processing, thus the mailbox message would not
be removed. To ensure that in such cases (as well other
potential cases in failure scenarios) the mailbox message
gets removed from the network we use that util.
2020-11-03 22:08:38 -05:00
Christoph Atteneder
63cae1ceb1
Merge pull request #4745 from chimp1984/fix-bug-with-reading-historical-data
Fix bug with reading historical data
2020-11-03 21:56:05 +01:00
chimp1984
ab5645b864
Fix issue with getting complete handler called twice from P2PService
We used a delegate method in P2PService for calling readPersisted on p2PDataStorage and peerManager.
This was from old times when those classed have not been injected classes. The complete handlers got
called from both p2PDataStorage and peerManager but we counted only P2PService as host, so the
countdown completed before the last host was really completed, leading to a nullpointer in
MainView (not always).

We removed now PersistedDataHost interface from P2PService and use P2PDataStorage and PeerManager to be added to hosts.
2020-11-03 13:01:35 -05:00
sqrrm
02e53304ed
Cleanup unused argument 2020-11-03 17:35:29 +01:00
sqrrm
7f734292f3
Cleanup line breaks 2020-11-03 16:59:15 +01:00
sqrrm
0f0b75c2ac
Change time dependent trade limits
This is in accordance with https://github.com/bisq-network/proposals/issues/264

Any account type that doesn't need signing can now trade the full
amount immediately, same goes for signed type accounts that are
selling.

Signed type accounts that are buying now has minimum limit (0.01 BTC) up until
30 days after getting signed, then the limit is increased to 0.5 times the max
limit (0.125 BTC) and after 60 days they get the full limits (0.25 BTC).
2020-11-03 16:58:14 +01:00
Christoph Atteneder
8fe8261a1e
Clean up code 2020-11-03 15:42:46 +01:00
Luis Aranguren
ecf9d49f65
Resolve conflicts with master 2020-11-03 15:42:23 +01:00