package
0.2.14-alpha
Repository: https://github.com/lightninglabs/faraday.git
Documentation: pkg.go.dev
# Functions
BestGranularity takes a period of time and returns the lowest granularity that we can query the coincap api in a single query.
GetPrice gets the price for a given time from a set of price data.
GetPrices gets a set of prices for a set of timestamps.
MsatToFiat converts a msat amount to fiat.
NewPriceSource returns a PriceSource which can be used to query price data.
UseLogger uses a specified Logger to output package logging info.
# Constants
CoinCapPriceBackend uses CoinCap's API for fiat price data.
CoinDeskPriceBackend uses CoinDesk's API for fiat price data.
CoinGeckoPriceBackend uses CoinGecko's API for fiat price data.
CustomPriceBackend uses user provided fiat price data.
Subsystem defines the logging code for this subsystem.
UnknownPriceBackend is used to indicate that no specific backend was specified for fiat price data and that the defaults should instead be used.
# Variables
ErrQueryTooLong is returned when we cannot get a granularity level for a period of time because it is too long.
Granularity12Hour aggregates the bitcoin price over 12 hours.
Granularity15Minute aggregates the bitcoin price over 15 minutes.
Granularity30Minute aggregates the bitcoin price over 30 minutes.
Granularity5Minute aggregates the bitcoin price over 5 minute.
Granularity6Hour aggregates the bitcoin price over 6 hours.
GranularityDay aggregates the bitcoin price over one day.
GranularityHour aggregates the bitcoin price over 1 hour.
GranularityMinute aggregates the bitcoin price over 1 minute.
# Structs
Granularity indicates the level of aggregation price information will be provided at.
Price represents the Bitcoin price in the given currency at a certain time.
PriceRequest describes a request for price information.
PriceSource holds a fiatBackend that can be used to fetch fiat price information.
PriceSourceConfig is a struct holding various config options used for initialising a new PriceSource.
# Type aliases
PriceBackend is an enum that indicates which backend we are using for fiat information.