pricefeed

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2023 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package pricefeed implements routines to retrieve on-chain price feeds from chainlink's decentralized oracle network.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriceFeed

type PriceFeed struct {
	Description string // "COIN / USD"
	Price       *apd.Decimal
	UpdatedAt   time.Time
}

PriceFeed contains the interesting data from a chainlink price feed query.

func GetETHUSDPrice

func GetETHUSDPrice(ctx context.Context, ec *ethclient.Client) (*PriceFeed, error)

GetETHUSDPrice returns the current ETH/USD price from the Chainlink oracle.

func GetXMRUSDPrice

func GetXMRUSDPrice(ctx context.Context, ec *ethclient.Client) (*PriceFeed, error)

GetXMRUSDPrice returns the current XMR/USD price from the Chainlink oracle.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL