diff options
Diffstat (limited to 'main/lightning_payout.h')
| -rw-r--r-- | main/lightning_payout.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/main/lightning_payout.h b/main/lightning_payout.h new file mode 100644 index 0000000..d353902 --- /dev/null +++ b/main/lightning_payout.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #ifndef LIGHTNING_PAYOUT_H | ||
| 2 | #define LIGHTNING_PAYOUT_H | ||
| 3 | |||
| 4 | #include "esp_err.h" | ||
| 5 | #include <stdint.h> | ||
| 6 | #include <stdbool.h> | ||
| 7 | |||
| 8 | #define PAYOUT_MAX_RECIPIENTS 4 | ||
| 9 | #define PAYOUT_MAX_MINTS 3 | ||
| 10 | #define PAYOUT_MAX_ADDR_LEN 128 | ||
| 11 | |||
| 12 | typedef struct { | ||
| 13 | char lightning_address[PAYOUT_MAX_ADDR_LEN]; | ||
| 14 | double factor; | ||
| 15 | } payout_recipient_t; | ||
| 16 | |||
| 17 | typedef struct { | ||
| 18 | char url[256]; | ||
| 19 | uint64_t min_balance; | ||
| 20 | uint64_t min_payout_amount; | ||
| 21 | } payout_mint_config_t; | ||
| 22 | |||
| 23 | typedef struct { | ||
| 24 | bool enabled; | ||
| 25 | payout_mint_config_t mints[PAYOUT_MAX_MINTS]; | ||
| 26 | int mint_count; | ||
| 27 | payout_recipient_t recipients[PAYOUT_MAX_RECIPIENTS]; | ||
| 28 | int recipient_count; | ||
| 29 | uint64_t fee_tolerance_pct; | ||
| 30 | int check_interval_s; | ||
| 31 | } payout_config_t; | ||
| 32 | |||
| 33 | esp_err_t lightning_payout_init(const payout_config_t *config); | ||
| 34 | |||
| 35 | void lightning_payout_tick(void); | ||
| 36 | |||
| 37 | #endif | ||