Skip to content

Commit 177248e

Browse files
authored
Merge branch 'hiero-ledger:main' into main
2 parents 13b3573 + 48441a1 commit 177248e

File tree

62 files changed

+3861
-276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3861
-276
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
OPERATOR_ID=<YOUR_OPERATOR_ID> #your account id, can be retrived from https://portal.hedera.com/dashboard
22
OPERATOR_KEY=<YOUR_PRIVATE_KEY> #your testnet private key, can be retrieved from https://portal.hedera.com/dashboard
3-
NETWORK=<NETWORK> #eg testnet/previewnet/mainnet
3+
NETWORK=<NETWORK> #eg testnet/local/previewnet/mainnet, default to testnet or local
44

55
# RECIPIENT_ID=<RECIPIENT_ID> #optional
66
# RECIPIENT_KEY=<RECIPIENT_KEY> #optional

.github/dependabot.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,4 @@ updates:
1414
directory: "/"
1515
schedule:
1616
interval: "daily"
17-
open-pull-requests-limit: 10
18-
- package-ecosystem: "pip-compile"
19-
directory: "/"
20-
schedule:
21-
interval: "daily"
22-
open-pull-requests-limit: 10
23-
- package-ecosystem: "pipenv"
24-
directory: "/"
25-
schedule:
26-
interval: "daily"
27-
open-pull-requests-limit: 10
17+
open-pull-requests-limit: 10

.github/workflows/pr-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
statuses: write
3232
steps:
3333
- name: Harden the runner (Audit all outbound calls)
34-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
34+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
3535
with:
3636
egress-policy: audit
3737

3838
- name: Check PR Title
39-
uses: step-security/conventional-pr-title-action@8a8989588c2547f23167c4c42f0fb2356479e81b # v3.2.1
39+
uses: step-security/conventional-pr-title-action@cb1c5657ccf4c42f5c0a6c0708cb8251b960d902 # v3.2.5
4040
env:
4141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4242

@@ -47,7 +47,7 @@ jobs:
4747
contents: read
4848
steps:
4949
- name: Harden the runner (Audit all outbound calls)
50-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
50+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
5151
with:
5252
egress-policy: audit
5353

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
id-token: write
1919
steps:
2020
- name: Harden the runner (Audit all outbound calls)
21-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
21+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
2222
with:
2323
egress-policy: audit
2424

2525
- name: Checkout repository
26-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727

2828
- name: Set up Python
29-
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4.9.1
29+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
3030

3131
- name: Upgrade pip
3232
run: pip install --upgrade pip
@@ -41,4 +41,4 @@ jobs:
4141
run: python -m build
4242

4343
- name: Publish to PyPI
44-
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1
44+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python-version: ["3.10", "3.11", "3.12"]
21+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2222

2323
steps:
2424
- name: Harden the runner (Audit all outbound calls)
25-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
25+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
2626
with:
2727
egress-policy: audit
2828

2929
- name: Checkout repository
30-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3131

3232
- name: Set up Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
33+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
3434
with:
3535
python-version: ${{ matrix.python-version }}
3636
cache: 'pip'
3737

3838
- name: Install uv
39-
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
39+
uses: astral-sh/setup-uv@2ddd2b9cb38ad8efd50337e8ab201519a34c9f24 # v7.1.1
4040

4141
- name: Install setuptools wheel
4242
run: pip install --upgrade pip setuptools wheel
@@ -49,7 +49,7 @@ jobs:
4949

5050
- name: Prepare Hiero Solo
5151
id: solo
52-
uses: hiero-ledger/hiero-solo-action@b76850c1ac44466900f8e7412b309c3aa0f539c1 # v0.14
52+
uses: hiero-ledger/hiero-solo-action@6a1a77601cf3e69661fb6880530a4edf656b40d5 # v0.14.0
5353
with:
5454
installMirrorNode: true
5555

CHANGELOG.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,50 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
77
## [Unreleased]
88

