Quick Start
Get up and running with AlgoKit Utils in 5 minutes.
Prerequisites
Section titled “Prerequisites”- Node.js >= 20.0
- AlgoKit CLI installed
- LocalNet running (
algokit localnet start)
Installation
Section titled “Installation”npm install @algorandfoundation/algokit-utilsYour First Transaction
Section titled “Your First Transaction”Create a file called hello-algorand.ts:
import { AlgorandClient, AlgoAmount } from '@algorandfoundation/algokit-utils';
async function main() { // 1. Connect to LocalNet const algorand = AlgorandClient.defaultLocalNet();
// 2. Create a new random account const sender = algorand.account.random(); console.log('Created account:', sender.addr);
// 3. Fund the account from the LocalNet dispenser await algorand.account.ensureFunded(sender, AlgoAmount.Algo(10)); console.log('Funded account with 10 ALGO');
// 4. Check the balance const info = await algorand.account.getInformation(sender); console.log('Balance:', AlgoAmount.MicroAlgo(info.balance).algo, 'ALGO');
// 5. Create a second account and send a payment const receiver = algorand.account.random();
const result = await algorand.send.payment({ sender: sender.addr, receiver: receiver.addr, amount: AlgoAmount.Algo(1), });
console.log('Payment sent! Transaction ID:', result.txIds[0]);
// 6. Check receiver balance const receiverInfo = await algorand.account.getInformation(receiver); console.log('Receiver balance:', AlgoAmount.MicroAlgo(receiverInfo.balance).algo, 'ALGO');}
main().catch(console.error);Run it:
npx tsx hello-algorand.tsWhat’s Next?
Section titled “What’s Next?”- AlgorandClient - Learn about the main entry point
- Account Management - Different ways to create and manage accounts
- Transaction Management - Build and send transactions
- Examples - Browse 100+ runnable examples