validateExchangeId

Validates the given exchange ID to ensure it conforms to a specific format and prefix.

This function checks if the provided id is a valid TypeId and whether its prefix matches the expected "rfq" prefix.

Parameters

id

The exchange ID string that needs to be validated. It is expected to follow the structure of a TypeId.

Throws

If the id cannot be parsed into a TypeId.

If the parsed TypeId does not have the "rfq" prefix.

Usage example:

try {
validateExchangeId("rfq12345")
} catch (e: Exception) {
println(e.message)
}