Selects accounts by preferred tree type with automatic fallback.
In V2 mode, prefers StateV2 accounts. Falls back to StateV1 if V2 has insufficient balance.
This ensures all returned accounts are from the same tree type, preventing mixed V1/V2 batch proof failures.
All available accounts (can be mixed V1/V2)
Optional
Minimum amount needed (optional - if not provided, returns all from preferred type)
Selected accounts from a single tree type
Selects accounts by preferred tree type with automatic fallback.
In V2 mode, prefers StateV2 accounts. Falls back to StateV1 if V2 has insufficient balance.
This ensures all returned accounts are from the same tree type, preventing mixed V1/V2 batch proof failures.