IWallet methods and callbacks

From Bytecoin Wiki
Jump to: navigation, search

IWallet Interface

Method Description Parameters Parameters Description Return Value Return Value Description
initialize Initializes an instance of IWallet class and creates a new wallet const std::string& password Password for a new wallet - -
load Initializes an instance of IWallet class and loads a wallet file std::istream& source File stream for the wallet file - -
const std::string& password Password for an existing wallet
shutdown Kills all connections from the wallet to the node. After this method’s call the object can be started by initialize or load methods. - - - -
changePassword Changes wallet's password. Having used this method, client should call "save" method to apply changes. const std::string& oldPassword Password to be changed - -
const std::string& newPassword New password
save Stores wallet's data to a binary storage std::ostream& destination Location where data should be stored - -
bool saveDetails Stores target transfer addresses for all sent transactions
bool saveCache Stores all data about already parsed transactions. On next startup wallet will not check blocks for these transactions.
getAddressCount Returns the number of all created addresses - - size_t Address count
getAddress Returns wallet's address by identifier size_t index Address identifier std::string Wallet address in string representation
createAddress Creates and returns newly created wallet's address - - std::string Wallet address in string representation
createAddress Creates and returns newly created wallet's address for a specific spendKey const KeyPair& spendKey Spend Key std::string Wallet address in string representation
deleteAddress Deletes wallet's address by string representation of it const std::string& address Wallet's address in string representation - -
getActualBalance Returns the balance that the user can currently operate with. - - uint64_t Money amount
getActualBalance Returns the balance that the user can currently operate with for a specific address const std::string& address One of the previously created wallet's address in string representation uint64_t Money amount
getPendingBalance Returns the balance that the user has already received but cannot spend yet. This might happen in two cases:
  • Block reward can’t be spent until confirmed by 10 blocks.
  • User receives the money through a transaction the unlock time of which is in the future. Until then this money will be held as pending.
- - uint64_t Money amount
getPendingBalance Returns the balance that the user has already received but cannot spend yet for a specific address. This might happen in two cases:
  • Block reward can’t be spent until confirmed by 10 blocks.
  • User receives the money through a transaction the unlock time of which is in the future. Until then this money will be held as pending.
const std::string& address One of the previously created wallet's address in string representation uint64_t Money amount
getTransactionCount Returns number of all transactions of the user - - size_t Transaction Count
getTransaction Returns a transaction by transaction identifier size_t transactionIndex Transaction identifier WalletTransaction Corresponding Transaction
getTransactionTransferCount Returns the number of transfers of specific transaction size_t transactionIndex Transaction identifier size_t Transfer's count for corresponding transaction
getTransactionTransfer Returns transfer by the transaction identifier and transfer identifier size_t transactionIndex Transaction identifier WalletTransfer Corresponding transfer
size_t transferIndex Transfer identifier
transfer Creates and sends a new transaction with a single destination const WalletTransfer& destination Transfer that the client wishes to send size_t Transaction identifier
uint64_t fee Transaction fee
uint64_t mixIn Mixin transaction parameter
const std::string& extra Extra parameter of the transaction
uint64_t unlockTimestamp After this time transfer's beneficiary can spend the money
transfer Creates and sends a new transaction with multiple destinations const std::vector<WalletTransfer>& destinations Transfers that the client wishes to send size_t Transaction identifier
uint64_t fee Transaction fee
uint64_t mixIn Mixin transaction parameter
const std::string& extra Extra parameter of the transaction
uint64_t unlockTimestamp After this time transfer's beneficiary can spend the money
transfer Creates and sends a new transaction with a single destination that spends funds of specific address const std::string& sourceAddress String representation of wallet's address user wishes to spend funds from size_t Transaction identifier
const WalletTransfer& destination Transfer that the client wishes to send
uint64_t fee Transaction fee
uint64_t mixIn Mixin transaction parameter
const std::string& extra Extra parameter of the transaction
uint64_t unlockTimestamp After this time transfer's beneficiary can spend the money
transfer Creates and sends a new transaction with multiple destinations const std::string& sourceAddress String representation of wallet's address user wishes to spend funds from size_t Transaction identifier
const std::vector<WalletTransfer>& destinations Transfers that the client wishes to send
uint64_t fee Transaction fee
uint64_t mixIn Mixin transaction parameter
const std::string& extra Extra parameter of the transaction
uint64_t unlockTimestamp After this time transfer's beneficiary can spend the money
start Function that starts the wallet and its event queue - - - -
stop Function that stops the wallet and unblocks getEvent queue - - - -
getEvent Blocks till wallet event occurs and returns it - - WalletEvent Corresponding event


Events

WalletEventType Description WalletEventDataType Parameters Description
TRANSACTION_CREATED This type of event occurs when new transaction is sent by user or came from network WalletTransactionCreatedData size_t transactionIndex Identifier of created transaction
TRANSACTION_UPDATED This type of event occurs when known transaction changes its status WalletTransactionUpdatedData size_t transactionIndex Identifier of updated transaction
BALANCE_UNLOCKED This type of event occurs when users funds become spendable - - -
Personal tools
Namespaces

Variants
Actions
Navigation
Tools