SPB Git

Repository Public

MonitorAPI.swift 1.5 KB 25 lines swift

1// SP Wallet Core2// File: Sources/SPWalletCore/Domains/Ops/MonitorAPI.swift3// Description: The read-only monitoring endpoints (services/api/src/monitor/routes.ts) and the quote engine's statistics route4//              (services/api/src/quotes/engine.ts). Each answer is cached a few seconds by the server; nothing here changes state.5//6// Author: Simon-Pierre Boucher7// Contact: contact@spboucher.ai8import Foundation910public struct MonitorAPI: Sendable {11    let client: APIClient12    public init(_ client: APIClient) { self.client = client }1314    /** Wallet, agents and derivatives accounts, each with its nature (real / simulated); five separate totals. */15    public func capital() async throws -> MonitorCapital { try await client.get("/monitor/capital") }16    /** Equity differences today / 7 days / 30 days per agent and per derivatives account (flows included). */17    public func pnl() async throws -> MonitorPnl { try await client.get("/monitor/pnl") }18    /** Exposure per asset, real and simulated apart. */19    public func exposure() async throws -> MonitorExposure { try await client.get("/monitor/exposure") }20    /** Connectors, background loops, quote engine, backup, disk, audit chain, signer, versions, capabilities, strategy sandbox. */21    public func health() async throws -> MonitorHealth { try await client.get("/monitor/health") }22    /** Connections, subscriptions, rates, conflation, drops, upstream state and lag of the live quote stream. */23    public func quoteStreamStats() async throws -> QuoteStreamStats { try await client.get("/stream/stats") }24}25
Files main
Menu

Theme