summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Mota <miguelmota2@gmail.com>2019-05-12 20:47:21 -0700
committerMiguel Mota <miguelmota2@gmail.com>2019-05-12 20:47:21 -0700
commiteaf94232a143942eea2c1e12c198f736e6c8969b (patch)
treeb499d0988a958b8f272cec93d53f4ae8ecfce436
parent6361b22399e629288a03c478c7b8534b755372c1 (diff)
v1.2.01.2.0
-rw-r--r--CHANGELOG.md7
-rw-r--r--cmd/cointop.go2
-rw-r--r--cointop/common/api/impl/coingecko/coingecko.go1
-rw-r--r--cointop/marketbar.go4
-rw-r--r--cointop/version.go2
5 files changed, 13 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5da6d85..16b754d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.2.0] - 2019-05-12
+### Added
+- Added CoinGecko API support
+
+### Changed
+- Default API from CoinMarketCap to CoinGecko
+
## [1.1.6] - 2019-04-23
### Added
- Prompt for CoinMarketCap Pro API Key
diff --git a/cmd/cointop.go b/cmd/cointop.go
index 62b40e7..0b7b0e3 100644
--- a/cmd/cointop.go
+++ b/cmd/cointop.go
@@ -18,7 +18,7 @@ func Run() {
flag.BoolVar(&reset, "reset", false, "Reset config")
flag.StringVar(&config, "config", "", "Config filepath")
flag.StringVar(&cmcAPIKey, "coinmarketcap-api-key", "", "CoinMarketCap API key")
- flag.StringVar(&apiChoice, "api", cointop.CoinMarketCap, "API choice")
+ flag.StringVar(&apiChoice, "api", cointop.CoinGecko, "API choice")
flag.Parse()
if v || ver {
fmt.Printf("cointop v%s", cointop.Version())
diff --git a/cointop/common/api/impl/coingecko/coingecko.go b/cointop/common/api/impl/coingecko/coingecko.go
index a0f8cf0..610d4ab 100644
--- a/cointop/common/api/impl/coingecko/coingecko.go
+++ b/cointop/common/api/impl/coingecko/coingecko.go
@@ -204,6 +204,7 @@ func (s *Service) GetGlobalMarketData(convert string) (apitypes.GlobalMarketData
ActiveAssets: 0,
ActiveMarkets: int(market.Markets),
}
+
return ret, nil
}
diff --git a/cointop/marketbar.go b/cointop/marketbar.go
index 9b5be81..f2b8c24 100644
--- a/cointop/marketbar.go
+++ b/cointop/marketbar.go
@@ -75,7 +75,9 @@ func (ct *Cointop) updateMarketbar() error {
if ok {
ct.debuglog("soft cache hit")
}
- } else {
+ }
+
+ if market.TotalMarketCapUSD == 0 {
market, err = ct.api.GetGlobalMarketData(ct.currencyconversion)
if err != nil {
filecache.Get(cachekey, &market)
diff --git a/cointop/version.go b/cointop/version.go
index f5df71c..f547aef 100644
--- a/cointop/version.go
+++ b/cointop/version.go
@@ -1,7 +1,7 @@
package cointop
// TODO: make dynamic based on git tag
-const version = "1.1.6"
+const version = "1.2.0"
func (ct *Cointop) version() string {
return version