Skip to content

Commit

Permalink
Added get cost
Browse files Browse the repository at this point in the history
  • Loading branch information
itsafuu committed Nov 25, 2024
1 parent 084c0d2 commit b8f02cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/GeniusSDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 );
}
5 changes: 3 additions & 2 deletions src/GeniusSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ 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 );
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

Expand Down

0 comments on commit b8f02cc

Please sign in to comment.