Skip to content

Commit c153093

Browse files
authored
Merge branch 'hiero-ledger:main' into main
2 parents 642cd68 + 70de9a5 commit c153093

File tree

10 files changed

+1200
-184
lines changed

10 files changed

+1200
-184
lines changed

MAINTAINERS.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Maintainers
2+
3+
The general handling of Maintainer rights and all groups in this GitHub org is done in the https://github.com/hiero-ledger/governance repository.
4+
5+
## Maintainer Scopes, GitHub Roles and GitHub Teams
6+
7+
Maintainers are assigned the following scopes in this repository:
8+
9+
| Scope | Definition | GitHub Role | GitHub Team |
10+
| ---------- | ------------------------ | ----------- | ---------------------------------- |
11+
| Maintainer | The GitHub Maintain role | Maintain | `hiero-sdk-python-maintainers` |
12+
13+
## Active Maintainers
14+
15+
<!-- Please keep this sorted alphabetically by github -->
16+
17+
| Name | GitHub ID | Scope | LFID | Discord ID | Email | Company Affiliation |
18+
|----- | --------- | ----- | ---- | ---------- | ----- | ------------------- |
19+
| | | | | | | |
20+
21+
22+
## Emeritus Maintainers
23+
24+
| Name | GitHub ID | Scope | LFID | Discord ID | Email | Company Affiliation |
25+
|----- | --------- | ----- | ---- | ---------- | ----- | ------------------- |
26+
| | | | | | | |
27+
28+
## The Duties of a Maintainer
29+
30+
Maintainers are expected to perform the following duties for this repository. The duties are listed in more or less priority order:
31+
32+
- Review, respond, and act on any security vulnerabilities reported against the repository.
33+
- Review, provide feedback on, and merge or reject GitHub Pull Requests from
34+
Contributors.
35+
- Review, triage, comment on, and close GitHub Issues
36+
submitted by Contributors.
37+
- When appropriate, lead/facilitate architectural discussions in the community.
38+
- When appropriate, lead/facilitate the creation of a product roadmap.
39+
- Create, clarify, and label issues to be worked on by Contributors.
40+
- Ensure that there is a well defined (and ideally automated) product test and
41+
release pipeline, including the publication of release artifacts.
42+
- When appropriate, execute the product release process.
43+
- Maintain the repository CONTRIBUTING.md file and getting started documents to
44+
give guidance and encouragement to those wanting to contribute to the product, and those wanting to become maintainers.
45+
- Contribute to the product via GitHub Pull Requests.
46+
- Monitor requests from the LF Decentralized Trust Technical Advisory Council about the
47+
contents and management of LFDT repositories, such as branch handling,
48+
required files in repositories and so on.
49+
- Contribute to the LFDT Project's Quarterly Report.
50+
51+
## Becoming a Maintainer
52+
53+
This community welcomes contributions. Interested contributors are encouraged to
54+
progress to become maintainers. To become a maintainer the following steps
55+
occur, roughly in order.
56+
57+
- The proposed maintainer establishes their reputation in the community,
58+
including authoring five (5) significant merged pull requests, and expresses
59+
an interest in becoming a maintainer for the repository.
60+
- A PR is created to update this file to add the proposed maintainer to the list of active maintainers.
61+
- The PR is authored by an existing maintainer or has a comment on the PR from an existing maintainer supporting the proposal.
62+
- The PR is authored by the proposed maintainer or has a comment on the PR from the proposed maintainer confirming their interest in being a maintainer.
63+
- The PR or comment from the proposed maintainer must include their
64+
willingness to be a long-term (more than 6 month) maintainer.
65+
- Once the PR and necessary comments have been received, an approval timeframe begins.
66+
- The PR **MUST** be communicated on all appropriate communication channels, including relevant community calls, chat channels and mailing lists. Comments of support from the community are welcome.
67+
- The PR is merged and the proposed maintainer becomes a maintainer if either:
68+
- Two weeks have passed since at least three (3) Maintainer PR approvals have been recorded, OR
69+
- An absolute majority of maintainers have approved the PR.
70+
- If the PR does not get the requisite PR approvals, it may be closed.
71+
- Once the add maintainer PR has been merged, any necessary updates to the GitHub Teams are made.
72+
73+
## Removing Maintainers
74+
75+
Being a maintainer is not a status symbol or a title to be carried
76+
indefinitely. It will occasionally be necessary and appropriate to move a
77+
maintainer to emeritus status. This can occur in the following situations:
78+
79+
- Resignation of a maintainer.
80+
- Violation of the Code of Conduct warranting removal.
81+
- Inactivity.
82+
- A general measure of inactivity will be no commits or code review comments
83+
for one reporting quarter. This will not be strictly enforced if
84+
the maintainer expresses a reasonable intent to continue contributing.
85+
- Reasonable exceptions to inactivity will be granted for known long term
86+
leave such as parental leave and medical leave.
87+
- Other circumstances at the discretion of the other Maintainers.
88+
89+
The process to move a maintainer from active to emeritus status is comparable to the process for adding a maintainer, outlined above. In the case of voluntary
90+
resignation, the Pull Request can be merged following a maintainer PR approval. If the removal is for any other reason, the following steps **SHOULD** be followed:
91+
92+
- A PR is created to update this file to move the maintainer to the list of emeritus maintainers.
93+
- The PR is authored by, or has a comment supporting the proposal from, an existing maintainer or a member of the project's Technical Steering Commitee (TSC).
94+
- Once the PR and necessary comments have been received, the approval timeframe begins.
95+
- The PR **MAY** be communicated on appropriate communication channels, including relevant community calls, chat channels and mailing lists.
96+
- The PR is merged and the maintainer transitions to maintainer emeritus if:
97+
- The PR is approved by the maintainer to be transitioned, OR
98+
- Two weeks have passed since at least three (3) Maintainer PR approvals have been recorded, OR
99+
- An absolute majority of maintainers have approved the PR.
100+
- If the PR does not get the requisite PR approvals, it may be closed.
101+
102+
Returning to active status from emeritus status uses the same steps as adding a
103+
new maintainer. Note that the emeritus maintainer already has the 5 required
104+
significant changes as there is no contribution time horizon for those.

