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

@@ -14,14 +14,12 @@ type Provider struct {
}
func (p *Provider) Name() string {
return "Bitcoin - Blockstream.info"
return "Bitcoin - Blockstream.info / CoinGecko"
}
// Configures the provider for usage via environment variables and persistentData
// If an error is returned, the provider will not be used
func (p *Provider) Configure() error {
var err error
// Load environment variables in continous series with suffix starting at 0
// Multiple addresses can be configured, (eg _1, _2)
// As soon as the series is interrupted, we assume we're done
@@ -39,10 +37,7 @@ func (p *Provider) Configure() error {
p.ynabAccountID = os.Getenv("bitcoin_ynab_account")
// Create new HTTP client
p.client, err = newClient()
if err != nil {
return fmt.Errorf("failed to create new bitcoin client: %v", err)
}
p.client = newClient(os.Getenv("bitcoin_coingecko_api_key"))
return nil
}