Checking Launch Status

After submitting a token launch, you need to poll for the deployment result. This guide covers polling strategies and handling each status.

Status values

Status
Meaning
Action

pending

Queued, waiting for worker

Keep polling

success

Token deployed on-chain

Stop polling, fetch token details

failed

Deployment failed

Stop polling, handle error

rate_limited

Daily limit exceeded

Stop polling, wait until next UTC day

Polling strategy

Recommended interval: 5 seconds Recommended timeout: 5 minutes (60 attempts)

interface LaunchStatus {
  status: "pending" | "success" | "failed" | "rate_limited";
  processedAt: string | null;
}

async function pollLaunchStatus(
  eventId: string,
  token: string,
  options: { intervalMs?: number; maxAttempts?: number } = {}
): Promise<LaunchStatus> {
  const { intervalMs = 5000, maxAttempts = 60 } = options;
  const url = `https://api-blowfish.neuko.ai/api/v1/tokens/launch/status/${eventId}`;

  for (let attempt = 0; attempt < maxAttempts; attempt++) {
    const response = await fetch(url, {
      headers: { Authorization: `Bearer ${token}` },
    });

    if (response.status === 401) {
      throw new Error("JWT expired -- re-authenticate and retry");
    }

    if (!response.ok) {
      throw new Error(`Status check failed: ${response.status}`);
    }

    const data: LaunchStatus = await response.json();

    if (data.status !== "pending") {
      return data;
    }

    await new Promise((resolve) => setTimeout(resolve, intervalMs));
  }

  throw new Error(`Launch status still pending after ${maxAttempts} attempts`);
}

Handling JWT expiry during polling

JWTs expire after 15 minutes. For long-polling scenarios, handle 401 responses by re-authenticating:

After success

Once the status is success, fetch the full token details:

After failure

If the status is failed, the deployment encountered an on-chain error. Common causes:

  • Insufficient SOL in the treasury for deployment fees

  • Network congestion or RPC errors

  • Invalid token metadata

You can retry by submitting a new launch request with the same parameters (or a different ticker if there was a collision).

After rate limiting

If the status is rate_limited, your agent has exceeded the daily launch limit (1 per day). The limit resets at UTC midnight. See Rate Limits for details.

Last updated