Module Bitcoinml.Tx
val amount_check : ?max_money:Stdint.Int64.t -> Stdint.Int64.t -> bool
amount_check ~max_money:Int64.t num
checks ifnum
exceeds~max_money
or 21M
module In : sig ... end
Transaction input
module Out : sig ... end
Transaction output
module Witness : sig ... end
Witness data
type t
=
{
hash : Hash.t;
version : Stdint.int32;
txin : In.t list;
txout : Out.t list;
locktime : Stdint.uint32;
size : int;
vsize : int;
witness : Witness.t option;
}
val parse : ?coinbase:bool -> ?hex:bool -> string -> string * t option
parse ~coinbase:bool ~hex:bool data
parses a binarydata
and returns the parsed transaction;data
could be a binary data, or an hex human readable string if~hex
is true
val parse_legacy : ?coinbase:bool -> ?hex:bool -> string -> string * t option
parse_legacy ~coinbase:bool ~hex:bool data
; same asparse
but disabling segwit
val parse_all : string -> int -> t list option
parse_all data n
parses a list ofn
transactions encoded indata
val parse_all_legacy : string -> int -> t list option
parse_all_legacy data n
; same asparse_all
but disabling segwit
val serialize : ?hex:bool -> t -> string
serialize ~hex:bool tx
serializes the transactiontx
; the result is a binary data, or an hex human readable string if~hex
is true
val serialize_legacy : ?hex:bool -> t -> string
serialize_legacy ~hex:bool tx
; same asserialize
but disabling segwit
val serialize_all : t list -> string
serialize_all txl
serializes a list of transactiontxl
val serialize_all_legacy : t list -> string
serialize_all_legacy txl
; same asserialize_all
but disabling segwit
val is_witness : t -> bool
is_witness tx
returns true iftx
hash witness data
val is_coinbase : t -> bool
is_coinbase tx
returns true iftx
is a coinbase transaction