Code Examples
Browse 18 runnable TypeScript examples demonstrating the Algorand TypeScript testing library. Each example is self-contained and demonstrates specific functionality.
Quick Start
Section titled “Quick Start”# Clone the repository
git clone https://github.com/algorandfoundation/algorand-typescript-testing.git
cd algorand-typescript-testing
# Install dependencies
npm install
# Run any example
cd examples
npx tsx hello-world/contract.algo.ts
Prerequisites
Section titled “Prerequisites”- Node.js >= 20
- npm
Examples (18)
Section titled “Examples (18)”| Example | Description |
|---|---|
| ARC4 Simple Voting Contract | Example source from |
| Auction | This example demonstrates a basic auction contract.
|
| Calculator Contract | Example source from |
| Hello World Contract | Example source from |
| Hello World ABI Contract | Example source from |
| Htlc Logicsig Signature | Example source from |
| Local Storage Contract | A contract demonstrating local storage functionality. This contract shows how to use local state storage in an Algorand smart contract, including initialization, reading, writing, and clearing of local state values. Local state is per-account storage that requires accounts to opt-in before use. |
| Marketplace Contract | Example source from |
| Precompiled Precompiled Apps | This logic sig can be used to create a custodial account that will allow any transaction to transfer its funds/assets. |
| Precompiled Precompiled Factory | Example source from |
| Precompiled Precompiled Typed | Example source from |
| Proof Of Attendance Contract | Example source from |
| Scratch Storage Contract | Example source from |
| Simple Voting | This example demonstrates a minimal voting contract with paid votes.
|
| Tealscript Example | Example source from |
| Tealscript Teal Script Base | Example source from |
| Voting Contract | Example source from |
| ZK Whitelist | This example demonstrates whitelist admission backed by zk proof verification.
|