UNPKG

dexscreener-sdk

Version:

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

32 lines (31 loc) 1.22 kB
import { BaseModel } from './BaseModel.js'; /** * Represents a liquidity pair from the DEX. */ export class Pair extends BaseModel { /** * Creates an instance of Pair. * @param data Partial data to initialize the pair. */ constructor(data) { super(data); this.chainId = data.chainId || ''; this.dexId = data.dexId || ''; this.url = data.url || ''; this.pairAddress = data.pairAddress || ''; this.priceNative = data.priceNative || ''; this.priceUsd = data.priceUsd || ''; this.fdv = data.fdv || 0; this.marketCap = data.marketCap || 0; this.pairCreatedAt = data.pairCreatedAt || 0; this.labels = data.labels || []; this.volume = data.volume || {}; this.priceChange = data.priceChange || {}; this.baseToken = data.baseToken || { address: '', name: '', symbol: '' }; this.quoteToken = data.quoteToken || { address: '', name: '', symbol: '' }; this.liquidity = data.liquidity || { usd: 0, base: 0, quote: 0 }; this.boosts = data.boosts || { active: 0 }; this.txns = data.txns || {}; this.info = data.info || {}; } }