From 8036b3c096b0dc1a60ae93fee09c68f8cde937fe Mon Sep 17 00:00:00 2001 From: zhongsongzhi-cmyk Date: Sat, 15 Aug 2026 11:46:23 +0800 Subject: [PATCH] fix(trenches): defer launchpad defaults to service --- src/client/OpenApiClient.ts | 44 ++++--------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/src/client/OpenApiClient.ts b/src/client/OpenApiClient.ts index c72c9dd..0fd6314 100644 --- a/src/client/OpenApiClient.ts +++ b/src/client/OpenApiClient.ts @@ -821,39 +821,6 @@ function formatCurl(method: string, url: string, headers: Record return `\n[curl]\ncurl -X ${method} '${url}' \\\n${headerArgs}${bodyArg}\n`; } -const TRENCHES_PLATFORMS: Record = { - sol: [ - "Pump.fun", "pump_mayhem", "pump_mayhem_agent", "pump_agent", - "letsbonk", "bonkers", "bags", "memoo", "liquid", "bankr", "zora", - "surge", "anoncoin", "moonshot_app", "wendotdev", "heaven", "sugar", - "token_mill", "believe", "trendsfun", "trends_fun", "jup_studio", - "Moonshot", "boop", "ray_launchpad", "meteora_virtual_curve", "xstocks", - ], - bsc: [ - "fourmeme", "fourmeme_agent", "bn_fourmeme", "four_xmode_agent", - "cubepeg", "likwid", "goplus_creator", "goplus_skills", "openfour", - "flap", "flap_stocks", "flap_aioracle", "clanker", "lunafun", - ], - base: [ - "clanker", "bankr", "flaunch", "zora", "zora_creator", - "baseapp", "basememe", "virtuals_v2", "klik", - ], - eth: [ - "trench", "clanker", "klik", "livo", "stroid", - "pool_uniswap_v2", "pool_uniswap_v3", "printr", - ], - robinhood: [ - "noxa", "virtuals_v2", "bankr", "dyorswap", - "pool_uniswap_v2", "pool_uniswap_v3", "pool_uniswap_v4", - ], - arc: [ - "dyorfun_v3", "dyorswap", "trench", "onmifun", "sharcfun", "klik", - ], - stable: [ - "dyorfun_v3", "dyorswap", "trench", - ], -}; - const TRENCHES_QUOTE_ADDRESS_TYPES: Record = { sol: [4, 5, 3, 1, 13, 0], bsc: [6, 7, 1, 16, 8, 3, 9, 10, 2, 17, 18, 0], @@ -864,7 +831,6 @@ const TRENCHES_QUOTE_ADDRESS_TYPES: Record = { function buildTrenchesBody(chain: string, types?: string[], platforms?: string[], limit?: number, filters?: Record): Record { const selectedTypes = types?.length ? types : ["new_creation", "near_completion", "completed"]; - const launchpad_platform = platforms?.length ? platforms : (TRENCHES_PLATFORMS[chain] ?? []); const quote_address_type = TRENCHES_QUOTE_ADDRESS_TYPES[chain] ?? []; const actualLimit = limit ?? 80; const section: Record = { @@ -873,12 +839,10 @@ function buildTrenchesBody(chain: string, types?: string[], platforms?: string[] limit: actualLimit, ...filters, }; - // launchpad_platform / quote_address_type act as allow-list filters: sending an - // empty array filters out every result. Configured chains (see the maps above) - // supply real values; for any chain missing config we omit the field so the API - // applies its own defaults rather than returning an all-empty response. This is a - // safety net — new chains should still be added to both maps above. - if (launchpad_platform.length) section.launchpad_platform = launchpad_platform; + // Let the service apply its current per-chain launchpad defaults when the user + // does not provide an explicit filter. Keeping a duplicate client-side allow-list + // here can silently hide newly supported platforms until the CLI is released. + if (platforms?.length) section.launchpad_platform = platforms; if (quote_address_type.length) section.quote_address_type = quote_address_type; const body: Record = { version: "v2" }; for (const type of selectedTypes) {