refactor: Rename x/vault -> x/dwn and x/service -> x/svc

This commit is contained in:
Prad Nukala
2024-11-25 15:44:55 -05:00
parent 711acd6bb8
commit 629ef72954
112 changed files with 22252 additions and 2167 deletions
+13
View File
@@ -0,0 +1,13 @@
syntax = "proto3";
package dwn.module.v1;
import "cosmos/app/v1alpha1/module.proto";
// Module is the app config object of the module.
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import : "github.com/onsonr/sonr"
};
}
+37
View File
@@ -0,0 +1,37 @@
syntax = "proto3";
package dwn.v1;
import "gogoproto/gogo.proto";
import "amino/amino.proto";
option go_package = "github.com/onsonr/sonr/x/dwn/types";
// GenesisState defines the module genesis state
message GenesisState {
// Params defines all the parameters of the module.
Params params = 1 [(gogoproto.nullable) = false];
}
// Params defines the set of module parameters.
message Params {
option (amino.name) = "vault/params";
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
bool ipfs_active = 1;
bool local_registration_enabled = 2;
Schema schema = 4;
}
message Schema {
int32 version = 1;
string account = 2;
string asset = 3;
string chain = 4;
string credential = 5;
string did = 6;
string jwk = 7;
string grant = 8;
string keyshare = 9;
string profile = 10;
}
+90
View File
@@ -0,0 +1,90 @@
syntax = "proto3";
package dwn.v1;
import "google/api/annotations.proto";
import "dwn/v1/genesis.proto";
option go_package = "github.com/onsonr/sonr/x/dwn/types";
// ╭─────────────────────────────────────────────────────────╮
// │ RPC Query Service │
// ╰─────────────────────────────────────────────────────────╯
// Query provides defines the gRPC querier service.
service Query {
// Params queries all parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/vault/v1/params";
}
// Schema queries the DID document by its id. And returns the required PKL
// information
rpc Schema(QuerySchemaRequest) returns (QuerySchemaResponse) {
option (google.api.http).get = "/vault/v1/schema";
}
// Allocate initializes a Target Vault available for claims with a compatible
// Authentication mechanism. The default authentication mechanism is WebAuthn.
rpc Allocate(QueryAllocateRequest) returns (QueryAllocateResponse) {
option (google.api.http).get = "/vault/v1/allocate";
}
// Sync queries the DID document by its id. And returns the required PKL
// information
rpc Sync(QuerySyncRequest) returns (QuerySyncResponse) {
option (google.api.http).get = "/vault/v1/sync";
}
}
// ╭──────────────────────────────────────────────────────────╮
// │ RPC Query Messages │
// ╰──────────────────────────────────────────────────────────╯
// QueryParamsRequest is the request type for the Query/Params RPC method.
message QueryParamsRequest {}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
// params defines the parameters of the module.
Params params = 1;
}
// QuerySchemaRequest is the request type for the Query/Schema RPC method.
message QuerySchemaRequest {}
// QuerySchemaResponse is the response type for the Query/Schema RPC method.
message QuerySchemaResponse {
// Schema is the DID document.
Schema schema = 1;
}
// QueryAllocateRequest is the request type for the Allocate RPC method.
message QueryAllocateRequest {}
// AllocateResponse is the response type for the Allocate RPC method.
message QueryAllocateResponse {
bool success = 1;
string cid = 2;
string macaroon = 3;
string public_uri = 4;
int64 expiry_block = 5;
}
// SyncRequest is the request type for the Sync RPC method.
message QuerySyncRequest {
string did = 1;
}
// SyncResponse is the response type for the Sync RPC method.
message QuerySyncResponse {
bool success = 1;
// Schema is the DID document.
Schema schema = 2;
// Address is the address of the calling DID.
string address = 3;
// ChainID is the chain ID of the current network.
string chainID = 4;
}
+19
View File
@@ -0,0 +1,19 @@
syntax = "proto3";
package dwn.v1;
import "cosmos/orm/v1/orm.proto";
option go_package = "github.com/onsonr/sonr/x/dwn/types";
// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md
message ExampleData {
option (cosmos.orm.v1.table) = {
id: 1;
primary_key: { fields: "account" }
index: { id: 1 fields: "amount" }
};
bytes account = 1;
uint64 amount = 2;
}
+65
View File
@@ -0,0 +1,65 @@
syntax = "proto3";
package dwn.v1;
import "cosmos/msg/v1/msg.proto";
import "dwn/v1/genesis.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
option go_package = "github.com/onsonr/sonr/x/dwn/types";
// Msg defines the Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;
// UpdateParams defines a governance operation for updating the parameters.
//
// Since: cosmos-sdk 0.47
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
// Initialize spawns a new Vault
rpc Initialize(MsgInitialize) returns (MsgInitializeResponse);
}
// MsgUpdateParams is the Msg/UpdateParams request type.
//
// Since: cosmos-sdk 0.47
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// params defines the parameters to update.
//
// NOTE: All parameters must be supplied.
Params params = 2 [(gogoproto.nullable) = false];
}
// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
//
// Since: cosmos-sdk 0.47
message MsgUpdateParamsResponse {}
// MsgInitialize spawns a New Vault with Unclaimed State. This is a one-time
// operation that must be performed interacting with the Vault.
//
// Since: cosmos-sdk 0.47
message MsgInitialize {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// params defines the parameters to update.
//
// NOTE: All parameters must be supplied.
Params params = 2 [(gogoproto.nullable) = false];
}
// MsgInitializeResponse defines the response structure for executing a
// MsgInitialize message.
//
// Since: cosmos-sdk 0.47
message MsgInitializeResponse {}