mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-19 11:48:18 -04:00
switch to xmr atomic units as native units
This commit is contained in:
parent
ab94b2d6fa
commit
9b4f8046b7
124 changed files with 1155 additions and 1283 deletions
|
@ -3,7 +3,6 @@ package bisq.daemon.grpc;
|
|||
import bisq.core.api.CoreApi;
|
||||
import bisq.core.support.dispute.Attachment;
|
||||
import bisq.core.support.dispute.DisputeResult;
|
||||
import bisq.core.trade.HavenoUtils;
|
||||
|
||||
import bisq.common.proto.ProtoUtil;
|
||||
|
||||
|
@ -108,9 +107,7 @@ public class GrpcDisputesService extends DisputesImplBase {
|
|||
try {
|
||||
var winner = ProtoUtil.enumFromProto(DisputeResult.Winner.class, req.getWinner().name());
|
||||
var reason = ProtoUtil.enumFromProto(DisputeResult.Reason.class, req.getReason().name());
|
||||
// scale atomic unit to centineros for consistency TODO switch base to atomic units?
|
||||
var customPayoutAmount = HavenoUtils.atomicUnitsToCentineros(req.getCustomPayoutAmount());
|
||||
coreApi.resolveDispute(req.getTradeId(), winner, reason, req.getSummaryNotes(), customPayoutAmount);
|
||||
coreApi.resolveDispute(req.getTradeId(), winner, reason, req.getSummaryNotes(), req.getCustomPayoutAmount());
|
||||
var reply = ResolveDisputeReply.newBuilder().build();
|
||||
responseObserver.onNext(reply);
|
||||
responseObserver.onCompleted();
|
||||
|
|
|
@ -21,7 +21,6 @@ import bisq.core.api.CoreApi;
|
|||
import bisq.core.api.model.OfferInfo;
|
||||
import bisq.core.offer.Offer;
|
||||
import bisq.core.offer.OpenOffer;
|
||||
import bisq.core.trade.HavenoUtils;
|
||||
import bisq.proto.grpc.CancelOfferReply;
|
||||
import bisq.proto.grpc.CancelOfferRequest;
|
||||
import bisq.proto.grpc.PostOfferReply;
|
||||
|
@ -154,8 +153,8 @@ class GrpcOffersService extends OffersImplBase {
|
|||
req.getPrice(),
|
||||
req.getUseMarketBasedPrice(),
|
||||
req.getMarketPriceMarginPct(),
|
||||
HavenoUtils.atomicUnitsToCentineros(req.getAmount()), // scale atomic unit to centineros for consistency TODO switch base to atomic units?
|
||||
HavenoUtils.atomicUnitsToCentineros(req.getMinAmount()),
|
||||
req.getAmount(),
|
||||
req.getMinAmount(),
|
||||
req.getBuyerSecurityDepositPct(),
|
||||
req.getTriggerPrice(),
|
||||
req.getPaymentAccountId(),
|
||||
|
|
|
@ -37,8 +37,6 @@ import bisq.proto.grpc.SendChatMessageReply;
|
|||
import bisq.proto.grpc.SendChatMessageRequest;
|
||||
import bisq.proto.grpc.TakeOfferReply;
|
||||
import bisq.proto.grpc.TakeOfferRequest;
|
||||
import bisq.proto.grpc.WithdrawFundsReply;
|
||||
import bisq.proto.grpc.WithdrawFundsRequest;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
|
||||
|
@ -191,19 +189,6 @@ class GrpcTradesService extends TradesImplBase {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawFunds(WithdrawFundsRequest req,
|
||||
StreamObserver<WithdrawFundsReply> responseObserver) {
|
||||
try {
|
||||
coreApi.withdrawFunds(req.getTradeId(), req.getAddress(), req.getMemo());
|
||||
var reply = WithdrawFundsReply.newBuilder().build();
|
||||
responseObserver.onNext(reply);
|
||||
responseObserver.onCompleted();
|
||||
} catch (Throwable cause) {
|
||||
exceptionHandler.handleException(log, cause, responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getChatMessages(GetChatMessagesRequest req,
|
||||
StreamObserver<GetChatMessagesReply> responseObserver) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue