bridge/functions/parseTokenString.md
parseTokenString(
tokenString):GalaChainTokenClassKey
Parse a pipe-delimited token string to TokenClassKey. The last three segments are the category,
type and additional key; everything before them is the collection (core's splitClassKey).
token string gala chain class key split
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenString | string | Pipe-delimited string (e.g., "GALA|Unit|none|none") |
token string
Returns
TokenClassKey object
gala chain token class key
Throws
GalaSDKError INVALID_TOKEN_REFERENCE (tokenId, bad_class_key) for anything else
invalid token reference id bad class key
Example
const key = parseTokenString('GALA|Unit|none|none');
// { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' }