mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-22 21:45:22 -04:00
general rebase in order to update payment methods and desktop app
Co-authored-by: Alva Swanson <alvasw@protonmail.com> Co-authored-by: andyheko <haoen.ko@gmail.com> Co-authored-by: Bisq GitHub Admin <51445974+bisq-github-admin-3@users.noreply.github.com> Co-authored-by: BtcContributor <79100296+BtcContributor@users.noreply.github.com> Co-authored-by: cd2357 <cd2357@users.noreply.github.com> Co-authored-by: chimp1984 <chimp1984@gmx.com> Co-authored-by: Chris Beams <chris@beams.io> Co-authored-by: Christoph Atteneder <christoph.atteneder@gmail.com> Co-authored-by: Devin Bileck <603793+devinbileck@users.noreply.github.com> Co-authored-by: ghubstan <36207203+ghubstan@users.noreply.github.com> Co-authored-by: Huey <hueydane@gmail.com> Co-authored-by: Jakub Loucký <jakub.loucky@outlook.cz> Co-authored-by: jmacxx <47253594+jmacxx@users.noreply.github.com> Co-authored-by: KanoczTomas <tomas.kanocz@cnl.sk> Co-authored-by: m52go <735155+m52go@users.noreply.github.com> Co-authored-by: Marcus0x <marcus0x@xrhodium.org> Co-authored-by: MarnixCroes <93143998+MarnixCroes@users.noreply.github.com> Co-authored-by: Martin Harrigan <martinharrigan@gmail.com> Co-authored-by: MwithM <50149324+MwithM@users.noreply.github.com> Co-authored-by: sqrrm <sqrrm@users.noreply.github.com> Co-authored-by: Stan <36207203+ghubstan@users.noreply.github.com> Co-authored-by: Stephan Oeste <emzy@emzy.de> Co-authored-by: Steven Barclay <stejbac@gmail.com> Co-authored-by: WAT <shiido.it@gmail.com> Co-authored-by: wiz <j@wiz.biz> Co-authored-by: xyzmaker123 <84982606+xyzmaker123@users.noreply.github.com>
This commit is contained in:
parent
15a1fe8a36
commit
88578bed10
539 changed files with 27629 additions and 8178 deletions
|
@ -1,18 +1,18 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
* This file is part of Haveno.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* Haveno is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* Haveno is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.daemon.grpc;
|
||||
|
|
|
@ -47,7 +47,6 @@ import java.util.stream.Collectors;
|
|||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static bisq.core.api.model.OfferInfo.toOfferInfo;
|
||||
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static bisq.proto.grpc.OffersGrpc.*;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
@ -75,7 +74,7 @@ class GrpcOffersService extends OffersImplBase {
|
|||
try {
|
||||
Offer offer = coreApi.getOffer(req.getId());
|
||||
var reply = GetOfferReply.newBuilder()
|
||||
.setOffer(toOfferInfo(offer).toProtoMessage())
|
||||
.setOffer(OfferInfo.toOfferInfo(offer).toProtoMessage())
|
||||
.build();
|
||||
responseObserver.onNext(reply);
|
||||
responseObserver.onCompleted();
|
||||
|
@ -84,14 +83,14 @@ class GrpcOffersService extends OffersImplBase {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: merge with getOffer()?
|
||||
@Override
|
||||
public void getMyOffer(GetMyOfferRequest req,
|
||||
StreamObserver<GetMyOfferReply> responseObserver) {
|
||||
try {
|
||||
Offer offer = coreApi.getMyOffer(req.getId());
|
||||
OpenOffer openOffer = coreApi.getMyOpenOffer(req.getId());
|
||||
var reply = GetMyOfferReply.newBuilder()
|
||||
.setOffer(toOfferInfo(offer, openOffer).toProtoMessage())
|
||||
.setOffer(OfferInfo.toMyOfferInfo(openOffer).toProtoMessage())
|
||||
.build();
|
||||
responseObserver.onNext(reply);
|
||||
responseObserver.onCompleted();
|
||||
|
@ -126,7 +125,7 @@ class GrpcOffersService extends OffersImplBase {
|
|||
List<OfferInfo> result = new ArrayList<OfferInfo>();
|
||||
for (Offer offer : coreApi.getMyOffers(req.getDirection(), req.getCurrencyCode())) {
|
||||
OpenOffer openOffer = coreApi.getMyOpenOffer(offer.getId());
|
||||
result.add(toOfferInfo(offer, openOffer));
|
||||
result.add(OfferInfo.toMyOfferInfo(openOffer));
|
||||
}
|
||||
var reply = GetMyOffersReply.newBuilder()
|
||||
.addAllOffers(result.stream()
|
||||
|
@ -154,17 +153,17 @@ class GrpcOffersService extends OffersImplBase {
|
|||
req.getDirection(),
|
||||
req.getPrice(),
|
||||
req.getUseMarketBasedPrice(),
|
||||
req.getMarketPriceMargin(),
|
||||
req.getMarketPriceMarginPct(),
|
||||
ParsingUtils.atomicUnitsToCentineros(req.getAmount()), // scale atomic unit to centineros for consistency TODO switch base to atomic units?
|
||||
ParsingUtils.atomicUnitsToCentineros(req.getMinAmount()),
|
||||
req.getBuyerSecurityDeposit(),
|
||||
req.getBuyerSecurityDepositPct(),
|
||||
req.getTriggerPrice(),
|
||||
req.getPaymentAccountId(),
|
||||
offer -> {
|
||||
// This result handling consumer's accept operation will return
|
||||
// the new offer to the gRPC client after async placement is done.
|
||||
OpenOffer openOffer = coreApi.getMyOpenOffer(offer.getId());
|
||||
OfferInfo offerInfo = toOfferInfo(offer, openOffer);
|
||||
OfferInfo offerInfo = OfferInfo.toMyOfferInfo(openOffer);
|
||||
CreateOfferReply reply = CreateOfferReply.newBuilder()
|
||||
.setOffer(offerInfo.toProtoMessage())
|
||||
.build();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue