2024-02-15 07:08:32 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package cerc.registry.v1;
|
|
|
|
|
|
|
|
import "google/api/annotations.proto";
|
|
|
|
import "cosmos/base/query/v1beta1/pagination.proto";
|
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
|
|
|
import "cerc/registry/v1/registry.proto";
|
|
|
|
|
2024-04-01 09:57:26 +00:00
|
|
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/registry";
|
2024-02-15 07:08:32 +00:00
|
|
|
|
|
|
|
// Query defines the gRPC querier service for registry module
|
|
|
|
service Query {
|
|
|
|
// Params queries the registry module params.
|
|
|
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
|
|
|
option (google.api.http).get = "/cerc/registry/v1/params";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Records queries all records
|
|
|
|
rpc Records(QueryRecordsRequest) returns (QueryRecordsResponse) {
|
|
|
|
option (google.api.http).get = "/cerc/registry/v1/records";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get record by id
|
2024-03-07 11:25:15 +00:00
|
|
|
rpc GetRecord(QueryGetRecordRequest) returns (QueryGetRecordResponse) {
|
2024-02-15 07:08:32 +00:00
|
|
|
option (google.api.http).get = "/cerc/registry/v1/records/{id}";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get records by bond id
|
2024-03-07 11:25:15 +00:00
|
|
|
rpc GetRecordsByBondId(QueryGetRecordsByBondIdRequest)
|
|
|
|
returns (QueryGetRecordsByBondIdResponse) {
|
2024-02-15 07:08:32 +00:00
|
|
|
option (google.api.http).get = "/cerc/registry/v1/records-by-bond-id/{id}";
|
|
|
|
}
|
|
|
|
|
|
|
|
// NameRecords queries all name records
|
|
|
|
rpc NameRecords(QueryNameRecordsRequest) returns (QueryNameRecordsResponse) {
|
|
|
|
option (google.api.http).get = "/cerc/registry/v1/names";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Whois method retrieve the name authority info
|
|
|
|
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse) {
|
|
|
|
option (google.api.http).get = "/cerc/registry/v1/whois/{name}";
|
|
|
|
}
|
|
|
|
|
2024-02-28 04:53:23 +00:00
|
|
|
// LookupLrn
|
|
|
|
rpc LookupLrn(QueryLookupLrnRequest) returns (QueryLookupLrnResponse) {
|
2024-02-15 07:08:32 +00:00
|
|
|
option (google.api.http).get = "/cerc/registry/v1/lookup";
|
|
|
|
}
|
|
|
|
|
2024-02-28 04:53:23 +00:00
|
|
|
// ResolveLrn
|
|
|
|
rpc ResolveLrn(QueryResolveLrnRequest) returns (QueryResolveLrnResponse) {
|
2024-02-15 07:08:32 +00:00
|
|
|
option (google.api.http).get = "/cerc/registry/v1/resolve";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get registry module balance
|
2024-03-07 11:25:15 +00:00
|
|
|
rpc GetRegistryModuleBalance(QueryGetRegistryModuleBalanceRequest)
|
|
|
|
returns (QueryGetRegistryModuleBalanceResponse) {
|
2024-02-15 07:08:32 +00:00
|
|
|
option (google.api.http).get = "/cerc/registry/v1/balance";
|
|
|
|
}
|
2024-07-24 09:14:39 +00:00
|
|
|
|
|
|
|
// Authorities queries all authorities
|
|
|
|
rpc Authorities(QueryAuthoritiesRequest) returns (QueryAuthoritiesResponse) {
|
|
|
|
option (google.api.http).get = "/cerc/registry/v1/authorities";
|
|
|
|
}
|
2024-02-15 07:08:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryParamsRequest is request type for registry params
|
|
|
|
message QueryParamsRequest {}
|
|
|
|
|
|
|
|
// QueryParamsResponse is response type for registry params
|
2024-03-07 11:25:15 +00:00
|
|
|
message QueryParamsResponse { Params params = 1; }
|
2024-02-15 07:08:32 +00:00
|
|
|
|
|
|
|
// QueryRecordsRequest is request type for registry records list
|
|
|
|
message QueryRecordsRequest {
|
2024-03-07 11:25:15 +00:00
|
|
|
// Array type attribute
|
|
|
|
message ArrayInput { repeated ValueInput values = 1; }
|
|
|
|
// Map type attribute
|
|
|
|
message MapInput { map<string, ValueInput> values = 1; }
|
|
|
|
// Type for record attribute value
|
2024-02-15 07:08:32 +00:00
|
|
|
message ValueInput {
|
2024-03-07 11:25:15 +00:00
|
|
|
// Value is one of the following types
|
2024-02-15 07:08:32 +00:00
|
|
|
oneof value {
|
2024-03-07 11:25:15 +00:00
|
|
|
string string = 1;
|
|
|
|
int64 int = 2;
|
|
|
|
double float = 3;
|
|
|
|
bool boolean = 4;
|
|
|
|
string link = 5;
|
2024-02-15 07:08:32 +00:00
|
|
|
ArrayInput array = 6;
|
2024-03-07 11:25:15 +00:00
|
|
|
MapInput map = 7;
|
2024-02-15 07:08:32 +00:00
|
|
|
}
|
|
|
|
}
|
2024-03-07 11:25:15 +00:00
|
|
|
// Type for record attribute key
|
2024-02-15 07:08:32 +00:00
|
|
|
message KeyValueInput {
|
2024-03-07 11:25:15 +00:00
|
|
|
string key = 1;
|
2024-02-15 07:08:32 +00:00
|
|
|
ValueInput value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
repeated KeyValueInput attributes = 1;
|
|
|
|
|
|
|
|
bool all = 2;
|
|
|
|
|
|
|
|
// pagination defines an optional pagination for the request.
|
|
|
|
cosmos.base.query.v1beta1.PageRequest pagination = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryRecordsResponse is response type for registry records list
|
|
|
|
message QueryRecordsResponse {
|
2024-03-07 11:25:15 +00:00
|
|
|
repeated Record records = 1 [ (gogoproto.nullable) = false ];
|
2024-02-15 07:08:32 +00:00
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetRecordRequest is request type for registry records by id
|
|
|
|
message QueryGetRecordRequest { string id = 1; }
|
2024-02-15 07:08:32 +00:00
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetRecordResponse is response type for registry records by id
|
|
|
|
message QueryGetRecordResponse {
|
|
|
|
Record record = 1 [ (gogoproto.nullable) = false ];
|
2024-02-15 07:08:32 +00:00
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetRecordsByBondIdRequest is request type for get the records by bond-id
|
|
|
|
message QueryGetRecordsByBondIdRequest {
|
2024-02-15 07:08:32 +00:00
|
|
|
string id = 1;
|
|
|
|
// pagination defines an optional pagination for the request.
|
|
|
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetRecordsByBondIdResponse is response type for records list by bond-id
|
|
|
|
message QueryGetRecordsByBondIdResponse {
|
|
|
|
repeated Record records = 1 [ (gogoproto.nullable) = false ];
|
2024-02-15 07:08:32 +00:00
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryNameRecordsRequest is request type for registry names records
|
|
|
|
message QueryNameRecordsRequest {
|
|
|
|
// pagination defines an optional pagination for the request.
|
|
|
|
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryNameRecordsResponse is response type for registry names records
|
|
|
|
message QueryNameRecordsResponse {
|
2024-03-07 11:25:15 +00:00
|
|
|
repeated NameEntry names = 1 [ (gogoproto.nullable) = false ];
|
2024-02-15 07:08:32 +00:00
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryWhoisRequest is request type for Get NameAuthority
|
2024-03-07 11:25:15 +00:00
|
|
|
message QueryWhoisRequest { string name = 1; }
|
2024-02-15 07:08:32 +00:00
|
|
|
|
|
|
|
// QueryWhoisResponse is response type for whois request
|
|
|
|
message QueryWhoisResponse {
|
|
|
|
NameAuthority name_authority = 1 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"name_authority\" yaml:\"name_authority\""
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2024-07-24 09:14:39 +00:00
|
|
|
// QueryAuthoritiesRequest is request type to get all authorities
|
|
|
|
message QueryAuthoritiesRequest { string owner = 1; }
|
|
|
|
|
|
|
|
// QueryAuthoritiesResponse is response type for authorities request
|
|
|
|
message QueryAuthoritiesResponse {
|
|
|
|
repeated AuthorityEntry authorities = 1 [ (gogoproto.nullable) = false ];
|
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
2024-02-28 04:53:23 +00:00
|
|
|
// QueryLookupLrnRequest is request type for LookupLrn
|
2024-03-07 11:25:15 +00:00
|
|
|
message QueryLookupLrnRequest { string lrn = 1; }
|
2024-02-15 07:08:32 +00:00
|
|
|
|
2024-02-28 04:53:23 +00:00
|
|
|
// QueryLookupLrnResponse is response type for QueryLookupLrnRequest
|
2024-03-07 11:25:15 +00:00
|
|
|
message QueryLookupLrnResponse { NameRecord name = 1; }
|
2024-02-15 07:08:32 +00:00
|
|
|
|
2024-02-28 04:53:23 +00:00
|
|
|
// QueryResolveLrnRequest is request type for ResolveLrn
|
2024-03-07 11:25:15 +00:00
|
|
|
message QueryResolveLrnRequest { string lrn = 1; }
|
2024-02-15 07:08:32 +00:00
|
|
|
|
2024-02-28 04:53:23 +00:00
|
|
|
// QueryResolveLrnResponse is response type for QueryResolveLrnRequest
|
2024-03-07 11:25:15 +00:00
|
|
|
message QueryResolveLrnResponse { Record record = 1; }
|
2024-02-15 07:08:32 +00:00
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetRegistryModuleBalanceRequest is request type for registry module
|
|
|
|
// accounts balance
|
2024-02-15 07:08:32 +00:00
|
|
|
message QueryGetRegistryModuleBalanceRequest {}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetRegistryModuleBalanceResponse is response type for registry module
|
|
|
|
// accounts balance
|
2024-02-15 07:08:32 +00:00
|
|
|
message QueryGetRegistryModuleBalanceResponse {
|
|
|
|
repeated AccountBalance balances = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// AccountBalance is registry module account balance
|
|
|
|
message AccountBalance {
|
2024-03-07 11:25:15 +00:00
|
|
|
string account_name = 1
|
|
|
|
[ (gogoproto.moretags) = "json:\"account_name\" yaml:\"account_name\"" ];
|
2024-02-15 07:08:32 +00:00
|
|
|
repeated cosmos.base.v1beta1.Coin balance = 3 [
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.nullable) = false,
|
2024-02-15 07:08:32 +00:00
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.moretags) = "json:\"balance\" yaml:\"balance\""
|
2024-02-15 07:08:32 +00:00
|
|
|
];
|
|
|
|
}
|