index/functions/normalizeTokenSymbol.md
normalizeTokenSymbol(
symbol):string
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
to upper case
Parameters
| Parameter | Type | Description |
|---|---|---|
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