package octez-protocol-014-PtKathma-libs
Octez protocol 014-PtKathma libraries
Install
Dune Dependency
Authors
Maintainers
Sources
tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/src/octez-protocol-014-PtKathma-libs.client/client_proto_context.ml.html
Source file client_proto_context.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439
(*****************************************************************************) (* *) (* Open Source License *) (* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.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. *) (* *) (*****************************************************************************) open Protocol open Alpha_context open Protocol_client_context open Tezos_micheline open Client_proto_contracts open Client_keys_v0 let get_balance (rpc : #rpc_context) ~chain ~block contract = Alpha_services.Contract.balance rpc (chain, block) contract let get_storage (rpc : #rpc_context) ~chain ~block ~unparsing_mode contract = Plugin.RPC.Contract.get_storage_normalized rpc (chain, block) ~unparsing_mode ~contract let get_big_map_value (rpc : #rpc_context) ~chain ~block ~unparsing_mode id key = Plugin.RPC.Big_map.big_map_get_normalized rpc (chain, block) ~unparsing_mode id key let get_contract_big_map_value (rpc : #rpc_context) ~chain ~block contract key = Alpha_services.Contract.contract_big_map_get_opt rpc (chain, block) contract key let get_script (rpc : #rpc_context) ~chain ~block ~unparsing_mode ~normalize_types contract = Plugin.RPC.Contract.get_script_normalized rpc (chain, block) ~unparsing_mode ~normalize_types ~contract let get_script_hash (rpc : #rpc_context) ~chain ~block contract = Alpha_services.Contract.script_opt rpc (chain, block) contract >>=? fun script_opt -> Lwt.return @@ Environment.wrap_tzresult @@ Option.map_e (fun {Script.code; storage = _} -> Script_repr.force_decode code >>? fun code -> let bytes = Data_encoding.Binary.to_bytes_exn Script.expr_encoding code in let hash = Script_expr_hash.hash_bytes [bytes] in ok hash) script_opt let get_frozen_deposits_limit (rpc : #rpc_context) ~chain ~block delegate = Alpha_services.Delegate.frozen_deposits_limit rpc (chain, block) delegate let parse_expression arg = Lwt.return (Micheline_parser.no_parsing_error (Michelson_v1_parser.parse_expression arg)) let parse_arg_transfer arg = (match arg with | Some arg -> parse_expression arg >>=? fun {expanded = arg; _} -> return_some arg | None -> return_none) >>=? fun parameters -> return (Option.fold ~some:Script.lazy_expr ~none:Script.unit_parameter parameters) let build_transaction_operation ~amount ~parameters ?(entrypoint = Entrypoint.default) ?fee ?gas_limit ?storage_limit destination = let operation = Transaction {amount; parameters; destination; entrypoint} in Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) operation let transfer_with_script (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?(force = false) ?branch ?successor_level ~source ~src_pk ~src_sk ~destination ?(entrypoint = Entrypoint.default) ~parameters ~amount ?fee ?gas_limit ?storage_limit ?counter ~fee_parameter ?replace_by_fees () = let contents = build_transaction_operation ~amount ~parameters ~entrypoint ?fee ?gas_limit ?storage_limit destination in let contents = Annotated_manager_operation.Single_manager contents in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ~force ?branch ?successor_level ~source ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) ?counter ?replace_by_fees ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> Lwt.return (Injection.originated_contracts ~force result) >>=? fun contracts -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return ((oph, op, result), contracts) let transfer (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?(force = false) ?branch ?successor_level ~source ~src_pk ~src_sk ~destination ?entrypoint ?arg ~amount ?fee ?gas_limit ?storage_limit ?counter ~fee_parameter ?replace_by_fees () = parse_arg_transfer arg >>=? fun parameters -> transfer_with_script (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ~force ?branch ?successor_level ~source ~src_pk ~src_sk ~destination ?entrypoint ~parameters ~amount ?fee ?gas_limit ?storage_limit ?counter ~fee_parameter ?replace_by_fees () let build_reveal_operation ?fee ?gas_limit ?storage_limit pk = let operation = Reveal pk in Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) operation let reveal cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?branch ~source ~src_pk ~src_sk ?fee ~fee_parameter () = let contents = Annotated_manager_operation.Single_manager (build_reveal_operation ?fee ~storage_limit:Z.zero src_pk) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?branch ~source ~fee:(Limit.of_option fee) ~gas_limit:Limit.unknown ~storage_limit:Limit.unknown ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let build_delegate_operation ?fee ?gas_limit ?storage_limit delegate_opt = let operation = Delegation delegate_opt in Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) operation let delegate_contract cctxt ~chain ~block ?branch ?confirmations ?dry_run ?verbose_signing ?simulation ~source ~src_pk ~src_sk ?fee ~fee_parameter delegate_opt = let operation = Annotated_manager_operation.Single_manager (build_delegate_operation ?fee delegate_opt) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?branch ~source ~fee:(Limit.of_option fee) ~gas_limit:Limit.unknown ~storage_limit:Limit.unknown ~src_pk ~src_sk ~fee_parameter operation >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let list_contract_labels cctxt ~chain ~block = Alpha_services.Contract.list cctxt (chain, block) >>=? fun contracts -> List.rev_map_es (fun h -> (match (h : Contract.t) with | Implicit m -> ( Public_key_hash.rev_find cctxt m >>=? function | None -> return "" | Some nm -> ( Raw_contract_alias.find_opt cctxt nm >>=? function | None -> return (" (known as " ^ nm ^ ")") | Some _ -> return (" (known as key:" ^ nm ^ ")"))) | Originated _ -> ( Raw_contract_alias.rev_find cctxt h >>=? function | None -> return "" | Some nm -> return (" (known as " ^ nm ^ ")"))) >>=? fun nm -> let kind = match h with Implicit _ -> " (implicit)" | Originated _ -> "" in let h_b58 = Contract.to_b58check h in return (nm, h_b58, kind)) contracts >|=? List.rev let message_added_contract (cctxt : #full) name = cctxt#message "Contract memorized as %s." name let set_delegate cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee contract ~src_pk ~manager_sk ~fee_parameter opt_delegate = delegate_contract cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ~source:contract ~src_pk ~src_sk:manager_sk ?fee ~fee_parameter opt_delegate let register_as_delegate cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?fee ~manager_sk ~fee_parameter src_pk = let source = Signature.V0.Public_key.hash src_pk in delegate_contract cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ~source ~src_pk ~src_sk:manager_sk ?fee ~fee_parameter (Some source) let set_deposits_limit cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee contract ~src_pk ~manager_sk ~fee_parameter limit_opt = let operation = Set_deposits_limit limit_opt in let operation = Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:Limit.unknown ~storage_limit:Limit.unknown operation in let operation = Annotated_manager_operation.Single_manager operation in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ~source:contract ~fee:(Limit.of_option fee) ~gas_limit:Limit.unknown ~storage_limit:Limit.unknown ~src_pk ~src_sk:manager_sk ~fee_parameter operation >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let increase_paid_storage cctxt ~chain ~block ?force ?dry_run ?verbose_signing ?fee ?confirmations ?simulation ~source ~destination ~src_pk ~manager_sk ~fee_parameter ~amount_in_bytes () = let operation = Increase_paid_storage {amount_in_bytes; destination} in let operation = Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:Limit.unknown ~storage_limit:Limit.unknown operation in let operation = Annotated_manager_operation.Single_manager operation in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?force ?dry_run ?verbose_signing ?simulation ~source ~fee:(Limit.of_option fee) ~gas_limit:Limit.unknown ~storage_limit:Limit.unknown ~src_pk ~src_sk:manager_sk ~fee_parameter operation >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let save_contract ~force cctxt alias_name contract = Raw_contract_alias.add ~force cctxt alias_name contract >>=? fun () -> message_added_contract cctxt alias_name >>= fun () -> return_unit let check_for_timelock code = let open Tezos_micheline.Micheline in let rec has_timelock_opcodes = function | Prim (_, (Script.T_chest | T_chest_key | I_OPEN_CHEST), _, _) -> true | Seq (_, exprs) | Prim (_, _, exprs, _) -> List.exists has_timelock_opcodes exprs | Int _ | String _ | Bytes _ -> false in has_timelock_opcodes (root code) let build_origination_operation ?(allow_timelock = false) ?fee ?gas_limit ?storage_limit ~initial_storage ~code ~delegate ~balance () = (if (not allow_timelock) && check_for_timelock code then failwith "Origination of contracts containing time lock related instructions is \ disabled in the client because of a vulnerability." else return_unit) >>=? fun () -> (* With the change of making implicit accounts delegatable, the following 3 arguments are being defaulted before they can be safely removed. *) Lwt.return (Michelson_v1_parser.parse_expression initial_storage) >>= fun result -> Lwt.return (Micheline_parser.no_parsing_error result) >>=? fun {Michelson_v1_parser.expanded = storage; _} -> let code = Script.lazy_expr code and storage = Script.lazy_expr storage in let origination = Origination {delegate; script = {code; storage}; credit = balance} in return (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) origination) let originate_contract (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?branch ?fee ?gas_limit ?storage_limit ~delegate ~initial_storage ~balance ~source ~src_pk ~src_sk ~code ~fee_parameter () = build_origination_operation ~allow_timelock:false ?fee ?gas_limit ?storage_limit ~initial_storage ~code ~delegate ~balance () >>=? fun origination -> let origination = Annotated_manager_operation.Single_manager origination in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?branch ~source ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) ~src_pk ~src_sk ~fee_parameter origination >>=? fun (oph, _, op, result) -> (match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result)) >>=? fun res -> Lwt.return (Injection.originated_contracts ~force:false result) >>=? function | [contract] -> return (res, Contract.Originated contract) | contracts -> failwith "The origination introduced %d contracts instead of one." (List.length contracts) let michelson_expression_of_string str = Michelson_v1_parser.parse_expression str |> Micheline_parser.no_parsing_error >>? fun {Michelson_v1_parser.expanded = v; _} -> ok @@ Script.lazy_expr v let build_register_global_constant ?fee ?gas_limit ?storage_limit value = michelson_expression_of_string value >>? fun value -> let op = Register_global_constant {value} in ok (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) op) let register_global_constant (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~constant () = build_register_global_constant ?fee ?storage_limit ?gas_limit constant >>?= fun op -> let op = Annotated_manager_operation.Single_manager op in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter op >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) type activation_key = { pkh : Signature.Ed25519.Public_key_hash.t; amount : Tez.t; activation_code : Blinded_public_key_hash.activation_code; mnemonic : string list; password : string; email : string; } let raw_activation_key_encoding = let open Data_encoding in obj6 (req "pkh" Signature.Ed25519.Public_key_hash.encoding) (req "amount" Tez.encoding) (req "activation_code" Blinded_public_key_hash.activation_code_encoding) (req "mnemonic" (list string)) (req "password" string) (req "email" string) let activation_key_encoding = (* Hack: allow compatibility with older encoding *) let open Data_encoding in conv (fun {pkh; amount; activation_code; mnemonic; password; email} -> (pkh, amount, activation_code, mnemonic, password, email)) (fun (pkh, amount, activation_code, mnemonic, password, email) -> {pkh; amount; activation_code; mnemonic; password; email}) @@ splitted ~binary:raw_activation_key_encoding ~json: (union [ case ~title:"Activation" Json_only raw_activation_key_encoding (fun x -> Some x) (fun x -> x); case ~title:"Deprecated_activation" Json_only (obj6 (req "pkh" Signature.Ed25519.Public_key_hash.encoding) (req "amount" Tez.encoding) (req "secret" Blinded_public_key_hash.activation_code_encoding) (req "mnemonic" (list string)) (req "password" string) (req "email" string)) (fun _ -> None) (fun x -> x); ]) type batch_transfer_operation = { destination : string; fee : string option; gas_limit : Gas.Arith.integral option; storage_limit : Z.t option; amount : string; arg : string option; entrypoint : Entrypoint.t option; } let batch_transfer_operation_encoding = let open Data_encoding in conv (fun {destination; fee; gas_limit; storage_limit; amount; arg; entrypoint} -> (destination, fee, gas_limit, storage_limit, amount, arg, entrypoint)) (fun (destination, fee, gas_limit, storage_limit, amount, arg, entrypoint) -> {destination; fee; gas_limit; storage_limit; amount; arg; entrypoint}) (obj7 (req "destination" string) (opt "fee" string) (opt "gas-limit" Gas.Arith.n_integral_encoding) (opt "storage-limit" z) (req "amount" string) (opt "arg" string) (opt "entrypoint" Entrypoint.simple_encoding)) let read_key key = match Bip39.of_words key.mnemonic with | None -> failwith "" | Some t -> (* TODO: unicode normalization (NFKD)... *) let passphrase = Bytes.(cat (of_string key.email) (of_string key.password)) in let sk = Bip39.to_seed ~passphrase t in let sk = Bytes.sub sk 0 32 in let sk : Signature.V0.Secret_key.t = Ed25519 (Data_encoding.Binary.of_bytes_exn Signature.Ed25519.Secret_key.encoding sk) in let pk = Signature.V0.Secret_key.to_public_key sk in let pkh = Signature.V0.Public_key.hash pk in return (pkh, pk, sk) let inject_activate_operation cctxt ~chain ~block ?confirmations ?dry_run alias pkh activation_code = let contents = Single (Activate_account {id = pkh; activation_code}) in Injection.inject_operation cctxt ?confirmations ?dry_run ~chain ~block contents >>=? fun (oph, op, result) -> (match confirmations with | None -> return_unit | Some _confirmations -> Alpha_services.Contract.balance cctxt (chain, block) (Contract.Implicit (Ed25519 pkh)) >>=? fun balance -> cctxt#message "Account %s (%a) activated with %s%a." alias Signature.Ed25519.Public_key_hash.pp pkh Operation_result.tez_sym Tez.pp balance >>= fun () -> return_unit) >>=? fun () -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Activate_account _ as op), result) -> return (oph, op, result) let activate_account (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?(encrypted = false) ?force key name = read_key key >>=? fun (pkh, pk, sk) -> fail_unless (Signature.V0.Public_key_hash.equal pkh (Ed25519 key.pkh)) (error_of_fmt "@[<v 2>Inconsistent activation key:@ Computed pkh: %a@ Embedded pkh: \ %a @]" Signature.V0.Public_key_hash.pp pkh Signature.Ed25519.Public_key_hash.pp key.pkh) >>=? fun () -> let pk = Signature.Of_V0.public_key pk in let sk = Signature.Of_V0.secret_key sk in Tezos_signer_backends.Unencrypted.make_pk pk >>?= fun pk_uri -> (if encrypted then Tezos_signer_backends.Encrypted.prompt_twice_and_encrypt cctxt sk else Tezos_signer_backends.Unencrypted.make_sk sk >>?= return) >>=? fun sk_uri -> Client_keys_v0.register_key cctxt ?force (pkh, pk_uri, sk_uri) name >>=? fun () -> inject_activate_operation cctxt ~chain ~block ?confirmations ?dry_run name key.pkh key.activation_code let activate_existing_account (cctxt : #full) ~chain ~block ?confirmations ?dry_run alias activation_code = Client_keys_v0.alias_keys cctxt alias >>=? function | Some (Ed25519 pkh, _, _) -> inject_activate_operation cctxt ~chain ~block ?confirmations ?dry_run alias pkh activation_code | Some _ -> failwith "Only Ed25519 accounts can be activated" | None -> failwith "Unknown account" type period_info = { current_period_kind : Voting_period.kind; position : Int32.t; remaining : Int32.t; current_proposal : Protocol_hash.t option; } type ballots_info = { current_quorum : Int32.t; participation : Int32.t; supermajority : Int64.t; ballots : Vote.ballots; } let get_ballots_info (cctxt : #full) ~chain ~block = (* Get the next level, not the current *) let cb = (chain, block) in Alpha_services.Voting.ballots cctxt cb >>=? fun ballots -> Alpha_services.Voting.current_quorum cctxt cb >>=? fun current_quorum -> Alpha_services.Voting.total_voting_power cctxt cb >>=? fun max_participation -> let all_votes = Int64.(add (add ballots.yay ballots.nay) ballots.pass) in let participation = Z.( to_int32 (div (mul (of_int64 all_votes) (of_int 100_00)) (of_int64 max_participation))) in let supermajority = Int64.(div (mul 8L (add ballots.yay ballots.nay)) 10L) in return {current_quorum; participation; supermajority; ballots} let get_period_info ?(successor = false) (cctxt : #full) ~chain ~block = let cb = (chain, block) in (if successor then Alpha_services.Voting.successor_period else Alpha_services.Voting.current_period) cctxt cb >>=? fun voting_period -> Alpha_services.Voting.current_proposal cctxt cb >>=? fun current_proposal -> return { current_period_kind = voting_period.voting_period.kind; position = voting_period.position; remaining = voting_period.remaining; current_proposal; } let get_proposals (cctxt : #full) ~chain ~block = let cb = (chain, block) in Alpha_services.Voting.proposals cctxt cb let submit_proposals ?dry_run ?verbose_signing (cctxt : #full) ~chain ~block ?confirmations ~src_sk source proposals = Alpha_services.Voting.successor_period cctxt (chain, block) >>=? fun {voting_period = {index; _}; _} -> let contents = Single (Proposals {source; period = index; proposals}) in Injection.inject_operation cctxt ~chain ~block ?confirmations ?dry_run ~src_sk contents ?verbose_signing let submit_ballot ?dry_run ?verbose_signing (cctxt : #full) ~chain ~block ?confirmations ~src_sk source proposal ballot = (* The user must provide the proposal explicitly to make himself sure for what he is voting. *) Alpha_services.Voting.successor_period cctxt (chain, block) >>=? fun {voting_period = {index; _}; _} -> let contents = Single (Ballot {source; period = index; proposal; ballot}) in Injection.inject_operation cctxt ~chain ~block ?confirmations ?dry_run ~src_sk contents ?verbose_signing let pp_operation formatter (a : Alpha_block_services.operation) = match (a.receipt, a.protocol_data) with | Receipt (Apply_results.Operation_metadata omd), Operation_data od -> ( match Apply_results.kind_equal_list od.contents omd.contents with | Some Apply_results.Eq -> Operation_result.pp_operation_result formatter (od.contents, omd.contents) | None -> Stdlib.failwith "Unexpected result.") | Empty, _ -> Stdlib.failwith "Pruned metadata: the operation receipt was removed accordingly to the \ node's history mode." | Too_large, _ -> Stdlib.failwith "Too large metadata." | _ -> Stdlib.failwith "Unexpected result." let get_operation_from_block (cctxt : #full) ~chain predecessors operation_hash = Client_confirmations.lookup_operation_in_previous_blocks cctxt ~chain ~predecessors operation_hash >>=? function | None -> return_none | Some (block, i, j) -> cctxt#message "Operation found in block: %a (pass: %d, offset: %d)" Block_hash.pp block i j >>= fun () -> Protocol_client_context.Alpha_block_services.Operations.operation cctxt ~chain ~block:(`Hash (block, 0)) i j >>=? fun op' -> return_some op' let display_receipt_for_operation (cctxt : #full) ~chain ?(predecessors = 10) operation_hash = get_operation_from_block cctxt ~chain predecessors operation_hash >>=? function | None -> failwith "Couldn't find operation" | Some op -> cctxt#message "%a" pp_operation op >>= fun () -> return_unit let cached_contracts cctxt ~chain ~block = let cb = (chain, block) in Alpha_services.Cache.cached_contracts cctxt cb let contract_rank cctxt ~chain ~block contract = let cb = (chain, block) in Alpha_services.Cache.contract_rank cctxt cb contract let contract_cache_size cctxt ~chain ~block = let cb = (chain, block) in Alpha_services.Cache.contract_cache_size cctxt cb let contract_cache_size_limit cctxt ~chain ~block = let cb = (chain, block) in Alpha_services.Cache.contract_cache_size_limit cctxt cb let originate_tx_rollup (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter () = let contents : Kind.tx_rollup_origination Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) Tx_rollup_origination) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let submit_tx_rollup_batch (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?burn_limit ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~content ~tx_rollup () = let contents : Kind.tx_rollup_submit_batch Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Tx_rollup_submit_batch {tx_rollup; content; burn_limit})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~successor_level:true ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let submit_tx_rollup_commitment (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~level ~inbox_merkle_root ~messages ~predecessor ~tx_rollup () = let commitment : Tx_rollup_commitment.Full.t = {level; messages; predecessor; inbox_merkle_root} in let contents : Kind.tx_rollup_commit Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Tx_rollup_commit {tx_rollup; commitment})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~successor_level:true ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let submit_tx_rollup_finalize_commitment (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~tx_rollup () = let contents : Kind.tx_rollup_finalize_commitment Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Tx_rollup_finalize_commitment {tx_rollup})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let submit_tx_rollup_remove_commitment (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~tx_rollup () = let contents : Kind.tx_rollup_remove_commitment Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Tx_rollup_remove_commitment {tx_rollup})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let submit_tx_rollup_rejection (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~level ~tx_rollup ~message ~message_position ~message_path ~message_result_hash ~message_result_path ~previous_context_hash ~previous_withdraw_list_hash ~previous_message_result_path ~proof () = let previous_message_result = Tx_rollup_message_result. { context_hash = previous_context_hash; withdraw_list_hash = previous_withdraw_list_hash; } in let contents : Kind.tx_rollup_rejection Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Tx_rollup_rejection { tx_rollup; level; message; message_position; message_path; message_result_hash; message_result_path; previous_message_result_path; previous_message_result; proof; })) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let submit_tx_rollup_return_bond (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~tx_rollup () = let contents : Kind.tx_rollup_return_bond Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Tx_rollup_return_bond {tx_rollup})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let tx_rollup_dispatch_tickets (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~level ~context_hash ~message_position ~message_result_path ~tickets_info ~tx_rollup () = let contents : Kind.tx_rollup_dispatch_tickets Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Tx_rollup_dispatch_tickets { tx_rollup; level; context_hash; message_index = message_position; message_result_path; tickets_info; })) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~successor_level:true ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let transfer_ticket (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~contents ~ty ~ticketer ~amount ~destination ~entrypoint () = parse_expression contents >>=? fun {expanded; _} -> let contents = Script.lazy_expr expanded in parse_expression ty >>=? fun {expanded; _} -> let ty = Script.lazy_expr expanded in let operation : Kind.transfer_ticket Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Transfer_ticket {contents; ty; ticketer; amount; destination; entrypoint})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~successor_level:true ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter operation >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let sc_rollup_originate (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~kind ~boot_sector ~parameters_ty ~src_pk ~src_sk ~fee_parameter () = let op = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Sc_rollup_originate {kind; boot_sector; parameters_ty})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter op >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let sc_rollup_add_messages (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~rollup ~messages ~src_pk ~src_sk ~fee_parameter () = let op = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Sc_rollup_add_messages {rollup; messages})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter op >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let sc_rollup_cement (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~rollup ~commitment ~src_pk ~src_sk ~fee_parameter () = let op = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Sc_rollup_cement {rollup; commitment})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter op >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let sc_rollup_publish (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~rollup ~commitment ~src_pk ~src_sk ~fee_parameter () = let op = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Sc_rollup_publish {rollup; commitment})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter op >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let sc_rollup_execute_outbox_message (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~rollup ~cemented_commitment ~outbox_level ~message_index ~inclusion_proof ~message ~src_pk ~src_sk ~fee_parameter () = let op = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Sc_rollup_execute_outbox_message { rollup; cemented_commitment; outbox_level; message_index; inclusion_proof; message; })) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter op >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let sc_rollup_recover_bond (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~sc_rollup () = let contents : Kind.sc_rollup_recover_bond Annotated_manager_operation.annotated_list = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Sc_rollup_recover_bond {sc_rollup})) in (* TODO/Fixme: https://gitlab.com/tezos/tezos/-/issues/2609 Decide if we should enforce ~successor_level:true for simulation. See https://gitlab.com/tezos/tezos/-/merge_requests/5395#note_958326685 *) Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter contents >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result) let sc_rollup_dal_slot_subscribe (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source ~rollup ~slot_index ~src_pk ~src_sk ~fee_parameter () = match Dal.Slot_index.of_int slot_index with | None -> failwith "Dal slot index either negative or above hard limit" | Some slot_index -> ( let op = Annotated_manager_operation.Single_manager (Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) (Sc_rollup_dal_slot_subscribe {rollup; slot_index})) in Injection.inject_manager_operation cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?simulation ?counter ~source ~fee:(Limit.of_option fee) ~storage_limit:(Limit.of_option storage_limit) ~gas_limit:(Limit.of_option gas_limit) ~src_pk ~src_sk ~fee_parameter op >>=? fun (oph, _, op, result) -> match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return (oph, op, result))
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>