Skip to content

Commit 855f399

Browse files
authored
docs: add method chaining examples (hiero-ledger#1200)
Signed-off-by: Your Name <[email protected]>
1 parent ea91f78 commit 855f399

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
99

1010

1111
### Added
12+
- Added method chaining examples to the developer training guide (`docs/sdk_developers/training/coding_token_transactions.md`) (#1194)
1213
- examples/mypy.ini for stricter type checking in example scripts
1314
- Added a GitHub Actions workflow that reminds contributors to link pull requests to issues.
1415
- Added `__str__` and `__repr__` methods to `AccountInfo` class for improved logging and debugging experience (#1098)

docs/sdk_developers/training/coding_token_transactions.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ def set_account_id(self, account_id: AccountId) -> "TokenAssociateTransaction":
6565

6666
```
6767

68+
This feature enables chaining.
69+
70+
For example:
71+
72+
### Standard Usage
73+
74+
```python
75+
tx.set_account_id(account_id)
76+
tx.set_token_id(token_id)
77+
tx.freeze()
78+
tx.execute(client)
79+
```
80+
or
81+
### Method Chaining
82+
```python
83+
tx.set_account_id(account_id).set_token_id(token_id).freeze().execute(client)
84+
```
85+
6886
## 4. Protobuf Conversion
6987

7088
The Hedera network communicates via Protocol Buffers (Protobuf). Your transaction class is responsible for converting its Python fields into a Protobuf message.

0 commit comments

Comments
 (0)