PIVX Core
5.6.99
P2P Digital Currency
src
interfaces
wallet.h
Go to the documentation of this file.
1
// Copyright (c) 2018-2020 The Bitcoin Core developers
2
// Copyright (c) 2020-2021 The PIVX Core developers
3
// Distributed under the MIT software license, see the accompanying
4
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
5
6
#ifndef PIVX_INTERFACES_WALLET_H
7
#define PIVX_INTERFACES_WALLET_H
8
9
#include <
amount.h
>
10
#include "
wallet/wallet.h
"
11
12
namespace
interfaces
{
13
15
struct
WalletBalances
16
{
17
CAmount
balance
{0};
18
CAmount
unconfirmed_balance
{0};
19
CAmount
immature_balance
{0};
20
bool
have_watch_only
{
false
};
21
CAmount
watch_only_balance
{0};
22
CAmount
unconfirmed_watch_only_balance
{0};
23
CAmount
immature_watch_only_balance
{0};
24
bool
have_coldstaking
{
false
};
25
CAmount
delegate_balance
{0};
26
CAmount
coldstaked_balance
{0};
27
CAmount
shielded_balance
{0};
28
CAmount
unconfirmed_shielded_balance
{0};
29
30
bool
balanceChanged
(
const
WalletBalances
& prev)
const
31
{
32
return
balance
!= prev.
balance
||
unconfirmed_balance
!= prev.
unconfirmed_balance
||
33
immature_balance
!= prev.
immature_balance
||
watch_only_balance
!= prev.
watch_only_balance
||
34
unconfirmed_watch_only_balance
!= prev.
unconfirmed_watch_only_balance
||
35
immature_watch_only_balance
!= prev.
immature_watch_only_balance
||
36
delegate_balance
!= prev.
delegate_balance
||
coldstaked_balance
!= prev.
coldstaked_balance
||
37
shielded_balance
!= prev.
shielded_balance
||
unconfirmed_shielded_balance
!= prev.
unconfirmed_shielded_balance
;
38
}
39
};
40
41
class
Wallet
{
42
public
:
43
explicit
Wallet
(
CWallet
& wallet) :
m_wallet
(wallet) { };
44
// Retrieve all the wallet balances
45
WalletBalances
getBalances
();
46
47
private
:
48
CWallet
&
m_wallet
;
49
};
50
51
52
}
// namespace interfaces
53
54
#endif
// PIVX_INTERFACES_WALLET_H
amount.h
CAmount
int64_t CAmount
Amount in PIV (Can be negative)
Definition:
amount.h:13
CWallet
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
Definition:
wallet.h:577
interfaces::Wallet
Definition:
wallet.h:41
interfaces::Wallet::m_wallet
CWallet & m_wallet
Definition:
wallet.h:48
interfaces::Wallet::getBalances
WalletBalances getBalances()
Definition:
wallet.cpp:11
interfaces::Wallet::Wallet
Wallet(CWallet &wallet)
Definition:
wallet.h:43
interfaces
Definition:
handler.cpp:11
interfaces::WalletBalances
Collection of wallet balances.
Definition:
wallet.h:16
interfaces::WalletBalances::have_coldstaking
bool have_coldstaking
Definition:
wallet.h:24
interfaces::WalletBalances::immature_balance
CAmount immature_balance
Definition:
wallet.h:19
interfaces::WalletBalances::shielded_balance
CAmount shielded_balance
Definition:
wallet.h:27
interfaces::WalletBalances::watch_only_balance
CAmount watch_only_balance
Definition:
wallet.h:21
interfaces::WalletBalances::unconfirmed_balance
CAmount unconfirmed_balance
Definition:
wallet.h:18
interfaces::WalletBalances::unconfirmed_shielded_balance
CAmount unconfirmed_shielded_balance
Definition:
wallet.h:28
interfaces::WalletBalances::delegate_balance
CAmount delegate_balance
Definition:
wallet.h:25
interfaces::WalletBalances::balance
CAmount balance
Definition:
wallet.h:17
interfaces::WalletBalances::have_watch_only
bool have_watch_only
Definition:
wallet.h:20
interfaces::WalletBalances::unconfirmed_watch_only_balance
CAmount unconfirmed_watch_only_balance
Definition:
wallet.h:22
interfaces::WalletBalances::immature_watch_only_balance
CAmount immature_watch_only_balance
Definition:
wallet.h:23
interfaces::WalletBalances::coldstaked_balance
CAmount coldstaked_balance
Definition:
wallet.h:26
interfaces::WalletBalances::balanceChanged
bool balanceChanged(const WalletBalances &prev) const
Definition:
wallet.h:30
wallet.h
Generated on Wed Apr 2 2025 00:40:28 for PIVX Core by
1.9.1