upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/components/tollgate_core/include/tollgate_platform.h
blob: 79e25cf1843bb1ea70697cb439df24332a2ae578 (plain)
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
#ifndef TOLLGATE_PLATFORM_H
#define TOLLGATE_PLATFORM_H

#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    uint16_t     (*get_price_sats)(void);
    int32_t      (*get_step_ms)(void);
    const char * (*get_mint_url)(void);
    const char * (*get_metric)(void);
    int32_t      (*get_step_bytes)(void);
    int64_t      (*get_time_ms)(void);
    bool         (*spend_proofs)(const char *raw_token_json);

    const char * (*get_stratum_url)(void);
    uint16_t     (*get_stratum_port)(void);
    const char * (*get_stratum_user)(void);
    const char * (*get_stratum_pass)(void);
    const char * (*get_stratum_fallback_url)(void);
    uint16_t     (*get_stratum_fallback_port)(void);
    uint16_t     (*get_mining_port)(void);
    const char * (*get_mining_payout_mode)(void);
    uint64_t     (*get_hashprice_sats_per_ghs_day)(void);
    void         (*on_share_accepted)(double difficulty);
    double       (*get_hashrate)(void);
} tollgate_platform_t;

#ifdef __cplusplus
}
#endif

#endif