Skip to content

Common models

Models for server status, system info, and general responses.

rainbowminer_api_client.models.common

Models for small, shared response objects.

Covers: /version, /info, /uptime, /systemuptime, /isserver, /remoteip, /status, /decsep, /sysinfo, /cpuinfo, /sessionvars, /session, /gc, /platforms.

Version

Bases: RainbowMinerModel

Version of the RainbowMiner server (/version).

The server returns a nested object with Version and RemoteVersion fields, each a System.Version-style object (Major, Minor, Build, Revision, ...). For convenience the string form can be accessed via :meth:version_string.

Attributes:

Name Type Description
Version str | dict[str, Any] | None

Local version as a version-object dict (or a plain string on older server versions).

RemoteVersion dict[str, Any] | None

Remote/latest version object, or None.

Build str | None

Optional build identifier (kept for backward compatibility).

version_string

version_string() -> str

Return the version as a dotted string (e.g. "5.0.1.9").

Handles both the object form ({"Major": 5, "Minor": 0, ...}) and the legacy plain-string form.

Uptime

Bases: RainbowMinerModel

Uptime duration returned by /uptime and /systemuptime.

Attributes:

Name Type Description
AsString str

Human-readable duration like "1.02:03:04".

Seconds int

Total uptime in seconds.

IsServer

Bases: RainbowMinerModel

Response of /isserver.

Attributes:

Name Type Description
Status bool

True if the server runs in server mode.

LockMinersState

Bases: RainbowMinerModel

The nested LockMiners object inside :class:Status.

Attributes:

Name Type Description
Enabled bool

Whether the lock feature is enabled.

Locked bool

Whether miners are currently locked.

Pools list[str]

List of locked pool names.

Status

Bases: RainbowMinerModel

Response of /status.

Attributes:

Name Type Description
Pause bool

Whether miners are globally paused.

PauseIAOnly bool

Whether only IA (idle-aware) miners are paused.

LockMiners bool | LockMinersState

Lock state — either a bool (legacy) or a :class:LockMinersState object (current servers).

IsExclusiveRun bool

Whether the current run is exclusive.

IsDonationRun bool

Whether the current run is a donation run.

ComputerStats

Bases: RainbowMinerModel

Response of /computerstats (opaque, server-defined fields).

SysInfo

Bases: RainbowMinerModel

Response of /sysinfo (system hardware info, server-defined).

CPUInfo

Bases: RainbowMinerModel

Response of /cpuinfo (CPU info, server-defined).

SessionVars

Bases: RootModel[dict[str, Any]]

Response of /sessionvars — a flat mapping of scalar session vars.

Session

Bases: RootModel[dict[str, Any]]

Response of /session — the full session hashtable (dynamic).

GarbageCollection

Bases: RootModel[dict[str, Any]]

Response of /gc — the sync-cache contents (dynamic).

Platforms

Bases: RootModel[dict[str, Any]]

Response of /platforms — OpenCL platform info (dynamic).

Parsed from a JSON file; structure varies by system.

rainbowminer_api_client.models.profit

Models for profit, totals, and stats endpoints.

Covers: /currentprofit, /totals, /stats, /downloadlist.

CurrentProfit

Bases: RainbowMinerModel

Response of /currentprofit.

Attributes:

Name Type Description
AllProfitBTC float | int | None

Combined profit (including remote miners) in BTC.

ProfitBTC float | int | None

Local profit in BTC.

Earnings_Avg float | int | None

Average earnings (local).

Earnings_1d float | int | None

24-hour earnings (local).

AllEarnings_Avg float | int | None

Average earnings (including remote).

AllEarnings_1d float | int | None

24-hour earnings (including remote).

Rates dict[str, float | int] | None

Current exchange rates used.

PowerPrice float | int | None

Current power price.

Power float | int | dict[str, Any] | None

Current power draw — either a single number (watts) or a dict with CPU, GPU, and Offset keys.

Uptime dict[str, Any] | None

RainbowMiner uptime.

SysUptime dict[str, Any] | None

System uptime.

RemoteIP str | dict[str, Any] | None

The server's remote IP — either a plain string or a dict containing geolocation data (ip, country, etc.).

Total

Bases: RainbowMinerModel

An entry from /totals.

StatsCache

Bases: RootModel[dict[str, Any]]

Response of /stats — the stats cache (highly dynamic).

Keys are stat identifiers (e.g. "CPU#Name_Algo_HashRate"); values are objects with Live, Day, Week etc. fields. Kept as a plain dict to remain forward-compatible across RainbowMiner versions.

DownloadItem

Bases: RainbowMinerModel

An entry from /downloadlist — a queued or completed download.