UNPKG

dexscreener-sdk

Version:

A TypeScript wrapper for the DEX Screener API, providing easy access to token profiles, boosts, orders, pairs, and more.

88 lines (87 loc) 2.53 kB
import { BaseModel } from './BaseModel.js'; /** * Represents a token with basic identification details. */ export interface IToken { /** Token address. */ address: string; /** Token name. */ name: string; /** Token symbol. */ symbol: string; } /** * Represents liquidity information for a pair. */ export interface ILiquidity { /** Liquidity value in USD. */ usd: number; /** Liquidity value in the base token. */ base: number; /** Liquidity value in the quote token. */ quote: number; } /** * Represents additional information about a pair. */ export interface IInfo { /** Optional image URL for the pair. */ imageUrl?: string; /** Optional array of website objects. */ websites?: { url: string; }[]; /** Optional array of social objects. */ socials?: { platform: string; handle: string; }[]; } /** * Represents a liquidity pair from the DEX. */ export declare class Pair extends BaseModel { /** Blockchain network identifier. */ chainId: string; /** Identifier of the DEX. */ dexId: string; /** URL to the pair’s DEX Screener page. */ url: string; /** Unique pair address. */ pairAddress: string; /** Price in native token format. */ priceNative: string; /** Price in USD (optional). */ priceUsd: string; /** Fully diluted valuation (optional). */ fdv: number; /** Market capitalization (optional). */ marketCap: number; /** Timestamp when the pair was created (optional). */ pairCreatedAt: number; /** An array of labels. */ labels: string[]; /** Volume data represented as a dynamic object. */ volume: Record<string, number>; /** Price change data represented as a dynamic object. */ priceChange: Record<string, number>; /** Information about the base token. */ baseToken: IToken; /** Information about the quote token. */ quoteToken: IToken; /** Liquidity information. */ liquidity: ILiquidity; /** Boosts data (e.g., active boosts count). */ boosts: { active: number; }; /** Transaction data (e.g., buys and sells). */ txns: Record<string, any>; /** Additional info such as images, websites, and socials. */ info: IInfo; /** * Creates an instance of Pair. * @param data Partial data to initialize the pair. */ constructor(data: Partial<Pair>); }