diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-11-28 14:07:25 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-11-28 17:54:22 +0000 |
commit | 82ba2108e98ab3f2695232fd45101bdc257e525a (patch) | |
tree | 68d2fcf0d962172f7012636fe6cd257d052a979a /src/wallet/wallet_rpc_server_commands_defs.h | |
parent | epee: add functions to convert from URL format (ie, %XX values) (diff) | |
download | monero-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.h | 56 |
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() + }; + }; + } } |