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) 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)
Click to show internal directories.
Click to hide internal directories.