Text128.ts
Text128 overview
Table of contents
arbitrary
arbitrary
FastCheck arbitrary for generating random Text128 instances.
Signature
export declare const arbitrary: FastCheck.Arbitrary<string>Added in v2.0.0
constants
TEXT128_MIN_LENGTH
Constants for Text128 validation. text .size (0 .. 128)
Signature
export declare const TEXT128_MIN_LENGTH: 0Added in v2.0.0
encoding
toBytes
Encode Text128 to bytes (unsafe)
Signature
export declare const toBytes: (a: string, overrideOptions?: ParseOptions) => anyAdded in v2.0.0
toHex
Encode Text128 to hex string (unsafe)
Signature
export declare const toHex: (a: string, overrideOptions?: ParseOptions) => stringAdded in v2.0.0
parsing
fromBytes
Parse Text128 from bytes (unsafe)
Signature
export declare const fromBytes: (i: any, overrideOptions?: ParseOptions) => stringAdded in v2.0.0
fromHex
Parse Text128 from hex string (unsafe)
Signature
export declare const fromHex: (i: string, overrideOptions?: ParseOptions) => stringAdded in v2.0.0
predicates
isText128
Check if the given value is a valid Text128
Signature
export declare const isText128: (u: unknown, overrideOptions?: ParseOptions | number) => u is stringAdded in v2.0.0
schemas
Text128
Schema for Text128 representing a variable-length text string (0-128 chars). text .size (0 .. 128) Follows the Conway-era CDDL specification.
Signature
export declare const Text128: Schema.refine<string, typeof Schema.String>Added in v2.0.0
utils
FromBytes
Signature
export declare const FromBytes: Schema.transform<
Schema.transform<typeof Schema.Uint8ArrayFromSelf, typeof Schema.String>,
Schema.refine<string, typeof Schema.String>
>FromHex
Signature
export declare const FromHex: Schema.transform<
Schema.Schema<Uint8Array, string, never>,
Schema.transform<
Schema.transform<typeof Schema.Uint8ArrayFromSelf, typeof Schema.String>,
Schema.refine<string, typeof Schema.String>
>
>TEXT128_MAX_LENGTH
Signature
export declare const TEXT128_MAX_LENGTH: 128