mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
136 lines
3.5 KiB
Protocol Buffer
136 lines
3.5 KiB
Protocol Buffer
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 parameters 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;
|
|
|
|
// Whitelisted Assets
|
|
repeated AssetInfo whitelisted_assets = 1;
|
|
|
|
// Whitelisted Blockchains
|
|
repeated ChainInfo whitelisted_chains = 2;
|
|
|
|
// Whitelisted Key Types
|
|
repeated KeyInfo allowed_public_keys = 3;
|
|
}
|
|
|
|
// AssetInfo defines the asset info
|
|
message AssetInfo {
|
|
string id = 1;
|
|
string denom = 2;
|
|
string symbol = 3;
|
|
string asset_type = 4;
|
|
string origin_chain = 5;
|
|
string origin_denom = 6;
|
|
int32 decimals = 7;
|
|
string description = 8;
|
|
string image_url = 9;
|
|
string coingecko_id = 10;
|
|
bool is_enabled = 11;
|
|
string ibc_path = 12;
|
|
string ibc_channel = 13;
|
|
string ibc_port = 14;
|
|
}
|
|
|
|
// ChainInfo defines the chain info
|
|
message ChainInfo {
|
|
string id = 1;
|
|
string chain_id = 2;
|
|
string name = 3;
|
|
string symbol = 4;
|
|
string bech32_prefix = 5;
|
|
string genesis_time = 6;
|
|
repeated Endpoint grpc_endpoints = 7;
|
|
repeated Endpoint rest_endpoints = 8;
|
|
ExplorerInfo explorer = 9;
|
|
FeeInfo fee_info = 10;
|
|
|
|
// Endpoint defines an endpoint
|
|
message Endpoint {
|
|
string url = 1;
|
|
bool is_primary = 2;
|
|
}
|
|
|
|
// ExplorerInfo defines the explorer info
|
|
message ExplorerInfo {
|
|
string name = 1;
|
|
string url = 2;
|
|
}
|
|
|
|
// FeeInfo defines a fee info
|
|
message FeeInfo {
|
|
string base_denom = 1;
|
|
repeated string fee_rates = 2;
|
|
int32 init_gas_limit = 3;
|
|
bool is_simulable = 4;
|
|
double gas_multiply = 5;
|
|
}
|
|
}
|
|
|
|
// KeyInfo defines information for accepted PubKey types
|
|
message KeyInfo {
|
|
KeyType kind = 1;
|
|
string algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K"
|
|
string curve = 3; // e.g., "P-256", "Ed25519", "secp256k1"
|
|
string encoding = 4; // e.g., "hex", "base64", "multibase"
|
|
}
|
|
|
|
// DIDNamespace define the different namespaces of DID
|
|
enum DIDNamespace {
|
|
DID_NAMESPACE_UNSPECIFIED = 0;
|
|
DID_NAMESPACE_IPFS = 1;
|
|
DID_NAMESPACE_SONR = 2;
|
|
DID_NAMESPACE_BITCOIN = 3;
|
|
DID_NAMESPACE_ETHEREUM = 4;
|
|
DID_NAMESPACE_IBC = 5;
|
|
}
|
|
|
|
// KeyKTind defines the kind of key
|
|
enum KeyType {
|
|
KEY_TYPE_UNSPECIFIED = 0;
|
|
|
|
// Blockchain key types
|
|
KEY_TYPE_SECP256K1 = 1; // cross-chain
|
|
KEY_TYPE_ED25519 = 2; // validators
|
|
KEY_TYPE_KECCAK = 3; // ethereum addresses
|
|
KEY_TYPE_BLS12381 = 4; // zero-knowledge
|
|
KEY_TYPE_X25519 = 5; // multisig
|
|
KEY_TYPE_SCHNORR = 6; // mpc
|
|
|
|
// Webauthn and FIDO key types
|
|
KEY_TYPE_WEBAUTHN = 7; // passkey authentication
|
|
KEY_TYPE_FIDO = 8; // fido2 authentication
|
|
}
|
|
|
|
// PermissionScope define the Capabilities Controllers can grant for Services
|
|
enum PermissionScope {
|
|
PERMISSION_SCOPE_UNSPECIFIED = 0;
|
|
PERMISSION_SCOPE_BASIC_INFO = 1;
|
|
PERMISSION_SCOPE_RECORDS_READ = 2;
|
|
PERMISSION_SCOPE_RECORDS_WRITE = 3;
|
|
PERMISSION_SCOPE_TRANSACTIONS_READ = 4;
|
|
PERMISSION_SCOPE_TRANSACTIONS_WRITE = 5;
|
|
PERMISSION_SCOPE_WALLETS_READ = 6;
|
|
PERMISSION_SCOPE_WALLETS_CREATE = 7;
|
|
PERMISSION_SCOPE_WALLETS_SUBSCRIBE = 8;
|
|
PERMISSION_SCOPE_WALLETS_UPDATE = 9;
|
|
PERMISSION_SCOPE_TRANSACTIONS_VERIFY = 10;
|
|
PERMISSION_SCOPE_TRANSACTIONS_BROADCAST = 11;
|
|
PERMISSION_SCOPE_ADMIN_USER = 12;
|
|
PERMISSION_SCOPE_ADMIN_VALIDATOR = 13;
|
|
}
|