Documentation
¶
Index ¶
- Variables
- type CoinToCoinWithAmountResponse
- type ObolRequest
- func (o *ObolRequest) GetCoin2CoinRates(fromCoin string, toCoin string) (float64, error)
- func (o *ObolRequest) GetCoin2CoinRatesWithAmount(fromCoin string, toCoin string, amount string) (CoinToCoinWithAmountResponse, error)
- func (o *ObolRequest) GetCoin2FIATRate(fromCoin string, toCoin string) (float64, error)
- func (o *ObolRequest) GetCoinRates(coin string) ([]Rate, error)
- func (o *ObolRequest) GetCoinRatesV2(coin string) (map[string]RateV2, error)
- type ObolService
- type Rate
- type RateV2
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var HttpClient = http.Client{ Timeout: time.Second * 15, }
HttpClient a usable client with hardcoded timeout
Functions ¶
This section is empty.
Types ¶
type CoinToCoinWithAmountResponse ¶
type CoinToCoinWithAmountResponse struct { AveragePrice float64 `json:"average_price"` Amount float64 `json:"amount"` }
CoinToCoinWithAmountResponse is the response of a CoinToCoinWithAmount result
type ObolRequest ¶
type ObolRequest struct {
ObolURL string
}
func (*ObolRequest) GetCoin2CoinRates ¶
func (o *ObolRequest) GetCoin2CoinRates(fromCoin string, toCoin string) (float64, error)
GetCoin2CoinRates is a function to return obol complex rates between 2 coins
func (*ObolRequest) GetCoin2CoinRatesWithAmount ¶
func (o *ObolRequest) GetCoin2CoinRatesWithAmount(fromCoin string, toCoin string, amount string) (CoinToCoinWithAmountResponse, error)
GetCoin2CoinRatesWithAmount is a function to return obol complex rates between 2 coins with a hardcoded amount
func (*ObolRequest) GetCoin2FIATRate ¶
func (o *ObolRequest) GetCoin2FIATRate(fromCoin string, toCoin string) (float64, error)
func (*ObolRequest) GetCoinRates ¶
func (o *ObolRequest) GetCoinRates(coin string) ([]Rate, error)
GetCoinRates is a function to return obol simple rates for a coin
func (*ObolRequest) GetCoinRatesV2 ¶
func (o *ObolRequest) GetCoinRatesV2(coin string) (map[string]RateV2, error)
GetCoinRates is a function to return obol simple rates for a coin
type ObolService ¶
type ObolService interface { GetCoinRatesV2(coin string) (map[string]RateV2, error) GetCoin2FIATRate(fromCoin string, toCoin string) (float64, error) GetCoinRates(coin string) ([]Rate, error) GetCoin2CoinRates(fromCoin string, toCoin string) (float64, error) GetCoin2CoinRatesWithAmount(fromCoin string, toCoin string, amount string) (CoinToCoinWithAmountResponse, error) }
Click to show internal directories.
Click to hide internal directories.