Versions in this module Expand all Collapse all v1 v1.0.3 Sep 4, 2026 v1.0.0 Aug 5, 2026 Changes in this version + var ErrAPIError = errors.New("tokenterminal: API error") + var ErrBadRequest = errors.New("tokenterminal: bad request") + var ErrForbidden = errors.New("tokenterminal: forbidden") + var ErrMissingAPIKey = errors.New("tokenterminal: API key is required") + var ErrNotFound = errors.New("tokenterminal: not found") + var ErrRateLimited = errors.New("tokenterminal: rate limited") + var ErrSubscriptionInvalid = errors.New("tokenterminal: subscription invalid or payment required") + var ErrUnauthorized = errors.New("tokenterminal: unauthorized") + type APIError struct + BodySnippet string + Code string + Message string + RequestURL string + RetryAfter string + StatusCode int + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type AggregateBy string + const AggregateByChain + const AggregateByProductID + type Asset struct + Addresses []AssetAddress + AssetID string + AssetType *string + CoingeckoID *string + CreatedAt string + InsertedAt string + Name string + Products []AssetProduct + Symbol string + type AssetAddress struct + ChainID *string + TokenAddress *string + TokenName *string + TokenSymbol *string + type AssetBreakdownItem struct + AssetID *string + ChainID *string + DataID *string + MarketSectorID *string + Metrics map[string]BreakdownMetricStats + ProductID *string + type AssetDetail struct + AvailableMetrics []string + type AssetHistoricalMetricsParams struct + AggregateBy []string + ChainIDs []string + End *Date + Interval Interval + MetricID string + OrderDirection OrderDirection + ProductIDs []string + Start *Date + type AssetMetricPoint struct + AssetID string + MetricID string + Timestamp string + Value string + type AssetMetricsBreakdownBody struct + AssetIDs []string + ChainIDs []string + DataIDs []string + End *Date + GroupBy GroupBy + IgnoreThreshold *bool + IncludeSelf *bool + Interval Interval + MarketSectorIDs []string + MetricIDs []string + ProductIDs []string + Start *Date + type AssetProduct struct + DataID string + Logo *string + ProductID string + RelationToTheProject *string + Tags []string + type AssetsService struct + func (s *AssetsService) Get(ctx context.Context, assetID string) (*ResultOne[AssetDetail], error) + func (s *AssetsService) HistoricalMetrics(ctx context.Context, assetID string, params *AssetHistoricalMetricsParams) (*Result[AssetMetricPoint], error) + func (s *AssetsService) List(ctx context.Context, params *ListAssetsParams) (*Result[Asset], error) + func (s *AssetsService) MetricsBreakdown(ctx context.Context, assetID string, body *AssetMetricsBreakdownBody) (*Result[AssetBreakdownItem], error) + func (s *AssetsService) MetricsBreakdownRaw(ctx context.Context, assetID string, body *AssetMetricsBreakdownBody) (*Result[json.RawMessage], error) + type BlockchainComparisonRow struct + ChainID string + ChainName string + Raw json.RawMessage + func (r *BlockchainComparisonRow) UnmarshalJSON(data []byte) error + type BreakdownMetricStats struct + Avg *float64 + Change *float64 + Latest *float64 + Sum *float64 + Trend *float64 + type Client struct + Assets *AssetsService + Datasets *DatasetsService + MarketSectors *MarketSectorsService + Metrics *MetricsService + Projects *ProjectsService + func NewClient(apiKey string, opts ...Option) (*Client, error) + func NewClientFromEnv(opts ...Option) (*Client, error) + type CohortAnalysisRow struct + Cohort string + InitialCohortSize float64 + MarketSectorID string + MarketSectorName string + Month0 float64 + Month1 float64 + Month10 float64 + Month11 float64 + Month2 float64 + Month3 float64 + Month4 float64 + Month5 float64 + Month6 float64 + Month7 float64 + Month8 float64 + Month9 float64 + ProjectID string + ProjectName string + type CryptoScreenerRow struct + MarketSectorID string + MarketSectorName string + ProjectID string + ProjectName string + Raw json.RawMessage + func (r *CryptoScreenerRow) UnmarshalJSON(data []byte) error + type DatasetInfo struct + MartID string + Name string + type DatasetQuery struct + ChainIDs []string + Limit *int + MarketSectorIDs []string + OrderBy string + OrderDirection OrderDirection + ProjectIDs []string + type DatasetsService struct + func (s *DatasetsService) BlockchainComparison(ctx context.Context, params *DatasetQuery) (*Result[BlockchainComparisonRow], error) + func (s *DatasetsService) CohortAnalysis(ctx context.Context, params *DatasetQuery) (*Result[CohortAnalysisRow], error) + func (s *DatasetsService) CryptoScreener(ctx context.Context, params *DatasetQuery) (*Result[CryptoScreenerRow], error) + func (s *DatasetsService) InsiderTransactions(ctx context.Context, params *DatasetQuery) (*Result[InsiderTransactionRow], error) + func (s *DatasetsService) List(ctx context.Context) (*ResultOne[DatasetInfo], error) + func (s *DatasetsService) ProjectContracts(ctx context.Context, params *DatasetQuery) (*Result[ProjectContractRow], error) + func (s *DatasetsService) TrendingContracts(ctx context.Context, params *DatasetQuery) (*Result[TrendingContractRow], error) + type Date struct + func DateVal(s string) Date + func NewDate(s string) (Date, error) + func (d Date) IsZero() bool + func (d Date) String() string + type FinancialStatementInterval string + const FSInterval1m + const FSInterval1y + const FSInterval2y + const FSInterval3y + const FSInterval5y + const FSIntervalMax + type FinancialStatementParams struct + Interval FinancialStatementInterval + TimestampGranularity TimestampGranularity + type FinancialStatementRow struct + Definition string + MetricID string + PopChange string + ProjectName string + Section string + Timestamp string + TimestampGranularity string + TimestampLabelHeading string + TimestampLabelSubheading string + Value string + type GroupBy string + const GroupByAssets + const GroupByChainAsset + const GroupByChainMarketSector + const GroupByChainProduct + const GroupByChainProject + const GroupByChains + const GroupByMarketSector + const GroupByProduct + const GroupByProductChain + const GroupByProjects + type HistoricalMetricsParams struct + AggregateBy AggregateBy + AssetsBridged *bool + ChainIDs []string + End *Date + MarketSectorIDs []string + MetricIDs []string + OrderDirection OrderDirection + ProductIDs []string + Start *Date + type InsiderTransactionRow struct + ActionType string + AmountNative *float64 + AmountUSD *float64 + ChainID string + ChainName string + CounterpartyAccountAddress string + CounterpartyAccountTitle string + DexName string + FlowUSD *float64 + InsiderAccountAddress string + InsiderAccountTitle string + MarketSectorID string + MarketSectorName string + PercentageOfPosition *float64 + PositionCreationTimestamp string + PostTransactionPosition *float64 + ProjectID string + ProjectName string + Timestamp string + TokenAddress string + TokenStandard string + TokenSymbol string + TransactionHash string + TransactionNumber string + TransactionType string + type Interval string + const Interval180d + const Interval24h + const Interval30d + const Interval365d + const Interval4FullQ + const Interval7d + const Interval90d + const IntervalMax + const IntervalYTD + type ListAssetsParams struct + AssetIDs []string + AssetTypes []string + Limit *int + MarketSectors []string + Offset *int + type MarketSector struct + ID string + Name string + URL string + type MarketSectorDescription struct + How string + What string + type MarketSectorDetail struct + Description MarketSectorDescription + MarketSectorID string + Name string + Projects []MarketSectorProject + type MarketSectorProject struct + Name string + ProjectID string + URL string + type MarketSectorsService struct + func (s *MarketSectorsService) Get(ctx context.Context, marketSectorID string) (*ResultOne[MarketSectorDetail], error) + func (s *MarketSectorsService) List(ctx context.Context) (*Result[MarketSector], error) + type MetricAggregation struct + MetricAggregationName string + MetricID string + ProjectID string + ProjectName string + Value string + type MetricAggregationsParams struct + MetricIDs []string + ProjectIDs []string + type MetricBreakdownBody struct + ChainIDs []string + End *Date + GroupBy GroupBy + Interval Interval + MarketSectorIDs []string + MetricIDs []string + ProductIDs []string + ProjectIDs []string + Start *Date + type MetricBreakdownItem struct + ChainID *string + DataID *string + Metrics map[string]BreakdownMetricStats + ProductID *string + type MetricDataParams struct + AssetsBridged *bool + ChainIDs []string + End *Date + MarketSectorIDs []string + ProductIDs []string + ProjectIDs []string + Start *Date + type MetricDataPoint struct + MetricID string + ProjectID string + ProjectName string + Timestamp string + Value string + type MetricDefinition struct + Description string + MetricID string + MetricName string + URL string + type MetricsService struct + func (s *MetricsService) Aggregations(ctx context.Context, params *MetricAggregationsParams) (*Result[MetricAggregation], error) + func (s *MetricsService) Breakdown(ctx context.Context, body *MetricBreakdownBody) (*Result[MetricBreakdownItem], error) + func (s *MetricsService) BreakdownRaw(ctx context.Context, body *MetricBreakdownBody) (*Result[json.RawMessage], error) + func (s *MetricsService) Data(ctx context.Context, metricID string, params *MetricDataParams) (*Result[MetricDataPoint], error) + func (s *MetricsService) List(ctx context.Context) (*Result[MetricDefinition], error) + type Option func(*config) + func WithBaseURL(url string) Option + func WithHTTPClient(client *http.Client) Option + func WithRetry(maxRetries int, delay time.Duration) Option + func WithRetryPOST() Option + func WithTimeout(d time.Duration) Option + func WithUserAgent(ua string) Option + type OrderDirection string + const OrderAscending + const OrderDescending + type PartialError struct + Code string + Field string + MetricID string + ProjectID string + Value string + type ProductDetail struct + AggregateByOptions json.RawMessage + Chains []string + MarketSectors json.RawMessage + MetricAvailability json.RawMessage + MetricDefinitions json.RawMessage + MetricSources json.RawMessage + Name string + ProductID string + ProjectID string + Symbol string + type ProductHistoricalMetricsParams struct + AggregateBy AggregateBy + AssetsBridged *bool + ChainIDs []string + End *Date + MetricIDs []string + OrderDirection OrderDirection + Start *Date + type ProductMetricPoint struct + ChainID string + Date string + MetricID string + Value float64 + type Project struct + ArchivedReason string + CoingeckoID string + IsArchived bool + MaintenanceReason string + Name string + Products []ProjectProduct + ProjectID string + Symbol string + URL string + type ProjectContractRow struct + AccountAddress string + AccountCreationTimestamp string + AccountTitle string + ActiveAddresses1dDistinctCount *float64 + ChainID string + ChainName string + GasMarketShare1dAvg *float64 + GasUsed1dSum *float64 + Inflows1dSum *float64 + MarketSectorID string + MarketSectorName string + NetFlows1dSum *float64 + Outflows1dSum *float64 + ProjectID string + ProjectName string + Raw json.RawMessage + TransactionCount1dSum *float64 + TransactionGas1dAvg *float64 + func (r *ProjectContractRow) UnmarshalJSON(data []byte) error + type ProjectDetail struct + AggregateByOptions json.RawMessage + Chains []string + Description json.RawMessage + Links []ProjectLink + MarketSectors json.RawMessage + MetricAvailability json.RawMessage + MetricDefinitions []ProjectMetricDefinition + MetricSources []ProjectMetricDefinition + Name string + ProjectID string + Symbol string + type ProjectLink struct + Summary string + URL string + type ProjectMetricAggregation struct + MetricAggregationName string + MetricID string + ProjectID string + ProjectName string + Value string + type ProjectMetricDefinition struct + Definition string + MetricID string + type ProjectMetricPoint struct + BusinessLine string + Chain string + ProjectID string + ProjectName string + RawMetrics json.RawMessage + Timestamp string + Version string + type ProjectProduct struct + ProductID string + ProductName string + Symbol string + URL string + type ProjectsService struct + func (s *ProjectsService) FinancialStatement(ctx context.Context, projectID string, params *FinancialStatementParams) (*Result[FinancialStatementRow], error) + func (s *ProjectsService) Get(ctx context.Context, projectID string) (*ResultOne[ProjectDetail], error) + func (s *ProjectsService) HistoricalMetrics(ctx context.Context, projectID string, params *HistoricalMetricsParams) (*Result[json.RawMessage], error) + func (s *ProjectsService) List(ctx context.Context) (*Result[Project], error) + func (s *ProjectsService) MetricAggregations(ctx context.Context, projectID string) (*Result[ProjectMetricAggregation], error) + func (s *ProjectsService) Product(ctx context.Context, projectID, productID string) (*ResultOne[ProductDetail], error) + func (s *ProjectsService) ProductHistoricalMetrics(ctx context.Context, projectID, productID string, ...) (*Result[json.RawMessage], error) + type ResponseMetadata struct + Headers http.Header + StatusCode int + type Result struct + Data []T + Errors []PartialError + Metadata ResponseMetadata + type ResultOne struct + Data T + Errors []PartialError + Metadata ResponseMetadata + type TimestampGranularity string + const GranularityMonth + const GranularityQuarter + const GranularityWeek + const GranularityYear + type TrendingContractRow struct + AccountAddress string + AccountCreationTimestamp string + AccountTitle string + ChainID string + ChainName string + MarketSectorID string + MarketSectorName string + ProjectID string + ProjectName string + Raw json.RawMessage + func (r *TrendingContractRow) UnmarshalJSON(data []byte) error