2024-07-05 22:20:13 -04:00
|
|
|
syntax = "proto3";
|
|
|
|
|
package did.v1;
|
|
|
|
|
|
|
|
|
|
import "did/v1/genesis.proto";
|
2024-08-31 12:49:44 -04:00
|
|
|
import "did/v1/models.proto";
|
2024-09-05 01:24:57 -04:00
|
|
|
import "google/api/annotations.proto";
|
2024-07-05 22:20:13 -04:00
|
|
|
|
2024-09-05 01:24:57 -04:00
|
|
|
option go_package = "github.com/onsonr/sonr/x/did/types";
|
2024-07-05 22:20:13 -04:00
|
|
|
|
|
|
|
|
// Query provides defines the gRPC querier service.
|
|
|
|
|
service Query {
|
2024-09-05 01:24:57 -04:00
|
|
|
// 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";
|
|
|
|
|
}
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
2024-09-05 01:24:57 -04:00
|
|
|
// 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;
|
|
|
|
|
}
|
2024-07-05 22:20:13 -04:00
|
|
|
|
|
|
|
|
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
|
|
|
|
message QueryParamsResponse {
|
|
|
|
|
// params defines the parameters of the module.
|
|
|
|
|
Params params = 1;
|
2024-09-06 11:10:21 -04:00
|
|
|
|
|
|
|
|
// ipfs_active returns true if the IPFS client is initialized
|
|
|
|
|
bool ipfs_active = 2;
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
2024-08-10 17:01:14 -04:00
|
|
|
// QueryAccountsResponse is the response type for the Query/Exists RPC method.
|
|
|
|
|
message QueryAccountsResponse {
|
2024-09-05 01:24:57 -04:00
|
|
|
bool exists = 1;
|
2024-08-10 17:01:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// QueryCredentialsResponse is the response type for the Query/Exists RPC method.
|
|
|
|
|
message QueryCredentialsResponse {
|
2024-09-05 01:24:57 -04:00
|
|
|
bool success = 1;
|
|
|
|
|
string subject = 2;
|
|
|
|
|
string origin = 3;
|
|
|
|
|
repeated Credential credentials = 4;
|
|
|
|
|
string error = 5;
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// QueryResolveResponse is the response type for the Query/Resolve RPC method.
|
|
|
|
|
message QueryResolveResponse {
|
2024-09-05 01:24:57 -04:00
|
|
|
// document is the DID document
|
|
|
|
|
Document document = 1;
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method.
|
2024-08-10 17:01:14 -04:00
|
|
|
message QueryServiceResponse {
|
2024-09-05 01:24:57 -04:00
|
|
|
Service service = 1;
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
2024-09-05 01:24:57 -04:00
|
|
|
// QueryTokenResponse is the response type for the Query/LoginOptions RPC method.
|
|
|
|
|
message QueryTokenResponse {
|
|
|
|
|
bool success = 1;
|
|
|
|
|
Token token = 2;
|
|
|
|
|
string error = 3;
|
|
|
|
|
}
|