package polymarket

  1. Overview
  2. Docs
OCaml client library for the Polymarket prediction market API

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.2.0.tar.gz
md5=4eb4c5d2f63ff081c9713d90be5a51b2
sha512=0e3de0c9b40683e09ab8f9f966a44784ef1b9b482c3eefef84104a7e8042c92f1d79893ee9588b24fa3d0decaed7f365509f4d1c23c66ce8328efb64e721f276

doc/polymarket.websocket/Websocket/Frame/index.html

Module Websocket.FrameSource

WebSocket frame encoding and decoding (RFC 6455).

This module implements the binary frame format for WebSocket messages. Client frames must be masked; server frames are unmasked.

Frame Opcodes

Sourcemodule Opcode : sig ... end

Close Status Codes

Sourcemodule Close_code : sig ... end

Frame Type

Sourcetype t = {
  1. fin : bool;
  2. opcode : Opcode.t;
  3. payload : string;
}

A WebSocket frame

Encoding/Decoding

Sourceval encode : mask:bool -> t -> string

Encode a frame for sending. Client frames should use mask:true.

Sourceval decode : _ Eio.Flow.source -> t

Decode a frame from a flow. Blocks until a complete frame is received.

Frame Constructors

Sourceval text : ?fin:bool -> string -> t

Create a text frame.

Sourceval binary : ?fin:bool -> string -> t

Create a binary frame.

Sourceval ping : ?payload:string -> unit -> t

Create a ping frame.

Sourceval pong : ?payload:string -> unit -> t

Create a pong frame.

Sourceval close : ?code:Close_code.t -> ?reason:string -> unit -> t

Create a close frame.

Masking

Sourceval apply_mask : key:string -> string -> string

Apply XOR mask to a payload. Used for client-to-server message masking.