Пример #1
0
  void onSelectTrade(PendingTradesListItem item) {
    // clean up previous selectedItem
    selectedItem = item;

    if (item == null) {
      trade = null;
      tradeProperty.set(null);
    } else {
      trade = item.getTrade();
      tradeProperty.set(trade);

      isOfferer = tradeManager.isMyOffer(trade.getOffer());

      if (trade.getDepositTx() != null) txId.set(trade.getDepositTx().getHashAsString());
    }
  }
Пример #2
0
  private void doOpenDispute(boolean isSupportTicket, Transaction depositTx) {
    Log.traceCall("depositTx=" + depositTx);
    byte[] depositTxSerialized = null;
    byte[] payoutTxSerialized = null;
    String depositTxHashAsString = null;
    String payoutTxHashAsString = null;
    if (depositTx != null) {
      depositTxSerialized = depositTx.bitcoinSerialize();
      depositTxHashAsString = depositTx.getHashAsString();
    } else {
      log.warn("depositTx is null");
    }
    Transaction payoutTx = trade.getPayoutTx();
    if (payoutTx != null) {
      payoutTxSerialized = payoutTx.bitcoinSerialize();
      payoutTxHashAsString = payoutTx.getHashAsString();
    }

    Dispute dispute =
        new Dispute(
            disputeManager.getDisputeStorage(),
            trade.getId(),
            keyRing.getPubKeyRing().hashCode(), // traderId
            trade.getOffer().getDirection() == Offer.Direction.BUY ? isOfferer : !isOfferer,
            isOfferer,
            keyRing.getPubKeyRing(),
            trade.getDate(),
            trade.getContract(),
            trade.getContractHash(),
            depositTxSerialized,
            payoutTxSerialized,
            depositTxHashAsString,
            payoutTxHashAsString,
            trade.getContractAsJson(),
            trade.getOffererContractSignature(),
            trade.getTakerContractSignature(),
            user.getAcceptedArbitratorByAddress(trade.getArbitratorNodeAddress()).getPubKeyRing(),
            isSupportTicket);

    trade.setDisputeState(Trade.DisputeState.DISPUTE_REQUESTED);
    disputeManager.sendOpenNewDisputeMessage(dispute);
    navigation.navigateTo(MainView.class, DisputesView.class);
  }
Пример #3
0
 public String getReference() {
   return trade.getOffer().getReferenceText();
 }
Пример #4
0
 String getCurrencyCode() {
   return trade.getOffer().getCurrencyCode();
 }
Пример #5
0
 boolean isBuyOffer() {
   return trade.getOffer().getDirection() == Offer.Direction.BUY;
 }