algorand-typescript

Reference Algorand TypeScript syntax, storage patterns, and AVM safety rules.

2|Updated Jul 29, 2025
One-click install
npx skills add https://github.com/algorandfoundation/xgov-committees --skill algorand-typescript-algorandfoundation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: algorand-typescript
Source: https://github.com/algorandfoundation/xgov-committees/tree/main/.claude/skills/algorand-typescript
Command: npx skills add https://github.com/algorandfoundation/xgov-committees --skill algorand-typescript-algorandfoundation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a consolidated reference of Algorand TypeScript (PuyaTs) syntax rules and practical patterns to prevent compiler errors and runtime issues in smart contracts. It clarifies AVM type usage, value semantics with clone(), and storage access patterns across GlobalState, LocalState, and BoxMap for safe contract data management.

Core Features & Use Cases

  • AVM type usage rules (uint64, bytes, biguint) and how to avoid JavaScript numbers.
  • Storage patterns and value semantics with clone() for GlobalState, LocalState, and BoxMap.
  • Guidance on arrays, unions, and inner transactions to ensure AVM compatibility.
  • Real-world scenario: build a PuyaTs contract managing balances and storage updates safely.

Quick Start

Start by applying the rules to convert a simple PuyaTs example into a safe, AVM-compliant pattern.

Frequently Asked Questions about algorand-typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use AVM types in Algorand TypeScript contracts without causing compiler errors?

AVM types in Algorand TypeScript require using uint64, bytes, and biguint instead of JavaScript numbers to prevent compiler errors. This Skill provides concrete rules for AVM type usage, ensuring your PuyaTs contracts satisfy Algorand Virtual Machine constraints safely.

Why do I need to clone complex values when accessing GlobalState or BoxMap in PuyaTs?

You need to clone complex values in PuyaTs because AVM value semantics require explicit duplication to prevent runtime mutation issues. This Skill details safe storage patterns for GlobalState, LocalState, and BoxMap, ensuring data management integrity.

What is the best way to structure inner transactions in Algorand TypeScript for AVM compatibility?

The best way to structure inner transactions in Algorand TypeScript is to follow specific AVM compatibility guidelines for arrays and unions. This Skill provides guidance on structuring inner transactions to ensure safe execution within PuyaTs contracts.

Can I use standard JavaScript numbers when managing balances in an Algorand TypeScript smart contract?

You cannot use standard JavaScript numbers for managing balances in an Algorand TypeScript smart contract. You must use AVM types like uint64 and biguint to satisfy AVM constraints and avoid runtime issues during storage updates.

Does PuyaTs support LocalState and BoxMap storage patterns for safe contract data management?

PuyaTs supports LocalState and BoxMap storage patterns for safe contract data management. This Skill specifies concrete requirements for accessing these storage mechanisms, including value cloning and AVM type rules to prevent data corruption.