8 #include "ui_reissueassetdialog.h" 24 #include <validation.h> 34 #include <QGraphicsDropShadowEffect> 35 #include <QModelIndex> 37 #include <QMessageBox> 40 #include <QStringListModel> 41 #include <QSortFilterProxyModel> 48 platformStyle(_platformStyle)
51 setWindowTitle(
"Reissue Assets");
53 connect(
ui->quantitySpinBox, SIGNAL(valueChanged(
double)),
this, SLOT(
onQuantityChanged(
double)));
55 connect(
ui->ipfsText, SIGNAL(textChanged(QString)),
this, SLOT(
onIPFSHashChanged(QString)));
59 connect(
ui->unitSpinBox, SIGNAL(valueChanged(
int)),
this, SLOT(
onUnitChanged(
int)));
69 connect(
ui->lineEditCoinControlChange, SIGNAL(textEdited(
const QString &)),
this, SLOT(
coinControlChangeEdited(
const QString &)));
72 QAction *clipboardQuantityAction =
new QAction(tr(
"Copy quantity"),
this);
73 QAction *clipboardAmountAction =
new QAction(tr(
"Copy amount"),
this);
74 QAction *clipboardFeeAction =
new QAction(tr(
"Copy fee"),
this);
75 QAction *clipboardAfterFeeAction =
new QAction(tr(
"Copy after fee"),
this);
76 QAction *clipboardBytesAction =
new QAction(tr(
"Copy bytes"),
this);
77 QAction *clipboardLowOutputAction =
new QAction(tr(
"Copy dust"),
this);
78 QAction *clipboardChangeAction =
new QAction(tr(
"Copy change"),
this);
86 ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);
87 ui->labelCoinControlAmount->addAction(clipboardAmountAction);
88 ui->labelCoinControlFee->addAction(clipboardFeeAction);
89 ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);
90 ui->labelCoinControlBytes->addAction(clipboardBytesAction);
91 ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
92 ui->labelCoinControlChange->addAction(clipboardChangeAction);
96 if (!settings.contains(
"fFeeSectionMinimized"))
97 settings.setValue(
"fFeeSectionMinimized",
true);
98 if (!settings.contains(
"nFeeRadio") && settings.contains(
"nTransactionFee") && settings.value(
"nTransactionFee").toLongLong() > 0)
99 settings.setValue(
"nFeeRadio", 1);
100 if (!settings.contains(
"nFeeRadio"))
101 settings.setValue(
"nFeeRadio", 0);
102 if (!settings.contains(
"nSmartFeeSliderPosition"))
103 settings.setValue(
"nSmartFeeSliderPosition", 0);
104 if (!settings.contains(
"nTransactionFee"))
105 settings.setValue(
"nTransactionFee", (qint64)DEFAULT_TRANSACTION_FEE);
106 if (!settings.contains(
"fPayOnlyMinFee"))
107 settings.setValue(
"fPayOnlyMinFee",
false);
108 ui->groupFee->setId(
ui->radioSmartFee, 0);
109 ui->groupFee->setId(
ui->radioCustomFee, 1);
110 ui->groupFee->button((
int)std::max(0, std::min(1, settings.value(
"nFeeRadio").toInt())))->setChecked(
true);
111 ui->customFee->setValue(settings.value(
"nTransactionFee").toLongLong());
112 ui->checkBoxMinimumFee->setChecked(settings.value(
"fPayOnlyMinFee").toBool());
115 formatGreen =
"%1%2 <font color=green><b>%3</b></font>";
116 formatBlack =
"%1%2 <font color=black><b>%3</b></font>";
118 formatBlack =
"%1%2 <font color=white><b>%3</b></font>";
127 proxy =
new QSortFilterProxyModel;
129 proxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
132 ui->comboBox->setEditable(
true);
133 ui->comboBox->lineEdit()->setPlaceholderText(
"Select an asset");
136 completer->setCompletionMode(QCompleter::PopupCompletion);
137 completer->setCaseSensitivity(Qt::CaseInsensitive);
147 connect(_clientModel, SIGNAL(numBlocksChanged(
int,QDateTime,
double,
bool)),
this, SLOT(
updateSmartFeeLabel()));
153 this->
model = _model;
159 connect(_model, SIGNAL(balanceChanged(
CAmount,
CAmount,
CAmount,
CAmount,
CAmount,
CAmount)),
this, SLOT(
setBalance(
CAmount,
CAmount,
CAmount,
CAmount,
CAmount,
CAmount)));
167 ui->frameCoinControl->setVisible(fCoinControlEnabled);
168 ui->addressText->setVisible(fCoinControlEnabled);
169 ui->addressLabel->setVisible(fCoinControlEnabled);
177 for (
const int &n : confTargets) {
180 connect(
ui->confTargetSelector, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
updateSmartFeeLabel()));
185 connect(
ui->checkBoxMinimumFee, SIGNAL(stateChanged(
int)),
this, SLOT(
setMinimumFee()));
197 ui->optInRBF->hide();
201 if (settings.value(
"nSmartFeeSliderPosition").toInt() != 0) {
204 int nConfirmTarget = 25 - settings.value(
"nSmartFeeSliderPosition").toInt();
205 settings.setValue(
"nConfTarget", nConfirmTarget);
206 settings.remove(
"nSmartFeeSliderPosition");
208 if (settings.value(
"nConfTarget").toInt() == 0)
214 ui->reissueCostLabel->setStyleSheet(
"font-weight: bold");
235 ui->reissuableBox->setCheckState(Qt::CheckState::Checked);
236 ui->ipfsText->setDisabled(
true);
239 ui->unitExampleLabel->setStyleSheet(
"font-weight: bold");
244 ui->currentAssetData->viewport()->setAutoFillBackground(
false);
245 ui->currentAssetData->setFrameStyle(QFrame::NoFrame);
248 ui->updatedAssetData->viewport()->setAutoFillBackground(
false);
249 ui->updatedAssetData->setFrameStyle(QFrame::NoFrame);
254 ui->reissueWarningLabel->hide();
262 ui->frameCoinControl->setStyleSheet(QString(
".QFrame {background-color: %1; padding-top: 10px; padding-right: 5px; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
263 ui->widgetCoinControl->setStyleSheet(
".QWidget {background-color: transparent;}");
296 ui->checkBoxCoinControlChange->setStyleSheet(QString(
".QCheckBox{ %1; }").arg(
STRING_LABEL_COLOR));
315 ui->frame->setStyleSheet(QString(
".QFrame {background-color: %1; padding-top: 10px; padding-right: 5px; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
334 ui->frame_3->setStyleSheet(QString(
".QFrame {background-color: %1; padding-top: 10px; padding-right: 5px; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
337 ui->frame_2->setStyleSheet(QString(
".QFrame {background-color: %1; padding-top: 10px; padding-right: 5px; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
351 ui->frameFee->setStyleSheet(QString(
".QFrame {background-color: %1; padding-top: 10px; padding-right: 5px; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
386 const CAmount& watchBalance,
const CAmount& watchUnconfirmedBalance,
const CAmount& watchImmatureBalance)
388 Q_UNUSED(unconfirmedBalance);
389 Q_UNUSED(immatureBalance);
390 Q_UNUSED(watchBalance);
391 Q_UNUSED(watchUnconfirmedBalance);
392 Q_UNUSED(watchImmatureBalance);
413 if (
ui->ipfsBox->isChecked()) {
414 ui->ipfsText->setDisabled(
false);
416 ui->ipfsText->setDisabled(
true);
425 ui->messageLabel->setStyleSheet(
"color: red");
426 ui->messageLabel->setText(
string);
427 ui->messageLabel->show();
432 ui->messageLabel->setStyleSheet(
"color: green");
433 ui->messageLabel->setText(
string);
434 ui->messageLabel->show();
439 ui->messageLabel->hide();
444 ui->reissueAssetButton->setDisabled(
true);
449 ui->reissueAssetButton->setDisabled(
false);
463 if (
asset->
nAmount +
ui->quantitySpinBox->value() * COIN > MAX_MONEY) {
464 showMessage(tr(
"Quantity is to large. Max is 21,000,000,000"));
470 if (!
ui->addressText->text().isEmpty()) {
472 showMessage(tr(
"Invalid Raven Destination Address"));
477 if (
ui->ipfsBox->isChecked())
482 if ((!
ui->ipfsBox->isChecked() || (
ui->ipfsBox->isChecked() &&
ui->ipfsText->text().isEmpty())) &&
ui->reissuableBox->isChecked() &&
ui->quantitySpinBox->value() == 0 &&
ui->unitSpinBox->value() ==
asset->
units) {
493 ui->quantitySpinBox->setDisabled(
true);
494 ui->addressText->setDisabled(
true);
495 ui->reissuableBox->setDisabled(
true);
496 ui->ipfsBox->setDisabled(
true);
497 ui->reissueAssetButton->setDisabled(
true);
498 ui->unitSpinBox->setDisabled(
true);
505 ui->quantitySpinBox->setDisabled(
false);
506 ui->addressText->setDisabled(
false);
507 ui->reissuableBox->setDisabled(
false);
508 ui->ipfsBox->setDisabled(
false);
509 ui->unitSpinBox->setDisabled(
false);
517 double newValue = value.get_real() +
ui->quantitySpinBox->value();
519 std::stringstream ss;
521 ss << std::fixed << newValue;
523 QString reissuable =
ui->reissuableBox->isChecked() ? tr(
"Yes") : tr(
"No");
527 if (
ui->quantitySpinBox->value() > 0)
528 quantity =
formatGreen.arg(tr(
"Total Quantity"),
":", QString::fromStdString(ss.str())) +
"\n";
530 quantity =
formatBlack.arg(tr(
"Total Quantity"),
":", QString::fromStdString(ss.str())) +
"\n";
534 units =
formatGreen.arg(tr(
"Units"),
":", QString::number(
ui->unitSpinBox->value())) +
"\n";
536 units =
formatBlack.arg(tr(
"Units"),
":", QString::number(
ui->unitSpinBox->value())) +
"\n";
539 if (
ui->reissuableBox->isChecked())
540 reissue =
formatBlack.arg(tr(
"Can Reisssue"),
":", reissuable) +
"\n";
542 reissue =
formatGreen.arg(tr(
"Can Reisssue"),
":", reissuable) +
"\n";
546 if (
asset->
nHasIPFS && (!
ui->ipfsBox->isChecked() || (
ui->ipfsBox->isChecked() &&
ui->ipfsText->text().isEmpty()))) {
548 if (qstr.size() == 46) {
549 ipfs =
formatBlack.arg(tr(
"IPFS Hash"),
":", qstr) +
"\n";
550 }
else if (qstr.size() == 64) {
551 ipfs =
formatBlack.arg(tr(
"Txid Hash"),
":", qstr) +
"\n";
553 }
else if (
ui->ipfsBox->isChecked() && !
ui->ipfsText->text().isEmpty()) {
554 QString qstr =
ui->ipfsText->text();
555 if (qstr.size() == 46) {
556 ipfs =
formatGreen.arg(tr(
"IPFS Hash"),
":", qstr) +
"\n";
557 }
else if (qstr.size() == 64) {
558 ipfs =
formatGreen.arg(tr(
"Txid Hash"),
":", qstr) +
"\n";
562 ui->updatedAssetData->clear();
563 ui->updatedAssetData->append(name);
564 ui->updatedAssetData->append(quantity);
565 ui->updatedAssetData->append(units);
566 ui->updatedAssetData->append(reissue);
567 ui->updatedAssetData->append(ipfs);
568 ui->updatedAssetData->show();
569 ui->updatedAssetData->setFixedHeight(
ui->updatedAssetData->document()->size().height());
574 ui->currentAssetData->clear();
575 ui->updatedAssetData->clear();
576 ui->currentAssetData->setText(tr(
"Please select a asset from the menu to display the assets current settings"));
577 ui->updatedAssetData->setText(tr(
"Please select a asset from the menu to display the assets updated settings"));
586 ui->currentAssetData->show();
587 QString qstr_name =
ui->comboBox->currentText();
592 if (!currentActiveAssetCache->GetAssetMetaDataIfExists(qstr_name.toStdString(), *
asset)) {
596 ui->currentAssetData->hide();
597 ui->currentAssetData->clear();
603 std::stringstream ss;
605 ss << std::fixed << value.get_real();
610 ui->quantitySpinBox->setMaximum(21000000000 - value.get_real());
612 ui->currentAssetData->clear();
615 QString quantity =
formatBlack.arg(tr(
"Current Quantity"),
":", QString::fromStdString(ss.str())) +
"\n";
616 QString units =
formatBlack.arg(tr(
"Current Units"),
":", QString::number(
ui->unitSpinBox->value()));
618 QString assetdatahash =
"";
621 if (qstr.size() == 46) {
622 assetdatahash =
formatBlack.arg(tr(
"IPFS Hash"),
":", qstr) +
"\n";
623 }
else if (qstr.size() == 64) {
624 assetdatahash =
formatBlack.arg(tr(
"Txid Hash"),
":", qstr) +
"\n";
627 assetdatahash =
formatBlack.arg(tr(
"Unknown data hash type"),
":", qstr) +
"\n";
631 ui->currentAssetData->append(name);
632 ui->currentAssetData->append(quantity);
633 ui->currentAssetData->append(units);
634 ui->currentAssetData->append(reissue);
635 ui->currentAssetData->append(assetdatahash);
636 ui->currentAssetData->setFixedHeight(
ui->currentAssetData->document()->size().height());
661 if (!hash.isEmpty()) {
663 if (hash.length() > 46) {
664 showMessage(tr(
"Only IPFS Hashes allowed until RIP5 is activated"));
673 showMessage(tr(
"IPFS/Txid Hash must start with 'Qm' and be 46 characters or Txid Hash must have 64 hex characters"));
676 }
else if (hash.size() != 46 && hash.size() != 64) {
678 showMessage(tr(
"IPFS/Txid Hash must have size of 46 characters, or 64 hex characters"));
683 showMessage(tr(
"IPFS/Txid hash is not valid. Please use a valid IPFS/Txid hash"));
691 ui->ipfsText->setStyleSheet(
"");
709 if (address.isEmpty())
712 ui->addressText->setStyleSheet(
"");
717 ui->addressText->setStyleSheet(
"border: 1px solid red");
723 ui->addressText->setStyleSheet(
"");
742 if (
ui->addressText->text().isEmpty()) {
745 address =
ui->addressText->text();
748 QString name =
ui->comboBox->currentText();
749 CAmount quantity =
ui->quantitySpinBox->value() * COIN;
750 bool reissuable =
ui->reissuableBox->isChecked();
751 bool hasIPFS =
ui->ipfsBox->isChecked() && !
ui->ipfsText->text().isEmpty();
753 int unit =
ui->unitSpinBox->value();
764 std::string ipfsDecoded =
"";
768 CReissueAsset reissueAsset(name.toStdString(), quantity, unit, reissuable ? 1 : 0, ipfsDecoded);
772 std::pair<int, std::string>
error;
777 showMessage(
"Invalid: " + QString::fromStdString(error.second));
781 std::string strError =
"";
783 showMessage(
"Invalid: " + QString::fromStdString(strError));
788 QStringList formatted;
792 amount.append(
"</b>");
794 QString addressburn =
"<span style='font-family: monospace;'>" + QString::fromStdString(
Params().ReissueAssetBurnAddress());
795 addressburn.append(
"</span>");
797 QString recipientElement1;
798 recipientElement1 = tr(
"%1 to %2").arg(amount, addressburn);
799 formatted.append(recipientElement1);
802 QString assetAmount =
"<b>" + QString::fromStdString(
ValueFromAmountString(reissueAsset.nAmount, 8)) +
" " + QString::fromStdString(reissueAsset.strName);
803 assetAmount.append(
"</b>");
806 QString assetAddress =
"<span style='font-family: monospace;'>" + address;
807 assetAddress.append(
"</span>");
809 QString recipientElement2;
810 recipientElement2 = tr(
"%1 to %2").arg(assetAmount, assetAddress);
811 formatted.append(recipientElement2);
813 QString questionString = tr(
"Are you sure you want to send?");
814 questionString.append(
"<br /><br />%1");
819 questionString.append(
"<hr /><span style='color:#aa0000;'>");
821 questionString.append(
"</span> ");
822 questionString.append(tr(
"added as transaction fee"));
829 questionString.append(
"<hr />");
831 QStringList alternativeUnits;
837 questionString.append(tr(
"Total Amount %1")
839 questionString.append(QString(
"<span style='font-size:10pt;font-weight:normal;'><br />(=%2)</span>")
840 .arg(alternativeUnits.join(
" " + tr(
"or") +
"<br />")));
844 confirmationDialog.
exec();
845 QMessageBox::StandardButton retval = (QMessageBox::StandardButton)confirmationDialog.result();
847 if(retval != QMessageBox::Yes)
855 showMessage(
"Invalid: " + QString::fromStdString(error.second));
858 QPushButton *copyButton = msgBox.addButton(tr(
"Copy"), QMessageBox::ActionRole);
859 copyButton->disconnect();
860 connect(copyButton, &QPushButton::clicked,
this, [=](){
861 QClipboard *p_Clipboard = QApplication::clipboard();
862 p_Clipboard->setText(QString::fromStdString(txid), QClipboard::Mode::Clipboard);
864 QMessageBox copiedBox;
865 copiedBox.setText(tr(
"Transaction ID Copied"));
869 QPushButton *okayButton = msgBox.addButton(QMessageBox::Ok);
870 msgBox.setText(tr(
"Asset transaction sent to network:"));
871 msgBox.setInformativeText(QString::fromStdString(txid));
874 if (msgBox.clickedButton() == okayButton) {
885 if (!
ui->reissuableBox->isChecked()) {
886 ui->reissueWarningLabel->setText(
"Warning: Once this asset is reissued with the reissuable flag set to false. It won't be able to be reissued in the future");
887 ui->reissueWarningLabel->setStyleSheet(
"color: red");
888 ui->reissueWarningLabel->show();
890 ui->reissueWarningLabel->hide();
900 if (
ui->radioCustomFee->isChecked()) {
924 ui->labelSmartFee2->show();
925 ui->labelFeeEstimation->setText(
"");
926 ui->fallbackFeeWarningLabel->setVisible(
true);
927 int lightness =
ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness();
928 QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14));
929 ui->fallbackFeeWarningLabel->setStyleSheet(
"QLabel { color: " + warning_colour.name() +
"; }");
930 ui->fallbackFeeWarningLabel->setIndent(QFontMetrics(
ui->fallbackFeeWarningLabel->font()).width(
"x"));
934 ui->labelSmartFee2->hide();
935 ui->labelFeeEstimation->setText(tr(
"Estimated to begin confirmation within %n block(s).",
"", feeCalc.
returnedTarget));
936 ui->fallbackFeeWarningLabel->setVisible(
false);
987 ui->frameCoinControl->setVisible(checked);
988 ui->addressText->setVisible(checked);
989 ui->addressLabel->setVisible(checked);
991 if (!checked &&
model)
1000 ui->frameFee->setVisible(checked);
1015 if (state == Qt::Unchecked)
1018 ui->labelCoinControlChangeLabel->clear();
1024 ui->lineEditCoinControlChange->setEnabled((state == Qt::Checked));
1034 ui->labelCoinControlChangeLabel->setStyleSheet(
"QLabel{color:red;}");
1040 ui->labelCoinControlChangeLabel->setText(
"");
1044 ui->labelCoinControlChangeLabel->setText(tr(
"Warning: Invalid Raven address"));
1049 ui->labelCoinControlChangeLabel->setText(tr(
"Warning: Unknown change address"));
1052 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?"),
1053 QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
1055 if(btnRetVal == QMessageBox::Yes)
1059 ui->lineEditCoinControlChange->setText(
"");
1060 ui->labelCoinControlChangeLabel->setStyleSheet(
"QLabel{color:black;}");
1061 ui->labelCoinControlChangeLabel->setText(
"");
1066 ui->labelCoinControlChangeLabel->setStyleSheet(
"QLabel{color:black;}");
1070 if (!associatedLabel.isEmpty())
1071 ui->labelCoinControlChangeLabel->setText(associatedLabel);
1073 ui->labelCoinControlChangeLabel->setText(tr(
"(no label)"));
1101 ui->labelCoinControlAutomaticallySelected->hide();
1102 ui->widgetCoinControl->show();
1107 ui->labelCoinControlAutomaticallySelected->show();
1108 ui->widgetCoinControl->hide();
1109 ui->labelCoinControlInsuffFunds->hide();
1115 ui->labelFeeMinimized->setVisible(fMinimize);
1116 ui->buttonChooseFee ->setVisible(fMinimize);
1117 ui->buttonMinimizeFee->setVisible(!fMinimize);
1118 ui->frameFeeSelection->setVisible(!fMinimize);
1119 ui->horizontalLayoutSmartFee->setContentsMargins(0, (fMinimize ? 0 : 6), 0, 0);
1141 ui->confTargetSelector ->setEnabled(
ui->radioSmartFee->isChecked());
1142 ui->labelSmartFee ->setEnabled(
ui->radioSmartFee->isChecked());
1143 ui->labelSmartFee2 ->setEnabled(
ui->radioSmartFee->isChecked());
1144 ui->labelSmartFee3 ->setEnabled(
ui->radioSmartFee->isChecked());
1145 ui->labelFeeEstimation ->setEnabled(
ui->radioSmartFee->isChecked());
1146 ui->checkBoxMinimumFee ->setEnabled(
ui->radioCustomFee->isChecked());
1147 ui->labelMinFeeWarning ->setEnabled(
ui->radioCustomFee->isChecked());
1148 ui->labelCustomPerKilobyte ->setEnabled(
ui->radioCustomFee->isChecked() && !
ui->checkBoxMinimumFee->isChecked());
1149 ui->customFee ->setEnabled(
ui->radioCustomFee->isChecked() && !
ui->checkBoxMinimumFee->isChecked());
1157 if (
ui->radioSmartFee->isChecked())
1158 ui->labelFeeMinimized->setText(
ui->labelSmartFee->text());
1167 ui->checkBoxMinimumFee->setText(tr(
"Pay only the required fee of %1").arg(
1181 for (
int i = 0; i < value; i++) {
1185 ui->unitExampleLabel->setText(text);
1195 std::vector<std::string> assets;
1202 for (
auto item : assets) {
1203 std::string name = QString::fromStdString(item).split(
"!").first().toStdString();
1207 list << QString::fromStdString(asset.
strName);
1216 ui->comboBox->setCurrentIndex(0);
1217 ui->addressText->clear();
1218 ui->quantitySpinBox->setValue(0);
1219 ui->unitSpinBox->setMinimum(0);
1220 ui->unitSpinBox->setValue(0);
1222 ui->reissuableBox->setChecked(
true);
1223 ui->ipfsBox->setChecked(
false);
1224 ui->ipfsText->setDisabled(
true);
1225 ui->ipfsText->clear();
1246 name = name.left(name.size() - 1);
1248 ui->comboBox->setCurrentIndex(
ui->comboBox->findText(name));
1251 ui->quantitySpinBox->setFocus();
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost)
Compute the virtual transaction size (weight reinterpreted as bytes).
void updateSmartFeeLabel()
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
CAmount GetBurnAmount(const int nType)
void disableReissueButton()
void coinControlClipboardQuantity()
void coinControlClipboardLowOutput()
QGraphicsDropShadowEffect * getShadowEffect()
void showMessage(QString string)
bool ContextualCheckReissueAsset(CAssetsCache *assetCache, const CReissueAsset &reissue_asset, std::string &strError, const CTransaction &tx)
static CCoinControl * coinControl
void coinControlClipboardAfterFee()
void coinControlChangeEdited(const QString &)
boost::optional< unsigned int > m_confirm_target
Override the default confirmation target if set.
Dialog showing transaction details.
void onQuantityChanged(double qty)
UnlockContext requestUnlock()
void setUpValues()
Helper Methods.
CCriticalSection cs_main
Global state.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
CTxDestination DecodeDestination(const std::string &str)
#define SEND_CONFIRM_DELAY
void feeControlFeatureChanged(bool)
const PlatformStyle * platformStyle
UniValue ValueFromAmount(const CAmount &amount, const int8_t units)
void coinControlButtonClicked()
CAmount GetRequiredFee(unsigned int nTxBytes)
Return the minimum required fee taking into account the floating relay fee and user set minimum trans...
AddressTableModel * getAddressTableModel()
void coinControlClipboardFee()
boost::optional< CFeeRate > m_feerate
Override the default payTxFee if set.
int getDisplayUnit() const
CAmount getBalance(const CCoinControl *coinControl=nullptr) const
void minimizeFeeSection(bool fMinimize)
int64_t CAmount
Amount in corbies (Can be negative)
int getConfTargetForIndex(int index)
void on_buttonChooseFee_clicked()
CAmount getImmatureBalance() const
CBlockPolicyEstimator feeEstimator
static QList< CAmount > payAmounts
void setClientModel(ClientModel *clientModel)
bool AreMessagingDeployed()
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
void updateFeeSectionControls()
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
std::string DecodeAssetData(std::string encoded)
Decode and Encode IPFS hashes, or OIP hashes.
void onClearButtonClicked()
void updateCoinControlState(CCoinControl &ctrl)
bool checkIPFSHash(QString hash)
void onReissueAssetClicked()
void onIPFSHashChanged(QString hash)
bool GetAssetMetaDataIfExists(const std::string &name, CNewAsset &asset)
Returns true if an asset with the name exists, and it was able to get the asset metadata from databas...
CAssetsCache * GetCurrentAssetCache()
void setClipboard(const QString &str)
#define STRING_LABEL_COLOR
void setupFeeControl(const PlatformStyle *platformStyle)
CTxDestination destChange
void updateFeeMinimizedLabel()
int getDefaultConfirmTarget() const
ClientModel * clientModel
CAmount getWatchUnconfirmedBalance() const
QString labelForAddress(const QString &address) const
ReissueAssetDialog(const PlatformStyle *platformStyle, QWidget *parent=0)
void onIPFSStateChanged()
void setupCoinControlFrame(const PlatformStyle *platformStyle)
std::string ValueFromAmountString(const CAmount &amount, const int8_t units)
static void updateLabels(WalletModel *, QDialog *)
int getIndexForConfTarget(int target)
CAmount GetReissueAssetBurnAmount()
Model for Raven network client.
bool SendAssetTransaction(CWallet *pwallet, CWalletTx &transaction, CReserveKey &reserveKey, std::pair< int, std::string > &error, std::string &txid)
Send any type of asset transaction to the network.
void on_buttonMinimizeFee_clicked()
void setBalance(const CAmount &balance, const CAmount &unconfirmedBalance, const CAmount &immatureBalance, const CAmount &watchOnlyBalance, const CAmount &watchUnconfBalance, const CAmount &watchImmatureBalance)
A transaction with a bunch of additional info that only the owner cares about.
void setModel(WalletModel *model)
bool getCoinControlFeatures() const
void GetAllAdministrativeAssets(CWallet *pwallet, std::vector< std::string > &names, int nMinConf)
void coinControlClipboardChange()
CAssetsCache * passets
Global variable that point to the active assets (protected by cs_main)
void setModel(WalletModel *model)
QString addRow(const QString &type, const QString &label, const QString &address)
static bool fSubtractFeeFromAmount
void coinControlChangeChecked(int)
void coinControlClipboardBytes()
A key allocated from the key pool.
const CChainParams & Params()
Return the currently selected parameters.
Interface to Raven wallet from Qt view code.
bool CreateReissueAssetTransaction(CWallet *pwallet, CCoinControl &coinControl, const CReissueAsset &reissueAsset, const std::string &address, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::string *verifier_string)
Create a reissue asset transaction.
CAmount getWatchBalance() const
Ui::ReissueAssetDialog * ui
CAmount getUnconfirmedBalance() const
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit)
static const QString Receive
Specifies receive address.
void coinControlUpdateLabels()
void coinControlFeatureChanged(bool)
bool CheckEncoded(const std::string &hash, std::string &strError)
Check the Encoded hash and make sure it is either an IPFS hash or a OIP hash.
Fee rate in satoshis per kilobyte: CAmount / kB.
void focusReissueAsset(const QModelIndex &index)
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
bool error(const char *fmt, const Args &... args)
QFont getTopLabelFont(int weight, int pxsize)
CAmount getWatchImmatureBalance() const
QString formatNiceTimeOffset(qint64 secs)
void onAddressNameChanged(QString address)
void onAssetSelected(int index)
SLOTS.
void setDisplayedDataToNone()
CWallet * getWallet() const
void setupAssetDataView(const PlatformStyle *platformStyle)
QSortFilterProxyModel * proxy
void onReissueBoxChanged()
void enableReissueButton()
bool getCustomFeeFeatures() const
std::string EncodeAssetData(std::string decoded)
CAmount GetMinimumFee(unsigned int nTxBytes, const CCoinControl &coin_control, const CTxMemPool &pool, const CBlockPolicyEstimator &estimator, FeeCalculation *feeCalc)
Estimate the minimum fee considering user set parameters and the required fee.
CAmount GetFeePerK() const
Return the fee in satoshis for a size of 1000 bytes.
void coinControlClipboardAmount()
UniValue reissue(const JSONRPCRequest &request)
void onUnitChanged(int value)
void showValidMessage(QString string)
OptionsModel * getOptionsModel()
QStringListModel * stringModel
bool IsSpendable(const CTxDestination &dest) const
bool IsAssetNameAnOwner(const std::string &name)
Check if an asset is an owner.