Skip to content

Conversation

@manishdait
Copy link
Contributor

Description:
This PR refactors AbstractTokenTransferTransaction to unified the common logic of creating TokenTransferList, for TransferTransaction and TokenAirdropTransaction.

Changes Made:

  • Moved shared logic for add_token_transfer and add_nft_transfer into the AbstractTokenTransaction class.
  • Refactored TransferTransaction and TokenAirdropTransaction class.

Related issue(s):

Fixes #404

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@manishdait manishdait marked this pull request as ready for review November 3, 2025 14:44
@nadineloepfe
Copy link
Contributor

yay! Thanks @manishdait, with this we get rid of quite a lot of duplicate code. Awesome work!
only thing to flag would be the inconsistent method call in _init_nft_transfers and the changelog.

@manishdait manishdait force-pushed the feat/improve-abstract-token-transfer branch from 583b55d to 10d0607 Compare November 4, 2025 13:53
@exploreriii
Copy link
Contributor

Hi @manishdait
Could you rebase?
I've been investigating why some of our examples workflows are not running

note we have two airdrop examples that ran, but we have just merged two more.
Therefore, i'm thinking it might be if your branch is behind the main, the workflow will only run on your branch content.
Additionally, if a PR breaks imports etc, the examples will just not run - so it says 'all checks pass' but that's because its omitting the example (or solo checks). So, it means, we don't really see which checks didn't run, I wonder if we can add a firm didn't run as that provides faster feedback.

************ examples/token_airdrop.py ************
Connecting to Hedera testnet...

Creating a new account...
✅ Success! Created a new recipient account with ID: 0.0.1067

Creating a token...
✅ Success! Created token: 0.0.1068

Creating a nft...
✅ Success! Created nft: 0.0.1069

Minting a nft...
✅ Success! Nft minted serial: 1.

Associating tokens to recipient...
Tokens associated with recipient:
0.0.1068: 0
0.0.1069: 0

✅ Success! Token association complete.

Airdropping tokens...
Token airdrop ID: [email protected]
Recipient balance after token airdrop:
0.0.1068: 1
0.0.1069: 1

✅ Success! Token Airdrop transaction successful

************ examples/token_airdrop_cancel.py ************
Connecting to Hedera testnet...

Creating a new account...
Created a new account with ID: 0.0.1070

Creating token: First Token (TKA)...
Created token First Token with ID: 0.0.1071

Creating token: Second Token (TKB)...
Created token Second Token with ID: 0.0.1072

Airdropping tokens...
Token airdrop complete: (status: 22, transaction_id: [email protected])

Canceling airdrops...
Airdrop cancel transaction successful

Signed-off-by: Manish Dait <[email protected]>
Signed-off-by: Manish Dait <[email protected]>
Signed-off-by: Manish Dait <[email protected]>
Signed-off-by: Manish Dait <[email protected]>
@manishdait manishdait force-pushed the feat/improve-abstract-token-transfer branch from 10d0607 to 1bffe80 Compare November 6, 2025 12:45
@exploreriii exploreriii merged commit a919abc into hiero-ledger:main Nov 7, 2025
12 checks passed
@manishdait manishdait deleted the feat/improve-abstract-token-transfer branch November 8, 2025 12:54
MonaaEid pushed a commit to MonaaEid/hiero-sdk-python that referenced this pull request Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor TransferTransaction to extend AbstractTokenTransferTransaction

3 participants