coinmarketcap

package
v0.0.0-...-81db2af Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinMarketCap

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

func NewCoinMarketCap

func NewCoinMarketCap(apiKey string) *CoinMarketCap

func (*CoinMarketCap) DexPairsTradeLatest

func (m *CoinMarketCap) DexPairsTradeLatest(contractAddress, networkSlug string) (*DexPairsTradeLatestResp, error)

func (*CoinMarketCap) DexSearch

func (m *CoinMarketCap) DexSearch(keyword string) ([]*DexPairsResp, error)

func (*CoinMarketCap) DexSpotPairsLatest

func (m *CoinMarketCap) DexSpotPairsLatest(quoteAssetSymbol, networkSlug string) (*DexSpotPairsLatestResp, error)

func (*CoinMarketCap) GetCryptocurrencyMap

func (m *CoinMarketCap) GetCryptocurrencyMap() (map[string]*MapDataCoin, error)

func (*CoinMarketCap) GetHistoricalPrice

func (m *CoinMarketCap) GetHistoricalPrice(id string, unixEnd int64) (*big.Float, error)

func (*CoinMarketCap) GetQuotesLatest

func (m *CoinMarketCap) GetQuotesLatest(arrayIDs []string) (map[string]*QuotesLatestDataCoin, error)

type DexPairsResp

type DexPairsResp struct {
	PlatformId          uint   `json:"platformId"`
	PlatformName        string `json:"platformName"`
	BaseTokenSymbol     string `json:"baseTokenSymbol"`
	QuoteTokenSymbol    string `json:"quoteTokenSymbol"`
	Liquidity           string `json:"liquidity"`
	PairContractAddress string `json:"pairContractAddress"`
	PlatFormCryptoId    string `json:"platFormCryptoId"`
	ExchangeId          uint   `json:"exchangeId"`
	PoolId              uint   `json:"poolId"`
	BaseTokenName       string `json:"baseTokenName"`
	MarketCap           string `json:"marketCap"`
	PriceUsd            string `json:"priceUsd"`
	PriceChange24h      string `json:"priceChange24h"`
	BaseToken           *struct {
		Name     string `json:"name"`
		Address  string `json:"address"`
		Symbol   string `json:"symbol"`
		Decimals uint   `json:"decimals"`
	} `json:"baseToken"`
	QuoteToken *struct {
		Name     string `json:"name"`
		Address  string `json:"address"`
		Symbol   string `json:"symbol"`
		Decimals uint   `json:"decimals"`
	} `json:"quoteToken"`
	Volume24h      string `json:"volume24h"`
	VolumeQuote24h string `json:"volumeQuote24h"`
}

type DexPairsTradeLatestDetail

type DexPairsTradeLatestDetail struct {
	ScrollId                  string `json:"scroll_id"`
	ContractAddress           string `json:"contract_address"`
	Name                      string `json:"name"`
	BaseAssetId               string `json:"base_asset_id"`
	BaseAssetUcid             string `json:"base_asset_ucid"`
	BaseAssetName             string `json:"base_asset_name"`
	BaseAssetSymbol           string `json:"base_asset_symbol"`
	BaseAssetContractAddress  string `json:"base_asset_contract_address"`
	QuoteAssetId              string `json:"quote_asset_id"`
	QuoteAssetUcid            string `json:"quote_asset_ucid"`
	QuoteAssetName            string `json:"quote_asset_name"`
	QuoteAssetSymbol          string `json:"quote_asset_symbol"`
	QuoteAssetContractAddress string `json:"quote_asset_contract_address"`
	DexId                     string `json:"dex_id"`
	DexSlug                   string `json:"dex_slug"`
	NetworkId                 string `json:"network_id"`
	NetworkSlug               string `json:"network_slug"`
	LastUpdated               string `json:"last_updated"`
	CreatedAt                 string `json:"created_at"`
	Trades                    []*struct {
		Date      string `json:"date"`
		TradeType string `json:"type"`
		Quote     []*struct {
			Price             float64 `json:"price"`
			Total             float64 `json:"total"`
			ConvertId         string  `json:"convert_id"`
			PriceByQuoteAsset float64 `json:"price_by_quote_asset"`
			AmountBaseAsset   float64 `json:"amount_base_asset"`
			AmountQuoteAsset  float64 `json:"amount_quote_asset"`
		} `json:"quote"`
	} `json:"trades"`
}

