summaryrefslogtreecommitdiffstats
path: root/pkg/api/api.go
blob: fa14c99bde9835e7e7976b18495edfc47b594a44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package api

import (
	cg "github.com/cointop-sh/cointop/pkg/api/impl/coingecko"
	cmc "github.com/cointop-sh/cointop/pkg/api/impl/coinmarketcap"
)

type CoinGeckoConfig struct {
	PerPage   uint
	MaxPages  uint
	ApiKey    string
	ProApiKey string
}

// NewCMC new CoinMarketCap API
func NewCMC(apiKey string) Interface {
	return cmc.NewCMC(apiKey)
}

// NewCC new CryptoCompare API
func NewCC() {
	// TODO
}

// NewCG new CoinGecko API
func NewCG(config *CoinGeckoConfig) Interface {
	return cg.NewCoinGecko(&cg.Config{
		PerPage:   config.PerPage,
		MaxPages:  config.MaxPages,
		ApiKey:    config.ApiKey,
		ProApiKey: config.ProApiKey,
	})
}