stxtools

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultApiBase = "https://api.stxtools.io"

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) GetAllHolders

func (c *APIClient) GetAllHolders(contractId string) (HoldersData, error)

func (*APIClient) GetAllSwaps

func (c *APIClient) GetAllSwaps(contractId string) ([]SwapsData, error)

func (*APIClient) GetAllTokens

func (c *APIClient) GetAllTokens() ([]Token, error)

func (*APIClient) GetAllTransfers

func (c *APIClient) GetAllTransfers(contractId string) ([]Transaction, error)

type HoldersData

type HoldersData struct {
	TokenInfo  TokenInfo   `json:"token_info"`
	TopHolders []TopHolder `json:"top_holders"`
}

type HoldersResponse

type HoldersResponse struct {
	Data HoldersData `json:"data"`
	Page Page        `json:"page"`
}

type Metrics

type Metrics struct {
	ContractID     string  `json:"contract_id"`
	HolderCount    int     `json:"holder_count"`
	SwapCount      int     `json:"swap_count"`
	TransferCount  int     `json:"transfer_count"`
	PriceUSD       float64 `json:"price_usd"`
	PriceChange1D  float64 `json:"price_change_1d"`
	PriceChange7D  float64 `json:"price_change_7d"`
	PriceChange30D float64 `json:"price_change_30d"`
	LiquidityUSD   float64 `json:"liquidity_usd"`
}

type Page

type Page struct {
	Size          int    `json:"size"`
	TotalPages    int    `json:"totalPages"`
	TotalElements int    `json:"totalElements"`
	PageNumber    int    `json:"pageNumber"`
	SortDirection string `json:"sortDirection"`
}

type SwapToken

type SwapToken struct {
	ContractID string `json:"contract_id"`
	Decimals   int    `json:"decimals"`
	ImageURL   string `json:"image_url"`
	Symbol     string `json:"symbol"`
}

type SwapsData

type SwapsData struct {
	TxID          string    `json:"tx_id"`
	PoolID        string    `json:"pool_id"`
	SenderAddress string    `json:"sender_address"`
	TokenXAmount  string    `json:"token_x_amount"`
	TokenYAmount  string    `json:"token_y_amount"`
	BurnBlockTime time.Time `json:"burn_block_time"`
	TokenX        SwapToken `json:"token_x"`
	TokenY        SwapToken `json:"token_y"`
}

type SwapsResponse

type SwapsResponse struct {
	Data []SwapsData `json:"data"`
	Page Page        `json:"page"`
}

type Token

type Token struct {
	ContractID        string  `json:"contract_id"`
	Symbol            string  `json:"symbol"`
	Name              string  `json:"name"`
	Decimals          int     `json:"decimals"`
	CirculatingSupply string  `json:"circulating_supply"`
	TotalSupply       string  `json:"total_supply"`
	ImageURL          string  `json:"image_url"`
	Enabled           bool    `json:"enabled"`
	WrappedToken      string  `json:"wrapped_token"`
	Metrics           Metrics `json:"metrics"`
}

type TokenInfo

type TokenInfo struct {
	Decimals    int    `json:"decimals"`
	TotalSupply string `json:"total_supply"`
}

type TopHolder

type TopHolder struct {
	WalletAddress string `json:"wallet_address"`
	TokenBalance  string `json:"token_balance"`
	TotalSent     string `json:"total_sent"`
	TotalReceived string `json:"total_received"`
	Wallet        Wallet `json:"wallet"`
	Rank          int    `json:"rank"`
}

type Transaction

type Transaction struct {
	TxID             string `json:"tx_id"`
	SenderAddress    string `json:"sender_address"`
	Amount           string `json:"amount"`
	RecipientAddress string `json:"recipient_address"`
	ContractID       string `json:"contract_id"`
	BurnBlockTime    string `json:"burn_block_time"`
	BlockHeight      int    `json:"block_height"`
	Token            Token  `json:"token"`
}

type TransfersResponse

type TransfersResponse struct {
	Data []Transaction `json:"data"`
	Page Page          `json:"page"`
}

type TransfersToken

type TransfersToken struct {
	Symbol      string `json:"symbol"`
	ImageURL    string `json:"image_url"`
	Decimals    int    `json:"decimals"`
	TotalSupply string `json:"total_supply"`
}

type Wallet

type Wallet struct {
	Address    string      `json:"address"`
	StxBalance string      `json:"stx_balance"`
	WalletTags []WalletTag `json:"wallet_tags"`
}

type WalletTag

type WalletTag struct {
	Tag string `json:"tag"`
}

Jump to

Keyboard shortcuts

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