7 #include "ui_createassetdialog.h" 25 #include <validation.h> 32 #include <QGraphicsDropShadowEffect> 33 #include <QModelIndex> 35 #include <QMessageBox> 38 #include <QStringListModel> 39 #include <QSortFilterProxyModel> 43 QDialog(parent, Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint | Qt::WindowMaximizeButtonHint),
45 platformStyle(_platformStyle)
48 setWindowTitle(
"Create Assets");
51 connect(
ui->nameText, SIGNAL(textChanged(QString)),
this, SLOT(
onNameChanged(QString)));
53 connect(
ui->ipfsText, SIGNAL(textChanged(QString)),
this, SLOT(
onIPFSHashChanged(QString)));
55 connect(
ui->unitBox, SIGNAL(valueChanged(
int)),
this, SLOT(
onUnitChanged(
int)));
65 connect(
ui->lineEditCoinControlChange, SIGNAL(textEdited(
const QString &)),
this, SLOT(
coinControlChangeEdited(
const QString &)));
68 QAction *clipboardQuantityAction =
new QAction(tr(
"Copy quantity"),
this);
69 QAction *clipboardAmountAction =
new QAction(tr(
"Copy amount"),
this);
70 QAction *clipboardFeeAction =
new QAction(tr(
"Copy fee"),
this);
71 QAction *clipboardAfterFeeAction =
new QAction(tr(
"Copy after fee"),
this);
72 QAction *clipboardBytesAction =
new QAction(tr(
"Copy bytes"),
this);
73 QAction *clipboardLowOutputAction =
new QAction(tr(
"Copy dust"),
this);
74 QAction *clipboardChangeAction =
new QAction(tr(
"Copy change"),
this);
82 ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);
83 ui->labelCoinControlAmount->addAction(clipboardAmountAction);
84 ui->labelCoinControlFee->addAction(clipboardFeeAction);
85 ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);
86 ui->labelCoinControlBytes->addAction(clipboardBytesAction);
87 ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
88 ui->labelCoinControlChange->addAction(clipboardChangeAction);
92 if (!settings.contains(
"fFeeSectionMinimized"))
93 settings.setValue(
"fFeeSectionMinimized",
true);
94 if (!settings.contains(
"nFeeRadio") && settings.contains(
"nTransactionFee") && settings.value(
"nTransactionFee").toLongLong() > 0)
95 settings.setValue(
"nFeeRadio", 1);
96 if (!settings.contains(
"nFeeRadio"))
97 settings.setValue(
"nFeeRadio", 0);
98 if (!settings.contains(
"nSmartFeeSliderPosition"))
99 settings.setValue(
"nSmartFeeSliderPosition", 0);
100 if (!settings.contains(
"nTransactionFee"))
101 settings.setValue(
"nTransactionFee", (qint64)DEFAULT_TRANSACTION_FEE);
102 if (!settings.contains(
"fPayOnlyMinFee"))
103 settings.setValue(
"fPayOnlyMinFee",
false);
104 ui->groupFee->setId(
ui->radioSmartFee, 0);
105 ui->groupFee->setId(
ui->radioCustomFee, 1);
106 ui->groupFee->button((
int)std::max(0, std::min(1, settings.value(
"nFeeRadio").toInt())))->setChecked(
true);
107 ui->customFee->setValue(settings.value(
"nTransactionFee").toLongLong());
108 ui->checkBoxMinimumFee->setChecked(settings.value(
"fPayOnlyMinFee").toBool());
111 format =
"%1<font color=green>%2%3</font>";
120 proxy =
new QSortFilterProxyModel;
122 proxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
124 ui->assetList->setModel(
proxy);
125 ui->assetList->setEditable(
true);
126 ui->assetList->lineEdit()->setPlaceholderText(
"Select an asset");
129 completer->setCompletionMode(QCompleter::PopupCompletion);
130 completer->setCaseSensitivity(Qt::CaseInsensitive);
133 ui->nameText->installEventFilter(
this);
134 ui->assetList->installEventFilter(
this);
142 connect(_clientModel, SIGNAL(numBlocksChanged(
int,QDateTime,
double,
bool)),
this, SLOT(
updateSmartFeeLabel()));
148 this->
model = _model;
154 connect(_model, SIGNAL(balanceChanged(
CAmount,
CAmount,
CAmount,
CAmount,
CAmount,
CAmount)),
this, SLOT(
setBalance(
CAmount,
CAmount,
CAmount,
CAmount,
CAmount,
CAmount)));
162 ui->frameCoinControl->setVisible(fCoinControlEnabled);
163 ui->addressText->setVisible(fCoinControlEnabled);
164 ui->addressLabel->setVisible(fCoinControlEnabled);
172 for (
const int &n : confTargets) {
175 connect(
ui->confTargetSelector, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
updateSmartFeeLabel()));
180 connect(
ui->checkBoxMinimumFee, SIGNAL(stateChanged(
int)),
this, SLOT(
setMinimumFee()));
192 ui->optInRBF->hide();
196 if (settings.value(
"nSmartFeeSliderPosition").toInt() != 0) {
199 int nConfirmTarget = 25 - settings.value(
"nSmartFeeSliderPosition").toInt();
200 settings.setValue(
"nConfTarget", nConfirmTarget);
201 settings.remove(
"nSmartFeeSliderPosition");
203 if (settings.value(
"nConfTarget").toInt() == 0)
224 if (sender ==
ui->nameText)
226 if(event->type()== QEvent::FocusIn)
228 ui->nameText->setStyleSheet(
"");
231 else if (sender ==
ui->assetList)
233 if(event->type()== QEvent::FocusIn)
235 ui->assetList->lineEdit()->setStyleSheet(
"");
238 return QWidget::eventFilter(sender,event);
244 ui->unitBox->setValue(0);
245 ui->reissuableBox->setCheckState(Qt::CheckState::Checked);
246 ui->ipfsText->hide();
249 ui->availabilityButton->setDisabled(
true);
251 ui->unitExampleLabel->setStyleSheet(
"font-weight: bold");
258 ui->assetType->addItems(list);
260 ui->assetTypeLabel->setText(tr(
"Asset Type") +
":");
263 ui->assetList->hide();
266 ui->assetFullName->setTextFormat(Qt::RichText);
267 ui->assetFullName->setStyleSheet(
"font-weight: bold");
269 ui->assetType->setStyleSheet(
"font-weight: bold");
275 ui->frameCoinControl->setStyleSheet(QString(
".QFrame {background-color: %1; padding-top: 10px; padding-right: 5px; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
276 ui->widgetCoinControl->setStyleSheet(
".QWidget {background-color: transparent;}");
309 ui->checkBoxCoinControlChange->setStyleSheet(QString(
".QCheckBox{ %1; }").arg(
STRING_LABEL_COLOR));
317 ui->frameAssetData->setStyleSheet(QString(
".QFrame {background-color: %1; padding-top: 10px; padding-right: 5px; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
343 ui->frameFee->setStyleSheet(QString(
".QFrame {background-color: %1; padding-top: 10px; padding-right: 5px; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
378 const CAmount& watchBalance,
const CAmount& watchUnconfirmedBalance,
const CAmount& watchImmatureBalance)
380 Q_UNUSED(unconfirmedBalance);
381 Q_UNUSED(immatureBalance);
382 Q_UNUSED(watchBalance);
383 Q_UNUSED(watchUnconfirmedBalance);
384 Q_UNUSED(watchImmatureBalance);
405 if (
ui->ipfsBox->isChecked()) {
406 ui->ipfsText->show();
408 ui->ipfsText->hide();
409 ui->ipfsText->clear();
417 ui->messageLabel->setStyleSheet(
"color: red; font-size: 15pt;font-weight: bold;");
418 ui->messageLabel->setText(
string);
419 ui->messageLabel->show();
424 ui->messageLabel->setStyleSheet(
"color: green; font-size: 15pt;font-weight: bold;");
425 ui->messageLabel->setText(
string);
426 ui->messageLabel->show();
431 ui->nameText->setStyleSheet(
"");
432 ui->addressText->setStyleSheet(
"");
433 if (
ui->ipfsBox->isChecked())
434 ui->ipfsText->setStyleSheet(
"");
436 ui->messageLabel->hide();
441 ui->createAssetButton->setDisabled(
true);
447 ui->createAssetButton->setDisabled(
false);
452 if (!hash.isEmpty()) {
455 ui->ipfsText->setStyleSheet(
"border: 2px solid red");
456 showMessage(tr(
"IPFS/Txid Hash must start with 'Qm' and be 46 characters or Txid Hash must have 64 hex characters"));
460 else if (hash.size() != 46 && hash.size() != 64) {
461 ui->ipfsText->setStyleSheet(
"border: 2px solid red");
462 showMessage(tr(
"IPFS/Txid Hash must have size of 46 characters, or 64 hex characters"));
466 showMessage(tr(
"IPFS/Txid hash is not valid. Please use a valid IPFS/Txid hash"));
474 ui->ipfsText->setStyleSheet(
"");
492 if (
ui->assetList->currentText() ==
"")
495 ui->availabilityButton->setDisabled(
true);
500 if (!assetNameValid && name.size() != 0) {
503 ui->availabilityButton->setDisabled(
true);
513 if (
ui->ipfsBox->isChecked())
520 ui->availabilityButton->setDisabled(
true);
523 ui->availabilityButton->setDisabled(
false);
539 if (currentActiveAssetCache) {
541 if (currentActiveAssetCache->GetAssetMetaDataIfExists(name.toStdString(), asset)) {
543 showMessage(tr(
"Invalid: Asset name already in use"));
553 showMessage(tr(
"Error: Asset Database not in sync"));
567 QString assetName = name;
572 if (name.size() == 0) {
574 ui->availabilityButton->setDisabled(
true);
584 ui->availabilityButton->setDisabled(
false);
588 ui->availabilityButton->setDisabled(
true);
591 if (name.size() == 0) {
593 ui->availabilityButton->setDisabled(
true);
597 if (
ui->assetList->currentText() ==
"")
600 ui->availabilityButton->setDisabled(
true);
609 ui->availabilityButton->setDisabled(
false);
613 ui->availabilityButton->setDisabled(
true);
645 CAmount quantity =
ui->quantitySpinBox->value() * COIN;
646 int units =
ui->unitBox->value();
647 bool reissuable =
ui->reissuableBox->isChecked();
648 bool hasIPFS =
ui->ipfsBox->isChecked() && !
ui->ipfsText->text().isEmpty();
650 std::string ipfsDecoded =
"";
654 CNewAsset asset(name.toStdString(), quantity, units, reissuable ? 1 : 0, hasIPFS ? 1 : 0, ipfsDecoded);
658 std::pair<int, std::string>
error;
669 if (
ui->addressText->text().isEmpty()) {
672 address =
ui->addressText->text();
677 showMessage(
"Invalid: " + QString::fromStdString(error.second));
682 QStringList formatted;
686 amount.append(
"</b>");
688 QString addressburn =
"<span style='font-family: monospace;'>" + QString::fromStdString(
GetBurnAddress(
type));
689 addressburn.append(
"</span>");
691 QString recipientElement1;
692 recipientElement1 = tr(
"%1 to %2").arg(amount, addressburn);
693 formatted.append(recipientElement1);
696 QString assetAmount =
"<b>" + QString::fromStdString(
ValueFromAmountString(asset.nAmount, asset.units)) +
" " + QString::fromStdString(asset.strName);
697 assetAmount.append(
"</b>");
700 QString assetAddress =
"<span style='font-family: monospace;'>" + address;
701 assetAddress.append(
"</span>");
703 QString recipientElement2;
704 recipientElement2 = tr(
"%1 to %2").arg(assetAmount, assetAddress);
705 formatted.append(recipientElement2);
707 QString questionString = tr(
"Are you sure you want to send?");
708 questionString.append(
"<br /><br />%1");
713 questionString.append(
"<hr /><span style='color:#aa0000;'>");
715 questionString.append(
"</span> ");
716 questionString.append(tr(
"added as transaction fee"));
723 questionString.append(
"<hr />");
725 QStringList alternativeUnits;
731 questionString.append(tr(
"Total Amount %1")
733 questionString.append(QString(
"<span style='font-size:10pt;font-weight:normal;'><br />(=%2)</span>")
734 .arg(alternativeUnits.join(
" " + tr(
"or") +
"<br />")));
738 confirmationDialog.
exec();
739 QMessageBox::StandardButton retval = (QMessageBox::StandardButton)confirmationDialog.result();
741 if(retval != QMessageBox::Yes)
749 showMessage(tr(
"Invalid: ") + QString::fromStdString(error.second));
752 QPushButton *copyButton = msgBox.addButton(tr(
"Copy"), QMessageBox::ActionRole);
753 copyButton->disconnect();
754 connect(copyButton, &QPushButton::clicked,
this, [=](){
755 QClipboard *p_Clipboard = QApplication::clipboard();
756 p_Clipboard->setText(QString::fromStdString(txid), QClipboard::Mode::Clipboard);
758 QMessageBox copiedBox;
759 copiedBox.setText(tr(
"Transaction ID Copied"));
763 QPushButton *okayButton = msgBox.addButton(QMessageBox::Ok);
764 msgBox.setText(tr(
"Asset transaction sent to network:"));
765 msgBox.setInformativeText(QString::fromStdString(txid));
768 if (msgBox.clickedButton() == okayButton) {
786 for (
int i = 0; i < value; i++) {
790 ui->unitExampleLabel->setText(text);
820 ui->assetList->show();
822 ui->assetList->hide();
830 if (
ui->nameText->text().size())
831 ui->availabilityButton->setDisabled(
false);
833 ui->availabilityButton->setDisabled(
true);
834 ui->createAssetButton->setDisabled(
true);
850 if (
ui->nameText->text().size())
851 ui->availabilityButton->setDisabled(
false);
853 ui->availabilityButton->setDisabled(
true);
854 ui->createAssetButton->setDisabled(
true);
859 ui->assetFullName->setText(name);
875 return ui->nameText->text();
877 return ui->assetList->currentText() +
"/" +
ui->nameText->text();
879 return ui->assetList->currentText() +
"#" +
ui->nameText->text();
886 ui->nameText->setMaxLength(30);
888 ui->nameText->setMaxLength(30 - (
ui->assetList->currentText().size() + 1));
895 ui->nameText->setText(
ui->nameText->text().toUpper());
901 if (
ui->radioCustomFee->isChecked()) {
925 ui->labelSmartFee2->show();
926 ui->labelFeeEstimation->setText(
"");
927 ui->fallbackFeeWarningLabel->setVisible(
true);
928 int lightness =
ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness();
929 QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14));
930 ui->fallbackFeeWarningLabel->setStyleSheet(
"QLabel { color: " + warning_colour.name() +
"; }");
931 ui->fallbackFeeWarningLabel->setIndent(QFontMetrics(
ui->fallbackFeeWarningLabel->font()).width(
"x"));
935 ui->labelSmartFee2->hide();
936 ui->labelFeeEstimation->setText(tr(
"Estimated to begin confirmation within %n block(s).",
"", feeCalc.
returnedTarget));
937 ui->fallbackFeeWarningLabel->setVisible(
false);
988 ui->frameCoinControl->setVisible(checked);
989 ui->addressText->setVisible(checked);
990 ui->addressLabel->setVisible(checked);
992 if (!checked &&
model)
1001 ui->frameFee->setVisible(checked);
1016 if (state == Qt::Unchecked)
1019 ui->labelCoinControlChangeLabel->clear();
1025 ui->lineEditCoinControlChange->setEnabled((state == Qt::Checked));
1035 ui->labelCoinControlChangeLabel->setStyleSheet(
"QLabel{color:red;}");
1041 ui->labelCoinControlChangeLabel->setText(
"");
1045 ui->labelCoinControlChangeLabel->setText(tr(
"Warning: Invalid Raven address"));
1050 ui->labelCoinControlChangeLabel->setText(tr(
"Warning: Unknown change address"));
1053 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?"),
1054 QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
1056 if(btnRetVal == QMessageBox::Yes)
1060 ui->lineEditCoinControlChange->setText(
"");
1061 ui->labelCoinControlChangeLabel->setStyleSheet(
"QLabel{color:black;}");
1062 ui->labelCoinControlChangeLabel->setText(
"");
1067 ui->labelCoinControlChangeLabel->setStyleSheet(
"QLabel{color:black;}");
1071 if (!associatedLabel.isEmpty())
1072 ui->labelCoinControlChangeLabel->setText(associatedLabel);
1074 ui->labelCoinControlChangeLabel->setText(tr(
"(no label)"));
1102 ui->labelCoinControlAutomaticallySelected->hide();
1103 ui->widgetCoinControl->show();
1108 ui->labelCoinControlAutomaticallySelected->show();
1109 ui->widgetCoinControl->hide();
1110 ui->labelCoinControlInsuffFunds->hide();
1116 ui->labelFeeMinimized->setVisible(fMinimize);
1117 ui->buttonChooseFee ->setVisible(fMinimize);
1118 ui->buttonMinimizeFee->setVisible(!fMinimize);
1119 ui->frameFeeSelection->setVisible(!fMinimize);
1120 ui->horizontalLayoutSmartFee->setContentsMargins(0, (fMinimize ? 0 : 6), 0, 0);
1142 ui->confTargetSelector ->setEnabled(
ui->radioSmartFee->isChecked());
1143 ui->labelSmartFee ->setEnabled(
ui->radioSmartFee->isChecked());
1144 ui->labelSmartFee2 ->setEnabled(
ui->radioSmartFee->isChecked());
1145 ui->labelSmartFee3 ->setEnabled(
ui->radioSmartFee->isChecked());
1146 ui->labelFeeEstimation ->setEnabled(
ui->radioSmartFee->isChecked());
1147 ui->checkBoxMinimumFee ->setEnabled(
ui->radioCustomFee->isChecked());
1148 ui->labelMinFeeWarning ->setEnabled(
ui->radioCustomFee->isChecked());
1149 ui->labelCustomPerKilobyte ->setEnabled(
ui->radioCustomFee->isChecked() && !
ui->checkBoxMinimumFee->isChecked());
1150 ui->customFee ->setEnabled(
ui->radioCustomFee->isChecked() && !
ui->checkBoxMinimumFee->isChecked());
1158 if (
ui->radioSmartFee->isChecked())
1159 ui->labelFeeMinimized->setText(
ui->labelSmartFee->text());
1168 ui->checkBoxMinimumFee->setText(tr(
"Pay only the required fee of %1").arg(
1175 ui->reissuableBox->setChecked(
false);
1176 ui->quantitySpinBox->setValue(1);
1177 ui->unitBox->setValue(0);
1178 ui->reissuableBox->setDisabled(
true);
1179 ui->unitBox->setDisabled(
true);
1180 ui->quantitySpinBox->setDisabled(
true);
1185 ui->reissuableBox->setDisabled(
false);
1186 ui->unitBox->setDisabled(
false);
1187 ui->quantitySpinBox->setDisabled(
false);
1188 ui->reissuableBox->setChecked(
true);
1189 ui->unitBox->setValue(0);
1197 std::vector<std::string> names;
1199 for (
auto item : names) {
1200 std::string name = QString::fromStdString(item).split(
"!").first().toStdString();
1201 if (name.size() != 30)
1202 list << QString::fromStdString(name);
1210 ui->assetType->setCurrentIndex(0);
1211 ui->nameText->clear();
1212 ui->addressText->clear();
1213 ui->quantitySpinBox->setValue(1);
1214 ui->unitBox->setValue(0);
1215 ui->reissuableBox->setChecked(
true);
1216 ui->ipfsBox->setChecked(
false);
1217 ui->ipfsText->hide();
1218 ui->assetList->hide();
1219 ui->assetList->setCurrentIndex(0);
1221 ui->assetFullName->clear();
1222 ui->unitBox->setDisabled(
false);
1223 ui->quantitySpinBox->setDisabled(
false);
1248 name = name.left(name.size() - 1);
1250 ui->assetType->setCurrentIndex(type);
1253 ui->assetList->setCurrentIndex(
ui->assetList->findText(name));
1256 ui->nameText->setFocus();
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost)
Compute the virtual transaction size (weight reinterpreted as bytes).
void UpdateAssetNameToUpper()
void coinControlClipboardFee()
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
CAmount GetBurnAmount(const int nType)
bool CreateAssetTransaction(CWallet *pwallet, CCoinControl &coinControl, const CNewAsset &asset, const std::string &address, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::string *verifier_string)
Creates new asset issuance transaction.
void coinControlClipboardLowOutput()
void coinControlClipboardChange()
ClientModel * clientModel
QGraphicsDropShadowEffect * getShadowEffect()
static CCoinControl * coinControl
boost::optional< unsigned int > m_confirm_target
Override the default confirmation target if set.
std::string GetBurnAddress(const int nType)
void ipfsStateChanged()
SLOTS.
void setUpValues()
Helper Methods.
void updateFeeMinimizedLabel()
int IntFromAssetType(AssetType type)
UnlockContext requestUnlock()
void onAssetListActivated(int index)
void coinControlUpdateLabels()
CCriticalSection cs_main
Global state.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
CTxDestination DecodeDestination(const std::string &str)
void onNameChanged(QString name)
#define SEND_CONFIRM_DELAY
CreateAssetDialog(const PlatformStyle *platformStyle, QWidget *parent=0)
void setClientModel(ClientModel *clientModel)
CAmount GetRequiredFee(unsigned int nTxBytes)
Return the minimum required fee taking into account the floating relay fee and user set minimum trans...
AssetType AssetTypeFromInt(int nType)
AddressTableModel * getAddressTableModel()
void showMessage(QString string)
boost::optional< CFeeRate > m_feerate
Override the default payTxFee if set.
int getDisplayUnit() const
CAmount getBalance(const CCoinControl *coinControl=nullptr) const
void on_buttonChooseFee_clicked()
void focusSubAsset(const QModelIndex &index)
int64_t CAmount
Amount in corbies (Can be negative)
int getConfTargetForIndex(int index)
CAmount getImmatureBalance() const
CBlockPolicyEstimator feeEstimator
static QList< CAmount > payAmounts
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
Ui::CreateAssetDialog * ui
void updateSmartFeeLabel()
void coinControlClipboardAmount()
void updateCoinControlState(CCoinControl &ctrl)
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
std::string DecodeAssetData(std::string encoded)
Decode and Encode IPFS hashes, or OIP hashes.
void onAddressNameChanged(QString address)
void setModel(WalletModel *model)
void minimizeFeeSection(bool fMinimize)
void coinControlButtonClicked()
CAssetsCache * GetCurrentAssetCache()
void setClipboard(const QString &str)
#define STRING_LABEL_COLOR
void onClearButtonClicked()
void coinControlClipboardBytes()
CTxDestination destChange
int getDefaultConfirmTarget() const
void coinControlClipboardAfterFee()
CAmount getWatchUnconfirmedBalance() const
void enableCreateButton()
QString labelForAddress(const QString &address) const
void onChangeAddressChanged(QString changeAddress)
void coinControlChangeEdited(const QString &)
void checkAvailabilityClicked()
void selectTypeName(int type, QString name)
void showValidMessage(QString string)
void setBalance(const CAmount &balance, const CAmount &unconfirmedBalance, const CAmount &immatureBalance, const CAmount &watchOnlyBalance, const CAmount &watchUnconfBalance, const CAmount &watchImmatureBalance)
std::string ValueFromAmountString(const CAmount &amount, const int8_t units)
static void updateLabels(WalletModel *, QDialog *)
int getIndexForConfTarget(int target)
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.
A transaction with a bunch of additional info that only the owner cares about.
QSortFilterProxyModel * proxy
void onCreateAssetClicked()
bool getCoinControlFeatures() const
void GetAllAdministrativeAssets(CWallet *pwallet, std::vector< std::string > &names, int nMinConf)
void on_buttonMinimizeFee_clicked()
void coinControlClipboardQuantity()
void feeControlFeatureChanged(bool)
void updatePresentedAssetName(QString name)
void coinControlFeatureChanged(bool)
void setModel(WalletModel *model)
QString addRow(const QString &type, const QString &label, const QString &address)
static bool fSubtractFeeFromAmount
void UpdateAssetNameMaxSize()
bool checkIPFSHash(QString hash)
A key allocated from the key pool.
void onIPFSHashChanged(QString hash)
const CChainParams & Params()
Return the currently selected parameters.
Interface to Raven wallet from Qt view code.
CAmount getWatchBalance() const
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 onUnitChanged(int value)
Dialog showing transaction details.
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.
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
bool IsTypeCheckNameValid(const AssetType type, const std::string &name, std::string &error)
Given a type, and an asset name, return if that name is valid based on the type.
QString formatNiceTimeOffset(qint64 secs)
CWallet * getWallet() const
void coinControlChangeChecked(int)
QStringListModel * stringModel
void updateFeeSectionControls()
void setupCoinControlFrame(const PlatformStyle *platformStyle)
const PlatformStyle * platformStyle
void disableCreateButton()
bool getCustomFeeFeatures() const
void setupFeeControl(const PlatformStyle *platformStyle)
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 focusUniqueAsset(const QModelIndex &index)
OptionsModel * getOptionsModel()
void onAssetTypeActivated(int index)
bool IsSpendable(const CTxDestination &dest) const
void setupAssetDataView(const PlatformStyle *platformStyle)
bool IsAssetNameAnOwner(const std::string &name)
Check if an asset is an owner.
bool eventFilter(QObject *sender, QEvent *event)
QString GetSpecialCharacter()