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.

referencesalgoamount-and-value-handling.md

≈701 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 micro_algo() shorthand functions for quick, readable amount creation.

from algokit_utils import algo, micro_algo

five_algo = algo(5)
ten_thousand_micro_algo = micro_algo(10_000)

print(five_algo.algo)                    # Decimal('5')
print(five_algo.micro_algo)              # 5_000_000
print(ten_thousand_micro_algo.algo)      # Decimal('0.01')
print(ten_thousand_micro_algo.micro_algo)  # 10_000

What just happened: You created type-safe AlgoAmount values using the algo() and micro_algo() helper functions. Each AlgoAmount exposes both .algo (as a Decimal) and .micro_algo (as an int) 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.

from algokit_utils import AlgoAmount

five_algo = AlgoAmount.from_algo(5)
ten_thousand_micro_algo = AlgoAmount.from_micro_algo(10_000)

print(five_algo.algo)                    # Decimal('5')
print(ten_thousand_micro_algo.micro_algo)  # 10_000

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

Convert between Algo and microAlgo

Read an amount in either unit via the .algo and .micro_algo properties.

from algokit_utils import algo, micro_algo

amount = algo(1)
print(amount.algo)        # Decimal('1')
print(amount.micro_algo)  # 1_000_000

small = micro_algo(500)
print(small.algo)        # Decimal('0.0005')
print(small.micro_algo)  # 500

What just happened: Every AlgoAmount stores the value once and converts on the fly. The .algo property returns a Decimal (safe for precise arithmetic and display), while .micro_algo returns an int (the native on-chain unit).

Calculate transaction fees

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

from algokit_utils import transaction_fees, ALGORAND_MIN_TX_FEE

fee_for_three = transaction_fees(3)
print(fee_for_three.micro_algo)  # 3_000 (3 × 1_000 µAlgo)

print(ALGORAND_MIN_TX_FEE.micro_algo)  # 1_000

What just happened: transaction_fees(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 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