package ledgerwallet

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type cmd =
  1. | Apdu_command : {
    1. cmd : 'a;
    2. cla_of_cmd : 'a -> int;
    3. ins_of_cmd : 'a -> int;
    } -> cmd
    (*

    Arbitrary type of a command, with its converters.

    *)
val create_cmd : cmd:'a -> cla_of_cmd:('a -> int) -> ins_of_cmd:('a -> int) -> cmd
type t = {
  1. cmd : cmd;
  2. p1 : int;
  3. p2 : int;
  4. lc : int;
  5. le : int;
  6. data : Cstruct.t;
}

Type of an ADPU.

val max_data_length : int

max_data_length is the maximum data length of an APDU.

val create : ?p1:int -> ?p2:int -> ?lc:int -> ?le:int -> ?data:Cstruct.t -> cmd -> t
val create_string : ?p1:int -> ?p2:int -> ?lc:int -> ?le:int -> ?data:string -> cmd -> t
val length : t -> int

length t is the size of t in bytes.

val write : Cstruct.t -> t -> Cstruct.t

write cs t writes t at cs and returns cs shifted by length t bytes.