mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-07 22:22:24 -04:00

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>
68 lines
2.1 KiB
Java
68 lines
2.1 KiB
Java
/*
|
|
* This file is part of Haveno.
|
|
*
|
|
* 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.
|
|
*
|
|
* 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 Haveno. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
package bisq.core.trade;
|
|
|
|
import bisq.core.btc.wallet.XmrWalletService;
|
|
import bisq.core.offer.Offer;
|
|
import bisq.core.trade.protocol.ProcessModel;
|
|
|
|
import bisq.network.p2p.NodeAddress;
|
|
|
|
import org.bitcoinj.core.Coin;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
import static com.google.common.base.Preconditions.checkNotNull;
|
|
|
|
@Slf4j
|
|
public abstract class BuyerTrade extends Trade {
|
|
BuyerTrade(Offer offer,
|
|
Coin tradeAmount,
|
|
Coin takerFee,
|
|
long tradePrice,
|
|
XmrWalletService xmrWalletService,
|
|
ProcessModel processModel,
|
|
String uid,
|
|
@Nullable NodeAddress takerNodeAddress,
|
|
@Nullable NodeAddress makerNodeAddress,
|
|
@Nullable NodeAddress arbitratorNodeAddress) {
|
|
super(offer,
|
|
tradeAmount,
|
|
takerFee,
|
|
tradePrice,
|
|
xmrWalletService,
|
|
processModel,
|
|
uid,
|
|
takerNodeAddress,
|
|
makerNodeAddress,
|
|
arbitratorNodeAddress);
|
|
}
|
|
|
|
@Override
|
|
public Coin getPayoutAmount() {
|
|
checkNotNull(getAmount(), "Invalid state: getTradeAmount() = null");
|
|
return checkNotNull(getOffer()).getBuyerSecurityDeposit().add(getAmount());
|
|
}
|
|
|
|
@Override
|
|
public boolean confirmPermitted() {
|
|
return !getDisputeState().isArbitrated();
|
|
}
|
|
}
|