Offline Transaction Signing (OTS) 0.1.0
Loading...
Searching...
No Matches
ots-abi.cpp File Reference
#include "ots.h"
#include "ots.hpp"
#include "ots-exceptions.hpp"
#include <cstring>
#include <memory>
Include dependency graph for ots-abi.cpp:

Functions

void ots_error_init (ots_error_t *error)
 Initialize error structure.
 
bool ots_is_error (const ots_result_t *result)
 Check if result contains an error.
 
bool ots_has_error (const ots_result_t *result)
 Check if result contains an error.
 
ots_result_t ots_get_last_error (void)
 Get error message for last error.
 
ots_result_t ots_get_error_message (int32_t error_code)
 Get error message for specific error code.
 
void ots_clear_error (void)
 Clear last error state.
 
void ots_free_string (char *str)
 Free a string allocated by the library.
 
void ots_free_array (void *arr)
 Free an array allocated by the library.
 
void ots_free_handle (ots_handle_t handle)
 Free a handle.
 
void ots_wipeable_string_free (ots_wipeable_string_t *str)
 Free a wipeable string, securely wiping memory.
 
void ots_seed_indices_free (ots_seed_indices_t *indices)
 Free seed indices, securely wiping memory.
 
void ots_free_tx_description (ots_tx_description_t *desc)
 Free transaction description.
 
ots_result_t ots_version (void)
 Get library version string.
 
ots_result_t ots_version_components (void)
 Get version components [major, minor, patch].
 

Function Documentation

◆ ots_clear_error()

void ots_clear_error ( void  )

Clear last error state.

◆ ots_error_init()

void ots_error_init ( ots_error_t error)

Initialize error structure.

Parameters
[out]errorError structure to initialize

◆ ots_free_array()

void ots_free_array ( void *  arr)

Free an array allocated by the library.

Parameters
[in]arrArray to free

◆ ots_free_handle()

void ots_free_handle ( ots_handle_t  handle)

Free a handle.

Parameters
[in]handleHandle to free

◆ ots_free_string()

void ots_free_string ( char *  str)

Free a string allocated by the library.

Parameters
[in]strString to free

◆ ots_free_tx_description()

void ots_free_tx_description ( ots_tx_description_t desc)

Free transaction description.

Parameters
[in]descTransaction description to free

◆ ots_get_error_message()

ots_result_t ots_get_error_message ( int32_t  error_code)

Get error message for specific error code.

Parameters
[in]error_codeError code to get message for
Returns
Result containing error message string

◆ ots_get_last_error()

ots_result_t ots_get_last_error ( void  )

Get error message for last error.

Returns
Result containing error message string

◆ ots_has_error()

bool ots_has_error ( const ots_result_t result)

Check if result contains an error.

Parameters
[in]resultResult to check
Returns
true if result contains an error

◆ ots_is_error()

bool ots_is_error ( const ots_result_t result)

Check if result contains an error.

Parameters
[in]resultResult to check
Returns
true if result contains an error

◆ ots_seed_indices_free()

void ots_seed_indices_free ( ots_seed_indices_t indices)

Free seed indices, securely wiping memory.

Parameters
[in,out]indicesIndices to free

◆ ots_version()

ots_result_t ots_version ( void  )

Get library version string.

Returns
Version string, must be freed with ots_free_string()

◆ ots_version_components()

ots_result_t ots_version_components ( void  )

Get version components [major, minor, patch].

Returns
Result containing version components array

◆ ots_wipeable_string_free()

void ots_wipeable_string_free ( ots_wipeable_string_t str)

Free a wipeable string, securely wiping memory.

Parameters
[in,out]strString to free