Module Ledgerwallet_tezos
module Version : sig ... endval curve_of_string : string -> curve optionval pp_curve : Stdlib.Format.formatter -> curve -> unitval pp_curve_short : Stdlib.Format.formatter -> curve -> unitval get_version : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> (Version.t, Ledgerwallet.Transport.error) Stdlib.resultget_version ?pp ?buf ledgeris the version information of the Ledger app running atledger.
val get_git_commit : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> (string, Ledgerwallet.Transport.error) Stdlib.resultget_git_commit ?pp ?buf ledgeris the git commit information of the Ledger app running atledger.
val get_authorized_key : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> (int32 list, Ledgerwallet.Transport.error) Stdlib.resultget_authorized_key ?pp ?buf ledgeris the BIP32 path of the key authorized to bake on the Ledger app running atledger.
val get_authorized_path_and_curve : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> (int32 list * curve, Ledgerwallet.Transport.error) Stdlib.resultget_authorized_path_and_curve ?pp ?buf ledgeris the BIP32 path and the curve code of the key authorized to bake on the Ledger app running atledger.
val get_public_key : ?prompt:bool -> ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> curve -> int32 list -> (Cstruct.t, Ledgerwallet.Transport.error) Stdlib.resultget_public_key ?pp ?buf ?prompt ledger curve pathis0x02 || pkfromledgeratpathfor curvecurve. Ifpromptistrue(the default), then a prompt on Ledger screen will ask user confirmation.
val authorize_baking : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> curve -> int32 list -> (Cstruct.t, Ledgerwallet.Transport.error) Stdlib.resultauthorize_baking ?pp ?buf ?prompt ledger curve pathis likeget_public_keywithprompt = true, but only works with the baking Ledger application and serves to indicate that the key fromcurveatpathis allowed to bake.This is deprecated as it ignores test-chains, see
setup_baking.
val setup_baking : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> main_chain_id:string -> main_hwm:int32 -> test_hwm:int32 -> curve -> int32 list -> (Cstruct.t, Ledgerwallet.Transport.error) Stdlib.resultsetup_baking ?pp ?buf ?prompt ledger ~main_chain_id ~main_hwm ~test_hwm curve pathsets up the Ledger's Baking application: it informs the device of the ID of the main chain (should be of length4), sets the high watermarks for the main and test chains, and indicates that the key at the givencurve/pathis authorized for baking.
val deauthorize_baking : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> (unit, Ledgerwallet.Transport.error) Stdlib.resultdeauthorize_baking ?pp ?buf ledgerdeauthorizes the Ledger's Baking application from baking for any address.
val get_high_watermark : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> (int32, Ledgerwallet.Transport.error) Stdlib.resultget_high_watermark ?pp ?buf ledgeris the current value of the high water mark for the main-chain onledger. This works with the baking app only. Seeget_all_high_watermarksfor a more complete query.
val get_all_high_watermarks : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> ([ `Main_hwm of int32 ] * [ `Test_hwm of int32 ] * [ `Chain_id of string ], Ledgerwallet.Transport.error) Stdlib.resultQuery the high water marks for the main and test chains, as well as the ID of the main-chain (string of length 4) recorded by the Ledger Baking app.
val set_high_watermark : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> int32 -> (unit, Ledgerwallet.Transport.error) Stdlib.resultset_high_watermark ?pp ?buf ledger hwmreset the high water mark onledgertohwmfor the main-chain. This works with the baking app only. Usesetup_bakingto be able to also reset all the test-chain water mark.
val sign : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> ?hash_on_ledger:bool -> Hidapi.t -> curve -> int32 list -> Cstruct.t -> (Cstruct.t, Ledgerwallet.Transport.error) Stdlib.resultsign ?pp ?buf ?hash_on_ledger h curve path payloadis the signature ofpayload(or its hash ifhash_on_ledgeristrue, the default), signed onledgerwith key from curvecurveatpath.
val get_deterministic_nonce : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> curve -> int32 list -> Cstruct.t -> (Cstruct.t, Ledgerwallet.Transport.error) Stdlib.resultget_deterministic_nonce ?pp ?buf h curve path payloadasks the ledger for a deterministic nonce from a some given bytes (using HMAC).
val sign_and_hash : ?pp:Stdlib.Format.formatter -> ?buf:Cstruct.t -> Hidapi.t -> curve -> int32 list -> Cstruct.t -> (Cstruct.t * Cstruct.t, Ledgerwallet.Transport.error) Stdlib.resultsign ?pp ?buf ?hash_on_ledger h curve path payloadis the signature ofpayload(or its hash ifhash_on_ledgeristrue, the default), signed onledgerwith key from curvecurveatpath.