You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: app manager; asset manager; creator and sender abstractions (#229)
feat: app manager; asset manager; creator and sender abstractions
This commit introduces comprehensive high-level abstractions for Algorand application
and asset management, along with ergonomic transaction creation interfaces that
significantly improve developer experience while maintaining full protocol capability.
## Core Features Added
### Application Manager (`app_manager.rs`)
- Complete application lifecycle management (create, update, delete, call)
- ABI method integration with automatic encoding/decoding
- Box storage operations with binary key support and ABI type decoding
- TEAL compilation with SHA256-based caching for performance
- Application state retrieval with binary key handling for cross-language consistency
### Asset Manager (`asset_manager.rs`)
- Asset creation, configuration, and lifecycle management
- Bulk opt-in/opt-out operations for efficient batch processing
- Asset information retrieval with flattened ergonomic interface
- Account asset information access with proper type handling
### Transaction Abstractions
- **Creator** (`creator.rs`): Fluent transaction building without automatic sending
- **Sender** (`sender.rs`): Direct transaction creation and execution
- **Sender Results** (`sender_results.rs`): Rich result types with transaction metadata
- Unified error handling and validation across all transaction types
## API Client Enhancements
### Generated Client Improvements
- Vendor extension system for field customization (application-index → app_id, asset-index → asset_id)
- Proper binary data handling with base64 deserialization for TealValue.bytes
- Consistent field naming across algod and indexer clients
- Generator-level fixes to avoid manual modification of auto-generated code
### AlgorandClient Integration
- Memory-efficient Arc<AlgodClient> sharing to eliminate unnecessary cloning
- Integrated manager instances for streamlined access patterns
- Comprehensive test utilities with ergonomic Arc-based fixtures
## Developer Experience Improvements
### Type Safety & Ergonomics
- AssetInformation with flattened field access (asset.total vs asset.params.total)
- Optional close_remainder_to in asset opt-out with automatic creator resolution
- Consistent app_id/asset_id naming throughout the API surface
- Rich transaction result types with compilation metadata
### Cross-Language Consistency
- Binary key handling in application state for TypeScript/Python alignment
- Vec<u8> box identifiers for proper non-UTF-8 support
- Standardized ABI return handling across all operations
- Consistent validation patterns between creator and sender abstractions
## Technical Architecture
### Performance Optimizations
- TEAL compilation caching with SHA256 keys for large programs
- Arc-based client sharing to minimize memory overhead
- Bulk operations using TransactionComposer for efficient execution
- Early validation with comprehensive error propagation
### Code Organization
- Clean separation of concerns between managers, creators, and senders
- Leveraged existing algokit_transact validation instead of duplication
- Modular design enabling incremental adoption
- Comprehensive test coverage with deterministic validation
## Breaking Changes
- AssetManager.get_by_id() returns AssetInformation instead of raw algod types
- AssetOptOutParams.creator renamed to close_remainder_to for clarity
- Some method names updated for consistency (_method_call suffix for ABI methods)
## Migration Benefits
This foundation enables the upcoming AlgoKit App Client while providing immediate
value for direct usage. The abstractions eliminate boilerplate while preserving
full protocol access, supporting both simple operations and complex multi-transaction
workflows.
Addresses 45+ PR review comments with architectural improvements, performance
optimizations, and API refinements based on extensive feedback integration.
0 commit comments