#ifndef wallet_ffi_h
#define wallet_ffi_h
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdbool.h>
struct ByteVector;
struct TariCommsConfig;
struct TariPrivateKey;
struct TariWallet;
struct TariWalletConfig;
struct TariPublicKey;
struct TariContacts;
struct TariContact;
struct TariCompletedTransactions;
struct TariCompletedTransaction;
struct TariPendingOutboundTransactions;
struct TariPendingOutboundTransaction;
struct TariPendingInboundTransactions;
struct TariPendingInboundTransaction;
struct TariTransportType;
struct TariSeedWords;
struct EmojiSet;
struct TariTransportType *transport_memory_create();
struct TariTransportType *transport_tcp_create(const char *listener_address,int* error_out);
struct TariTransportType *transport_tor_create(
const char *control_server_address,
struct ByteVector *tor_cookie,
struct ByteVector *tor_identity,
unsigned short tor_port,
const char *socks_username,
const char *socks_password,
int* error_out);
struct ByteVector *wallet_get_tor_identity(struct TariWallet *wallet,int* error_out );
char *transport_memory_get_address(struct TariTransportType *transport,int* error_out);
void transport_type_destroy(struct TariTransportType *transport);
void string_destroy(char *s);
struct ByteVector *byte_vector_create(const unsigned char *byte_array, unsigned int element_count, int* error_out);
unsigned char byte_vector_get_at(struct ByteVector *ptr, unsigned int i, int* error_out);
unsigned int byte_vector_get_length(const struct ByteVector *vec, int* error_out);
void byte_vector_destroy(struct ByteVector *bytes);
struct TariPublicKey *public_key_create(struct ByteVector *bytes,int* error_out);
struct ByteVector *public_key_get_bytes(struct TariPublicKey *public_key,int* error_out);
struct TariPublicKey *public_key_from_private_key(struct TariPrivateKey *secret_key,int* error_out);
struct TariPublicKey *public_key_from_hex(const char *hex,int* error_out);
void public_key_destroy(struct TariPublicKey *pk);
char *public_key_to_emoji_id(struct TariPublicKey *pk, int* error_out);
struct TariPublicKey *emoji_id_to_public_key(const char *emoji, int* error_out);
struct TariPrivateKey *private_key_create(struct ByteVector *bytes,int* error_out);
struct TariPrivateKey *private_key_generate(void);
struct ByteVector *private_key_get_bytes(struct TariPrivateKey *private_key,int* error_out);
struct TariPrivateKey *private_key_from_hex(const char *hex,int* error_out);
void private_key_destroy(struct TariPrivateKey *pk);
unsigned int seed_words_get_length(struct TariSeedWords *seed_words, int* error_out);
char *seed_words_get_at(struct TariSeedWords *seed_words, unsigned int position, int* error_out);
void seed_words_destroy(struct TariSeedWords *seed_words);
struct TariContact *contact_create(const char *alias, struct TariPublicKey *public_key,int* error_out);
char *contact_get_alias(struct TariContact *contact,int* error_out);
struct TariPublicKey *contact_get_public_key(struct TariContact *contact,int* error_out);
void contact_destroy(struct TariContact *contact);
unsigned int contacts_get_length(struct TariContacts *contacts,int* error_out);
struct TariContact *contacts_get_at(struct TariContacts *contacts, unsigned int position,int* error_out);
void contacts_destroy(struct TariContacts *contacts);
struct TariPublicKey *completed_transaction_get_destination_public_key(struct TariCompletedTransaction *transaction,int* error_out);
struct TariPublicKey *completed_transaction_get_source_public_key(struct TariCompletedTransaction *transaction,int* error_out);
unsigned long long completed_transaction_get_amount(struct TariCompletedTransaction *transaction,int* error_out);
unsigned long long completed_transaction_get_fee(struct TariCompletedTransaction *transaction,int* error_out);
const char *completed_transaction_get_message(struct TariCompletedTransaction *transaction,int* error_out);
int completed_transaction_get_status(struct TariCompletedTransaction *transaction,int* error_out);
unsigned long long completed_transaction_get_transaction_id(struct TariCompletedTransaction *transaction,int* error_out);
unsigned long long completed_transaction_get_timestamp(struct TariCompletedTransaction *transaction,int* error_out);
bool completed_transaction_is_outbound(struct TariCompletedTransaction *tx,int* error_out);
void completed_transaction_destroy(struct TariCompletedTransaction *transaction);
unsigned int completed_transactions_get_length(struct TariCompletedTransactions *transactions,int* error_out);
struct TariCompletedTransaction *completed_transactions_get_at(struct TariCompletedTransactions *transactions, unsigned int position,int* error_out);
void completed_transactions_destroy(struct TariCompletedTransactions *transactions);
unsigned long long pending_outbound_transaction_get_transaction_id(struct TariPendingOutboundTransaction *transaction,int* error_out);
struct TariPublicKey *pending_outbound_transaction_get_destination_public_key(struct TariPendingOutboundTransaction *transaction,int* error_out);
unsigned long long pending_outbound_transaction_get_amount(struct TariPendingOutboundTransaction *transaction,int* error_out);
unsigned long long pending_outbound_transaction_get_fee(struct TariPendingOutboundTransaction *transaction,int* error_out);
const char *pending_outbound_transaction_get_message(struct TariPendingOutboundTransaction *transaction,int* error_out);
unsigned long long pending_outbound_transaction_get_timestamp(struct TariPendingOutboundTransaction *transaction,int* error_out);
int pending_outbound_transaction_get_status(struct TariPendingOutboundTransaction *transaction,int* error_out);
void pending_outbound_transaction_destroy(struct TariPendingOutboundTransaction *transaction);
unsigned int pending_outbound_transactions_get_length(struct TariPendingOutboundTransactions *transactions,int* error_out);
struct TariPendingOutboundTransaction *pending_outbound_transactions_get_at(struct TariPendingOutboundTransactions *transactions, unsigned int position,int* error_out);
void pending_outbound_transactions_destroy(struct TariPendingOutboundTransactions *transactions);
unsigned long long pending_inbound_transaction_get_transaction_id(struct TariPendingInboundTransaction *transaction,int* error_out);
struct TariPublicKey *pending_inbound_transaction_get_source_public_key(struct TariPendingInboundTransaction *transaction,int* error_out);
const char *pending_inbound_transaction_get_message(struct TariPendingInboundTransaction *transaction,int* error_out);
unsigned long long pending_inbound_transaction_get_amount(struct TariPendingInboundTransaction *transaction,int* error_out);
unsigned long long pending_inbound_transaction_get_timestamp(struct TariPendingInboundTransaction *transaction,int* error_out);
int pending_inbound_transaction_get_status(struct TariPendingInboundTransaction *transaction,int* error_out);
void pending_inbound_transaction_destroy(struct TariPendingInboundTransaction *transaction);
unsigned int pending_inbound_transactions_get_length(struct TariPendingInboundTransactions *transactions,int* error_out);
struct TariPendingInboundTransaction *pending_inbound_transactions_get_at(struct TariPendingInboundTransactions *transactions, unsigned int position,int* error_out);
void pending_inbound_transactions_destroy(struct TariPendingInboundTransactions *transactions);
struct TariCommsConfig *comms_config_create(const char *public_address,
struct TariTransportType *transport,
const char *database_name,
const char *datastore_path,
unsigned long long discovery_timeout_in_secs,
int* error_out);
void comms_config_set_secret_key(struct TariCommsConfig *comms_config, struct TariPrivateKey *secret_key, int* error_out);
void comms_config_destroy(struct TariCommsConfig *wc);
struct TariWallet *wallet_create(struct TariWalletConfig *config,
const char *log_path,
unsigned int num_rolling_log_files,
unsigned int size_per_log_file_bytes,
const char *passphrase,
void (*callback_received_transaction)(struct TariPendingInboundTransaction*),
void (*callback_received_transaction_reply)(struct TariCompletedTransaction*),
void (*callback_received_finalized_transaction)(struct TariCompletedTransaction*),
void (*callback_transaction_broadcast)(struct TariCompletedTransaction*),
void (*callback_transaction_mined)(struct TariCompletedTransaction*),
void (*callback_direct_send_result)(unsigned long long, bool),
void (*callback_store_and_forward_send_result)(unsigned long long, bool),
void (*callback_transaction_cancellation)(struct TariCompletedTransaction*),
void (*callback_base_node_sync_complete)(unsigned long long, bool),
int* error_out);
char* wallet_sign_message(struct TariWallet *wallet, const char* msg, int* error_out);
bool wallet_verify_message_signature(struct TariWallet *wallet, struct TariPublicKey *public_key, const char* hex_sig_nonce, const char* msg, int* error_out);
bool wallet_test_generate_data(struct TariWallet *wallet, const char *datastore_path,int* error_out);
bool wallet_add_base_node_peer(struct TariWallet *wallet, struct TariPublicKey *public_key, const char *address,int* error_out);
bool wallet_upsert_contact(struct TariWallet *wallet, struct TariContact *contact,int* error_out);
bool wallet_remove_contact(struct TariWallet *wallet, struct TariContact *contact,int* error_out);
unsigned long long wallet_get_available_balance(struct TariWallet *wallet,int* error_out);
unsigned long long wallet_get_pending_incoming_balance(struct TariWallet *wallet,int* error_out);
unsigned long long wallet_get_pending_outgoing_balance(struct TariWallet *wallet,int* error_out);
unsigned long long wallet_send_transaction(struct TariWallet *wallet, struct TariPublicKey *destination, unsigned long long amount, unsigned long long fee_per_gram,const char *message,int* error_out);
struct TariContacts *wallet_get_contacts(struct TariWallet *wallet,int* error_out);
struct TariCompletedTransactions *wallet_get_completed_transactions(struct TariWallet *wallet,int* error_out);
struct TariPendingOutboundTransactions *wallet_get_pending_outbound_transactions(struct TariWallet *wallet,int* error_out);
struct TariPublicKey *wallet_get_public_key(struct TariWallet *wallet,int* error_out);
struct TariPendingInboundTransactions *wallet_get_pending_inbound_transactions(struct TariWallet *wallet,int* error_out);
struct TariCompletedTransactions *wallet_get_cancelled_transactions(struct TariWallet *wallet,int* error_out);
struct TariCompletedTransaction *wallet_get_completed_transaction_by_id(struct TariWallet *wallet, unsigned long long transaction_id,int* error_out);
struct TariPendingOutboundTransaction *wallet_get_pending_outbound_transaction_by_id(struct TariWallet *wallet, unsigned long long transaction_id,int* error_out);
struct TariPendingInboundTransaction *wallet_get_pending_inbound_transaction_by_id(struct TariWallet *wallet, unsigned long long transaction_id,int* error_out);
struct TariCompletedTransaction *wallet_get_cancelled_transaction_by_id(struct TariWallet *wallet, unsigned long long transaction_id, int* error_out);
bool wallet_test_complete_sent_transaction(struct TariWallet *wallet, struct TariPendingOutboundTransaction *tx,int* error_out);
unsigned long long wallet_import_utxo(struct TariWallet *wallet, unsigned long long amount, struct TariPrivateKey *spending_key, struct TariPublicKey *source_public_key, const char *message, int* error_out);
unsigned long long wallet_sync_with_base_node(struct TariWallet *wallet, int* error_out);
void wallet_set_low_power_mode(struct TariWallet *wallet, int* error_out);
void wallet_set_normal_power_mode(struct TariWallet *wallet, int* error_out);
bool wallet_test_broadcast_transaction(struct TariWallet *wallet, unsigned long long tx, int* error_out);
bool wallet_test_finalize_received_transaction(struct TariWallet *wallet, struct TariPendingInboundTransaction *tx, int* error_out);
bool wallet_test_mine_transaction(struct TariWallet *wallet, unsigned long long tx, int* error_out);
bool wallet_test_receive_transaction(struct TariWallet *wallet,int* error_out);
bool wallet_cancel_pending_transaction(struct TariWallet *wallet, unsigned long long transaction_id, int* error_out);
unsigned long long wallet_coin_split(struct TariWallet *wallet, unsigned long long amount, unsigned long long count, unsigned long long fee, const char* msg, unsigned long long lock_height, int* error_out);
struct TariSeedWords *wallet_get_seed_words(struct TariWallet *wallet, int* error_out);
void wallet_apply_encryption(struct TariWallet *wallet, const char *passphrase, int* error_out);
void wallet_remove_encryption(struct TariWallet *wallet, int* error_out);
void wallet_destroy(struct TariWallet *wallet);
void file_partial_backup(const char *original_file_path, const char *backup_file_path, int* error_out);
void log_debug_message(const char* msg);
struct EmojiSet *get_emoji_set(void);
void emoji_set_destroy(struct EmojiSet *emoji_set);
struct ByteVector *emoji_set_get_at(struct EmojiSet *emoji_set, unsigned int position, int* error_out);
unsigned int emoji_set_get_length(struct EmojiSet *emoji_set, int* error_out);
#ifdef __cplusplus
}
#endif
#endif