geckoterminal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributesItem

type AttributesItem struct {
	Name                     string  `json:"name"`
	CoingeckoAssetPlatformID *string `json:"coingecko_asset_platform_id"`
}

AttributesItem

type Client

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

Client struct

func NewGeckoTerminal

func NewGeckoTerminal(httpClient *http.Client) *Client

NewGeckoTerminal create a new GeckoTerminal API client.

func (*Client) GetDexes

func (c *Client) GetDexes(ctx context.Context, network string, page uint) (*DexesResponse, error)

GetDexes gets list of supported dexes on a network.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

Query parameters:

page(optional): page through results.

func (*Client) GetLatest20PoolsOnAllNetworks

func (c *Client) GetLatest20PoolsOnAllNetworks(ctx context.Context, include []string) (*PoolsResponse, error)

GetLatest20PoolsOnAllNetworks gets latest 20 pools across all networks.

Note: rate limit for this API is 30 calls per minute.

Query parameters:

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: base_token, quote_token, dex. Example: base_token,quote_token.

func (*Client) GetLatest20PoolsOnOneNetwork

func (c *Client) GetLatest20PoolsOnOneNetwork(ctx context.Context, network string, include []string) (*PoolsResponse, error)

GetLatest20PoolsOnOneNetwork gets latest 20 pools on a network.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

Query parameters:

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: base_token, quote_token, dex. Example: base_token,quote_token.

func (*Client) GetMultiPools

func (c *Client) GetMultiPools(ctx context.Context, network string, include, addresses []string) (*PoolsResponse, error)

GetMultiPools gets multi pools on a network.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

addresses(required): comma-separated list of pool addresses (up to 30 addresses); addresses not found in the GeckoTerminal database will be ignored. Example: 0x60594a405d53811d3bc4766596efd80fd545a270,0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640.

Query parameters:

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: base_token, quote_token, dex. Example: base_token,quote_token.

func (*Client) GetMultiTokensOnOneNetwork

func (c *Client) GetMultiTokensOnOneNetwork(ctx context.Context, network string, addresses, include []string) (*TokensResponse, error)

GetMultiTokensOnOneNetwork gets multi tokens on a network.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

addresses(required): comma-separated list of token addresses (up to 30 addresses). addresses not found in the GeckoTerminal database will be ignored. Note: top_pools for this endpoint returns only the first top pool for each token. Example: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.

Query parameters:

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: top_pools. Example: top_pools.

func (*Client) GetNetworks

func (c *Client) GetNetworks(ctx context.Context, page uint) (*NetworksResponse, error)

GetNetworks gets list of supported networks.

Query parameters:

page(optional): page through results.

Note: rate limit for this API is 30 calls per minute.

func (*Client) GetOHLCV

func (c *Client) GetOHLCV(ctx context.Context, network, poolAddress, timeframe string, aggregate uint, beforeTimestamp int64,
	limit uint, currency, token string) (*OHLCVResponse, error)

GetOHLCV gets OHLCV data of a pool, up to 6 months ago. Empty response if there is no earlier data available.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

pool_address(required): pool address. Example: 0x60594a405d53811d3bc4766596efd80fd545a270. Note: Pools with more than 2 tokens are not yet supported for this endpoint.

timeframe(required): timeframe. Available values: day, hour, minute. Example: day.

Query parameters:

aggregate(optional): time period to aggregate for each ohlcv (e.g. /minute?aggregate=15 for 15m ohlcv). Available values (day): 1. Available values (hour): 1, 4, 12. Available values (minute): 1, 5, 15. Default: 1.

before_timestamp(optional): return ohlcv data before this timestamp (integer seconds since epoch). Example: 1679414400.

limit(optional): limit number of ohlcv results to return (default: 100, max: 1000). Example: 100.

currency(optional): return ohlcv in USD or quote token (default: usd). Available values: usd, token.

token(optional): return ohlcv for base or quote token; use this to invert the chart. (default: base). Available values: base, quote.

