Documentation ¶
Index ¶
- type Gecko
- func (g *Gecko) GetChainTokenPrice(network string, currency string) (decimal.Decimal, error)
- func (g *Gecko) GetId(symbol string, network string) (string, error)
- func (g *Gecko) GetPriceByAddress(address string, network string, currency string, client bind.ContractBackend) (decimal.Decimal, error)
- func (g *Gecko) GetPriceById(id string, currency string) (decimal.Decimal, error)
- func (g *Gecko) GetPriceBySymbol(symbol string, network string, currency string) (decimal.Decimal, error)
- func (g *Gecko) Update()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gecko ¶
type Gecko struct { ApiKey string TokenList []geckoapis.CoingeckoToken UpdatedAt time.Time }
func New ¶
Create a new coingeco reader.
"apiKey" is the key for pro users, to unlock the request limits.
"" can be used as the key, and you will have a request limit of 10-50 times/min.
func (*Gecko) GetChainTokenPrice ¶ added in v0.1.3
Return chain token price.
func (*Gecko) GetId ¶
Return the id accroding to symbol.
Some tokens like usdc.e on avalanche cannot be found by coingecko list, need special process.
func (*Gecko) GetPriceByAddress ¶ added in v0.1.0
func (g *Gecko) GetPriceByAddress(address string, network string, currency string, client bind.ContractBackend) (decimal.Decimal, error)
Return token price.
Some tokens like usdc.e on avalanche cannot be found by coingecko list, need special process.
func (*Gecko) GetPriceById ¶ added in v0.1.1
Return token price.
Currency can be "", "usd" will be used by default.
Click to show internal directories.
Click to hide internal directories.