Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bsq swap: Implementation [3] #5775

Merged
merged 274 commits into from Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
2141f8f
Move CleanupMailboxMessagesService, ClosedTradeUtil to package bisq.c…
chimp1984 Oct 19, 2021
f871e83
Move TransactionResultHandler, TradeResultHandler to package bisq.cor…
chimp1984 Oct 19, 2021
71c663e
Move TradeDataValidation, DumpDelayedPayoutTx, TradeDataValidation, T…
chimp1984 Oct 19, 2021
26e2676
Rename ProcessModelServiceProvider to Provider
chimp1984 Oct 19, 2021
c282b70
Rename txID to txId
chimp1984 Oct 19, 2021
30dd568
Move createoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
0cd0e16
Move takeoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
4169a87
Move MutableOffer view classes into bisq.desktop.main.offer.bisq_v1 p…
chimp1984 Oct 19, 2021
a2a7e87
Move OfferDataModel, OfferViewUtil into bisq.desktop.main.offer.bisq_…
chimp1984 Oct 19, 2021
a9f4bb7
Rename FeeUtil to OfferViewModelUtil
chimp1984 Oct 19, 2021
1e03aae
Move OfferViewModelUtil into bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
72284d7
Cleanups, refromatting, add final qualifier
chimp1984 Oct 19, 2021
71eec7b
Move TradingPeer to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
e1efc5e
Make setPaymentStartedAckMessage and setDepositTxSentAckMessage public
chimp1984 Oct 19, 2021
760732f
Move ProcessModel to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
41d9d3f
Move OfferPayload into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
edf5c3e
Move CreateOfferService into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
4341a7e
Move MarketPriceNotAvailableException into package bisq.core.offer.bi…
chimp1984 Oct 19, 2021
042476a
Move MutableOfferPayloadFields into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
d9fd8a4
Move TriggerPriceService into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
e348000
Move TakeOfferModel into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
a2d1e88
Move AvailabilityResult into package bisq.core.offer.availability
chimp1984 Oct 19, 2021
1badd69
Move bisq.core.offer.messages package into package bisq.core.offer.av…
chimp1984 Oct 19, 2021
7197b31
Move content of bisq.core.offer.placeoffer package into package bisq.…
chimp1984 Oct 19, 2021
1b4c487
Rename OfferFilter to OfferFilterService
chimp1984 Oct 19, 2021
1e9b606
Move Contract, SellerAsMakerTrade, SellerAsTakerTrade, SellerTrade,
chimp1984 Oct 19, 2021
8b21b85
Make updateDepositTxFromWallet public
chimp1984 Oct 19, 2021
d422427
Move Trade to bisq.core.trade.model.bisq_v1 package
chimp1984 Oct 19, 2021
fc3177c
Move MakerTrade and TakerTrade to bisq.core.trade.model package
chimp1984 Oct 19, 2021
58cfcff
Move Tradable to bisq.core.trade.model package
chimp1984 Oct 19, 2021
3474a2b
Move TradableList to bisq.core.trade.model package
chimp1984 Oct 19, 2021
d7b2e99
Make FluentProtocol.Event public
chimp1984 Oct 19, 2021
e3eea63
Make setup in FluentProtocol public
chimp1984 Oct 19, 2021
1b2e798
Move protocol classes to bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
508296c
Move tasks package into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
97906e0
Move TradingPeer into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
cbf2822
Move messages package into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
fd6934c
Move ClosedTradableManager, FailedTradesManager into bisq.core.trade.…
chimp1984 Oct 19, 2021
fe2871b
Rename CleanupMailboxMessages to CleanupMailboxMessagesService
chimp1984 Oct 19, 2021
e80cdf8
Move CleanupMailboxMessagesService, ClosedTradeUtil to package bisq.c…
chimp1984 Oct 19, 2021
956ffc9
Move TransactionResultHandler, TradeResultHandler to package bisq.cor…
chimp1984 Oct 19, 2021
eacf446
Move TradeDataValidation, DumpDelayedPayoutTx, TradeDataValidation, T…
chimp1984 Oct 19, 2021
e1de502
Rename ProcessModelServiceProvider to Provider
chimp1984 Oct 19, 2021
2733af9
Rename txID to txId
chimp1984 Oct 19, 2021
932c0f8
Move createoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
0efa0bd
Move takeoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
601956d
Move MutableOffer view classes into bisq.desktop.main.offer.bisq_v1 p…
chimp1984 Oct 19, 2021
9777005
Move OfferDataModel, OfferViewUtil into bisq.desktop.main.offer.bisq_…
chimp1984 Oct 19, 2021
4a9db79
Rename FeeUtil to OfferViewModelUtil
chimp1984 Oct 19, 2021
25bbad1
Move OfferViewModelUtil into bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
777287a
Cleanups, refromatting, add final qualifier
chimp1984 Oct 19, 2021
401880b
Move TradingPeer to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
afed788
Make setPaymentStartedAckMessage and setDepositTxSentAckMessage public
chimp1984 Oct 19, 2021
734d429
Move ProcessModel to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
dca0c93
Cleanups
chimp1984 Oct 20, 2021
e752965
Add linebreak in error popup
chimp1984 Oct 20, 2021
9f3034e
Fix layout/text issues
chimp1984 Oct 20, 2021
dc82fba
Increase visibility
chimp1984 Oct 20, 2021
8768345
Remove Inject annotation at abstract classes
chimp1984 Oct 20, 2021
d1d1706
Add delegate methods to offer
chimp1984 Oct 20, 2021
dfbc746
Move Offer.Direction one level up and rename to OfferDirection
chimp1984 Oct 20, 2021
6cf0a7c
Rename paymentMethod.isAsset to paymentMethod.isBlockchain
chimp1984 Oct 20, 2021
dad19ba
Add isFiat and isAltcoin methods.
chimp1984 Oct 20, 2021
88198be
Rename availableConfirmedBalance to availableBalance
chimp1984 Oct 20, 2021
d4bb026
Only check for localhost btc node if mainnet
chimp1984 Oct 20, 2021
f8751a8
Make TxConfidenceListener and its onTransactionConfidenceChanged meth…
chimp1984 Oct 20, 2021
a927bea
Add scriptTypeId to RawTransactionInput
chimp1984 Oct 20, 2021
75072eb
Add deprecated annotation, null checks and comment to getRawInputFrom…
chimp1984 Oct 20, 2021
561ebe9
Move test classes into bisq.desktop.main.offer.bisq_v1.createoffer
chimp1984 Oct 20, 2021
8ee2554
Merge branch 'bsq-swap-low-risk-refactorings' into wip-merge2
chimp1984 Oct 20, 2021
559bc58
Fix merge issues
chimp1984 Oct 20, 2021
34c4eef
Add allowSpendMyOwnUnconfirmedTxOutputs flag to BsqCoinSelector
chimp1984 Oct 20, 2021
4757288
Add isMine method. Add error logs
chimp1984 Oct 20, 2021
0f6364d
Inline TransactionWitness
chimp1984 Oct 20, 2021
e582ffd
Add new methods
chimp1984 Oct 20, 2021
54e81d1
Add signTx and verifyNonDustTxo methods
chimp1984 Oct 20, 2021
5f8bc83
Remove unused signTx method
chimp1984 Oct 20, 2021
d95356b
Add verifiedBalance field.
chimp1984 Oct 20, 2021
cfc404b
Rename signTx to signTxAndVerifyNoDustOutputs (no code change)
chimp1984 Oct 20, 2021
82c1be1
Change log level
chimp1984 Oct 20, 2021
c15fc0c
Add comment, cleanups
chimp1984 Oct 20, 2021
d7f1b00
Rename processModel.getTradingPeer to getTradePeer
chimp1984 Oct 20, 2021
02d7dfd
Only print stack trace if dev mode
chimp1984 Oct 20, 2021
9e4be13
Change log level
chimp1984 Oct 20, 2021
8d25798
Replace Value annotation with Getter and EqualsAndHashCode
chimp1984 Oct 20, 2021
d976f11
Add methods
chimp1984 Oct 20, 2021
a3b3d56
Simplify
chimp1984 Oct 20, 2021
9d10646
Move getRandomOfferId method to OfferUtil
chimp1984 Oct 20, 2021
e061d6a
Replace Value with Getter
chimp1984 Oct 20, 2021
5b0e9ab
Rename trade.getPhase to getTradePhase
chimp1984 Oct 20, 2021
544dd89
Rename trade.getState to getTradeState
chimp1984 Oct 20, 2021
12fff54
Cleanup
chimp1984 Oct 20, 2021
2440d72
Extract methods, Cleanups
chimp1984 Oct 20, 2021
4cb0746
Extract methods, cleanups. Rename methods and vars
chimp1984 Oct 20, 2021
7211f89
Add exclude fields to EqualsAndHashCode
chimp1984 Oct 20, 2021
07883e9
Rename trade.getPhase to getTradePhase
chimp1984 Oct 20, 2021
0148a36
Extract to method in TradeUtil
chimp1984 Oct 20, 2021
1051640
Use early return. cleanup
chimp1984 Oct 20, 2021
8219bf8
Extract method. Rename vars
chimp1984 Oct 20, 2021
ee374c3
Cleanups, apply rename of getTradePhase
chimp1984 Oct 20, 2021
e940f6f
Add method. Dont return null in case of no amount but min fee
chimp1984 Oct 21, 2021
19aabba
Add method. cleanups
chimp1984 Oct 21, 2021
1c0b52c
Move OfferDirection from bisq.core.offer.bisq_v1 to bisq.core.offer
chimp1984 Oct 21, 2021
0735419
Remove handling of BundleOfEnvelopes in send method.
chimp1984 Oct 21, 2021
b80b6ec
Cleanups
chimp1984 Oct 21, 2021
23af455
Add filterPredicate
chimp1984 Oct 21, 2021
2e384ed
Make onDeleteAccount more clear
chimp1984 Oct 21, 2021
9d8c705
Only add delay if not devmode
chimp1984 Oct 21, 2021
d285157
Reduce visibility
chimp1984 Oct 21, 2021
8bb42e1
Add methods, move field up
chimp1984 Oct 21, 2021
1aa5e70
Add method
chimp1984 Oct 21, 2021
8ac40a3
Add style
chimp1984 Oct 21, 2021
c60df6e
Add linebreak (no code change)
chimp1984 Oct 21, 2021
9fb6a6c
Add isNotPublished method (will be combined later with bsq swap checks)
chimp1984 Oct 21, 2021
cfae096
Add null checks, extract variables, cleanups
chimp1984 Oct 21, 2021
2ae1860
Move tests to package bisq.desktop.main.offer.bisq_v1.createoffer
chimp1984 Oct 21, 2021
080dc3e
Merge branch 'chimp-bsq-swap' into wip-merge021.10
chimp1984 Oct 21, 2021
ab6e4e1
Dummy commit to enforce rebuild at CI
chimp1984 Oct 21, 2021
5412f8b
Merge branch 'chimp-bsq-swap' into bsq-swap-low-risk-refactorings
chimp1984 Oct 21, 2021
c920da3
Add abstract classes and interfaces. Let ProcessModel and TradingPeer…
chimp1984 Oct 21, 2021
8cd85a7
Let Trade extend TradeModel
chimp1984 Oct 21, 2021
dcd0101
Generify TradeResultHandler
chimp1984 Oct 21, 2021
5d687bd
Use TradeModel and ProtocolModel in TradeTaskRunner, TradeTask, Trade…
chimp1984 Oct 21, 2021
308bb68
Use TradeModel
chimp1984 Oct 21, 2021
453229e
Impl. onAckMessage. Add fields for concrete types
chimp1984 Oct 21, 2021
c0e70b8
Use TradeModel in trade domain
chimp1984 Oct 21, 2021
d063aff
Let OfferPayload extend OfferPayloadBase
chimp1984 Oct 21, 2021
b194960
Use TradeModel instead of Trade where appropriate.
chimp1984 Oct 21, 2021
14765d6
Move protobuf OfferPayload.Direction to OfferDirection
chimp1984 Oct 21, 2021
611b944
Move protobuf OfferPayload.Direction to OfferDirection
chimp1984 Oct 21, 2021
2f40edd
Use bitcoinj 42bbae9 (with fix required for bsq swaps)
chimp1984 Oct 21, 2021
63c385b
Add support for RemoveDataMessage in testCapability
chimp1984 Oct 21, 2021
54f17b0
Cleanups
chimp1984 Oct 21, 2021
ebfd1b5
Remove todo
chimp1984 Oct 21, 2021
0942d8f
Move OfferPayload into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
3838b45
Move CreateOfferService into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
76441ff
Move MarketPriceNotAvailableException into package bisq.core.offer.bi…
chimp1984 Oct 19, 2021
b93295a
Move MutableOfferPayloadFields into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
990c62b
Move TriggerPriceService into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
0e8ff7d
Move TakeOfferModel into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
ab91be8
Move AvailabilityResult into package bisq.core.offer.availability
chimp1984 Oct 19, 2021
fa9896d
Move bisq.core.offer.messages package into package bisq.core.offer.av…
chimp1984 Oct 19, 2021
aa02ac8
Move content of bisq.core.offer.placeoffer package into package bisq.…
chimp1984 Oct 19, 2021
4b968ce
Rename OfferFilter to OfferFilterService
chimp1984 Oct 19, 2021
09aa24c
Move Contract, SellerAsMakerTrade, SellerAsTakerTrade, SellerTrade,
chimp1984 Oct 19, 2021
b580a61
Make updateDepositTxFromWallet public
chimp1984 Oct 19, 2021
4dc7121
Move Trade to bisq.core.trade.model.bisq_v1 package
chimp1984 Oct 19, 2021
2b57309
Move MakerTrade and TakerTrade to bisq.core.trade.model package
chimp1984 Oct 19, 2021
eef55b7
Move Tradable to bisq.core.trade.model package
chimp1984 Oct 19, 2021
5b59d50
Move TradableList to bisq.core.trade.model package
chimp1984 Oct 19, 2021
838f7e2
Make FluentProtocol.Event public
chimp1984 Oct 19, 2021
e2f8236
Make setup in FluentProtocol public
chimp1984 Oct 19, 2021
21e9bb4
Move protocol classes to bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
8305434
Move tasks package into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
97903e6
Move TradingPeer into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
69ca8de
Move messages package into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
c090116
Move ClosedTradableManager, FailedTradesManager into bisq.core.trade.…
chimp1984 Oct 19, 2021
bd7af46
Rename CleanupMailboxMessages to CleanupMailboxMessagesService
chimp1984 Oct 19, 2021
0bc5ede
Move CleanupMailboxMessagesService, ClosedTradeUtil to package bisq.c…
chimp1984 Oct 19, 2021
3b7a14c
Move TransactionResultHandler, TradeResultHandler to package bisq.cor…
chimp1984 Oct 19, 2021
ac8dd03
Move TradeDataValidation, DumpDelayedPayoutTx, TradeDataValidation, T…
chimp1984 Oct 19, 2021
449472e
Rename ProcessModelServiceProvider to Provider
chimp1984 Oct 19, 2021
3dd4a75
Rename txID to txId
chimp1984 Oct 19, 2021
f25d0d1
Move createoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
9a1306a
Move takeoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
cc4b001
Move MutableOffer view classes into bisq.desktop.main.offer.bisq_v1 p…
chimp1984 Oct 19, 2021
4ebbaa3
Move OfferDataModel, OfferViewUtil into bisq.desktop.main.offer.bisq_…
chimp1984 Oct 19, 2021
fbfdaf4
Rename FeeUtil to OfferViewModelUtil
chimp1984 Oct 19, 2021
3b5b20d
Move OfferViewModelUtil into bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
6a8f612
Cleanups, refromatting, add final qualifier
chimp1984 Oct 19, 2021
3bb303b
Move TradingPeer to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
993c602
Make setPaymentStartedAckMessage and setDepositTxSentAckMessage public
chimp1984 Oct 19, 2021
ed13d72
Move ProcessModel to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
7d48cdb
Cleanups
chimp1984 Oct 20, 2021
56759be
Move tests to package bisq.desktop.main.offer.bisq_v1.createoffer
chimp1984 Oct 21, 2021
d5dfdb4
Merge branch 'chimp-bsq-swap-1' into bsq-swap-low-risk-refactorings-2
chimp1984 Nov 2, 2021
fd28c63
Fix merge issues (nothing critical)
chimp1984 Nov 2, 2021
f7fcaa9
Add BSQ swap code
chimp1984 Oct 21, 2021
1c1b280
Apply codacy review suggestions
chimp1984 Oct 21, 2021
74789b1
Move Utilities.objectToJson to JsonUtil.objectToJson
chimp1984 Oct 23, 2021
75fff98
Add custom json serializer for OfferPayload
chimp1984 Oct 23, 2021
8ab6302
Update text
chimp1984 Oct 23, 2021
06bba39
Remove missingFundsListener after successful take offer
chimp1984 Oct 23, 2021
0e41c96
Change log level
chimp1984 Oct 23, 2021
9b1720f
Improve BSQ swap offer details window
chimp1984 Oct 23, 2021
5eec562
Update dev mode values for create offer
chimp1984 Oct 23, 2021
884fe09
Workaround for weird JFXComboBox bug
chimp1984 Oct 23, 2021
6890b50
Add default value if no filter is available
chimp1984 Oct 23, 2021
bcf54d4
Add log
chimp1984 Oct 23, 2021
20e83b6
Reset address entry if BSQ swap offer is used for create offer
chimp1984 Oct 23, 2021
91276c9
Use checkNotNull and checkArgument for checking pre conditions
chimp1984 Oct 23, 2021
90e5cf1
Add requestPersistence call.
chimp1984 Oct 23, 2021
fbe15cd
Improve naming, comments, extract variables
chimp1984 Oct 23, 2021
3b86921
Improve naming, comments, extract variables, inline method
chimp1984 Oct 23, 2021
3276c80
Remove redundant complete call
chimp1984 Oct 23, 2021
d0bb421
Improve naming, cleanups, use static imports
chimp1984 Oct 23, 2021
311d1e4
Fix linebreak
chimp1984 Oct 23, 2021
726307c
Combine nested if statements
chimp1984 Oct 24, 2021
bcbce6e
Revert behaviour to old version in master to return null if amount is…
chimp1984 Oct 24, 2021
addfade
Cleanups
chimp1984 Oct 24, 2021
8ee8cba
Apply patch from ghubstan
chimp1984 Oct 31, 2021
0c0c27c
Rename package
chimp1984 Oct 31, 2021
17d7388
Fix link to BSQ_Swaps wiki
chimp1984 Oct 31, 2021
2f5c644
Apply patch from @ghubstan
chimp1984 Nov 2, 2021
d5d3a85
Apply patch from @ghubstan
chimp1984 Nov 2, 2021
ab7d6ed
Add missing class (merge mistake)
chimp1984 Nov 2, 2021
c5f2cbc
Merge branch 'bsq-swap-low-risk-refactorings-2' into bsq-swap-impl-3
chimp1984 Nov 2, 2021
41ce2d8
Remove unused import
ripcurlx Nov 3, 2021
9778950
Rename BSQ SWAP TRADES to BSQ Swap Trades
chimp1984 Nov 3, 2021
c1e470d
Add requestFocus call to createOfferView as well
chimp1984 Nov 3, 2021
bc4241c
Rename tradeAmount to amount in Trade
chimp1984 Nov 3, 2021
5bf02e9
Rename getTradePrice to getPrice in Trade
chimp1984 Nov 3, 2021
d0cdf9f
Rename tradeVolumeProperty to volumeProperty in Trade
chimp1984 Nov 3, 2021
b3e8d56
Rename tradeAmountProperty to amountProperty in Trade
chimp1984 Nov 3, 2021
5b4e2a0
Rename getTradeAmountAsLong to getAmountAsLong in Trade
chimp1984 Nov 3, 2021
05de48b
Rename setTradePrice to setPriceAsLong in Trade
chimp1984 Nov 3, 2021
863a520
Rename getAmount to getAmountAsLong in Trade
chimp1984 Nov 3, 2021
12aadf9
Add getAmountAsLong to TradeModel
chimp1984 Nov 3, 2021
1f96122
Add getAmount to TradeModel
chimp1984 Nov 3, 2021
3fa4b57
Rename getTradeVolume to getVolume in Trade
chimp1984 Nov 3, 2021
d235dae
Add getVolume to TradeModel
chimp1984 Nov 3, 2021
d9d054f
Add getPrice to TradeModel
chimp1984 Nov 3, 2021
300e19d
Add default methods for volume, price, amount
chimp1984 Nov 3, 2021
baa1fe5
Add getTxFee method to TradeModel
chimp1984 Nov 3, 2021
964144c
Rename takerFee to takerFeeAsLong
chimp1984 Nov 3, 2021
310de35
Add getTakerFee to TradeModel
chimp1984 Nov 3, 2021
128bd5b
Add getOptionalTxFee method
chimp1984 Nov 3, 2021
f6d2f7c
Rename makerFee to makerFeeAsLong in BsqSwapTrade
chimp1984 Nov 3, 2021
080255c
Add getMakerFee to TradeModel
chimp1984 Nov 3, 2021
a5eec8c
Add getOptionalTakerFee and getOptionalMakerFee to Tradeable
chimp1984 Nov 3, 2021
01b3691
Add null check
chimp1984 Nov 3, 2021
98bed96
Move ClosedTradableManager and ClosedTradeUtil one level up
chimp1984 Nov 3, 2021
b021f96
Refactor methods
chimp1984 Nov 3, 2021
680040d
Add info about trade if checkArgument fails
chimp1984 Nov 3, 2021
d4dc75b
Rename CompletedBsqSwapsView* classes to UnconfirmedBsqSwapsView*
chimp1984 Nov 3, 2021
2ac5b35
Rename BSQ swap trades tab to Unconfirmed BSQ swaps
chimp1984 Nov 3, 2021
792bbaa
Rename BSQ Swap Trades to Unconfirmed BSQ Swaps
chimp1984 Nov 3, 2021
ba64ba5
Add methods for confirmed and unconfirmed trades
chimp1984 Nov 3, 2021
c4a8627
Use TradeModel instead of Trade in the avatar icon
chimp1984 Nov 3, 2021
3023d5b
Add confirmed state
chimp1984 Nov 3, 2021
5da5d47
Fix getNumPastTrades method
chimp1984 Nov 3, 2021
24f18b7
Rename txFeeAsLong to tradeTxFee and txFeeAsLong to txFeeAsLong
chimp1984 Nov 3, 2021
7109666
Moved AltcoinValidator, FiatPriceValidator and NumberValidator
chimp1984 Nov 3, 2021
acf7c21
Moved PriceUtil to bisq.core.util
chimp1984 Nov 3, 2021
27df58b
Extract formatter methods to ClosedTradeFormatter
chimp1984 Nov 3, 2021
8fa66ea
Moved instance methods to ClosedTradableManager
chimp1984 Nov 3, 2021
1ca0ed5
Add notification when BSQ swap trade got confirmed
chimp1984 Nov 4, 2021
733b4f0
Fix layout
chimp1984 Nov 4, 2021
19eac43
Remove ClosedTradableListItem
chimp1984 Nov 4, 2021
26e7541
Fix mixed usage of static import to pacify Codacy
ripcurlx Nov 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/src/main/java/bisq/core/btc/wallet/WalletService.java
Expand Up @@ -871,7 +871,10 @@ public static Transaction maybeAddTxToWallet(Transaction transaction,
// bisqWalletEventListener
///////////////////////////////////////////////////////////////////////////////////////////

public class BisqWalletListener implements WalletCoinsReceivedEventListener, WalletCoinsSentEventListener, WalletReorganizeEventListener, TransactionConfidenceEventListener {
public class BisqWalletListener implements WalletCoinsReceivedEventListener,
WalletCoinsSentEventListener,
WalletReorganizeEventListener,
TransactionConfidenceEventListener {
@Override
public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) {
notifyBalanceListeners(tx);
Expand Down
5 changes: 3 additions & 2 deletions core/src/main/resources/i18n/displayStrings.properties
Expand Up @@ -3105,8 +3105,9 @@ notification.takeOffer.walletUpdate.msg=Your trading wallet was already sufficie
notification.tradeCompleted.headline=Trade completed
notification.tradeCompleted.msg=You can withdraw your funds now to your external Bitcoin wallet or transfer it to the Bisq wallet.
notification.bsqSwap.maker.headline=BSQ swap completed
notification.bsqSwap.maker.tradeCompleted=Your offer with ID ''{0}'' has been taken.

notification.bsqSwap.maker.tradeCompleted=Your offer with ID ''{0}'' has been taken.
notification.bsqSwap.confirmed.headline=BSQ swap transaction confirmed
notification.bsqSwap.confirmed.text=The BSQ swap transaction for trade with ID ''{0}'' is confirmed.

####################################################################
# System Tray
Expand Down
37 changes: 33 additions & 4 deletions desktop/src/main/java/bisq/desktop/main/MainViewModel.java
Expand Up @@ -37,6 +37,7 @@
import bisq.desktop.main.overlays.windows.downloadupdate.DisplayUpdateDownloadWindow;
import bisq.desktop.main.portfolio.PortfolioView;
import bisq.desktop.main.portfolio.bsqswaps.UnconfirmedBsqSwapsView;
import bisq.desktop.main.portfolio.closedtrades.ClosedTradesView;
import bisq.desktop.main.presentation.AccountPresentation;
import bisq.desktop.main.presentation.DaoPresentation;
import bisq.desktop.main.presentation.MarketPricePresentation;
Expand All @@ -51,6 +52,7 @@
import bisq.core.app.BisqSetup;
import bisq.core.btc.nodes.LocalBitcoinNode;
import bisq.core.btc.setup.WalletsSetup;
import bisq.core.btc.wallet.BsqWalletService;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.locale.CryptoCurrency;
import bisq.core.locale.CurrencyUtil;
Expand Down Expand Up @@ -86,6 +88,8 @@
import bisq.common.util.Hex;
import bisq.common.util.Tuple2;

import org.bitcoinj.core.TransactionConfidence;

import com.google.inject.Inject;

import com.google.common.base.Charsets;
Expand Down Expand Up @@ -123,6 +127,7 @@
public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener {
private final BisqSetup bisqSetup;
private final WalletsSetup walletsSetup;
private final BsqWalletService bsqWalletService;
private final User user;
private final BalancePresentation balancePresentation;
private final TradePresentation tradePresentation;
Expand Down Expand Up @@ -172,6 +177,7 @@ public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener {
public MainViewModel(BisqSetup bisqSetup,
WalletsSetup walletsSetup,
BtcWalletService btcWalletService,
BsqWalletService bsqWalletService,
User user,
BalancePresentation balancePresentation,
TradePresentation tradePresentation,
Expand Down Expand Up @@ -200,6 +206,7 @@ public MainViewModel(BisqSetup bisqSetup,
Navigation navigation) {
this.bisqSetup = bisqSetup;
this.walletsSetup = walletsSetup;
this.bsqWalletService = bsqWalletService;
this.user = user;
this.balancePresentation = balancePresentation;
this.tradePresentation = tradePresentation;
Expand Down Expand Up @@ -264,8 +271,8 @@ public void onSetupComplete() {
if (DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Popup().warning(Res.get("popup.warning.tradePeriod.halfReached",
trade.getShortId(),
DisplayUtils.formatDateTime(maxTradePeriodDate)))
trade.getShortId(),
DisplayUtils.formatDateTime(maxTradePeriodDate)))
.show();
}
break;
Expand All @@ -274,8 +281,8 @@ public void onSetupComplete() {
if (DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Popup().warning(Res.get("popup.warning.tradePeriod.ended",
trade.getShortId(),
DisplayUtils.formatDateTime(maxTradePeriodDate)))
trade.getShortId(),
DisplayUtils.formatDateTime(maxTradePeriodDate)))
.show();
}
break;
Expand All @@ -296,6 +303,9 @@ public void onSetupComplete() {
bsqSwapTradeManager.resetCompletedBsqSwapTrade();
}
});

maybeNotifyBsqSwapTxConfirmed();
bsqWalletService.getWallet().addTransactionConfidenceEventListener((wallet, tx) -> maybeNotifyBsqSwapTxConfirmed());
}
});

