call-smart-contracts

Deploy and interact with Algorand smart contracts using AlgoKit CLI and generated TypeScript clients.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/Rudhrakoushik10/RootNode --skill call-smart-contracts-rudhrakoushik10
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: call-smart-contracts
Source: https://github.com/Rudhrakoushik10/RootNode/tree/main/projects/.opencode/skill/call-smart-contracts
Command: npx skills add https://github.com/Rudhrakoushik10/RootNode --skill call-smart-contracts-rudhrakoushik10

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @algorandfoundation/algokit-utils, and includes references (resource) components.

What problem does it solve? Deploying and calling Algorand smart contracts involves many moving parts—building artifacts, managing App IDs, encoding ABI calls, and reading on-chain state. This Skill provides a complete, repeatable workflow so you can deploy contracts and write interaction scripts without memorizing CLI flags or client APIs. ## Core Features & Use Cases - Build and Deploy Workflow: Compile contracts with algokit project run build and deploy to localnet, testnet, or mainnet with idempotent deploy scripts. - Typed Client Interaction: Call ABI methods, read global/local/box state, and handle opt-in, close-out, and delete operations through generated TypeScript clients. - Troubleshooting Reference: A detailed reference covers CLI commands, client patterns, environment variables, and common error resolutions. - Use Case: After building a Counter contract, deploy it to localnet, then write a script that calls the increment method and reads the updated global state using the generated typed client. ## Quick Start Ask the AI to build the contract, deploy it to localnet, and write a TypeScript script that calls a method on the deployed app using the generated client.

Frequently Asked Questions about call-smart-contracts

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

FAQPage Schema
How do I deploy an Algorand smart contract to localnet?

Run algokit project run build to compile the contract and generate artifacts, start the network with algokit localnet start, then run algokit project deploy localnet. The deploy-config.ts script handles idempotent deployment and prints the App ID.

How do I call a smart contract method from TypeScript?

Create a typed client with algorand.client.getTypedAppClientById using the generated client class and the deployed App ID, then call client.send.methodName with args. The result object contains the typed return value.

How do I read global and local state from an Algorand app?

Use client.state.global.getAll() for all global keys or client.state.global.keyName() for a typed key. For local state, call client.state.local(address).getAll(), and for boxes use client.state.box.boxName().

Why does my contract call fail with 'app does not exist'?

This error means the App ID is wrong or the app was never deployed on that network. Verify the App ID from the deployment output and confirm localnet is running with algokit localnet status.

Can I deploy the same contract to testnet or mainnet?

Yes, run algokit project deploy testnet or mainnet after setting ALGORAND_NETWORK and DEPLOYER_MNEMONIC environment variables. The deployer account must be funded on the target network.

What should I do when the generated client module is not found?

A 'Cannot find module' error means the TypeScript client was not generated yet. Run algokit project run build to compile the contract and regenerate the artifacts and client before running your script.