JavaScript code snippets illustrating basic integration operations with Algorand.
This is a companion repository to the article: Integrating with third-party app (deposits and withdrawals) on the Algorand Developer portal.
Algorand Sandbox must be up and running in the Private network mode (default one) prior to starting this app. Please refer to the Sandbox documentation to find the most relevant information on how to download and start it.
For the best experience it is recommended to reset the Sandbox to its initial state by running the following command in the Sandbox directory:
./sandbox resetFor the best learning experience, it is recommended to run snippets in the following sequence. This ensures that everything works as expected.
Learn how to generate a standalone account on Algorand.
node generateAccount.jsLearn how to create a deterministic wallet and generate a repeatable set of addresses using only one key.
node generateAccountsUsingKmd.jsLearn how to make a basic transaction for transfer Algo.
node transferAlgo.jsLearn how to check the expected account balance before the transaction to ensure it satisfies minimum amount requirements.
node checkAccountBalance.jsLearn the peculiarities of working with Algorand Standard Assets (ASA). Make the newly created account be able to receive an ASA.
node optInASA.jsLearn how to transfer an Algorand Standard Asset (ASA).
node transferASA.jsLearn how to implement watching for new deposits and emit appropriate events. See DepostiWatcher.js.
node watchDeposits.jsA sample app able to create deposit addresses and watch for deposits: https://github.com/bakoushin/algorand-deposit-example
Alex Bakoushin
MIT
