2023-11-07 00:11:12 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
#include <ArduinoJson.h>
|
2023-11-30 21:38:01 +00:00
|
|
|
#include <HTTPClient.h>
|
|
|
|
#include <esp_timer.h>
|
|
|
|
#include <esp_websocket_client.h>
|
2023-11-30 21:56:50 +00:00
|
|
|
|
|
|
|
#include <cstring>
|
2023-11-30 21:38:01 +00:00
|
|
|
#include <string>
|
2023-11-07 00:11:12 +00:00
|
|
|
|
2023-11-30 21:56:50 +00:00
|
|
|
#include "lib/led_handler.hpp"
|
|
|
|
#include "lib/screen_handler.hpp"
|
|
|
|
#include "lib/shared.hpp"
|
|
|
|
|
2023-11-30 21:38:01 +00:00
|
|
|
// using namespace websockets;
|
2023-11-07 00:11:12 +00:00
|
|
|
|
|
|
|
void setupBlockNotify();
|
|
|
|
|
2024-05-08 23:02:40 +00:00
|
|
|
void onWebsocketBlockEvent(void *handler_args, esp_event_base_t base,
|
2023-11-30 21:38:01 +00:00
|
|
|
int32_t event_id, void *event_data);
|
2024-05-08 23:02:40 +00:00
|
|
|
void onWebsocketBlockMessage(esp_websocket_event_data_t *event_data);
|
2023-11-07 00:11:12 +00:00
|
|
|
|
2023-11-12 11:38:28 +00:00
|
|
|
void setBlockHeight(uint newBlockHeight);
|
|
|
|
uint getBlockHeight();
|
2024-03-10 19:24:55 +00:00
|
|
|
|
|
|
|
void setBlockMedianFee(uint blockMedianFee);
|
|
|
|
uint getBlockMedianFee();
|
|
|
|
|
2023-11-08 11:18:59 +00:00
|
|
|
bool isBlockNotifyConnected();
|
2024-01-31 22:45:26 +00:00
|
|
|
void stopBlockNotify();
|
2024-04-16 13:17:34 +00:00
|
|
|
void restartBlockNotify();
|
|
|
|
|
2024-07-11 20:08:42 +00:00
|
|
|
void processNewBlock(uint newBlockHeight);
|
|
|
|
void processNewBlockFee(uint newBlockFee);
|
|
|
|
|
2024-03-30 10:40:58 +00:00
|
|
|
bool getBlockNotifyInit();
|
|
|
|
uint getLastBlockUpdate();
|
|
|
|
int getBlockFetch();
|
|
|
|
void setLastBlockUpdate(uint lastUpdate);
|