Skip to content

Commit ca24c84

Browse files
authored
docs(account): improve module docstring for account_allowance_approve… (#1204)
Signed-off-by: Sarthak Tyagi <[email protected]> Signed-off-by: Sarthak Tyagi <[email protected]>
1 parent ea16035 commit ca24c84

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
6363
- Add Linked Issue Enforcer to automatically close PRs without linked issues `.github/workflows/bot-linked-issue-enforcer.yml`.
6464

6565
### Changed
66+
- Improved docstring for `account_allowance_approve_transaction_nft.py` with purpose, key concepts and required vs optional steps.
6667
- Updated Codecov coverage thresholds in 'codecov.yml' to require 90% of project coverage and 92% of patch coverage (#1157)
6768
- Reduce office-hours reminder spam by posting only on each user's most recent open PR, grouping by author and sorting by creation time (#1121)
6869
- Pylint cleanup for token_airdrop_transaction_cancel.py (#1081) [@tiya-15](https://github.com/tiya-15)

examples/account/account_allowance_approve_transaction_nft.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
"""
2-
This example demonstrates approving an NFT allowance and transferring the NFT using it.
2+
Example: Approving an NFT allowance and transferring the NFT using it.
33
4-
- Creates an owner, spender, and receiver account.
5-
- Creates an NFT.
6-
- Mints the NFT to the owner's account.
7-
- Associates the NFT with the receiver's account.
8-
- Approves the spender to spend the owner's NFT.
9-
- Spender (as payer) transfers the NFT from the owner to the receiver.
4+
Why:
5+
This example demonstrates how to use the Hiero Python SDK to approve and
6+
execute an NFT allowance when interacting with the Hedera network.
7+
8+
Key Concepts:
9+
- Owner: The account that owns the NFT and grants the allowance.
10+
- Spender: The account approved to transfer the Owner's NFT.
11+
- Receiver: The account that will receive the NFT.
12+
- NFT Allowance: Permission granted by the Owner to the Spender to transfer NFTs.
13+
14+
High-Level Steps:
15+
Pre-requisites:
16+
1. Create Owner, Spender, and Receiver accounts.
17+
2. Create and mint an NFT to the Owner.
18+
19+
Required:
20+
3. Approve the Spender to transfer the Owner's NFT.
21+
22+
Demonstration:
23+
4. Associate the NFT with the Receiver account.
24+
5. Transfer the NFT using the approved allowance.
1025
1126
Usage:
1227
uv run examples/account/account_allowance_approve_transaction_nft.py
1328
"""
1429

30+
1531
import os
1632
import sys
1733
from dotenv import load_dotenv
@@ -212,4 +228,4 @@ def main():
212228
owner_client.close()
213229

214230
if __name__ == "__main__":
215-
main()
231+
main()

0 commit comments

Comments
 (0)