api

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

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

func NewApi

func NewApi(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) GetTokenAddressPrice

func (a *Api) GetTokenAddressPrice(networkId int) ([]common.TokenAddressPrice, error)

GetTokenAddressPrice returns an array of TokenAddressPrice structs, which contain the token address and its price for a given network ID.

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.

Jump to

Keyboard shortcuts

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