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
18#include <util/translation.h>
19
20namespace wallet {
29enum class AddressPurpose {
30 RECEIVE,
31 SEND,
32 REFUND,
33};
34
36{
40 std::optional<unsigned int> change_pos;
41
42 CreatedTransactionResult(CTransactionRef _tx, CAmount _fee, std::optional<unsigned int> _change_pos, const FeeCalculation& _fee_calc)
43 : tx(_tx), fee(_fee), fee_calc(_fee_calc), change_pos(_change_pos) {}
44};
45
51enum class WalletErrorCode {
55
59};
60
71};
72
73} // namespace wallet
74
75#endif // BITCOIN_WALLET_TYPES_H
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
WalletErrorCode
Machine-readable wallet error codes.
Definition: types.h:51
@ 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:29
@ 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
FeeCalculation fee_calc
Definition: types.h:39
CreatedTransactionResult(CTransactionRef _tx, CAmount _fee, std::optional< unsigned int > _change_pos, const FeeCalculation &_fee_calc)
Definition: types.h:42
std::optional< unsigned int > change_pos
Definition: types.h:40
Wallet-layer error with both programmatic and user-facing information.
Definition: types.h:66
bilingual_str message
User-facing translated error message.
Definition: types.h:70
WalletErrorCode code
Machine-readable error code for callers that need programmatic handling.
Definition: types.h:68