dex-skills v0.1.0

getTokenInfo()

Retrieve detailed information about a token launched on a supported platform. This is a read-only operation that does not require a private key.

Signature

// Get a platform skill, then call getTokenInfo() with a string address
const skill = getSkill(skills, "pumpfun");
const info: TokenInfo = await skill.getTokenInfo("TokenMintAddress...");

Parameters

Parameter Type Description
tokenAddress * string The on-chain address of the token to query. Passed as a plain string argument, not an object.
No private key needed
This method only reads public on-chain and platform data. You do not need to provide a wallet or private key to call it.

Return Value

Returns a Promise<TokenInfo> containing metadata and market data. Optional fields may be undefined depending on what the platform exposes.

TokenInfo
interface TokenInfo {
  platform: Platform;
  chain: Chain;
  tokenAddress: string;
  name: string;
  symbol: string;
  description?: string;
  imageUrl?: string;
  creatorAddress: string;
  marketCap?: number;
  price?: number;
  priceUsd?: number;
  totalSupply?: number;
  holderCount?: number;
  bondingCurveProgress?: number; // 0-100
  isGraduated?: boolean;
  liquidityUsd?: number;
  volume24h?: number;
  createdAt?: string;
}

Field Notes

  • bondingCurveProgress -- A value from 0 to 100 representing how far the token has progressed along the bonding curve. Only available on platforms that use bonding curves.
  • isGraduated -- Whether the token has graduated from the bonding curve to a full DEX listing.
  • priceUsd -- USD-denominated price. Requires the platform to provide price oracle data.
  • volume24h -- Rolling 24-hour trading volume in USD.

Example

query-token.ts
import { createSkills, getSkill } from "dex-skills";

const skills = createSkills({
  wallets: {
    solana: {
      privateKey: "your-base58-private-key",
      rpcUrl: "https://api.mainnet-beta.solana.com",
    },
  },
});

const pumpfun = getSkill(skills, "pumpfun");
const info = await pumpfun.getTokenInfo("So11111111111111111111111111111111111111112");

console.log(info.name);           // Token name
console.log(info.symbol);         // Token symbol
console.log(info.marketCap);      // Market cap (if available)
console.log(info.priceUsd);       // USD price (if available)
console.log(info.holderCount);    // Number of holders
console.log(info.isGraduated);    // Bonding curve graduation status