How beemol/llcore works
LLCore is a Swift library for exchange API integration. Its principal workflow is to configure an exchange and endpoint, build a signed request, and parse wallet or API-key information returned by the exchange; error detectors translate HTTP and exchange-payload failures into domain errors. The library also exposes polling and shared data models. The excerpts show the components and some dependencies, but not a complete request-execution path, so connections between request construction and response parsing are left unverified.
Main entry points: ExchangeRegistry.swift Exchange registry · APIDomainError.swift Domain errors · APIRequestBuilder.swift Signed request builders · ByBitApiKeyInfoParser.swift ByBit key parser
Components 16
Exchange configuration
- Exchange registry
Sources/LLCore/Models/ExchangeRegistry.swift - Exchange types
Sources/LLCore/Models/ExchangeType.swift
Requests and parsing
- Signed request builders
Sources/LLCore/RequestBuilders/APIRequestBuilder.swift - Wallet parsers
Sources/LLCore/Parsers/Parsers.swift - ByBit key parser
Sources/LLCore/Parsers/ByBitApiKeyInfoParser.swift
Error handling
- Exchange error detectors
Sources/LLCore/ErrorHandlers/ErrorDetector.swift - HTTP error detector
Sources/LLCore/ErrorHandlers/HTTPStatusErrorDetector.swift - HTTP error mapper
Sources/LLCore/ErrorModel/APIErrorMapper.swift - Exchange error codes
Sources/LLCore/ErrorModel/ExchangeAPIErrorCode.swift - Domain errors
Sources/LLCore/ErrorModel/APIDomainError.swift
Runtime support
- API key data
Sources/LLCore/Models/ApiKeyInfoData.swift - Shared data models
Sources/LLCore/Models/DataModel.swift - Polling strategy
Sources/LLCore/Service/PollingStrategy.swift - Core helpers
Sources/LLCore/Helpers.swift
Other components
- Library client
- Exchange API
Connections 16
- Library client → Exchange registry: configures
- Exchange registry → Exchange types: uses capabilities
Sources/LLCore/Models/ExchangeRegistry.swift - Exchange registry → Signed request builders: registers factories
Sources/LLCore/Models/ExchangeRegistry.swift - Exchange registry → Wallet parsers: registers factories
Sources/LLCore/Models/ExchangeRegistry.swift - Exchange registry → ByBit key parser: registers factory
Sources/LLCore/Models/ExchangeRegistry.swift - Signed request builders → Exchange types: reads endpoints
Sources/LLCore/RequestBuilders/APIRequestBuilder.swift - Signed request builders → Exchange API: sends signed request
- Exchange API → Wallet parsers: returns wallet data
- Exchange API → ByBit key parser: returns key data
- ByBit key parser → API key data: creates model
Sources/LLCore/Parsers/ByBitApiKeyInfoParser.swift - HTTP error detector → HTTP error mapper: maps HTTP errors
Sources/LLCore/ErrorHandlers/HTTPStatusErrorDetector.swift - HTTP error detector → Exchange error detectors: checks payload errors
Sources/LLCore/ErrorHandlers/HTTPStatusErrorDetector.swift - Exchange error detectors → Domain errors: throws domain errors
Sources/LLCore/ErrorHandlers/ErrorDetector.swift - HTTP error mapper → Domain errors: returns mapped errors
Sources/LLCore/ErrorModel/APIErrorMapper.swift - Exchange error codes → Domain errors: defines error codes
Sources/LLCore/ErrorModel/ExchangeAPIErrorCode.swift - Polling strategy → Domain errors: reports retry limit
Sources/LLCore/Service/PollingStrategy.swift