Index of every page on this site: llms.txt
All skills
Run it yourself

Builds Algorand dApp frontends with wallet integration and typed contract clients. Supports React, Vue, SolidJS, Svelte, and vanilla JS/TS via @txnlab/use-wallet. Covers the signer handoff pattern, wallet provider setup, network configuration, and calling contract methods from frontend code. Use when creating a dApp UI, connecting wallets, integrating typed app clients with wallet signers, or calling smart contract methods from any JavaScript or TypeScript frontend framework.

  • 3 files
  • 36.3 KB
  • Updated 8 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/algorandfoundation/algorand-agent-skills/algorand-frontend

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈125 tokens for metadata: the name and description. ≈1.1k when used: this file. ≈8.1k more on demand in 2 files.

Description uses 6.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈500 characters, or 6.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Algorand Frontends

Build frontend applications that connect to Algorand wallets and interact with smart contracts using typed clients. Works with React, Vue, SolidJS, Svelte, and vanilla JS/TS.

Prerequisites

  1. Smart contract is deployed with a known App ID
  2. ARC-56/ARC-32 app spec exists (e.g., MyContract.arc56.json)
  3. Frontend project is set up (Vite, Next.js, Nuxt, SvelteKit, or any bundler)

Core Pattern: Signer Handoff

Wallet (use-wallet) → transactionSigner
                              ↓
                    AlgorandClient.setSigner()
                              ↓
                    Typed App Client (defaultSender)
                              ↓
                    Contract Method Calls (auto-signed)

Quick Start

# Generate typed client
algokit generate client path/to/MyContract.arc56.json --output src/contracts/MyContractClient.ts

# Install core + framework adapter (pick one)
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet-react   # React
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet-vue     # Vue
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet-solid   # SolidJS
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet-svelte  # Svelte
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet         # Vanilla JS/TS

# Install wallet peer dependencies (only for wallets you use)
npm install @perawallet/connect @blockshake/defly-connect

Minimal Integration (React)

import { useWallet } from '@txnlab/use-wallet-react'
import { AlgorandClient } from '@algorandfoundation/algokit-utils'
import { MyContractClient } from './contracts/MyContractClient'

function ContractInteraction() {
  const { transactionSigner, activeAddress } = useWallet()

  const callContract = async () => {
    if (!activeAddress || !transactionSigner) return

    const algorand = AlgorandClient.testNet()
    algorand.setSigner(activeAddress, transactionSigner)

    const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
      appId: 12345n,
      defaultSender: activeAddress,
    })

    const result = await appClient.send.myMethod({ args: { value: 42n } })
    console.log('Result:', result.return)
  }

  return <button onClick={callContract}>Call Contract</button>
}

Important Rules

  1. Always call setSigner() before creating clients — signer must be registered first
  2. Check for null activeAddress and transactionSigner — null when no wallet connected
  3. Match networks — AlgorandClient network must match WalletManager network
  4. Use getTypedAppClientById() for frontends with known App IDs
  5. Check isReady before rendering wallet state — prevents SSR hydration mismatches in Next.js, Nuxt, and SvelteKit
  6. Trigger signing from direct user interaction — button clicks, not timers or effects. Some wallets (especially mobile) block or silently fail signing from useEffect/onMount/setTimeout
  7. Never use hook-returned clients as effect/callback dependencies — client and algorand from custom hooks are new references on every wallet state change. Use refs for data fetching in effects (see Example 11 in frontend-examples.md)

Reference Guide

Canonical Example Repos

Search these repositories for real-world code examples:

  • algorandfoundation/algokit-fullstack-template — Fullstack project template (React + contracts)
  • algorandfoundation/algokit-react-frontend-template — React frontend template
  • TxnLab/use-wallet — UseWallet library source and framework adapters
  • TxnLab/next-use-wallet — Next.js + UseWallet example app

Cross-References

  • New to Algorand? Read algorand-core skill first for AVM mental model
  • Smart contracts: See algorand-typescript or algorand-python skills
  • Project scaffolding and CLI: See algorand-project-setup skill

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 12acef7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 8 months ago

README badge

README badge for algorandfoundation/algorand-agent-skills/algorand-frontend