logos-execution-zone-module/src/logos_execution_zone_wallet_module.h

125 lines
4.5 KiB
C
Raw Normal View History

2026-02-04 16:27:47 +01:00
#ifndef LOGOS_EXECUTION_ZONE_WALLET_MODULE_H
#define LOGOS_EXECUTION_ZONE_WALLET_MODULE_H
2026-02-03 18:12:53 +01:00
#include "i_logos_execution_zone_wallet_module.h"
2026-02-04 15:51:02 +01:00
#include <QObject>
#include <QString>
#include <QVariantList>
class LogosExecutionZoneWalletModule : public QObject, public PluginInterface, public ILogosExecutionZoneWalletModule {
2026-02-03 18:12:53 +01:00
Q_OBJECT
2026-02-03 18:28:17 +01:00
Q_PLUGIN_METADATA(IID ILogosExecutionZoneWalletModule_iid FILE LOGOS_EXECUTION_ZONE_WALLET_MODULE_METADATA_FILE)
2026-02-04 15:51:02 +01:00
Q_INTERFACES(PluginInterface ILogosExecutionZoneWalletModule)
private:
LogosAPI* logosApi = nullptr;
2026-02-18 11:21:00 +00:00
WalletHandle* walletHandle = nullptr;
2026-02-03 18:12:53 +01:00
public:
2026-02-04 16:18:56 +01:00
LogosExecutionZoneWalletModule();
2026-02-03 18:12:53 +01:00
~LogosExecutionZoneWalletModule() override;
2026-02-04 15:51:02 +01:00
// === Plugin Interface ===
2026-02-03 18:12:53 +01:00
[[nodiscard]] QString name() const override;
[[nodiscard]] QString version() const override;
2026-02-04 15:51:02 +01:00
// === Logos Core ===
2026-02-04 16:18:56 +01:00
Q_INVOKABLE void initLogos(LogosAPI* logosApiInstance) override;
2026-02-04 15:51:02 +01:00
// === Logos Execution Zone Wallet ===
// Account Management
2026-02-18 22:18:10 +01:00
Q_INVOKABLE WalletFfiError create_account_public(QString& output_account_id_hex) override;
Q_INVOKABLE WalletFfiError create_account_private(QString& output_account_id_hex) override;
Q_INVOKABLE WalletFfiError list_accounts(QJsonArray& output_list) override;
2026-02-04 15:51:02 +01:00
// Account Queries
Q_INVOKABLE WalletFfiError get_balance(
const QString& account_id_hex,
2026-02-04 15:51:02 +01:00
bool is_public,
2026-02-18 22:18:10 +01:00
QString& output_balance_le16_hex
2026-02-04 15:51:02 +01:00
) override;
Q_INVOKABLE WalletFfiError
2026-02-18 22:18:10 +01:00
get_account_public(const QString& account_id_hex, QString& output_account_json) override;
2026-02-18 09:20:58 +00:00
Q_INVOKABLE WalletFfiError
2026-02-18 22:18:10 +01:00
get_account_private(const QString& account_id_hex, QString& output_account_json) override;
2026-02-04 15:51:02 +01:00
Q_INVOKABLE WalletFfiError get_public_account_key(
const QString& account_id_hex,
2026-02-18 22:18:10 +01:00
QString& output_public_key_hex
2026-02-04 15:51:02 +01:00
) override;
Q_INVOKABLE WalletFfiError get_private_account_keys(
const QString& account_id_hex,
2026-02-18 22:18:10 +01:00
QString& output_keys_json
2026-02-04 15:51:02 +01:00
) override;
// Account Encoding
Q_INVOKABLE QString account_id_to_base58(const QString& account_id_hex) override;
2026-02-18 22:18:10 +01:00
Q_INVOKABLE WalletFfiError account_id_from_base58(const QString& base58_str, QString& output_account_id_hex) override;
2026-02-04 15:51:02 +01:00
// Blockchain Synchronisation
2026-02-18 11:21:00 +00:00
Q_INVOKABLE WalletFfiError sync_to_block(uint64_t block_id) override;
2026-02-18 22:18:10 +01:00
Q_INVOKABLE WalletFfiError get_last_synced_block(uint64_t* output_block_id) override;
Q_INVOKABLE WalletFfiError get_current_block_height(uint64_t* output_block_height) override;
2026-02-04 15:51:02 +01:00
// Operations
Q_INVOKABLE WalletFfiError transfer_public(
const QString& from_hex,
const QString& to_hex,
const QString& amount_le16_hex,
2026-02-18 22:18:10 +01:00
QString& output_result_json
2026-02-04 15:51:02 +01:00
) override;
2026-02-18 09:20:58 +00:00
Q_INVOKABLE WalletFfiError transfer_shielded(
const QString& from_hex,
2026-02-18 22:10:38 +01:00
const QString& to_keys_json,
const QString& amount_le16_hex,
2026-02-18 22:18:10 +01:00
QString& output_result_json
2026-02-18 09:20:58 +00:00
) override;
Q_INVOKABLE WalletFfiError transfer_deshielded(
const QString& from_hex,
const QString& to_hex,
const QString& amount_le16_hex,
2026-02-18 22:18:10 +01:00
QString& output_result_json
2026-02-18 09:20:58 +00:00
) override;
Q_INVOKABLE WalletFfiError transfer_private(
const QString& from_hex,
2026-02-18 22:10:38 +01:00
const QString& to_keys_json,
const QString& amount_le16_hex,
2026-02-18 22:18:10 +01:00
QString& output_result_json
2026-02-18 09:20:58 +00:00
) override;
Q_INVOKABLE WalletFfiError transfer_shielded_owned(
const QString& from_hex,
const QString& to_hex,
const QString& amount_le16_hex,
2026-02-18 22:18:10 +01:00
QString& output_result_json
2026-02-18 09:20:58 +00:00
) override;
Q_INVOKABLE WalletFfiError transfer_private_owned(
const QString& from_hex,
const QString& to_hex,
const QString& amount_le16_hex,
2026-02-18 22:18:10 +01:00
QString& output_result_json
2026-02-18 09:20:58 +00:00
) override;
2026-02-04 15:51:02 +01:00
Q_INVOKABLE WalletFfiError
2026-02-18 22:18:10 +01:00
register_public_account(const QString& account_id_hex, QString& output_result_json) override;
2026-02-18 09:20:58 +00:00
Q_INVOKABLE WalletFfiError
2026-02-18 22:18:10 +01:00
register_private_account(const QString& account_id_hex, QString& output_result_json) override;
2026-02-04 15:51:02 +01:00
// Wallet Lifecycle
2026-02-18 11:21:00 +00:00
Q_INVOKABLE WalletFfiError create_new(
2026-02-04 15:51:02 +01:00
const QString& config_path,
const QString& storage_path,
const QString& password
) override;
2026-02-18 11:21:00 +00:00
Q_INVOKABLE WalletFfiError open(const QString& config_path, const QString& storage_path) override;
Q_INVOKABLE WalletFfiError save() override;
2026-02-04 15:51:02 +01:00
// Configuration
2026-02-18 11:21:00 +00:00
Q_INVOKABLE QString get_sequencer_addr() override;
2026-02-04 15:51:02 +01:00
signals:
void eventResponse(const QString& eventName, const QVariantList& data);
2026-02-03 18:12:53 +01:00
};
2026-02-04 15:51:02 +01:00
#endif