laconicd-deprecated/proto/vulcanize/registry/v1beta1/query.proto
Nabarun 776799ea02
Some checks failed
Pull Request Labeler / triage (push) Successful in 58s
Run Gosec / Gosec (push) Failing after 2m29s
Tests / cleanup-runs (push) Has been skipped
Lint / Run flake8 on python integration tests (push) Failing after 4m48s
Tests / test-unit-cover (push) Failing after 8m52s
Tests / sdk_tests (push) Failing after 22s
Tests / test-rpc (push) Failing after 1m18s
Lint / Run golangci-lint (push) Successful in 15m15s
Tests / test-importer (push) Successful in 11m6s
CodeQL / Analyze (go) (push) Failing after 3m14s
Semgrep / Scan (push) Failing after 47s
Remove hard-coded record types (#132)
- Resolves #107 and is initial work on #108
  - Refactors the `Record.Attributes` from Any into a byte string and removes the hard-coded Protobuf record types.
  - Fixes EIP-712 bytes decoding.
- Resolves #109
  - Rewords the graphql schema to be able to represent generic IPLD objects encoded as DAG-JSON.

Co-authored-by: Roy Crihfield <roy@manteia.ltd>
Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Reviewed-on: cerc-io/laconicd#132
Reviewed-by: Thomas E Lackey <telackey@noreply.git.vdb.to>
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-01-15 04:20:38 +00:00

227 lines
7.5 KiB
Protocol Buffer

syntax = "proto3";
package vulcanize.registry.v1beta1;
import "vulcanize/registry/v1beta1/registry.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
// 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 = "/vulcanize/registry/v1beta1/params";
}
// List records
rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/records";
}
// Get record by id
rpc GetRecord(QueryRecordByIDRequest) returns (QueryRecordByIDResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/records/{id}";
}
// Get records by bond id
rpc GetRecordByBondID(QueryRecordByBondIDRequest) returns (QueryRecordByBondIDResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/records-by-bond-id/{id}";
}
// Get registry module balance
rpc GetRegistryModuleBalance(GetRegistryModuleBalanceRequest) returns (GetRegistryModuleBalanceResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/balance";
}
// List name records
rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/names";
}
// Whois method retrieve the name authority info
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/whois/{name}";
}
// LookupCrn
rpc LookupCrn(QueryLookupCrn) returns (QueryLookupCrnResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/lookup";
}
// ResolveCrn
rpc ResolveCrn(QueryResolveCrn) returns (QueryResolveCrnResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/resolve";
}
// GetRecordExpiryQueue
rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/record-expiry";
}
// GetAuthorityExpiryQueue
rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/authority-expiry";
}
}
// QueryParamsRequest is request type for registry params
message QueryParamsRequest {}
// QueryParamsResponse is response type for registry params
message QueryParamsResponse {
Params params = 1;
}
// QueryListRecordsRequest is request type for registry records list
message QueryListRecordsRequest {
message LinkInput {
string id = 1;
}
message ArrayInput {
repeated ValueInput values = 1;
}
message MapInput {
map<string, ValueInput> values = 1;
}
message ValueInput {
// Type of record attribute value
oneof value {
string string = 1;
int64 int = 2;
double float = 3;
bool boolean = 4;
string link = 5;
ArrayInput array = 6;
MapInput map = 7;
}
}
message KeyValueInput {
string key = 1;
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;
}
// QueryListRecordsResponse is response type for registry records list
message QueryListRecordsResponse {
repeated Record records = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryRecordByIDRequest is request type for registry records by id
message QueryRecordByIDRequest {
string id = 1;
}
// QueryRecordByIDResponse is response type for registry records by id
message QueryRecordByIDResponse {
Record record = 1 [(gogoproto.nullable) = false];
}
// QueryRecordByBondIdRequest is request type for get the records by bond-id
message QueryRecordByBondIDRequest {
string id = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryRecordByBondIdResponse is response type for records list by bond-id
message QueryRecordByBondIDResponse {
repeated Record records = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// GetRegistryModuleBalanceRequest is request type for registry module accounts balance
message GetRegistryModuleBalanceRequest {}
// GetRegistryModuleBalanceResponse is response type for registry module accounts balance
message GetRegistryModuleBalanceResponse {
repeated AccountBalance balances = 1;
}
// AccountBalance is registry module account balance
message AccountBalance {
string account_name = 1 [(gogoproto.moretags) = "json:\"accountName\" yaml:\"accountName\""];
repeated cosmos.base.v1beta1.Coin balance = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "json:\"balance\" yaml:\"balance\""
];
}
// QueryListNameRecordsRequest is request type for registry names records
message QueryListNameRecordsRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryListNameRecordsResponse is response type for registry names records
message QueryListNameRecordsResponse {
repeated NameEntry names = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryWhoisRequest is request type for Get NameAuthority
message QueryWhoisRequest {
string name = 1;
}
// QueryWhoisResponse is response type for whois request
message QueryWhoisResponse {
NameAuthority name_authority = 1
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"nameAuthority\" yaml:\"nameAuthority\""];
}
// QueryLookupCrn is request type for LookupCrn
message QueryLookupCrn {
string crn = 1;
}
// QueryLookupCrnResponse is response type for QueryLookupCrn
message QueryLookupCrnResponse {
NameRecord name = 1;
}
// QueryResolveCrn is request type for ResolveCrn
message QueryResolveCrn {
string crn = 1;
}
// QueryResolveCrnResponse is response type for QueryResolveCrn
message QueryResolveCrnResponse {
Record record = 1;
}
// QueryGetRecordExpiryQueue
message QueryGetRecordExpiryQueue {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryGetRecordExpiryQueueResponse
message QueryGetRecordExpiryQueueResponse {
repeated ExpiryQueueRecord records = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// ExpiryQueueRecord
message ExpiryQueueRecord {
string id = 1;
repeated string value = 2;
}
// QueryGetAuthorityExpiryQueue
message QueryGetAuthorityExpiryQueue {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryGetAuthorityExpiryQueueResponse
message QueryGetAuthorityExpiryQueueResponse {
repeated ExpiryQueueRecord authorities = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}