syntax = "proto3"; package did.v1; import "did/v1/genesis.proto"; import "did/v1/models.proto"; import "google/api/annotations.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; // Query provides defines the gRPC querier service. service Query { // Params queries all parameters of the module. rpc Params(QueryRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/did/params"; } // Accounts returns associated wallet accounts with the DID. rpc Accounts(QueryRequest) returns (QueryAccountsResponse) { option (google.api.http).get = "/did/{did}/accounts"; } // Credentials returns associated credentials with the DID and Service Origin. rpc Credentials(QueryRequest) returns (QueryCredentialsResponse) { option (google.api.http).get = "/service/{origin}/{subject}/credentials"; } // Resolve queries the DID document by its id. rpc Resolve(QueryRequest) returns (QueryResolveResponse) { option (google.api.http).get = "/did/{did}"; } // Service returns associated ServiceInfo for a given Origin rpc Service(QueryRequest) returns (QueryServiceResponse) { option (google.api.http).get = "/service/{origin}"; } // Token returns the current authentication token for the client. rpc Token(QueryRequest) returns (QueryTokenResponse) { option (google.api.http).post = "/token"; } } // Queryequest is the request type for the Query/Params RPC method. message QueryRequest { string did = 1; string origin = 2; string subject = 3; repeated Credential credentials = 4; } // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // params defines the parameters of the module. Params params = 1; } // QueryAccountsResponse is the response type for the Query/Exists RPC method. message QueryAccountsResponse { bool exists = 1; } // QueryCredentialsResponse is the response type for the Query/Exists RPC method. message QueryCredentialsResponse { bool success = 1; string subject = 2; string origin = 3; repeated Credential credentials = 4; string error = 5; } // QueryResolveResponse is the response type for the Query/Resolve RPC method. message QueryResolveResponse { // document is the DID document Document document = 1; } // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. message QueryServiceResponse { Service service = 1; } // QueryTokenResponse is the response type for the Query/LoginOptions RPC method. message QueryTokenResponse { bool success = 1; Token token = 2; string error = 3; }