Skip to main content

Function: normalizeTokenSymbol()

Gala Launchpad SDK 9.0.0-rc.5


Gala Launchpad SDK 9.0.0-rc.5 / index / normalizeTokenSymbol

Function: normalizeTokenSymbol()

normalizeTokenSymbol(symbol): string

Defined in: packages/launchpad-sdk/dist/utils/tokenNameNormalizer.d.ts:95

Normalizes a token symbol for API submission

Used during token creation to prepare user-provided token symbols for API validation. Removes whitespace and converts to uppercase.

Distinction from normalizeTokenKey():

  • normalizeTokenKey: Cache keys (includes additional transformations)
  • normalizeTokenSymbol: User input preparation (pure trim + uppercase)

Current normalizations:

  • .trim() - Remove leading/trailing whitespace
  • .toUpperCase() - Convert to uppercase

Parameters​

symbol​

string

The token symbol to normalize

Returns​

string

Normalized symbol (trimmed and uppercased)

Example​

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

const symbol = normalizeTokenSymbol(' gala ');
console.log(symbol); // 'GALA'

Since​

6.15.1