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.

referencesalgoamount-and-value-handling.md

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

AlgoAmount and value handling

Create amounts with helper functions

Use the algo() and microAlgo() shorthand functions for quick, readable amount creation.

import { algo, microAlgo } from "@algorandfoundation/algokit-utils";

const fiveAlgo = algo(5);
const tenThousandMicroAlgo = microAlgo(10_000);

console.log(fiveAlgo.algo); // 5
console.log(fiveAlgo.microAlgo); // 5_000_000n
console.log(tenThousandMicroAlgo.algo); // 0.01
console.log(tenThousandMicroAlgo.microAlgo); // 10_000n

What just happened: You created type-safe AlgoAmount values using the algo() and microAlgo() helper functions. Each AlgoAmount exposes both .algo (as a number) and .microAlgo (as a bigint) so you can read the value in whichever unit you need. The type system prevents you from accidentally mixing Algo and microAlgo values.

Create amounts with static constructors

Use the AlgoAmount class directly for a more explicit, self-documenting style.

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

const fiveAlgo = AlgoAmount.Algo(5);
const tenThousandMicroAlgo = AlgoAmount.MicroAlgo(10_000);

console.log(fiveAlgo.algo); // 5
console.log(tenThousandMicroAlgo.microAlgo); // 10_000n

What just happened: You created AlgoAmount instances using the static factory methods AlgoAmount.Algo() and AlgoAmount.MicroAlgo(). These are equivalent to the algo() and microAlgo() helpers — choose whichever style fits your codebase.

Convert between Algo and microAlgo

Read an amount in either unit via the .algo and .microAlgo accessors.

import { algo, microAlgo } from "@algorandfoundation/algokit-utils";

const amount = algo(1.5);
console.log(amount.algo); // 1.5
console.log(amount.microAlgo); // 1_500_000n

const small = microAlgo(500);
console.log(small.algo); // 0.0005
console.log(small.microAlgo); // 500n

What just happened: Every AlgoAmount stores the value once and converts on the fly. The .algo getter returns a number (convenient for display), while .microAlgo returns a bigint (safe for arithmetic and on-chain values where precision matters).

Use number and bigint prototype extensions

Call .algo() or .microAlgo() directly on number and bigint literals for the most concise syntax.

import "@algorandfoundation/algokit-utils";

const fiveAlgo = (5).algo();
const tenMicroAlgo = (10).microAlgo();
const largeBigintAlgo = 1_000_000n.algo();
const largeBigintMicroAlgo = 1_000_000n.microAlgo();

console.log(fiveAlgo.microAlgo); // 5_000_000n
console.log(tenMicroAlgo.algo); // 0.00001
console.log(largeBigintAlgo.microAlgo); // 1_000_000_000_000n
console.log(largeBigintMicroAlgo.algo); // 1

What just happened: Importing the library augments the Number and BigInt prototypes with .algo() and .microAlgo() methods. This lets you write amounts inline — (5).algo() reads as "5 Algo". Number also supports the plural forms .algos() and .microAlgos().

Calculate transaction fees

Use transactionFees() to compute the minimum fee for a given number of transactions.

import {
  transactionFees,
  ALGORAND_MIN_TX_FEE,
} from "@algorandfoundation/algokit-utils";

const feeForThree = transactionFees(3);
console.log(feeForThree.microAlgo); // 3_000n (3 × 1_000 µALGO)

console.log(ALGORAND_MIN_TX_FEE.microAlgo); // 1_000n

What just happened: transactionFees(n) multiplies the Algorand minimum transaction fee (1,000 microAlgo) by the number of transactions you pass in. This is useful when budgeting fees for atomic groups or inner transactions. The ALGORAND_MIN_TX_FEE constant is also exported if you need the single-transaction fee directly.

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