Skip to main content

index/functions/normalizeTokenName.md

normalizeTokenName(tokenName): string

Normalizes a launchpad token name for consistent API usage.

All token names are stored lowercase in the backend. This utility ensures consistent normalization across all SDK services.

Current normalizations:

  • .trim() - Remove leading/trailing whitespace
  • .toLowerCase() - Convert to lowercase

Parameters​

ParameterTypeDescription
tokenNamestringThe token name to normalize

Returns​

string

Normalized token name (trimmed and lowercased)

Example​

import { normalizeTokenName } from '../utils/tokenNameNormalizer';

const normalized = normalizeTokenName(' MyToken ');
console.log(normalized); // 'mytoken'