sui_rpc_api/proto/generated/sui.rpc.v2beta.rs
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 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093
// This file is @generated by prost-build.
/// An argument to a programmable transaction command.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Argument {
#[prost(enumeration = "argument::ArgumentKind", optional, tag = "1")]
pub kind: ::core::option::Option<i32>,
/// Index of an input when `kind` is `INPUT`.
#[prost(uint32, optional, tag = "2")]
pub input: ::core::option::Option<u32>,
/// Used to access a nested result when `kind` is `RESULT`.
#[prost(uint32, optional, tag = "3")]
pub subresult: ::core::option::Option<u32>,
/// Index of a result when `kind` is `RESULT`.
/// TODO Fix field numbering
#[prost(uint32, optional, tag = "4")]
pub result: ::core::option::Option<u32>,
}
/// Nested message and enum types in `Argument`.
pub mod argument {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ArgumentKind {
Unknown = 0,
/// The gas coin.
Gas = 1,
/// One of the input objects or primitive values (from
/// `ProgrammableTransaction` inputs).
Input = 2,
/// The result of another command (from `ProgrammableTransaction` commands).
Result = 3,
}
impl ArgumentKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "ARGUMENT_KIND_UNKNOWN",
Self::Gas => "GAS",
Self::Input => "INPUT",
Self::Result => "RESULT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ARGUMENT_KIND_UNKNOWN" => Some(Self::Unknown),
"GAS" => Some(Self::Gas),
"INPUT" => Some(Self::Input),
"RESULT" => Some(Self::Result),
_ => None,
}
}
}
}
/// The delta, or change, in balance for an address for a particular `Coin` type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BalanceChange {
/// The account address that is affected by this balance change event.
#[prost(string, optional, tag = "1")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
/// The `Coin` type of this balance change event.
#[prost(string, optional, tag = "2")]
pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
/// The amount or change in balance.
#[prost(string, optional, tag = "3")]
pub amount: ::core::option::Option<::prost::alloc::string::String>,
}
/// `Bcs` contains an arbitrary type that is serialized using the
/// [BCS](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/index.html#bcs>)
/// format as well as a name that identifies the type of the serialized value.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bcs {
/// Name that identifies the type of the serialized value.
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
/// Bytes of a BCS serialized value.
#[prost(bytes = "bytes", optional, tag = "2")]
pub value: ::core::option::Option<::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Checkpoint {
/// The height of this checkpoint.
#[prost(uint64, optional, tag = "1")]
pub sequence_number: ::core::option::Option<u64>,
/// The digest of this Checkpoint's CheckpointSummary.
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// The `CheckpointSummary` for this checkpoint.
#[prost(message, optional, tag = "3")]
pub summary: ::core::option::Option<CheckpointSummary>,
/// An aggregated quorum signature from the validator committee that
/// certified this checkpoint.
#[prost(message, optional, tag = "4")]
pub signature: ::core::option::Option<ValidatorAggregatedSignature>,
/// The `CheckpointContents` for this checkpoint.
#[prost(message, optional, tag = "5")]
pub contents: ::core::option::Option<CheckpointContents>,
/// List of transactions included in this checkpoint.
#[prost(message, repeated, tag = "6")]
pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
}
/// The committed to contents of a checkpoint.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckpointContents {
/// This CheckpointContents serialized as BCS.
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
/// The digest of this CheckpointContents.
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Version of this CheckpointContents
#[prost(int32, optional, tag = "3")]
pub version: ::core::option::Option<i32>,
/// Set of transactions committed to in this checkpoint.
#[prost(message, repeated, tag = "4")]
pub transactions: ::prost::alloc::vec::Vec<CheckpointedTransactionInfo>,
}
/// Transaction information committed to in a checkpoint.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckpointedTransactionInfo {
/// Digest of the transaction.
#[prost(string, optional, tag = "1")]
pub transaction: ::core::option::Option<::prost::alloc::string::String>,
/// Digest of the effects.
#[prost(string, optional, tag = "2")]
pub effects: ::core::option::Option<::prost::alloc::string::String>,
/// Set of user signatures that authorized the transaction.
#[prost(message, repeated, tag = "3")]
pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
}
/// A header for a checkpoint on the Sui blockchain.
///
/// On the Sui network, checkpoints define the history of the blockchain. They are quite similar to
/// the concept of blocks used by other blockchains like Bitcoin or Ethereum. The Sui blockchain,
/// however, forms checkpoints after transaction execution has already happened to provide a
/// certified history of the chain, instead of being formed before execution.
///
/// Checkpoints commit to a variety of state, including but not limited to:
/// - The hash of the previous checkpoint.
/// - The set of transaction digests, their corresponding effects digests, as well as the set of
/// user signatures that authorized its execution.
/// - The objects produced by a transaction.
/// - The set of live objects that make up the current state of the chain.
/// - On epoch transitions, the next validator committee.
///
/// `CheckpointSummary`s themselves don't directly include all of the previous information but they
/// are the top-level type by which all the information is committed to transitively via cryptographic
/// hashes included in the summary. `CheckpointSummary`s are signed and certified by a quorum of
/// the validator committee in a given epoch to allow verification of the chain's state.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckpointSummary {
/// This CheckpointSummary serialized as BCS.
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
/// The digest of this CheckpointSummary.
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Epoch that this checkpoint belongs to.
#[prost(uint64, optional, tag = "3")]
pub epoch: ::core::option::Option<u64>,
/// The height of this checkpoint.
#[prost(uint64, optional, tag = "4")]
pub sequence_number: ::core::option::Option<u64>,
/// Total number of transactions committed since genesis, including those in this
/// checkpoint.
#[prost(uint64, optional, tag = "5")]
pub total_network_transactions: ::core::option::Option<u64>,
/// The hash of the `CheckpointContents` for this checkpoint.
#[prost(string, optional, tag = "6")]
pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
/// The hash of the previous `CheckpointSummary`.
///
/// This will be `None` only for the first, or genesis, checkpoint.
#[prost(string, optional, tag = "7")]
pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
/// The running total gas costs of all transactions included in the current epoch so far
/// until this checkpoint.
#[prost(message, optional, tag = "8")]
pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
/// Timestamp of the checkpoint - number of milliseconds from the Unix epoch
/// Checkpoint timestamps are monotonic, but not strongly monotonic - subsequent
/// checkpoints can have the same timestamp if they originate from the same underlining consensus commit.
#[prost(message, optional, tag = "9")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
/// Commitments to checkpoint-specific state.
#[prost(message, repeated, tag = "10")]
pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
/// Extra data only present in the final checkpoint of an epoch.
#[prost(message, optional, tag = "11")]
pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
/// `CheckpointSummary` is not an evolvable structure - it must be readable by any version of
/// the code. Therefore, to allow extensions to be added to `CheckpointSummary`,
/// opaque data can be added to checkpoints, which can be deserialized based on the current
/// protocol version.
#[prost(bytes = "bytes", optional, tag = "12")]
pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
}
/// Data, which when included in a `CheckpointSummary`, signals the end of an `Epoch`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndOfEpochData {
/// The set of validators that will be in the `ValidatorCommittee` for the next epoch.
#[prost(message, repeated, tag = "1")]
pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
/// The protocol version that is in effect during the next epoch.
#[prost(uint64, optional, tag = "2")]
pub next_epoch_protocol_version: ::core::option::Option<u64>,
/// Commitments to epoch specific state (live object set)
#[prost(message, repeated, tag = "3")]
pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
}
/// A commitment made by a checkpoint.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckpointCommitment {
#[prost(
enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
}
/// Nested message and enum types in `CheckpointCommitment`.
pub mod checkpoint_commitment {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CheckpointCommitmentKind {
Unknown = 0,
/// An elliptic curve multiset hash attesting to the set of objects that
/// comprise the live state of the Sui blockchain.
EcmhLiveObjectSet = 1,
}
impl CheckpointCommitmentKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
"ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
_ => None,
}
}
}
}
/// The effects of executing a transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionEffects {
/// This TransactionEffects serialized as BCS.
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
/// The digest of this TransactionEffects.
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Version of this TransactionEffects.
#[prost(int32, optional, tag = "3")]
pub version: ::core::option::Option<i32>,
/// The status of the execution.
#[prost(message, optional, tag = "4")]
pub status: ::core::option::Option<ExecutionStatus>,
/// The epoch when this transaction was executed.
#[prost(uint64, optional, tag = "5")]
pub epoch: ::core::option::Option<u64>,
/// The gas used by this transaction.
#[prost(message, optional, tag = "6")]
pub gas_used: ::core::option::Option<GasCostSummary>,
/// The transaction digest.
#[prost(string, optional, tag = "7")]
pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
/// Information about the gas object. Also present in the `changed_objects` vector.
///
/// System transaction that don't require gas will leave this as `None`.
#[prost(message, optional, tag = "8")]
pub gas_object: ::core::option::Option<ChangedObject>,
/// The digest of the events emitted during execution,
/// can be `None` if the transaction does not emit any event.
#[prost(string, optional, tag = "9")]
pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
/// The set of transaction digests this transaction depends on.
#[prost(string, repeated, tag = "10")]
pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The version number of all the written objects (excluding packages) by this transaction.
#[prost(uint64, optional, tag = "11")]
pub lamport_version: ::core::option::Option<u64>,
/// Objects whose state are changed by this transaction.
#[prost(message, repeated, tag = "12")]
pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
/// Shared objects that are not mutated in this transaction. Unlike owned objects,
/// read-only shared objects' version are not committed in the transaction,
/// and in order for a node to catch up and execute it without consensus sequencing,
/// the version needs to be committed in the effects.
#[prost(message, repeated, tag = "13")]
pub unchanged_shared_objects: ::prost::alloc::vec::Vec<UnchangedSharedObject>,
/// Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately.
/// Storing it separately allows us to avoid bloating the effects with data that are not critical.
/// It also provides more flexibility on the format and type of the data.
#[prost(string, optional, tag = "14")]
pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
}
/// Input/output state of an object that was changed during execution.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangedObject {
/// ID of the object.
#[prost(string, optional, tag = "1")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
pub input_state: ::core::option::Option<i32>,
/// Version of the object before this transaction executed.
#[prost(uint64, optional, tag = "3")]
pub input_version: ::core::option::Option<u64>,
/// Digest of the object before this transaction executed.
#[prost(string, optional, tag = "4")]
pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
/// Owner of the object before this transaction executed.
#[prost(message, optional, tag = "5")]
pub input_owner: ::core::option::Option<Owner>,
#[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
pub output_state: ::core::option::Option<i32>,
/// Version of the object after this transaction executed.
#[prost(uint64, optional, tag = "7")]
pub output_version: ::core::option::Option<u64>,
/// Digest of the object after this transaction executed.
#[prost(string, optional, tag = "8")]
pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
/// Owner of the object after this transaction executed.
#[prost(message, optional, tag = "9")]
pub output_owner: ::core::option::Option<Owner>,
/// What happened to an `ObjectId` during execution.
#[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
pub id_operation: ::core::option::Option<i32>,
/// Type information is not provided by the effects structure but is instead
/// provided by an indexing layer
#[prost(string, optional, tag = "11")]
pub object_type: ::core::option::Option<::prost::alloc::string::String>,
}
/// Nested message and enum types in `ChangedObject`.
pub mod changed_object {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum InputObjectState {
Unknown = 0,
DoesNotExist = 1,
Exists = 2,
}
impl InputObjectState {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
"INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
"INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OutputObjectState {
Unknown = 0,
DoesNotExist = 1,
ObjectWrite = 2,
PackageWrite = 3,
}
impl OutputObjectState {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
"OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
"OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
"OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum IdOperation {
Unknown = 0,
None = 1,
Created = 2,
Deleted = 3,
}
impl IdOperation {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "ID_OPERATION_UNKNOWN",
Self::None => "NONE",
Self::Created => "CREATED",
Self::Deleted => "DELETED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
"NONE" => Some(Self::None),
"CREATED" => Some(Self::Created),
"DELETED" => Some(Self::Deleted),
_ => None,
}
}
}
}
/// A shared object that wasn't changed during execution.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnchangedSharedObject {
#[prost(
enumeration = "unchanged_shared_object::UnchangedSharedObjectKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
/// ObjectId of the shared object.
#[prost(string, optional, tag = "2")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
/// Version of the shared object.
#[prost(uint64, optional, tag = "3")]
pub version: ::core::option::Option<u64>,
/// Digest of the shared object.
#[prost(string, optional, tag = "4")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Type information is not provided by the effects structure but is instead
/// provided by an indexing layer
#[prost(string, optional, tag = "5")]
pub object_type: ::core::option::Option<::prost::alloc::string::String>,
}
/// Nested message and enum types in `UnchangedSharedObject`.
pub mod unchanged_shared_object {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum UnchangedSharedObjectKind {
Unknown = 0,
/// Read-only shared object from the input.
ReadOnlyRoot = 1,
/// Deleted shared objects that appear mutably/owned in the input.
MutateDeleted = 2,
/// Deleted shared objects that appear as read-only in the input.
ReadDeleted = 3,
/// Shared objects that was congested and resulted in this transaction being
/// canceled.
Canceled = 4,
/// Read of a per-epoch config object that should remain the same during an epoch.
PerEpochConfig = 5,
}
impl UnchangedSharedObjectKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNCHANGED_SHARED_OBJECT_KIND_UNKNOWN",
Self::ReadOnlyRoot => "READ_ONLY_ROOT",
Self::MutateDeleted => "MUTATE_DELETED",
Self::ReadDeleted => "READ_DELETED",
Self::Canceled => "CANCELED",
Self::PerEpochConfig => "PER_EPOCH_CONFIG",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNCHANGED_SHARED_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
"READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
"MUTATE_DELETED" => Some(Self::MutateDeleted),
"READ_DELETED" => Some(Self::ReadDeleted),
"CANCELED" => Some(Self::Canceled),
"PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Epoch {
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
/// The committee governing this epoch.
#[prost(message, optional, tag = "2")]
pub committee: ::core::option::Option<ValidatorCommittee>,
/// Snapshot of Sui's SystemState (`0x3::sui_system::SystemState`) at the
/// beginning of the epoch, for past epochs, or the current state for the
/// current epoch.
#[prost(message, optional, boxed, tag = "3")]
pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
#[prost(uint64, optional, tag = "4")]
pub first_checkpoint: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub last_checkpoint: ::core::option::Option<u64>,
#[prost(message, optional, tag = "6")]
pub start: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub end: ::core::option::Option<::prost_types::Timestamp>,
/// Reference gas price denominated in MIST
#[prost(uint64, optional, tag = "8")]
pub reference_gas_price: ::core::option::Option<u64>,
#[prost(message, optional, tag = "9")]
pub protocol_config: ::core::option::Option<ProtocolConfig>,
}
/// Events emitted during the successful execution of a transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionEvents {
/// This TransactionEvents serialized as BCS.
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
/// The digest of this TransactionEvents.
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Set of events emitted by a transaction.
#[prost(message, repeated, tag = "3")]
pub events: ::prost::alloc::vec::Vec<Event>,
}
/// An event.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Event {
/// Package ID of the top-level function invoked by a `MoveCall` command that triggered this
/// event to be emitted.
#[prost(string, optional, tag = "1")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
/// Module name of the top-level function invoked by a `MoveCall` command that triggered this
/// event to be emitted.
#[prost(string, optional, tag = "2")]
pub module: ::core::option::Option<::prost::alloc::string::String>,
/// Address of the account that sent the transaction where this event was emitted.
#[prost(string, optional, tag = "3")]
pub sender: ::core::option::Option<::prost::alloc::string::String>,
/// The type of the event emitted.
#[prost(string, optional, tag = "4")]
pub event_type: ::core::option::Option<::prost::alloc::string::String>,
/// BCS serialized bytes of the event.
#[prost(message, optional, tag = "5")]
pub contents: ::core::option::Option<Bcs>,
/// JSON rendering of the event.
#[prost(message, optional, boxed, tag = "100")]
pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutedTransaction {
/// The digest of this Transaction.
#[prost(string, optional, tag = "1")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// The transaction itself.
#[prost(message, optional, tag = "2")]
pub transaction: ::core::option::Option<Transaction>,
/// List of user signatures that are used to authorize the
/// execution of this transaction.
#[prost(message, repeated, tag = "3")]
pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
/// The `TransactionEffects` for this transaction.
#[prost(message, optional, tag = "4")]
pub effects: ::core::option::Option<TransactionEffects>,
/// The `TransactionEvents` for this transaction.
///
/// This field might be empty, even if it was explicitly requested, if the
/// transaction didn't produce any events.
/// `sui.types.TransactionEffects.events_digest` is populated if the
/// transaction produced any events.
#[prost(message, optional, tag = "5")]
pub events: ::core::option::Option<TransactionEvents>,
/// The sequence number for the checkpoint that includes this transaction.
#[prost(uint64, optional, tag = "6")]
pub checkpoint: ::core::option::Option<u64>,
/// The Unix timestamp of the checkpoint that includes this transaction.
#[prost(message, optional, tag = "7")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "8")]
pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
/// Set of input objects used during the execution of this transaction.
#[prost(message, repeated, tag = "10")]
pub input_objects: ::prost::alloc::vec::Vec<Object>,
/// Set of output objects produced from the execution of this transaction.
#[prost(message, repeated, tag = "11")]
pub output_objects: ::prost::alloc::vec::Vec<Object>,
}
/// The status of an executed transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStatus {
/// Indicates if the transaction was successful or not.
#[prost(bool, optional, tag = "1")]
pub success: ::core::option::Option<bool>,
/// The error if `success` is false.
#[prost(message, optional, tag = "2")]
pub error: ::core::option::Option<ExecutionError>,
}
/// An error that can occur during the execution of a transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionError {
/// The command, if any, during which the error occurred.
#[prost(uint64, optional, tag = "1")]
pub command: ::core::option::Option<u64>,
/// A human readable description of the error
/// TODO update field numbering before GA
#[prost(string, optional, tag = "15")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "2")]
pub kind: ::core::option::Option<i32>,
/// Abort code from Move.
#[prost(uint64, optional, tag = "3")]
pub abort_code: ::core::option::Option<u64>,
/// Location in Move where the error occurred.
#[prost(message, optional, tag = "4")]
pub location: ::core::option::Option<MoveLocation>,
#[prost(message, optional, tag = "5")]
pub size_error: ::core::option::Option<SizeError>,
#[prost(message, optional, tag = "6")]
pub command_argument_error: ::core::option::Option<CommandArgumentError>,
#[prost(message, optional, tag = "7")]
pub type_argument_error: ::core::option::Option<TypeArgumentError>,
#[prost(message, optional, tag = "8")]
pub package_upgrade_error: ::core::option::Option<PackageUpgradeError>,
/// Index of an input or result.
#[prost(uint32, optional, tag = "9")]
pub index: ::core::option::Option<u32>,
/// Index of a subresult.
#[prost(uint32, optional, tag = "10")]
pub subresult: ::core::option::Option<u32>,
#[prost(string, optional, tag = "11")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
/// Denied address.
#[prost(string, optional, tag = "12")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
/// Coin type.
#[prost(string, optional, tag = "13")]
pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
/// Set of objects that were congested, leading to the transaction's cancellation.
#[prost(string, repeated, tag = "14")]
pub congested_objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `ExecutionError`.
pub mod execution_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExecutionErrorKind {
Unknown = 0,
/// Insufficient gas.
InsufficientGas = 1,
/// Invalid `Gas` object.
InvalidGasObject = 2,
/// Invariant violation.
InvariantViolation = 3,
/// Attempted to use feature that is not supported yet.
FeatureNotYetSupported = 4,
/// Move object is larger than the maximum allowed size.
ObjectTooBig = 5,
/// Package is larger than the maximum allowed size.
PackageTooBig = 6,
/// Circular object ownership.
CircularObjectOwnership = 7,
/// Insufficient coin balance for requested operation.
InsufficientCoinBalance = 8,
/// Coin balance overflowed an u64.
CoinBalanceOverflow = 9,
/// Publish error, non-zero address.
/// The modules in the package must have their self-addresses set to zero.
PublishErrorNonZeroAddress = 10,
/// Sui Move bytecode verification error.
SuiMoveVerificationError = 11,
/// Error from a non-abort instruction.
/// Possible causes:
/// Arithmetic error, stack overflow, max value depth, or similar.
MovePrimitiveRuntimeError = 12,
/// Move runtime abort.
MoveAbort = 13,
/// Bytecode verification error.
VmVerificationOrDeserializationError = 14,
/// MoveVm invariant violation.
VmInvariantViolation = 15,
/// Function not found.
FunctionNotFound = 16,
/// Parity mismatch for Move function.
/// The number of arguments does not match the number of parameters.
ArityMismatch = 17,
/// Type parity mismatch for Move function.
/// Mismatch between the number of actual versus expected type arguments.
TypeArityMismatch = 18,
/// Non-entry function invoked. Move Call must start with an entry function.
NonEntryFunctionInvoked = 19,
/// Invalid command argument.
CommandArgumentError = 20,
/// Type argument error.
TypeArgumentError = 21,
/// Unused result without the drop ability.
UnusedValueWithoutDrop = 22,
/// Invalid public Move function signature.
/// Unsupported return type for return value.
InvalidPublicFunctionReturnType = 23,
/// Invalid transfer object, object does not have public transfer.
InvalidTransferObject = 24,
/// Effects from the transaction are too large.
EffectsTooLarge = 25,
/// Publish or Upgrade is missing dependency.
PublishUpgradeMissingDependency = 26,
/// Publish or upgrade dependency downgrade.
///
/// Indirect (transitive) dependency of published or upgraded package has been assigned an
/// on-chain version that is less than the version required by one of the package's
/// transitive dependencies.
PublishUpgradeDependencyDowngrade = 27,
/// Invalid package upgrade.
PackageUpgradeError = 28,
/// Indicates the transaction tried to write objects too large to storage.
WrittenObjectsTooLarge = 29,
/// Certificate is on the deny list.
CertificateDenied = 30,
/// Sui Move bytecode verification timed out.
SuiMoveVerificationTimedout = 31,
/// The requested shared object operation is not allowed.
SharedObjectOperationNotAllowed = 32,
/// Requested shared object has been deleted.
InputObjectDeleted = 33,
/// Certificate is canceled due to congestion on shared objects.
ExecutionCanceledDueToSharedObjectCongestion = 34,
/// Address is denied for this coin type.
AddressDeniedForCoin = 35,
/// Coin type is globally paused for use.
CoinTypeGlobalPause = 36,
/// Certificate is canceled because randomness could not be generated this epoch.
ExecutionCanceledDueToRandomnessUnavailable = 37,
MoveVectorElemTooBig = 38,
MoveRawValueTooBig = 39,
InvalidLinkage = 40,
}
impl ExecutionErrorKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
Self::InsufficientGas => "INSUFFICIENT_GAS",
Self::InvalidGasObject => "INVALID_GAS_OBJECT",
Self::InvariantViolation => "INVARIANT_VIOLATION",
Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
Self::ObjectTooBig => "OBJECT_TOO_BIG",
Self::PackageTooBig => "PACKAGE_TOO_BIG",
Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
Self::MoveAbort => "MOVE_ABORT",
Self::VmVerificationOrDeserializationError => {
"VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
}
Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
Self::ArityMismatch => "ARITY_MISMATCH",
Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
Self::InvalidPublicFunctionReturnType => {
"INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
}
Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
Self::PublishUpgradeMissingDependency => {
"PUBLISH_UPGRADE_MISSING_DEPENDENCY"
}
Self::PublishUpgradeDependencyDowngrade => {
"PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
}
Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
Self::CertificateDenied => "CERTIFICATE_DENIED",
Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
Self::SharedObjectOperationNotAllowed => {
"SHARED_OBJECT_OPERATION_NOT_ALLOWED"
}
Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
Self::ExecutionCanceledDueToSharedObjectCongestion => {
"EXECUTION_CANCELED_DUE_TO_SHARED_OBJECT_CONGESTION"
}
Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
Self::ExecutionCanceledDueToRandomnessUnavailable => {
"EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
}
Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
Self::InvalidLinkage => "INVALID_LINKAGE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
"INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
"INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
"INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
"FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
"OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
"PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
"CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
"INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
"COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
"PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
Some(Self::PublishErrorNonZeroAddress)
}
"SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
"MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
"MOVE_ABORT" => Some(Self::MoveAbort),
"VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
Some(Self::VmVerificationOrDeserializationError)
}
"VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
"FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
"ARITY_MISMATCH" => Some(Self::ArityMismatch),
"TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
"NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
"COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
"TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
"UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
"INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
Some(Self::InvalidPublicFunctionReturnType)
}
"INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
"EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
"PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
Some(Self::PublishUpgradeMissingDependency)
}
"PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
Some(Self::PublishUpgradeDependencyDowngrade)
}
"PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
"WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
"CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
"SUI_MOVE_VERIFICATION_TIMEDOUT" => {
Some(Self::SuiMoveVerificationTimedout)
}
"SHARED_OBJECT_OPERATION_NOT_ALLOWED" => {
Some(Self::SharedObjectOperationNotAllowed)
}
"INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
"EXECUTION_CANCELED_DUE_TO_SHARED_OBJECT_CONGESTION" => {
Some(Self::ExecutionCanceledDueToSharedObjectCongestion)
}
"ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
"COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
"EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
}
"MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
"MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
"INVALID_LINKAGE" => Some(Self::InvalidLinkage),
_ => None,
}
}
}
}
/// A size error.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SizeError {
/// The offending size.
#[prost(uint64, optional, tag = "1")]
pub size: ::core::option::Option<u64>,
/// The maximum allowable size.
#[prost(uint64, optional, tag = "2")]
pub max_size: ::core::option::Option<u64>,
}
/// Location in Move bytecode where an error occurred.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveLocation {
/// The package ID.
#[prost(string, optional, tag = "1")]
pub package: ::core::option::Option<::prost::alloc::string::String>,
/// The module name.
#[prost(string, optional, tag = "2")]
pub module: ::core::option::Option<::prost::alloc::string::String>,
/// The function index.
#[prost(uint32, optional, tag = "3")]
pub function: ::core::option::Option<u32>,
/// Offset of the instruction where the error occurred.
#[prost(uint32, optional, tag = "4")]
pub instruction: ::core::option::Option<u32>,
/// The name of the function, if available.
#[prost(string, optional, tag = "5")]
pub function_name: ::core::option::Option<::prost::alloc::string::String>,
}
/// An error with an argument to a command.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CommandArgumentError {
/// Position of the problematic argument.
#[prost(uint32, optional, tag = "1")]
pub argument: ::core::option::Option<u32>,
#[prost(
enumeration = "command_argument_error::CommandArgumentErrorKind",
optional,
tag = "2"
)]
pub kind: ::core::option::Option<i32>,
/// Index of an input or result.
#[prost(uint32, optional, tag = "3")]
pub index: ::core::option::Option<u32>,
/// Index of a subresult.
#[prost(uint32, optional, tag = "4")]
pub subresult: ::core::option::Option<u32>,
}
/// Nested message and enum types in `CommandArgumentError`.
pub mod command_argument_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CommandArgumentErrorKind {
Unknown = 0,
/// The type of the value does not match the expected type.
TypeMismatch = 1,
/// The argument cannot be deserialized into a value of the specified type.
InvalidBcsBytes = 2,
/// The argument cannot be instantiated from raw bytes.
InvalidUsageOfPureArgument = 3,
/// Invalid argument to private entry function.
/// Private entry functions cannot take arguments from other Move functions.
InvalidArgumentToPrivateEntryFunction = 4,
/// Out of bounds access to input or results.
///
/// `index` field will be set indicating the invalid index value.
IndexOutOfBounds = 5,
/// Out of bounds access to subresult.
///
/// `index` and `subresult` fields will be set indicating the invalid index value.
SecondaryIndexOutOfBounds = 6,
/// Invalid usage of result.
/// Expected a single result but found either no return value or multiple.
/// `index` field will be set indicating the invalid index value.
InvalidResultArity = 7,
/// Invalid usage of gas coin.
/// The gas coin can only be used by-value with a `TransferObject` command.
InvalidGasCoinUsage = 8,
/// Invalid usage of Move value.
/// - Mutably borrowed values require unique usage.
/// - Immutably borrowed values cannot be taken or borrowed mutably.
/// - Taken values cannot be used again.
InvalidValueUsage = 9,
/// Immutable objects cannot be passed by-value.
InvalidObjectByValue = 10,
/// Immutable objects cannot be passed by mutable reference, `&mut`.
InvalidObjectByMutRef = 11,
/// Shared object operations such as wrapping, freezing, or converting to owned are not
/// allowed.
SharedObjectOperationNotAllowed = 12,
/// Invalid argument arity. Expected a single argument but found a result that expanded to
/// multiple arguments.
InvalidArgumentArity = 13,
}
impl CommandArgumentErrorKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
Self::TypeMismatch => "TYPE_MISMATCH",
Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
Self::InvalidArgumentToPrivateEntryFunction => {
"INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
}
Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
Self::InvalidResultArity => "INVALID_RESULT_ARITY",
Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
Self::SharedObjectOperationNotAllowed => {
"SHARED_OBJECT_OPERATION_NOT_ALLOWED"
}
Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
"TYPE_MISMATCH" => Some(Self::TypeMismatch),
"INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
"INVALID_USAGE_OF_PURE_ARGUMENT" => {
Some(Self::InvalidUsageOfPureArgument)
}
"INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
Some(Self::InvalidArgumentToPrivateEntryFunction)
}
"INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
"SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
"INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
"INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
"INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
"INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
"INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
"SHARED_OBJECT_OPERATION_NOT_ALLOWED" => {
Some(Self::SharedObjectOperationNotAllowed)
}
"INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
_ => None,
}
}
}
}
/// An error with upgrading a package.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PackageUpgradeError {
#[prost(
enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
/// The Package Id.
#[prost(string, optional, tag = "2")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
/// A digest.
#[prost(string, optional, tag = "3")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// The policy.
#[prost(uint32, optional, tag = "4")]
pub policy: ::core::option::Option<u32>,
/// The ticket Id.
#[prost(string, optional, tag = "5")]
pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
}
/// Nested message and enum types in `PackageUpgradeError`.
pub mod package_upgrade_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum PackageUpgradeErrorKind {
Unknown = 0,
/// Unable to fetch package.
UnableToFetchPackage = 1,
/// Object is not a package.
NotAPackage = 2,
/// Package upgrade is incompatible with previous version.
IncompatibleUpgrade = 3,
/// Digest in upgrade ticket and computed digest differ.
DigetsDoesNotMatch = 4,
/// Upgrade policy is not valid.
UnknownUpgradePolicy = 5,
/// Package ID does not match `PackageId` in upgrade ticket.
PackageIdDoesNotMatch = 6,
}
impl PackageUpgradeErrorKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
Self::NotAPackage => "NOT_A_PACKAGE",
Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
Self::DigetsDoesNotMatch => "DIGETS_DOES_NOT_MATCH",
Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
"UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
"NOT_A_PACKAGE" => Some(Self::NotAPackage),
"INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
"DIGETS_DOES_NOT_MATCH" => Some(Self::DigetsDoesNotMatch),
"UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
"PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
_ => None,
}
}
}
}
/// Type argument error.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TypeArgumentError {
/// Index of the problematic type argument.
#[prost(uint32, optional, tag = "1")]
pub type_argument: ::core::option::Option<u32>,
#[prost(
enumeration = "type_argument_error::TypeArgumentErrorKind",
optional,
tag = "2"
)]
pub kind: ::core::option::Option<i32>,
}
/// Nested message and enum types in `TypeArgumentError`.
pub mod type_argument_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TypeArgumentErrorKind {
Unknown = 0,
/// A type was not found in the module specified.
TypeNotFound = 1,
/// A type provided did not match the specified constraint.
ConstraintNotSatisfied = 2,
}
impl TypeArgumentErrorKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
Self::TypeNotFound => "TYPE_NOT_FOUND",
Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
"TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
"CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
_ => None,
}
}
}
}
/// Summary of gas charges.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GasCostSummary {
/// Cost of computation/execution.
#[prost(uint64, optional, tag = "1")]
pub computation_cost: ::core::option::Option<u64>,
/// Storage cost, it's the sum of all storage cost for all objects created or mutated.
#[prost(uint64, optional, tag = "2")]
pub storage_cost: ::core::option::Option<u64>,
/// The amount of storage cost refunded to the user for all objects deleted or mutated in the
/// transaction.
#[prost(uint64, optional, tag = "3")]
pub storage_rebate: ::core::option::Option<u64>,
/// The fee for the rebate. The portion of the storage rebate kept by the system.
#[prost(uint64, optional, tag = "4")]
pub non_refundable_storage_fee: ::core::option::Option<u64>,
}
/// An input to a user transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Input {
#[prost(enumeration = "input::InputKind", optional, tag = "1")]
pub kind: ::core::option::Option<i32>,
/// A move value serialized as BCS.
///
/// For normal operations this is required to be a move primitive type and not contain structs
/// or objects.
#[prost(bytes = "bytes", optional, tag = "2")]
pub pure: ::core::option::Option<::prost::bytes::Bytes>,
/// `ObjectId` of the object input.
#[prost(string, optional, tag = "3")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
/// Requested version of the input object when `kind` is `IMMUTABLE_OR_OWNED`
/// or `RECEIVING` or if `kind` is `SHARED` this is the initial version of the
/// object when it was shared
#[prost(uint64, optional, tag = "4")]
pub version: ::core::option::Option<u64>,
/// The digest of this object.
#[prost(string, optional, tag = "5")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Controls whether the caller asks for a mutable reference to the shared
/// object.
#[prost(bool, optional, tag = "6")]
pub mutable: ::core::option::Option<bool>,
/// A literal value
///
/// INPUT ONLY
#[prost(message, optional, boxed, tag = "1000")]
pub literal: ::core::option::Option<
::prost::alloc::boxed::Box<::prost_types::Value>,
>,
}
/// Nested message and enum types in `Input`.
pub mod input {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum InputKind {
Unknown = 0,
/// A move value serialized as BCS.
Pure = 1,
/// A Move object that is either immutable or address owned.
ImmutableOrOwned = 2,
/// A Move object whose owner is "Shared".
Shared = 3,
/// A Move object that is attempted to be received in this transaction.
Receiving = 4,
}
impl InputKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "INPUT_KIND_UNKNOWN",
Self::Pure => "PURE",
Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
Self::Shared => "SHARED",
Self::Receiving => "RECEIVING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
"PURE" => Some(Self::Pure),
"IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
"SHARED" => Some(Self::Shared),
"RECEIVING" => Some(Self::Receiving),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetServiceInfoRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetServiceInfoResponse {
/// The chain identifier of the chain that this node is on.
///
/// The chain identifier is the digest of the genesis checkpoint, the
/// checkpoint with sequence number 0.
#[prost(string, optional, tag = "1")]
pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
/// Human-readable name of the chain that this node is on.
///
/// This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
#[prost(string, optional, tag = "2")]
pub chain: ::core::option::Option<::prost::alloc::string::String>,
/// Current epoch of the node based on its highest executed checkpoint.
#[prost(uint64, optional, tag = "3")]
pub epoch: ::core::option::Option<u64>,
/// Checkpoint height of the most recently executed checkpoint.
#[prost(uint64, optional, tag = "4")]
pub checkpoint_height: ::core::option::Option<u64>,
/// Unix timestamp of the most recently executed checkpoint.
#[prost(message, optional, tag = "5")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
/// The lowest checkpoint for which checkpoints and transaction data are available.
#[prost(uint64, optional, tag = "6")]
pub lowest_available_checkpoint: ::core::option::Option<u64>,
/// The lowest checkpoint for which object data is available.
#[prost(uint64, optional, tag = "7")]
pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
/// Software version of the service. Similar to the `server` http header.
#[prost(string, optional, tag = "8")]
pub server_version: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetObjectRequest {
/// Required. The `ObjectId` of the requested object.
#[prost(string, optional, tag = "1")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
/// Request a specific version of the object.
/// If no version is specified, and the object is live, then the latest
/// version of the object is returned.
#[prost(uint64, optional, tag = "2")]
pub version: ::core::option::Option<u64>,
/// Mask specifying which fields to read.
/// If no mask is specified, defaults to `object_id,version,digest`.
#[prost(message, optional, tag = "3")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetObjectsRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
/// Mask specifying which fields to read.
/// If no mask is specified, defaults to `object_id,version,digest`.
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetObjectsResponse {
#[prost(message, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<Object>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTransactionRequest {
/// Required. The digest of the requested transaction.
#[prost(string, optional, tag = "1")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Mask specifying which fields to read.
/// If no mask is specified, defaults to `digest`.
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetTransactionsRequest {
/// Required. The digests of the requested transactions.
#[prost(string, repeated, tag = "1")]
pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Mask specifying which fields to read.
/// If no mask is specified, defaults to `object_id,version,digest`.
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetTransactionsResponse {
#[prost(message, repeated, tag = "1")]
pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCheckpointRequest {
/// Mask specifying which fields to read.
/// If no mask is specified, defaults to `object_id,version,digest`.
#[prost(message, optional, tag = "3")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
/// If neither is provided, return the latest
#[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
}
/// Nested message and enum types in `GetCheckpointRequest`.
pub mod get_checkpoint_request {
/// If neither is provided, return the latest
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum CheckpointId {
/// The sequence number of the requested checkpoint.
#[prost(uint64, tag = "1")]
SequenceNumber(u64),
/// The digest of the requested checkpoint.
#[prost(string, tag = "2")]
Digest(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEpochRequest {
/// The requested epoch.
/// If no epoch is provided the current epoch will be returned.
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
/// Mask specifying which fields to read.
/// If no mask is specified, defaults to `epoch`.
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Generated client implementations.
pub mod ledger_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct LedgerServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LedgerServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> LedgerServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> LedgerServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Query the service for general information about its current state.
pub async fn get_service_info(
&mut self,
request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetServiceInfoResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta.LedgerService/GetServiceInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta.LedgerService", "GetServiceInfo"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_object(
&mut self,
request: impl tonic::IntoRequest<super::GetObjectRequest>,
) -> std::result::Result<tonic::Response<super::Object>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta.LedgerService/GetObject",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("sui.rpc.v2beta.LedgerService", "GetObject"));
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_objects(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetObjectsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta.LedgerService/BatchGetObjects",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta.LedgerService", "BatchGetObjects"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_transaction(
&mut self,
request: impl tonic::IntoRequest<super::GetTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::ExecutedTransaction>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta.LedgerService/GetTransaction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta.LedgerService", "GetTransaction"),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_transactions(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetTransactionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta.LedgerService/BatchGetTransactions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta.LedgerService",
"BatchGetTransactions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_checkpoint(
&mut self,
request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
) -> std::result::Result<tonic::Response<super::Checkpoint>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta.LedgerService/GetCheckpoint",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("sui.rpc.v2beta.LedgerService", "GetCheckpoint"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_epoch(
&mut self,
request: impl tonic::IntoRequest<super::GetEpochRequest>,
) -> std::result::Result<tonic::Response<super::Epoch>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta.LedgerService/GetEpoch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("sui.rpc.v2beta.LedgerService", "GetEpoch"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod ledger_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with LedgerServiceServer.
#[async_trait]
pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
/// Query the service for general information about its current state.
async fn get_service_info(
&self,
request: tonic::Request<super::GetServiceInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetServiceInfoResponse>,
tonic::Status,
>;
async fn get_object(
&self,
request: tonic::Request<super::GetObjectRequest>,
) -> std::result::Result<tonic::Response<super::Object>, tonic::Status>;
async fn batch_get_objects(
&self,
request: tonic::Request<super::BatchGetObjectsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetObjectsResponse>,
tonic::Status,
>;
async fn get_transaction(
&self,
request: tonic::Request<super::GetTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::ExecutedTransaction>,
tonic::Status,
>;
async fn batch_get_transactions(
&self,
request: tonic::Request<super::BatchGetTransactionsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetTransactionsResponse>,
tonic::Status,
>;
async fn get_checkpoint(
&self,
request: tonic::Request<super::GetCheckpointRequest>,
) -> std::result::Result<tonic::Response<super::Checkpoint>, tonic::Status>;
async fn get_epoch(
&self,
request: tonic::Request<super::GetEpochRequest>,
) -> std::result::Result<tonic::Response<super::Epoch>, tonic::Status>;
}
#[derive(Debug)]
pub struct LedgerServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> LedgerServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
where
T: LedgerService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/sui.rpc.v2beta.LedgerService/GetServiceInfo" => {
#[allow(non_camel_case_types)]
struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetServiceInfoRequest>
for GetServiceInfoSvc<T> {
type Response = super::GetServiceInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetServiceInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_service_info(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetServiceInfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta.LedgerService/GetObject" => {
#[allow(non_camel_case_types)]
struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetObjectRequest>
for GetObjectSvc<T> {
type Response = super::Object;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetObjectRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_object(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetObjectSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta.LedgerService/BatchGetObjects" => {
#[allow(non_camel_case_types)]
struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::BatchGetObjectsRequest>
for BatchGetObjectsSvc<T> {
type Response = super::BatchGetObjectsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BatchGetObjectsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::batch_get_objects(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = BatchGetObjectsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta.LedgerService/GetTransaction" => {
#[allow(non_camel_case_types)]
struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetTransactionRequest>
for GetTransactionSvc<T> {
type Response = super::ExecutedTransaction;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetTransactionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_transaction(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetTransactionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta.LedgerService/BatchGetTransactions" => {
#[allow(non_camel_case_types)]
struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::BatchGetTransactionsRequest>
for BatchGetTransactionsSvc<T> {
type Response = super::BatchGetTransactionsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BatchGetTransactionsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::batch_get_transactions(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = BatchGetTransactionsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta.LedgerService/GetCheckpoint" => {
#[allow(non_camel_case_types)]
struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetCheckpointRequest>
for GetCheckpointSvc<T> {
type Response = super::Checkpoint;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetCheckpointRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_checkpoint(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetCheckpointSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/sui.rpc.v2beta.LedgerService/GetEpoch" => {
#[allow(non_camel_case_types)]
struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
impl<
T: LedgerService,
> tonic::server::UnaryService<super::GetEpochRequest>
for GetEpochSvc<T> {
type Response = super::Epoch;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetEpochRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as LedgerService>::get_epoch(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetEpochSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for LedgerServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "sui.rpc.v2beta.LedgerService";
impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
/// An object on the Sui blockchain.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Object {
/// This Object serialized as BCS.
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
/// `ObjectId` for this object.
#[prost(string, optional, tag = "2")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
/// Version of the object.
#[prost(uint64, optional, tag = "3")]
pub version: ::core::option::Option<u64>,
/// The digest of this Object.
#[prost(string, optional, tag = "4")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Owner of the object.
#[prost(message, optional, tag = "5")]
pub owner: ::core::option::Option<Owner>,
/// The type of this object.
///
/// This will be 'package' for packages and a StructTag for move structs.
#[prost(string, optional, tag = "6")]
pub object_type: ::core::option::Option<::prost::alloc::string::String>,
/// DEPRECATED this field is no longer used to determine whether a tx can transfer this
/// object. Instead, it is always calculated from the objects type when loaded in execution.
///
/// Only set for Move structs
#[prost(bool, optional, tag = "7")]
pub has_public_transfer: ::core::option::Option<bool>,
/// BCS bytes of a Move struct value.
///
/// Only set for Move structs
#[prost(message, optional, tag = "8")]
pub contents: ::core::option::Option<Bcs>,
/// Set of modules defined by this package.
///
/// Only set for Packages
#[prost(message, repeated, tag = "9")]
pub modules: ::prost::alloc::vec::Vec<MoveModule>,
/// Maps struct/module to a package version where it was first defined, stored as a vector for
/// simple serialization and deserialization.
///
/// Only set for Packages
#[prost(message, repeated, tag = "10")]
pub type_origin_table: ::prost::alloc::vec::Vec<TypeOrigin>,
/// For each dependency, maps original package ID to the info about the (upgraded) dependency
/// version that this package is using.
///
/// Only set for Packages
#[prost(message, repeated, tag = "11")]
pub linkage_table: ::prost::alloc::vec::Vec<UpgradeInfo>,
/// The digest of the transaction that created or last mutated this object
#[prost(string, optional, tag = "12")]
pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
/// The amount of SUI to rebate if this object gets deleted.
/// This number is re-calculated each time the object is mutated based on
/// the present storage gas price.
#[prost(uint64, optional, tag = "13")]
pub storage_rebate: ::core::option::Option<u64>,
/// JSON rendering of the object.
#[prost(message, optional, boxed, tag = "100")]
pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
}
/// Module defined by a package.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveModule {
/// Name of the module.
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
/// Serialized bytecode of the module.
#[prost(bytes = "bytes", optional, tag = "2")]
pub contents: ::core::option::Option<::prost::bytes::Bytes>,
}
/// Identifies a struct and the module it was defined in.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TypeOrigin {
#[prost(string, optional, tag = "1")]
pub module_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub struct_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub package_id: ::core::option::Option<::prost::alloc::string::String>,
}
/// / Upgraded package info for the linkage table.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpgradeInfo {
/// ID of the original package.
#[prost(string, optional, tag = "1")]
pub original_id: ::core::option::Option<::prost::alloc::string::String>,
/// ID of the upgraded package.
#[prost(string, optional, tag = "2")]
pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
/// Version of the upgraded package.
#[prost(uint64, optional, tag = "3")]
pub upgraded_version: ::core::option::Option<u64>,
}
/// Reference to an object.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectReference {
/// The object ID of this object.
#[prost(string, optional, tag = "1")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
/// The version of this object.
#[prost(uint64, optional, tag = "2")]
pub version: ::core::option::Option<u64>,
/// The digest of this object.
#[prost(string, optional, tag = "3")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
}
/// Enum of different types of ownership for an object.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Owner {
#[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
pub kind: ::core::option::Option<i32>,
/// Address or ObjectId of the owner
#[prost(string, optional, tag = "2")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
/// The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
#[prost(uint64, optional, tag = "3")]
pub version: ::core::option::Option<u64>,
}
/// Nested message and enum types in `Owner`.
pub mod owner {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OwnerKind {
Unknown = 0,
Address = 1,
Object = 2,
Shared = 3,
Immutable = 4,
ConsensusAddress = 5,
}
impl OwnerKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "OWNER_KIND_UNKNOWN",
Self::Address => "ADDRESS",
Self::Object => "OBJECT",
Self::Shared => "SHARED",
Self::Immutable => "IMMUTABLE",
Self::ConsensusAddress => "CONSENSUS_ADDRESS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
"ADDRESS" => Some(Self::Address),
"OBJECT" => Some(Self::Object),
"SHARED" => Some(Self::Shared),
"IMMUTABLE" => Some(Self::Immutable),
"CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtocolConfig {
#[prost(uint64, optional, tag = "1")]
pub protocol_version: ::core::option::Option<u64>,
#[prost(map = "string, bool", tag = "2")]
pub feature_flags: ::std::collections::HashMap<::prost::alloc::string::String, bool>,
#[prost(map = "string, string", tag = "3")]
pub attributes: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
/// A signature from a user.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserSignature {
/// This signature serialized as as BCS.
///
/// When provided as input this will support both the form that is length
/// prefixed as well as not length prefixed.
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
/// The signature scheme of this signature.
#[prost(enumeration = "SignatureScheme", optional, tag = "2")]
pub scheme: ::core::option::Option<i32>,
/// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1.
#[prost(bytes = "bytes", optional, tag = "3")]
pub signature: ::core::option::Option<::prost::bytes::Bytes>,
/// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1.
#[prost(bytes = "bytes", optional, tag = "4")]
pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
/// The multisig aggregated signature if scheme is `MULTISIG`.
#[prost(message, optional, tag = "5")]
pub multisig: ::core::option::Option<MultisigAggregatedSignature>,
/// The zklogin authenticator if scheme is `ZKLOGIN`.
#[prost(message, optional, boxed, tag = "6")]
pub zklogin: ::core::option::Option<
::prost::alloc::boxed::Box<ZkLoginAuthenticator>,
>,
/// The passkey authenticator if scheme is `PASSKEY`.
#[prost(message, optional, boxed, tag = "7")]
pub passkey: ::core::option::Option<
::prost::alloc::boxed::Box<PasskeyAuthenticator>,
>,
}
/// Public key equivalent for zklogin authenticators.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginPublicIdentifier {
#[prost(string, optional, tag = "1")]
pub iss: ::core::option::Option<::prost::alloc::string::String>,
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "2")]
pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
}
/// Set of valid public keys for multisig committee members.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigMemberPublicKey {
/// The signature scheme of this public key.
#[prost(enumeration = "SignatureScheme", optional, tag = "1")]
pub scheme: ::core::option::Option<i32>,
/// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey.
#[prost(bytes = "bytes", optional, tag = "2")]
pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
/// A zklogin public identifier if scheme is zklogin.
#[prost(message, optional, tag = "3")]
pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
}
/// A member in a multisig committee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigMember {
/// The public key of the committee member.
#[prost(message, optional, tag = "1")]
pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
/// The weight of this member's signature.
#[prost(uint32, optional, tag = "2")]
pub weight: ::core::option::Option<u32>,
}
/// A multisig committee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigCommittee {
/// A list of committee members and their corresponding weight.
#[prost(message, repeated, tag = "1")]
pub members: ::prost::alloc::vec::Vec<MultisigMember>,
/// The threshold of signatures needed to validate a signature from
/// this committee.
#[prost(uint32, optional, tag = "2")]
pub threshold: ::core::option::Option<u32>,
}
/// Aggregated signature from members of a multisig committee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigAggregatedSignature {
/// The plain signatures encoded with signature scheme.
///
/// The signatures must be in the same order as they are listed in the committee.
#[prost(message, repeated, tag = "1")]
pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
/// Bitmap indicating which committee members contributed to the
/// signature.
#[prost(uint32, optional, tag = "2")]
pub bitmap: ::core::option::Option<u32>,
/// If present, means this signature's on-chain format uses the old
/// legacy multisig format.
#[prost(uint32, repeated, tag = "3")]
pub legacy_bitmap: ::prost::alloc::vec::Vec<u32>,
/// The committee to use to validate this signature.
#[prost(message, optional, tag = "4")]
pub committee: ::core::option::Option<MultisigCommittee>,
}
/// A signature from a member of a multisig committee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultisigMemberSignature {
/// The signature scheme of this signature.
#[prost(enumeration = "SignatureScheme", optional, tag = "1")]
pub scheme: ::core::option::Option<i32>,
/// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1.
#[prost(bytes = "bytes", optional, tag = "2")]
pub signature: ::core::option::Option<::prost::bytes::Bytes>,
/// The zklogin authenticator if scheme is `ZKLOGIN`.
#[prost(message, optional, tag = "3")]
pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
/// The passkey authenticator if scheme is `PASSKEY`.
#[prost(message, optional, tag = "4")]
pub passkey: ::core::option::Option<PasskeyAuthenticator>,
}
/// A zklogin authenticator.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginAuthenticator {
/// Zklogin proof and inputs required to perform proof verification.
#[prost(message, optional, tag = "1")]
pub inputs: ::core::option::Option<ZkLoginInputs>,
/// Maximum epoch for which the proof is valid.
#[prost(uint64, optional, tag = "2")]
pub max_epoch: ::core::option::Option<u64>,
/// User signature with the public key attested to by the provided proof.
/// TODO maybe we make a SimpleSignature message type for better type-safety clarity?
#[prost(message, optional, boxed, tag = "3")]
pub signature: ::core::option::Option<::prost::alloc::boxed::Box<UserSignature>>,
}
/// A zklogin groth16 proof and the required inputs to perform proof verification.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginInputs {
#[prost(message, optional, tag = "1")]
pub proof_points: ::core::option::Option<ZkLoginProof>,
#[prost(message, optional, tag = "2")]
pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
#[prost(string, optional, tag = "3")]
pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "4")]
pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
}
/// A zklogin groth16 proof.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginProof {
#[prost(message, optional, tag = "1")]
pub a: ::core::option::Option<CircomG1>,
#[prost(message, optional, tag = "2")]
pub b: ::core::option::Option<CircomG2>,
#[prost(message, optional, tag = "3")]
pub c: ::core::option::Option<CircomG1>,
}
/// A claim of the iss in a zklogin proof.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkLoginClaim {
#[prost(string, optional, tag = "1")]
pub value: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
pub index_mod_4: ::core::option::Option<u32>,
}
/// A G1 point.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CircomG1 {
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "1")]
pub e0: ::core::option::Option<::prost::alloc::string::String>,
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "2")]
pub e1: ::core::option::Option<::prost::alloc::string::String>,
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "3")]
pub e2: ::core::option::Option<::prost::alloc::string::String>,
}
/// A G2 point.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CircomG2 {
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "1")]
pub e00: ::core::option::Option<::prost::alloc::string::String>,
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "2")]
pub e01: ::core::option::Option<::prost::alloc::string::String>,
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "3")]
pub e10: ::core::option::Option<::prost::alloc::string::String>,
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "4")]
pub e11: ::core::option::Option<::prost::alloc::string::String>,
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "5")]
pub e20: ::core::option::Option<::prost::alloc::string::String>,
/// base10 encoded Bn254FieldElement
#[prost(string, optional, tag = "6")]
pub e21: ::core::option::Option<::prost::alloc::string::String>,
}
/// A passkey authenticator.
///
/// See
/// [struct.PasskeyAuthenticator](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs>)
/// for more information on the requirements on the shape of the
/// `client_data_json` field.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PasskeyAuthenticator {
/// Opaque authenticator data for this passkey signature.
///
/// See [Authenticator Data](<https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data>) for
/// more information on this field.
#[prost(bytes = "bytes", optional, tag = "1")]
pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
/// Structured, unparsed, JSON for this passkey signature.
///
/// See [CollectedClientData](<https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>)
/// for more information on this field.
#[prost(string, optional, tag = "2")]
pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
/// A secp256r1 signature.
/// TODO maybe we make a SimpleSignature message type for better type-safety clarity?
#[prost(message, optional, boxed, tag = "3")]
pub signature: ::core::option::Option<::prost::alloc::boxed::Box<UserSignature>>,
}
/// The validator set for a particular epoch.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorCommittee {
/// The epoch where this committee governs.
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
/// The committee members.
#[prost(message, repeated, tag = "2")]
pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
}
/// A member of a validator committee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorCommitteeMember {
/// The 96-byte Bls12381 public key for this validator.
#[prost(bytes = "bytes", optional, tag = "1")]
pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
/// Stake weight this validator possesses.
#[prost(uint64, optional, tag = "2")]
pub stake: ::core::option::Option<u64>,
}
/// / An aggregated signature from multiple validators.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorAggregatedSignature {
/// The epoch when this signature was produced.
///
/// This can be used to lookup the `ValidatorCommittee` from this epoch
/// to verify this signature.
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
/// The 48-byte Bls12381 aggregated signature.
#[prost(bytes = "bytes", optional, tag = "2")]
pub signature: ::core::option::Option<::prost::bytes::Bytes>,
/// Bitmap indicating which members of the committee contributed to
/// this signature.
#[prost(uint32, repeated, tag = "3")]
pub bitmap: ::prost::alloc::vec::Vec<u32>,
}
/// Flag use to disambiguate the signature schemes supported by Sui.
///
/// Note: the enum values defined by this proto message exactly match their
/// expected BCS serialized values when serialized as a u8. See
/// [enum.SignatureScheme](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html>)
/// for more information about signature schemes.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SignatureScheme {
Ed25519 = 0,
Secp256k1 = 1,
Secp256r1 = 2,
Multisig = 3,
Bls12381 = 4,
Zklogin = 5,
Passkey = 6,
}
impl SignatureScheme {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Ed25519 => "ED25519",
Self::Secp256k1 => "SECP256K1",
Self::Secp256r1 => "SECP256R1",
Self::Multisig => "MULTISIG",
Self::Bls12381 => "BLS12381",
Self::Zklogin => "ZKLOGIN",
Self::Passkey => "PASSKEY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ED25519" => Some(Self::Ed25519),
"SECP256K1" => Some(Self::Secp256k1),
"SECP256R1" => Some(Self::Secp256r1),
"MULTISIG" => Some(Self::Multisig),
"BLS12381" => Some(Self::Bls12381),
"ZKLOGIN" => Some(Self::Zklogin),
"PASSKEY" => Some(Self::Passkey),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SystemState {
/// The version of the system state data structure type.
#[prost(uint64, optional, tag = "1")]
pub version: ::core::option::Option<u64>,
/// The epoch id
#[prost(uint64, optional, tag = "2")]
pub epoch: ::core::option::Option<u64>,
/// The protocol version
#[prost(uint64, optional, tag = "3")]
pub protocol_version: ::core::option::Option<u64>,
/// Information about the validators
#[prost(message, optional, tag = "4")]
pub validators: ::core::option::Option<ValidatorSet>,
/// Storage Fund info
#[prost(message, optional, tag = "5")]
pub storage_fund: ::core::option::Option<StorageFund>,
/// Set of system config parameters
#[prost(message, optional, tag = "6")]
pub parameters: ::core::option::Option<SystemParameters>,
/// The reference gas price for this epoch
#[prost(uint64, optional, tag = "7")]
pub reference_gas_price: ::core::option::Option<u64>,
/// A list of the records of validator reporting each other.
///
/// There is an entry in this list for each validator that has been reported
/// at least once. Each record contains all the validators that reported
/// them. If a validator has never been reported they don't have a record in this list.
/// This lists persists across epoch: a peer continues being in a reported state until the
/// reporter doesn't explicitly remove their report.
#[prost(message, repeated, tag = "8")]
pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
/// Schedule of stake subsidies given out each epoch.
#[prost(message, optional, tag = "9")]
pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
/// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
/// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
/// It can be reset once we are able to successfully execute advance_epoch.
/// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
/// when advance_epoch_safe_mode is executed. They will eventually be processed once we
/// are out of safe mode.
#[prost(bool, optional, tag = "10")]
pub safe_mode: ::core::option::Option<bool>,
/// Storage rewards accumulated during safe_mode
#[prost(uint64, optional, tag = "11")]
pub safe_mode_storage_rewards: ::core::option::Option<u64>,
/// Computation rewards accumulated during safe_mode
#[prost(uint64, optional, tag = "12")]
pub safe_mode_computation_rewards: ::core::option::Option<u64>,
/// Storage rebates paid out during safe_mode
#[prost(uint64, optional, tag = "13")]
pub safe_mode_storage_rebates: ::core::option::Option<u64>,
/// Nonrefundable storage fees accumulated during safe_mode
#[prost(uint64, optional, tag = "14")]
pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
/// Unix timestamp of when this this epoch started
#[prost(uint64, optional, tag = "15")]
pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
/// Any extra fields that's not defined statically.
#[prost(message, optional, tag = "16")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorReportRecord {
/// The address of the validator being reported
#[prost(string, optional, tag = "1")]
pub reported: ::core::option::Option<::prost::alloc::string::String>,
/// The list of validator (addresses) that are reporting on the validator specified by `reported`
#[prost(string, repeated, tag = "2")]
pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SystemParameters {
/// The duration of an epoch, in milliseconds.
#[prost(uint64, optional, tag = "1")]
pub epoch_duration_ms: ::core::option::Option<u64>,
/// The starting epoch in which stake subsidies start being paid out
#[prost(uint64, optional, tag = "2")]
pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
/// Minimum number of active validators at any moment.
#[prost(uint64, optional, tag = "3")]
pub min_validator_count: ::core::option::Option<u64>,
/// Maximum number of active validators at any moment.
/// We do not allow the number of validators in any epoch to go above this.
#[prost(uint64, optional, tag = "4")]
pub max_validator_count: ::core::option::Option<u64>,
/// Deprecated.
/// Lower-bound on the amount of stake required to become a validator.
#[prost(uint64, optional, tag = "5")]
pub min_validator_joining_stake: ::core::option::Option<u64>,
/// Deprecated.
/// Validators with stake amount below `validator_low_stake_threshold` are considered to
/// have low stake and will be escorted out of the validator set after being below this
/// threshold for more than `validator_low_stake_grace_period` number of epochs.
#[prost(uint64, optional, tag = "6")]
pub validator_low_stake_threshold: ::core::option::Option<u64>,
/// Deprecated.
/// Validators with stake below `validator_very_low_stake_threshold` will be removed
/// immediately at epoch change, no grace period.
#[prost(uint64, optional, tag = "7")]
pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
/// A validator can have stake below `validator_low_stake_threshold`
/// for this many epochs before being kicked out.
#[prost(uint64, optional, tag = "8")]
pub validator_low_stake_grace_period: ::core::option::Option<u64>,
/// Any extra fields that are not defined statically.
#[prost(message, optional, tag = "9")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveTable {
/// The UID of the table or bag
#[prost(string, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
/// The size or number of key-value pairs in the table or bag
#[prost(uint64, optional, tag = "2")]
pub size: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StakeSubsidy {
/// Balance of SUI set aside for stake subsidies that will be drawn down over time.
#[prost(uint64, optional, tag = "1")]
pub balance: ::core::option::Option<u64>,
/// Count of the number of times stake subsidies have been distributed.
#[prost(uint64, optional, tag = "2")]
pub distribution_counter: ::core::option::Option<u64>,
/// The amount of stake subsidy to be drawn down per distribution.
/// This amount decays and decreases over time.
#[prost(uint64, optional, tag = "3")]
pub current_distribution_amount: ::core::option::Option<u64>,
/// Number of distributions to occur before the distribution amount decays.
#[prost(uint64, optional, tag = "4")]
pub stake_subsidy_period_length: ::core::option::Option<u64>,
/// The rate at which the distribution amount decays at the end of each
/// period. Expressed in basis points.
#[prost(uint32, optional, tag = "5")]
pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
/// Any extra fields that's not defined statically.
#[prost(message, optional, tag = "6")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
/// Struct representing the onchain storage fund.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StorageFund {
/// This is the sum of `storage_rebate` of
/// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
/// balance is storage charges collected from transactions, and the only outflow is storage rebates
/// of transactions, including both the portion refunded to the transaction senders as well as
/// the non-refundable portion taken out and put into `non_refundable_balance`.
#[prost(uint64, optional, tag = "1")]
pub total_object_storage_rebates: ::core::option::Option<u64>,
/// Represents any remaining inflow of the storage fund that should not
/// be taken out of the fund.
#[prost(uint64, optional, tag = "2")]
pub non_refundable_balance: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorSet {
/// Total amount of stake from all active validators at the beginning of the epoch.
/// Written only once per epoch, in `advance_epoch` function.
#[prost(uint64, optional, tag = "1")]
pub total_stake: ::core::option::Option<u64>,
/// The current list of active validators.
#[prost(message, repeated, tag = "2")]
pub active_validators: ::prost::alloc::vec::Vec<Validator>,
/// List of new validator candidates added during the current epoch.
/// They will be processed at the end of the epoch.
///
/// key: u64 (index), value: 0x3::validator::Validator
#[prost(message, optional, tag = "3")]
pub pending_active_validators: ::core::option::Option<MoveTable>,
/// Removal requests from the validators. Each element is an index
/// pointing to `active_validators`.
#[prost(uint64, repeated, tag = "4")]
pub pending_removals: ::prost::alloc::vec::Vec<u64>,
/// Mappings from staking pool's ID to the sui address of a validator.
///
/// key: address (staking pool Id), value: address (sui address of the validator)
#[prost(message, optional, tag = "5")]
pub staking_pool_mappings: ::core::option::Option<MoveTable>,
/// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
/// When a validator is deactivated the validator is removed from `active_validators` it
/// is added to this table so that stakers can continue to withdraw their stake from it.
///
/// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
#[prost(message, optional, tag = "6")]
pub inactive_validators: ::core::option::Option<MoveTable>,
/// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
/// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
/// validator.
/// When the candidate has met the min stake requirement, they can call `request_add_validator` to
/// officially add them to the active validator set `active_validators` next epoch.
///
/// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
#[prost(message, optional, tag = "7")]
pub validator_candidates: ::core::option::Option<MoveTable>,
/// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
#[prost(map = "string, uint64", tag = "8")]
pub at_risk_validators: ::std::collections::HashMap<
::prost::alloc::string::String,
u64,
>,
/// Any extra fields that's not defined statically.
#[prost(message, optional, tag = "9")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
/// Definition of a Validator in the system contracts
///
/// Note: fields of ValidatorMetadata are flattened into this type
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Validator {
/// A unique human-readable name of this validator.
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
/// The Sui Address of the validator. This is the sender that created the Validator object,
/// and also the address to send validator/coins to during withdraws.
#[prost(string, optional, tag = "2")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub image_url: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub project_url: ::core::option::Option<::prost::alloc::string::String>,
/// The public key bytes corresponding to the private key that the validator
/// holds to sign transactions. For now, this is the same as AuthorityName.
#[prost(bytes = "bytes", optional, tag = "7")]
pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
/// This is a proof that the validator has ownership of the protocol private key
#[prost(bytes = "bytes", optional, tag = "8")]
pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
/// The public key bytes corresponding to the private key that the validator
/// uses to establish TLS connections
#[prost(bytes = "bytes", optional, tag = "10")]
pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
/// The public key bytes correstponding to the Narwhal Worker
#[prost(bytes = "bytes", optional, tag = "12")]
pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
/// The network address of the validator (could also contain extra info such as port, DNS and etc.).
#[prost(string, optional, tag = "13")]
pub network_address: ::core::option::Option<::prost::alloc::string::String>,
/// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
#[prost(string, optional, tag = "14")]
pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
/// The address of the narwhal primary
#[prost(string, optional, tag = "15")]
pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
/// The address of the narwhal worker
#[prost(string, optional, tag = "16")]
pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes = "bytes", optional, tag = "18")]
pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "19")]
pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "21")]
pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(bytes = "bytes", optional, tag = "23")]
pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
#[prost(string, optional, tag = "24")]
pub next_epoch_network_address: ::core::option::Option<
::prost::alloc::string::String,
>,
#[prost(string, optional, tag = "25")]
pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "26")]
pub next_epoch_primary_address: ::core::option::Option<
::prost::alloc::string::String,
>,
#[prost(string, optional, tag = "27")]
pub next_epoch_worker_address: ::core::option::Option<
::prost::alloc::string::String,
>,
/// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
#[prost(message, optional, tag = "28")]
pub metadata_extra_fields: ::core::option::Option<MoveTable>,
/// The voting power of this validator, which might be different from its
/// stake amount.
#[prost(uint64, optional, tag = "29")]
pub voting_power: ::core::option::Option<u64>,
/// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
#[prost(string, optional, tag = "30")]
pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
/// Gas price quote, updated only at end of epoch.
#[prost(uint64, optional, tag = "31")]
pub gas_price: ::core::option::Option<u64>,
/// Staking pool for this validator.
#[prost(message, optional, tag = "32")]
pub staking_pool: ::core::option::Option<StakingPool>,
/// Commission rate of the validator, in basis point.
#[prost(uint64, optional, tag = "33")]
pub commission_rate: ::core::option::Option<u64>,
/// Total amount of stake that would be active in the next epoch.
#[prost(uint64, optional, tag = "34")]
pub next_epoch_stake: ::core::option::Option<u64>,
/// This validator's gas price quote for the next epoch.
#[prost(uint64, optional, tag = "35")]
pub next_epoch_gas_price: ::core::option::Option<u64>,
/// The commission rate of the validator starting the next epoch, in basis point.
#[prost(uint64, optional, tag = "36")]
pub next_epoch_commission_rate: ::core::option::Option<u64>,
/// Any extra fields that's not defined statically.
#[prost(message, optional, tag = "37")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
/// A staking pool embedded in each validator struct in the system state object.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StakingPool {
/// UID of the StakingPool object
#[prost(string, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
/// The epoch at which this pool became active.
/// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
#[prost(uint64, optional, tag = "2")]
pub activation_epoch: ::core::option::Option<u64>,
/// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
/// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
#[prost(uint64, optional, tag = "3")]
pub deactivation_epoch: ::core::option::Option<u64>,
/// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
/// in the `StakedSui` object, updated at epoch boundaries.
#[prost(uint64, optional, tag = "4")]
pub sui_balance: ::core::option::Option<u64>,
/// The epoch stake rewards will be added here at the end of each epoch.
#[prost(uint64, optional, tag = "5")]
pub rewards_pool: ::core::option::Option<u64>,
/// Total number of pool tokens issued by the pool.
#[prost(uint64, optional, tag = "6")]
pub pool_token_balance: ::core::option::Option<u64>,
/// Exchange rate history of previous epochs.
///
/// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
/// i.e., right after the rewards for the previous epoch have been deposited into the pool.
///
/// key: u64 (epoch number), value: PoolTokenExchangeRate
#[prost(message, optional, tag = "7")]
pub exchange_rates: ::core::option::Option<MoveTable>,
/// Pending stake amount for this epoch, emptied at epoch boundaries.
#[prost(uint64, optional, tag = "8")]
pub pending_stake: ::core::option::Option<u64>,
/// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
/// This includes both the principal and rewards SUI withdrawn.
#[prost(uint64, optional, tag = "9")]
pub pending_total_sui_withdraw: ::core::option::Option<u64>,
/// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
#[prost(uint64, optional, tag = "10")]
pub pending_pool_token_withdraw: ::core::option::Option<u64>,
/// Any extra fields that's not defined statically.
#[prost(message, optional, tag = "11")]
pub extra_fields: ::core::option::Option<MoveTable>,
}
/// A transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transaction {
/// This Transaction serialized as BCS.
#[prost(message, optional, tag = "1")]
pub bcs: ::core::option::Option<Bcs>,
/// The digest of this Transaction.
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// Version of this Transaction.
#[prost(int32, optional, tag = "3")]
pub version: ::core::option::Option<i32>,
#[prost(message, optional, tag = "4")]
pub kind: ::core::option::Option<TransactionKind>,
#[prost(string, optional, tag = "5")]
pub sender: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub gas_payment: ::core::option::Option<GasPayment>,
#[prost(message, optional, tag = "7")]
pub expiration: ::core::option::Option<TransactionExpiration>,
}
/// Payment information for executing a transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GasPayment {
/// Set of gas objects to use for payment.
#[prost(message, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
/// Owner of the gas objects, either the transaction sender or a sponsor.
#[prost(string, optional, tag = "2")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
/// Gas unit price to use when charging for computation.
///
/// Must be greater than or equal to the network's current RGP (reference gas price).
#[prost(uint64, optional, tag = "3")]
pub price: ::core::option::Option<u64>,
/// Total budget willing to spend for the execution of a transaction.
#[prost(uint64, optional, tag = "4")]
pub budget: ::core::option::Option<u64>,
}
/// A TTL for a transaction.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TransactionExpiration {
#[prost(
enumeration = "transaction_expiration::TransactionExpirationKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
#[prost(uint64, optional, tag = "2")]
pub epoch: ::core::option::Option<u64>,
}
/// Nested message and enum types in `TransactionExpiration`.
pub mod transaction_expiration {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TransactionExpirationKind {
Unknown = 0,
/// The transaction has no expiration.
None = 1,
/// Validators won't sign and execute transaction unless the expiration epoch
/// is greater than or equal to the current epoch.
Epoch = 2,
}
impl TransactionExpirationKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
Self::None => "NONE",
Self::Epoch => "EPOCH",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
"NONE" => Some(Self::None),
"EPOCH" => Some(Self::Epoch),
_ => None,
}
}
}
}
/// Transaction type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionKind {
#[prost(
oneof = "transaction_kind::Kind",
tags = "2, 100, 101, 102, 103, 104, 105, 106, 107, 108"
)]
pub kind: ::core::option::Option<transaction_kind::Kind>,
}
/// Nested message and enum types in `TransactionKind`.
pub mod transaction_kind {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
/// A user transaction comprised of a list of native commands and Move calls.
#[prost(message, tag = "2")]
ProgrammableTransaction(super::ProgrammableTransaction),
/// System transaction used to end an epoch.
///
/// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
/// `EndOfEpochTransaction`).
#[prost(message, tag = "100")]
ChangeEpoch(super::ChangeEpoch),
/// Transaction used to initialize the chain state.
///
/// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
/// executed on the chain.
#[prost(message, tag = "101")]
Genesis(super::GenesisTransaction),
/// V1 consensus commit update.
#[prost(message, tag = "102")]
ConsensusCommitPrologueV1(super::ConsensusCommitPrologue),
/// Update set of valid JWKs used for zklogin.
#[prost(message, tag = "103")]
AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
/// Set of operations to run at the end of the epoch to close out the current epoch and start
/// the next one.
#[prost(message, tag = "104")]
EndOfEpoch(super::EndOfEpochTransaction),
/// Randomness update.
#[prost(message, tag = "105")]
RandomnessStateUpdate(super::RandomnessStateUpdate),
/// V2 consensus commit update.
#[prost(message, tag = "106")]
ConsensusCommitPrologueV2(super::ConsensusCommitPrologue),
/// V3 consensus commit update.
#[prost(message, tag = "107")]
ConsensusCommitPrologueV3(super::ConsensusCommitPrologue),
/// V4 consensus commit update.
#[prost(message, tag = "108")]
ConsensusCommitPrologueV4(super::ConsensusCommitPrologue),
}
}
/// A user transaction.
///
/// Contains a series of native commands and Move calls where the results of one command can be
/// used in future commands.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProgrammableTransaction {
/// Input objects or primitive values.
#[prost(message, repeated, tag = "1")]
pub inputs: ::prost::alloc::vec::Vec<Input>,
/// The commands to be executed sequentially. A failure in any command
/// results in the failure of the entire transaction.
#[prost(message, repeated, tag = "2")]
pub commands: ::prost::alloc::vec::Vec<Command>,
}
/// A single command in a programmable transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Command {
#[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
pub command: ::core::option::Option<command::Command>,
}
/// Nested message and enum types in `Command`.
pub mod command {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Command {
/// A call to either an entry or a public Move function.
#[prost(message, tag = "1")]
MoveCall(super::MoveCall),
/// `(Vec<forall T:key+store. T>, address)`
/// It sends n-objects to the specified address. These objects must have store
/// (public transfer) and either the previous owner must be an address or the object must
/// be newly created.
#[prost(message, tag = "2")]
TransferObjects(super::TransferObjects),
/// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
/// It splits off some amounts into new coins with those amounts.
#[prost(message, tag = "3")]
SplitCoins(super::SplitCoins),
/// `(&mut Coin<T>, Vec<Coin<T>>)`
/// It merges n-coins into the first coin.
#[prost(message, tag = "4")]
MergeCoins(super::MergeCoins),
/// Publishes a Move package. It takes the package bytes and a list of the package's transitive
/// dependencies to link against on chain.
#[prost(message, tag = "5")]
Publish(super::Publish),
/// `forall T: Vec<T> -> vector<T>`
/// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
/// the type tag must be specified.
#[prost(message, tag = "6")]
MakeMoveVector(super::MakeMoveVector),
/// Upgrades a Move package.
/// Takes (in order):
/// 1. A vector of serialized modules for the package.
/// 2. A vector of object ids for the transitive dependencies of the new package.
/// 3. The object ID of the package being upgraded.
/// 4. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
/// programmable transaction.
#[prost(message, tag = "7")]
Upgrade(super::Upgrade),
}
}
/// Command to call a Move function.
///
/// Functions that can be called by a `MoveCall` command are those that have a function signature
/// that is either `entry` or `public` (which don't have a reference return type).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveCall {
/// The package containing the module and function.
#[prost(string, optional, tag = "1")]
pub package: ::core::option::Option<::prost::alloc::string::String>,
/// The specific module in the package containing the function.
#[prost(string, optional, tag = "2")]
pub module: ::core::option::Option<::prost::alloc::string::String>,
/// The function to be called.
#[prost(string, optional, tag = "3")]
pub function: ::core::option::Option<::prost::alloc::string::String>,
/// The type arguments to the function.
#[prost(string, repeated, tag = "4")]
pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The arguments to the function.
#[prost(message, repeated, tag = "5")]
pub arguments: ::prost::alloc::vec::Vec<Argument>,
}
/// Command to transfer ownership of a set of objects to an address.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransferObjects {
/// Set of objects to transfer.
#[prost(message, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<Argument>,
/// The address to transfer ownership to.
#[prost(message, optional, tag = "2")]
pub address: ::core::option::Option<Argument>,
}
/// Command to split a single coin object into multiple coins.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SplitCoins {
/// The coin to split.
#[prost(message, optional, tag = "1")]
pub coin: ::core::option::Option<Argument>,
/// The amounts to split off.
#[prost(message, repeated, tag = "2")]
pub amounts: ::prost::alloc::vec::Vec<Argument>,
}
/// Command to merge multiple coins of the same type into a single coin.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MergeCoins {
/// Coin to merge coins into.
#[prost(message, optional, tag = "1")]
pub coin: ::core::option::Option<Argument>,
/// Set of coins to merge into `coin`.
///
/// All listed coins must be of the same type and be the same type as `coin`
#[prost(message, repeated, tag = "2")]
pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
}
/// Command to publish a new Move package.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Publish {
/// The serialized Move modules.
#[prost(bytes = "bytes", repeated, tag = "1")]
pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
/// Set of packages that the to-be published package depends on.
#[prost(string, repeated, tag = "2")]
pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Command to build a Move vector out of a set of individual elements.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MakeMoveVector {
/// Type of the individual elements.
///
/// This is required to be set when the type can't be inferred, for example when the set of
/// provided arguments are all pure input values.
#[prost(string, optional, tag = "1")]
pub element_type: ::core::option::Option<::prost::alloc::string::String>,
/// The set individual elements to build the vector with.
#[prost(message, repeated, tag = "2")]
pub elements: ::prost::alloc::vec::Vec<Argument>,
}
/// Command to upgrade an already published package.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Upgrade {
/// The serialized Move modules.
#[prost(bytes = "bytes", repeated, tag = "1")]
pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
/// Set of packages that the to-be published package depends on.
#[prost(string, repeated, tag = "2")]
pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Package ID of the package to upgrade.
#[prost(string, optional, tag = "3")]
pub package: ::core::option::Option<::prost::alloc::string::String>,
/// Ticket authorizing the upgrade.
#[prost(message, optional, tag = "4")]
pub ticket: ::core::option::Option<Argument>,
}
/// Randomness update.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RandomnessStateUpdate {
/// Epoch of the randomness state update transaction.
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
/// Randomness round of the update.
#[prost(uint64, optional, tag = "2")]
pub randomness_round: ::core::option::Option<u64>,
/// Updated random bytes.
#[prost(bytes = "bytes", optional, tag = "3")]
pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
/// The initial version of the randomness object that it was shared at.
#[prost(uint64, optional, tag = "4")]
pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
}
/// System transaction used to change the epoch.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeEpoch {
/// The next (to become) epoch ID.
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
/// The protocol version in effect in the new epoch.
#[prost(uint64, optional, tag = "2")]
pub protocol_version: ::core::option::Option<u64>,
/// The total amount of gas charged for storage during the epoch.
#[prost(uint64, optional, tag = "3")]
pub storage_charge: ::core::option::Option<u64>,
/// The total amount of gas charged for computation during the epoch.
#[prost(uint64, optional, tag = "4")]
pub computation_charge: ::core::option::Option<u64>,
/// The amount of storage rebate refunded to the txn senders.
#[prost(uint64, optional, tag = "5")]
pub storage_rebate: ::core::option::Option<u64>,
/// The non-refundable storage fee.
#[prost(uint64, optional, tag = "6")]
pub non_refundable_storage_fee: ::core::option::Option<u64>,
/// Unix timestamp when epoch started.
#[prost(message, optional, tag = "7")]
pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
/// System packages (specifically framework and Move stdlib) that are written before the new
/// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
/// the validator must write out the following modules. Modules are provided with the version they
/// will be upgraded to, their modules in serialized form (which include their package ID), and
/// a list of their transitive dependencies.
#[prost(message, repeated, tag = "8")]
pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
}
/// System package.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SystemPackage {
/// Version of the package.
#[prost(uint64, optional, tag = "1")]
pub version: ::core::option::Option<u64>,
/// Move modules.
#[prost(bytes = "bytes", repeated, tag = "2")]
pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
/// Package dependencies.
#[prost(string, repeated, tag = "3")]
pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The genesis transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisTransaction {
/// Set of genesis objects.
#[prost(message, repeated, tag = "1")]
pub objects: ::prost::alloc::vec::Vec<Object>,
}
/// Consensus commit prologue system transaction.
///
/// This message can represent V1, V2, and V3 prologue types.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusCommitPrologue {
/// Epoch of the commit prologue transaction.
///
/// Present in V1, V2, V3, V4.
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
/// Consensus round of the commit.
///
/// Present in V1, V2, V3, V4.
#[prost(uint64, optional, tag = "2")]
pub round: ::core::option::Option<u64>,
/// Unix timestamp from consensus.
///
/// Present in V1, V2, V3, V4.
#[prost(message, optional, tag = "3")]
pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
/// Digest of consensus output.
///
/// Present in V2, V3, V4.
#[prost(string, optional, tag = "4")]
pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
/// The sub DAG index of the consensus commit. This field is populated if there
/// are multiple consensus commits per round.
///
/// Present in V3, V4.
#[prost(uint64, optional, tag = "5")]
pub sub_dag_index: ::core::option::Option<u64>,
/// Stores consensus handler determined shared object version assignments.
///
/// Present in V3, V4.
#[prost(message, optional, tag = "6")]
pub consensus_determined_version_assignments: ::core::option::Option<
ConsensusDeterminedVersionAssignments,
>,
/// Digest of any additional state computed by the consensus handler.
/// Used to detect forking bugs as early as possible.
///
/// Present in V4.
#[prost(string, optional, tag = "7")]
pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
}
/// Object version assignment from consensus.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VersionAssignment {
/// `ObjectId` of the object.
#[prost(string, optional, tag = "1")]
pub object_id: ::core::option::Option<::prost::alloc::string::String>,
/// start version of the consensus stream for this object
///
/// TODO fix field numbering
#[prost(uint64, optional, tag = "3")]
pub start_version: ::core::option::Option<u64>,
/// Assigned version.
#[prost(uint64, optional, tag = "2")]
pub version: ::core::option::Option<u64>,
}
/// A transaction that was canceled.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanceledTransaction {
/// Digest of the canceled transaction.
#[prost(string, optional, tag = "1")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// List of object version assignments.
#[prost(message, repeated, tag = "2")]
pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
}
/// Version assignments performed by consensus.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusDeterminedVersionAssignments {
/// Version of this message
#[prost(int32, optional, tag = "1")]
pub version: ::core::option::Option<i32>,
/// Canceled transaction version assignment.
#[prost(message, repeated, tag = "3")]
pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
}
/// Update the set of valid JWKs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticatorStateUpdate {
/// Epoch of the authenticator state update transaction.
#[prost(uint64, optional, tag = "1")]
pub epoch: ::core::option::Option<u64>,
/// Consensus round of the authenticator state update.
#[prost(uint64, optional, tag = "2")]
pub round: ::core::option::Option<u64>,
/// Newly active JWKs.
#[prost(message, repeated, tag = "3")]
pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
/// The initial version of the authenticator object that it was shared at.
#[prost(uint64, optional, tag = "4")]
pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
}
/// A new JWK.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActiveJwk {
/// Identifier used to uniquely identify a JWK.
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<JwkId>,
/// The JWK.
#[prost(message, optional, tag = "2")]
pub jwk: ::core::option::Option<Jwk>,
/// Most recent epoch in which the JWK was validated.
#[prost(uint64, optional, tag = "3")]
pub epoch: ::core::option::Option<u64>,
}
/// Key to uniquely identify a JWK.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JwkId {
/// The issuer or identity of the OIDC provider.
#[prost(string, optional, tag = "1")]
pub iss: ::core::option::Option<::prost::alloc::string::String>,
/// A key ID used to uniquely identify a key from an OIDC provider.
#[prost(string, optional, tag = "2")]
pub kid: ::core::option::Option<::prost::alloc::string::String>,
}
/// A JSON web key.
///
/// Struct that contains info for a JWK. A list of them for different kinds can
/// be retrieved from the JWK endpoint (for example, <<https://www.googleapis.com/oauth2/v3/certs>>).
/// The JWK is used to verify the JWT token.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Jwk {
/// Key type parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.1.>
#[prost(string, optional, tag = "1")]
pub kty: ::core::option::Option<::prost::alloc::string::String>,
/// RSA public exponent, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
#[prost(string, optional, tag = "2")]
pub e: ::core::option::Option<::prost::alloc::string::String>,
/// RSA modulus, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
#[prost(string, optional, tag = "3")]
pub n: ::core::option::Option<::prost::alloc::string::String>,
/// Algorithm parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.>
#[prost(string, optional, tag = "4")]
pub alg: ::core::option::Option<::prost::alloc::string::String>,
}
/// Set of operations run at the end of the epoch to close out the current epoch
/// and start the next one.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndOfEpochTransaction {
#[prost(message, repeated, tag = "1")]
pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
}
/// Operation run at the end of an epoch.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndOfEpochTransactionKind {
#[prost(
oneof = "end_of_epoch_transaction_kind::Kind",
tags = "2, 3, 4, 200, 201, 202, 203, 204, 205"
)]
pub kind: ::core::option::Option<end_of_epoch_transaction_kind::Kind>,
}
/// Nested message and enum types in `EndOfEpochTransactionKind`.
pub mod end_of_epoch_transaction_kind {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
/// End the epoch and start the next one.
#[prost(message, tag = "2")]
ChangeEpoch(super::ChangeEpoch),
/// Expire JWKs used for zklogin.
#[prost(message, tag = "3")]
AuthenticatorStateExpire(super::AuthenticatorStateExpire),
/// Execution time observations from the committee to preserve cross epoch
#[prost(message, tag = "4")]
ExecutionTimeObservations(super::ExecutionTimeObservations),
/// Create and initialize the authenticator object used for zklogin.
#[prost(message, tag = "200")]
AuthenticatorStateCreate(()),
/// Create and initialize the randomness object.
#[prost(message, tag = "201")]
RandomnessStateCreate(()),
/// Create and initialize the deny list object.
#[prost(message, tag = "202")]
DenyListStateCreate(()),
/// Create and initialize the bridge object.
#[prost(string, tag = "203")]
BridgeStateCreate(::prost::alloc::string::String),
/// Initialize the bridge committee.
#[prost(uint64, tag = "204")]
BridgeCommitteeInit(u64),
/// Create the accumulator root object.
#[prost(message, tag = "205")]
AccumulatorRootCreate(()),
}
}
/// Expire old JWKs.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AuthenticatorStateExpire {
/// Expire JWKs that have a lower epoch than this.
#[prost(uint64, optional, tag = "1")]
pub min_epoch: ::core::option::Option<u64>,
/// The initial version of the authenticator object that it was shared at.
#[prost(uint64, optional, tag = "2")]
pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionTimeObservations {
/// Version of this ExecutionTimeObservations
#[prost(int32, optional, tag = "1")]
pub version: ::core::option::Option<i32>,
#[prost(message, repeated, tag = "2")]
pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionTimeObservation {
#[prost(
enumeration = "execution_time_observation::ExecutionTimeObservationKind",
optional,
tag = "1"
)]
pub kind: ::core::option::Option<i32>,
#[prost(message, optional, tag = "2")]
pub move_entry_point: ::core::option::Option<MoveCall>,
#[prost(message, repeated, tag = "3")]
pub validator_observations: ::prost::alloc::vec::Vec<
ValidatorExecutionTimeObservation,
>,
}
/// Nested message and enum types in `ExecutionTimeObservation`.
pub mod execution_time_observation {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExecutionTimeObservationKind {
Unknown = 0,
MoveEntryPoint = 1,
TransferObjects = 2,
SplitCoins = 3,
MergeCoins = 4,
Publish = 5,
MakeMoveVector = 6,
Upgrade = 7,
}
impl ExecutionTimeObservationKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
Self::TransferObjects => "TRANSFER_OBJECTS",
Self::SplitCoins => "SPLIT_COINS",
Self::MergeCoins => "MERGE_COINS",
Self::Publish => "PUBLISH",
Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
Self::Upgrade => "UPGRADE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
"MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
"TRANSFER_OBJECTS" => Some(Self::TransferObjects),
"SPLIT_COINS" => Some(Self::SplitCoins),
"MERGE_COINS" => Some(Self::MergeCoins),
"PUBLISH" => Some(Self::Publish),
"MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
"UPGRADE" => Some(Self::Upgrade),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorExecutionTimeObservation {
/// Bls12381 public key of the validator
#[prost(bytes = "bytes", optional, tag = "1")]
pub validator: ::core::option::Option<::prost::bytes::Bytes>,
/// Duration of an execution observation
#[prost(message, optional, tag = "2")]
pub duration: ::core::option::Option<::prost_types::Duration>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteTransactionRequest {
/// The transaction to execute.
#[prost(message, optional, tag = "1")]
pub transaction: ::core::option::Option<Transaction>,
/// Set of `UserSiganture`s authorizing the execution of the provided
/// transaction.
#[prost(message, repeated, tag = "2")]
pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
/// Mask specifying which fields to read.
/// If no mask is specified, defaults to `finality`.
#[prost(message, optional, tag = "3")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Response message for `NodeService.ExecuteTransaction`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteTransactionResponse {
/// Indicates the finality of the executed transaction.
#[prost(message, optional, tag = "1")]
pub finality: ::core::option::Option<TransactionFinality>,
#[prost(message, optional, tag = "2")]
pub transaction: ::core::option::Option<ExecutedTransaction>,
}
/// Indicates the finality of the executed transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionFinality {
#[prost(oneof = "transaction_finality::Finality", tags = "1, 2, 3")]
pub finality: ::core::option::Option<transaction_finality::Finality>,
}
/// Nested message and enum types in `TransactionFinality`.
pub mod transaction_finality {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Finality {
/// A quorum certificate certifying that a transaction is final but might not
/// be included in a checkpoint yet.
#[prost(message, tag = "1")]
Certified(super::ValidatorAggregatedSignature),
/// Sequence number of the checkpoint that includes the transaction.
#[prost(uint64, tag = "2")]
Checkpointed(u64),
/// Indicates that a quorum of validators has executed the transaction but
/// that it might not be included in a checkpoint yet.
#[prost(message, tag = "3")]
QuorumExecuted(()),
}
}
/// Generated client implementations.
pub mod transaction_execution_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct TransactionExecutionServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl TransactionExecutionServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> TransactionExecutionServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
TransactionExecutionServiceClient::new(
InterceptedService::new(inner, interceptor),
)
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn execute_transaction(
&mut self,
request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteTransactionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/sui.rpc.v2beta.TransactionExecutionService/ExecuteTransaction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"sui.rpc.v2beta.TransactionExecutionService",
"ExecuteTransaction",
),
);
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod transaction_execution_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
#[async_trait]
pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
async fn execute_transaction(
&self,
request: tonic::Request<super::ExecuteTransactionRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteTransactionResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct TransactionExecutionServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> TransactionExecutionServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>>
for TransactionExecutionServiceServer<T>
where
T: TransactionExecutionService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/sui.rpc.v2beta.TransactionExecutionService/ExecuteTransaction" => {
#[allow(non_camel_case_types)]
struct ExecuteTransactionSvc<T: TransactionExecutionService>(
pub Arc<T>,
);
impl<
T: TransactionExecutionService,
> tonic::server::UnaryService<super::ExecuteTransactionRequest>
for ExecuteTransactionSvc<T> {
type Response = super::ExecuteTransactionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ExecuteTransactionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TransactionExecutionService>::execute_transaction(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExecuteTransactionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for TransactionExecutionServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "sui.rpc.v2beta.TransactionExecutionService";
impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}