monero-c
C ABI for using Monero
Loading...
Searching...
No Matches
monero_c_rpc_connection.h
Go to the documentation of this file.
1
23#ifndef MONERO_C_RPC_CONNECTION_H
24#define MONERO_C_RPC_CONNECTION_H
25
27
28#include <stdbool.h>
29#include <stddef.h>
30#include <stdint.h>
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36// ----------------------------- RPC CONNECTION -------------------------------
37// each function wraps the monero_rpc_connection method of the same name. A JSON argument can't
38// nest deeper than 64 levels. On error, string and buffer outputs are set to NULL and scalar
39// outputs are left unchanged
40
51
60
69
77
86
95MONERO_EXPORT monero_result monero_rpc_connection_set_credentials(monero_rpc_connection* connection, const char* username, const char* password);
96
106
116
125
134
143
152
161
171MONERO_EXPORT monero_result monero_rpc_connection_check_connection(monero_rpc_connection* connection, const uint32_t* timeout_ms, bool* out_changed);
172
185MONERO_EXPORT monero_result monero_rpc_connection_send_json_request(monero_rpc_connection* connection, const char* method, const char* params_json, const uint32_t* timeout_ms, char** out_json);
186
198MONERO_EXPORT monero_result monero_rpc_connection_send_path_request(monero_rpc_connection* connection, const char* path, const char* params_json, const uint32_t* timeout_ms, char** out_json);
199
212MONERO_EXPORT monero_result monero_rpc_connection_send_binary_request(monero_rpc_connection* connection, const char* path, const char* params_json, const uint32_t* timeout_ms, uint8_t** out_data, size_t* out_len);
213
214#ifdef __cplusplus
215}
216#endif
217
218#endif // MONERO_C_RPC_CONNECTION_H
MONERO_EXPORT void monero_rpc_connection_free(monero_rpc_connection *connection)
Release a connection handle.
monero_optional_bool
Bool that is unset until monero-cpp knows it, e.g.
Definition monero_c_rpc_connection.h:55
@ MONERO_OPTIONAL_BOOL_UNSET
Definition monero_c_rpc_connection.h:56
@ MONERO_OPTIONAL_BOOL_FALSE
Definition monero_c_rpc_connection.h:57
@ MONERO_OPTIONAL_BOOL_TRUE
Definition monero_c_rpc_connection.h:58
MONERO_EXPORT monero_result monero_rpc_connection_get_attribute(monero_rpc_connection *connection, const char *key, char **out_value)
Get an attribute of the connection.
MONERO_EXPORT monero_result monero_rpc_connection_is_connected(monero_rpc_connection *connection, monero_optional_bool *out_is_connected)
Check if the server was online and authenticated at the last check_connection().
MONERO_EXPORT monero_result monero_rpc_connection_create(const char *connection_json, monero_rpc_connection **out_connection)
Create a connection.
struct monero_rpc_connection monero_rpc_connection
Copyright (c) Libmonero.
Definition monero_c_rpc_connection.h:50
MONERO_EXPORT monero_result monero_rpc_connection_set_credentials(monero_rpc_connection *connection, const char *username, const char *password)
Set the credentials of the connection.
MONERO_EXPORT monero_result monero_rpc_connection_is_authenticated(monero_rpc_connection *connection, monero_optional_bool *out_is_authenticated)
Check if the server accepted the credentials at the last check_connection().
MONERO_EXPORT monero_result monero_rpc_connection_is_i2p(monero_rpc_connection *connection, bool *out_is_i2p)
Check if the URI is an I2P address.
MONERO_EXPORT monero_result monero_rpc_connection_set_attribute(monero_rpc_connection *connection, const char *key, const char *value)
Set an attribute of the connection.
MONERO_EXPORT monero_result monero_rpc_connection_send_binary_request(monero_rpc_connection *connection, const char *path, const char *params_json, const uint32_t *timeout_ms, uint8_t **out_data, size_t *out_len)
Send a binary request to a path of the server, e.g.
MONERO_EXPORT monero_result monero_rpc_connection_serialize(monero_rpc_connection *connection, char **out_json)
Serialize the connection, with the status that check_connection() sets.
MONERO_EXPORT monero_result monero_rpc_connection_is_online(monero_rpc_connection *connection, monero_optional_bool *out_is_online)
Check if the server was online at the last check_connection().
MONERO_EXPORT monero_result monero_rpc_connection_check_connection(monero_rpc_connection *connection, const uint32_t *timeout_ms, bool *out_changed)
Check the connection and update its online, authentication and response time status.
MONERO_EXPORT monero_result monero_rpc_connection_send_json_request(monero_rpc_connection *connection, const char *method, const char *params_json, const uint32_t *timeout_ms, char **out_json)
Send a JSON-RPC request to /json_rpc.
MONERO_EXPORT monero_result monero_rpc_connection_is_onion(monero_rpc_connection *connection, bool *out_is_onion)
Check if the URI is a Tor onion address.
MONERO_EXPORT monero_result monero_rpc_connection_send_path_request(monero_rpc_connection *connection, const char *path, const char *params_json, const uint32_t *timeout_ms, char **out_json)
Send a JSON request to a path of the server, e.g.
monero_result
Definition monero_c_utils.h:81
#define MONERO_EXPORT
Copyright (c) Libmonero.
Definition monero_c_utils.h:69