func (*Client) GetPoolTokensInfoOnOneNetwork

func (c *Client) GetPoolTokensInfoOnOneNetwork(ctx context.Context, network, poolAddress string) (*PoolTokensInfoResponse, error)

GetPoolTokensInfoOnOneNetwork gets pool tokens info on a network.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

pool_address(required): pool address. Example: 0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852

func (*Client) GetRecentlyUpdated100TokensInfo

func (c *Client) GetRecentlyUpdated100TokensInfo(ctx context.Context, include []string) (*RecentlyUpdatedTokensResponse, error)

GetRecentlyUpdated100TokensInfo gets most recently 100 tokens info across all networks.

Note: rate limit for this API is 30 calls per minute.

Query parameters:

include(optional): attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: network. Example: network.

func (*Client) GetSpecificPool

func (c *Client) GetSpecificPool(ctx context.Context, network, address string, include []string) (*SpecificPoolResponse, error)

GetSpecificPool gets specific pool on a network.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

address(required): pool address. Example: 0x60594a405d53811d3bc4766596efd80fd545a270.

Query parameters:

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: base_token, quote_token, dex. Example: base_token,quote_token.

func (*Client) GetSpecificTokenInfoOnOneNetwork

func (c *Client) GetSpecificTokenInfoOnOneNetwork(ctx context.Context, network, address string) (*TokenInfoResponse, error)

GetSpecificTokenInfoOnOneNetwork gets specific token info on a network.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

addresses(required): token address. Example: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

func (*Client) GetSpecificTokenOnOneNetwork

func (c *Client) GetSpecificTokenOnOneNetwork(ctx context.Context, network, address string, include []string) (*SpecificTokenResponse, error)

GetSpecificTokenOnOneNetwork gets specific token on a network.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

address(required): token address. Example: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.

Query parameters:

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: top_pools. Example: top_pools.

func (*Client) GetTop20PoolsForOneToken

func (c *Client) GetTop20PoolsForOneToken(ctx context.Context, network, tokenAddress string, include []string) (*PoolsResponse, error)

GetTop20PoolsForOneToken gets top 20 pools for a token. Contains special field token_price_usd representing price of requested token.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

token_address(required): address of token. Example: 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.

Query parameters:

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: base_token, quote_token, dex. Example: base_token,quote_token.

func (*Client) GetTop20PoolsOnOneDex

func (c *Client) GetTop20PoolsOnOneDex(ctx context.Context, network, dex string, include []string) (*PoolsResponse, error)

GetTop20PoolsOnOneDex gets top 20 pools on a network's dex.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

Query parameters:

dex(required): dex id from /networks/{network}/dexes list. Example: sushiswap.

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: base_token, quote_token, dex. Example: base_token,quote_token.

func (*Client) GetTop20PoolsOnOneNetwork

func (c *Client) GetTop20PoolsOnOneNetwork(ctx context.Context, network string, include []string) (*PoolsResponse, error)

GetTop20PoolsOnOneNetwork gets top 20 pools on a network.

Note: rate limit for this API is 30 calls per minute.

Path parameters:

network(required): network id from /networks list. Example: eth.

Query parameters:

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: base_token, quote_token, dex. Example: base_token,quote_token.

func (*Client) SearchPools

func (c *Client) SearchPools(ctx context.Context, query, network string, include []string) (*PoolsResponse, error)

SearchPools search for pools on a network.

Note: rate limit for this API is 30 calls per minute.

Query parameters:

query(optional): Search query: can be pool address, token address, or token symbol. Returns top 5 matching pools. Example: ETH.

network(optional): network id from /networks list. Example: eth.

include(optional): Attributes for related resources to include, which will be returned under the top-level "included" key. Available resources: base_token, quote_token, dex. Example: base_token,quote_token.

type DexesItem

type DexesItem struct {
	Attributes struct {
		Name string `json:"name"`
	} `json:"attributes"`
	// contains filtered or unexported fields
}

