sui_rpc/proto/sui/rpc/v2/
name_service.rs

1use sui_sdk_types::Address;
2
3use super::*;
4
5impl LookupNameRequest {
6    pub fn new<T: Into<String>>(name: T) -> Self {
7        Self {
8            name: Some(name.into()),
9        }
10    }
11}
12
13impl LookupNameResponse {
14    pub fn new(record: NameRecord) -> Self {
15        Self {
16            record: Some(record),
17        }
18    }
19}
20
21impl ReverseLookupNameRequest {
22    pub fn new(address: &Address) -> Self {
23        Self {
24            address: Some(address.to_string()),
25        }
26    }
27}
28
29impl ReverseLookupNameResponse {
30    pub fn new(record: NameRecord) -> Self {
31        Self {
32            record: Some(record),
33        }
34    }
35}