type DexPairsTradeLatestResp

type DexPairsTradeLatestResp struct {
	Data *[]*DexPairsTradeLatestDetail `json:"data"`
}

type DexSearchResp

type DexSearchResp struct {
	Data *struct {
		Total uint            `json:"total"`
		Pairs []*DexPairsResp `json:"pairs"`
	} `json:"data"`
}

type DexSpotPairsLatestDetail

type DexSpotPairsLatestDetail struct {
	ScrollId                  string `json:"scroll_id"`
	ContractAddress           string `json:"contract_address"`
	Name                      string `json:"name"`
	BaseAssetId               string `json:"base_asset_id"`
	BaseAssetUcid             string `json:"base_asset_ucid"`
	BaseAssetName             string `json:"base_asset_name"`
	BaseAssetSymbol           string `json:"base_asset_symbol"`
	BaseAssetContractAddress  string `json:"base_asset_contract_address"`
	QuoteAssetId              string `json:"quote_asset_id"`
	QuoteAssetUcid            string `json:"quote_asset_ucid"`
	QuoteAssetName            string `json:"quote_asset_name"`
	QuoteAssetSymbol          string `json:"quote_asset_symbol"`
	QuoteAssetContractAddress string `json:"quote_asset_contract_address"`
	DexId                     string `json:"dex_id"`
	DexSlug                   string `json:"dex_slug"`
	NetworkId                 string `json:"network_id"`
	NetworkSlug               string `json:"network_slug"`
	LastUpdated               string `json:"last_updated"`
	CreatedAt                 string `json:"created_at"`
	Quote                     []*struct {
		ConvertId             string  `json:"convert_id"`
		Price                 float64 `json:"price"`
		PriceByQuoteAsset     float64 `json:"price_by_quote_asset"`
		LastUpdated           string  `json:"last_updated"`
		Volume24h             float64 `json:"volume_24h"`
		PercentChangePrice1h  float64 `json:"percent_change_price_1h"`
		PercentChangePrice24h float64 `json:"percent_change_price_24h"`
		Liquidity             float64 `json:"liquidity"`
		FullyDilutedValue     float64 `json:"fully_diluted_value"`
	} `json:"quote"`
}

type DexSpotPairsLatestResp

type DexSpotPairsLatestResp struct {
	Data *[]*DexSpotPairsLatestDetail `json:"data"`
}

type HistoricalData

type HistoricalData struct {
	Data map[string]*HistoricalDataCoin `json:"data"`
}

type HistoricalDataCoin

type HistoricalDataCoin struct {
	ID     uint   `json:"id"`
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
	Quotes []*struct {
		Timestamp string `json:"timestamp"`
		Quote     *struct {
			USD *struct {
				Price     numeric.BigFloat `json:"price"`
				Timestamp time.Time        `json:"timestamp"`
			} `json:"USD"`
		} `json:"quote"`
	} `json:"quotes"`
}

type MapData

type MapData struct {
	Data []*MapDataCoin `json:"data"`
}

type MapDataCoin

type MapDataCoin struct {
	ID     uint   `json:"id"`
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
	Slug   string `json:"slug"`
}

type PriceConversionDataResponse

type PriceConversionDataResponse struct {
	Id          int       `json:"id"`
	Symbol      string    `json:"symbol"`
	Name        string    `json:"name"`
	Amount      int       `json:"amount"`
	LastUpdated time.Time `json:"last_updated"`
	Quote       Quote     `json:"quote"`
}

type PriceConversionResponse

type PriceConversionResponse struct {
	Status interface{}                 `json:"status"`
	Data   PriceConversionDataResponse `json:"data"`
}

type Quote

type Quote struct {
	USD USD `json:"usd"`
}

type QuotesLatestData

type QuotesLatestData struct {
	Data map[string]*QuotesLatestDataCoin `json:"data"`
}

type QuotesLatestDataCoin

type QuotesLatestDataCoin struct {
	ID     uint   `json:"id"`
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
	Quote  *struct {
		USD *struct {
			Price     numeric.BigFloat `json:"price"`
			MarketCap numeric.BigFloat `json:"market_cap"`
			Volume24h numeric.BigFloat `json:"volume_24h"`
		} `json:"USD"`
	} `json:"quote"`
}

type USD

type USD struct {
	Price       float64   `json:"price"`
	LastUpdated time.Time `json:"last_updated"`
}

Jump to

Keyboard shortcuts

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