2016-01-20 15:15:29 +01:00
|
|
|
// Copyright (c) 2016 The Bitcoin Core developers
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_WALLET_RPCWALLET_H
|
|
|
|
#define BITCOIN_WALLET_RPCWALLET_H
|
|
|
|
|
2020-05-28 08:13:19 +02:00
|
|
|
#include <span.h>
|
|
|
|
|
2021-11-01 12:24:34 +01:00
|
|
|
#include <memory>
|
2017-09-08 01:30:28 +02:00
|
|
|
#include <string>
|
2021-11-01 12:24:34 +01:00
|
|
|
#include <vector>
|
2017-09-08 01:30:28 +02:00
|
|
|
|
2020-05-28 08:13:19 +02:00
|
|
|
class CRPCCommand;
|
2017-09-08 01:30:28 +02:00
|
|
|
class CWallet;
|
2017-03-03 13:37:19 +01:00
|
|
|
class JSONRPCRequest;
|
2020-12-15 03:41:03 +01:00
|
|
|
class UniValue;
|
2021-07-13 18:30:17 +02:00
|
|
|
class CTransaction;
|
2020-05-28 08:13:19 +02:00
|
|
|
struct PartiallySignedTransaction;
|
|
|
|
struct WalletContext;
|
2016-03-31 10:55:06 +02:00
|
|
|
|
2022-06-27 18:40:22 +02:00
|
|
|
static const std::string HELP_REQUIRING_PASSPHRASE{"\nRequires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.\n"};
|
|
|
|
|
2022-04-23 09:46:44 +02:00
|
|
|
namespace util {
|
|
|
|
class Ref;
|
|
|
|
} // namespace util
|
2021-11-01 12:24:34 +01:00
|
|
|
|
2020-05-28 08:13:19 +02:00
|
|
|
Span<const CRPCCommand> GetWalletRPCCommands();
|
2016-01-20 15:15:29 +01:00
|
|
|
|
2017-03-03 13:37:19 +01:00
|
|
|
/**
|
|
|
|
* Figures out what wallet, if any, to use for a JSONRPCRequest.
|
|
|
|
*
|
|
|
|
* @param[in] request JSONRPCRequest that wishes to access a wallet
|
2019-08-06 05:08:33 +02:00
|
|
|
* @return nullptr if no wallet should be used, or a pointer to the CWallet
|
2017-03-03 13:37:19 +01:00
|
|
|
*/
|
2021-04-01 19:28:43 +02:00
|
|
|
std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& request);
|
2017-03-03 13:37:19 +01:00
|
|
|
|
2019-05-06 10:12:20 +02:00
|
|
|
void EnsureWalletIsUnlocked(const CWallet*);
|
2020-05-28 08:13:19 +02:00
|
|
|
WalletContext& EnsureWalletContext(const util::Ref& context);
|
2017-03-03 13:37:19 +01:00
|
|
|
|
2020-12-17 13:46:20 +01:00
|
|
|
UniValue getaddressinfo(const JSONRPCRequest& request);
|
2018-02-20 03:29:22 +01:00
|
|
|
UniValue signrawtransactionwithwallet(const JSONRPCRequest& request);
|
2016-01-20 15:15:29 +01:00
|
|
|
#endif //BITCOIN_WALLET_RPCWALLET_H
|