
Overview
Starkzap provides comprehensive support for ERC20 token operations, including balance queries, transfers, and type-safe amount handling. This module allows you to work with:- Bitcoin wrappers on Starknet - wBTC, lBTC, tBTC (wrapped Bitcoin tokens that represent Bitcoin on Starknet)
- Stablecoins - USDC, USDT, and other stablecoins
- Other ERC20 tokens - Any ERC20-compatible token on Starknet
Token Presets
The SDK ships with pre-configured token definitions for mainnet and Sepolia:Token Shape
Getting Tokens for Current Network
Resolving Unknown Tokens
Resolve tokens from on-chain contract addresses:Checking Balances
Transferring Tokens
Single Transfer
Batch Transfer (Multiple Recipients)
Send to multiple recipients in a single transaction:With Sponsored Fees
Working with Amounts
TheAmount class provides precision-safe handling of token amounts, preventing common errors when converting between human-readable values and raw blockchain values.
Creating Amounts
Converting and Displaying
Arithmetic
All arithmetic operations return newAmount instances (immutable):
Comparisons
Comparisons between incompatible amounts return
false (never throw).Using Amounts in Transactions
Amounts work seamlessly with all SDK methods:Token Approval
For operations that require spending tokens (like staking), you may need to approve first:Best Practices
- Always use Amount.parse() for user input to avoid precision errors
- Use token presets instead of hardcoding addresses
- Check balances before transfers to provide better UX
- Use batch transfers when sending to multiple recipients to save gas
- Format amounts for display using
toFormatted()for better UX
Common Patterns
Checking if User Has Enough Balance
Checking Balance Covers Transfer + Fee
Next Steps
- Learn about Staking & Delegation
- Explore Transaction Builder for complex operations
- Check the API Reference for detailed method signatures