Skip to content

Commit

Permalink
chore(WIP): Hiero renaming initial
Browse files Browse the repository at this point in the history
Signed-off-by: gsstoykov <[email protected]>
  • Loading branch information
gsstoykov committed Nov 12, 2024
1 parent 50b6f54 commit 4dce809
Show file tree
Hide file tree
Showing 701 changed files with 5,773 additions and 5,342 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.15...3.24)
project(hedera-sdk-cpp VERSION 0.1.0 DESCRIPTION "Hedera SDK C++" LANGUAGES CXX)
project(hiero-sdk-cpp VERSION 0.1.0 DESCRIPTION "Hiero SDK C++" LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to the Hedera SDK for C++
# Contributing to the Hiero SDK for C++

Thank you for your interest in contributing the Hedera SDK for C++!
Thank you for your interest in contributing the Hiero SDK for C++!

We appreciate your interest in helping us and the rest of our community. We welcome bug reports, feature requests, and
code contributions.
Expand Down Expand Up @@ -129,7 +129,7 @@ It will populate the newly added tag in `origin`.

### Step 2 - Draft Release in GitHub

Open [Hedera C++ SDK](https://github.com/hashgraph/hedera-sdk-cpp) and search for `Create a new release` link.
Open [Hiero C++ SDK](https://github.com/hashgraph/hiero-sdk-cpp) and search for `Create a new release` link.
Select tag `v0.3.0` from the dropdown list. Enter the Release title to be same as the release number which is been
prepared (for example: `v0.3.0`).

Expand All @@ -146,7 +146,7 @@ emoji ➡️ followed by a description in plain English for each over-arching ne
#### Examples

This section should list all of the newly added examples. Each of them should represent a link to the implementation (
for example: [TransferTokensExample.cc](<(https://github.com/hashgraph/hedera-sdk-cpp/blob/main/src/sdk/examples/TransferTokensExample.cc)>). It's a good idea also to add prefix with ➡️ before
for example: [TransferTokensExample.cc](<(https://github.com/hashgraph/hiero-sdk-cpp/blob/main/src/sdk/examples/TransferTokensExample.cc)>). It's a good idea also to add prefix with ➡️ before
each line.

#### Notes
Expand All @@ -160,12 +160,12 @@ Here should be listed all of the Pull Requests (PRs) which are part of the relea

> (pull-request-title) by (@author) in (#link)
[issues]: https://github.com/hashgraph/hedera-sdk-cpp/issues
[label-bug]: https://github.com/hashgraph/hedera-sdk-cpp/labels/bug
[issues]: https://github.com/hashgraph/hiero-sdk-cpp/issues
[label-bug]: https://github.com/hashgraph/hiero-sdk-cpp/labels/bug
[mwe]: https://en.wikipedia.org/wiki/Minimal_Working_Example
[markdown]: https://guides.github.com/features/mastering-markdown/
[label-feature-enhancement]: https://github.com/hashgraph/hedera-sdk-cpp/labels/Feature%20Enhancement
[label-new-feature]: https://github.com/hashgraph/hedera-sdk-cpp/labels/New%20Feature
[pull-requests]: https://github.com/hashgraph/hedera-sdk-cpp/pulls
[license]: https://github.com/hashgraph/hedera-sdk-cpp/blob/main/LICENSE
[label-feature-enhancement]: https://github.com/hashgraph/hiero-sdk-cpp/labels/Feature%20Enhancement
[label-new-feature]: https://github.com/hashgraph/hiero-sdk-cpp/labels/New%20Feature
[pull-requests]: https://github.com/hashgraph/hiero-sdk-cpp/pulls
[license]: https://github.com/hashgraph/hiero-sdk-cpp/blob/main/LICENSE
[discord]: https://hedera.com/discord
2 changes: 1 addition & 1 deletion HederaApi.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(HAPI_VERSION_TAG "v0.55.0" CACHE STRING "Use the configured version tag for the Hedera API protobufs")
set(HAPI_VERSION_TAG "v0.55.0" CACHE STRING "Use the configured version tag for the Hiero API protobufs")

if (HAPI_VERSION_TAG STREQUAL "")
set(HAPI_VERSION_TAG "v0.55.0")
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 Hedera Hashgraph LLC
Copyright 2022 Hiero Hashgraph LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![](https://img.shields.io/badge/c++-17-blue)
![](https://img.shields.io/badge/cmake-3.24-blue)
[![](https://github.com/hashgraph/hedera-sdk-cpp/actions/workflows/flow-pull-request-checks.yaml/badge.svg)](https://github.com/hashgraph/hedera-sdk-cpp/actions/workflows/flow-pull-request-checks.yaml)
[![](https://github.com/hashgraph/hiero-sdk-cpp/actions/workflows/flow-pull-request-checks.yaml/badge.svg)](https://github.com/hashgraph/hiero-sdk-cpp/actions/workflows/flow-pull-request-checks.yaml)

The C++ SDK for interacting with a Hiero network.

Expand Down Expand Up @@ -128,8 +128,8 @@ located in the `addressbook/` and `config/` directories. Make sure your `.env` f

- `OPERATOR_ID`: The ID of the operator account.
- `OPERATOR_KEY`: The DER-encoded hex private key of the operator account.
- `HEDERA_NETWORK`: The Hedera network name. Must be one of `mainnet`, `testnet`, or `previewnet`.
- `PASSPHRASE`: Optional variable used by `hedera-sdk-cpp-generate-private-key-from-mnemonic-example` to generate a
- `HEDERA_NETWORK`: The Hiero network name. Must be one of `mainnet`, `testnet`, or `previewnet`.
- `PASSPHRASE`: Optional variable used by `hiero-sdk-cpp-generate-private-key-from-mnemonic-example` to generate a
private key from a mnemonic with a passphrase.

The command to run an example looks like:
Expand Down Expand Up @@ -177,7 +177,7 @@ More instructions for contribution can be found in the

## Code of Conduct

Hiero uses the Linux Foundation Decentralised Trust [Code of Conduct]([https://github.com/hashgraph/.github/blob/main/CODE_OF_CONDUCT.md](https://www.lfdecentralizedtrust.org/code-of-conduct)).
Hiero uses the Linux Foundation Decentralised Trust [Code of Conduct](<[https://github.com/hashgraph/.github/blob/main/CODE_OF_CONDUCT.md](https://www.lfdecentralizedtrust.org/code-of-conduct)>).

## License

Expand Down
18 changes: 9 additions & 9 deletions src/sdk/examples/AccountAliasExample.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*-
*
* Hedera C++ SDK
* Hiero C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
* Copyright (C) 2020 - 2024 Hiero
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,25 +32,25 @@
#include <dotenv.h>
#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
dotenv::init();
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

// Get a client for the Hedera testnet, and set the operator account ID and key such that all generated transactions
// Get a client for the Hiero testnet, and set the operator account ID and key such that all generated transactions
// will be paid for by this account and be signed by this key.
Client client = Client::forTestnet();
client.setOperator(operatorAccountId, operatorPrivateKey);

/*
* Hedera supports a form of auto account creation.
* Hiero supports a form of auto account creation.
*
* You can "create" an account by generating a private key, and then deriving the public key, without any need to
* interact with the Hedera network. The public key more or less acts as the user's account ID. This public key is an
* account's mAliasKey: a public key that aliases (or will eventually alias) to a Hedera account.
* interact with the Hiero network. The public key more or less acts as the user's account ID. This public key is an
* account's mAliasKey: a public key that aliases (or will eventually alias) to a Hiero account.
*
* An AccountId takes one of two forms: a normal AccountId with a null mAliasKey member takes the form 0.0.123, while
* an AccountId with a non-null mAliasKey member takes the form
Expand All @@ -62,9 +62,9 @@ int main(int argc, char** argv)
* transactions, however most queries and transactions involving such an AccountId won't work until Hbar has been
* transferred to the mAliasKey account.
*
* There is no record in the Hedera network of an account associated with a given mAliasKey until an amount of Hbar is
* There is no record in the Hiero network of an account associated with a given mAliasKey until an amount of Hbar is
* transferred to the account. The moment that Hbar is transferred to that mAliasKey AccountId is the moment that that
* account actually begins to exist in the Hedera ledger.
* account actually begins to exist in the Hiero ledger.
*/

// Generate a ED25519 private, public key pair
Expand Down
8 changes: 4 additions & 4 deletions src/sdk/examples/AccountAllowanceExample.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*-
*
* Hedera C++ SDK
* Hiero C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
* Copyright (C) 2020 - 2024 Hiero
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,15 +34,15 @@
#include <dotenv.h>
#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
dotenv::init();
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

// Get a client for the Hedera testnet, and set the operator account ID and key such that all generated transactions
// Get a client for the Hiero testnet, and set the operator account ID and key such that all generated transactions
// will be paid for by this account and be signed by this key.
Client client = Client::forTestnet();
client.setOperator(operatorAccountId, operatorPrivateKey);
Expand Down
8 changes: 4 additions & 4 deletions src/sdk/examples/AccountAllowanceSerializedExample.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*-
*
* Hedera C++ SDK
* Hiero C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
* Copyright (C) 2020 - 2024 Hiero
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,15 +36,15 @@
#include <dotenv.h>
#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
dotenv::init();
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

// Get a client for the Hedera testnet, and set the operator account ID and key such that all generated transactions
// Get a client for the Hiero testnet, and set the operator account ID and key such that all generated transactions
// will be paid for by this account and be signed by this key.
Client client = Client::forTestnet();
client.setOperator(operatorAccountId, operatorPrivateKey);
Expand Down
12 changes: 6 additions & 6 deletions src/sdk/examples/AccountCreateWithHtsExample.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*-
*
* Hedera C++ SDK
* Hiero C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
* Copyright (C) 2020 - 2024 Hiero
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,15 +36,15 @@
#include <dotenv.h>
#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
dotenv::init();
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

// Get a client for the Hedera testnet, and set the operator account ID and key such that all generated transactions
// Get a client for the Hiero testnet, and set the operator account ID and key such that all generated transactions
// will be paid for by this account and be signed by this key.
Client client = Client::forTestnet();
client.setOperator(operatorAccountId, operatorPrivateKey);
Expand All @@ -62,7 +62,7 @@ int main(int argc, char** argv)
std::cout << "---------" << std::endl;

/**
* Step 1: Create an NFT using the Hedera token service.
* Step 1: Create an NFT using the Hiero token service.
*/
TokenId tokenId = TokenCreateTransaction()
.setTokenName("HIP-542 Example Collection")
Expand Down Expand Up @@ -131,7 +131,7 @@ int main(int argc, char** argv)
std::cout << "---------" << std::endl;

/**
* Step 1: Create a fungible token using the Hedera token service.
* Step 1: Create a fungible token using the Hiero token service.
*/
tokenId = TokenCreateTransaction()
.setTokenName("HIP-542 Token")
Expand Down
16 changes: 8 additions & 8 deletions src/sdk/examples/AccountCreationWaysExample.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*-
*
* Hedera C++ SDK
* Hiero C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
* Copyright (C) 2020 - 2024 Hiero
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
Expand All @@ -22,14 +22,14 @@

#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
/**
* Reference: [HIP-583 Expand alias support in CryptoCreate & CryptoTransfer
* Transactions](https://hips.hedera.com/hip/hip-583)
* In Hedera we have the concept of 4 different account representations:
* In Hiero we have the concept of 4 different account representations:
* - An account can have an account ID in shard.realm.accountNumber format (0.0.10).
* - An account can have a public key alias in
* 0.0.302D300706052B8104000A032200036847776633520568B5B4B1D074C647BE63579B3D7DC9E4B638042CB4E041C8B8 format.
Expand All @@ -45,15 +45,15 @@ int main(int argc, char** argv)
std::cout << "Account " + hederaFormat.toString() + " corresponding Long-Zero address: "
<< hederaFormat.toSolidityAddress() << std::endl;

// The Hedera Long-Form Account ID: 0.0.aliasPublicKey, i.e.
// The Hiero Long-Form Account ID: 0.0.aliasPublicKey, i.e.
// `0.0.302D300706052B8104000A032200036847776633520568B5B4B1D074C647BE63579B3D7DC9E4B638042CB4E041C8B8`
const std::unique_ptr<ECDSAsecp256k1PrivateKey> privateKey = ECDSAsecp256k1PrivateKey::generatePrivateKey();
const AccountId aliasAccountId = privateKey->getPublicKey()->toAccountId();
std::cout << "Hedera Long-Form Account ID: " + aliasAccountId.toString() << std::endl;
std::cout << "Hiero Long-Form Account ID: " + aliasAccountId.toString() << std::endl;

// The Hedera Account Long-Zero address `0x000000000000000000000000000000000000000a` (for accountId 0.0.10)
// The Hiero Account Long-Zero address `0x000000000000000000000000000000000000000a` (for accountId 0.0.10)
const AccountId longZeroAddress = AccountId::fromString("0x000000000000000000000000000000000000000a");
std::cout << "Hedera Account Long-Zero address: " << longZeroAddress.toString() << std::endl;
std::cout << "Hiero Account Long-Zero address: " << longZeroAddress.toString() << std::endl;

// The Ethereum Account Address / public-address `0xb794f5ea0ba39494ce839613fffba74279579268`.
const AccountId evmAddress = AccountId::fromString("0xb794f5ea0ba39494ce839613fffba74279579268");
Expand Down
18 changes: 9 additions & 9 deletions src/sdk/examples/AutoCreateAccountTransferTransactionExample.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*-
*
* Hedera C++ SDK
* Hiero C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
* Copyright (C) 2020 - 2024 Hiero
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,15 +35,15 @@
#include <memory>
#include <thread>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
dotenv::init();
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

// Get a client for the Hedera testnet, and set the operator account ID and key such that all generated transactions
// Get a client for the Hiero testnet, and set the operator account ID and key such that all generated transactions
// will be paid for by this account and be signed by this key.
Client client = Client::forTestnet();
client.setOperator(operatorAccountId, operatorPrivateKey);
Expand All @@ -56,15 +56,15 @@ int main(int argc, char** argv)
* - Extract the ECDSA public key.
* - Extract the Ethereum public address.
* - Use the `TransferTransaction`.
* - Populate the `FromAddress` with the sender Hedera account ID.
* - Populate the `FromAddress` with the sender Hiero account ID.
* - Populate the `ToAddress` with Ethereum public address.
* - Note: Can transfer from public address to public address in the `TransferTransaction` for complete accounts.
* Transfers from hollow accounts will not work because the hollow account does not have a public key
* assigned to authorize transfers out of the account.
* - Sign the `TransferTransaction` transaction using an existing Hedera account and key paying for the transaction
* - Sign the `TransferTransaction` transaction using an existing Hiero account and key paying for the transaction
* fee.
* - The `AccountCreateTransaction` is executed as a child transaction triggered by the `TransferTransaction`.
* - The Hedera account that was created has a public address the user specified in the TransferTransaction ToAddress.
* - The Hiero account that was created has a public address the user specified in the TransferTransaction ToAddress.
* - Will not have a public key at this stage.
* - Cannot do anything besides receive tokens or hbars.
* - The alias property of the account does not have the public address.
Expand Down Expand Up @@ -105,7 +105,7 @@ int main(int argc, char** argv)
.freezeWith(&client);

/**
* Step 5: Sign the `TransferTransaction` transaction using an existing Hedera account and key paying for the
* Step 5: Sign the `TransferTransaction` transaction using an existing Hiero account and key paying for the
* transaction fee.
*/
const TransactionResponse response = transferTransaction.execute(client);
Expand All @@ -126,7 +126,7 @@ int main(int argc, char** argv)
// Populate the account public EVM Address from Mirror Node
newAccountId.populateAccountEvmAddress(client);

// If Mirror Node contained the account public EVM Address. It should be printed instead of the Hedera AccountID
// If Mirror Node contained the account public EVM Address. It should be printed instead of the Hiero AccountID
std::cout << newAccountId.toString() << std::endl;

return 0;
Expand Down
Loading

0 comments on commit 4dce809

Please sign in to comment.