12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2019-2021 Nomadic Labs <contact@nomadic-labs.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)openProtocolopenAlpha_contextopenClient_proto_argsopenTezos_michelineletgroup={Tezos_clic.name="multisig";title="Commands for managing a multisig smart contract";}letthreshold_param()=Tezos_clic.param~name:"threshold"~desc:"Number of required signatures"Client_proto_args.int_parameterletpublic_key_param()=Client_keys.Public_key.source_param~name:"key"~desc:"Each signer of the multisig contract"letsecret_key_param()=Client_keys.Secret_key.source_param~name:"key"~desc:"Secret key corresponding to one of the public keys stored on the \
multisig contract"letsignature_param()=Tezos_clic.param~name:"signature"~desc:"Each signer of the multisig contract"Client_proto_args.signature_parameterletlambda_param()=Tezos_clic.param~name:"lambda"~desc:"the lambda to execute, of type lambda unit (list operation)"string_parameterletbytes_only_switch=Tezos_clic.switch~long:"bytes-only"~doc:"return only the byte sequence to be signed"()letbytes_param~name~desc=Tezos_clic.param~name~descClient_proto_args.bytes_parameterlettransfer_options=Tezos_clic.args10Client_proto_args.fee_argClient_proto_context_commands.dry_run_switchClient_proto_context_commands.verbose_signing_switchClient_proto_args.gas_limit_argClient_proto_args.storage_limit_argClient_proto_args.counter_argClient_proto_args.arg_argClient_proto_args.no_print_source_flagClient_proto_args.fee_parameter_argsClient_proto_args.entrypoint_argletnon_transfer_options=Tezos_clic.args8Client_proto_args.fee_argClient_proto_context_commands.dry_run_switchClient_proto_context_commands.verbose_signing_switchClient_proto_args.gas_limit_argClient_proto_args.storage_limit_argClient_proto_args.counter_argClient_proto_args.no_print_source_flagClient_proto_args.fee_parameter_argsletprepare_command_displayprepared_commandbytes_only=ifbytes_onlythenFormat.printf"0x%a@."Hex.pp(Hex.of_bytesprepared_command.Client_proto_multisig.bytes)elseFormat.printf"%a@.%a@.%a@.%a@."(funppfx->Format.fprintfppf"Bytes to sign: '0x%a'"Hex.pp(Hex.of_bytesx))prepared_command.Client_proto_multisig.bytes(funppfx->Format.fprintfppf"Blake 2B Hash: '%s'"(Tezos_crypto.Base58.raw_encodeTezos_crypto.Blake2B.(hash_bytes[x]|>to_string)))prepared_command.Client_proto_multisig.bytes(funppfz->Format.fprintfppf"Threshold (number of signatures required): %s"(Z.to_stringz))prepared_command.Client_proto_multisig.threshold(funppf->Format.fprintfppf"@[<2>Public keys of the signers:@ %a@]"(Format.pp_print_list~pp_sep:(funppf()->Format.fprintfppf"@ ")Signature.Public_key.pp))prepared_command.Client_proto_multisig.keysletget_parameter_type(cctxt:#Protocol_client_context.full)~(destination:Contract.t)~entrypoint=letopenLwt_result_syntaxinmatchdestinationwith|Implicit_->letopenMichelineinreturn@@strip_locations@@Prim(0,Script.T_unit,[],[])|Originatedcontract->(let*o=Michelson_v1_entrypoints.contract_entrypoint_typecctxt~chain:cctxt#chain~block:cctxt#block~contract~entrypoint~normalize_types:trueinmatchowith|None->cctxt#error"Contract %a has no entrypoint named %a"Contract_hash.ppcontractEntrypoint.ppentrypoint|Someparameter_type->returnparameter_type)letcommands_ro():#Protocol_client_context.fullTezos_clic.commandlist=Tezos_clic.[command~group~desc:"Show the hashes of the supported multisig contracts."no_options(fixed["show";"supported";"multisig";"hashes"])(fun()_cctxt->Format.printf"Hashes of supported multisig contracts:@.";List.iter(funh->Format.printf"%a@."Script_expr_hash.pph)Client_proto_multisig.known_multisig_hashes;Lwt_result_syntax.return_unit);command~group~desc:"Show the script of the recommended multisig contract."no_options(fixed["show";"multisig";"script"])(fun()_cctxt->let{Michelson_v1_parser.source;_}=Michelson_v1_printer.unparse_toplevelClient_proto_multisig.multisig_scriptinFormat.printf"%s@."source;Lwt_result_syntax.return_unit);]letcommands_rw():#Protocol_client_context.fullTezos_clic.commandlist=Tezos_clic.[command~group~desc:"Originate a new multisig contract."(args9Client_proto_args.fee_argClient_proto_context_commands.dry_run_switchClient_proto_args.gas_limit_argClient_proto_args.storage_limit_argClient_proto_args.delegate_arg(Client_keys.force_switch())Client_proto_args.no_print_source_flagClient_proto_args.fee_parameter_argsClient_proto_context_commands.verbose_signing_switch)(prefixes["deploy";"multisig"]@@Client_proto_contracts.Raw_contract_alias.fresh_alias_param~name:"new_multisig"~desc:"name of the new multisig contract"@@prefix"transferring"@@Client_proto_args.tez_param~name:"qty"~desc:"amount taken from source"@@prefix"from"@@Client_keys.Public_key_hash.source_param~name:"src"~desc:"name of the source contract"@@prefixes["with";"threshold"]@@threshold_param()@@prefixes["on";"public";"keys"]@@seq_of_param(public_key_param()))(fun(fee,dry_run,gas_limit,storage_limit,delegate,force,no_print_source,fee_parameter,verbose_signing)alias_namebalancesourcethresholdkeys(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*alias_name=Client_proto_contracts.Raw_contract_alias.of_freshcctxtforcealias_nameinlet*_,src_pk,src_sk=Client_keys.get_keycctxtsourceinlet*keys=List.map_es(fun(pk_uri,_)->Client_keys.public_keypk_uri)keysinlet*!errors=Client_proto_multisig.originate_multisigcctxt~chain:cctxt#chain~block:cctxt#block?confirmations:cctxt#confirmations~dry_run?fee?gas_limit?storage_limit~verbose_signing~delegate~threshold:(Z.of_intthreshold)~keys~balance~source~src_pk~src_sk~fee_parameter()inlet*!o=Client_proto_context_commands.report_michelson_errors~no_print_source~msg:"multisig origination simulation failed"cctxterrorsinunlessdry_run@@fun()->Option.iter_es(fun(_res,contract)->Client_proto_context.save_contract~forcecctxtalias_namecontract)o);command~group~desc:"Sign a transaction for a multisig contract."(args2arg_argentrypoint_arg)(prefixes["sign";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefix"transferring"@@Client_proto_args.tez_param~name:"qty"~desc:"amount taken from source"@@prefix"to"@@Client_proto_contracts.Contract_alias.destination_param~name:"dst"~desc:"name/literal of the destination contract"@@prefixes["using";"secret";"key"]@@secret_key_param()@@stop)(fun(parameter,entrypoint)multisig_contractamountdestinationsk(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinletentrypoint=Option.value~default:Entrypoint.defaultentrypointinletparameter=Option.value~default:"Unit"parameterinlet*?{expanded=parameter;_}=Micheline_parser.no_parsing_error@@Michelson_v1_parser.parse_expressionparameterinlet*parameter_type=get_parameter_typecctxt~destination~entrypointinlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Client_proto_multisig.Transfer{amount;destination;entrypoint;parameter_type;parameter})()inlet*signature=Client_keys.signcctxtskprepared_command.bytesinFormat.printf"%a@."Signature.ppsignature;return_unit);command~group~desc:"Sign a lambda for a generic multisig contract."no_options(prefixes["sign";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["running";"lambda"]@@lambda_param()@@prefixes["using";"secret";"key"]@@secret_key_param()@@stop)(fun()multisig_contractlambdask(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*?{expanded=lambda;_}=Micheline_parser.no_parsing_error@@Michelson_v1_parser.parse_expressionlambdainlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Lambdalambda)()inlet*signature=Client_keys.signcctxtskprepared_command.bytesinFormat.printf"%a@."Signature.ppsignature;return_unit);command~group~desc:"Sign a delegate change for a multisig contract."no_options(prefixes["sign";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["setting";"delegate";"to"]@@Client_keys.Public_key_hash.source_param~name:"dlgt"~desc:"new delegate of the new multisig contract"@@prefixes["using";"secret";"key"]@@secret_key_param()@@stop)(fun()multisig_contractdelegatesk(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Client_proto_multisig.Change_delegate(Somedelegate))()inlet*signature=Client_keys.signcctxtskprepared_command.bytesinFormat.printf"%a@."Signature.ppsignature;return_unit);command~group~desc:"Sign a delegate withdraw for a multisig contract."no_options(prefixes["sign";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["withdrawing";"delegate"]@@prefixes["using";"secret";"key"]@@secret_key_param()@@stop)(fun()multisig_contractsk(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Client_proto_multisig.Change_delegateNone)()inlet*signature=Client_keys.signcctxtskprepared_command.bytesinFormat.printf"%a@."Signature.ppsignature;return_unit);command~group~desc:"Sign a change of public keys and threshold for a multisig contract."no_options(prefixes["sign";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["using";"secret";"key"]@@secret_key_param()@@prefixes["setting";"threshold";"to"]@@threshold_param()@@prefixes["and";"public";"keys";"to"]@@seq_of_param(public_key_param()))(fun()multisig_contractsknew_thresholdnew_keys(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*keys=List.map_es(fun(pk_uri,_)->Client_keys.public_keypk_uri)new_keysinlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Client_proto_multisig.Change_keys(Z.of_intnew_threshold,keys))()inlet*signature=Client_keys.signcctxtskprepared_command.bytesinFormat.printf"%a@."Signature.ppsignature;return_unit);command~group~desc:"Transfer tokens using a multisig contract."transfer_options(prefixes["from";"multisig";"contract"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name/literal of the multisig contract"@@prefix"transfer"@@Client_proto_args.tez_param~name:"qty"~desc:"amount taken from the multisig contract"@@prefix"to"@@Client_proto_contracts.Contract_alias.destination_param~name:"dst"~desc:"name/literal of the destination contract"@@prefixes["on";"behalf";"of"]@@Client_keys.Public_key_hash.source_param~name:"src"~desc:"source calling the multisig contract"@@prefixes["with";"signatures"]@@seq_of_param(signature_param()))(fun(fee,dry_run,verbose_signing,gas_limit,storage_limit,counter,parameter,no_print_source,fee_parameter,entrypoint)multisig_contractamountdestinationsourcesignatures(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinletentrypoint=Option.value~default:Entrypoint.defaultentrypointinletparameter=Option.value~default:"Unit"parameterinlet*?{expanded=parameter;_}=Micheline_parser.no_parsing_error@@Michelson_v1_parser.parse_expressionparameterinlet*parameter_type=get_parameter_typecctxt~destination~entrypointinlet*_,src_pk,src_sk=Client_keys.get_keycctxtsourceinlet*!errors=Client_proto_multisig.call_multisigcctxt~chain:cctxt#chain~block:cctxt#block?confirmations:cctxt#confirmations~dry_run~verbose_signing~fee_parameter~source?fee~src_pk~src_sk~multisig_contract~action:(Client_proto_multisig.Transfer{amount;destination;entrypoint;parameter_type;parameter})~signatures~amount:Tez.zero?gas_limit?storage_limit?counter()inlet*!(_:(_Injection.result*Contract_hash.tlist)option)=Client_proto_context_commands.report_michelson_errors~no_print_source~msg:"transfer simulation failed"cctxterrorsinreturn_unit);command~group~desc:"Run a lambda on a generic multisig contract."non_transfer_options(prefixes["from";"multisig";"contract"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name/literal of the multisig contract"@@prefixes["run";"lambda"]@@lambda_param()@@prefixes["on";"behalf";"of"]@@Client_keys.Public_key_hash.source_param~name:"src"~desc:"source calling the multisig contract"@@prefixes["with";"signatures"]@@seq_of_param(signature_param()))(fun(fee,dry_run,verbose_signing,gas_limit,storage_limit,counter,no_print_source,fee_parameter)multisig_contractlambdasourcesignatures(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*_,src_pk,src_sk=Client_keys.get_keycctxtsourceinlet*?{expanded=lambda;_}=Micheline_parser.no_parsing_error@@Michelson_v1_parser.parse_expressionlambdainlet*!errors=Client_proto_multisig.call_multisigcctxt~chain:cctxt#chain~block:cctxt#block?confirmations:cctxt#confirmations~dry_run~verbose_signing~fee_parameter~source?fee~src_pk~src_sk~multisig_contract~action:(Client_proto_multisig.Lambdalambda)~signatures~amount:Tez.zero?gas_limit?storage_limit?counter()inlet*!(_:(_Injection.result*Contract_hash.tlist)option)=Client_proto_context_commands.report_michelson_errors~no_print_source~msg:"transfer simulation failed"cctxterrorsinreturn_unit);command~group~desc:"Change the delegate of a multisig contract."non_transfer_options(prefixes["set";"delegate";"of";"multisig";"contract"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefix"to"@@Client_keys.Public_key_hash.source_param~name:"dlgt"~desc:"new delegate of the new multisig contract"@@prefixes["on";"behalf";"of"]@@Client_keys.Public_key_hash.source_param~name:"src"~desc:"source calling the multisig contract"@@prefixes["with";"signatures"]@@seq_of_param(signature_param()))(fun(fee,dry_run,verbose_signing,gas_limit,storage_limit,counter,no_print_source,fee_parameter)multisig_contractdelegatesourcesignatures(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*_,src_pk,src_sk=Client_keys.get_keycctxtsourceinlet*!errors=Client_proto_multisig.call_multisigcctxt~chain:cctxt#chain~block:cctxt#block?confirmations:cctxt#confirmations~dry_run~verbose_signing~fee_parameter~source?fee~src_pk~src_sk~multisig_contract~action:(Client_proto_multisig.Change_delegate(Somedelegate))~signatures~amount:Tez.zero?gas_limit?storage_limit?counter()inlet*!(_:(_Injection.result*Contract_hash.tlist)option)=Client_proto_context_commands.report_michelson_errors~no_print_source~msg:"transfer simulation failed"cctxterrorsinreturn_unit);command~group~desc:"Withdraw the delegate of a multisig contract."non_transfer_options(prefixes["withdraw";"delegate";"of";"multisig";"contract"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["on";"behalf";"of"]@@Client_keys.Public_key_hash.source_param~name:"src"~desc:"source calling the multisig contract"@@prefixes["with";"signatures"]@@seq_of_param(signature_param()))(fun(fee,dry_run,verbose_signing,gas_limit,storage_limit,counter,no_print_source,fee_parameter)multisig_contractsourcesignatures(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*_,src_pk,src_sk=Client_keys.get_keycctxtsourceinlet*!errors=Client_proto_multisig.call_multisigcctxt~chain:cctxt#chain~block:cctxt#block?confirmations:cctxt#confirmations~dry_run~verbose_signing~fee_parameter~source?fee~src_pk~src_sk~multisig_contract~action:(Client_proto_multisig.Change_delegateNone)~signatures~amount:Tez.zero?gas_limit?storage_limit?counter()inlet*!(_:(_Injection.result*Contract_hash.tlist)option)=Client_proto_context_commands.report_michelson_errors~no_print_source~msg:"transfer simulation failed"cctxterrorsinreturn_unit);command~group~desc:"Change public keys and threshold for a multisig contract."non_transfer_options(prefixes["set";"threshold";"of";"multisig";"contract"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["to"]@@threshold_param()@@prefixes["and";"public";"keys";"to"]@@non_terminal_seq(public_key_param())~suffix:["on";"behalf";"of"]@@Client_keys.Public_key_hash.source_param~name:"src"~desc:"source calling the multisig contract"@@prefixes["with";"signatures"]@@seq_of_param(signature_param()))(fun(fee,dry_run,verbose_signing,gas_limit,storage_limit,counter,no_print_source,fee_parameter)multisig_contractnew_thresholdnew_keyssourcesignatures(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*_,src_pk,src_sk=Client_keys.get_keycctxtsourceinlet*keys=List.map_es(fun(pk_uri,_)->Client_keys.public_keypk_uri)new_keysinlet*!errors=Client_proto_multisig.call_multisigcctxt~chain:cctxt#chain~block:cctxt#block?confirmations:cctxt#confirmations~dry_run~verbose_signing~fee_parameter~source?fee~src_pk~src_sk~multisig_contract~action:(Client_proto_multisig.Change_keys(Z.of_intnew_threshold,keys))~signatures~amount:Tez.zero?gas_limit?storage_limit?counter()inlet*!(_:(_Injection.result*Contract_hash.tlist)option)=Client_proto_context_commands.report_michelson_errors~no_print_source~msg:"transfer simulation failed"cctxterrorsinreturn_unit);(* This command is no longer necessary as Tezos_clic now supports non terminal
lists of parameters, however, it is kept for compatibility. *)command~group~desc:"Run a transaction described by a sequence of bytes on a multisig \
contract."non_transfer_options(prefixes["run";"transaction"]@@bytes_param~name:"bytes"~desc:"the sequence of bytes to deserialize as a multisig action, can \
be obtained by one of the \"prepare multisig transaction\" \
commands"@@prefixes["on";"multisig";"contract"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["on";"behalf";"of"]@@Client_keys.Public_key_hash.source_param~name:"src"~desc:"source calling the multisig contract"@@prefixes["with";"signatures"]@@seq_of_param(signature_param()))(fun(fee,dry_run,verbose_signing,gas_limit,storage_limit,counter,no_print_source,fee_parameter)bytesmultisig_contractsourcesignatures(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*_,src_pk,src_sk=Client_keys.get_keycctxtsourceinlet*!errors=Client_proto_multisig.call_multisig_on_bytescctxt~chain:cctxt#chain~block:cctxt#block?confirmations:cctxt#confirmations~dry_run~verbose_signing~fee_parameter~source?fee~src_pk~src_sk~multisig_contract~bytes~signatures~amount:Tez.zero?gas_limit?storage_limit?counter()inlet*!(_:(_Injection.result*Contract_hash.tlist)option)=Client_proto_context_commands.report_michelson_errors~no_print_source~msg:"transfer simulation failed"cctxterrorsinreturn_unit);command~group~desc:"Display the threshold, public keys, and byte sequence to sign for a \
multisigned transfer."(args3bytes_only_switcharg_argentrypoint_arg)(prefixes["prepare";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefix"transferring"@@Client_proto_args.tez_param~name:"qty"~desc:"amount taken from source"@@prefix"to"@@Client_proto_contracts.Contract_alias.destination_param~name:"dst"~desc:"name/literal of the destination contract"@@stop)(fun(bytes_only,parameter,entrypoint)multisig_contractamountdestination(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinletentrypoint=Option.value~default:Entrypoint.defaultentrypointinletparameter=Option.value~default:"Unit"parameterinlet*?{expanded=parameter;_}=Micheline_parser.no_parsing_error@@Michelson_v1_parser.parse_expressionparameterinlet*parameter_type=get_parameter_typecctxt~destination~entrypointinlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Client_proto_multisig.Transfer{amount;destination;entrypoint;parameter_type;parameter})()inreturn@@prepare_command_displayprepared_commandbytes_only);command~group~desc:"Display the threshold, public keys, and byte sequence to sign for a \
multisigned lambda execution in a generic multisig contract."(args1bytes_only_switch)(prefixes["prepare";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["running";"lambda"]@@lambda_param()@@stop)(funbytes_onlymultisig_contractlambda(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*?{expanded=lambda;_}=Micheline_parser.no_parsing_error@@Michelson_v1_parser.parse_expressionlambdainlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Client_proto_multisig.Lambdalambda)()inreturn@@prepare_command_displayprepared_commandbytes_only);command~group~desc:"Display the threshold, public keys, and byte sequence to sign for a \
multisigned delegate change."(args1bytes_only_switch)(prefixes["prepare";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["setting";"delegate";"to"]@@Client_keys.Public_key_hash.source_param~name:"dlgt"~desc:"new delegate of the new multisig contract"@@stop)(funbytes_onlymultisig_contractnew_delegate(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Client_proto_multisig.Change_delegate(Somenew_delegate))()inreturn@@prepare_command_displayprepared_commandbytes_only);command~group~desc:"Display the threshold, public keys, and byte sequence to sign for a \
multisigned delegate withdraw."(args1bytes_only_switch)(prefixes["prepare";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["withdrawing";"delegate"]@@stop)(funbytes_onlymultisig_contract(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Client_proto_multisig.Change_delegateNone)()inreturn@@prepare_command_displayprepared_commandbytes_only);command~group~desc:"Display the threshold, public keys, and byte sequence to sign for a \
multisigned change of keys and threshold."(args1bytes_only_switch)(prefixes["prepare";"multisig";"transaction";"on"]@@Client_proto_contracts.Originated_contract_alias.destination_param~name:"multisig"~desc:"name or address of the originated multisig contract"@@prefixes["setting";"threshold";"to"]@@threshold_param()@@prefixes["and";"public";"keys";"to"]@@seq_of_param(public_key_param()))(funbytes_onlymultisig_contractnew_thresholdnew_keys(cctxt:#Protocol_client_context.full)->letopenLwt_result_syntaxinlet*keys=List.map_es(fun(pk_uri,_)->Client_keys.public_keypk_uri)new_keysinlet*prepared_command=Client_proto_multisig.prepare_multisig_transactioncctxt~chain:cctxt#chain~block:cctxt#block~multisig_contract~action:(Client_proto_multisig.Change_keys(Z.of_intnew_threshold,keys))()inreturn@@prepare_command_displayprepared_commandbytes_only);]letcommands()=commands_ro()@commands_rw()