{"id":50499235,"url":"https://github.com/phantasma-io/phantasma-sdk-cpp","last_synced_at":"2026-06-16T07:31:18.060Z","repository":{"id":237344286,"uuid":"770331020","full_name":"phantasma-io/phantasma-sdk-cpp","owner":"phantasma-io","description":"Phantasma C++ SDK","archived":false,"fork":false,"pushed_at":"2026-05-27T23:22:24.000Z","size":1337,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T10:28:37.491Z","etag":null,"topics":["blockchain","cpp","crypto","cryptocurrency","phantasma","phantasmachain","phantasmaio","sdk","smartnft","smartnfts"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phantasma-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-11T11:17:22.000Z","updated_at":"2026-05-27T23:22:28.000Z","dependencies_parsed_at":"2024-05-01T00:54:48.518Z","dependency_job_id":null,"html_url":"https://github.com/phantasma-io/phantasma-sdk-cpp","commit_stats":null,"previous_names":["phantasma-io/phantasma-cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phantasma-io/phantasma-sdk-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phantasma-io%2Fphantasma-sdk-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phantasma-io%2Fphantasma-sdk-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phantasma-io%2Fphantasma-sdk-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phantasma-io%2Fphantasma-sdk-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phantasma-io","download_url":"https://codeload.github.com/phantasma-io/phantasma-sdk-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phantasma-io%2Fphantasma-sdk-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34394376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","cpp","crypto","cryptocurrency","phantasma","phantasmachain","phantasmaio","sdk","smartnft","smartnfts"],"created_at":"2026-06-02T10:01:43.770Z","updated_at":"2026-06-16T07:31:18.040Z","avatar_url":"https://github.com/phantasma-io.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"------------------------------------------------------------------------------\n Low-level API\n------------------------------------------------------------------------------\n  The PhantasmaJsonAPI namespace can construct JSON requests and parse JSON responses,\n   but you are responsible for sending/receiving these messages via HTTP on your own.\n   You can call `PhantasmaJsonAPI::Uri()` to determine where to send them.\n\n     void PhantasmaJsonAPI::MakeGetAccountRequest(JSONBuilder, addressText);\n     bool PhantasmaJsonAPI::ParseGetAccountResponse(JSONValue, Account);\n     void PhantasmaJsonAPI::MakeGetAccountsRequest(JSONBuilder, accountText, extended, checkAddressReservedByte);\n     bool PhantasmaJsonAPI::ParseGetAccountsResponse(JSONValue, vector\u003cAccount\u003e);\n     void PhantasmaJsonAPI::MakeLookUpNameRequest(JSONBuilder, name);\n     bool PhantasmaJsonAPI::ParseLookUpNameResponse(JSONValue, String);\n     void PhantasmaJsonAPI::MakeGetBlockHeightRequest(JSONBuilder, chainInput);\n     bool PhantasmaJsonAPI::ParseGetBlockHeightResponse(JSONValue, Int32);\n     void PhantasmaJsonAPI::MakeGetBlockTransactionCountByHashRequest(JSONBuilder, chainAddressOrName, blockHash);\n     bool PhantasmaJsonAPI::ParseGetBlockTransactionCountByHashResponse(JSONValue, Int32);\n     void PhantasmaJsonAPI::MakeGetBlockByHashRequest(JSONBuilder, blockHash);\n     bool PhantasmaJsonAPI::ParseGetBlockByHashResponse(JSONValue, Block);\n     void PhantasmaJsonAPI::MakeGetBlockByHeightRequest(JSONBuilder, chainInput, height);\n     bool PhantasmaJsonAPI::ParseGetBlockByHeightResponse(JSONValue, Block);\n     void PhantasmaJsonAPI::MakeGetLatestBlockRequest(JSONBuilder, chainInput);\n     bool PhantasmaJsonAPI::ParseGetLatestBlockResponse(JSONValue, Block);\n     void PhantasmaJsonAPI::MakeGetTransactionByBlockHashAndIndexRequest(JSONBuilder, chainAddressOrName, blockHash, index);\n     bool PhantasmaJsonAPI::ParseGetTransactionByBlockHashAndIndexResponse(JSONValue, Transaction);\n     void PhantasmaJsonAPI::MakeGetAddressTransactionsRequest(JSONBuilder, addressText, page, pageSize);\n     bool PhantasmaJsonAPI::ParseGetAddressTransactionsResponse(JSONValue, AccountTransactions);\n     void PhantasmaJsonAPI::MakeGetAddressTransactionCountRequest(JSONBuilder, addressText, chainInput);\n     bool PhantasmaJsonAPI::ParseGetAddressTransactionCountResponse(JSONValue, Int32);\n     void PhantasmaJsonAPI::MakeSendRawTransactionRequest(JSONBuilder, txData);\n     bool PhantasmaJsonAPI::ParseSendRawTransactionResponse(JSONValue, String);\n     void PhantasmaJsonAPI::MakeSendCarbonTransactionRequest(JSONBuilder, txData);\n     bool PhantasmaJsonAPI::ParseSendCarbonTransactionResponse(JSONValue, String);\n     void PhantasmaJsonAPI::MakeInvokeRawScriptRequest(JSONBuilder, chainInput, scriptData);\n     bool PhantasmaJsonAPI::ParseInvokeRawScriptResponse(JSONValue, Script);\n     void PhantasmaJsonAPI::MakeGetTransactionRequest(JSONBuilder, hashText);\n     bool PhantasmaJsonAPI::ParseGetTransactionResponse(JSONValue, Transaction);\n     void PhantasmaJsonAPI::MakeGetChainsRequest(JSONBuilder);\n     bool PhantasmaJsonAPI::ParseGetChainsResponse(JSONValue, vector\u003cChain\u003e);\n     void PhantasmaJsonAPI::MakeGetChainRequest(JSONBuilder, name, extended);\n     bool PhantasmaJsonAPI::ParseGetChainResponse(JSONValue, Chain);\n     void PhantasmaJsonAPI::MakeGetNexusRequest(JSONBuilder, extended);\n     bool PhantasmaJsonAPI::ParseGetNexusResponse(JSONValue, Nexus);\n     void PhantasmaJsonAPI::MakeGetOrganizationRequest(JSONBuilder, name, includeMemberCount);\n     bool PhantasmaJsonAPI::ParseGetOrganizationResponse(JSONValue, Organization);\n     void PhantasmaJsonAPI::MakeGetOrganizationsRequest(JSONBuilder, pageSize, cursor, includeMemberCount);\n     bool PhantasmaJsonAPI::ParseGetOrganizationsResponse(JSONValue, CursorPaginatedResult\u003cOrganization\u003e);\n     void PhantasmaJsonAPI::MakeGetOrganizationMembersRequest(JSONBuilder, name, pageSize, cursor, includeMemberTime);\n     bool PhantasmaJsonAPI::ParseGetOrganizationMembersResponse(JSONValue, CursorPaginatedResult\u003cOrganizationMember\u003e);\n     void PhantasmaJsonAPI::MakeGetOrganizationMemberRequest(JSONBuilder, name, address, checkAddressReservedByte, addressType);\n     bool PhantasmaJsonAPI::ParseGetOrganizationMemberResponse(JSONValue, OrganizationMember);\n     void PhantasmaJsonAPI::MakeGetLeaderboardRequest(JSONBuilder, name);\n     bool PhantasmaJsonAPI::ParseGetLeaderboardResponse(JSONValue, Leaderboard);\n     void PhantasmaJsonAPI::MakeGetTokensRequest(JSONBuilder, extended, ownerAddress);\n     bool PhantasmaJsonAPI::ParseGetTokensResponse(JSONValue, vector\u003cToken\u003e);\n     void PhantasmaJsonAPI::MakeGetTokenRequest(JSONBuilder, symbol, extended, carbonTokenId);\n     bool PhantasmaJsonAPI::ParseGetTokenResponse(JSONValue, Token);\n     void PhantasmaJsonAPI::MakeGetTokenSeriesRequest(JSONBuilder, symbol, carbonTokenId, pageSize, cursor);\n     bool PhantasmaJsonAPI::ParseGetTokenSeriesResponse(JSONValue, CursorPaginatedResult\u003cTokenSeries\u003e);\n     void PhantasmaJsonAPI::MakeGetTokenSeriesByIdRequest(JSONBuilder, symbol, carbonTokenId, seriesId, carbonSeriesId);\n     bool PhantasmaJsonAPI::ParseGetTokenSeriesByIdResponse(JSONValue, TokenSeries);\n     void PhantasmaJsonAPI::MakeGetTokenNFTsRequest(JSONBuilder, carbonTokenId, carbonSeriesId, pageSize, cursor, extended);\n     bool PhantasmaJsonAPI::ParseGetTokenNFTsResponse(JSONValue, CursorPaginatedResult\u003cTokenData\u003e);\n     void PhantasmaJsonAPI::MakeGetTokenDataRequest(JSONBuilder, symbol, IDtext);\n     bool PhantasmaJsonAPI::ParseGetTokenDataResponse(JSONValue, TokenData);\n     void PhantasmaJsonAPI::MakeGetNFTRequest(JSONBuilder, symbol, IDtext, extended);\n     bool PhantasmaJsonAPI::ParseGetNFTResponse(JSONValue, TokenData);\n     void PhantasmaJsonAPI::MakeGetNFTsRequest(JSONBuilder, symbol, IDtext, extended);\n     bool PhantasmaJsonAPI::ParseGetNFTsResponse(JSONValue, vector\u003cTokenData\u003e);\n     void PhantasmaJsonAPI::MakeGetTokenBalanceRequest(JSONBuilder, addressText, tokenSymbol, chainInput);\n     bool PhantasmaJsonAPI::ParseGetTokenBalanceResponse(JSONValue, Balance);\n     void PhantasmaJsonAPI::MakeGetAccountFungibleTokensRequest(JSONBuilder, account, tokenSymbol, carbonTokenId, pageSize, cursor, checkAddressReservedByte);\n     bool PhantasmaJsonAPI::ParseGetAccountFungibleTokensResponse(JSONValue, CursorPaginatedResult\u003cBalance\u003e);\n     void PhantasmaJsonAPI::MakeGetAccountNFTsRequest(JSONBuilder, account, tokenSymbol, carbonTokenId, carbonSeriesId, pageSize, cursor, extended, checkAddressReservedByte);\n     bool PhantasmaJsonAPI::ParseGetAccountNFTsResponse(JSONValue, CursorPaginatedResult\u003cTokenData\u003e);\n     void PhantasmaJsonAPI::MakeGetAccountOwnedTokensRequest(JSONBuilder, account, tokenSymbol, carbonTokenId, pageSize, cursor, checkAddressReservedByte);\n     bool PhantasmaJsonAPI::ParseGetAccountOwnedTokensResponse(JSONValue, CursorPaginatedResult\u003cToken\u003e);\n     void PhantasmaJsonAPI::MakeGetAccountOwnedTokenSeriesRequest(JSONBuilder, account, tokenSymbol, carbonTokenId, pageSize, cursor, checkAddressReservedByte);\n     bool PhantasmaJsonAPI::ParseGetAccountOwnedTokenSeriesResponse(JSONValue, CursorPaginatedResult\u003cTokenSeries\u003e);\n     void PhantasmaJsonAPI::MakeGetAuctionsCountRequest(JSONBuilder, chainAddressOrName, symbol);\n     bool PhantasmaJsonAPI::ParseGetAuctionsCountResponse(JSONValue, Int32);\n     void PhantasmaJsonAPI::MakeGetAuctionsRequest(JSONBuilder, chainAddressOrName, symbol, page, pageSize);\n     bool PhantasmaJsonAPI::ParseGetAuctionsResponse(JSONValue, vector\u003cAuction\u003e);\n     void PhantasmaJsonAPI::MakeGetAuctionRequest(JSONBuilder, chainAddressOrName, symbol, IDtext);\n     bool PhantasmaJsonAPI::ParseGetAuctionResponse(JSONValue, Auction);\n     void PhantasmaJsonAPI::MakeGetArchiveRequest(JSONBuilder, hashText);\n     bool PhantasmaJsonAPI::ParseGetArchiveResponse(JSONValue, Archive);\n     void PhantasmaJsonAPI::MakeWriteArchiveRequest(JSONBuilder, hashText, blockIndex, blockContent);\n     bool PhantasmaJsonAPI::ParseWriteArchiveResponse(JSONValue, bool);\n     void PhantasmaJsonAPI::MakeReadArchiveRequest(JSONBuilder, hashText, blockIndex);\n     bool PhantasmaJsonAPI::ParseReadArchiveResponse(JSONValue, String);\n     void PhantasmaJsonAPI::MakeGetContractRequest(JSONBuilder, chainAddressOrName, contractName);\n     bool PhantasmaJsonAPI::ParseGetContractResponse(JSONValue, Contract);\n     void PhantasmaJsonAPI::MakeGetContractsRequest(JSONBuilder, chainAddressOrName, extended);\n     bool PhantasmaJsonAPI::ParseGetContractsResponse(JSONValue, vector\u003cContract\u003e);\n     void PhantasmaJsonAPI::MakeGetContractByAddressRequest(JSONBuilder, chainAddressOrName, contractAddress);\n     bool PhantasmaJsonAPI::ParseGetContractByAddressResponse(JSONValue, Contract);\n     void PhantasmaJsonAPI::MakeGetVersionRequest(JSONBuilder);\n     bool PhantasmaJsonAPI::ParseGetVersionResponse(JSONValue, BuildInfoResult);\n     void PhantasmaJsonAPI::MakeGetPhantasmaVmConfigRequest(JSONBuilder, chainAddressOrName);\n     bool PhantasmaJsonAPI::ParseGetPhantasmaVmConfigResponse(JSONValue, PhantasmaVmConfig);\n\n------------------------------------------------------------------------------\n High-level API\n------------------------------------------------------------------------------\n  If you have defined `PHANTASMA_HTTPCLIENT`, then you can construct a \n   PhantasmaAPI object, which provides a simplified API that hides the \n   internal JSON messaging.\n\n     PhantasmaAPI phantasmaAPI(httpClient);\n     Account = phantasmaAPI.GetAccount(addressText, error);\n     vector\u003cAccount\u003e = phantasmaAPI.GetAccounts(accountText, extended, checkAddressReservedByte, error);\n     String = phantasmaAPI.LookUpName(name, error);\n     Int32 = phantasmaAPI.GetBlockHeight(chainInput, error);\n     Int32 = phantasmaAPI.GetBlockTransactionCountByHash(chainAddressOrName, blockHash, error);\n     Block = phantasmaAPI.GetBlockByHash(blockHash, error);\n     Block = phantasmaAPI.GetBlockByHeight(chainInput, height, error);\n     Block = phantasmaAPI.GetLatestBlock(chainInput, error);\n     Transaction = phantasmaAPI.GetTransactionByBlockHashAndIndex(chainAddressOrName, blockHash, index, error);\n     AccountTransactions = phantasmaAPI.GetAddressTransactions(addressText, page, pageSize, error);\n     Int32 = phantasmaAPI.GetAddressTransactionCount(addressText, chainInput, error);\n     String = phantasmaAPI.SendRawTransaction(txData, error);\n     String = phantasmaAPI.SendCarbonTransaction(txData, error);\n     Script = phantasmaAPI.InvokeRawScript(chainInput, scriptData, error);\n     Transaction = phantasmaAPI.GetTransaction(hashText, error);\n     vector\u003cChain\u003e = phantasmaAPI.GetChains(error);\n     Chain = phantasmaAPI.GetChain(name, extended, error);\n     Nexus = phantasmaAPI.GetNexus(extended, error);\n     Organization = phantasmaAPI.GetOrganization(name, includeMemberCount, error);\n     CursorPaginatedResult\u003cOrganization\u003e = phantasmaAPI.GetOrganizations(pageSize, cursor, includeMemberCount, error);\n     CursorPaginatedResult\u003cOrganizationMember\u003e = phantasmaAPI.GetOrganizationMembers(name, pageSize, cursor, includeMemberTime, error);\n     OrganizationMember = phantasmaAPI.GetOrganizationMember(name, address, checkAddressReservedByte, addressType, error);\n     Leaderboard = phantasmaAPI.GetLeaderboard(name, error);\n     vector\u003cToken\u003e = phantasmaAPI.GetTokens(extended, error);\n     vector\u003cToken\u003e = phantasmaAPI.GetTokens(extended, ownerAddress, error);\n     Token = phantasmaAPI.GetToken(symbol, extended, error);\n     Token = phantasmaAPI.GetToken(symbol, extended, carbonTokenId, error);\n     CursorPaginatedResult\u003cTokenSeries\u003e = phantasmaAPI.GetTokenSeries(symbol, carbonTokenId, pageSize, cursor, error);\n     TokenSeries = phantasmaAPI.GetTokenSeriesById(symbol, carbonTokenId, seriesId, carbonSeriesId, error);\n     CursorPaginatedResult\u003cTokenData\u003e = phantasmaAPI.GetTokenNFTs(carbonTokenId, carbonSeriesId, pageSize, cursor, extended, error);\n     TokenData = phantasmaAPI.GetTokenData(symbol, IDtext, error);\n     TokenData = phantasmaAPI.GetNFT(symbol, IDtext, extended, error);\n     vector\u003cTokenData\u003e = phantasmaAPI.GetNFTs(symbol, IDtext, extended, error);\n     Balance = phantasmaAPI.GetTokenBalance(addressText, tokenSymbol, chainInput, error);\n     CursorPaginatedResult\u003cBalance\u003e = phantasmaAPI.GetAccountFungibleTokens(account, tokenSymbol, carbonTokenId, pageSize, cursor, checkAddressReservedByte, error);\n     CursorPaginatedResult\u003cTokenData\u003e = phantasmaAPI.GetAccountNFTs(account, tokenSymbol, carbonTokenId, carbonSeriesId, pageSize, cursor, extended, checkAddressReservedByte, error);\n     CursorPaginatedResult\u003cToken\u003e = phantasmaAPI.GetAccountOwnedTokens(account, tokenSymbol, carbonTokenId, pageSize, cursor, checkAddressReservedByte, error);\n     CursorPaginatedResult\u003cTokenSeries\u003e = phantasmaAPI.GetAccountOwnedTokenSeries(account, tokenSymbol, carbonTokenId, pageSize, cursor, checkAddressReservedByte, error);\n     Int32 = phantasmaAPI.GetAuctionsCount(chainAddressOrName, symbol, error);\n     vector\u003cAuction\u003e = phantasmaAPI.GetAuctions(chainAddressOrName, symbol, page, pageSize, error);\n     Auction = phantasmaAPI.GetAuction(chainAddressOrName, symbol, IDtext, error);\n     Archive = phantasmaAPI.GetArchive(hashText, error);\n     bool = phantasmaAPI.WriteArchive(hashText, blockIndex, blockContent, error);\n     String = phantasmaAPI.ReadArchive(hashText, blockIndex, error);\n     Contract = phantasmaAPI.GetContract(chainAddressOrName, contractName, error);\n     vector\u003cContract\u003e = phantasmaAPI.GetContracts(chainAddressOrName, extended, error);\n     Contract = phantasmaAPI.GetContractByAddress(chainAddressOrName, contractAddress, error);\n     BuildInfoResult = phantasmaAPI.GetVersion(error);\n     PhantasmaVmConfig = phantasmaAPI.GetPhantasmaVmConfig(chainAddressOrName, error);\n\n------------------------------------------------------------------------------\n API configuration\n------------------------------------------------------------------------------\n As different C++ projects may use different primitive types, you can use the \n  following #defines (BEFORE including `phantasma.h`) to override the default types.\n\n |#define                  | typedef                   | Default             | Notes                                                  |\n |-------------------------|---------------------------|---------------------|--------------------------------------------------------|\n |`PHANTASMA_BYTE`         | `phantasma::Byte`         | `uint8_t`           |                                                        |\n |`PHANTASMA_INT32`        | `phantasma::Int32`        | `int32_t`           |                                                        |\n |`PHANTASMA_UINT32`       | `phantasma::UInt32`       | `uint32_t`          |                                                        |\n |`PHANTASMA_INT64`        | `phantasma::Int64`        | `int64_t`           |                                                        |\n |`PHANTASMA_UINT64`       | `phantasma::UInt64`       | `uint64_t`          |                                                        |\n |`PHANTASMA_CHAR`         | `phantasma::Char`         | `char`              | See Unicode section                                    |\n |`PHANTASMA_STRING`       | `phantasma::String`       | `std::string`       | Must support construction from `const phantasma::Char*`|\n |`PHANTASMA_STRINGBUILDER`| `phantasma::StringBuilder`| `std::stringstream` |                                                        |\n |`PHANTASMA_VECTOR`       |                           | `std::vector`       | Must support `push_back` and `size` members            |\n |`PHANTASMA_JSONVALUE`    | `phantasma::JSONValue`    | `std::string_view`  | See JSON and Adaptors section                          |\n |`PHANTASMA_JSONARRAY`    | `phantasma::JSONArray`    | `JSONValue`         | See JSON and Adaptors section                          |\n |`PHANTASMA_JSONDOCUMENT` | `phantasma::JSONDocument` | `std::string`       | See JSON and Adaptors section                          |\n |`PHANTASMA_JSONBUILDER`  | `phantasma::JSONBuilder`  | `std::stringstream`*| See JSON and Adaptors section                          |\n |`PHANTASMA_HTTPCLIENT`   | `phantasma::HttpClient`   |                     | See HTTP and Adaptors section                          |\n\n The behavior of this header can further be modified by using the following \n  `#defines` (BEFORE including `phantasma.h`)\n \n |#define                                        | Notes                   |\n |-----------------------------------------------|-------------------------|\n |`PHANTASMA_EXCEPTION(message)`                 | See Exceptions section  |\n |`PHANTASMA_EXCEPTION_MESSAGE(message, String)` | See Exceptions section  |\n |`PHANTASMA_LITERAL(x)`                         | See Unicode section     |\n |`PHANTASMA_FUNCTION`                           | See Integration section |        \n |`PHANTASMA_IMPLEMENTATION`                     | See Integration section |\n\n------------------------------------------------------------------------------\n Integration\n------------------------------------------------------------------------------\n The core of API is provided in the \"single header\" style to support simple and \n  flexible integration into your project \n  (see https://github.com/nothings/single_file_libs / https://en.wikipedia.org/wiki/Header-only).\n The implementation of function bodies will be excluded unless you define\n  `PHANTASMA_IMPLEMENTATION` before including `phantasma.h`.\n\n See the \"Extended/Advanced usage\" section, below for details on what is excluded\n  from this single header file.\n\n Typical linking:\n  In one CPP file, before including `phantasma.h`:\n\n   `#define PHANTASMA_IMPLEMENTATION`\n \n Inline linking:\n  In every CPP file that uses the API, before including `phantasma.h`:\n\n   `#define PHANTASMA_IMPLEMENTATION`\n\n   `#define PHANTASMA_FUNCTION inline`\n\n Aside from `PHANTASMA_IMPLEMENTATION` / `PHANTASMA_FUNCTION`, you should take \n  care to ensure that every other PHANTASMA_* macro is defined to the same value\n  in all of your CPP files that use the phantasma API.\n\n------------------------------------------------------------------------------\n Exceptions\n------------------------------------------------------------------------------\n Support for C++ exceptions is opt-in. Before including `phantasma.h`, define\n  the following to enable exceptions:\n\n `#define PHANTASMA_EXCEPTION_ENABLE`\n\n Alternatively, you can customize the exact type that is thrown by defining:\n\n `#define PHANTASMA_EXCEPTION(message)                 throw std::runtime_error(message)`\n\n `#define PHANTASMA_EXCEPTION_MESSAGE(message, string) throw std::runtime_error(string)`\n\n------------------------------------------------------------------------------\n Unicode\n------------------------------------------------------------------------------\n To build a wide-character version of the API, define the following before\n  including `phantasma.h`:\n\n `#define PHANTASMA_CHAR          wchar_t`\n\n `#define PHANTASMA_LITERAL(x)    L ## x`\n\n `#define PHANTASMA_STRING        std::wstring`\n\n `#define PHANTASMA_STRINGBUILDER std::wstringstream`\n\n Alternatively, if `_UNICODE` is defined, then the above macros will be defined\n  automatically.\n\n You should also provide a JSON and HTTP library with wide-character support.\n\n------------------------------------------------------------------------------\n Adaptors\n------------------------------------------------------------------------------\n Parts of the Phantasma SDK are designed to plug into external features, such\n  as HTTP communications, JSON encoding and advanced cryptography.\n You can configure the SDK to connect to your own implemenations, or existing\n  libraries.\n To make integration easier, we provide several \"adaptor\" header files that \n  contain the required configuration to connect the Phantasma SDK to existing\n  popular open source libraries for different features:\n\n |Library   | Features     | #include file                       | Library URL                             |\n |----------|--------------|-------------------------------------|-----------------------------------------|\n |C++ REST  | HTTP + JSON  | `Adapters/PhantasmaAPI_cpprest.h`   | https://github.com/microsoft/cpprestsdk |\n |libcurl   | HTTP         | `Adapters/PhantasmaAPI_curl.h`      | https://curl.haxx.se/libcurl/           |\n |RapidJSON | JSON         | `Adapters/PhantasmaAPI_rapidjson.h` | http://rapidjson.org/                   |\n |Sodium    | Cryptography | `Adapters/PhantasmaAPI_sodium.h`    | https://libsodium.org                   |\n\n------------------------------------------------------------------------------\n JSON\n------------------------------------------------------------------------------\n This header contains JSON parsing and building code, but it is written to be\n  as simple as possible (approx 200 lines of code) and is not high-performance\n  or highly robust.\n\n It is recommended that you supply another JSON-parsing API, by defining the\n  following macros before including `phantasma.h`:\n\n  `#define PHANTASMA_JSONVALUE    Your_Json_Value_Type`\n\n  `#define PHANTASMA_JSONARRAY    Your_Json_Array_Type`\n\n  `#define PHANTASMA_JSONDOCUMENT Your_JSON_Document_Type`\n\n  `#define PHANTASMA_JSONBUILDER  Your_Json_Serializer_Type`\n\n **The CPP REST and RapidJSON adaptors implement these macros.**\n\n Also, this header uses the following procedural API to interact with these types.\n If you have supplied your own JSON types, you must implement the following functions:\n\n     namespace phantasma { namespace json {\n     \n        JSONValue Parse(const JSONDocument\u0026);\n     \n        bool      LookupBool(   const JSONValue\u0026, const Char* field, bool\u0026 out_error);\n        Int32     LookupInt32(  const JSONValue\u0026, const Char* field, bool\u0026 out_error);\n        UInt32    LookupUInt32( const JSONValue\u0026, const Char* field, bool\u0026 out_error);\n        String    LookupString( const JSONValue\u0026, const Char* field, bool\u0026 out_error);\n        JSONValue LookupValue(  const JSONValue\u0026, const Char* field, bool\u0026 out_error);\n        JSONArray LookupArray(  const JSONValue\u0026, const Char* field, bool\u0026 out_error);\n        bool      HasField(     const JSONValue\u0026, const Char* field, bool\u0026 out_error);\n        bool      HasArrayField(const JSONValue\u0026, const Char* field, bool\u0026 out_error);\n     \n        bool      AsBool(       const JSONValue\u0026,                    bool\u0026 out_error);\n        Int32     AsInt32(      const JSONValue\u0026,                    bool\u0026 out_error);\n        UInt32    AsUInt32(     const JSONValue\u0026,                    bool\u0026 out_error);\n        String    AsString(     const JSONValue\u0026,                    bool\u0026 out_error);\n        JSONArray AsArray(      const JSONValue\u0026,                    bool\u0026 out_error);\n        bool      IsArray(      const JSONValue\u0026,                    bool\u0026 out_error);\n        bool      IsObject(     const JSONValue\u0026,                    bool\u0026 out_error);\n        \n        int       ArraySize(    const JSONArray\u0026,                    bool\u0026 out_error);\n        JSONValue IndexArray(   const JSONArray\u0026, int index,         bool\u0026 out_error);\n     \n                               void BeginObject(JSONBuilder\u0026);\n                               void AddString  (JSONBuilder\u0026, const Char* key, const Char* value);\n       template\u003cclass... Args\u003e void AddArray   (JSONBuilder\u0026, const Char* key, Args...);\n                               void EndObject  (JSONBuilder\u0026);\n     }}\n\n------------------------------------------------------------------------------\n HTTP\n------------------------------------------------------------------------------\n This header does not contain a HTTP client, nor a dependency on any specific\n  HTTP client library. If you do not supply a HTTP client library, then only\n  the Low-level phantasma API (`PhantasmaJsonAPI`) is available.\n\n To enable the `PhantasmaAPI` class, defining the following macro before \n  including `phantasma.h`:\n  \n `#define PHANTASMA_HTTPCLIENT   Your_HTTP_Client_Type`\n\n **The CPP REST and libcurl adaptors implement this macro.**\n\n Also, this header uses the following procedural API to interact with this type.\n If you have defined `PHANTASMA_HTTPCLIENT`, you must implement the following,\n  function, which should perform a HTTP POST request and return the result:\n\n     namespace phantasma {\n      JSONDocument HttpPost(HttpClient\u0026, const Char* uri, const JSONBuilder\u0026);\n     }\n\n------------------------------------------------------------------------------\n Extended/Advanced usage\n------------------------------------------------------------------------------\n This header file contains the entirety of the RPC API requried to communicate \n  with a Phantasma node. If you are not trying to create transactions, this \n  may be enough for you.\n\n However, for advanced usage, such as creating and signing transactions, much\n  more code is required, including cryptography, N-bit ingeger arithmetic, etc.\n The other header files that are included in this distribution, in sub-folders\n  listed below, provide these extra features:\n\n  |Directory     | Features                                                              |\n  |--------------|-----------------------------------------------------------------------|\n  | Adapters     | Configuration for this library to communicate with 3rd party libraries|\n  | Blockchain   | Transactions                                                          |\n  | Cryptography | Public/Private keys, Signatures, Random numbers, Encryption           |\n  | Numerics     | N-bit integer implementation. Base 16/58 ASCII encoding.              |\n  | Security     | Practical memory protection.                                          |\n\n------------------------------------------------------------------------------\n - Extended/Advanced usage - Security configuration\n------------------------------------------------------------------------------\n   To securely process transactions and private keys, it is strongly advised to \n   pair the PhantasmaAPI with strong 3rd party security library.\n\n   **The Sodium adaptor implements these macros.**\n   \n  |#define                      |                                                                                                              |\n  |-----------------------------|--------------------------------------------------------------------------------------------------------------|\n  |`PHANTASMA_RANDOMBYTES`      | Fill a memory range with cryptographically secure pseudo-random numbers                                      |\n  |`PHANTASMA_WIPEMEM`          | Fill a memory range with 0's in a way that won't be \"optimized away\"                                         |\n  |`PHANTASMA_LOCKMEM`          | Pin the memory pages containing this range, and otherwise inform the OS that it contains secrets.            |\n  |`PHANTASMA_UNLOCKMEM`        | Undo the actions of `PHANTASMA_LOCKMEM`, but also fill the memory range with 0's as with `PHANTASMA_WIPEMEM`.|\n  |`PHANTASMA_SECURE_ALLOC`     | Similar to malloc, but should return dedicated pages that can have their access permissions modified.        |\n  |`PHANTASMA_SECURE_FREE`      | Similar to free - used with allocations returned from `PHANTASMA_SECURE_ALLOC`                               |\n  |`PHANTASMA_SECURE_NOACCESS`  | Used with allocations returned from `PHANTASMA_SECURE_ALLOC`. Mark the pages as non-readable.                |\n  |`PHANTASMA_SECURE_READONLY`  | Used with allocations returned from `PHANTASMA_SECURE_ALLOC`. Mark the pages as read only.                   |\n  |`PHANTASMA_SECURE_READWRITE` | Used with allocations returned from `PHANTASMA_SECURE_ALLOC`. Mark the pages as writable.                    |\n\n------------------------------------------------------------------------------\n - Extended/Advanced usage - Cryptography configuration\n------------------------------------------------------------------------------\n  To create or validate transactions, an EdDSA Ed25519 implementation is requied.\n   The libSodium adaptor implements these macros.\n   \n  |#define                                |                                                               |\n  |---------------------------------------|---------------------------------------------------------------|\n  |`PHANTASMA_Ed25519_PublicKeyFromSeed`  | Generate a 32 byte public key from a 32 byte seed.            |\n  |`PHANTASMA_Ed25519_PrivateKeyFromSeed` | Generate a 64 byte public key from a 32 byte seed.            |\n  |`PHANTASMA_Ed25519_SignDetached`       | Generate a 64 byte signature from a message and a private key.|\n  |`PHANTASMA_Ed25519_ValidateDetached`   | Validate a 64 byte signature using a public key.              |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphantasma-io%2Fphantasma-sdk-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphantasma-io%2Fphantasma-sdk-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphantasma-io%2Fphantasma-sdk-cpp/lists"}