package polymarket

  1. Overview
  2. Docs
On This Page
  1. Hash Module
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Primitives.HashSource

Hash Module

Variable-length hex hash type (0x-prefixed, any number of hex chars). Used for signatures and other variable-length hex data.

Sourcetype t
Sourceval make : string -> (t, string) result

Create a hash with validation. Returns Error if invalid.

Sourceval make_exn : string -> t

Create a hash with validation. Raises on invalid input.

Sourceval unsafe_of_string : string -> t

Create from string without validation. Use only for trusted sources.

Sourceval to_string : t -> string

Convert to string.

Sourceval pp : Format.formatter -> t -> unit

Pretty printer for Format.

Sourceval equal : t -> t -> bool

Equality comparison.

Sourceval of_yojson : Yojson.Safe.t -> (t, string) result

JSON deserialization with validation.

Sourceval of_yojson_exn : Yojson.Safe.t -> t

JSON deserialization, raises on invalid.

Sourceval to_yojson : t -> Yojson.Safe.t

JSON serialization.

Sourceval yojson_of_t : t -> Yojson.Safe.t

JSON serialization (ppx_yojson_conv compatibility).

Sourceval t_of_yojson : Yojson.Safe.t -> t

JSON deserialization (ppx_yojson_conv compatibility).