1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063(*****************************************************************************)(* *)(* 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.args11Client_proto_args.fee_argClient_proto_context_commands.dry_run_switchClient_proto_context_commands.verbose_signing_switchClient_proto_args.gas_limit_argClient_proto_args.safety_guard_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.args9Client_proto_args.fee_argClient_proto_context_commands.dry_run_switchClient_proto_context_commands.verbose_signing_switchClient_proto_args.gas_limit_argClient_proto_args.safety_guard_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."(args10Client_proto_args.fee_argClient_proto_context_commands.dry_run_switchClient_proto_args.gas_limit_argClient_proto_args.safety_guard_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,safety_guard,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?safety_guard?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,safety_guard,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?safety_guard?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,safety_guard,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?safety_guard?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,safety_guard,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?safety_guard?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,safety_guard,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?safety_guard?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,safety_guard,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?safety_guard?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,safety_guard,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?safety_guard?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()