package exchange import ( "fmt" "github.com/shopspring/decimal" ) type response[T any] struct { Data T Status status } type status struct { Error string `json:"error_message"` } type apiError struct { Status status } func (e apiError) Error() string { return fmt.Sprintf("currency exchange api error: %v", e.Status.Error) } type priceConversionQuery struct { Amount uint `url:"amount"` From string `url:"symbol"` To string `url:"convert"` } type priceConversion struct { Id uint Quote map[string]price } type price struct { Price decimal.Decimal }