99
### Added
10-
10+
- Added `docs/sdk_developers/pylance.md`, a new guide explaining how to set up and use **Pylance** in VS Code for validating imports, file references, and methods before review. (#713)
11+
- docs: Add Google-style docstrings to `TokenId` class and its methods in `token_id.py`.
12+
- added Google-style docstrings to the `TransactionRecord` class including all dataclass fields, `__repr__`, `_from_proto()` & `_to_proto()` methods.
13+
- Standardized docstrings, improved error handling, and updated type hinting (`str | None` to `Optional[str]`) for the `FileId` class (#652).
1114
- Add Google-style docstrings to `AccountInfo` class and its methods in `account_info.py`.
1215
- Added comprehensive Google-style docstrings to the `Logger` class and all utility functions in `src/hiero_sdk_python/logger/logger.py` (#639).
1316
- add AccountRecordsQuery class
14-
17+
- chore: added python 3.13 to test.yml workflow (#510, #449)
18+
- Transaction bytes serialization support: `Transaction.freeze()`, `Transaction.to_bytes()`, and `Transaction.from_bytes()` methods for offline signing and transaction storage
1519
- docs: Add Google-style docstrings to `ContractId` class and methods in `contract_id.py`.
20+
- Added TokenUnpauseTransaction class
21+
- Added expiration_time, auto_renew_period, auto_renew_account, fee_schedule_key, kyc_key in `TokenCreateTransaction`, `TokenUpdateTransaction` classes
22+
- Added comprehensive Google-style docstrings to the `CustomFee` class and its methods in `custom_fee.py`.
23+
- docs: Add `docs/sdk_developers/project_structure.md` to explain repository layout and import paths.
1624

1725
### Changed
1826
- chore: validate that token airdrop transactions require an available token service on the channel (#632)
1927
- chore: update local environment configuration in env.example (#649)
28+
- chore: Update env.example NETWORK to encourage testnet or local usage (#659)
29+
- chore: updated pyproject.toml with python 3.10 to 3.13 (#510, #449)
2030
- chore: fix type hint for TokenCancelAirdropTransaction pending_airdrops parameter
2131
- chore: Moved documentation file `common_issues.md` from `examples/sdk_developers/` to `docs/sdk_developers/` for unified documentation management (#516).
32+
- chore: Refactored the script of examples/custom_fee.py into modular functions
33+
- fix: Replaced `collections.namedtuple` with `typing.NamedTuple` in `client.py` for improved type checking.
34+
- chore: Refactored examples/custom_fee.py into three separate example files.
35+
- Expanded `docs/sdk_developers/checklist.md` with a self-review guide for all pull request submission requirements (#645).
36+
- Expanded docs/sdk_developers/signing.md to clarify GPG and DCO requirements and add a Table of Contents (#455).
37+
- chore: Standardized client initialization across all examples/ files to promote consistency (#658).
38+
- chore: changed the file names of airdrop examples, classes, unit and integration tests so they are grouped together. (#631)
2239

2340
### Fixed
24-
2541
- Added explicit read permissions to examples.yml (#623)
42+
- Removed deprecated Logger.warn() method and legacy parameter swap logic from get_logger() (#673).
2643
- Improved type hinting in `file_append_transaction.py` to resolve 'mypy --strict` errors. ([#495](https://github.com/hiero-ledger/hiero-sdk-python/issues/495))
27-
44+
- fix: Resolve `__eq__` type conflict in `CustomFee` class (#627)
45+
- Fixes a type conflict in `token_id.py` where `from_string` could receive `None`, preventing a runtime error by raising a `ValueError` if the input is missing. #630
46+
- Dependabot alerts (version bumps)
47+
2848
### Breaking Changes
49+
- chore: changed the file names airdrop classes (#631)
50+
{pending_airdrop_id.py -> token_airdrop_pending_id.py}
51+
{pending_airdrop_record.py -> token_airdrop_pending_record.py}
52+
{token_cancel_airdrop_transaction.py -> token_airdrop_transaction_cancel.py}
53+
2954

3055
## [0.1.7] - 2025-10-28
3156

@@ -50,6 +75,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
5075
- docs: workflow.md documenting key steps to creating a pull request (#605)
5176
- Added `docs/discord.md` explaining how to join and navigate the Hiero community Discord (#614).
5277

78+
5379
### Changed
5480

5581
- Added direct links to Python SDK channel in Linux Foundation Decentralized Trust Discord back in
@@ -82,7 +108,6 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
82108
- Type hinting for `Topic` related transactions.
83109

84110
### Removed
85-
86111
- Remove deprecated camelCase alias support and `_DeprecatedAliasesMixin`; SDK now only exposes snake_case attributes for `NftId`, `TokenInfo`, and `TransactionReceipt`. (Issue #428)
87112

88113
## [0.1.6] - 2025-10-21
@@ -123,6 +148,8 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
123148
- Improved `CONTRIBUTING.md` by explaining the /docs folder structure and fixing broken hyperlinks.(#431)
124149
- Converted class in `token_nft_info.py` to dataclass for simplicity.
125150

151+
152+
126153
### Fixed
127154

128155
- Incompatible Types assignment in token_transfer_list.py

docs/sdk_developers/checklist.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
# Pull Request Checklist
1+
# Developer PR Submission Checklist
22

3-
Before submitting your PR, verify:
3+
## Table of Contents
4+
- [Prior to Submission](#1-prior-to-submission)
5+
- [Post-Submission Verification](#2-post-submission-verification)
6+
7+
---
8+
9+
## 1. Prior to Submission
410

511
## Required ✅
612

@@ -16,13 +22,36 @@ Before submitting your PR, verify:
1622
- [ ] Verified GitHub shows commits as "Verified"
1723

1824
## Don't Do This ❌
25+
Once you have opened your Pull Request (PR), you must double-check the automated workflow results **BEFORE** requesting a formal review.
1926

2027
- [ ] Work on the `main` branch
2128
- [ ] Mix multiple issues in one PR
2229
- [ ] Skip changelog updates
2330
- [ ] Force push without `--force-with-lease`
2431
- [ ] Include sensitive information
2532

33+
## 2. Post-Submission Verification
34+
35+
Once you have opened your Pull Request (PR), you must double-check the automated workflow results **BEFORE** requesting a formal review.
36+
37+
### How to Verify All Requirements on GitHub
38+
39+
Navigate to your PR page on GitHub and use the **Checks** and **Commits** tabs to verify the following:
40+
41+
| Requirement | GitHub Location | Status to Look For | Action if Failed |
42+
| :--- | :--- | :--- | :--- |
43+
| **Commit Signature** | **Commits Tab** | Must show **"Verified"** (Green badge) | See **[Signing Guide](signing.md)** for how to set up GPG and fix unverified commits. |
44+
| **DCO Check** | **Checks Tab** | The "DCO" or "License" check must show a **Green Checkmark**. | See **[Signing Guide](signing.md)** to ensure your commits have the DCO sign-off (`-s`). |
45+
| **Tests Pass (CI)** | **Checks Tab** (Workflows like 'Integration Tests') | All required tests must show a **Green Checkmark**. | View the logs for the failing check to debug the error locally. |
46+
| **Changelog Formatting** | **Checks Tab** ('PR Formatting / Changelog Check') | Must show a **Green Checkmark**. | Correct the `CHANGELOG.md` and force push. See **[Changelog Guide](changelog_entry.md)**. |
47+
48+
### The Files Changed Tab
49+
50+
The **Files Changed Tab** shows the exact **difference** between your branch and the `main` branch. This is the key document maintainers use for review.
51+
**Your Goal:** Submitted PRs should have a diff that achieves the issue and meets all items in the pre-submit checklist.
52+
53+
---
54+
2655
## Need Help?
2756

2857
- **Signing issues?**[Signing Guide](signing.md)
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Hiero Python SDK Project Structure
2+
3+
Welcome to the Hiero Python SDK! Understanding the repository's structure is the first step to contributing effectively. This guide outlines the main directories and explains where to find the core SDK functionality, helping you locate the classes and methods you need to use and modify.
4+
5+
## Table of Contents
6+
7+
- [Top-Level File Structure](#top-level-file-structure)
8+
- [The `docs` Directory](#the-docs-directory)
9+
- [The `examples` Directory](#the-examples-directory)
10+
- [The `src` Directory (Core SDK)](#the-src-directory-core-sdk)
11+
- [The `tests` Directory](#the-tests-directory)
12+
- [Implications for Development (How to Import)](#implications-for-development-how-to-import)
13+
- [Conclusion](#conclusion)
14+
15+
---
16+
17+
## Top-Level File Structure
18+
19+
The repository is organized into four main directories:
20+
21+
- `/docs`: All project documentation.
22+
- `/examples`: Runnable example scripts for SDK users.
23+
- `/src`: The SDK source code. **This is where you will make code changes.**
24+
- `/tests`: The unit and integration tests for the SDK.
25+
26+
### The `docs` Directory
27+
28+
This directory contains all documentation for both users and developers of the SDK.
29+
30+
- **`docs/sdk_users/`**: Guides for people *using* the SDK in their applications (e.g., `running_examples.md`).
31+
- **`docs/sdk_developers/`**: Guides for people *contributing* to the SDK (e.g., `CONTRIBUTING.md`, `signing.md`, `testing.md`).
32+
33+
### The `examples` Directory
34+
35+
This folder contains complete, runnable Python scripts demonstrating how to use the SDK for various operations, such as creating tokens or submitting topic messages. This is the best place to see the SDK in action.
36+
37+
### The `src` Directory (Core SDK)
38+
39+
This is the heart of the SDK. The main source code lives inside `src/hiero_sdk_python/`. As an SDK developer, you will spend most of your time reading and modifying files in this directory.
40+
41+
#### `src/hiero_sdk_python/hapi`
42+
43+
This directory contains the Python classes auto-generated from the Hedera `.proto` (protobuf) files.
44+
45+
- **Do not edit files here!** They are generated automatically by running `uv run python generate_proto.py`.
46+
- This is an advanced concept, but it can be useful to look at these files (especially in `hapi/services/`) to understand the exact data structures required by the Hedera network APIs.
47+
48+
#### Core SDK Modules
49+
50+
The other directories inside `src/hiero_sdk_python/` contain the actual SDK logic. This is where you will add features, fix bugs, and make your contributions.
51+
52+
Each directory corresponds to a specific area of functionality:
53+
54+
- **`account/`**: Contains transactions and queries related to Hedera accounts (e.g., `AccountCreateTransaction`, `AccountInfoQuery`).
55+
- **`address_book/`**: Contains logic for node address books.
56+
- **`client/`**: Contains the main `Client` class that manages network connections and operators.
57+
- **`consensus/`**: For Hedera Consensus Service (HCS) (e.g., `TopicCreateTransaction`, `TopicMessageSubmitTransaction`).
58+
- **`contract/`**: For Hedera Smart Contract Service (HSCS) (e.g., `ContractCreateTransaction`, `ContractCallQuery`).
59+
- **`file/`**: For Hedera File Service (HFS) (e.g., `FileCreateTransaction`, `FileContentsQuery`).
60+
- **`logger/`**: Internal logging utilities.
61+
- **`nodes/`**: Transactions for managing network nodes (privileged operations).
62+
- **`query/`**: Base classes and logic for all network queries.
63+
- **`schedule/`**: For the Hedera Schedule Service (e.g., `ScheduleCreateTransaction`).
64+
- **`tokens/`**: For Hedera Token Service (HTS) (e.g., `TokenCreateTransaction`, `CustomFixedFee`).
65+
- **`transaction/`**: Base classes and logic for all network transactions.
66+
- **`utils/`**: Helper utilities, like for checksums or entity ID parsing.
67+
68+
There are also individual files (e.g., `Duration.py`, `channels.py`, `exceptions.py`, `hbar.py`) that provide utility classes.
69+
70+
When you work on an issue, you will most likely be modifying a file within one of these directories, such as `src/hiero_sdk_python/tokens/custom_fixed_fee.py`. Each file contains the specific logic for the services we provide for the Hedera network.
71+
72+
### The `tests` Directory
73+
74+
This directory contains all the automated tests for the SDK, separated into two main types:
75+
76+
- **`tests/unit/`**: Unit tests that check individual functions and classes in isolation. They are fast and do not require a network connection.
77+
- **`tests/integration/`**: Integration tests that run end-to-end workflows against a live Hedera network (or a local `solo` network). These are marked with `@pytest.mark.integration`.
78+
79+
All contributions require new or updated tests to be included.
80+
81+
---
82+
83+
## Implications for Development (How to Import)
84+
85+
When you create a new feature (e.g., an imaginary `src/hiero_sdk_python/fees/step_fee.py`), you will need to import and use classes and functions from other modules.
86+
87+
For example, your new "step fee" logic might need:
88+
- `AccountId` (from `account/`) to know who pays and who receives the fee.
89+
- `TokenId` (from `tokens/`) if the fee is paid with a token.
90+
- The `Client` (from `client/`) to make network calls.
91+
92+
This is why every file begins with an import block. These imports must be correct and point to the exact location of the file within the `src/` directory.
93+
94+
### Finding the Correct Import Path
95+
96+
The import path always starts from the root of the package, `hiero_sdk_python`.
97+
98+
**Example 1: Importing the `TokenId` class**
99+
- **File Location:** `src/hiero_sdk_python/tokens/token_id.py`
100+
- **Class Name:** `TokenId`
101+
- **Correct Import:** `from hiero_sdk_python.tokens.token_id import TokenId`
102+
103+
**Example 2: Importing a Protobuf type**
104+
- **File Location:** `src/hiero_sdk_python/hapi/services/basic_types_pb2.py`
105+
- **File to Import:** `basic_types_pb2`
106+
- **Correct Import:** `from hiero_sdk_python.hapi.services import basic_types_pb2`
107+
108+
A tool like Pylance (in VS Code) can help verify your import paths and flag any that are incorrect.
109+
110+
---
111+
112+
## Conclusion
113+
114+
This guide outlines the basic file structure of the project. By understanding where different types of code live (`src/`, `tests/`, `examples/`, `docs/`), you can more easily find the classes you need to import and know where to place your new contributions.

0 commit comments

Comments
 (0)