Commit Graph

12720 Commits

Author SHA1 Message Date
ghubstan
f1db254073
Make formatSatoshis visible for testing 2020-10-27 13:01:33 -03:00
ghubstan
a3631a022f
Implement api methods 'keepfunds', 'withdrawfunds'
The CoreTradesService was refactored to work for newly added api methods:

- keepfunds -- close trade, keep funds in bisq wallet

- withdrawfunds -- close trade, withdraw funds to external btc wallet

A getKey accessor was added to CoreWalletsService (needed by withdrawfunds impl).
2020-10-26 20:44:39 -03:00
ghubstan
a8decafc2f
Stub out api methods 'keepfunds', 'withdrawfunds'
This PR adds trade closing method stubs to keep funds in the
Bisq wallet or send them to an external BTC wallet.

- Add grpc protos
- Add new methods to GrpcTradesService, CoreApi
- Stub out implementations in CoreTradesService
- Add methods to CLI
2020-10-26 17:43:08 -03:00
ghubstan
a2b292318c
Add boolean 'showcontract' argument to api's 'gettrade'
Optionally print the json contract for a given trade id.
2020-10-25 17:44:18 -03:00
ghubstan
2b23704b5a
Add 'gettrade' to api method CLI 2020-10-25 17:15:02 -03:00
ghubstan
31435bba51
Move semicolon up from blank line 2020-10-25 17:02:40 -03:00
ghubstan
d8bc26588c
Add license comment 2020-10-25 16:52:45 -03:00
ghubstan
3379376bab
Refactor CLI output formatting code & add trade formatter
- Move output column header specs to its own shared constants class.

- Add new TradeFormat class for printing trade details in the console.

- Print formatted trade in api trade tests -- to see output before
  using formatter in CLI (in next PR).
2020-10-25 16:50:22 -03:00
ghubstan
161dbade0d
Add getRole(tradeId) to core api
API users will need to see their role as maker/taker when looking at trade details.

- Add getRole(trade) to TradeUtil.
- Add getTradeRole(tradeId) to CoreApi, CoreTradesService.
- Add role field to TradeInfo proto and its wrapper class.
2020-10-25 16:22:20 -03:00
ghubstan
bbd7a31c88
Remove unused import 2020-10-25 11:38:03 -03:00
ghubstan
95bcb1ef9c
Refactor PendingTradesDataModel methods -> TradeUtil
Scope of this refactoring is small;  more can be done, but the short
term goal is to share trade util logic with core api.

- Removed unused method getCurrencyCode()
- Made minor style changes
- Removed duplicated code block
2020-10-25 11:27:30 -03:00
ghubstan
36ad137949
Remove trailing spaces for codacy 2020-10-25 10:54:40 -03:00
ghubstan
24ba9215cd
Refactor PendingTradesViewModel methods -> TradeUtil & OfferUtil 2020-10-25 10:41:19 -03:00
ghubstan
ccd3c99f2e
Fix comment typos 2020-10-24 17:45:01 -03:00
ghubstan
296e4f98cb
Replace static TradeUtil with singleton TradeUtil
The API is going to need some desktop trade utilities, which should be
shared between :desktop and :core.api.
2020-10-24 17:26:10 -03:00
ghubstan
63cf436990
Add fields to grpc TradeInfo proto & wrapper 2020-10-24 16:27:03 -03:00
ghubstan
ab20225cd2
Add compiler warning suppression, remove comment 2020-10-24 16:25:20 -03:00
ghubstan
cb65de6d2e
Block on tx-fee-request in core TakeOfferModel init
Added license comment too.
2020-10-23 12:47:06 -03:00
sqrrm
9e76f5fdc3
Merge pull request #4606 from ghubstan/remove-dup-statuscheck
Delete redundant core.api.StatusCheck
2020-10-23 15:42:34 +02:00
sqrrm
380a57a37a
Merge pull request #4685 from chimp1984/update-monitor-with-last-version-from-freimairs-repo
Update monitor with last version from freimairs repo
2020-10-22 23:38:56 +02:00
chimp1984
9a018ccd47
Adopt to new PersistenceManager 2020-10-22 14:49:16 -05:00
chimp1984
57064a091b
Remove change in Connection (issue with config when not using guice is
solved in another PR which we will add to that PR in next commits)
2020-10-22 11:40:08 -05:00
chimp1984
f3e0696078
Reorg imports, reformat code according to your style guide 2020-10-22 11:38:34 -05:00
Florian Reimair
6c1d7509a1
Cleanup and refactoring 2020-10-22 11:36:26 -05:00
Florian Reimair
292f057f22
Added volume-per-trader metric 2020-10-22 11:36:26 -05:00
Florian Reimair
1f1b7390f0
Added offers-per-trader metric 2020-10-22 11:36:26 -05:00
Florian Reimair
3674d36a91
Added offer-volume-distribution 2020-10-22 11:36:26 -05:00
Florian Reimair
ac27ea69ec
Added offer volume feed metric 2020-10-22 11:36:26 -05:00
Florian Reimair
7c5043063a
Code cleanup 2020-10-22 11:36:25 -05:00
Florian Reimair
70347ed989
Fix connection config for monitor
The monitor does not use the common bisq app base featuring guice.
Hence, the `config` in the `Connection` class is never injected
and leads to NullPointerExceptions and ultimately breaks the monitor.

