Documentation
¶
Index ¶
Constants ¶
View Source
const ModuleName = "price-feeder"
Variables ¶
View Source
var ( ErrMissingExchangeRate = "missing exchange rate for %s" ErrWebsocketDial = "error connecting to %s websocket: %w" ErrWebsocketClose = "error closing %s websocket: %w" ErrWebsocketSend = "error sending to %s websocket: %w" ErrWebsocketRead = "error reading from %s websocket: %w" ErrTickerNotFound = "%s failed to get ticker price for %s" ErrCandleNotFound = "%s failed to get candle price for %s" )
Functions ¶
This section is empty.
Types ¶
type CandlePrice ¶
type CandlePrice struct {
Price sdk.Dec // last trade price
Volume sdk.Dec // volume
TimeStamp int64 // timestamp
}
CandlePrice defines price, volume, and time information for an exchange rate.
func NewCandlePrice ¶
func NewCandlePrice(provider, symbol, lastPrice, volume string, timeStamp int64) (CandlePrice, error)
NewCandlePrice parses the lastPrice and volume to a decimal and returns a CandlePrice.
type CurrencyPair ¶
CurrencyPair defines a currency exchange pair consisting of a base and a quote. We primarily utilize the base for broadcasting exchange rates and use the pair for querying for the ticker prices.
func (CurrencyPair) String ¶
func (cp CurrencyPair) String() string
String implements the Stringer interface and defines a ticker symbol for querying the exchange rate.
type TickerPrice ¶
TickerPrice defines price and volume information for a symbol or ticker exchange rate.
func NewTickerPrice ¶
func NewTickerPrice(provider, symbol, lastPrice, volume string) (TickerPrice, error)
NewTickerPrice parses the lastPrice and volume to a decimal and returns a TickerPrice.
Click to show internal directories.
Click to hide internal directories.