Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was the bug?
The application was encountering a
TypeError: signer is not a function
during the execution of atomic transactions using the Algorand SDK'sAtomicTransactionComposer
. This error was triggered when trying to gather signatures for the transactions. The bug stemmed from improperly passing thesender
account object as asigner
directly into theAtomicTransactionComposer
, which expects a function capable of signing transactions.How did you fix the bug?
To fix the bug, I implemented the following steps:
sender
account object was being passed directly as asigner
. Recognized that theAtomicTransactionComposer
requires a function to handle the signing process.algosdk.makeBasicAccountTransactionSigner
function to create a signer function from the sender's secret key. This function encapsulates the correct signing logic required by theAtomicTransactionComposer
.By implementing these steps, I was able to successfully resolve the bug, allowing for the correct execution of atomic transactions in the application.
Console Screenshot: