Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
wallet_api_plugin.cpp File Reference
Include dependency graph for wallet_api_plugin.cpp:

Go to the source code of this file.

Classes

struct  sysio::detail::wallet_api_plugin_empty
 

Namespaces

namespace  sysio
 
namespace  sysio::detail
 

Macros

#define CALL_WITH_400(api_name, api_handle, call_name, INVOKE, http_response_code)
 
#define INVOKE_R_R(api_handle, call_name, in_param)
 
#define INVOKE_R_R_R(api_handle, call_name, in_param0, in_param1)
 
#define INVOKE_R_R_R_R(api_handle, call_name, in_param0, in_param1, in_param2)
 
#define INVOKE_R_V(api_handle, call_name)
 
#define INVOKE_V_R(api_handle, call_name, in_param)
 
#define INVOKE_V_R_R(api_handle, call_name, in_param0, in_param1)
 
#define INVOKE_V_R_R_R(api_handle, call_name, in_param0, in_param1, in_param2)
 
#define INVOKE_V_V(api_handle, call_name)
 

Functions

 FC_REFLECT (sysio::detail::wallet_api_plugin_empty,)
 

Macro Definition Documentation

◆ CALL_WITH_400

#define CALL_WITH_400 ( api_name,
api_handle,
call_name,
INVOKE,
http_response_code )
Value:
{std::string("/v1/" #api_name "/" #call_name), \
[&api_handle](string, string body, url_response_callback cb) mutable { \
try { \
INVOKE \
cb(http_response_code, fc::variant(result)); \
} catch (...) { \
http_plugin::handle_exception(#api_name, #call_name, body, cb); \
} \
}}
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
std::string string
Definition string.hpp:10

Definition at line 23 of file wallet_api_plugin.cpp.

23#define CALL_WITH_400(api_name, api_handle, call_name, INVOKE, http_response_code) \
24{std::string("/v1/" #api_name "/" #call_name), \
25 [&api_handle](string, string body, url_response_callback cb) mutable { \
26 try { \
27 INVOKE \
28 cb(http_response_code, fc::variant(result)); \
29 } catch (...) { \
30 http_plugin::handle_exception(#api_name, #call_name, body, cb); \
31 } \
32 }}

◆ INVOKE_R_R

#define INVOKE_R_R ( api_handle,
call_name,
in_param )
Value:
auto params = parse_params<in_param, http_params_types::params_required>(body);\
auto result = api_handle.call_name( std::move(params) );

Definition at line 34 of file wallet_api_plugin.cpp.

34#define INVOKE_R_R(api_handle, call_name, in_param) \
35 auto params = parse_params<in_param, http_params_types::params_required>(body);\
36 auto result = api_handle.call_name( std::move(params) );

◆ INVOKE_R_R_R

#define INVOKE_R_R_R ( api_handle,
call_name,
in_param0,
in_param1 )
Value:
const auto& params = parse_params<fc::variants, http_params_types::params_required>(body);\
if (params.size() != 2) { \
SYS_THROW(chain::invalid_http_request, "Missing valid input from POST body"); \
} \
auto result = api_handle.call_name(params.at(0).as<in_param0>(), params.at(1).as<in_param1>());

Definition at line 38 of file wallet_api_plugin.cpp.

38#define INVOKE_R_R_R(api_handle, call_name, in_param0, in_param1) \
39 const auto& params = parse_params<fc::variants, http_params_types::params_required>(body);\
40 if (params.size() != 2) { \
41 SYS_THROW(chain::invalid_http_request, "Missing valid input from POST body"); \
42 } \
43 auto result = api_handle.call_name(params.at(0).as<in_param0>(), params.at(1).as<in_param1>());

◆ INVOKE_R_R_R_R

#define INVOKE_R_R_R_R ( api_handle,
call_name,
in_param0,
in_param1,
in_param2 )
Value:
const auto& params = parse_params<fc::variants, http_params_types::params_required>(body);\
if (params.size() != 3) { \
SYS_THROW(chain::invalid_http_request, "Missing valid input from POST body"); \
} \
auto result = api_handle.call_name(params.at(0).as<in_param0>(), params.at(1).as<in_param1>(), params.at(2).as<in_param2>());

Definition at line 46 of file wallet_api_plugin.cpp.

46#define INVOKE_R_R_R_R(api_handle, call_name, in_param0, in_param1, in_param2) \
47 const auto& params = parse_params<fc::variants, http_params_types::params_required>(body);\
48 if (params.size() != 3) { \
49 SYS_THROW(chain::invalid_http_request, "Missing valid input from POST body"); \
50 } \
51 auto result = api_handle.call_name(params.at(0).as<in_param0>(), params.at(1).as<in_param1>(), params.at(2).as<in_param2>());

◆ INVOKE_R_V

#define INVOKE_R_V ( api_handle,
call_name )
Value:
body = parse_params<std::string, http_params_types::no_params>(body); \
auto result = api_handle.call_name();

