Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.


### Added
- Added method chaining examples to the developer training guide (`docs/sdk_developers/training/coding_token_transactions.md`) (#1194)
- examples/mypy.ini for stricter type checking in example scripts
- Added a GitHub Actions workflow that reminds contributors to link pull requests to issues.
- Added `__str__` and `__repr__` methods to `AccountInfo` class for improved logging and debugging experience (#1098)
Expand Down
18 changes: 18 additions & 0 deletions docs/sdk_developers/training/coding_token_transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,24 @@ def set_account_id(self, account_id: AccountId) -> "TokenAssociateTransaction":

```

This feature enables chaining.

For example:

### Standard Usage

```python
tx.set_account_id(account_id)
tx.set_token_id(token_id)
tx.freeze()
tx.execute(client)
```
or
### Method Chaining
```python
tx.set_account_id(account_id).set_token_id(token_id).freeze().execute(client)
```

## 4. Protobuf Conversion

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