aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server_commands_defs.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-28 14:07:25 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-28 17:54:22 +0000
commit82ba2108e98ab3f2695232fd45101bdc257e525a (patch)
tree68d2fcf0d962172f7012636fe6cd257d052a979a /src/wallet/wallet_rpc_server_commands_defs.h
parentepee: add functions to convert from URL format (ie, %XX values) (diff)
downloadmonero-82ba2108e98ab3f2695232fd45101bdc257e525a.tar.xz
wallet: add API and RPC to create/parse monero: URIs
Diffstat (limited to 'src/wallet/wallet_rpc_server_commands_defs.h')
-rw-r--r--src/wallet/wallet_rpc_server_commands_defs.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h
index 76de7bc9d..50b1613f9 100644
--- a/src/wallet/wallet_rpc_server_commands_defs.h
+++ b/src/wallet/wallet_rpc_server_commands_defs.h
@@ -703,5 +703,61 @@ namespace wallet_rpc
};
};
+ struct uri_spec
+ {
+ std::string address;
+ std::string payment_id;
+ uint64_t amount;
+ std::string tx_description;
+ std::string recipient_name;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(address);
+ KV_SERIALIZE(payment_id);
+ KV_SERIALIZE(amount);
+ KV_SERIALIZE(tx_description);
+ KV_SERIALIZE(recipient_name);
+ END_KV_SERIALIZE_MAP()
+ };
+
+ struct COMMAND_RPC_MAKE_URI
+ {
+ struct request: public uri_spec
+ {
+ };
+
+ struct response
+ {
+ std::string uri;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(uri)
+ END_KV_SERIALIZE_MAP()
+ };
+ };
+
+ struct COMMAND_RPC_PARSE_URI
+ {
+ struct request
+ {
+ std::string uri;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(uri)
+ END_KV_SERIALIZE_MAP()
+ };
+
+ struct response
+ {
+ uri_spec uri;
+ std::vector<std::string> unknown_parameters;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(uri);
+ KV_SERIALIZE(unknown_parameters);
+ END_KV_SERIALIZE_MAP()
+ };
+ };
+
}
}