alex

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultApiBase = "https://api.alexgo.io"
View Source
const DefaultGraphQLEndpoint = "https://gql.alexlab.co/v1/graphql"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	BaseURL string
	Client  *http.Client
}

func NewAPIClient

func NewAPIClient(baseURL string) *APIClient

func (*APIClient) ExecuteGraphQLQuery

func (c *APIClient) ExecuteGraphQLQuery(query string) ([]byte, error)

func (*APIClient) FetchLatestPrices

func (c *APIClient) FetchLatestPrices() (TokenPriceResponse, error)

func (*APIClient) GetPairs

func (c *APIClient) GetPairs() ([]CurrencyPair, error)

type CurrencyPair

type CurrencyPair struct {
	TickerID       string  `json:"ticker_id"`
	PoolID         string  `json:"pool_id"`
	BaseCurrency   string  `json:"base_currency"`
	TargetCurrency string  `json:"target_currency"`
	Base           string  `json:"base"`
	Target         string  `json:"target"`
	LastPrice      float64 `json:"last_price"`
	BaseVolume     float64 `json:"base_volume"`
	TargetVolume   float64 `json:"target_volume"`
	LiquidityInUSD float64 `json:"liquidity_in_usd"`
}

type TokenPriceResponse

type TokenPriceResponse struct {
	Data struct {
		LaplaceCurrentTokenPrice []struct {
			AvgPriceUSD float64 `json:"avg_price_usd"`
			Token       string  `json:"token"`
		} `json:"laplace_current_token_price"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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