fix fiat conversion - requires cg api key
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-09 17:43:14 -06:00
parent c119f1f57c
commit 7689e3e1f2
4 changed files with 14 additions and 16 deletions

View File

@@ -15,8 +15,9 @@ const apiBaseURL = "https://blockstream.info/api/"
// endpoints. It holds the login credentials, http client/transport,
// rate limit information, and the login session timer.
type client struct {
httpClient *http.Client
transport *http.Transport
httpClient *http.Client
transport *http.Transport
coinGeckoApiKey string
}
// Send an HTTP GET request, and return the processed response
@@ -61,7 +62,7 @@ func (c *client) processResponse(res *http.Response, out interface{}) error {
}
// newClient is the factory function for clients
func newClient() (*client, error) {
func newClient(coinGeckoApiKey string) *client {
transport := &http.Transport{
ResponseHeaderTimeout: 5 * time.Second,
}
@@ -72,8 +73,9 @@ func newClient() (*client, error) {
// Create a new client
c := &client{
httpClient: httpClient,
transport: transport,
httpClient: httpClient,
transport: transport,
coinGeckoApiKey: coinGeckoApiKey,
}
return c, nil
return c
}