-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGeniusSDK.h
66 lines (55 loc) · 2.04 KB
/
GeniusSDK.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* @file GeniusSDK.h
* @brief New GeniusSDK node
* @date 2024-05-25
* @author Henrique A. Klein ([email protected])
*/
#ifndef _GENIUSSDK_H
#define _GENIUSSDK_H
#include <stdint.h>
#include <stdbool.h>
#ifndef GNUS_EXPORT_BEGIN
#if defined( __cplusplus )
#define GNUS_EXPORT_BEGIN \
extern "C" \
{
#define GNUS_EXPORT_END }
#else
#define GNUS_EXPORT_BEGIN
#define GNUS_EXPORT_END
#endif
#endif
#ifdef _WIN32
#define GNUS_VISIBILITY_DEFAULT __declspec( dllexport )
#else
#define GNUS_VISIBILITY_DEFAULT __attribute__( ( visibility( "default" ) ) )
#endif
GNUS_EXPORT_BEGIN
typedef struct
{
uint64_t size;
uint8_t *ptr;
} GeniusArray; ///< Struct to interop C++ vectors with C
typedef struct
{
uint64_t size;
GeniusArray *ptr;
} GeniusMatrix; ///< Struct to interop a matrix of C++ vectors in C
typedef struct
{
/// A string prepended with `0x` followed by 64 hex characters,
/// including a null-terminating char just for safety.
char address[2 + 256 / 4 + 1];
} GeniusAddress;
typedef char ImagePath_t[1024]; ///< ID/Path of the image to be processed
typedef uint64_t PayAmount_t; ///< Amount to be paid for the processing
GNUS_VISIBILITY_DEFAULT const char *GeniusSDKInit( const char *base_path, const char *eth_private_key );
GNUS_VISIBILITY_DEFAULT void GeniusSDKProcess( const ImagePath_t path, PayAmount_t amount );
GNUS_VISIBILITY_DEFAULT uint64_t GeniusSDKGetBalance();
GNUS_VISIBILITY_DEFAULT GeniusMatrix GeniusSDKGetTransactions();
GNUS_VISIBILITY_DEFAULT void GeniusSDKFreeTransactions( GeniusMatrix matrix );
GNUS_VISIBILITY_DEFAULT void GeniusSDKMintTokens( uint64_t amount );
GNUS_VISIBILITY_DEFAULT GeniusAddress GeniusSDKGetAddress();
GNUS_VISIBILITY_DEFAULT bool GeniusSDKTransferTokens( uint64_t amount, GeniusAddress *dest );
GNUS_EXPORT_END
#endif