40 lines
1.2 KiB
C
Raw Normal View History

2025-12-19 15:53:41 +01:00
#ifndef LOGOS_BLOCKCHAIN_MODULE_API_H
#define LOGOS_BLOCKCHAIN_MODULE_API_H
2025-12-17 10:55:13 +01:00
#include <core/interface.h>
2025-12-18 11:47:59 +01:00
2026-01-22 23:36:47 +01:00
#ifdef __cplusplus
extern "C" {
#endif
#include <lib_logos_blockchain.h>
#ifdef __cplusplus
}
#endif
2025-12-19 15:53:41 +01:00
class LogosBlockchainModuleAPI : public QObject, public PluginInterface {
Q_OBJECT
2025-12-19 17:31:26 +01:00
Q_INTERFACES(PluginInterface)
2025-12-19 15:53:41 +01:00
2025-12-17 10:55:13 +01:00
public:
2025-12-19 15:53:41 +01:00
using QObject::QObject;
~LogosBlockchainModuleAPI() override = default;
2025-12-17 10:55:13 +01:00
2026-01-22 23:36:47 +01:00
// Logos Core
2025-12-19 15:53:41 +01:00
Q_INVOKABLE virtual void initLogos(LogosAPI* logosAPIInstance) = 0;
2025-12-17 10:55:13 +01:00
2026-01-22 23:36:47 +01:00
// Node
Q_INVOKABLE virtual int start(const QString& config_path) = 0;
Q_INVOKABLE virtual int stop() = 0;
Q_INVOKABLE virtual int subscribe() = 0;
Q_INVOKABLE virtual int wallet_get_balance(const uint8_t* wallet_address, const HeaderId* optional_tip, BalanceResult* output_balance) = 0;
Q_INVOKABLE virtual int wallet_transfer_funds(const TransferFundsArguments* transfer_funds_arguments, Hash* output_hash) = 0;
2025-12-17 10:55:13 +01:00
signals:
2025-12-19 15:53:41 +01:00
void eventResponse(const QString& eventName, const QVariantList& data);
2025-12-17 10:55:13 +01:00
};
2025-12-19 15:53:41 +01:00
2025-12-17 10:55:13 +01:00
#define LogosBlockchainModuleInterface_iid "org.logos.blockchaininterface"
Q_DECLARE_INTERFACE(LogosBlockchainModuleAPI, LogosBlockchainModuleInterface_iid)
2025-12-19 15:53:41 +01:00
#endif