Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Oracle ¶
type Oracle struct { PriceRecords []*PriceRecord URLPool []string PublicKeys []string }
Oracle represents a collection of price records and associated metadata.
func (*Oracle) FetchPrices ¶
FetchPrices updates the PriceRecords by fetching new data. This method should contain the logic to periodically fetch prices.
type PriceRecord ¶
type PriceRecord struct { KSH float64 KRV float64 KUSD float64 KSHMA float64 KRVMA float64 KUSDMA float64 Timestamp int64 }
PriceRecord stores the prices and moving averages of KSH, KRV, and KUSD against USDT.
func FromBytes ¶
func FromBytes(data []byte) (*PriceRecord, error)
FromBytes deserializes a byte slice into a PriceRecord.
func (*PriceRecord) ToBytes ¶
func (pr *PriceRecord) ToBytes() ([]byte, error)
ToBytes serializes the PriceRecord into a byte slice.
Click to show internal directories.
Click to hide internal directories.