assertIsOffchainMessageContentRestrictedAsciiOf1232BytesMax

function assertIsOffchainMessageContentRestrictedAsciiOf1232BytesMax(
    putativeContent,
): asserts putativeContent is Readonly<{
    format: RESTRICTED_ASCII_1232_BYTES_MAX;
    text: Brand<
        string,
        'offchainMessageContentRestrictedAsciiOf1232BytesMax'
    >;
}>;

In the event that you receive content of a v0 offchain message from an untrusted source, use this function to assert that it conforms to the OffchainMessageContentRestrictedAsciiOf1232BytesMax type.

Parameters

ParameterType
putativeContent{ format: OffchainMessageContentFormat; text: string; }
putativeContent.formatOffchainMessageContentFormat
putativeContent.textstring

Returns

asserts putativeContent is Readonly<{ format: RESTRICTED_ASCII_1232_BYTES_MAX; text: Brand<string, "offchainMessageContentRestrictedAsciiOf1232BytesMax"> }>

See

OffchainMessageContentRestrictedAsciiOf1232BytesMax for more detail.

On this page