mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
(no commit message provided)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
version: v1
|
||||
plugins:
|
||||
- name: gocosmos
|
||||
out: ..
|
||||
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mcosmos/orm/v1/orm.proto=cosmossdk.io/orm
|
||||
- name: grpc-gateway
|
||||
out: ..
|
||||
opt: logtostderr=true,allow_colon_final_segments=true
|
||||
@@ -0,0 +1,22 @@
|
||||
version: v1
|
||||
managed:
|
||||
enabled: true
|
||||
go_package_prefix:
|
||||
default: github.com/onsonr/hway/api
|
||||
except:
|
||||
- buf.build/googleapis/googleapis
|
||||
- buf.build/cosmos/gogo-proto
|
||||
- buf.build/cosmos/cosmos-proto
|
||||
override:
|
||||
buf.build/cosmos/cosmos-sdk: cosmossdk.io/api # required to import the Cosmos SDK api module for the orm
|
||||
plugins:
|
||||
- name: go-pulsar
|
||||
out: ..
|
||||
opt: paths=source_relative
|
||||
- name: go-grpc
|
||||
out: ..
|
||||
opt: paths=source_relative
|
||||
# go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest
|
||||
- name: go-cosmos-orm
|
||||
out: ..
|
||||
opt: paths=source_relative
|
||||
@@ -0,0 +1,18 @@
|
||||
version: v1
|
||||
name: buf.build/didao/sonr
|
||||
deps:
|
||||
- buf.build/cosmos/cosmos-sdk:9000fcc585a046c9881271d53dd40c34
|
||||
- buf.build/cosmos/cosmos-proto:1935555c206d4afb9e94615dfd0fad31
|
||||
- buf.build/cosmos/gogo-proto
|
||||
- buf.build/googleapis/googleapis
|
||||
lint:
|
||||
use:
|
||||
- DEFAULT
|
||||
- COMMENTS
|
||||
- FILE_LOWER_SNAKE_CASE
|
||||
except:
|
||||
- UNARY_RPC
|
||||
- COMMENT_FIELD
|
||||
- SERVICE_SUFFIX
|
||||
- PACKAGE_VERSION_SUFFIX
|
||||
- RPC_REQUEST_STANDARD_NAME
|
||||
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package didao.sonr.did.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/hway"
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// Copyright Tharsis Labs Ltd.(Evmos)
|
||||
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
|
||||
syntax = "proto3";
|
||||
package did.v1;
|
||||
|
||||
import "cosmos/auth/v1beta1/auth.proto";
|
||||
import "cosmos_proto/cosmos.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "did/v1/genesis.proto";
|
||||
|
||||
option go_package = "github.com/onsonr/hway/x/did/types";
|
||||
|
||||
// EthAccount implements the authtypes.AccountI interface and embeds an
|
||||
// authtypes.BaseAccount type. It is compatible with the auth AccountKeeper.
|
||||
message EthAccount {
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
option (gogoproto.goproto_stringer) = false;
|
||||
option (gogoproto.equal) = false;
|
||||
|
||||
option (cosmos_proto.implements_interface) = "github.com/cosmos/cosmos-sdk/x/auth/types.cosmos.auth.v1beta1.AccountI";
|
||||
|
||||
// base_account is an authtypes.BaseAccount
|
||||
cosmos.auth.v1beta1.BaseAccount base_account = 1
|
||||
[(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""];
|
||||
|
||||
// code_hash is the hash calculated from the code contents
|
||||
string code_hash = 2 [(gogoproto.moretags) = "yaml:\"code_hash\""];
|
||||
|
||||
// controller is the address of the controller
|
||||
string controller = 3 [(gogoproto.moretags) = "yaml:\"controller\""];
|
||||
}
|
||||
|
||||
// DIDDocument defines a DID document
|
||||
message DIDDocument {
|
||||
string id = 1;
|
||||
repeated VerificationMethod verification_methods = 2;
|
||||
repeated string authentication = 4;
|
||||
repeated string assertion_method = 5;
|
||||
repeated string capability_delegation = 7;
|
||||
repeated string capability_invocation = 8;
|
||||
}
|
||||
|
||||
// VerificationMethod defines a verification method
|
||||
message VerificationMethod {
|
||||
string id = 1;
|
||||
string controller = 2;
|
||||
PublicKey public_key = 3;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
syntax = "proto3";
|
||||
package did.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "amino/amino.proto";
|
||||
option go_package = "github.com/onsonr/hway/x/did/types";
|
||||
|
||||
// GenesisState defines the module genesis state
|
||||
message GenesisState {
|
||||
// Params defines all the paramaters of the module.
|
||||
Params params = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// Params defines the set of module parameters.
|
||||
message Params {
|
||||
option (amino.name) = "did/params";
|
||||
option (gogoproto.equal) = true;
|
||||
option (gogoproto.goproto_stringer) = false;
|
||||
|
||||
// Property Allowlist
|
||||
repeated string property_allowlist = 2;
|
||||
|
||||
// Whitelisted Verifications
|
||||
repeated string whitelisted_origins = 3;
|
||||
|
||||
// Assertion Reward Rate
|
||||
double assertion_reward_rate = 4;
|
||||
|
||||
// Encryption Reward Rate
|
||||
double encryption_reward_rate = 5;
|
||||
}
|
||||
|
||||
// PublicKey is the struct that represents a public key
|
||||
message PublicKey {
|
||||
option (amino.name) = "did/publickey";
|
||||
option (amino.message_encoding) = "key_field";
|
||||
option (gogoproto.goproto_stringer) = false;
|
||||
|
||||
// Key is the public key
|
||||
bytes key = 1;
|
||||
|
||||
// Type is the type of the public key
|
||||
string key_type = 2;
|
||||
|
||||
// DID is the DID of the public key
|
||||
string did = 3;
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
syntax = "proto3";
|
||||
package did.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "did/v1/genesis.proto";
|
||||
|
||||
option go_package = "github.com/onsonr/hway/x/did/types";
|
||||
|
||||
// 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 = "/did/params";
|
||||
}
|
||||
|
||||
// Exists queries if an id exists.
|
||||
rpc PropertyExists(QueryExistsRequest) returns (QueryExistsResponse) {
|
||||
option (google.api.http).get = "/did/exists/{kind}/{value}";
|
||||
}
|
||||
|
||||
// Resolve queries the DID document by its id.
|
||||
rpc ResolveIdentifier(QueryResolveRequest) returns (QueryResolveResponse) {
|
||||
option (google.api.http).get = "/did/resolve/{id}";
|
||||
}
|
||||
|
||||
// LoginOptions queries the PublicKeyCredentialAttestationOptions for starting a login flow.
|
||||
rpc LoginOptions(QueryLoginOptionsRequest) returns (QueryLoginOptionsResponse) {
|
||||
option (google.api.http).get = "/did/login/{origin}/{handle}/options";
|
||||
}
|
||||
|
||||
// RegisterOptions queries the PublicKeyCredentialCreationOptions for starting a register flow.
|
||||
rpc RegisterOptions(QueryRegisterOptionsRequest) returns (QueryRegisterOptionsResponse) {
|
||||
option (google.api.http).get = "/did/register/{origin}/{handle}/options";
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// QueryExistsRequest is the request type for the Query/Exists RPC method.
|
||||
message QueryExistsRequest {
|
||||
string kind = 1;
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
// QueryExistsResponse is the response type for the Query/Exists RPC method.
|
||||
message QueryExistsResponse {
|
||||
bool exists = 1;
|
||||
}
|
||||
|
||||
// QueryResolveRequest is the request type for the Query/Resolve RPC method.
|
||||
message QueryResolveRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// QueryResolveResponse is the response type for the Query/Resolve RPC method.
|
||||
message QueryResolveResponse {
|
||||
// document is the DID document
|
||||
string document = 1;
|
||||
}
|
||||
|
||||
// QueryLoginOptionsRequest is the request type for the Query/LoginOptions RPC method.
|
||||
message QueryLoginOptionsRequest {
|
||||
string origin = 1;
|
||||
string handle = 2;
|
||||
}
|
||||
|
||||
// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method.
|
||||
message QueryLoginOptionsResponse {
|
||||
// options is the PublicKeyCredentialAttestationOptions
|
||||
string options = 1;
|
||||
}
|
||||
|
||||
// QueryRegisterOptionsRequest is the request type for the Query/RegisterOptions RPC method.
|
||||
message QueryRegisterOptionsRequest {
|
||||
string origin = 1;
|
||||
string handle = 2;
|
||||
}
|
||||
|
||||
// QueryRegisterOptionsResponse is the response type for the Query/RegisterOptions RPC method.
|
||||
message QueryRegisterOptionsResponse {
|
||||
string options = 1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package did.v1;
|
||||
option go_package = "github.com/onsonr/hway/x/did/types";
|
||||
|
||||
import "cosmos/orm/v1/orm.proto";
|
||||
import "did/v1/genesis.proto";
|
||||
|
||||
// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone)
|
||||
message Attestation {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
id: 1
|
||||
primary_key: {fields: "id"}
|
||||
};
|
||||
|
||||
// The unique identifier of the attestation
|
||||
string id = 1;
|
||||
|
||||
// The type of the linked identifier (e.g., "crypto", "github", "email", "phone")
|
||||
string key_type = 2;
|
||||
|
||||
// The value of the linked identifier
|
||||
string value = 3;
|
||||
|
||||
// The proof or verification method for this attestation
|
||||
string proof = 4;
|
||||
|
||||
// The controller of the attestation
|
||||
string controller = 5;
|
||||
}
|
||||
|
||||
// Controller represents a Sonr DWN Vault
|
||||
message Controller {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
id: 2
|
||||
primary_key: {fields: "id"}
|
||||
};
|
||||
|
||||
// The unique identifier of the controller
|
||||
string id = 1;
|
||||
|
||||
// The DID of the controller
|
||||
string did = 2;
|
||||
|
||||
// The public key of the controller
|
||||
PublicKey public_key = 3;
|
||||
|
||||
// The vault address or identifier
|
||||
string vault_cid = 4;
|
||||
|
||||
// Fingerprint is the Accumulator of discrete credential identifiers
|
||||
bytes fingerprint = 5;
|
||||
}
|
||||
|
||||
// Delegation represents IBC Account Controllers for various chains (e.g., ETH, BTC)
|
||||
message Delegation {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
id: 3
|
||||
primary_key: {fields: "id"}
|
||||
};
|
||||
|
||||
// The unique identifier of the delegation
|
||||
string id = 1;
|
||||
|
||||
// The Decentralized Identifier of the delegated account
|
||||
string did = 2;
|
||||
|
||||
// The chain type (e.g., "ETH", "BTC")
|
||||
string chain_type = 3;
|
||||
|
||||
// The address on the target chain
|
||||
string chain_address = 4;
|
||||
|
||||
// The controller DID
|
||||
string controller_did = 5;
|
||||
|
||||
// The delegation proof or verification method
|
||||
PublicKey public_key = 6;
|
||||
|
||||
// IBC Channel ID
|
||||
uint64 channel_id = 7;
|
||||
}
|
||||
|
||||
// Service represents a service in a DID Document
|
||||
message Service {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
id: 4
|
||||
primary_key: {fields: "id"}
|
||||
};
|
||||
|
||||
// The ID of the service
|
||||
string id = 1;
|
||||
|
||||
// The type of the service
|
||||
string service_type = 2;
|
||||
|
||||
// The service endpoint
|
||||
string service_endpoint = 3;
|
||||
|
||||
// The controller DID of the service
|
||||
string controller_did = 4;
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package did.v1;
|
||||
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "did/v1/genesis.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos_proto/cosmos.proto";
|
||||
option go_package = "github.com/onsonr/hway/x/did/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);
|
||||
|
||||
// InitializeController initializes a controller with the given assertions, keyshares, and verifications.
|
||||
rpc InitializeController(MsgInitializeController) returns (MsgInitializeControllerResponse);
|
||||
|
||||
// AuthenticateController asserts the given controller is the owner of the given address.
|
||||
rpc AuthenticateController(MsgAuthenticateController) returns (MsgAuthenticateControllerResponse);
|
||||
}
|
||||
|
||||
// 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 {}
|
||||
|
||||
// MsgInitializeController is the message type for the InitializeController RPC.
|
||||
message MsgInitializeController {
|
||||
option (cosmos.msg.v1.signer) = "authority";
|
||||
|
||||
// authority is the address of the governance account.
|
||||
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
|
||||
// Assertions is the list of assertions to initialize the controller with.
|
||||
repeated bytes assertions = 2;
|
||||
|
||||
// Keyshares is the list of keyshares to initialize the controller with.
|
||||
repeated bytes keyshares = 3;
|
||||
|
||||
// Verifications is the list of verifications to initialize the controller with.
|
||||
repeated bytes verifications = 4;
|
||||
}
|
||||
|
||||
// MsgInitializeControllerResponse is the response type for the InitializeController RPC.
|
||||
message MsgInitializeControllerResponse {
|
||||
// Controller is the address of the initialized controller.
|
||||
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
}
|
||||
|
||||
// MsgAuthenticate is the message type for the Authenticate RPC.
|
||||
message MsgAuthenticateController {
|
||||
option (cosmos.msg.v1.signer) = "authority";
|
||||
|
||||
// authority is the address of the governance account.
|
||||
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
|
||||
// Controller is the address of the controller to authenticate.
|
||||
string controller = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
|
||||
// Address is the address to authenticate.
|
||||
string address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
|
||||
// Origin is the origin of the request in wildcard form.
|
||||
string origin = 4;
|
||||
}
|
||||
|
||||
// MsgAuthenticateControllerResponse is the response type for the Authenticate RPC.
|
||||
message MsgAuthenticateControllerResponse {}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package didao.sonr.oracle.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/hway"
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package oracle.v1;
|
||||
|
||||
option go_package = "github.com/onsonr/hway/x/oracle/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
// GenesisState defines the middlewares genesis state.
|
||||
message GenesisState {}
|
||||
@@ -0,0 +1,7 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package oracle.v1;
|
||||
|
||||
option go_package = "github.com/onsonr/hway/x/oracle/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
@@ -0,0 +1,7 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package oracle.v1;
|
||||
|
||||
option go_package = "github.com/onsonr/hway/x/oracle/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
Reference in New Issue
Block a user