This workaround initilizes default values in case guice isn't there.
2020-10-22 11:36:17 -05:00
sqrrm
0e7070a5fa
Merge pull request #4679 from ghubstan/5-suggested-changes
Changes suggested in PRs 4672,4673,4674,4675
2020-10-22 16:33:52 +02:00
ghubstan
1f3554ef65
Remove redundant calculateTotalToPay() call
Resolves issue found during https://github.com/bisq-network/bisq/pull/4673
review, and suggested in comment
https://github.com/bisq-network/bisq/pull/4673#discussion_r510111662
2020-10-22 10:55:53 -03:00
ghubstan
d463dd14a0
Remove useless default tx fee calculations
Resolves issue found during https://github.com/bisq-network/bisq/pull/4673
review, and suggested in comment
https://github.com/bisq-network/bisq/pull/4673#discussion_r510110682

Also shortened comment lines to < 90 chars.
2020-10-22 10:41:04 -03:00
ghubstan
31a311903a
Simplify result handler argument
Resolves issue found during https://github.com/bisq-network/bisq/pull/4673
review, and suggested in comment
https://github.com/bisq-network/bisq/pull/4673#discussion_r510089605
2020-10-22 10:17:12 -03:00
ghubstan
fa0e05a336
Remove redundant getTrade(id) method
Resolves issue found during https://github.com/bisq-network/bisq/pull/4673
review, and mentioned in comment
https://github.com/bisq-network/bisq/pull/4673#discussion_r510090257
2020-10-22 10:09:35 -03:00
sqrrm
01d434170f
Merge pull request #4682 from bisq-network/release/v1.4.2
Release/v1.4.2
2020-10-22 10:57:26 +02:00
Christoph Atteneder
177c9c8af3
Merge branch 'master' of github.com:bisq-network/bisq into release/v1.4.2
# Conflicts:
#	build.gradle
#	desktop/package/linux/Dockerfile
#	desktop/package/linux/package.sh
#	desktop/package/linux/release.sh
#	desktop/package/macosx/create_app.sh
#	desktop/package/macosx/finalize.sh
#	desktop/package/macosx/insert_snapshot_version.sh
#	desktop/package/windows/package.bat
#	desktop/package/windows/release.bat
#	relay/src/main/resources/version.txt
2020-10-22 09:40:17 +02:00
Christoph Atteneder
f6d8cadee8
Revert to SNAPSHOT version 2020-10-22 09:36:50 +02:00
sqrrm
b9e1398e29
Merge pull request #4672 from ghubstan/1-convert-offerutil-to-injected-singleton
Refactor offer/trade related classes in core and desktop
2020-10-21 20:06:47 +02:00
ghubstan
2ae6bfaf51
Change predicate names isPositiveXYZ -> isNonZeroXYZ
Resolves issue found during https://github.com/bisq-network/bisq/pull/4672
review, and mentioned in comment
https://github.com/bisq-network/bisq/pull/4672#discussion_r509318045
2020-10-21 12:54:28 -03:00
Christoph Atteneder
062b58b65d
Bump version number for v1.4.2 2020-10-21 09:23:51 +02:00
chimp1984
108ca75097
Rename HISTORY to HISTORICAL_RESOURCE_FILE_VERSION_TAGS to make its usage more clear 2020-10-21 09:21:53 +02:00
chimp1984
8bb1c61c76
Fix wrong HISTORY version entry.
This fields contains the versions where we have tagged a resource file.
It does not need to be the latest version in case we have not added a new resource file.
2020-10-21 09:21:46 +02:00
Christoph Atteneder
bbe71fe78d
Merge pull request #4678 from chimp1984/rename-history-field-in-version
Rename history field in version
2020-10-21 09:19:43 +02:00
chimp1984
927004b4be
Rename HISTORY to HISTORICAL_RESOURCE_FILE_VERSION_TAGS to make its usage more clear 2020-10-20 22:08:18 -05:00
chimp1984
fd00048b47
Fix wrong HISTORY version entry.
This fields contains the versions where we have tagged a resource file.
It does not need to be the latest version in case we have not added a new resource file.
2020-10-20 22:06:30 -05:00
ghubstan
ac8ed8dd06
Add 'confirmpaymentreceived' api method
- Implement confirmpaymentsent on server and cli side

