benchmarks

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 13 Imported by: 0

README

Benchmarks Client

More information about the Benchmarks API can be found here.

Current Supported Endpoints

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for the Pyth Benchmarks API (https://benchmarks.pyth.network/docs)

func NewClient

func NewClient(cfg *Config, logger retryablehttp.LeveledLogger) (*Client, error)

NewClient creates a client for the Pyth Benchmarks API.

func (*Client) GetHistoricalPriceUpdatesSync

func (c *Client) GetHistoricalPriceUpdatesSync(
	_ context.Context, timestamp time.Time, priceFeeds ...string,
) (map[string]*apyth.PythStructsPriceFeed, error)

GetHistoricalPriceUpdatesSync queries the `v1/updates/price/{timestamp}` endpoint for all price feed IDs together. Takes the price feed keys (uses corresponding Pyth feed ID). Returns the Pyth PriceFeed struct and the price feed update data for each pair.

func (*Client) Shutdown

func (c *Client) Shutdown()

Shutdown gracefully shuts down the Pyth Benchmarks client.

type Config

type Config struct {
	APIEndpoint string
	HTTPTimeout time.Duration
	MaxRetries  int
}

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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