2020-04-16 13:14:08 -04:00
|
|
|
// Copyright (c) 2016-2020 The Bitcoin Core developers
|
2016-01-07 04:33:49 -03:00
|
|
|
// 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 02:13:19 -04:00
|
|
|
#include <span.h>
|
|
|
|
|
2017-07-31 11:46:13 -04:00
|
|
|
#include <memory>
|
2017-08-28 14:33:59 -03:00
|
|
|
#include <string>
|
2017-07-31 11:46:13 -04:00
|
|
|
#include <vector>
|
2017-08-28 14:33:59 -03:00
|
|
|
|
2020-05-28 02:13:19 -04:00
|
|
|
class CRPCCommand;
|
2017-08-28 14:33:59 -03:00
|
|
|
class CWallet;
|
2017-01-06 14:53:06 -03:00
|
|
|
class JSONRPCRequest;
|
2019-11-05 12:13:43 -03:00
|
|
|
class LegacyScriptPubKeyMan;
|
2017-06-12 21:53:46 -04:00
|
|
|
class UniValue;
|
2018-06-28 22:05:05 -04:00
|
|
|
class CTransaction;
|
2020-05-28 02:13:19 -04:00
|
|
|
struct PartiallySignedTransaction;
|
|
|
|
struct WalletContext;
|
2016-03-29 14:43:02 -03:00
|
|
|
|
2020-05-28 02:13:19 -04:00
|
|
|
Span<const CRPCCommand> GetWalletRPCCommands();
|
2016-01-07 04:33:49 -03:00
|
|
|
|
2017-01-06 14:53:06 -03:00
|
|
|
/**
|
|
|
|
* Figures out what wallet, if any, to use for a JSONRPCRequest.
|
|
|
|
*
|
|
|
|
* @param[in] request JSONRPCRequest that wishes to access a wallet
|
2017-08-07 01:36:37 -04:00
|
|
|
* @return nullptr if no wallet should be used, or a pointer to the CWallet
|
2017-01-06 14:53:06 -03:00
|
|
|
*/
|
2018-05-22 11:18:07 -04:00
|
|
|
std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& request);
|
2017-01-06 14:53:06 -03:00
|
|
|
|
2021-03-04 12:20:13 -03:00
|
|
|
void EnsureWalletIsUnlocked(const CWallet&);
|
2020-05-28 02:13:19 -04:00
|
|
|
WalletContext& EnsureWalletContext(const util::Ref& context);
|
2019-10-07 15:11:34 -03:00
|
|
|
LegacyScriptPubKeyMan& EnsureLegacyScriptPubKeyMan(CWallet& wallet, bool also_create = false);
|
2017-01-06 14:53:06 -03:00
|
|
|
|
2020-09-22 13:13:52 -03:00
|
|
|
RPCHelpMan getaddressinfo();
|
|
|
|
RPCHelpMan signrawtransactionwithwallet();
|
2016-01-07 04:33:49 -03:00
|
|
|
#endif //BITCOIN_WALLET_RPCWALLET_H
|