26#define OTS_MAX_ERROR_MESSAGE 256
28#define OTS_MAX_ERROR_LOCATION 64
30#define OTS_MAX_VERSION_STRING 32
33#define OTS_MONERO_SEED_WORDS 25
34#define OTS_POLYSEED_WORDS 16
35#define OTS_LEGACY_SEED_WORDS 13
135 return h.
type == expected && h.
ptr != NULL;
285 const char* language_code,
369 const char* password,
479 const uint8_t random[32],
513 const char* passphrase
531 const char* passphrase
548 const uint8_t random[19],
551 const char* passphrase
564 const char* passphrase
579 const char* password,
580 const char* passphrase
595 const char* password,
596 const char* passphrase
611 const char* language_code,
613 const char* password,
614 const char* passphrase
706 const char* address_string
795 const uint8_t key[32],
855 uint32_t max_account_depth,
856 uint32_t max_index_depth
870 uint32_t max_account_depth,
871 uint32_t max_index_depth
886 uint32_t max_account_depth,
887 uint32_t max_index_depth
902 uint32_t max_account_depth,
903 uint32_t max_index_depth
978 const char* unsigned_tx
990 const char* unsigned_tx
1039 const char* signature,
1040 bool legacy_fallback
1058 const char* signature,
1059 bool legacy_fallback
1076 const char* signature,
1077 bool legacy_fallback
1133 const uint8_t* data,
Error codes for the C ABI.
ots_result_t ots_wallet_accounts(ots_handle_t wallet_handle, uint32_t max, uint32_t offset)
Get list of accounts in wallet.
ots_result_t ots_address_is_integrated(ots_handle_t address)
Check if address is an integrated address.
void ots_reset_max_depth(void)
Reset maximum depths to defaults.
ots_result_t ots_get_last_error(void)
Get error message for last error.
Definition ots-abi.cpp:56
ots_result_t ots_wallet_secret_view_key(ots_handle_t wallet_handle)
Get secret view key.
void ots_error_init(ots_error_t *error)
Initialize error structure.
Definition ots-abi.cpp:41
ots_result_t ots_monero_seed_decode(const char *phrase, uint64_t height, uint64_t time, OTS_NETWORK network, const char *passphrase)
Decode a Monero seed from phrase.
ots_result_t ots_address_create(const char *address)
Create address object from string.
ots_result_t ots_polyseed_generate(OTS_NETWORK network, uint64_t time, const char *passphrase)
Generate a new Polyseed.
ots_result_t ots_seed_timestamp(ots_handle_t handle)
Get seed creation timestamp.
ots_result_t ots_wallet_sign_transaction(ots_handle_t wallet_handle, const char *unsigned_tx)
Sign unsigned transaction.
ots_result_t ots_address_string_type(const char *address)
Get type for an address string.
void ots_free_handle(ots_handle_t handle)
Free a handle.
Definition ots-abi.cpp:80
ots_result_t ots_version(void)
Get library version string.
Definition ots-abi.cpp:106
void ots_wipeable_string_clear(ots_wipeable_string_t *str)
Clear wipeable string content.
ots_result_t ots_seed_merge_multiple_values_and_zero(ots_seed_indices_t *values[], size_t count, bool delete_after)
Merge multiple sets of seed values and zero.
void ots_secure_free(void *buffer, size_t size)
Securely wipe and free a buffer.
ots_result_t ots_seed_network(ots_handle_t handle)
Get seed network type.
ots_result_t ots_wallet_public_spend_key(ots_handle_t wallet_handle)
Get public spend key.
void ots_set_max_account_depth(uint32_t depth)
Set maximum account depth for searching.
ots_result_t ots_verify_data(const char *data, const char *address, const char *signature)
Verify signed data.
ots_result_t ots_monero_seed_generate(uint64_t height, uint64_t time, OTS_NETWORK network)
Generate a new Monero seed.
ots_result_t ots_wallet_verify_data_with_address(ots_handle_t wallet_handle, const char *data, ots_handle_t address_handle, const char *signature, bool legacy_fallback)
Verify signed data with specific address.
void ots_wipeable_string_free(ots_wipeable_string_t *str)
Free a wipeable string, securely wiping memory.
Definition ots-abi.cpp:86
ots_result_t ots_polyseed_decode_indices(const ots_seed_indices_t *indices, OTS_NETWORK network, const char *password, const char *passphrase)
Decode a Polyseed from indices.
void ots_address_free(ots_handle_t handle)
Free address handle.
static bool ots_handle_valid(ots_handle_t h, ots_handle_type expected)
Validate handle type.
Definition ots.h:134
ots_result_t ots_wallet_sign_data_with_address(ots_handle_t wallet_handle, const char *data, ots_handle_t address_handle)
Sign data with specific address.
ots_result_t ots_address_string_valid(const char *address, OTS_NETWORK network)
Validate a Monero address.
ots_result_t ots_address_string_integrated(const char *address)
Get base address from integrated address string.
ots_result_t ots_check_entropy(const uint8_t *data, size_t size, double min_entropy)
Check data entropy level.
ots_result_t ots_wallet_secret_spend_key(ots_handle_t wallet_handle)
Get secret spend key.
ots_result_t ots_wallet_export_key_images(ots_handle_t wallet_handle)
Export key images.
ots_result_t ots_wallet_check_tx_string(ots_handle_t wallet_handle, const char *unsigned_tx)
Check transaction string for warnings.
ots_result_t ots_wipeable_string_compare(const ots_wipeable_string_t *str1, const ots_wipeable_string_t *str2)
Compare two wipeable strings.
ots_result_t ots_random_bytes(uint8_t *buffer, size_t size)
Generate random bytes.
ots_result_t ots_wallet_describe_tx(ots_handle_t wallet_handle, const char *unsigned_tx)
Describe unsigned transaction.
void ots_free_tx_description(ots_tx_description_t *desc)
Free transaction description.
Definition ots-abi.cpp:101
ots_result_t ots_wallet_verify_data(const char *data, const char *signature, bool legacy_fallback)
Verify signed data for the wallet address with legacy support.
void ots_free_array(void *arr)
Free an array allocated by the library.
Definition ots-abi.cpp:76
ots_result_t ots_address_string_is_integrated(const char *address)
Check if address string is integrated.
ots_result_t ots_wallet_height(ots_handle_t wallet_handle)
Get wallet restore height.
ots_result_t ots_monero_seed_decode_indices(const ots_seed_indices_t *indices, uint64_t height, uint64_t time, OTS_NETWORK network, const char *passphrase)
Decode a Monero seed from indices.
#define OTS_MAX_ERROR_LOCATION
Maximum length for error location strings.
Definition ots.h:28
ots_result_t ots_seed_merge_values_and_zero(ots_seed_indices_t *values1, ots_seed_indices_t *values2, bool delete_after)
Merge and zero two sets of seed values.
ots_result_t ots_wallet_check_tx(ots_handle_t wallet_handle, ots_handle_t unsigned_tx_handle)
Check transaction for warnings.
ots_result_t ots_address_string_fingerprint(const char *address)
Generate fingerprint for an address string.
ots_result_t ots_seed_languages(OTS_SEED_TYPE type)
Get supported languages for seed type.
ots_result_t ots_seed_fingerprint(ots_handle_t handle)
Get seed fingerprint.
ots_result_t ots_address_base58_string(ots_handle_t address_handle)
Get base58 string representation of address.
ots_result_t ots_seed_wallet(ots_handle_t handle)
Get wallet from seed.
ots_result_t ots_seed_merge_multiple_values(const ots_seed_indices_t *values[], size_t count)
Merge multiple sets of seed values.
OTS_ADDRESS_TYPE
Address types matching ots::AddressType.
Definition ots.h:53
@ OTS_ADDRESS_TYPE_STANDARD
Definition ots.h:54
@ OTS_ADDRESS_TYPE_SUBADDRESS
Definition ots.h:55
@ OTS_ADDRESS_TYPE_INTEGRATED
Definition ots.h:56
ots_result_t ots_legacy_seed_decode_indices(const ots_seed_indices_t *indices, uint64_t height, uint64_t time, OTS_NETWORK network)
Decode a legacy seed from indices.
ots_result_t ots_wallet_import_outputs(ots_handle_t wallet_handle, const char *outputs)
Import outputs from string.
ots_result_t ots_address_length(ots_handle_t address)
Get address length.
void ots_clear_error(void)
Clear last error state.
Definition ots-abi.cpp:68
void ots_seed_indices_free(ots_seed_indices_t *indices)
Free seed indices, securely wiping memory.
Definition ots-abi.cpp:94
ots_result_t ots_seed_height(ots_handle_t handle)
Get seed blockchain height.
ots_result_t ots_address_equal(ots_handle_t address1, ots_handle_t address2)
Compare two addresses for equality.
ots_result_t ots_wallet_create(const uint8_t key[32], uint64_t height, OTS_NETWORK network)
Create wallet from secret key.
ots_result_t ots_timestamp_from_height(uint64_t height, OTS_NETWORK network)
Convert block height to estimated timestamp.
void ots_set_max_depth(uint32_t account_depth, uint32_t index_depth)
Set maximum depths for searching.
ots_result_t ots_address_network(ots_handle_t address)
Get network type for an address.
ots_result_t ots_legacy_seed_decode(const char *phrase, uint64_t height, uint64_t time, OTS_NETWORK network)
Decode a legacy (13 word) seed from phrase.
ots_result_t ots_random_32(void)
Generate 32 random bytes.
#define OTS_MAX_ERROR_MESSAGE
Maximum length for error messages.
Definition ots.h:26
bool ots_is_error(const ots_result_t *result)
Check if result contains an error.
Definition ots-abi.cpp:48
ots_result_t ots_polyseed_create(const uint8_t random[19], OTS_NETWORK network, uint64_t time, const char *passphrase)
Create a Polyseed from random data.
void ots_free_string(char *str)
Free a string allocated by the library.
Definition ots-abi.cpp:72
ots_handle_type
Types of handles for type safety.
Definition ots.h:70
@ OTS_HANDLE_SEED
Definition ots.h:72
@ OTS_HANDLE_INVALID
Definition ots.h:71
@ OTS_HANDLE_WALLET
Definition ots.h:73
@ OTS_HANDLE_TX
Definition ots.h:74
ots_result_t ots_address_fingerprint(ots_handle_t address)
Generate fingerprint for an address.
ots_result_t ots_wipeable_string_create(const char *str)
Create a new wipeable string.
ots_result_t ots_polyseed_decode(const char *phrase, OTS_NETWORK network, const char *password, const char *passphrase)
Decode a Polyseed from phrase.
OTS_NETWORK
Network types matching ots::Network.
Definition ots.h:44
@ OTS_NETWORK_STAGE
Definition ots.h:47
@ OTS_NETWORK_MAIN
Definition ots.h:45
@ OTS_NETWORK_TEST
Definition ots.h:46
ots_result_t ots_wallet_sign_data(ots_handle_t wallet_handle, const char *data)
Sign arbitrary data.
OTS_SEED_TYPE
Seed types matching ots::SeedType.
Definition ots.h:62
@ OTS_SEED_TYPE_MONERO
Definition ots.h:63
@ OTS_SEED_TYPE_POLYSEED
Definition ots.h:64
ots_result_t ots_wallet_address_index(ots_handle_t wallet_handle, const char *address, uint32_t max_account_depth, uint32_t max_index_depth)
Get account and index for address in wallet.
ots_result_t ots_wallet_public_view_key(ots_handle_t wallet_handle)
Get public view key.
ots_result_t ots_wallet_address(ots_handle_t wallet_handle, uint32_t account, uint32_t index)
Generate address for wallet.
ots_result_t ots_seed_merge_with_password(const char *password, const ots_seed_indices_t *values)
Merge seed values with password.
ots_result_t ots_get_error_message(int32_t error_code)
Get error message for specific error code.
Definition ots-abi.cpp:62
ots_result_t ots_wallet_address_index_handle(ots_handle_t wallet_handle, ots_handle_t address_handle, uint32_t max_account_depth, uint32_t max_index_depth)
Get account and index for address handle in wallet.
ots_result_t ots_address_string_network(const char *address)
Get network type for an address string.
uint32_t ots_max_index_depth(uint32_t depth)
Get maximum index depth.
ots_result_t ots_address_from_integrated(ots_handle_t address)
Get base address from integrated address.
ots_result_t ots_address_string_payment_id(const char *address)
Extract payment ID from integrated address string.
uint32_t ots_max_account_depth(uint32_t depth)
Get maximum account depth.
ots_result_t ots_wallet_verify_data_with_index(ots_handle_t wallet_handle, const char *data, uint32_t account, uint32_t subaddr, const char *signature, bool legacy_fallback)
Verify signed data with specific subaddress.
ots_result_t ots_polyseed_decode_with_language(const char *phrase, const char *language_code, OTS_NETWORK network, const char *password, const char *passphrase)
Decode a Polyseed from phrase with specific language.
ots_result_t ots_seed_address(ots_handle_t handle)
Get seed address.
bool ots_has_error(const ots_result_t *result)
Check if result contains an error.
Definition ots-abi.cpp:52
ots_result_t ots_height_from_timestamp(uint64_t timestamp, OTS_NETWORK network)
Convert timestamp to estimated block height.
ots_result_t ots_wallet_sign_data_with_index(ots_handle_t wallet_handle, const char *data, uint32_t account, uint32_t subaddr)
Sign data with specific subaddress.
ots_result_t ots_address_equal_string(ots_handle_t address_handle, const char *address_string)
Compare address handle with string.
ots_result_t ots_monero_seed_create(const uint8_t random[32], uint64_t height, uint64_t time, OTS_NETWORK network)
Create a Monero seed from random data.
ots_result_t ots_address_type(ots_handle_t address)
Get address type.
void ots_set_max_index_depth(uint32_t depth)
Set maximum index depth for searching.
ots_result_t ots_seed_indices_create(size_t size)
Create seed indices container.
ots_result_t ots_version_components(void)
Get version components [major, minor, patch].
Definition ots-abi.cpp:118
ots_result_t ots_seed_merge_values_with_password_and_zero(char *password, ots_seed_indices_t *values, bool delete_after)
Merge seed values with password and zero.
ots_result_t ots_seed_phrase(ots_handle_t handle, const char *language_code, const char *password)
Get seed phrase in specified language.
ots_result_t ots_wallet_has_address_handle(ots_handle_t wallet_handle, ots_handle_t address_handle, uint32_t max_account_depth, uint32_t max_index_depth)
Check if address belongs to wallet using Address handle.
ots_result_t ots_seed_indices(ots_handle_t handle, const char *password)
Get seed indices.
void ots_seed_indices_clear(ots_seed_indices_t *indices)
Clear seed indices content.
ots_result_t ots_wallet_subaddresses(ots_handle_t wallet_handle, uint32_t account, uint32_t max, uint32_t offset)
Get list of subaddresses for an account.
ots_result_t ots_wallet_has_address(ots_handle_t wallet_handle, const char *address, uint32_t max_account_depth, uint32_t max_index_depth)
Check if address belongs to wallet.
ots_result_t ots_address_payment_id(ots_handle_t address)
Extract payment ID from integrated address.
void ots_set_enforce_entropy(bool enforce)
Set entropy enforcement.
ots_result_t ots_seed_merge_values(const ots_seed_indices_t *values1, const ots_seed_indices_t *values2)
Merge two sets of seed values.
Error structure for exception handling.
Definition ots.h:87
int32_t code
Definition ots.h:88
Handle structure for C objects.
Definition ots.h:80
uint32_t version
Definition ots.h:82
void * ptr
Definition ots.h:83
ots_handle_type type
Definition ots.h:81
Result structure combining handle and error.
Definition ots.h:94
void * ptr
Definition ots.h:97
ots_handle_t handle
Definition ots.h:96
bool boolean
Definition ots.h:98
ots_error_t error
Definition ots.h:101
int64_t number
Definition ots.h:99
Seed indices container.
Definition ots.h:111
size_t count
Definition ots.h:113
uint16_t * indices
Definition ots.h:112
Transaction description.
Definition ots.h:117
uint64_t fee
Definition ots.h:120
char * destination
Definition ots.h:121
char * description
Definition ots.h:118
uint32_t unlock_time
Definition ots.h:122
uint64_t amount
Definition ots.h:119
Transaction warning.
Definition ots.h:126
char * message
Definition ots.h:127
uint32_t severity
Definition ots.h:128
Wipeable string for sensitive data.
Definition ots.h:105
char * data
Definition ots.h:106
size_t length
Definition ots.h:107