fix fiat conversion - requires cg api key
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user