7 class AddressTableModel;
8 class TransactionTableModel;
11 struct SendCoinsRecipient
18 // Interface to a Bitcoin wallet
19 class WalletModel : public QObject
23 explicit WalletModel(CWallet *wallet, QObject *parent = 0);
31 AmountWithFeeExceedsBalance,
33 TransactionCreationFailed,
34 TransactionCommitFailed,
39 OptionsModel *getOptionsModel();
40 AddressTableModel *getAddressTableModel();
41 TransactionTableModel *getTransactionTableModel();
43 qint64 getBalance() const;
44 qint64 getUnconfirmedBalance() const;
45 int getNumTransactions() const;
47 // Check address for validity
48 bool validateAddress(const QString &address);
50 // Return status record for SendCoins
51 // fee is used in case status is "AmountWithFeeExceedsBalance"
52 // hex is filled with the transaction hash if status is "OK"
53 struct SendCoinsReturn
55 SendCoinsReturn(StatusCode status,
57 QString hex=QString()):
58 status(status), fee(fee), hex(hex) {}
64 // Send coins to list of recipients
65 SendCoinsReturn sendCoins(const QList<SendCoinsRecipient> &recipients);
69 // Wallet has an options model for wallet-specific options
70 // (transaction fee, for example)
71 OptionsModel *optionsModel;
73 AddressTableModel *addressTableModel;
74 TransactionTableModel *transactionTableModel;
77 void balanceChanged(qint64 balance, qint64 unconfirmedBalance);
78 void numTransactionsChanged(int count);
80 // Asynchronous error notification
81 void error(const QString &title, const QString &message);
90 #endif // WALLETMODEL_H