UNPKG

@messari/sdk

Version:

Messari SDK provides a type-safe, intuitive interface for accessing Messari's suite of crypto data and AI APIs.

78 lines (77 loc) 3.1 kB
import { type Logger } from "../logging"; import type { ClientEventHandler, ClientEventType, MessariClientOptions } from "./types"; import type { AIInterface, AssetInterface, FundraisingAPIInterface, DiligenceAPIInterface, IntelInterface, NewsInterface, ResearchInterface, TokenUnlocksInterface, ExchangesInterface, NetworksInterface, MarketsInterface, UserManagementInterface } from "./base"; import { MessariClientBase } from "./base"; /** * MessariClient is the main client class for interacting with the Messari API. * It provides a comprehensive interface for accessing market data, news, intelligence, * and AI-powered features through typed methods and robust error handling. * * Key features: * - Full TypeScript support with strongly typed requests and responses * - Configurable logging and error handling * - Built-in request timeout and retry logic * - Pagination helpers for listing endpoints * - Event system for monitoring requests, responses and errors * - Connection pooling support via HTTP agent * - Custom fetch implementation support */ export declare class MessariClient extends MessariClientBase { private readonly apiKey; private readonly baseUrl; private readonly timeoutMs; private readonly fetchFn; private readonly agent?; private readonly defaultHeaders; protected readonly eventHandlers: Map<ClientEventType, Set<ClientEventHandler<ClientEventType>>>; protected logger: Logger; protected isLoggingDisabled: boolean; constructor(options: MessariClientOptions); private request; private requestStream; private requestWithMetadata; private paginate; readonly ai: AIInterface; /** * @deprecated Asset is Work-in-Progress and not production ready */ readonly asset: AssetInterface; /** * @deprecated Exchanges is Work-in-Progress and not production ready */ readonly exchanges: ExchangesInterface; readonly networks: NetworksInterface; /** * @deprecated Markets is Work-in-Progress and not production ready */ readonly markets: MarketsInterface; /** * @deprecated Intel is Work-in-Progress and not production ready */ readonly intel: IntelInterface; /** * @deprecated Fundraising is Work-in-Progress and not production ready */ readonly fundraising: FundraisingAPIInterface; /** * @deprecated TokenUnlocks is Work-in-Progress and not production ready */ readonly tokenUnlocks: TokenUnlocksInterface; /** * @deprecated News is Work-in-Progress and not production ready */ readonly news: NewsInterface; /** * @deprecated Research is Work-in-Progress and not production ready */ readonly research: ResearchInterface; /** * @deprecated Diligence is Work-in-Progress and not production ready */ readonly diligence: DiligenceAPIInterface; /** * User Management API service * Provides methods for managing user-specific data like watchlists, credits, and permissions */ readonly userManagement: UserManagementInterface; }