-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathAPI_key_signature.h
41 lines (31 loc) · 990 Bytes
/
API_key_signature.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
#ifndef API_KEY_SIGNATURE_H
#define API_KEY_SIGNATURE_H
#include <stdbool.h>
// Maximum length for the API key
#define API_KEY_MAX_LENGTH 256
// Primary API URL
#define API_URL "https://api.primary.com/v1/broadcast"
// Retry limits
#define RETRY_LIMIT 3
// Function Declarations
/**
* Initializes the API key system with the provided API key.
* @param key The API key to initialize.
*/
void initializeApiKeySignature(const char* key);
/**
* Validates if the API key is properly initialized and valid.
* @return True if the API key is valid, false otherwise.
*/
bool isApiKeyValid();
/**
* Broadcasts a transaction using the configured API key.
* Implements PMLL (Primary Retry), ARLL (Alternate Retry), and EFLL (Error Flagging).
* @param rawTxHex The raw transaction hex to broadcast.
*/
void broadcastWithApiKey(const char* rawTxHex);
/**
* Cleans up the API key system by clearing the stored API key.
*/
void cleanupApiKeySignature();
#endif // API_KEY_SIGNATURE_H