Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed getblocks and added get in and out transactions #12

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/GeniusSDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,13 @@ uint64_t GeniusSDKGetBalance()
return GeniusNodeInstance->GetBalance();
}

GeniusMatrix GeniusSDKGetTransactions()
GeniusMatrix GeniusSDKGetOutTransactions()
{
return matrix_from_vector_of_vector( GeniusNodeInstance->GetTransactions() );
return matrix_from_vector_of_vector( GeniusNodeInstance->GetOutTransactions() );
}
GeniusMatrix GeniusSDKGetInTransactions()
{
return matrix_from_vector_of_vector( GeniusNodeInstance->GetInTransactions() );
}

void GeniusSDKFreeTransactions( GeniusMatrix matrix )
Expand All @@ -169,20 +173,14 @@ void GeniusSDKFreeTransactions( GeniusMatrix matrix )
free( matrix.ptr );
}

GeniusMatrix GeniusSDKGetBlocks()
{
auto blocks = GeniusNodeInstance->GetBlocks();
return matrix_from_buffer( blocks );
}

void GeniusSDKMintTokens( uint64_t amount, const char *transaction_hash, const char *chain_id, const char *token_id )
{
GeniusNodeInstance->MintTokens( amount, transaction_hash, chain_id, token_id );
}

GeniusAddress GeniusSDKGetAddress()
{
auto address = GeniusNodeInstance->GetAddress();
auto address = GeniusNodeInstance->GetAddress<std::string>();

GeniusAddress ret;

Expand Down
16 changes: 9 additions & 7 deletions src/GeniusSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ typedef struct
} GeniusAddress;

typedef char JsonData_t[1024]; ///< ID/Path of the image to be processed
typedef uint64_t PayAmount_t; ///< Amount to be paid for the processing
typedef uint64_t PayAmount_t; ///< Amount to be paid for the processing

GNUS_VISIBILITY_DEFAULT const char *GeniusSDKInit( const char *base_path, const char *eth_private_key, bool autodht, bool process );
GNUS_VISIBILITY_DEFAULT void GeniusSDKProcess( const JsonData_t jsondata );
GNUS_VISIBILITY_DEFAULT uint64_t GeniusSDKGetBalance();
GNUS_VISIBILITY_DEFAULT GeniusMatrix GeniusSDKGetTransactions();
GNUS_VISIBILITY_DEFAULT const char *GeniusSDKInit( const char *base_path, const char *eth_private_key, bool autodht,
bool process );
GNUS_VISIBILITY_DEFAULT void GeniusSDKProcess( const JsonData_t jsondata );
GNUS_VISIBILITY_DEFAULT uint64_t GeniusSDKGetBalance();
GNUS_VISIBILITY_DEFAULT GeniusMatrix GeniusSDKGetOutTransactions();
GNUS_VISIBILITY_DEFAULT GeniusMatrix GeniusSDKGetInTransactions();
GNUS_VISIBILITY_DEFAULT void GeniusSDKFreeTransactions( GeniusMatrix matrix );
GNUS_VISIBILITY_DEFAULT GeniusMatrix GeniusSDKGetBlocks();
GNUS_VISIBILITY_DEFAULT void GeniusSDKMintTokens( uint64_t amount, const char *transaction_hash, const char *chain_id, const char *token_id );
GNUS_VISIBILITY_DEFAULT void GeniusSDKMintTokens( uint64_t amount, const char *transaction_hash, const char *chain_id,
const char *token_id );
GNUS_VISIBILITY_DEFAULT GeniusAddress GeniusSDKGetAddress();
GNUS_VISIBILITY_DEFAULT bool GeniusSDKTransferTokens( uint64_t amount, GeniusAddress *dest );
GNUS_VISIBILITY_DEFAULT uint64_t GeniusSDKGetCost( const JsonData_t jsondata );
Expand Down
Loading