examples/README.md

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -82,40 +82,48 @@ balance = ( CryptoGetAccountBalanceQuery() .set_account_id(some_account_id) .exe
8282
#### Pythonic Syntax:
8383
```
8484
transaction = TokenCreateTransaction(
85-
token_name="ExampleToken",
86-
token_symbol="EXT",
87-
decimals=2,
88-
initial_supply=1000,
89-
treasury_account_id=operator_id,
90-
admin_key=admin_key
91-
supply_key=supply_key
85+
token_params=TokenParams(
86+
token_name="ExampleToken",
87+
token_symbol="EXT",
88+
decimals=2, # 0 for NON_FUNGIBLE_UNIQUE
89+
initial_supply=1000, # 0 for NON_FUNGIBLE_UNIQUE
90+
token_type=TokenType.FUNGIBLE_COMMON, # or TokenType.NON_FUNGIBLE_UNIQUE
91+
freeze_default=False,
92+
treasury_account_id=operator_id
93+
),
94+
keys=TokenKeys(
95+
admin_key=admin_key, # added but optional. Necessary for Token Delete or Update.
96+
supply_key=supply_key, # added but optional. Necessary for Token Mint or Burn.
97+
freeze_key=freeze_key # added but optional. Necessary to freeze and unfreeze a token.
98+
)
9299
).freeze_with(client)
93-
94-
transaction.sign(admin_key)
95-
transaction.sign(operator_key)
100+
transaction.sign(operator_key) # Required signing by the treasury account
101+
transaction.sign(admin_key) # Required since admin key exists
96102
transaction.execute(client)
97-
98103
```
104+
99105
#### Method Chaining:
100106
```
101107
transaction = (
102-
TokenCreateTransaction()
103-
.set_token_name("ExampleToken")
104-
.set_token_symbol("EXT")
105-
.set_decimals(2)
106-
.set_initial_supply(1000)
107-
.set_treasury_account_id(operator_id)
108-
.set_admin_key(admin_key) # Optional to create a token. Necessary for Token Delete or Update.
109-
.set_supply_key(supply_key) # Optional to change token supply. Necessary for Token Mint or Burn.
110-
.freeze_with(client)
111-
)
108+
TokenCreateTransaction() # no params => uses default placeholders which are next overwritten.
109+
.set_token_name("ExampleToken")
110+
.set_token_symbol("EXT")
111+
.set_decimals(2) # 0 for NON_FUNGIBLE_UNIQUE
112+
.set_initial_supply(1000) # 0 for NON_FUNGIBLE_UNIQUE
113+
.set_token_type(TokenType.FUNGIBLE_COMMON) # or TokenType.NON_FUNGIBLE_UNIQUE
114+
.set_freeze_default(False)
115+
.set_treasury_account_id(operator_id)
116+
.set_admin_key(admin_key) # added but optional. Necessary for Token Delete or Update.
117+
.set_supply_key(supply_key) # added but optional. Necessary for Token Mint or Burn.
118+
.set_freeze_key(freeze_key) # added but optional. Necessary to freeze and unfreeze a token.
119+
.freeze_with(client)
120+
)
112121
113-
transaction.sign(admin_key) # If admin key exists.
114-
transaction.sign(operator_key)
115-
transaction.execute(client)
122+
transaction.sign(operator_key) # Required signing by the treasury account
123+
transaction.sign(admin_key) # Required since admin key exists
124+
transaction.execute(client)
116125
```
117126

118-
119127
### Minting a Fungible Token
120128

121129
#### Pythonic Syntax:

examples/query_topic_message.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def on_error_handler(e):
2020
query = TopicMessageQuery(
2121
topic_id=os.getenv('TOPIC_ID'),
2222
start_time=datetime.now(timezone.utc),
23-
2423
limit=0,
2524
chunking_enabled=True
2625
)

examples/token_create.py

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,85 @@
1+
"""
2+
This is a simple example of how to create a token using setting methods.
3+
4+
It:
5+
1. Loads environment variables.
6+
2. Sets up a client and creates a token with the given parameters.
7+
3. Executes the token creation and prints the result.
8+
9+
Required environment variables:
10+
- OPERATOR_ID, OPERATOR_KEY (mandatory)
11+
- ADMIN_KEY, SUPPLY_KEY, FREEZE_KEY (optional)
12+
13+
Dependencies:
14+
- dotenv
15+
- hiero_sdk_python
16+
"""
17+
18+
# Adapt imports and paths as appropriate
119
import os
220
import sys
321
from dotenv import load_dotenv
4-
522
from hiero_sdk_python import (
623
Client,
724
AccountId,
825
PrivateKey,
926
TokenCreateTransaction,
1027
Network,
11-
)
28+
TokenType
29+
)
1230

