Search in sources :

Example 1 with Arbitrator

use of bisq.core.arbitration.Arbitrator in project bisq-core by bisq-network.

the class Trade method getArbitratorBtcPubKey.

public byte[] getArbitratorBtcPubKey() {
    // Only new trades cannot start without any arbitrator
    if (arbitratorBtcPubKey == null) {
        Arbitrator arbitrator = processModel.getUser().getAcceptedArbitratorByAddress(arbitratorNodeAddress);
        checkNotNull(arbitrator, "arbitrator must not be null");
        arbitratorBtcPubKey = arbitrator.getBtcPubKey();
    }
    checkNotNull(arbitratorBtcPubKey, "ArbitratorPubKey must not be null");
    return arbitratorBtcPubKey;
}
Also used : Arbitrator(bisq.core.arbitration.Arbitrator)

Example 2 with Arbitrator

use of bisq.core.arbitration.Arbitrator in project bisq-core by bisq-network.

the class Trade method setArbitratorNodeAddress.

@SuppressWarnings("NullableProblems")
public void setArbitratorNodeAddress(NodeAddress arbitratorNodeAddress) {
    this.arbitratorNodeAddress = arbitratorNodeAddress;
    if (processModel.getUser() != null) {
        Arbitrator arbitrator = processModel.getUser().getAcceptedArbitratorByAddress(arbitratorNodeAddress);
        checkNotNull(arbitrator, "arbitrator must not be null");
        arbitratorBtcPubKey = arbitrator.getBtcPubKey();
        arbitratorPubKeyRing = arbitrator.getPubKeyRing();
        persist();
    }
}
Also used : Arbitrator(bisq.core.arbitration.Arbitrator)

Example 3 with Arbitrator

use of bisq.core.arbitration.Arbitrator in project bisq-desktop by bisq-network.

the class ArbitratorRegistrationViewModel method onRegister.

void onRegister(ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) {
    updateDisableStates();
    if (allDataValid) {
        AddressEntry arbitratorDepositAddressEntry = walletService.getOrCreateAddressEntry(AddressEntry.Context.ARBITRATOR);
        String registrationSignature = arbitratorManager.signStorageSignaturePubKey(registrationKey);
        // TODO not impl in UI
        String emailAddress = null;
        @SuppressWarnings("ConstantConditions") Arbitrator arbitrator = new Arbitrator(p2PService.getAddress(), arbitratorDepositAddressEntry.getPubKey(), arbitratorDepositAddressEntry.getAddressString(), keyRing.getPubKeyRing(), new ArrayList<>(languageCodes), new Date().getTime(), registrationKey.getPubKey(), registrationSignature, emailAddress, null, null);
        arbitratorManager.addArbitrator(arbitrator, () -> {
            updateDisableStates();
            resultHandler.handleResult();
        }, (errorMessage) -> {
            updateDisableStates();
            errorMessageHandler.handleErrorMessage(errorMessage);
        });
    }
}
Also used : AddressEntry(bisq.core.btc.AddressEntry) Arbitrator(bisq.core.arbitration.Arbitrator) Date(java.util.Date)

Example 4 with Arbitrator

use of bisq.core.arbitration.Arbitrator in project bisq-desktop by bisq-network.

the class ArbitratorRegistrationViewModel method activate.

@Override
protected void activate() {
    arbitratorManager.getArbitratorsObservableMap().addListener(arbitratorMapChangeListener);
    Arbitrator myRegisteredArbitrator = user.getRegisteredArbitrator();
    myArbitratorProperty.set(myRegisteredArbitrator);
    updateDisableStates();
}
Also used : Arbitrator(bisq.core.arbitration.Arbitrator)

Example 5 with Arbitrator

use of bisq.core.arbitration.Arbitrator in project bisq-desktop by bisq-network.

the class ArbitratorSelectionViewModel method updateAutoSelectArbitrators.

private void updateAutoSelectArbitrators() {
    if (preferences.isAutoSelectArbitrators()) {
        arbitratorListItems.stream().forEach(item -> {
            Arbitrator arbitrator = item.arbitrator;
            if (!isMyOwnRegisteredArbitrator(arbitrator)) {
                if (hasMatchingLanguage(arbitrator)) {
                    onAddArbitrator(arbitrator);
                    item.setIsSelected(true);
                } else {
                    onRemoveArbitrator(arbitrator);
                    item.setIsSelected(false);
                }
            } else {
                item.setIsSelected(false);
            }
        });
    }
}
Also used : Arbitrator(bisq.core.arbitration.Arbitrator)

Aggregations

Arbitrator (bisq.core.arbitration.Arbitrator)7 AddressEntry (bisq.core.btc.AddressEntry)2 BsqWalletService (bisq.core.btc.wallet.BsqWalletService)2 BtcWalletService (bisq.core.btc.wallet.BtcWalletService)2 TradeWalletService (bisq.core.btc.wallet.TradeWalletService)2 NodeAddress (bisq.network.p2p.NodeAddress)2 Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)2 FutureCallback (com.google.common.util.concurrent.FutureCallback)2 Address (org.bitcoinj.core.Address)2 Transaction (org.bitcoinj.core.Transaction)2 NotNull (org.jetbrains.annotations.NotNull)2 Offer (bisq.core.offer.Offer)1 User (bisq.core.user.User)1 Date (java.util.Date)1