From b8f02ccbe0884f09481990206afcbcca35a68857 Mon Sep 17 00:00:00 2001 From: itsafuu Date: Mon, 25 Nov 2024 18:15:03 -0500 Subject: [PATCH] Added get cost --- src/GeniusSDK.cpp | 9 +++++++-- src/GeniusSDK.h | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/GeniusSDK.cpp b/src/GeniusSDK.cpp index 885a1f1..9657e8c 100644 --- a/src/GeniusSDK.cpp +++ b/src/GeniusSDK.cpp @@ -145,9 +145,9 @@ const char *GeniusSDKInit( const char *base_path, const char *eth_private_key ) return ret_val.c_str(); } -void GeniusSDKProcess( const ImagePath_t path, const PayAmount_t amount ) +void GeniusSDKProcess( const JsonData_t jsondata ) { - GeniusNodeInstance->ProcessImage( std::string{ path }, amount ); + GeniusNodeInstance->ProcessImage( std::string{ jsondata } ); } uint64_t GeniusSDKGetBalance() @@ -197,3 +197,8 @@ bool GeniusSDKTransferTokens( uint64_t amount, GeniusAddress *dest ) return GeniusNodeInstance->TransferFunds( amount, destination ); } + +uint64_t GeniusSDKGetCost( const JsonData_t jsondata ) +{ + return GeniusNodeInstance->GetProcessCost( jsondata ); +} diff --git a/src/GeniusSDK.h b/src/GeniusSDK.h index 36ff8c5..ff3f55c 100644 --- a/src/GeniusSDK.h +++ b/src/GeniusSDK.h @@ -49,11 +49,11 @@ typedef struct char address[2 + 256 / 4 + 1]; } GeniusAddress; -typedef char ImagePath_t[1024]; ///< ID/Path of the image to be processed +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 GNUS_VISIBILITY_DEFAULT const char *GeniusSDKInit( const char *base_path, const char *eth_private_key ); -GNUS_VISIBILITY_DEFAULT void GeniusSDKProcess( const ImagePath_t path, PayAmount_t amount ); +GNUS_VISIBILITY_DEFAULT void GeniusSDKProcess( const JsonData_t jsondata ); GNUS_VISIBILITY_DEFAULT uint64_t GeniusSDKGetBalance(); GNUS_VISIBILITY_DEFAULT GeniusMatrix GeniusSDKGetTransactions(); GNUS_VISIBILITY_DEFAULT void GeniusSDKFreeTransactions( GeniusMatrix matrix ); @@ -61,6 +61,7 @@ GNUS_VISIBILITY_DEFAULT GeniusMatrix GeniusSDKGetBlocks(); GNUS_VISIBILITY_DEFAULT void GeniusSDKMintTokens( uint64_t amount ); 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 ); GNUS_EXPORT_END