Files
app-ethereum/src/swap_lib_calls.h

54 lines
1.5 KiB
C
Raw Normal View History

2020-06-29 15:43:02 +02:00
#ifndef SWAP_LIB_CALLS
#define SWAP_LIB_CALLS
#include "stdbool.h"
#define RUN_APPLICATION 1
#define SIGN_TRANSACTION 2
#define CHECK_ADDRESS 3
#define GET_PRINTABLE_AMOUNT 4
// structure that should be send to specific coin application to get address
typedef struct check_address_parameters_s {
// IN
unsigned char* coin_configuration;
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
2020-10-07 16:56:40 +02:00
unsigned char* address_parameters;
2020-06-29 15:43:02 +02:00
unsigned char address_parameters_length;
2020-12-01 16:20:13 +01:00
char* address_to_check;
char* 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
unsigned char* coin_configuration;
unsigned char coin_configuration_length;
2020-10-07 16:56:40 +02:00
unsigned char* amount;
2020-06-29 15:43:02 +02:00
unsigned char amount_length;
bool is_fee;
// OUT
char printable_amount[30];
int result;
2020-06-29 15:43:02 +02:00
} get_printable_amount_parameters_t;
typedef struct create_transaction_parameters_s {
unsigned char* coin_configuration;
unsigned char coin_configuration_length;
2020-10-07 16:56:40 +02:00
unsigned char* amount;
2020-06-29 15:43:02 +02:00
unsigned char amount_length;
2020-10-07 16:56:40 +02:00
unsigned char* fee_amount;
2020-06-29 15:43:02 +02:00
unsigned char fee_amount_length;
2020-12-01 16:20:13 +01:00
char* destination_address;
char* destination_address_extra_id;
2020-06-29 15:43:02 +02:00
} create_transaction_parameters_t;
#endif