Skip to content

Commit 2473279

Browse files
authored
Merge branch 'main' into chore/refactor-token-examples
2 parents f75b1be + e1ffa96 commit 2473279

File tree

164 files changed

+9683
-1592
lines changed

Some content is hidden

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

164 files changed

+9683
-1592
lines changed

.env.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
OPERATOR_ID=<YOUR_OPERATOR_ID> #your private key, can be retrived from https://portal.hedera.com/dashboard
2-
OPERATOR_KEY=<YOUR_PRIVATE_KEY> # your account id, can be retrieved from https://portal.hedera.com/dashboard
3-
NETWORK=<NETWORK> #eg testnet/previewnet/mainnet
1+
OPERATOR_ID=<YOUR_OPERATOR_ID> #your account id, can be retrived from https://portal.hedera.com/dashboard
2+
OPERATOR_KEY=<YOUR_PRIVATE_KEY> #your testnet private key, can be retrieved from https://portal.hedera.com/dashboard
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/examples.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Run Examples
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
branches:
8+
- "**"
9+
pull_request:
10+
workflow_dispatch:
11+
12+
jobs:
13+
run-examples:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Harden the runner (Audit all outbound calls)
17+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
18+
with:
19+
egress-policy: audit
20+
21+
- name: Checkout repository
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@1781c6eb42f98d67097986d30130a8ff6879fda2
28+
29+
- name: Install dependencies
30+
run: uv sync
31+
32+
- name: Generate Proto Files
33+
run: uv run python generate_proto.py
34+
35+
- name: Prepare Hiero Solo
36+
id: solo
37+
uses: hiero-ledger/hiero-solo-action@6a1a77601cf3e69661fb6880530a4edf656b40d5 #v0.14.0
38+
with:
39+
installMirrorNode: true
40+
- name: Run Examples
41+
env:
42+
OPERATOR_ID: ${{ steps.solo.outputs.accountId }}
43+
OPERATOR_KEY: ${{ steps.solo.outputs.privateKey }}
44+
CHAIN_ID: 012A
45+
NETWORK: solo
46+
shell: bash
47+
run: |
48+
set -euo pipefail
49+
files=$(ls examples/*.py)
50+
51+
for file in $files;
52+
do
53+
echo -e "\n************ ${file} ************"
54+
55+
module="examples.$(basename "$file" .py)"
56+
57+
# Run the example and capture both stdout and stderr
58+
if ! output=$(uv run -m "$module" 2>&1); then
59+
echo -e "\n❌ Example failed: ${file}"
60+
echo "************ Error Output ************"
61+
echo "$output"
62+
echo "**************************************"
63+
exit 1
64+
fi
65+
66+
echo "$output"
67+
echo "✅ Completed ${file} successfully."
68+
done

.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: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,93 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
66

77
## [Unreleased]
88

9-
- Refactor `query_balance.py` into modular, reusable functions with `setup_client()`, `create_account()`, `get_balance()`, `transfer_hbars()`, and `main()` for improved readability, maintainability, and error handling.
10-
- Unified balance and transfer logging format — both now consistently display values in hbars for clarity.
9+
### Added
10+
- Add `TokenFeeScheduleUpdateTransaction` class to support updating custom fee schedules on tokens (#471).
11+
- Add `examples/token_update_fee_schedule_fungible.py` and `examples/token_update_fee_schedule_nft.py` demonstrating the use of `TokenFeeScheduleUpdateTransaction`.
12+
- Update `docs/sdk_users/running_examples.md` to include `TokenFeeScheduleUpdateTransaction`.
13+
- added FreezeTransaction class
14+
- added FreezeType class
15+
- 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)
16+
- feat: TokenAirdropClaim Transaction, examples (with signing required and not), unit and integration tests (#201)
17+
- docs: Add Google-style docstrings to `TokenId` class and its methods in `token_id.py`.
18+
- added Google-style docstrings to the `TransactionRecord` class including all dataclass fields, `__repr__`, `_from_proto()` & `_to_proto()` methods.
19+
- Standardized docstrings, improved error handling, and updated type hinting (`str | None` to `Optional[str]`) for the `FileId` class (#652).
20+
- Add Google-style docstrings to `AccountInfo` class and its methods in `account_info.py`.
21+
- Added comprehensive Google-style docstrings to the `Logger` class and all utility functions in `src/hiero_sdk_python/logger/logger.py` (#639).
22+
- add AccountRecordsQuery class
23+
- chore: added python 3.13 to test.yml workflow (#510, #449)
24+
- Transaction bytes serialization support: `Transaction.freeze()`, `Transaction.to_bytes()`, and `Transaction.from_bytes()` methods for offline signing and transaction storage
25+
- docs: Add Google-style docstrings to `ContractId` class and methods in `contract_id.py`.
26+
- Added TokenUnpauseTransaction class
27+
- Added expiration_time, auto_renew_period, auto_renew_account, fee_schedule_key, kyc_key in `TokenCreateTransaction`, `TokenUpdateTransaction` classes
28+
- Added comprehensive Google-style docstrings to the `CustomFee` class and its methods in `custom_fee.py`.
29+
- docs: Add `docs/sdk_developers/project_structure.md` to explain repository layout and import paths.
30+
31+
### Changed
32+
- chore: replaced hardcoded 'testnet' messages with environment network name
33+
- chore: validate that token airdrop transactions require an available token service on the channel (#632)
34+
- chore: update local environment configuration in env.example (#649)
35+
- chore: Update env.example NETWORK to encourage testnet or local usage (#659)
36+
- chore: updated pyproject.toml with python 3.10 to 3.13 (#510, #449)
37+
- chore: fix type hint for TokenCancelAirdropTransaction pending_airdrops parameter
38+
- chore: Moved documentation file `common_issues.md` from `examples/sdk_developers/` to `docs/sdk_developers/` for unified documentation management (#516).
39+
- chore: Refactored the script of examples/custom_fee.py into modular functions
40+
- fix: Replaced `collections.namedtuple` with `typing.NamedTuple` in `client.py` for improved type checking.
41+
- chore: Refactored examples/custom_fee.py into three separate example files.
42+
- Expanded `docs/sdk_developers/checklist.md` with a self-review guide for all pull request submission requirements (#645).
43+
- Expanded docs/sdk_developers/signing.md to clarify GPG and DCO requirements and add a Table of Contents (#455).
44+
- chore: Standardized client initialization across all examples/ files to promote consistency (#658).
45+
- chore: changed the file names of airdrop examples, classes, unit and integration tests so they are grouped together. (#631)
46+
- Refactor `AbstractTokenTransferTransaction` to unify Token/NFT transfer logic.
47+
48+
### Fixed
49+
- Added explicit read permissions to examples.yml (#623)
50+
- Removed deprecated Logger.warn() method and legacy parameter swap logic from get_logger() (#673).
51+
- Improved type hinting in `file_append_transaction.py` to resolve 'mypy --strict` errors. ([#495](https://github.com/hiero-ledger/hiero-sdk-python/issues/495))
52+
- fix: Resolve `__eq__` type conflict in `CustomFee` class (#627)
53+
- 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
54+
- Dependabot alerts (version bumps)
55+
- Fixed incorrect `TokenType` import (protobuf vs. SDK enum) in 18 example files.
56+
- Update `schedule_sign_transaction_e2e_test` to check for key presence instead of relying on index.
57+
58+
### Breaking Changes
59+
- chore: changed the file names airdrop classes (#631)
60+
{pending_airdrop_id.py -> token_airdrop_pending_id.py}
61+
{pending_airdrop_record.py -> token_airdrop_pending_record.py}
62+
{token_cancel_airdrop_transaction.py -> token_airdrop_transaction_cancel.py}
63+
64+
- In `TokenAirdropTransaction` the parameters of the following methods have been renamed:
65+
- add_nft_transfer(sender → sender_id, receiver → receiver_id)
66+
- add_approved_nft_transfer(sender → sender_id, receiver → receiver_id)
67+
68+
## [0.1.7] - 2025-10-28
1169

1270
### Added
71+
72+
- Expanded `README.md` with a new "Follow Us" section detailing how to watch, star, and fork the repository (#472).
1373
- Refactored `examples/topic_create.py` into modular functions for better readability and reuse.
1474
- Add Rebasing and Signing section to signing.md with instructions for maintaining commit verification during rebase operations (#556)
1575
- Add `examples/account_id.py` demonstrating AccountId class usage including creating standard AccountIds, parsing from strings, comparing instances, and creating AccountIds with public key aliases
1676
- Added Google-style docstrings to `CustomFractionalFee` class and its methods in `custom_fractional_fee.py`.
1777
- Added `dependabot.yaml` file to enable automated dependency management.
1878
- Common issues guide for SDK developers at `examples/sdk_developers/common_issues.md`
1979
- Added documentation for resolving changelog conflicts in `docs/common_issues.md`
20-
- - Added comprehensive changelog entry guide at `docs/sdk_developers/changelog.md` to help contributors create proper changelog entries (#532).
80+
- Added comprehensive changelog entry guide at `docs/sdk_developers/changelog.md` to help contributors create proper changelog entries (#532).
2181
- docs: Added Google-style docstrings to `CustomFixedFee` class and its methods in `custom_fixed_fee.py`.
2282
- docs: Add Google-style docstrings to `CustomRoyaltyFee` class and its methods in `custom_royalty_fee.py`.
2383
- docs: Add Google-style docstrings to `AbstractTokenTransferTransaction` class and its methods in `abstract_token_transfer_transaction.py`.
2484
- docs: Add Google-style docstrings to `TokenRelationship` class and its methods in `token_relationship.py`.
2585
- feat: add initial testing guide structure
2686
- Added `checksum` filed for TopicId, FileId, ContractId, ScheduleId class
87+
- Added workflow for running example scripts.
88+
- docs: workflow.md documenting key steps to creating a pull request (#605)
89+
- Added `docs/discord.md` explaining how to join and navigate the Hiero community Discord (#614).
90+
2791

2892
### Changed
2993

94+
- Added direct links to Python SDK channel in Linux Foundation Decentralized Trust Discord back in
95+
- Updated all occurrences of non-functional Discord invite links throughout the documentation with the new, stable Hyperledger and Hedera invite links (#603).
3096
- Refactored TopicId class to use @dataclass decorator for reducing boilerplate code
3197
- Renamed `examples/nft_allowance.py` to `examples/account_allowance_nft.py` for consistency with account class naming scheme
3298
- Added changelog conflict resolution examples to `docs/common_issues.md`
@@ -43,6 +109,10 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
43109
- Converted monolithic function in `token_create_nft_infinite.py` to multiple modular functions for better structure and ease.
44110
- docs: Use relative paths for internal GitHub links (#560).
45111
- Update pyproject.toml maintainers list.
112+
– docs: Updated README.md/CHANGELOG.md and added blog.md, bud.md and setup.md (#474)
113+
- renamed docs/sdk_developers/changelog.md to docs/sdk_developers/changelog_entry.md for clarity.
114+
- Refactor `query_balance.py` into modular, reusable functions with `setup_client()`, `create_account()`, `get_balance()`, `transfer_hbars()`, and `main()` for improved readability, maintainability, and error handling.
115+
- Unified balance and transfer logging format — both now consistently display values in hbars for clarity.
46116

47117
### Fixed
48118

@@ -91,6 +161,8 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
91161
- Improved `CONTRIBUTING.md` by explaining the /docs folder structure and fixing broken hyperlinks.(#431)
92162
- Converted class in `token_nft_info.py` to dataclass for simplicity.
93163

164+
165+
94166
### Fixed
95167

96168
- Incompatible Types assignment in token_transfer_list.py
@@ -103,6 +175,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
103175
- Add strict type hints to `TransactionGetReceiptQuery` (#420)
104176
- Fixed broken documentation links in CONTRIBUTING.md by converting absolute GitHub URLs to relative paths
105177
- Updated all documentation references to use local paths instead of pointing to hiero-sdk project hub
178+
- chore: fix the examples workflow to log error messages and run on import failure (#738)
106179

107180
## [0.1.5] - 2025-09-25
108181

0 commit comments

Comments
 (0)