2022-03-07 14:21:32 +01:00
|
|
|
#ifndef _SWAP_LIB_CALLS_H_
|
|
|
|
|
#define _SWAP_LIB_CALLS_H_
|
2020-06-29 15:43:02 +02:00
|
|
|
|
|
|
|
|
#include "stdbool.h"
|
|
|
|
|
|
|
|
|
|
#define RUN_APPLICATION 1
|
|
|
|
|
|
|
|
|
|
#define SIGN_TRANSACTION 2
|
|
|
|
|
|
|
|
|
|
#define CHECK_ADDRESS 3
|
|
|
|
|
|
|
|
|
|
#define GET_PRINTABLE_AMOUNT 4
|
|
|
|
|
|
2022-04-25 09:03:39 +02:00
|
|
|
#define MAX_PRINTABLE_AMOUNT_SIZE 50
|
|
|
|
|
|
2020-06-29 15:43:02 +02:00
|
|
|
// structure that should be send to specific coin application to get address
|
|
|
|
|
typedef struct check_address_parameters_s {
|
|
|
|
|
// IN
|
2022-04-25 09:03:39 +02:00
|
|
|
const unsigned char* const coin_configuration;
|
|
|
|
|
const unsigned char coin_configuration_length;
|
2020-10-07 16:56:40 +02:00
|
|
|
// serialized path, segwit, version prefix, hash used, dictionary etc.
|
2020-06-29 15:43:02 +02:00
|
|
|
// fields and serialization format depends on spesific coin app
|
2022-04-25 09:03:39 +02:00
|
|
|
const unsigned char* const address_parameters;
|
|
|
|
|
const unsigned char address_parameters_length;
|
|
|
|
|
const char* const address_to_check;
|
|
|
|
|
const char* const extra_id_to_check;
|
2020-06-29 15:43:02 +02:00
|
|
|
// OUT
|
|
|
|
|
int result;
|
|
|
|
|
} check_address_parameters_t;
|
|
|
|
|
|
|
|
|
|
// structure that should be send to specific coin application to get printable amount
|
|
|
|
|
typedef struct get_printable_amount_parameters_s {
|
|
|
|
|
// IN
|
2022-04-25 09:03:39 +02:00
|
|
|
const unsigned char* const coin_configuration;
|
|
|
|
|
const unsigned char coin_configuration_length;
|
|
|
|
|
const unsigned char* const amount;
|
|
|
|
|
const unsigned char amount_length;
|
|
|
|
|
const bool is_fee;
|
2020-06-29 15:43:02 +02:00
|
|
|
// OUT
|
2022-04-25 09:03:39 +02:00
|
|
|
char printable_amount[MAX_PRINTABLE_AMOUNT_SIZE];
|
2021-01-05 16:43:00 +01:00
|
|
|
// int result;
|
2020-06-29 15:43:02 +02:00
|
|
|
} get_printable_amount_parameters_t;
|
|
|
|
|
|
|
|
|
|
typedef struct create_transaction_parameters_s {
|
2022-04-25 09:03:39 +02:00
|
|
|
const unsigned char* const coin_configuration;
|
|
|
|
|
const unsigned char coin_configuration_length;
|
|
|
|
|
const unsigned char* const amount;
|
|
|
|
|
const unsigned char amount_length;
|
|
|
|
|
const unsigned char* const fee_amount;
|
|
|
|
|
const unsigned char fee_amount_length;
|
|
|
|
|
const char* const destination_address;
|
|
|
|
|
const char* const destination_address_extra_id;
|
2020-06-29 15:43:02 +02:00
|
|
|
} create_transaction_parameters_t;
|
|
|
|
|
|
2022-03-07 14:21:32 +01:00
|
|
|
#endif // _SWAP_LIB_CALLS_H_
|