I want to group 2 payment transactions using Algorand's atomic transfers feature but it's not working!
Inside of index.ts
file, there is code that is trying to atomically group 2 payment transactions and synchronously send them using atomic transfers. The code is using the Algorand JavaScript SDK and the AlgoKit Utils TypeScript.
However, if you try to run the index.ts
file after going into the challenge
directory, opening Docker Desktop, and then running:
algokit bootstrap all
algokit localnet start
npm run start
it will fail and show this error: TypeError: signer is not a function
Find out what is wrong and fix the bug.
💬 Meet other hackers working on this challenge and get help in the General Dev Discord Channel!
- Install AlgoKit.
- Install Docker. It is used to run a local Algorand network for development.
- Install Node.JS / npm
- Fork this repository.
- Clone the repository
cd [DIRECTORY_OF_YOUR_CHOICE]
git clone [FORKED_REPO_URL]
- Open the cloned repository with the code editor of your choosing.
- Setup Dev environment using AlgoKit. Run the below command inside of the
challenge
folder.
algokit bootstrap all
This command will install all dependencies and also generate a .env
file for you.
Video walkthrough of forking and cloning this repository:
fork-clone-tutorial.mp4
Now you are ready to fix the bug!
- Open Docker Desktop and launch Algorand localnet by running
algokit localnet start
in your terminal For more info click me!. - Go to
./index.ts
and read the comments on the file and fix the bug! - After fixing the bug run the below command inside of the
challenge
folder:
npm run start
- If you see:
The first payment transaction sent 1000000 microAlgos and the second payment transaction sent 2000000 microAlgos
in the console, you successfully fixed the bug! 😆
😰 Are you struggling?
atc.addTransaction()
takes in a transactionWithSigner
object as the parameter. You can get the signer of an account using the makeBasicAccountTransactionSigner
function from the Algorand JavaScript SDK.
- After fixing the bug, push your code to your forked Github repo and make a PR to the original repo.
- Inside the PR include:
- What was the problem?
- How did you solve the problem?
- Screenshot of your terminal showing the result of running
index.ts
file.
The Algorand Developer Relations team will review the submission and "approve" the PR by labeling it Approved
. Once it's approved, we will share the magic link to claim your certificate of completion NFT in the comment of the PR!
The certificate of completion NFT is a verifiable credential minted on the GoPlausible platform that follows the W3C standard for certificates and OpenBadges standard for badges.
🎉 Congratulations on completing the challenge Algodev! This was the final challenge of the 1st season of #AlgoCodingChallenge. Be on the lookout for the 2nd season of #AlgoCodingChallenge!