type DexesResponse

type DexesResponse struct {
	Data      []struct{ DexesItem } `json:"data"`
	LinksItem `json:"links"`
}

DexesResponse returned by GetDexes API.

type ErrorResponse

type ErrorResponse struct {
	Errors []struct {
		Status string `json:"status"`
		Title  string `json:"title"`
	} `json:"errors"`
}

ErrorResponse is returned when failing to call API.

type LinksItem

type LinksItem struct {
	First string  `json:"first"`
	Prev  *string `json:"prev"`
	Next  *string `json:"next"`
	Last  string  `json:"last"`
}

LinksItem used for pagination

type NetworksItem

type NetworksItem struct {
	Attributes AttributesItem `json:"attributes"`
	// contains filtered or unexported fields
}

NetworksItem

type NetworksResponse

type NetworksResponse struct {
	Data      []struct{ NetworksItem } `json:"data"`
	LinksItem `json:"links"`
}

NetworksResponse returned by GetNetworks API.

type OHLCVItem

type OHLCVItem [6]float64

OHLCVItem used for OHLCVResponse.

type OHLCVResponse

type OHLCVResponse struct {
	Data struct {
		Attributes struct {
			OHLCVList []OHLCVItem `json:"ohlcv_list"`
		} `json:"attributes"`
		// contains filtered or unexported fields
	} `json:"data"`
}

OHLCVResponse returned by GetOHLCV API.

type PoolAttributesItem

type PoolAttributesItem struct {
	BaseTokenPriceUSD             *string                     `json:"base_token_price_usd"`
	BaseTokenPriceNativeCurrency  *string                     `json:"base_token_price_native_currency"`
	QuoteTokenPriceUSD            *string                     `json:"quote_token_price_usd"`
	QuoteTokenPriceNativeCurrency *string                     `json:"quote_token_price_native_currency"`
	BaseTokenPriceQuoteToken      *string                     `json:"base_token_price_quote_token"`
	QuoteTokenPriceBaseToken      *string                     `json:"quote_token_price_base_token"`
	Address                       string                      `json:"address"`
	Name                          string                      `json:"name"`
	PoolCreatedAt                 *time.Time                  `json:"pool_created_at"`
	TokenPriceUSD                 *string                     `json:"token_price_usd,omitempty"`
	FDVUSD                        *string                     `json:"fdv_usd"`
	MarketCapUSD                  *string                     `json:"market_cap_usd"`
	PriceChangePercentage         map[string]string           `json:"price_change_percentage"`
	Transactions                  map[string]TransactionsItem `json:"transactions"`
	VolumeUSD                     map[string]string           `json:"volume_usd"`
	ReserveInUSD                  *string                     `json:"reserve_in_usd"`
}

PoolAttributesItem

type PoolDataItem

type PoolDataItem struct {
	Attributes    PoolAttributesItem                `json:"attributes"`
	Relationships map[string]map[string]basicStruct `json:"relationships"`
	// contains filtered or unexported fields
}

PoolDataItem

type PoolIncludedItem

type PoolIncludedItem struct {
	Attributes struct {
		Address         string  `json:"address,omitempty"`
		Name            string  `json:"name"`
		Symbol          string  `json:"symbol,omitempty"`
		CoingeckoCoinID *string `json:"coingecko_coin_id,omitempty"`
	} `json:"attributes"`
	// contains filtered or unexported fields
}

PoolIncludedItem

type PoolTokensInfoResponse

type PoolTokensInfoResponse struct {
	Data []TokenInfoDataItem `json:"data"`
}

PoolTokensInfoResponse returned by GetPoolTokensInfoOnOneNetwork API.

type PoolsResponse

type PoolsResponse struct {
	Data     []PoolDataItem     `json:"data"`
	Included []PoolIncludedItem `json:"included,omitempty"`
}

PoolsResponse returned by pools APIs.