31+
# Load environment variables from .env file
1332
load_dotenv()
1433

1534
def create_token():
35+
"""Function to create a fungible token on the Hedera network."""
36+
37+
# Network Setup
1638
network = Network(network='testnet')
1739
client = Client(network)
1840

41+
# Operator credentials (must be present)
1942
operator_id = AccountId.from_string(os.getenv('OPERATOR_ID'))
2043
operator_key = PrivateKey.from_string(os.getenv('OPERATOR_KEY'))
21-
admin_key = PrivateKey.from_string(os.getenv('ADMIN_KEY'))
22-
supply_key = PrivateKey.from_string(os.getenv('ADMIN_KEY')) #Optional
2344

24-
freeze_key = PrivateKey.from_string(os.getenv('FREEZE_KEY')) #Optional
45+
# Optional Token Keys
46+
admin_key = PrivateKey.from_string(os.getenv('ADMIN_KEY'))# Optional
47+
supply_key = PrivateKey.from_string(os.getenv('SUPPLY_KEY')) # Optional
48+
freeze_key = PrivateKey.from_string(os.getenv('FREEZE_KEY')) # Optional
2549

50+
# Set the operator for the client
2651
client.set_operator(operator_id, operator_key)
2752

53+
# Create the token creation transaction
54+
# In this example, we set up a default empty token create transaction, then set the values
2855
transaction = (
2956
TokenCreateTransaction()
3057
.set_token_name("MyToken")
3158
.set_token_symbol("MTK")
32-
.set_decimals(2)
33-
.set_initial_supply(10)
34-
.set_treasury_account_id(operator_id)
35-
.set_admin_key(admin_key)
36-
.set_supply_key(supply_key)
37-
.set_freeze_key(freeze_key)
38-
.freeze_with(client)
39-
.sign(operator_key)
40-
.sign(admin_key)
59+
.set_decimals(2) # 0 for NON_FUNGIBLE_UNIQUE
60+
.set_initial_supply(10) # 0 for NON_FUNGIBLE_UNIQUE
61+
.set_treasury_account_id(operator_id) # Also known as treasury account
62+
.set_token_type(TokenType.FUNGIBLE_COMMON) # or TokenType.NON_FUNGIBLE_UNIQUE
63+
.set_admin_key(admin_key) # Optional
64+
.set_supply_key(supply_key) # Optional
65+
.set_freeze_key(freeze_key) # Optional
66+
.freeze_with(client) # Freeze the transaction. Returns self so we can sign.
67+
.sign(operator_key) # Required signature of treasury account
68+
.sign(admin_key) if admin_key else None # Only sign if admin_key is present. No need to sign with the supply or freeze keys to create the token.
4169

4270
)
4371

4472
try:
73+
74+
# Execute the transaction and get the receipt
4575
receipt = transaction.execute(client)
76+
4677
if receipt and receipt.tokenId:
4778
print(f"Token created with ID: {receipt.tokenId}")
4879
else:
4980
print("Token creation failed: Token ID not returned in receipt.")
5081
sys.exit(1)
82+
5183
except Exception as e:
5284
print(f"Token creation failed: {str(e)}")
5385
sys.exit(1)

src/hiero_sdk_python/crypto/public_key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def to_proto(self):
142142
if self.is_ed25519():
143143
return basic_types_pb2.Key(ed25519=pub_bytes)
144144
else:
145-
return basic_types_pb2.Key(ECDSASecp256k1=pub_bytes)
145+
return basic_types_pb2.Key(ECDSA_secp256k1=pub_bytes)
146146

147147
def is_ed25519(self) -> bool:
148148
"""

0 commit comments

Comments
 (0)