-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Feat: OCO Offers #6605
Feat: OCO Offers #6605
Conversation
As this is a high impact PR I'd like to see som ACK from core contributors like @HenrikJannsen,... |
desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersView.java
Outdated
Show resolved
Hide resolved
desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersView.java
Outdated
Show resolved
Hide resolved
desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersView.java
Outdated
Show resolved
Hide resolved
desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersView.java
Outdated
Show resolved
Hide resolved
desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersView.java
Show resolved
Hide resolved
Pick a more user friendly name instead of OCO. Clean up code.
After the cloned offers have been created it is unclear what need to be edited to allow activation. There is no feedback at clicking activate and changing the price does not enable it as well, so a user not familiar with the feature would be confused. There should be an icon as well next to edit and duplicate offer. Not sure if the 5x option is needed. There will not be that many users who have that many payment methods and its just a simple click to clone. The right click context menu is not a standard UX feature Bisq uses so it would be hidden to most users. |
I don't think there should be another icon next to edit and duplicate offer - that crowds the screen and confuses casual users. This feature is not for casual users, it is for advanced market makers. As such I expect the people using this feature would be the ones who requested it and/or read about it in the forums or bisq.wiki. Those users being experienced I think they do not need to be spoon fed by popups either. |
|
||
// check if the ADDRESS still has any existing entries, only if not do the add to available. | ||
boolean entryWithSameContextAlreadyExist = entrySet.stream().anyMatch(e -> { | ||
if (entrySet.remove(addressEntry)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to remove the address entry if entryWithSameContextStillExists is true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked closer into that now. The check with entryWithSameContextAlreadyExist is not needed and we can revert it as we have a hashset and the add will not add if we try to add the same entry.
addressEntryList.addAddressEntry(newEntry); | ||
return newEntry; | ||
// when a new offer needs to share the reserved amount info from parent offer's address entry | ||
public AddressEntry getOrCreateAddressEntry(AddressEntry orgAddressEntry, String offerId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The param name orgAddressEntry is unclear. If it means original better spell it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better name the method getOrCreateSharedAddressEntry
for (TransactionOutput output : txn.getOutputs()) { | ||
if (walletService.isTransactionOutputMine(output) && WalletService.isOutputScriptConvertibleToAddress(output)) { | ||
String addressString = WalletService.getAddressStringFromOutput(output); | ||
assert addressString != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not use assert but checkNotNull.
String addressString = WalletService.getAddressStringFromOutput(output); | ||
assert addressString != null; | ||
// make sure the output is still unspent | ||
if (addressString.equalsIgnoreCase(address.toString()) && output.getSpentBy() == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why equalsIgnoreCase?
return openOffers.stream().filter(e -> !e.getOffer().isBsqSwapOffer() && e.getOffer().getOfferFeePaymentTxId().equals(safeSearch)).collect(Collectors.toList()); | ||
return openOffers.stream() | ||
.filter(e -> !e.getOffer().isBsqSwapOffer() && e.getOffer().getOfferFeePaymentTxId() | ||
.equals(makerFeeTxId == null ? "" : makerFeeTxId)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right side of equals can be null.
!e.isDeactivated() && | ||
!e.getId().equals(newOffer.getId()) && | ||
e.getOffer().getOfferFeePaymentTxId().equals(newOffer.getOfferFeePaymentTxId()) && | ||
e.getOffer().getPaymentMethodId().equalsIgnoreCase(newOffer.getPaymentMethodId()) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use equalsIgnoreCase. It suggests that the strings do not have a defined case, but those data have not arbitrary upper/lower case.
Has this feature been included in any of the recent releases? @jmacxx |
OCO (One cancels other) offers as defined by @apemithrandir
Ref: bisq-network/proposals#402. Demo here.
Features: