You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
π Completion
When this issue is complete, you will have:
β Solved a real issue
β A merged pull request in the Hiero Python SDK
β Your name in the project history
β Confidence to take on larger issues next
πΎ Description of the issue
The TokenId class in src/hiero_sdk_python/tokens/token_id.py has a __str__ method that returns shard.realm.num format, but it lacks a custom __repr__ method. The default dataclass __repr__ is used, which shows all fields including checksum=None even when not relevant.
When debugging, a clearer __repr__ that shows the constructor-style call would be more helpful:
Implement a custom __repr__() method for the TokenId class that returns a clear, constructor-style representation. The checksum should not be shown (it's an internal detail).
Open the file src/hiero_sdk_python/tokens/token_id.py
Review the existing __str__() method to understand the current formatting
Review the dataclass fields: shard, realm, num, checksum
Add a new __repr__() method after the existing __str__() method (around line 172):
def__repr__(self) ->str:
""" Returns a detailed representation of the TokenId suitable for debugging. Returns: str: A string in constructor format 'TokenId(shard=X, realm=Y, num=Z)'. """returnf"TokenId(shard={self.shard}, realm={self.realm}, num={self.num})"
Run the tests to verify everything works: uv run pytest tests/
β Acceptance Criteria
The issue is solved:
My changes do exactly what the issue asked for.
I did not add extra changes:
I did not modify anything that was not mentioned in the issue description.
Nothing else was broken:
All existing features still work the same as before.
All checks pass:
The automated tests (unit and integration tests) run successfully.
π Step-by-Step Contribution Guide
Assignment: You must be assigned to the issue, comment: /assign in the issue to get assigned see guide
Fork, Branch and Work on the issue: Create a copy of the repository, create a branch for the issue and solve the problem. For instructions, please read our Contributing guide file. Further help can be found at Set-up Training (including the Windows Setup Guide for Windows users) and Workflow Training.
DCO and GPG key sign each commit : each commit must be -s and -S signed. An explanation on how to do this is at Signing Guide
Add a Changelog Entry : your pull request will require a changelog. Read Changelog Entry Guide to learn how.
Push and Create a Pull Request : Once your issue is resolved, and your commits are signed, and you have a changelog entry, push your changes and create a pull request. Detailed instructions can be found at Submit PR Training, part of Workflow Training.
You did it π: A maintainer or committer will review your pull request and provide feedback. If approved, we will merge the fix in the main branch. Thanks for being part of the Hiero community as an open-source contributor β€οΈ
IMPORTANT You will ONLY be assigned to the issue if you comment: /assign IMPORTANT Your pull request CANNOT BE MERGED until you add a changelog entry AND sign your commits each with git commit -S -s -m "chore: your commit message" with a GPG key setup.
π€ AI Usage Guidelines
You are welcome to use AI to help you understand and solve this issue.
Because AI tools can sometimes make mistakes, please take care to:
Only implement what is described in this issue
Avoid changing anything else in the file
Be careful when modifying parameters or return statements, as this may affect runtime behavior
If you're unsure, ask your mentor or the maintainers for help β they can provide expert Python SDK guidance and point you to the right examples or methods.
Additionally, we invite you to join our community on our Discord server.
We also invite you to attend each Wednesday, 2pm UTC our Python SDK Office Hour and Community Calls. The Python SDK Office hour is for hands-on-help and the Community Call for general community discussion.
ππ₯ Newcomer Friendly
This Good First Issue is a guided, well-scoped task intended for new contributors to the Hiero Python SDK.
What you'll do
Support
A maintainer or mentor actively monitors this issue and will help guide it to completion.
Important
This issue does not require prior domain knowledge.
Note
β±οΈ Typical time to complete: 30β60 minutes (once setup is done)
π§© Difficulty: Small, well-contained change
π Best for: New contributors
π Completion
When this issue is complete, you will have:
πΎ Description of the issue
The
TokenIdclass insrc/hiero_sdk_python/tokens/token_id.pyhas a__str__method that returnsshard.realm.numformat, but it lacks a custom__repr__method. The default dataclass__repr__is used, which shows all fields includingchecksum=Noneeven when not relevant.When debugging, a clearer
__repr__that shows the constructor-style call would be more helpful:π‘ Proposed Solution
Implement a custom
__repr__()method for theTokenIdclass that returns a clear, constructor-style representation. The checksum should not be shown (it's an internal detail).π©βπ» Implementation Steps
Open the file
src/hiero_sdk_python/tokens/token_id.pyReview the existing
__str__()method to understand the current formattingReview the dataclass fields:
shard,realm,num,checksumAdd a new
__repr__()method after the existing__str__()method (around line 172):Write a unit test for the new
__repr__()method:Run the tests to verify everything works:
uv run pytest tests/β Acceptance Criteria
The issue is solved:
My changes do exactly what the issue asked for.
I did not add extra changes:
I did not modify anything that was not mentioned in the issue description.
Nothing else was broken:
All existing features still work the same as before.
All checks pass:
The automated tests (unit and integration tests) run successfully.
π Step-by-Step Contribution Guide
/assignin the issue to get assigned see guideIMPORTANT You will ONLY be assigned to the issue if you comment:
/assignIMPORTANT Your pull request CANNOT BE MERGED until you add a changelog entry AND sign your commits each with
git commit -S -s -m "chore: your commit message"with a GPG key setup.π€ AI Usage Guidelines
You are welcome to use AI to help you understand and solve this issue.
Because AI tools can sometimes make mistakes, please take care to:
If you're unsure, ask your mentor or the maintainers for help β they can provide expert Python SDK guidance and point you to the right examples or methods.
π€ Additional Information
For more help, we have extensive documentation:
Additionally, we invite you to join our community on our Discord server.
We also invite you to attend each Wednesday, 2pm UTC our Python SDK Office Hour and Community Calls. The Python SDK Office hour is for hands-on-help and the Community Call for general community discussion.
You can also ask for help in a comment below!