Skip to content

Commit c2c3bbf

Browse files
committed
docs(account): improve module docstring for account_allowance_approve_transaction_nft example
Updated CHANGELOG.md Signed-off-by: Sarthak Tyagi <[email protected]>
1 parent ea91f78 commit c2c3bbf

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

CHANGELOG.md

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

6363
### Changed
64+
- Improved docstring for `account_allowance_approve_transaction_nft.py` with purpose, key concepts and required vs optional steps.
6465
- Updated Codecov coverage thresholds in 'codecov.yml' to require 90% of project coverage and 92% of patch coverage (#1157)
6566
- 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)
6667
- 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: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
"""
2-
This example demonstrates approving an NFT allowance and transferring the NFT using it.
3-
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.
2+
Example: Approving an NFT allowance and transferring the NFT using it.
3+
4+
Why:
5+
This example demonstrates how NFT allowances work on the Hedera network.
6+
It shows how an owner can approve another account (the spender) to transfer
7+
their NFT to a receiver. This is useful for understanding NFT permissions
8+
and automated transfers in decentralized applications.
9+
10+
Key Concepts:
11+
- Owner: The account that owns the NFT and grants allowance.
12+
- Spender: The account approved to transfer the Owner's NFT.
13+
- Receiver: The account that will receive the NFT.
14+
- NFT Allowance: Permission given by the Owner to the Spender to transfer NFT(s).
15+
16+
High-Level Steps:
17+
Required:
18+
1. Create Owner, Spender, and Receiver accounts.
19+
2. Create and mint an NFT to the Owner.
20+
3. Approve the Spender to transfer the Owner's NFT.
21+
4. Transfer the NFT using the approved allowance.
22+
Optional:
23+
- Associate the NFT with the Receiver account (depends on network/account setup).
1024
1125
Usage:
1226
uv run examples/account/account_allowance_approve_transaction_nft.py
1327
"""
1428

29+
1530
import os
1631
import sys
1732
from dotenv import load_dotenv

0 commit comments

Comments
 (0)