Serialization Module
Provides helpers for decoding and encoding JV-Link payloads into strongly typed domain records.
Functions and values
| Function or value |
Description
|
Full Usage:
deserialiseOdds payload
Parameters:
byte[]
-
UTF-8 or Shift-JIS encoded JSON byte array.
Returns: Result<RaceOdds list, XanthosError>
A list of RaceOdds or a XanthosError.
|
Deserialises odds snapshots from JSON. This is an alias for parseOdds.
|
Full Usage:
parseOdds payload
Parameters:
byte[]
-
Raw bytes returned by JV-Link.
Returns: Result<RaceOdds list, XanthosError>
A list of RaceOdds or a XanthosError.
|
Decodes JV odds payloads (Shift-JIS or UTF-8) expressed as JSON into strongly typed snapshots.
|
Full Usage:
parseRaceCard payload
Parameters:
byte[]
-
Raw bytes returned by JV-Link.
Returns: Result<RaceInfo list, XanthosError>
A list of RaceInfo or a XanthosError.
|
Decodes JV race card payloads (Shift-JIS or UTF-8) expressed as JSON into strongly typed records.
|
Full Usage:
parseWatchEvent rawKey
Parameters:
string
-
The raw key string from JVWatchEvent callback.
Returns: WatchEvent
A WatchEvent with parsed fields including event type, meeting date, course code, etc.
|
Parses a raw JV watch event key string into a typed WatchEvent. JVWatchEvent returns keys in formats like "0B12RA20240101010112..." where:
|
Full Usage:
serialiseOdds snapshots
Parameters:
RaceOdds list
-
The odds snapshots to serialise.
Returns: Result<byte[], XanthosError>
UTF-8 encoded JSON byte array or a XanthosError.
|
Serialises odds snapshots to JSON for persistence or caching scenarios. The output format is compatible with parseOdds.
|
Xanthos