type RecentlyUpdatedTokensResponse

type RecentlyUpdatedTokensResponse struct {
	Data    []TokenInfoDataItem      `json:"data"`
	Include []TokensInfoIncludedItem `json:"included"`
}

RecentlyUpdatedTokensResponse returned by GetRecentlyUpdated100TokensInfo API.

type SpecificPoolResponse

type SpecificPoolResponse struct {
	Data     PoolDataItem       `json:"data"`
	Included []PoolIncludedItem `json:"included,omitempty"`
}

SpecificPoolResponse returned by GetSpecificPool API.

type SpecificTokenResponse

type SpecificTokenResponse struct {
	Data     TokenDataItem `json:"data"`
	Included []struct {
		PoolDataItem
		// contains filtered or unexported fields
	} `json:"included,omitempty"`
}

SpecificTokenResponse returned by GetSpecificTokenOnOneNetwork API.

type TokenAttributesItem

type TokenAttributesItem struct {
	Address           string            `json:"address"`
	Name              string            `json:"name"`
	Symbol            string            `json:"symbol"`
	CoingeckoCoinID   string            `json:"coingecko_coin_id"`
	Decimals          int               `json:"decimals"`
	TotalSupply       string            `json:"total_supply"`
	PriceUSD          string            `json:"price_usd"`
	FDVUSD            string            `json:"fdv_usd"`
	TotalReserveInUSD string            `json:"total_reserve_in_usd"`
	VolumeUSD         map[string]string `json:"volume_usd"`
	MarketCapUSD      *string           `json:"market_cap_usd"`
}

TokenAttributesItem

type TokenDataItem

type TokenDataItem struct {
	Attributes    TokenAttributesItem `json:"attributes"`
	Relationships struct {
		TopPools map[string][]basicStruct `json:"top_pools"`
	} `json:"relationships"`
	// contains filtered or unexported fields
}

TokenDataItem

type TokenInfoAttributesItem

type TokenInfoAttributesItem struct {
	Address           string     `json:"address"`
	Name              string     `json:"name"`
	Symbol            string     `json:"symbol"`
	CoingeckoCoinID   string     `json:"coingecko_coin_id"`
	ImageURL          string     `json:"image_url"`
	Websites          []string   `json:"websites"`
	Description       string     `json:"description"`
	GTScore           float64    `json:"gt_score"`
	MetadataUpdatedAt *time.Time `json:"metadata_updated_at,omitempty"`
	DiscordURL        *string    `json:"discord_url"`
	TelegramHandle    *string    `json:"telegram_handle"`
	TwitterHandle     *string    `json:"twitter_handle"`
}

TokenInfoAttributesItem

type TokenInfoDataItem

type TokenInfoDataItem struct {
	Attributes    TokenInfoAttributesItem           `json:"attributes"`
	Relationships map[string]map[string]basicStruct `json:"relationships,omitempty"`
	// contains filtered or unexported fields
}

TokenInfoDataItem

type TokenInfoResponse

type TokenInfoResponse struct {
	Data TokenInfoDataItem `json:"data"`
}

TokenInfoResponse used in token info APIs.

type TokensInfoIncludedItem

type TokensInfoIncludedItem struct {
	Attributes struct {
		Name                     string  `json:"name"`
		CoingeckoAssetPlatformID *string `json:"coingecko_asset_platform_id"`
	} `json:"attributes"`
	// contains filtered or unexported fields
}

TokensInfoIncludedItem

type TokensResponse

type TokensResponse struct {
	Data     []TokenDataItem `json:"data"`
	Included []struct {
		PoolDataItem
		// contains filtered or unexported fields
	} `json:"included,omitempty"`
}

TokensResponse returned by GetMultiTokensOnOneNetwork API.

type TransactionsItem

type TransactionsItem struct {
	Buys  int64 `json:"buys"`
	Sells int64 `json:"sells"`
}

TransactionsItem

Jump to

Keyboard shortcuts

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