sui_rpc/proto/sui/rpc/v2/
move_package_service.rs1use bytes::Bytes;
2use sui_sdk_types::Address;
3
4use super::*;
5
6impl GetPackageRequest {
7 pub fn new(package_id: &Address) -> Self {
8 Self {
9 package_id: Some(package_id.to_string()),
10 selector: None,
11 }
12 }
13}
14
15impl GetPackageResponse {
16 pub fn new(package: Package) -> Self {
17 Self {
18 package: Some(package),
19 }
20 }
21}
22
23impl GetDatatypeRequest {
24 pub fn new(package_id: &Address, module: &str, name: &str) -> Self {
25 Self {
26 package_id: Some(package_id.to_string()),
27 module_name: Some(module.into()),
28 name: Some(name.into()),
29 }
30 }
31}
32
33impl GetDatatypeResponse {
34 pub fn new(datatype: DatatypeDescriptor) -> Self {
35 Self {
36 datatype: Some(datatype),
37 }
38 }
39}
40
41impl GetFunctionRequest {
42 pub fn new(package_id: &Address, module: &str, name: &str) -> Self {
43 Self {
44 package_id: Some(package_id.to_string()),
45 module_name: Some(module.into()),
46 name: Some(name.into()),
47 }
48 }
49}
50
51impl GetFunctionResponse {
52 pub fn new(function: FunctionDescriptor) -> Self {
53 Self {
54 function: Some(function),
55 }
56 }
57}
58
59impl ListPackageVersionsRequest {
60 pub fn new(package_id: &Address) -> Self {
61 Self {
62 package_id: Some(package_id.to_string()),
63 page_size: None,
64 page_token: None,
65 }
66 }
67}
68
69impl ListPackageVersionsResponse {
70 pub fn new(versions: Vec<PackageVersion>, next_page_token: Option<Bytes>) -> Self {
71 Self {
72 versions,
73 next_page_token,
74 }
75 }
76}
77
78impl PackageVersion {
79 pub fn new(package_id: &Address, version: u64) -> Self {
80 Self {
81 package_id: Some(package_id.to_string()),
82 version: Some(version),
83 }
84 }
85}