mirror of
https://github.com/logos-blockchain/logos-execution-zone-module.git
synced 2026-02-13 13:03:07 +00:00
100 lines
3.4 KiB
C++
100 lines
3.4 KiB
C++
#ifndef I_LOGOS_EXECUTION_ZONE_WALLET_MODULE_API_H
|
|
#define I_LOGOS_EXECUTION_ZONE_WALLET_MODULE_API_H
|
|
|
|
#include <core/interface.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#include <wallet_ffi.h>
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
class ILogosExecutionZoneWalletModule {
|
|
public:
|
|
virtual ~ILogosExecutionZoneWalletModule() = default;
|
|
|
|
// === Logos Core ===
|
|
|
|
virtual void initLogos(LogosAPI* logosAPIInstance) = 0;
|
|
|
|
// === Logos Execution Zone Wallet ===
|
|
|
|
// Account Management
|
|
virtual WalletFfiError create_account_public(WalletHandle* handle, FfiBytes32* out_account_id) = 0;
|
|
virtual WalletFfiError create_account_private(WalletHandle* handle, FfiBytes32* out_account_id) = 0;
|
|
virtual WalletFfiError list_accounts(WalletHandle* handle, FfiAccountList* out_list) = 0;
|
|
virtual void free_account_list(FfiAccountList* list) = 0;
|
|
|
|
// Account Queries
|
|
virtual WalletFfiError get_balance(
|
|
WalletHandle* handle,
|
|
const FfiBytes32* account_id,
|
|
bool is_public,
|
|
QByteArray* out_balance_le16
|
|
) = 0;
|
|
virtual WalletFfiError get_account_public(
|
|
WalletHandle* handle,
|
|
const FfiBytes32* account_id,
|
|
FfiAccount* out_account
|
|
) = 0;
|
|
virtual void free_account_data(FfiAccount* account) = 0;
|
|
virtual WalletFfiError get_public_account_key(
|
|
WalletHandle* handle,
|
|
const FfiBytes32* account_id,
|
|
FfiPublicAccountKey* out_public_key
|
|
) = 0;
|
|
virtual WalletFfiError get_private_account_keys(
|
|
WalletHandle* handle,
|
|
const FfiBytes32* account_id,
|
|
FfiPrivateAccountKeys* out_keys
|
|
) = 0;
|
|
virtual void free_private_account_keys(FfiPrivateAccountKeys* keys) = 0;
|
|
|
|
// Account Encoding
|
|
virtual QString account_id_to_base58(const FfiBytes32* account_id) = 0;
|
|
virtual WalletFfiError account_id_from_base58(const QString& base58_str, FfiBytes32* out_account_id) = 0;
|
|
|
|
// Blockchain Synchronisation
|
|
virtual WalletFfiError sync_to_block(WalletHandle* handle, uint64_t block_id) = 0;
|
|
virtual WalletFfiError get_last_synced_block(WalletHandle* handle, uint64_t* out_block_id) = 0;
|
|
virtual WalletFfiError get_current_block_height(WalletHandle* handle, uint64_t* out_block_height) = 0;
|
|
|
|
// Operations
|
|
virtual WalletFfiError transfer_public(
|
|
WalletHandle* handle,
|
|
const FfiBytes32* from,
|
|
const FfiBytes32* to,
|
|
const QByteArray& amount_le16,
|
|
FfiTransferResult* out_result
|
|
) = 0;
|
|
virtual WalletFfiError register_public_account(
|
|
WalletHandle* handle,
|
|
const FfiBytes32* account_id,
|
|
FfiTransferResult* out_result
|
|
) = 0;
|
|
virtual void free_transfer_result(FfiTransferResult* result) = 0;
|
|
|
|
// Wallet Lifecycle
|
|
virtual WalletHandle* create_new(
|
|
const QString& config_path,
|
|
const QString& storage_path,
|
|
const QString& password
|
|
) = 0;
|
|
virtual WalletHandle* open(const QString& config_path, const QString& storage_path) = 0;
|
|
virtual void destroy_wallet(WalletHandle* handle) = 0;
|
|
virtual WalletFfiError save(WalletHandle* handle) = 0;
|
|
|
|
// Configuration & Metadata
|
|
virtual QString get_sequencer_addr(WalletHandle* handle) = 0;
|
|
|
|
// Memory Management
|
|
virtual void free_string(char* ptr) = 0;
|
|
};
|
|
|
|
#define ILogosExecutionZoneWalletModule_iid "org.logos.ilogosexecutionzonewalletmodule"
|
|
Q_DECLARE_INTERFACE(ILogosExecutionZoneWalletModule, ILogosExecutionZoneWalletModule_iid)
|
|
|
|
#endif
|