Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Opt-in Transaction Fails with transferAsset Function #24

Open
meetthosar opened this issue Mar 4, 2025 · 2 comments
Open

Opt-in Transaction Fails with transferAsset Function #24

meetthosar opened this issue Mar 4, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@meetthosar
Copy link

In the current implementation, for opt-in transactions, the asset amount must be set to 0. However, using the transferAsset function with the asset amount set to 0 causes the transaction to fail. Interestingly, if the addAssetAmount function is not chained in the transferAsset call, the opt-in transaction works as expected.

To address this issue, I propose adding a dedicated function for opt-in transactions in the AlgorandTransactionCrafter class to handle this scenario more effectively.

@PhearZero PhearZero added the bug Something isn't working label Mar 4, 2025
@PhearZero
Copy link
Member

This looks like an issue with the encoder, validated that the toEncodingData from the algosdk is the same structure that is produced by the AssetTransferTxBuilder but the encoded bytes are not equal.

@meetthosar
Copy link
Author

Yes, I am facing a similar situation. Currently, I am trying to create a similar transaction for an application call. Using bytesToSign from algosdk makes the transaction successful with hashi, while toEncodingData produces the same structure but results in unequal bytes.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants