-
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
API daemon 'getoffer' & 'gettrade' support for BSQ swaps #1 #5827
API daemon 'getoffer' & 'gettrade' support for BSQ swaps #1 #5827
Conversation
- Adjust GetBsqSwapOffer(s) rpc services to remove currency param. - Adjust OfferInfo and remove BsqSwapOfferInfo. - Add GetOfferCategory service so CLI can determine what kind of takeoffer service is to be used. - Add comment about adding sub-message BsqSwapTradeInfo field to TradeInfo.
- Add GetOfferCategory service so CLI can determine what kind of takeoffer service is to be used. - Adjust to removal of BsqSwapOfferInfo proto. - Call new coreApi.getRole(BsqSwapTrade) before building BsqSwapTradeInfo proto.
- Complete BsqSwapTradeInfo impl. - Merge BsqSwapOfferInfo fields into OfferInfo and remove BsqSwapOfferInfo. - Change all model builders to private static class Builder.
- Add core api methods to help CLI determine which type of offer to take for a given offerId. CLI's 'takeoffer` will need to determine which gRPC/proto request type to send to server. - Add implemetations for getBsqSwapTradeRole(), for tradeId or trade.
- 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.
- Adjust to removal of BsqSwapOfferInfo proto, use ammended OfferInfo instead. - Remove currency-code param from all get(My)BsqSwapOffer(s) requests.
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.
- 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.
I tried
|
I have not addressed the CLI side of this, and do not expect it to work. (The PR title should have specified these are incremental changes, mostly on the server side.) This will require 2-3 more PRs. I am a bit surprised that Please un-comment the |
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.
utACK
@ghubstan I haven't followed other developments, can this be merged or does it need to wait?
public static boolean isAltcoinOffer(Offer offer) { | ||
return offer.getCounterCurrencyCode().equals("BTC") && !offer.isBsqSwapOffer(); | ||
} |
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.
Is swapOffer not considered an altcoin trade? I guess it makes some sense but also somewhat odd.
This change is a partial adjustment in the API for BSQ swaps, mostly related to how it fetches and displays v1 and new swap offers and trades.
The
currencyCode
param was removed from theGetBsqSwapOffer
service request.BsqSwapOfferInfo
fields were merged intoOfferInfo
, andBsqSwapOfferInfo
was removed.New rpc service
GetOfferCategory
was added for later use, to determine what kind of rpc request to send in CLItakeoffer
calls (v1-offer or bsq-swap offer).Added new
coreApi.getRole(BsqSwapTrade)
method.Normalized (removed duplication) recently merged
BsqSwapTradeInfo
with the existingTradeInfo
gRPC proto defs and wrappers. AbsqSwapTradeInfo
field was appended to the oldTradeInfo
proto message. The API'sgettrade
andgettrades
(todo) methods' reply messages can still return the same gRPC response message data type (TradeInfo
, orList<TradeInfo>
forgettrades
), and may represent v1 trade and/or bisq-swap trade details.Adjusted the CLI console output to display v1 or bsq-swap trade details returned by the CLI's
gettrade
method.BSQ swap offer create & take support in the CLI should come with the next 1-3 PRs.
Based on
master
.