mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-07 21:47:02 +09:00
90 lines
2.6 KiB
Protocol Buffer
90 lines
2.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
option go_package = "nameservice/nameserviceproto";
|
|
|
|
//import "google/protobuf/timestamp.proto";
|
|
import "nameservice/nameserviceproto/protos/nameservice_aa.proto";
|
|
|
|
message NameAvailableRequest {
|
|
// Name including .any suffix
|
|
string fullName = 1;
|
|
}
|
|
|
|
message BatchNameAvailableRequest {
|
|
// Names including .any suffix
|
|
repeated string fullNames = 1;
|
|
}
|
|
|
|
message NameByAddressRequest {
|
|
// EOA -> SCW -> name
|
|
// A SCW Ethereum address that owns that name
|
|
string ownerScwEthAddress = 1;
|
|
}
|
|
|
|
message BatchNameByAddressRequest {
|
|
// EOA -> SCW -> name
|
|
// A SCW Ethereum address that owns that name
|
|
repeated string ownerScwEthAddresses = 1;
|
|
}
|
|
|
|
message NameByAnyIdRequest {
|
|
string anyAddress = 1;
|
|
}
|
|
|
|
message BatchNameByAnyIdRequest {
|
|
repeated string anyAddresses = 1;
|
|
}
|
|
|
|
message NameAvailableResponse {
|
|
bool available = 1;
|
|
|
|
// EOA -> SCW -> name
|
|
// This field is non-empty only if name is "already registered"
|
|
string ownerScwEthAddress = 2;
|
|
|
|
// This field is non-empty only if name is "already registered"
|
|
string ownerEthAddress = 3;
|
|
|
|
// A content hash attached to this name
|
|
// This field is non-empty only if name is "already registered"
|
|
string ownerAnyAddress = 4;
|
|
|
|
// A SpaceID attached to this name
|
|
// This field is non-empty only if name is "already registered"
|
|
string spaceId = 5;
|
|
|
|
// doesn't work with marashalling/unmarshalling
|
|
//google.protobuf.Timestamp nameExpires = 5 [(gogoproto.stdtime) = true];
|
|
int64 nameExpires = 6;
|
|
}
|
|
|
|
message BatchNameAvailableResponse {
|
|
repeated NameAvailableResponse results = 1;
|
|
}
|
|
|
|
message NameByAddressResponse {
|
|
bool found = 1;
|
|
|
|
string name = 2;
|
|
}
|
|
|
|
message BatchNameByAddressResponse {
|
|
repeated NameByAddressResponse results = 1;
|
|
}
|
|
|
|
service Anyns {
|
|
// Lookup: name -> address
|
|
rpc IsNameAvailable(NameAvailableRequest) returns (NameAvailableResponse) {}
|
|
rpc BatchIsNameAvailable(BatchNameAvailableRequest) returns (BatchNameAvailableResponse) {}
|
|
|
|
// Reverse lookup: address -> name
|
|
rpc GetNameByAddress(NameByAddressRequest) returns (NameByAddressResponse) {}
|
|
rpc BatchGetNameByAddress(BatchNameByAddressRequest) returns (BatchNameByAddressResponse) {}
|
|
|
|
// Reverse lookup: ANY ID -> name
|
|
rpc GetNameByAnyId(NameByAnyIdRequest) returns (NameByAddressResponse) {}
|
|
rpc BatchGetNameByAnyId(BatchNameByAnyIdRequest) returns (BatchNameByAddressResponse) {}
|
|
|
|
// Register new name for the user (on behalf of the user)
|
|
// Anytype CAN only register names for users, but can not transfer or update them!
|
|
rpc AdminNameRegisterSigned(NameRegisterRequestSigned) returns (OperationResponse) {}
|
|
}
|