Bitcoin
Classes | Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
WalletModel Class Reference

#include <walletmodel.h>

Inheritance diagram for WalletModel:

Classes

struct  SendCoinsReturn
 
class  UnlockContext
 

Public Types

enum  StatusCode {
  OK, InvalidAmount, InvalidAddress, AmountExceedsBalance,
  AmountWithFeeExceedsBalance, DuplicateAddress, TransactionCreationFailed, TransactionCommitFailed,
  AbsurdFee, PaymentRequestExpired
}
 
enum  EncryptionStatus { Unencrypted, Locked, Unlocked }
 

Public Slots

void updateStatus ()
 
void updateTransaction ()
 
void updateAddressBook (const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
 
void updateWatchOnlyFlag (bool fHaveWatchonly)
 
void pollBalanceChanged ()
 

Signals

void balanceChanged (const interfaces::WalletBalances &balances)
 
void encryptionStatusChanged ()
 
void requireUnlock ()
 
void message (const QString &title, const QString &message, unsigned int style)
 
void coinsSent (WalletModel *wallet, SendCoinsRecipient recipient, QByteArray transaction)
 
void showProgress (const QString &title, int nProgress)
 
void notifyWatchonlyChanged (bool fHaveWatchonly)
 
void unload ()
 
void canGetAddressesChanged ()
 

Public Member Functions

 WalletModel (std::unique_ptr< interfaces::Wallet > wallet, interfaces::Node &node, const PlatformStyle *platformStyle, OptionsModel *optionsModel, QObject *parent=nullptr)
 
 ~WalletModel ()
 
OptionsModelgetOptionsModel ()
 
AddressTableModelgetAddressTableModel ()
 
TransactionTableModelgetTransactionTableModel ()
 
RecentRequestsTableModelgetRecentRequestsTableModel ()
 
EncryptionStatus getEncryptionStatus () const
 
bool validateAddress (const QString &address)
 
SendCoinsReturn prepareTransaction (WalletModelTransaction &transaction, const CCoinControl &coinControl)
 
SendCoinsReturn sendCoins (WalletModelTransaction &transaction)
 
bool setWalletEncrypted (bool encrypted, const SecureString &passphrase)
 
bool setWalletLocked (bool locked, const SecureString &passPhrase=SecureString())
 
bool changePassphrase (const SecureString &oldPass, const SecureString &newPass)
 
UnlockContext requestUnlock ()
 
void loadReceiveRequests (std::vector< std::string > &vReceiveRequests)
 
bool saveReceiveRequest (const std::string &sAddress, const int64_t nId, const std::string &sRequest)
 
bool bumpFee (uint256 hash, uint256 &new_hash)
 
bool privateKeysDisabled () const
 
bool canGetAddresses () const
 
interfaces::Nodenode () const
 
interfaces::Walletwallet () const
 
QString getWalletName () const
 
QString getDisplayName () const
 
bool isMultiwallet ()
 
AddressTableModelgetAddressTableModel () const
 

Static Public Member Functions

static bool isWalletEnabled ()
 

Private Member Functions

void subscribeToCoreSignals ()
 
void unsubscribeFromCoreSignals ()
 
void checkBalanceChanged (const interfaces::WalletBalances &new_balances)
 

Private Attributes

std::unique_ptr< interfaces::Walletm_wallet
 
std::unique_ptr< interfaces::Handlerm_handler_unload
 
std::unique_ptr< interfaces::Handlerm_handler_status_changed
 
std::unique_ptr< interfaces::Handlerm_handler_address_book_changed
 
std::unique_ptr< interfaces::Handlerm_handler_transaction_changed
 
std::unique_ptr< interfaces::Handlerm_handler_show_progress
 
std::unique_ptr< interfaces::Handlerm_handler_watch_only_changed
 
std::unique_ptr< interfaces::Handlerm_handler_can_get_addrs_changed
 
interfaces::Nodem_node
 
bool fHaveWatchOnly
 
bool fForceCheckBalanceChanged {false}
 
OptionsModeloptionsModel
 
AddressTableModeladdressTableModel
 
TransactionTableModeltransactionTableModel
 
RecentRequestsTableModelrecentRequestsTableModel
 
interfaces::WalletBalances m_cached_balances
 
EncryptionStatus cachedEncryptionStatus
 
int cachedNumBlocks
 
QTimer * pollTimer
 

Detailed Description

Interface to Bitcoin wallet from Qt view code.

Member Enumeration Documentation

◆ EncryptionStatus

Enumerator
Unencrypted 
Locked 
Unlocked 

◆ StatusCode

Enumerator
OK 
InvalidAmount 
InvalidAddress 
AmountExceedsBalance 
AmountWithFeeExceedsBalance 
DuplicateAddress 
TransactionCreationFailed 
TransactionCommitFailed 
AbsurdFee 
PaymentRequestExpired 

Constructor & Destructor Documentation

◆ WalletModel()

WalletModel::WalletModel ( std::unique_ptr< interfaces::Wallet wallet,
interfaces::Node node,
const PlatformStyle platformStyle,
OptionsModel optionsModel,
QObject *  parent = nullptr 
)
explicit

◆ ~WalletModel()

WalletModel::~WalletModel ( )

Member Function Documentation

◆ balanceChanged

void WalletModel::balanceChanged ( const interfaces::WalletBalances balances)
signal

◆ bumpFee()

bool WalletModel::bumpFee ( uint256  hash,
uint256 new_hash 
)

◆ canGetAddresses()

bool WalletModel::canGetAddresses ( ) const

◆ canGetAddressesChanged

void WalletModel::canGetAddressesChanged ( )
signal

◆ changePassphrase()

bool WalletModel::changePassphrase ( const SecureString oldPass,
const SecureString newPass 
)

◆ checkBalanceChanged()

void WalletModel::checkBalanceChanged ( const interfaces::WalletBalances new_balances)
private

◆ coinsSent

void WalletModel::coinsSent ( WalletModel wallet,
SendCoinsRecipient  recipient,
QByteArray  transaction 
)
signal

◆ encryptionStatusChanged

void WalletModel::encryptionStatusChanged ( )
signal

◆ getAddressTableModel() [1/2]

AddressTableModel * WalletModel::getAddressTableModel ( )

◆ getAddressTableModel() [2/2]

AddressTableModel* WalletModel::getAddressTableModel ( ) const
inline

◆ getDisplayName()

QString WalletModel::getDisplayName ( ) const

◆ getEncryptionStatus()

WalletModel::EncryptionStatus WalletModel::getEncryptionStatus ( ) const

◆ getOptionsModel()

OptionsModel * WalletModel::getOptionsModel ( )

◆ getRecentRequestsTableModel()

RecentRequestsTableModel * WalletModel::getRecentRequestsTableModel ( )

◆ getTransactionTableModel()

TransactionTableModel * WalletModel::getTransactionTableModel ( )

◆ getWalletName()

QString WalletModel::getWalletName ( ) const

◆ isMultiwallet()

bool WalletModel::isMultiwallet ( )

◆ isWalletEnabled()

bool WalletModel::isWalletEnabled ( )
static

◆ loadReceiveRequests()

void WalletModel::loadReceiveRequests ( std::vector< std::string > &  vReceiveRequests)

◆ message

void WalletModel::message ( const QString &  title,
const QString &  message,
unsigned int  style 
)
signal

◆ node()

interfaces::Node& WalletModel::node ( ) const
inline

◆ notifyWatchonlyChanged

void WalletModel::notifyWatchonlyChanged ( bool  fHaveWatchonly)
signal

◆ pollBalanceChanged

void WalletModel::pollBalanceChanged ( )
slot

◆ prepareTransaction()

WalletModel::SendCoinsReturn WalletModel::prepareTransaction ( WalletModelTransaction transaction,
const CCoinControl coinControl 
)

◆ privateKeysDisabled()

bool WalletModel::privateKeysDisabled ( ) const

◆ requestUnlock()

WalletModel::UnlockContext WalletModel::requestUnlock ( )

◆ requireUnlock

void WalletModel::requireUnlock ( )
signal

◆ saveReceiveRequest()

bool WalletModel::saveReceiveRequest ( const std::string &  sAddress,
const int64_t  nId,
const std::string &  sRequest 
)

◆ sendCoins()

WalletModel::SendCoinsReturn WalletModel::sendCoins ( WalletModelTransaction transaction)

◆ setWalletEncrypted()

bool WalletModel::setWalletEncrypted ( bool  encrypted,
const SecureString passphrase 
)

◆ setWalletLocked()

bool WalletModel::setWalletLocked ( bool  locked,
const SecureString passPhrase = SecureString() 
)

◆ showProgress

void WalletModel::showProgress ( const QString &  title,
int  nProgress 
)
signal

◆ subscribeToCoreSignals()

void WalletModel::subscribeToCoreSignals ( )
private

◆ unload

void WalletModel::unload ( )
signal

◆ unsubscribeFromCoreSignals()

void WalletModel::unsubscribeFromCoreSignals ( )
private

◆ updateAddressBook

void WalletModel::updateAddressBook ( const QString &  address,
const QString &  label,
bool  isMine,
const QString &  purpose,
int  status 
)
slot

◆ updateStatus

void WalletModel::updateStatus ( )
slot

◆ updateTransaction

void WalletModel::updateTransaction ( )
slot

◆ updateWatchOnlyFlag

void WalletModel::updateWatchOnlyFlag ( bool  fHaveWatchonly)
slot

◆ validateAddress()

bool WalletModel::validateAddress ( const QString &  address)

◆ wallet()

interfaces::Wallet& WalletModel::wallet ( ) const
inline

Member Data Documentation

◆ addressTableModel

AddressTableModel* WalletModel::addressTableModel
private

◆ cachedEncryptionStatus

EncryptionStatus WalletModel::cachedEncryptionStatus
private

◆ cachedNumBlocks

int WalletModel::cachedNumBlocks
private

◆ fForceCheckBalanceChanged

bool WalletModel::fForceCheckBalanceChanged {false}
private

◆ fHaveWatchOnly

bool WalletModel::fHaveWatchOnly
private

◆ m_cached_balances

interfaces::WalletBalances WalletModel::m_cached_balances
private

◆ m_handler_address_book_changed

std::unique_ptr<interfaces::Handler> WalletModel::m_handler_address_book_changed
private

◆ m_handler_can_get_addrs_changed

std::unique_ptr<interfaces::Handler> WalletModel::m_handler_can_get_addrs_changed
private

◆ m_handler_show_progress

std::unique_ptr<interfaces::Handler> WalletModel::m_handler_show_progress
private

◆ m_handler_status_changed

std::unique_ptr<interfaces::Handler> WalletModel::m_handler_status_changed
private

◆ m_handler_transaction_changed

std::unique_ptr<interfaces::Handler> WalletModel::m_handler_transaction_changed
private

◆ m_handler_unload

std::unique_ptr<interfaces::Handler> WalletModel::m_handler_unload
private

◆ m_handler_watch_only_changed

std::unique_ptr<interfaces::Handler> WalletModel::m_handler_watch_only_changed
private

◆ m_node

interfaces::Node& WalletModel::m_node
private

◆ m_wallet

std::unique_ptr<interfaces::Wallet> WalletModel::m_wallet
private

◆ optionsModel

OptionsModel* WalletModel::optionsModel
private

◆ pollTimer

QTimer* WalletModel::pollTimer
private

◆ recentRequestsTableModel

RecentRequestsTableModel* WalletModel::recentRequestsTableModel
private

◆ transactionTableModel

TransactionTableModel* WalletModel::transactionTableModel
private

The documentation for this class was generated from the following files: