6 #ifndef RAVEN_QT_WALLETMODEL_H 7 #define RAVEN_QT_WALLETMODEL_H 71 template <
typename Stream,
typename Operation>
73 std::string sAddress = address.toStdString();
74 std::string sLabel = label.toStdString();
75 std::string sMessage = message.toStdString();
76 std::string sPaymentRequest;
79 std::string sAuthenticatedMerchant = authenticatedMerchant.toStdString();
89 if (ser_action.ForRead())
91 address = QString::fromStdString(sAddress);
92 label = QString::fromStdString(sLabel);
93 message = QString::fromStdString(sMessage);
94 if (!sPaymentRequest.empty())
95 paymentRequest.
parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size()));
96 authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant);
105 explicit SendAssetsRecipient(
const QString& assetName,
const QString &addr,
const QString &_label,
const CAmount& _amount,
const QString &_message):
131 template <
typename Stream,
typename Operation>
133 std::string sAddress = address.toStdString();
134 std::string sLabel = label.toStdString();
135 std::string sMessage = message.toStdString();
136 std::string sPaymentRequest;
137 std::string sAssetName = assetName.toStdString();
140 std::string sAuthenticatedMerchant = authenticatedMerchant.toStdString();
151 if (ser_action.ForRead())
153 assetName = QString::fromStdString(sAssetName);
154 address = QString::fromStdString(sAddress);
155 label = QString::fromStdString(sLabel);
156 message = QString::fromStdString(sMessage);
157 if (!sPaymentRequest.empty())
158 paymentRequest.
parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size()));
159 authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant);
184 PaymentRequestExpired
201 CAmount getUnconfirmedBalance()
const;
202 CAmount getImmatureBalance()
const;
203 bool haveWatchOnly()
const;
204 CAmount getWatchBalance()
const;
205 CAmount getWatchUnconfirmedBalance()
const;
206 CAmount getWatchImmatureBalance()
const;
210 bool validateAddress(
const QString &
address);
217 reasonCommitFailed(_reasonCommitFailed)
233 bool setWalletEncrypted(
bool encrypted,
const SecureString &passphrase);
238 bool backupWallet(
const QString &filename);
265 void getOutputs(
const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs);
266 bool isSpent(
const COutPoint& outpoint)
const;
267 void listCoins(std::map<QString, std::vector<COutput> >& mapCoins)
const;
270 void listAssets(std::map<QString, std::map<QString, std::vector<COutput> > >& mapCoins)
const;
272 bool isLockedCoin(
uint256 hash,
unsigned int n)
const;
275 void listLockedCoins(std::vector<COutPoint>& vOutpts);
277 void loadReceiveRequests(std::vector<std::string>& vReceiveRequests);
278 bool saveReceiveRequest(
const std::string &sAddress,
const int64_t nId,
const std::string &sRequest);
280 bool transactionCanBeAbandoned(
uint256 hash)
const;
281 bool abandonTransaction(
uint256 hash)
const;
283 bool transactionCanBeBumped(
uint256 hash)
const;
286 static bool isWalletEnabled();
288 bool hdEnabled()
const;
290 int getDefaultConfirmTarget()
const;
292 bool getDefaultWalletRbf()
const;
322 void subscribeToCoreSignals();
323 void unsubscribeFromCoreSignals();
324 void checkBalanceChanged();
328 void balanceChanged(
const CAmount& balance,
const CAmount& unconfirmedBalance,
const CAmount& immatureBalance,
329 const CAmount& watchOnlyBalance,
const CAmount& watchUnconfBalance,
const CAmount& watchImmatureBalance);
332 void encryptionStatusChanged(
int status);
337 void requireUnlock();
340 void message(
const QString &title,
const QString &
message,
unsigned int style);
349 void showProgress(
const QString &title,
int nProgress);
352 void notifyWatchonlyChanged(
bool fHaveWatchonly);
358 void updateTransaction();
360 void updateAddressBook(
const QString &
address,
const QString &
label,
bool isMine,
const QString &purpose,
int status);
362 void updateWatchOnlyFlag(
bool fHaveWatchonly);
364 void pollBalanceChanged();
367 #endif // RAVEN_QT_WALLETMODEL_H
Model for list of recently generated payment requests / raven: URIs.
TransactionTableModel * transactionTableModel
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
RecentRequestsTableModel * recentRequestsTableModel
PaymentRequestPlus paymentRequest
UnlockContext & operator=(const UnlockContext &rhs)
QString reasonCommitFailed
SendAssetsRecipient(const QString &assetName, const QString &addr, const QString &_label, const CAmount &_amount, const QString &_message)
static const int CURRENT_VERSION
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
bool SerializeToString(std::string *output) const
bool IsInitialized() const
SendCoinsRecipient(const QString &addr, const QString &_label, const CAmount &_amount, const QString &_message)
PaymentRequestPlus paymentRequest
AssetTableModel * assetTableModel
int64_t CAmount
Amount in corbies (Can be negative)
void SerializationOp(Stream &s, Operation ser_action)
Models assets portion of wallet as table of owned assets.
CAmount cachedImmatureBalance
An encapsulated public key.
SendCoinsReturn(StatusCode _status=OK, QString _reasonCommitFailed="")
OptionsModel * optionsModel
CAmount cachedWatchOnlyBalance
EncryptionStatus cachedEncryptionStatus
An outpoint - a combination of a transaction hash and an index n into its vout.
void SerializationOp(Stream &s, Operation ser_action)
UI model for the transaction table of a wallet.
bool parse(const QByteArray &data)
Qt model of the address book in the core.
A transaction with a bunch of additional info that only the owner cares about.
UnlockContext(const UnlockContext &obj)
CAmount cachedWatchUnconfBalance
bool fForceCheckBalanceChanged
CAmount cachedWatchImmatureBalance
A key allocated from the key pool.
Interface from Qt to configuration data structure for Raven client.
Interface to Raven wallet from Qt view code.
QString authenticatedMerchant
A reference to a CKey: the Hash160 of its serialized public key.
CAmount cachedUnconfirmedBalance
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Data model for a walletmodel transaction.
AddressTableModel * addressTableModel
bool fSubtractFeeFromAmount
An encapsulated private key.
QString authenticatedMerchant