Expand All @@ -316,6 +326,25 @@ public void onSetupComplete() {
getShowAppScreen().set(true);
}

private void maybeNotifyBsqSwapTxConfirmed() {
bsqSwapTradeManager.getObservableList().stream()
.filter(bsqSwapTrade -> bsqSwapTrade.getTxId() != null)
.filter(bsqSwapTrade -> DontShowAgainLookup.showAgain(bsqSwapTrade.getTxId()))
.filter(bsqSwapTrade -> {
TransactionConfidence confidenceForTxId = bsqWalletService.getConfidenceForTxId(bsqSwapTrade.getTxId());
return confidenceForTxId != null && confidenceForTxId.getDepthInBlocks() > 0;
})
.forEach(bsqSwapTrade -> {
DontShowAgainLookup.dontShowAgain(bsqSwapTrade.getTxId(), true);
new Notification()
.headLine(Res.get("notification.bsqSwap.confirmed.headline"))
.notification(Res.get("notification.bsqSwap.confirmed.text", bsqSwapTrade.getShortId()))
.actionButtonTextWithGoTo("navigation.portfolio.closedTrades")
.onAction(() -> navigation.navigateTo(MainView.class, PortfolioView.class, ClosedTradesView.class))
.show();
});
}


///////////////////////////////////////////////////////////////////////////////////////////
// UI handlers
Expand Down