Bitcoin Core 31.99.0
P2P Digital Currency
export.h
Go to the documentation of this file.
1// Copyright (c) 2026-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or https://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_WALLET_EXPORT_H
6#define BITCOIN_WALLET_EXPORT_H
7
8#include <threadsafety.h>
9#include <util/expected.h>
10#include <wallet/wallet.h>
11
12#include <optional>
13#include <vector>
14
15namespace wallet {
16// Struct containing all of the info from WalletDescriptor, except with the descriptor as a string,
17// and without its ID or cache.
18// Used when exporting descriptors from the wallet.
20 std::string descriptor;
21 uint64_t creation_time;
22 bool active;
23 std::optional<bool> internal;
24 std::optional<std::pair<int64_t,int64_t>> range;
25 int64_t next_index;
26};
27
30
33util::Result<std::string> ExportWatchOnlyWallet(const CWallet& wallet, const fs::path& destination, WalletContext& context) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
34} // namespace wallet
35
36#endif // BITCOIN_WALLET_EXPORT_H
The util::Expected class provides a standard way for low-level functions to return either error value...
Definition: expected.h:44
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:310
util::Result< std::string > ExportWatchOnlyWallet(const CWallet &wallet, const fs::path &destination, WalletContext &context)
Make a new watchonly wallet file containing the public descriptors from this wallet The exported watc...
Definition: export.cpp:45
util::Expected< std::vector< WalletDescInfo >, std::string > ExportDescriptors(const CWallet &wallet, bool export_private)
Export the descriptors from a wallet so that they can be imported elsewhere.
Definition: export.cpp:17
WalletContext struct containing references to state shared between CWallet instances,...
Definition: context.h:36
std::optional< bool > internal
Definition: export.h:23
std::optional< std::pair< int64_t, int64_t > > range
Definition: export.h:24
int64_t next_index
Definition: export.h:25
std::string descriptor
Definition: export.h:20
uint64_t creation_time
Definition: export.h:21
#define EXCLUSIVE_LOCKS_REQUIRED(...)
Definition: threadsafety.h:49