aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server_commands_defs.h
diff options
context:
space:
mode:
authorDusan Klinec <dusan.klinec@gmail.com>2018-05-07 23:23:47 +0200
committerDusan Klinec <dusan.klinec@gmail.com>2018-06-03 13:21:00 +0200
commit9c2a7b46381f577ca1398a1d587d176b3b72a366 (patch)
tree9ef329cdaaec7499171460580bd9c457e03ec24d /src/wallet/wallet_rpc_server_commands_defs.h
parentMerge pull request #3525 (diff)
downloadmonero-9c2a7b46381f577ca1398a1d587d176b3b72a366.tar.xz
wallet-rpc: watch-only and cold wallet features added
- unsigned_txset, signed_txset in transfer / submit_transfer / sign_transfer - export_outputs, import_outputs Squashed commits: [f4d9f3d4] wallet-rpc: do_not_relay removed from submit_transfer [5b16a86f] wallet-rpc: review-fix - method signature changes, renaming [b7fbb10a] wallet-rpc: naming fixes (unsigned vs signed), consts renamed [8c7d2727] wallet-rpc: sign_transfer added [481d024a] wallet2: sign_tx splitted to work with strings and structs, more granular [2a474db9] wallet-rpc: wallet2::load_unsigned_tx split to load from str, file [b1e3a018] wallet-rpc: review fix, load_tx_from_str variable rename [1f6373be] wallet-rpc: review fix: save_tx_to_{str,file} [2a08eafc] wallet-rpc: review comments fixes - redundant this removed from wallet2.cpp - load_tx_from_str, load_tx_from_file [43498052] wallet-rpc: submit_transfer added [9c45d1ad] wallet-rpc: watch_only check, return unsigned_txset [62831396] wallet2: added string variants to load_tx, save_tx - analogously to save_multisig_tx - required for monero-wallet-rpc to support watch-only wallet
Diffstat (limited to 'src/wallet/wallet_rpc_server_commands_defs.h')
-rw-r--r--src/wallet/wallet_rpc_server_commands_defs.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h
index a0f43c9b9..11f852d6f 100644
--- a/src/wallet/wallet_rpc_server_commands_defs.h
+++ b/src/wallet/wallet_rpc_server_commands_defs.h
@@ -419,6 +419,7 @@ namespace wallet_rpc
std::string tx_blob;
std::string tx_metadata;
std::string multisig_txset;
+ std::string unsigned_txset;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(tx_hash)
@@ -429,6 +430,7 @@ namespace wallet_rpc
KV_SERIALIZE(tx_blob)
KV_SERIALIZE(tx_metadata)
KV_SERIALIZE(multisig_txset)
+ KV_SERIALIZE(unsigned_txset)
END_KV_SERIALIZE_MAP()
};
};
@@ -484,6 +486,7 @@ namespace wallet_rpc
std::list<std::string> tx_blob_list;
std::list<std::string> tx_metadata_list;
std::string multisig_txset;
+ std::string unsigned_txset;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(tx_hash_list)
@@ -493,6 +496,55 @@ namespace wallet_rpc
KV_SERIALIZE(tx_blob_list)
KV_SERIALIZE(tx_metadata_list)
KV_SERIALIZE(multisig_txset)
+ KV_SERIALIZE(unsigned_txset)
+ END_KV_SERIALIZE_MAP()
+ };
+ };
+
+ struct COMMAND_RPC_SIGN_TRANSFER
+ {
+ struct request
+ {
+ std::string unsigned_txset;
+ bool export_raw;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(unsigned_txset)
+ KV_SERIALIZE_OPT(export_raw, false)
+ END_KV_SERIALIZE_MAP()
+ };
+
+ struct response
+ {
+ std::string signed_txset;
+ std::list<std::string> tx_hash_list;
+ std::list<std::string> tx_raw_list;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(signed_txset)
+ KV_SERIALIZE(tx_hash_list)
+ KV_SERIALIZE(tx_raw_list)
+ END_KV_SERIALIZE_MAP()
+ };
+ };
+
+ struct COMMAND_RPC_SUBMIT_TRANSFER
+ {
+ struct request
+ {
+ std::string tx_data_hex;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(tx_data_hex)
+ END_KV_SERIALIZE_MAP()
+ };
+
+ struct response
+ {
+ std::list<std::string> tx_hash_list;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(tx_hash_list)
END_KV_SERIALIZE_MAP()
};
};
@@ -532,6 +584,7 @@ namespace wallet_rpc
std::list<std::string> tx_blob_list;
std::list<std::string> tx_metadata_list;
std::string multisig_txset;
+ std::string unsigned_txset;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(tx_hash_list)
@@ -541,6 +594,7 @@ namespace wallet_rpc
KV_SERIALIZE(tx_blob_list)
KV_SERIALIZE(tx_metadata_list)
KV_SERIALIZE(multisig_txset)
+ KV_SERIALIZE(unsigned_txset)
END_KV_SERIALIZE_MAP()
};
};
@@ -598,6 +652,7 @@ namespace wallet_rpc
std::list<std::string> tx_blob_list;
std::list<std::string> tx_metadata_list;
std::string multisig_txset;
+ std::string unsigned_txset;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(tx_hash_list)
@@ -607,6 +662,7 @@ namespace wallet_rpc
KV_SERIALIZE(tx_blob_list)
KV_SERIALIZE(tx_metadata_list)
KV_SERIALIZE(multisig_txset)
+ KV_SERIALIZE(unsigned_txset)
END_KV_SERIALIZE_MAP()
};
};
@@ -651,6 +707,7 @@ namespace wallet_rpc
std::string tx_blob;
std::string tx_metadata;
std::string multisig_txset;
+ std::string unsigned_txset;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(tx_hash)
@@ -660,6 +717,7 @@ namespace wallet_rpc
KV_SERIALIZE(tx_blob)
KV_SERIALIZE(tx_metadata)
KV_SERIALIZE(multisig_txset)
+ KV_SERIALIZE(unsigned_txset)
END_KV_SERIALIZE_MAP()
};
};
@@ -1364,6 +1422,45 @@ namespace wallet_rpc
};
};
+ struct COMMAND_RPC_EXPORT_OUTPUTS
+ {
+ struct request
+ {
+ BEGIN_KV_SERIALIZE_MAP()
+ END_KV_SERIALIZE_MAP()
+ };
+
+ struct response
+ {
+ std::string outputs_data_hex;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(outputs_data_hex);
+ END_KV_SERIALIZE_MAP()
+ };
+ };
+
+ struct COMMAND_RPC_IMPORT_OUTPUTS
+ {
+ struct request
+ {
+ std::string outputs_data_hex;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(outputs_data_hex);
+ END_KV_SERIALIZE_MAP()
+ };
+
+ struct response
+ {
+ uint64_t num_imported;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(num_imported);
+ END_KV_SERIALIZE_MAP()
+ };
+ };
+
struct COMMAND_RPC_EXPORT_KEY_IMAGES
{
struct request