Bitcoin Core 31.99.0
P2P Digital Currency
types.h
Go to the documentation of this file.
1// Copyright (c) 2009-2010 Satoshi Nakamoto
2// Copyright (c) 2009-present The Bitcoin Core developers
3// Distributed under the MIT software license, see the accompanying
4// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
13
14#ifndef BITCOIN_WALLET_TYPES_H
15#define BITCOIN_WALLET_TYPES_H
16
17#include <consensus/amount.h>
18#include <policy/feerate.h>
20#include <util/fees.h>
21#include <util/translation.h>
22
23#include <optional>
24#include <utility>
25
26namespace wallet {
30 std::optional<int> returned_target;
31
34};
35
44enum class AddressPurpose {
45 RECEIVE,
46 SEND,
47 REFUND,
48};
49
51{
55 std::optional<unsigned int> change_pos;
56
57 CreatedTransactionResult(CTransactionRef _tx, CAmount _fee, std::optional<unsigned int> _change_pos, FeeReason _fee_reason)
58 : tx(_tx), fee(_fee), fee_reason(_fee_reason), change_pos(_change_pos) {}
59};
60
66enum class WalletErrorCode {
70
74};
75
86};
87
88} // namespace wallet
89
90#endif // BITCOIN_WALLET_TYPES_H
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
Fee rate in satoshis per virtualbyte: CAmount / vB the feerate is represented internally as FeeFrac.
Definition: feerate.h:32
WalletErrorCode
Machine-readable wallet error codes.
Definition: types.h:66
@ UnlockNeeded
The wallet is locked and the operation requires access to private keys.
@ GenericError
Generic wallet error.
AddressPurpose
Address purpose field that has been been stored with wallet sending and receiving addresses since BIP...
Definition: types.h:44
@ REFUND
Never set in current code may be present in older wallet databases.
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:403
Bilingual messages:
Definition: translation.h:24
CreatedTransactionResult(CTransactionRef _tx, CAmount _fee, std::optional< unsigned int > _change_pos, FeeReason _fee_reason)
Definition: types.h:57
std::optional< unsigned int > change_pos
Definition: types.h:55
std::optional< int > returned_target
Definition: types.h:30
MinimumFeeRateResult(CFeeRate fee_rate, FeeReason fee_reason, std::optional< int > returned_target)
Definition: types.h:32
Wallet-layer error with both programmatic and user-facing information.
Definition: types.h:81
bilingual_str message
User-facing translated error message.
Definition: types.h:85
WalletErrorCode code
Machine-readable error code for callers that need programmatic handling.
Definition: types.h:83
FeeReason
Definition: fees.h:24