bridge/functions/parseTokenId.md
parseTokenId(
tokenId):ParsedTokenId
Parse a TokenId (string or object) to TokenClassKey and stringified form.
token id parsed
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenId | TokenClassKeyInput | Token identifier (pipe-delimited string or TokenClassKey object) |
token id class key input
Returns
Parsed token with TokenClassKey and stringified form
parsed token id
Throws
GalaSDKError INVALID_TOKEN_REFERENCE (tokenId, bad_class_key) if it is neither
invalid token reference id bad class key
Example
parseTokenId('GALA|Unit|none|none');
parseTokenId({ collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' });