All skills

Guide for writing TypeScript code with AlgoKit Utils (`@algorandfoundation/algokit-utils`). Use this skill whenever the user is building on Algorand with TypeScript — client setup, account management, payments, asset operations, atomic transaction groups, smart contract deployment and interaction (AppFactory, AppClient, ARC-56/ARC-32 specs), raw app calls, key registration, network management, testing with algorandFixture, error handling, and the low-level crypto primitives under `@algorandfoundation/algokit-utils/crypto` (Ed25519 keygen/signing/verification, SHA-512/256 `hash`, Peikert xHD BIP44 wallets, wrapped-secret patterns). Trigger on imports from `@algorandfoundation/algokit-utils` (incl. `/crypto`, `/testing`, `/transact` subpaths), references to `AlgorandClient`, `AppFactory`, `AppClient`, `AlgoAmount`, `algorandFixture`, `ed25519Generator`, `peikertXHdWalletGenerator`, `hash`, `WrappedEd25519Seed`, or `RawEd25519Signer`. Also on any TypeScript or JavaScript code that builds on Algorand.

Use this Skill: https://skilld.dev/gh/algorand-devrel/algorand-agent-skills/algokit-utils-ts

This session only. Nothing lands on disk.

referencesraw-app-calls.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Raw app calls

Send a raw app call

Call an existing application without an ABI method (a "bare" no-op call).

import { AlgorandClient } from "@algorandfoundation/algokit-utils";

const algorand = AlgorandClient.defaultLocalNet();

const sender = algorand.account.random();
await algorand.account.ensureFunded(
  sender,
  algorand.account.localNetDispenser(),
  (10).algo(),
);

const appId = 123n; // ID of an already-deployed application

const result = await algorand.send.appCall({
  sender: sender.addr,
  appId,
});

console.log(`App call TX: ${result.txIds[0]}`);

What just happened? algorand.send.appCall() built, signed, and submitted a bare application call transaction with an OnComplete of NoOp (the default). No ABI method selector is involved — the raw args array is empty. Use this when you know the app ID but do not have (or need) an app spec.

Create an app from compiled TEAL

Deploy a new application by supplying approval and clear-state programs directly.

const approvalTeal = `#pragma version 10
int 1`;
const clearTeal = `#pragma version 10
int 1`;

const createResult = await algorand.send.appCreate({
  sender: sender.addr,
  approvalProgram: approvalTeal,
  clearStateProgram: clearTeal,
  schema: {
    globalInts: 1,
    globalByteSlices: 1,
    localInts: 0,
    localByteSlices: 0,
  },
});

console.log(`Created app ${createResult.appId} at ${createResult.appAddress}`);

What just happened? algorand.send.appCreate() compiled the TEAL source strings on the node, built an application-create transaction with the specified state schema, signed it, and submitted it. The returned appId is the on-chain ID of the new application and appAddress is its Algorand address.

Update an app

Replace the approval and clear-state programs of an existing application.

const newApprovalTeal = `#pragma version 10
int 1`;
const newClearTeal = `#pragma version 10
int 1`;

const updateResult = await algorand.send.appUpdate({
  sender: sender.addr,
  appId: createResult.appId,
  approvalProgram: newApprovalTeal,
  clearStateProgram: newClearTeal,
});

console.log(`Updated app in TX: ${updateResult.txIds[0]}`);

What just happened? algorand.send.appUpdate() submitted an OnComplete.UpdateApplication transaction that swaps the on-chain programs. The appId must reference an application the sender is authorized to update.

Delete an app

Remove an application from the ledger.

const deleteResult = await algorand.send.appDelete({
  sender: sender.addr,
  appId: createResult.appId,
});

console.log(`Deleted app in TX: ${deleteResult.txIds[0]}`);

What just happened? algorand.send.appDelete() submitted an OnComplete.DeleteApplication transaction. After confirmation the application's programs and state are removed from the ledger. The sender must be the app creator (or the address the app's approval program authorises for deletion).

Call an ABI method

Invoke a specific ABI method on an existing application without using an AppClient.

import { ABIMethod } from "@algorandfoundation/algokit-utils/abi";

const method = new ABIMethod({
  name: "hello",
  args: [{ name: "name", type: "string" }],
  returns: { type: "string" },
});

const methodResult = await algorand.send.appCallMethodCall({
  sender: sender.addr,
  appId: 456n,
  method,
  args: ["world"],
});

console.log(`ABI return: ${methodResult.return?.returnValue}`);

What just happened? algorand.send.appCallMethodCall() encoded the ABI method selector and arguments, built a no-op application call, signed it, and submitted it. The return field on the result contains the ABI-decoded return value. You construct the ABIMethod manually — no app spec file is needed.

Create an app via ABI method

Deploy a new application whose creation triggers an ABI method (an ARC-4 create method).

const createMethod = new ABIMethod({
  name: "createApplication",
  args: [{ name: "greeting", type: "string" }],
  returns: { type: "void" },
});

const abiCreateResult = await algorand.send.appCreateMethodCall({
  sender: sender.addr,
  method: createMethod,
  args: ["hello"],
  approvalProgram: approvalTeal,
  clearStateProgram: clearTeal,
  schema: {
    globalInts: 1,
    globalByteSlices: 1,
    localInts: 0,
    localByteSlices: 0,
  },
});

console.log(`Created app ${abiCreateResult.appId} via ABI method`);
console.log(`ABI return: ${abiCreateResult.return?.value}`);

What just happened? algorand.send.appCreateMethodCall() combined an application-create transaction with ABI method encoding. The method selector and arguments are packed into the transaction's args array while the approval and clear-state programs are deployed on-chain. The result includes both appId (the new application ID) and return (the ABI-decoded return value).

Source: SKILL.md on GitHub

1 alert1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides a comprehensive guide for using the AlgoKit Utils TypeScript library. It follows security best practices, such as recommending environment variables for secrets, and uses standard testing mnemonics and placeholder domains in its code examples. No malicious patterns or security risks were detected.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: HIGH · 2 issues

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

Last checked against GitHub 3 weeks ago.

Activeupdated 6 months ago

README badge

README badge for algorand-devrel/algorand-agent-skills/algokit-utils-ts