Parses a token module event, decoding the details from CBOR format. If the desired outcome is to be able to handle
arbitrary token events, it's recommended to use Cbor.decode instead.
Returns
The parsed token module event with decoded details.
Throws
If the event cannot be parsed as a token module event.
Example
try { constparsedEvent = parseModuleEvent(encodedEvent); switch (parsedEvent.type) { // typed details are now available, e.g.: caseTokenOperationType.AddAllowList: console.log(parsedEvent.details.target); ... } } catch (error) { // Fall back to using Cbor.decode constdecodedDetails = Cbor.decode(encodedEvent.details); switch (encodedEvent.type) { // do something with the decoded details } }
Parses a token module event, decoding the details from CBOR format. If the desired outcome is to be able to handle arbitrary token events, it's recommended to use Cbor.decode instead.
Returns
The parsed token module event with decoded details.
Throws
If the event cannot be parsed as a token module event.
Example