api

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig added in v0.1.10

func GetConfig(network common.NetworkType) (common.ConfigType, map[int]bool)

Types

type Api

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

func NewApi

func NewApi(network common.NetworkType, tokenIndexes []int) *Api

NewApi returns a new Api instance. It accepts a slice of token indexes, which are used to filter the results of the GetTokenIndexPrice and GetTokenAddressPrice functions.

func (*Api) GetNodeInfo

func (a *Api) GetNodeInfo() ([]common.NodeInfo, error)

func (*Api) GetTokenIndexInfo

func (a *Api) GetTokenIndexInfo() (map[int]common.TokenIndexInfo, error)

func (*Api) GetTokenIndexPrice

func (a *Api) GetTokenIndexPrice() ([]common.TokenIndexPrice, error)

GetTokenIndexPrice retrieves the current prices of all tokens in the XOracle index. It returns a slice of TokenIndexPrice structs, each containing the token index and its corresponding price.

func (*Api) GetTokenIndexPriceByTimestamp added in v0.1.8

func (a *Api) GetTokenIndexPriceByTimestamp(timestamp int64) ([]common.TokenIndexPrice, error)

Jump to

Keyboard shortcuts

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