Skip to content

Commit

Permalink
Added GetAdress function
Browse files Browse the repository at this point in the history
  • Loading branch information
EduMenges committed Sep 13, 2024
1 parent ffa30ed commit 9198c39
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/GeniusSDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "GeniusSDK.h"
#include "account/GeniusNode.hpp"
#include <boost/multiprecision/cpp_int/import_export.hpp>
#include <memory>
#include <rapidjson/document.h>
#include <rapidjson/writer.h>
Expand Down Expand Up @@ -151,3 +152,14 @@ void GeniusSDKMintTokens( uint64_t amount )
{
GeniusNodeInstance->MintTokens( amount );
}

GeniusAddress GeniusSDKGetAddress()
{
auto address = GeniusNodeInstance->GetAdddress();

GeniusAddress ret;

std::copy( address.cbegin(), address.cend(), ret.address );

return ret;
}
8 changes: 8 additions & 0 deletions src/GeniusSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ typedef struct
GeniusArray *ptr;
} GeniusMatrix; ///< Struct to interop a matrix of C++ vectors in C

typedef struct
{
/// A string prepended with `0x` followed by 64 hex characters,
/// including a null-terminating char just for safety.
char address[2 + 256 / 4 + 1];
} GeniusAddress;

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

Expand All @@ -50,6 +57,7 @@ GNUS_VISIBILITY_DEFAULT uint64_t GeniusSDKGetBalance();
GNUS_VISIBILITY_DEFAULT GeniusMatrix GeniusSDKGetTransactions();
GNUS_VISIBILITY_DEFAULT void GeniusSDKFreeTransactions( GeniusMatrix matrix );
GNUS_VISIBILITY_DEFAULT void GeniusSDKMintTokens( uint64_t amount );
GNUS_VISIBILITY_DEFAULT GeniusAddress GeniusSDKGetAddress();

GNUS_EXPORT_END

Expand Down

0 comments on commit 9198c39

Please sign in to comment.