UNPKG

@cfxdevkit/defillama

Version:

A TypeScript library for interacting with Defillama API

27 lines (26 loc) 906 B
/** * Base API client for DeFi Llama * Handles HTTP requests to the DeFi Llama API * @public */ export declare class DefiLlamaAPI { protected customBaseUrl?: string | undefined; /** * Base URL for the DeFi Llama API */ protected readonly BASE_URL = "https://api.llama.fi"; /** * Creates a new DeFi Llama API client * @param customBaseUrl - Optional custom base URL for the API */ constructor(customBaseUrl?: string | undefined); /** * Makes a request to the DeFi Llama API * @param endpoint - API endpoint to call * @param baseUrl - Base URL to use (defaults to BASE_URL) * @param params - Query parameters to include in the request * @returns Promise with the API response * @internal */ protected fetchApi<T>(endpoint: string, baseUrl?: string, params?: Record<string, string | number | boolean>): Promise<T>; }