Skip to main content

bridge/functions/parseTokenId.md

parseTokenId(tokenId): ParsedTokenId

Parse a TokenId (string or object) to TokenClassKey and stringified form.

Parameters​

ParameterTypeDescription
tokenIdTokenClassKeyInputToken identifier (pipe-delimited string or TokenClassKey object)

Returns​

ParsedTokenId

Parsed token with TokenClassKey and stringified form

Throws​

GalaSDKError INVALID_TOKEN_REFERENCE (tokenId, bad_class_key) if it is neither

Example​

parseTokenId('GALA|Unit|none|none');
parseTokenId({ collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' });