mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-05 10:51:41 +00:00
feature/1149 vault allocation error (#1173)
- **refactor: update devbox configuration and scripts** - **refactor: remove web documentation** - **refactor: move resolver formatter to services package** - **refactor: Rename x/vault -> x/dwn and x/service -> x/svc** - **refactor: remove unused dependencies and simplify module imports** - **refactor: remove dependency on DWN.pkl** - **refactor: Move IPFS interaction functions to common package** - **refactor: remove unused TUI components** - **feat: add gum package and update devbox configuration** - **refactor: rename Assertion to Account and update related code** - **fix: resolve rendering issue in login modal** - **refactor: migrate build system from Taskfile to Makefile** - **refactor: Deployment setup** - **refactor: Update Credential table to match WebAuthn Credential Descriptor** - **feat: add fast reflection methods for Capability and Resource** - **fix: update devbox lockfile** - **feat: add support for parent field and resources list in Capability message** - **feature/1149-vault-allocation-error** - **fix: adjust fullscreen modal close button margin**
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
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;
|
||||
}
|
||||
|
||||
// Capability reprensents the available capabilities of a decentralized web node
|
||||
message Capability {
|
||||
string name = 1;
|
||||
string parent = 2;
|
||||
string description = 3;
|
||||
repeated string resources = 4;
|
||||
}
|
||||
|
||||
// Resource reprensents the available resources of a decentralized web node
|
||||
message Resource {
|
||||
string kind = 1;
|
||||
string template = 2;
|
||||
}
|
||||
|
||||
// Schema is the Database Model for Decentralized Web Nodes
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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 Credential {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
id: 1;
|
||||
primary_key: { fields: "id" }
|
||||
};
|
||||
|
||||
bytes id = 1; // The credential ID as a byte array
|
||||
string kind = 2; // The credential type (e.g. "public-key")
|
||||
repeated string transports = 3; // Optional transport hints (usb, nfc, ble, internal)
|
||||
bytes public_key = 4; // The credential's public key
|
||||
string attestation_type = 5; // The attestation type used (e.g. "none", "indirect", etc)
|
||||
uint64 created_at = 6; // Timestamp of when the credential was created
|
||||
}
|
||||
|
||||
message Profile {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
id: 2;
|
||||
primary_key: { fields: "account" }
|
||||
index: { id: 1 fields: "amount" }
|
||||
};
|
||||
|
||||
bytes account = 1;
|
||||
uint64 amount = 2;
|
||||
}
|
||||
@@ -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 {}
|
||||
Reference in New Issue
Block a user