Definition at line 53 of file wallet_api_plugin.cpp.

53#define INVOKE_R_V(api_handle, call_name) \
54 body = parse_params<std::string, http_params_types::no_params>(body); \
55 auto result = api_handle.call_name();

◆ INVOKE_V_R

#define INVOKE_V_R ( api_handle,
call_name,
in_param )
Value:
auto params = parse_params<in_param, http_params_types::params_required>(body);\
api_handle.call_name( std::move(params) ); \

Definition at line 57 of file wallet_api_plugin.cpp.

57#define INVOKE_V_R(api_handle, call_name, in_param) \
58 auto params = parse_params<in_param, http_params_types::params_required>(body);\
59 api_handle.call_name( std::move(params) ); \
60 sysio::detail::wallet_api_plugin_empty result;

◆ INVOKE_V_R_R

#define INVOKE_V_R_R ( api_handle,
call_name,
in_param0,
in_param1 )
Value:
const auto& params = parse_params<fc::variants, http_params_types::params_required>(body);\
if (params.size() != 2) { \
SYS_THROW(chain::invalid_http_request, "Missing valid input from POST body"); \
} \
api_handle.call_name(params.at(0).as<in_param0>(), params.at(1).as<in_param1>()); \

Definition at line 62 of file wallet_api_plugin.cpp.

62#define INVOKE_V_R_R(api_handle, call_name, in_param0, in_param1) \
63 const auto& params = parse_params<fc::variants, http_params_types::params_required>(body);\
64 if (params.size() != 2) { \
65 SYS_THROW(chain::invalid_http_request, "Missing valid input from POST body"); \
66 } \
67 api_handle.call_name(params.at(0).as<in_param0>(), params.at(1).as<in_param1>()); \
68 sysio::detail::wallet_api_plugin_empty result;

◆ INVOKE_V_R_R_R

#define INVOKE_V_R_R_R ( api_handle,
call_name,
in_param0,
in_param1,
in_param2 )
Value:
const auto& params = parse_params<fc::variants, http_params_types::params_required>(body);\
if (params.size() != 3) { \
SYS_THROW(chain::invalid_http_request, "Missing valid input from POST body"); \
} \
api_handle.call_name(params.at(0).as<in_param0>(), params.at(1).as<in_param1>(), params.at(2).as<in_param2>()); \

Definition at line 70 of file wallet_api_plugin.cpp.

70#define INVOKE_V_R_R_R(api_handle, call_name, in_param0, in_param1, in_param2) \
71 const auto& params = parse_params<fc::variants, http_params_types::params_required>(body);\
72 if (params.size() != 3) { \
73 SYS_THROW(chain::invalid_http_request, "Missing valid input from POST body"); \
74 } \
75 api_handle.call_name(params.at(0).as<in_param0>(), params.at(1).as<in_param1>(), params.at(2).as<in_param2>()); \
76 sysio::detail::wallet_api_plugin_empty result;

◆ INVOKE_V_V

#define INVOKE_V_V ( api_handle,
call_name )
Value:
body = parse_params<std::string, http_params_types::no_params>(body); \
api_handle.call_name(); \

Definition at line 78 of file wallet_api_plugin.cpp.

78#define INVOKE_V_V(api_handle, call_name) \
79 body = parse_params<std::string, http_params_types::no_params>(body); \
80 api_handle.call_name(); \
81 sysio::detail::wallet_api_plugin_empty result;

Function Documentation

◆ FC_REFLECT()