5 #if defined(HAVE_CONFIG_H)
10 #include <qt/forms/ui_sendcoinsdialog.h>
26 #include <txmempool.h>
27 #include <validation.h>
37 #include <QFontMetrics>
40 #include <QTextDocument>
45 static constexpr std::array
confTargets{2, 4, 6, 12, 24, 48, 144, 504, 1008};
47 if (index+1 >
static_cast<int>(
confTargets.size())) {
56 for (
unsigned int i = 0; i <
confTargets.size(); i++) {
68 platformStyle(_platformStyle)
73 ui->addButton->setIcon(QIcon());
74 ui->clearButton->setIcon(QIcon());
75 ui->sendButton->setIcon(QIcon());
95 QAction *clipboardQuantityAction =
new QAction(tr(
"Copy quantity"),
this);
96 QAction *clipboardAmountAction =
new QAction(tr(
"Copy amount"),
this);
97 QAction *clipboardFeeAction =
new QAction(tr(
"Copy fee"),
this);
98 QAction *clipboardAfterFeeAction =
new QAction(tr(
"Copy after fee"),
this);
99 QAction *clipboardBytesAction =
new QAction(tr(
"Copy bytes"),
this);
100 QAction *clipboardLowOutputAction =
new QAction(tr(
"Copy dust"),
this);
101 QAction *clipboardChangeAction =
new QAction(tr(
"Copy change"),
this);
109 ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);
110 ui->labelCoinControlAmount->addAction(clipboardAmountAction);
111 ui->labelCoinControlFee->addAction(clipboardFeeAction);
112 ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);
113 ui->labelCoinControlBytes->addAction(clipboardBytesAction);
114 ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
115 ui->labelCoinControlChange->addAction(clipboardChangeAction);
119 if (!settings.contains(
"fFeeSectionMinimized"))
120 settings.setValue(
"fFeeSectionMinimized",
true);
121 if (!settings.contains(
"nFeeRadio") && settings.contains(
"nTransactionFee") && settings.value(
"nTransactionFee").toLongLong() > 0)
122 settings.setValue(
"nFeeRadio", 1);
123 if (!settings.contains(
"nFeeRadio"))
124 settings.setValue(
"nFeeRadio", 0);
125 if (!settings.contains(
"nSmartFeeSliderPosition"))
126 settings.setValue(
"nSmartFeeSliderPosition", 0);
127 if (!settings.contains(
"nTransactionFee"))
129 ui->groupFee->setId(
ui->radioSmartFee, 0);
130 ui->groupFee->setId(
ui->radioCustomFee, 1);
131 ui->groupFee->button((
int)std::max(0, std::min(1, settings.value(
"nFeeRadio").toInt())))->setChecked(
true);
132 ui->customFee->SetAllowEmpty(
false);
133 ui->customFee->setValue(settings.value(
"nTransactionFee").toLongLong());
150 this->
model = _model;
154 for(
int i = 0; i <
ui->entries->count(); ++i)
156 SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(
ui->entries->itemAt(i)->widget());
180 #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
192 ui->customFee->SetMinValue(requiredFee);
193 if (
ui->customFee->value() < requiredFee) {
194 ui->customFee->setValue(requiredFee);
196 ui->customFee->setSingleStep(requiredFee);
201 ui->optInRBF->setCheckState(Qt::Checked);
205 ui->sendButton->setText(tr(
"Sign on device"));
207 ui->sendButton->setEnabled(
true);
208 ui->sendButton->setToolTip(tr(
"Connect your hardware wallet first."));
210 ui->sendButton->setEnabled(
false);
212 ui->sendButton->setToolTip(tr(
"Set external signer script path in Options -> Wallet"));
215 ui->sendButton->setText(tr(
"Cr&eate Unsigned"));
216 ui->sendButton->setToolTip(tr(
"Creates a Partially Signed Bitcoin Transaction (PSBT) for use with e.g. an offline %1 wallet, or a PSBT-compatible hardware wallet.").arg(
PACKAGE_NAME));
221 if (settings.value(
"nSmartFeeSliderPosition").toInt() != 0) {
224 int nConfirmTarget = 25 - settings.value(
"nSmartFeeSliderPosition").toInt();
225 settings.setValue(
"nConfTarget", nConfirmTarget);
226 settings.remove(
"nSmartFeeSliderPosition");
228 if (settings.value(
"nConfTarget").toInt() == 0)
239 settings.setValue(
"nFeeRadio",
ui->groupFee->checkedId());
241 settings.setValue(
"nTransactionFee", (qint64)
ui->customFee->value());
248 QList<SendCoinsRecipient> recipients;
251 for(
int i = 0; i <
ui->entries->count(); ++i)
253 SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(
ui->entries->itemAt(i)->widget());
258 recipients.append(entry->
getValue());
262 ui->scrollArea->ensureWidgetVisible(entry);
268 if(!valid || recipients.isEmpty())
302 QStringList formatted;
312 QString address = rcp.address;
314 QString recipientElement;
317 if(rcp.label.length() > 0)
320 recipientElement.append(QString(
" (%1)").arg(address));
324 recipientElement.append(tr(
"%1 to %2").arg(amount, address));
327 formatted.append(recipientElement);
332 question_string.append(tr(
"Do you want to create this transaction?"));
333 question_string.append(
"<br /><span style='font-size:10pt;'>");
338 question_string.append(tr(
"Please, review your transaction proposal. This will produce a Partially Signed Bitcoin Transaction (PSBT) which you can save or copy and then sign with e.g. an offline %1 wallet, or a PSBT-compatible hardware wallet.").arg(
PACKAGE_NAME));
343 question_string.append(tr(
"Please, review your transaction. You can create and send this transaction or create a Partially Signed Bitcoin Transaction (PSBT), which you can save or copy and then sign with, e.g., an offline %1 wallet, or a PSBT-compatible hardware wallet.").arg(
PACKAGE_NAME));
346 question_string.append(tr(
"Please, review your transaction."));
348 question_string.append(
"</span>%1");
353 question_string.append(
"<hr /><b>");
354 question_string.append(tr(
"Transaction fee"));
355 question_string.append(
"</b>");
358 question_string.append(
" (" + QString::number((
double)
m_current_transaction->getTransactionSize() / 1000) +
" kB): ");
361 question_string.append(
"<span style='color:#aa0000; font-weight:bold;'>");
363 question_string.append(
"</span><br />");
366 question_string.append(
"<span style='font-size:10pt; font-weight:normal;'>");
367 if (
ui->optInRBF->isChecked()) {
368 question_string.append(tr(
"You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
370 question_string.append(tr(
"Not signalling Replace-By-Fee, BIP-125."));
372 question_string.append(
"</span>");
376 question_string.append(
"<hr />");
378 QStringList alternativeUnits;
383 question_string.append(QString(
"<b>%1</b>: <b>%2</b>").arg(tr(
"Total Amount"))
385 question_string.append(QString(
"<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>")
386 .arg(alternativeUnits.join(
" " + tr(
"or") +
" ")));
388 if (formatted.size() > 1) {
389 question_string = question_string.arg(
"");
390 informative_text = tr(
"To review recipient list click \"Show Details…\"");
391 detailed_text = formatted.join(
"\n\n");
393 question_string = question_string.arg(
"<br /><br />" + formatted.at(0));
406 msgBox.setText(
"Unsigned Transaction");
407 msgBox.setInformativeText(
"The PSBT has been copied to the clipboard. You can also save it.");
408 msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
409 msgBox.setDefaultButton(QMessageBox::Discard);
410 switch (msgBox.exec()) {
411 case QMessageBox::Save: {
412 QString selectedFilter;
413 QString fileNameSuggestion =
"";
417 fileNameSuggestion.append(
" - ");
419 QString labelOrAddress = rcp.label.isEmpty() ? rcp.address : rcp.label;
421 fileNameSuggestion.append(labelOrAddress +
"-" + amount);
424 fileNameSuggestion.append(
".psbt");
426 tr(
"Save Transaction Data"), fileNameSuggestion,
428 tr(
"Partially Signed Transaction (Binary)") + QLatin1String(
" (*.psbt)"), &selectedFilter);
429 if (filename.isEmpty()) {
432 std::ofstream out{filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary};
438 case QMessageBox::Discard:
449 }
catch (
const std::runtime_error& e) {
450 QMessageBox::critical(
nullptr, tr(
"Sign failed"), e.what());
455 QMessageBox::critical(
nullptr, tr(
"External signer not found"),
"External signer not found");
460 QMessageBox::critical(
nullptr, tr(
"External signer failure"),
"External signer failure");
478 QString question_string, informative_text, detailed_text;
479 if (!
PrepareSendText(question_string, informative_text, detailed_text))
return;
482 const QString confirmation = tr(
"Confirm send coins");
486 confirmationDialog->setAttribute(Qt::WA_DeleteOnClose);
488 const auto retval =
static_cast<QMessageBox::StandardButton
>(confirmationDialog->exec());
490 if(retval != QMessageBox::Yes && retval != QMessageBox::Save)
496 bool send_failure =
false;
497 if (retval == QMessageBox::Save) {
501 bool complete =
false;
512 bool broadcast =
true;
516 bool complete =
false;
524 broadcast = complete && !send_failure;
561 ui->checkBoxCoinControlChange->setChecked(
false);
562 ui->lineEditCoinControlChange->clear();
566 while(
ui->entries->count())
568 ui->entries->takeAt(0)->widget()->deleteLater();
589 ui->entries->addWidget(entry);
598 ui->scrollAreaWidgetContents->resize(
ui->scrollAreaWidgetContents->sizeHint());
599 qApp->processEvents();
600 QScrollBar* bar =
ui->scrollArea->verticalScrollBar();
602 bar->setSliderPosition(bar->maximum());
619 if (
ui->entries->count() == 1)
622 entry->deleteLater();
629 for(
int i = 0; i <
ui->entries->count(); ++i)
631 SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(
ui->entries->itemAt(i)->widget());
637 QWidget::setTabOrder(prev,
ui->sendButton);
638 QWidget::setTabOrder(
ui->sendButton,
ui->clearButton);
639 QWidget::setTabOrder(
ui->clearButton,
ui->addButton);
640 return ui->addButton;
647 if(
ui->entries->count() == 1)
649 SendCoinsEntry *first = qobject_cast<SendCoinsEntry*>(
ui->entries->itemAt(0)->widget());
670 if(
ui->entries->count() == 1)
672 SendCoinsEntry *first = qobject_cast<SendCoinsEntry*>(
ui->entries->itemAt(0)->widget());
701 ui->labelBalanceName->setText(tr(
"External balance:"));
704 ui->labelBalanceName->setText(tr(
"Watch-only balance:"));
719 QPair<QString, CClientUIInterface::MessageBoxFlags> msgParams;
725 switch(sendCoinsReturn.
status)
728 msgParams.first = tr(
"The recipient address is not valid. Please recheck.");
731 msgParams.first = tr(
"The amount to pay must be larger than 0.");
734 msgParams.first = tr(
"The amount exceeds your balance.");
737 msgParams.first = tr(
"The total exceeds your balance when the %1 transaction fee is included.").arg(msgArg);
740 msgParams.first = tr(
"Duplicate address found: addresses should only be used once each.");
743 msgParams.first = tr(
"Transaction creation failed!");
755 Q_EMIT
message(tr(
"Send Coins"), msgParams.first, msgParams.second);
760 ui->labelFeeMinimized->setVisible(fMinimize);
761 ui->buttonChooseFee ->setVisible(fMinimize);
762 ui->buttonMinimizeFee->setVisible(!fMinimize);
763 ui->frameFeeSelection->setVisible(!fMinimize);
764 ui->horizontalLayoutSmartFee->setContentsMargins(0, (fMinimize ? 0 : 6), 0, 0);
786 for (
int i = 0; i <
ui->entries->count(); ++i) {
787 SendCoinsEntry* e = qobject_cast<SendCoinsEntry*>(
ui->entries->itemAt(i)->widget());
788 if (e && !e->isHidden() && e != entry) {
803 ui->confTargetSelector ->setEnabled(
ui->radioSmartFee->isChecked());
804 ui->labelSmartFee ->setEnabled(
ui->radioSmartFee->isChecked());
805 ui->labelSmartFee2 ->setEnabled(
ui->radioSmartFee->isChecked());
806 ui->labelSmartFee3 ->setEnabled(
ui->radioSmartFee->isChecked());
807 ui->labelFeeEstimation ->setEnabled(
ui->radioSmartFee->isChecked());
808 ui->labelCustomFeeWarning ->setEnabled(
ui->radioCustomFee->isChecked());
809 ui->labelCustomPerKilobyte ->setEnabled(
ui->radioCustomFee->isChecked());
810 ui->customFee ->setEnabled(
ui->radioCustomFee->isChecked());
818 if (
ui->radioSmartFee->isChecked())
819 ui->labelFeeMinimized->setText(
ui->labelSmartFee->text());
827 if (
ui->radioCustomFee->isChecked()) {
859 ui->labelSmartFee2->show();
860 ui->labelFeeEstimation->setText(
"");
861 ui->fallbackFeeWarningLabel->setVisible(
true);
862 int lightness =
ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness();
863 QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14));
864 ui->fallbackFeeWarningLabel->setStyleSheet(
"QLabel { color: " + warning_colour.name() +
"; }");
865 ui->fallbackFeeWarningLabel->setIndent(
GUIUtil::TextWidth(QFontMetrics(
ui->fallbackFeeWarningLabel->font()),
"x"));
869 ui->labelSmartFee2->hide();
870 ui->labelFeeEstimation->setText(tr(
"Estimated to begin confirmation within %n block(s).",
"", returned_target));
871 ui->fallbackFeeWarningLabel->setVisible(
false);
922 ui->frameCoinControl->setVisible(checked);
924 if (!checked &&
model) {
942 if (state == Qt::Unchecked)
945 ui->labelCoinControlChangeLabel->clear();
951 ui->lineEditCoinControlChange->setEnabled((state == Qt::Checked));
961 ui->labelCoinControlChangeLabel->setStyleSheet(
"QLabel{color:red;}");
967 ui->labelCoinControlChangeLabel->setText(
"");
971 ui->labelCoinControlChangeLabel->setText(tr(
"Warning: Invalid Bitcoin address"));
976 ui->labelCoinControlChangeLabel->setText(tr(
"Warning: Unknown change address"));
979 QMessageBox::StandardButton btnRetVal = QMessageBox::question(
this, tr(
"Confirm custom change address"), tr(
"The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?"),
980 QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
982 if(btnRetVal == QMessageBox::Yes)
986 ui->lineEditCoinControlChange->setText(
"");
987 ui->labelCoinControlChangeLabel->setStyleSheet(
"QLabel{color:black;}");
988 ui->labelCoinControlChangeLabel->setText(
"");
993 ui->labelCoinControlChangeLabel->setStyleSheet(
"QLabel{color:black;}");
997 if (!associatedLabel.isEmpty())
998 ui->labelCoinControlChangeLabel->setText(associatedLabel);
1000 ui->labelCoinControlChangeLabel->setText(tr(
"(no label)"));
1020 for(
int i = 0; i <
ui->entries->count(); ++i)
1022 SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(
ui->entries->itemAt(i)->widget());
1023 if(entry && !entry->isHidden())
1038 ui->labelCoinControlAutomaticallySelected->hide();
1039 ui->widgetCoinControl->show();
1044 ui->labelCoinControlAutomaticallySelected->show();
1045 ui->widgetCoinControl->hide();
1046 ui->labelCoinControlInsuffFunds->hide();
1051 : QMessageBox(parent), secDelay(_secDelay), m_enable_send(enable_send)
1053 setIcon(QMessageBox::Question);
1054 setWindowTitle(title);
1056 setInformativeText(informative_text);
1057 setDetailedText(detailed_text);
1058 setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
1059 if (always_show_unsigned || !enable_send) addButton(QMessageBox::Save);
1060 setDefaultButton(QMessageBox::Cancel);
1074 return QMessageBox::exec();
int64_t CAmount
Amount in satoshis (Can be negative)
const CChainParams & Params()
Return the currently selected parameters.
QString labelForAddress(const QString &address) const
Look up label for address in address book, if not found return empty string.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
static QString formatHtmlWithUnit(Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as HTML string (with unit)
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
static QString formatWithUnit(Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
CAmount GetFeePerK() const
Return the fee in satoshis for a vsize of 1000 vbytes.
Model for Bitcoin network client.
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, SyncType header, SynchronizationState sync_state)
static QList< CAmount > payAmounts
static void updateLabels(wallet::CCoinControl &m_coin_control, WalletModel *, QDialog *)
static bool fSubtractFeeFromAmount
bool getCoinControlFeatures() const
bool getEnablePSBTControls() const
void coinControlFeaturesChanged(bool)
void displayUnitChanged(BitcoinUnit unit)
BitcoinUnit getDisplayUnit() const
Dialog for sending bitcoins.
void useAvailableBalance(SendCoinsEntry *entry)
void presentPSBT(PartiallySignedTransaction &psbt)
ClientModel * clientModel
void coinControlChangeEdited(const QString &)
void coinControlChangeChecked(int)
void coinControlClipboardFee()
void on_buttonChooseFee_clicked()
void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg=QString())
void setClientModel(ClientModel *clientModel)
void updateTabsAndLabels()
void updateFeeSectionControls()
SendCoinsEntry * addEntry()
void updateNumberOfBlocks(int count, const QDateTime &blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state)
void pasteEntry(const SendCoinsRecipient &rv)
void updateFeeMinimizedLabel()
const PlatformStyle * platformStyle
std::unique_ptr< wallet::CCoinControl > m_coin_control
void coinControlClipboardQuantity()
void coinControlButtonClicked()
void coinControlClipboardAfterFee()
bool signWithExternalSigner(PartiallySignedTransaction &psbt, CMutableTransaction &mtx, bool &complete)
QWidget * setupTabChain(QWidget *prev)
Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://...
bool PrepareSendText(QString &question_string, QString &informative_text, QString &detailed_text)
void sendButtonClicked(bool checked)
void setModel(WalletModel *model)
void coinControlClipboardLowOutput()
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
void setBalance(const interfaces::WalletBalances &balances)
void coinControlClipboardAmount()
void setAddress(const QString &address)
void coinControlClipboardChange()
std::unique_ptr< WalletModelTransaction > m_current_transaction
bool fNewRecipientAllowed
void removeEntry(SendCoinsEntry *entry)
void updateSmartFeeLabel()
void updateCoinControlState()
void coinControlClipboardBytes()
void message(const QString &title, const QString &message, unsigned int style)
SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
void coinsSent(const uint256 &txid)
void on_buttonMinimizeFee_clicked()
void coinControlUpdateLabels()
void coinControlFeatureChanged(bool)
void minimizeFeeSection(bool fMinimize)
A single entry in the dialog for sending bitcoins.
void setAddress(const QString &address)
bool isClear()
Return whether the entry is still empty and unedited.
void subtractFeeFromAmountChanged()
void useAvailableBalance(SendCoinsEntry *entry)
void setValue(const SendCoinsRecipient &value)
void setModel(WalletModel *model)
void removeEntry(SendCoinsEntry *entry)
void setAmount(const CAmount &amount)
QWidget * setupTabChain(QWidget *prev)
Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://...
bool validate(interfaces::Node &node)
void checkSubtractFeeFromAmount()
SendCoinsRecipient getValue()
bool fSubtractFeeFromAmount
QString m_psbt_button_text
SendConfirmationDialog(const QString &title, const QString &text, const QString &informative_text="", const QString &detailed_text="", int secDelay=SEND_CONFIRM_DELAY, bool enable_send=true, bool always_show_unsigned=true, QWidget *parent=nullptr)
QAbstractButton * m_psbt_button
QAbstractButton * yesButton
QString confirmButtonText
Interface to Bitcoin wallet from Qt view code.
AddressTableModel * getAddressTableModel() const
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const wallet::CCoinControl &coinControl)
void sendCoins(WalletModelTransaction &transaction)
CAmount getAvailableBalance(const wallet::CCoinControl *control)
bool isMultiwallet() const
interfaces::Wallet & wallet() const
OptionsModel * getOptionsModel() const
interfaces::Node & node() const
UnlockContext requestUnlock()
void balanceChanged(const interfaces::WalletBalances &balances)
interfaces::WalletBalances getCachedBalance() const
QString getWalletName() const
@ AmountWithFeeExceedsBalance
@ TransactionCreationFailed
virtual bool isLegacy()=0
Return whether is a legacy wallet.
virtual TransactionError fillPSBT(int sighash_type, bool sign, bool bip32derivs, size_t *n_signed, PartiallySignedTransaction &psbtx, bool &complete)=0
Fill PSBT.
virtual CAmount getRequiredFee(unsigned int tx_bytes)=0
Get required fee.
virtual unsigned int getConfirmTarget()=0
Get tx confirm target.
virtual bool hasExternalSigner()=0
virtual CAmount getDefaultMaxTxFee()=0
Get max tx fee.
virtual bool isSpendable(const CTxDestination &dest)=0
Return whether wallet has private key.
virtual bool privateKeysDisabled()=0
virtual CAmount getMinimumFee(unsigned int tx_bytes, const wallet::CCoinControl &coin_control, int *returned_target, FeeReason *reason)=0
Get minimum fee.
bool m_allow_other_inputs
If true, the selection process can add extra unselected inputs from the wallet while requires all sel...
@ EXTERNAL_SIGNER_NOT_FOUND
CTxDestination DecodeDestination(const std::string &str, std::string &error_msg, std::vector< int > *error_locations)
Utility functions used by the Bitcoin Qt UI.
QString HtmlEscape(const QString &str, bool fMultiLine)
void ShowModalDialogAsynchronously(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when ...
QString formatNiceTimeOffset(qint64 secs)
constexpr auto dialog_flags
auto ExceptionSafeConnect(Sender sender, Signal signal, Receiver receiver, Slot method, Qt::ConnectionType type=Qt::AutoConnection)
A drop-in replacement of QObject::connect function (see: https://doc.qt.io/qt-5/qobject....
int TextWidth(const QFontMetrics &fm, const QString &text)
Returns the distance in pixels appropriate for drawing a subsequent character after text.
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
void setClipboard(const QString &str)
constexpr CAmount DEFAULT_PAY_TX_FEE
-paytxfee default
static CTransactionRef MakeTransactionRef(Tx &&txIn)
std::shared_ptr< const CTransaction > CTransactionRef
bool FinalizeAndExtractPSBT(PartiallySignedTransaction &psbtx, CMutableTransaction &result)
Finalizes a PSBT if possible, and extracts it to a CMutableTransaction if it could be finalized.
int getConfTargetForIndex(int index)
int getIndexForConfTarget(int target)
static constexpr std::array confTargets
#define SEND_CONFIRM_DELAY
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
std::variant< CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
A mutable version of CTransaction.
A version of CTransaction with the PSBT format.
Collection of wallet balances.
CAmount watch_only_balance
static secp256k1_context * ctx
std::string EncodeBase64(Span< const unsigned char > input)
SynchronizationState
Current sync state passed to tip changed callbacks.
static const int PROTOCOL_VERSION
network protocol versioning