- Updated src/config.ts to handle multiple HIRO_API_KEYS as an array, added methods for generating hashed Durable Object names and reverse lookup of keys from DO IDs.
- Enhanced src/index.ts with CacheService and CacheKeyService initialization, implemented fast-path KV cache checking for /contract-calls/read-only/ endpoints, and added round-robin selection of ContractCallsDO instances using a KV counter for load balancing.
- Modified src/durable-objects/contract-calls-do.ts to assign Hiro API keys based on DO IDs, pass keys to StacksContractFetcher, and set higher priority for non-cache-busting requests in the queue.
- Updated src/services/stacks-api-service.ts to accept and use Hiro API keys in the constructor for authentication middleware.
- Adjusted src/services/stacks-contract-data-service.ts to accept and forward Hiro API keys to StacksApiService.
- Improved src/services/request-queue-service.ts by adding priority to QueuedRequest, accepting priority in enqueue, and sorting the queue by priority in processQueue.
- Integrated Hiro rate limit headers by updating TokenBucket to sync from response headers, modifying StacksApiService to perform custom fetches and pass headers for syncing, and updating StacksContractFetcher to use the sync functionality after requests.
- Marked all implementation steps and tasks as completed in docs/PLAN.md and docs/QUESTIONS.md.
-
Fixed test scripts to trim trailing slashes from API_URL, preventing double-slash path malformations.
-
Added path normalization in ContractCallsDO to handle multiple slashes robustly.
-
Improved error handling with try-catch blocks to ensure consistent status codes and prevent unexpected 500s.
-
Added warnings for missing Hiro API keys to improve debuggability.
-
Marked all steps as completed in docs/PLAN.md after validation; tests now pass with the fixes.
-
Added missing Logger imports to fix "Logger is not defined" errors in various services and DOs.