Types
Complete TypeScript type definitions exported by the dex-skills package. All types are
available via import type { ... } from "dex-skills".
Platform
String literal union identifying a supported launchpad platform.
type Platform =
| "pumpfun"
| "letsbonk"
| "moonshot"
| "zora"
| "clanker"
| "fourmeme"
| "sunpump"; Chain
String literal union identifying a supported blockchain.
type Chain =
| "solana"
| "base"
| "bnb"
| "tron"; LaunchParams
Parameters accepted by the launch() method.
interface LaunchParams {
name: string;
symbol: string;
description?: string;
imageUrl?: string;
initialBuyAmount?: string;
links?: {
twitter?: string;
telegram?: string;
website?: string;
discord?: string;
github?: string;
};
extra?: Record<string, unknown>;
} LaunchResult
Object returned by a successful launch() call.
interface LaunchResult {
platform: Platform;
chain: Chain;
tokenAddress: string;
txHash: string;
tokenName: string;
tokenSymbol: string;
creatorAddress: string;
timestamp: string;
} TokenInfo
Token metadata and market data returned by getTokenInfo() and listTokens().
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;
} ListTokensParams
Optional parameters for the listTokens() method.
interface ListTokensParams {
limit?: number; // default: 20
sortBy?: "marketCap" | "createdAt" | "volume" | "price"; // default: "createdAt"
sortOrder?: "asc" | "desc"; // default: "desc"
} TradeParams
Parameters accepted by the buy() and sell() methods.
interface TradeParams {
tokenAddress: string;
amount: string;
slippage?: number;
} TradeResult
Object returned by a successful buy() or sell() call.
interface TradeResult {
platform: Platform;
chain: Chain;
txHash: string;
tokenAddress: string;
action: "buy" | "sell";
tokenAmount?: string;
nativeAmount?: string;
timestamp: number;
} PriceQuoteParams
Parameters accepted by the estimatePrice() method.
interface PriceQuoteParams {
tokenAddress: string;
action: "buy" | "sell";
amount: string;
} PriceQuote
Object returned by the estimatePrice() method.
interface PriceQuote {
estimatedAmount: string;
estimatedCost: string;
fee?: string;
pricePerToken?: string;
} TradeHistoryItem
A single trade record returned by the getTradeHistory() method.
interface TradeHistoryItem {
txHash: string;
action: "buy" | "sell";
tokenAmount: string;
nativeAmount?: string;
priceUsd?: number;
timestamp: number;
walletAddress?: string;
} HolderInfo
Token holder information returned by the getHolders() method.
interface HolderInfo {
address: string;
balance: string;
percentage?: number;
} TrendingParams
Optional parameters for the getTrending() method.
interface TrendingParams {
category?: "gainers" | "volume" | "new" | "graduated";
limit?: number;
} PlatformSkill
Interface that all platform implementations must satisfy. Each supported platform provides a class
that implements this interface. Methods marked with ?
are optional and only available on certain platforms.
interface PlatformSkill {
readonly platform: Platform;
readonly chain: Chain;
launch(params: LaunchParams): Promise<LaunchResult>;
getTokenInfo(tokenAddress: string): Promise<TokenInfo>;
listTokens(params?: ListTokensParams): Promise<TokenInfo[]>;
// Optional methods -- not all platforms support these
buy?(params: TradeParams): Promise<TradeResult>;
sell?(params: TradeParams): Promise<TradeResult>;
getTrending?(params?: TrendingParams): Promise<TokenInfo[]>;
getTradeHistory?(tokenAddress: string, params?: { limit?: number }): Promise<TradeHistoryItem[]>;
getHolders?(tokenAddress: string, params?: { limit?: number }): Promise<HolderInfo[]>;
estimatePrice?(params: PriceQuoteParams): Promise<PriceQuote>;
} WalletConfig
Configuration object for initializing a platform skill with wallet credentials.
interface WalletConfig {
privateKey: string;
rpcUrl?: string;
}