- Enable confirmpaymentreceived method tests
2020-10-20 16:51:48 -03:00
ghubstan
3d2b90fb96
Add 'confirmpaymentsent' api method
- Implement confirmpaymentsent on server and cli side

- Enable confirmpaymentsent method tests
2020-10-20 16:20:40 -03:00
ghubstan
e809af37cc
Add 'takeoffer' API method
- Add new core.offer.takeoffer.TakeOfferModel

	Would have been nice to move more logic from
	bisq.desktop.main.offer.takeoffer.TakeOfferDataModel,
	but it has JFX dependencies that cannot be use in :core.

- Add grpc protos to support takeoffer, confirmpaymentsent, confirmpaymentreceived

	Only takeoffer is implemented in this commit.

- Refactor OfferInfo grpc proto wrapper, and add offer state field

- Add new TradeInfo grpc proto wrapper

- Implement takeoffer on server and cli side

- Refactor offer/trade tests, add test cases
2020-10-20 16:00:05 -03:00
ghubstan
ab6be23516
Refactor offer/trade related classes in core and desktop
These refactoring changes are for reducing existing and potential
duplication coming with the addition of new trading protocol support
in the gRPC API.  Some minor styling and logic simplification changes
are also include.

- Convert OfferUtil to injected singleton, and move various offer related
  utility methods into it.

- Delete both MakerFeeProvider classes, which were wrappers around the same
  static old OfferUtil method.

- Inject OfferUtil into CreateOfferDataModel, CreateOfferViewModel,
  TakeOfferDataModel, TakeOfferViewModel, MutableOfferDataModel,
  MutableOfferViewModel, OfferDataModel, EditOfferDataModel,
  EditOfferViewModel

- Refactor TakeOfferViewModel

	Use OfferUtil, remove unused fields & methods.
	Made minor logic simplification, style and formatting changes.

- MutableOfferDataModel

	Made minor logic simplification, style and formatting changes.

- MutableOfferView uses new paymentAccount.isHalCashAccount().

- MutableOfferViewModel

	Refactored to use new VolumeUtil, CoinUtil, OfferUtil.
	Removed unused fields & accessors.
	Made minor style change.

- Refactored OfferDataModel to use new OfferUtil

- Refactor CreateOfferService

	Inject and use OfferUtil
	Move some utility methods to OfferUtil
	Remove unused fields

- Offer

	Refactored to use new VolumeUtil for volume calculations.
	Made stateProperty and errorMessageProperty fields private.

- PaymentAccount

	Moved isHalCashAccount type check to this class.
	Moved getTradeCurrency logic to this class.

- Contract, radeStatistics2, TradeStatistics3

	Refactored to use new VolumeUtil for volume calculations.

- Trade

	Refactored to use new VolumeUtil for volume calculations.
	Made minor logic simplification, style and formatting changes.

- CoinUtil

	Moved some coin utility methods into this class

- CoinUtilTest

	Moved (coin related) tests from CoinCryptoUtilsTest and OfferUtilTest
	into CoinUtilTest, and deleted OfferUtilTest, CoinCryptoUtilsTest.

- Adjust create and edit offer tests to model refactoring
2020-10-20 15:06:44 -03:00