21#include <QApplication>
45 QLabel *
noWallet =
new QLabel(
tr(
"No wallet has been loaded.\nGo to File > Open Wallet to load a wallet.\n- OR -"));
46 noWallet->setAlignment(Qt::AlignCenter);
99 sp.setHorizontalPolicy(QSizePolicy::Ignored);
108 sp.setHorizontalPolicy(QSizePolicy::Preferred);
128 QMap<WalletModel*, WalletView*>::const_iterator i;
140 return walletView->handlePaymentRequest(recipient);
146 QMap<WalletModel*, WalletView*>::const_iterator i;
148 i.value()->showOutOfSyncWarning(
fShow);
153 QMap<WalletModel*, WalletView*>::const_iterator i;
155 i.value()->gotoOverviewPage();
160 QMap<WalletModel*, WalletView*>::const_iterator i;
162 i.value()->gotoHistoryPage();
167 QMap<WalletModel*, WalletView*>::const_iterator i;
169 i.value()->gotoReceiveCoinsPage();
174 QMap<WalletModel*, WalletView*>::const_iterator i;
176 i.value()->gotoSendCoinsPage(addr);
195 std::vector<unsigned char> data;
198 std::string
raw = QApplication::clipboard()->text().toStdString();
204 data = std::move(*result);
208 tr(
"Partially Signed Transaction (*.psbt)"),
nullptr);
209 if (filename.isEmpty())
return;
214 std::ifstream in{filename.toLocal8Bit().data(), std::ios::binary};
215 data.assign(std::istreambuf_iterator<char>{in}, {});
218 std::string
b64_str{data.begin(), data.end()};
Model for Bitcoin network client.
Overview ("home") page widget.
Dialog showing transaction details.
bool addView(WalletView *walletView)
void changePassphrase()
Change encrypted wallet passphrase.
WalletModel * currentWalletModel() const
void gotoHistoryPage()
Switch to history (transactions) page.
void unlockWallet()
Ask for passphrase to unlock wallet temporarily.
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
WalletView * currentWalletView() const
void gotoOverviewPage()
Switch to overview (home) page.
ClientModel * clientModel
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
void removeWallet(WalletModel *wallet_model)
void setClientModel(ClientModel *clientModel)
void backupWallet()
Backup the wallet.
QStackedWidget * walletStack
void usedSendingAddresses()
Show used sending addresses.
void createWalletButtonClicked()
void encryptWallet()
Encrypt the wallet.
void usedReceivingAddresses()
Show used receiving addresses.
void message(const QString &title, const QString &message, unsigned int style)
void setCurrentWallet(WalletModel *wallet_model)
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
QMap< WalletModel *, WalletView * > mapWalletViews
void gotoLoadPSBT(bool from_clipboard=false)
Load Partially Signed Bitcoin Transaction.
WalletFrame(const PlatformStyle *platformStyle, QWidget *parent)
void showOutOfSyncWarning(bool fShow)
void gotoReceiveCoinsPage()
Switch to receive coins page.
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
Interface to Bitcoin wallet from Qt view code.
std::streampos GetFileSize(const char *path, std::streamsize max)
Get the size of a file by scanning it.
void ShowModalDialogAsynchronously(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
bool DecodeRawPSBT(PartiallySignedTransaction &psbt, std::span< const std::byte > tx_data, std::string &error)
Decode a raw (binary blob) PSBT into a PartiallySignedTransaction.
const std::streamsize MAX_FILE_SIZE_PSBT
auto MakeByteSpan(const V &v) noexcept
A version of CTransaction with the PSBT format.
std::optional< std::vector< unsigned char > > DecodeBase64(std::string_view str)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.