use of bisq.core.btc.wallet.ChangeBelowDustException in project bisq-desktop by bisq-network.
the class ActiveProposalsView method activate.
@Override
protected void activate() {
super.activate();
bsqWalletService.addBsqBalanceListener(this);
onUpdateBalances(bsqWalletService.getAvailableBalance(), bsqWalletService.getPendingBalance(), bsqWalletService.getLockedForVotingBalance(), bsqWalletService.getLockedInBondsBalance());
if (voteButton != null) {
voteButton.setOnAction(e -> {
Coin stake = bsqFormatter.parseToCoin(stakeInputTextField.getText());
// TODO show popup
try {
voteService.publishBlindVote(stake, new FutureCallback<Transaction>() {
@Override
public void onSuccess(@Nullable Transaction result) {
// TODO
}
@Override
public void onFailure(@NotNull Throwable t) {
// TODO
}
});
} catch (CryptoException e1) {
// TODO show error popup
e1.printStackTrace();
} catch (InsufficientBsqException e1) {
e1.printStackTrace();
} catch (WalletException e1) {
e1.printStackTrace();
} catch (TransactionVerificationException e1) {
e1.printStackTrace();
} catch (InsufficientMoneyException e1) {
e1.printStackTrace();
} catch (ChangeBelowDustException e1) {
e1.printStackTrace();
} catch (InvalidProtocolBufferException e1) {
e1.printStackTrace();
}
});
}
}
use of bisq.core.btc.wallet.ChangeBelowDustException in project bisq-desktop by bisq-network.
the class MakeProposalView method publishProposal.
private void publishProposal(ProposalType type) {
try {
Proposal proposal = createProposal(type);
Transaction tx = Objects.requireNonNull(proposal).getTx();
Coin miningFee = Objects.requireNonNull(tx).getFee();
int txSize = tx.bitcoinSerialize().length;
validateInputs();
new Popup<>().headLine(Res.get("dao.proposal.create.confirm")).confirmation(Res.get("dao.proposal.create.confirm.info", bsqFormatter.formatCoinWithCode(ProposalConsensus.getCreateCompensationRequestFee(readableBsqBlockChain)), btcFormatter.formatCoinWithCode(miningFee), CoinUtil.getFeePerByte(miningFee, txSize), (txSize / 1000d))).actionButtonText(Res.get("shared.yes")).onAction(() -> {
proposalCollectionsService.publishProposal(proposal, new FutureCallback<Transaction>() {
@Override
public void onSuccess(@Nullable Transaction transaction) {
proposalDisplay.clearForm();
proposalTypeComboBox.getSelectionModel().clearSelection();
new Popup<>().confirmation(Res.get("dao.tx.published.success")).show();
}
@Override
public void onFailure(@NotNull Throwable t) {
log.error(t.toString());
new Popup<>().warning(t.toString()).show();
}
});
}).closeButtonText(Res.get("shared.cancel")).show();
} catch (InsufficientMoneyException e) {
BSFormatter formatter = e instanceof InsufficientBsqException ? bsqFormatter : btcFormatter;
new Popup<>().warning(Res.get("dao.proposal.create.missingFunds", formatter.formatCoinWithCode(e.missing))).show();
} catch (CompensationAmountException e) {
new Popup<>().warning(Res.get("validation.bsq.amountBelowMinAmount", bsqFormatter.formatCoinWithCode(e.required))).show();
} catch (TransactionVerificationException | WalletException e) {
log.error(e.toString());
e.printStackTrace();
new Popup<>().warning(e.toString()).show();
} catch (ChangeBelowDustException e) {
// TODO
e.printStackTrace();
}
}
Aggregations