All skills

Guide for writing Python code with AlgoKit Utils (`algokit-utils`). Use this skill whenever the user is building on Algorand with Python — client setup, account management, payments, ASA operations, atomic transaction groups, smart contract deployment and interaction (AppFactory, AppClient, ARC-56/ARC-32 specs), raw app calls, TEAL compilation, key registration, network management, error handling, and the low-level crypto primitives in `algokit_crypto` (Ed25519 keygen/signing/verification, Peikert xHD BIP44 wallets, wrapped-secret patterns) and `algokit_common` (`sha512_256`). Trigger on imports from `algokit_utils` or `algokit_crypto`, references to `AlgorandClient`, `AppFactory`, `AppClient`, `AlgoAmount`, `ed25519_generator`, `peikert_hd_wallet_generator`, `sha512_256`, `WrappedEd25519Seed`, or `RawEd25519Signer`, or any Python code that builds on Algorand.

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

This session only. Nothing lands on disk.

referencesnetwork-and-client-management.md

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

Network and client management

All snippets in this section assume an AlgorandClient named algorand — see Client initialization for setup.

Access algod, indexer, and kmd clients

Retrieve the underlying SDK clients for direct low-level API calls.

algod_client = algorand.client.algod
indexer_client = algorand.client.indexer
kmd_client = algorand.client.kmd

What just happened: You accessed the raw SDK client objects through the ClientManager. These are the same clients the library uses internally — you can call any algod, indexer, or KMD REST endpoint on them directly. indexer and kmd raise ValueError if the corresponding service wasn't configured; use algorand.client.indexer_if_present to get None instead of an error.

Check if connected to LocalNet

Detect whether the current network is a local development network.

is_localnet = algorand.client.is_localnet()

if is_localnet:
    print("Running on LocalNet — safe to use test-only features")

What just happened: The ClientManager fetched the network's genesis ID from algod and checked whether it matches the known LocalNet pattern. Use this to guard development-only code paths like auto-funding from the dispenser. The companion methods is_testnet() and is_mainnet() work the same way, and network() returns a NetworkDetail dataclass with boolean flags and genesis info.

Set the default validity window

Control how many rounds a transaction remains valid before it expires.

algorand.set_default_validity_window(1000)

What just happened: All transactions created through this client will now have a validity window of 1,000 rounds (the gap between first and last valid round). Increase it if your signing workflow is slow, or decrease it for tighter replay protection. Returns Self for method chaining.

Cache suggested params

Avoid redundant algod calls by caching the transaction parameters.

import time

# Cache for 10 seconds using the timeout (in milliseconds)
algorand.set_suggested_params_cache_timeout(10_000)

# Or cache specific params until a fixed point in time
params = algorand.client.algod.suggested_params()
algorand.set_suggested_params_cache(params, until=time.time() + 3600)

What just happened: By default, every transaction fetches fresh SuggestedParams from algod (current round, genesis info, fee). Caching avoids that round-trip on every send — set_suggested_params_cache_timeout sets how long cached params stay valid (default 3,000 ms), while set_suggested_params_cache lets you inject specific params with an explicit expiry.

Source: SKILL.md on GitHub

1 warning1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill is a technical reference guide for the Algorand Python SDK (AlgoKit Utils). It promotes secure coding practices, including environment-based secret management and memory-safe cryptographic patterns for handling private keys. No malicious patterns or security risks were identified.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: MEDIUM · 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-py