feat(did): remove unused proto files

This commit is contained in:
Prad Nukala 2024-09-14 14:46:09 -04:00
parent 001000da14
commit 8f234dc561
13 changed files with 34 additions and 5800 deletions

View File

@ -9,7 +9,6 @@
"ipfs-cluster@latest",
"air@latest"
],
"packages": ["go@1.21"],
"env": {
"GOPATH": "$HOME/go",
"PATH": "$HOME/go/bin:$PATH",
@ -49,13 +48,6 @@
"testnet": [
"devbox services up"
]
"install": ["make install"],
"gen": ["make proto-gen"],
"build": [
"make local-image",
"docker tag sonr:local ghcr.io/onsonr/sonrd:latest"
],
"push": ["docker push ghcr.io/onsonr/sonrd:latest"]
}
}
}

View File

@ -1,4 +0,0 @@
syntax = "proto3";
package did.v1;
option go_package = "github.com/onsonr/hway/x/did/types";

View File

@ -1,24 +0,0 @@
syntax = "proto3";
package did.v1;
import "gogoproto/gogo.proto";
import "amino/amino.proto";
option go_package = "github.com/onsonr/hway/x/did/types";
// PermissionScope define the Capabilities Controllers can grant for Services
enum PermissionScope {
PERMISSION_SCOPE_UNSPECIFIED = 0;
PERMISSION_SCOPE_PROFILE_NAME = 1;
PERMISSION_SCOPE_IDENTIFIERS_EMAIL = 2;
PERMISSION_SCOPE_IDENTIFIERS_PHONE = 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;
}

View File

@ -5,9 +5,6 @@ import "amino/amino.proto";
import "gogoproto/gogo.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
import "did/v1/types.proto";
option go_package = "github.com/onsonr/hway/x/did/types";
// GenesisState defines the module genesis state
message GenesisState {
@ -81,47 +78,6 @@ message KeyInfo {
KeyType type = 5; // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC"
}
// ValidatorInfo defines information for accepted Validator nodes
message ValidatorInfo {
string moniker = 1;
repeated Endpoint grpc_endpoints = 2;
repeated Endpoint rest_endpoints = 3;
ExplorerInfo explorer = 4;
FeeInfo fee_info = 5;
IBCChannel ibc_channel = 6;
// 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;
}
// IBCChannel defines the IBC channel info
message IBCChannel {
string id = 1;
string port = 2;
}
}
//
// [Constant Enumerations]
//
// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified
enum AssetType {
ASSET_TYPE_UNSPECIFIED = 0;
@ -226,4 +182,3 @@ enum PermissionScope {
PERMISSION_SCOPE_ADMIN_USER = 12;
PERMISSION_SCOPE_ADMIN_VALIDATOR = 13;
}

View File

@ -4,7 +4,6 @@ package did.v1;
import "did/v1/genesis.proto";
import "did/v1/models.proto";
import "google/api/annotations.proto";
import "did/v1/types.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
@ -16,39 +15,34 @@ service Query {
}
// ParamsAssets queries all parameters of the module.
rpc ParamsAssets(QueryRequest) returns (QueryResponse) {
rpc ParamsAssets(QueryRequest) returns (QueryParamsAssetsResponse) {
option (google.api.http).get = "/params/assets";
}
// Params queries all parameters of the module.
rpc ParamsByAsset(QueryRequest) returns (QueryResponse) {
rpc ParamsByAsset(QueryRequest) returns (QueryParamsByAssetResponse) {
option (google.api.http).get = "/params/assets/{asset}";
}
// ParamsKeys queries all parameters of the module.
rpc ParamsKeys(QueryRequest) returns (QueryResponse) {
rpc ParamsKeys(QueryRequest) returns (QueryParamsKeysResponse) {
option (google.api.http).get = "/params/keys";
}
// Params queries all parameters of the module.
rpc ParamsByKey(QueryRequest) returns (QueryResponse) {
rpc ParamsByKey(QueryRequest) returns (QueryParamsByKeyResponse) {
option (google.api.http).get = "/params/keys/{key}";
}
// Params queries all parameters of the module.
rpc RegistrationOptionsByKey(QueryRequest) returns (QueryResponse) {
option (google.api.http).get = "/params/keys/{key}/registration";
}
// Resolve queries the DID document by its id.
rpc Resolve(QueryRequest) returns (QueryResponse) {
rpc Resolve(QueryRequest) returns (QueryResolveResponse) {
option (google.api.http).get = "/did/{did}";
}
// Service returns associated ServiceInfo for a given Origin
// if the servie is not found, a fingerprint is generated to be used
// as a TXT record in DNS. v=sonr, o=origin, p=protocol
rpc Service(QueryRequest) returns (QueryResponse) {
rpc Service(QueryRequest) returns (QueryServiceResponse) {
option (google.api.http).get = "/service/{origin}";
}
}
@ -66,104 +60,21 @@ message QueryResponse {
bool success = 1;
string query = 2;
Document document = 3;
ServiceInfo service = 4;
Params params = 5;
}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
Params params = 1;
}
message QueryParamsAssetsResponse {
repeated AssetInfo assets = 1;
// Accounts returns associated wallet accounts with the DID.
rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) {
option (google.api.http).get = "/did/{did}/accounts";
}
// Credentials returns associated credentials with the DID and Service Origin.
rpc Credentials(QueryCredentialsRequest) returns (QueryCredentialsResponse) {
option (google.api.http).get = "/did/{did}/{origin}/credentials";
}
// Identities returns associated identity with the DID.
rpc Identities(QueryIdentitiesRequest) returns (QueryIdentitiesResponse) {
option (google.api.http).get = "/did/{did}/identities";
}
// Resolve queries the DID document by its id.
rpc Resolve(QueryResolveRequest) returns (QueryResolveResponse) {
option (google.api.http).get = "/did/resolve/{did}";
}
// Service returns associated ServiceInfo for a given Origin
rpc Service(QueryServiceRequest) returns (QueryServiceResponse) {
option (google.api.http).get = "/did/service/{origin}";
}
}
// 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;
}
// QueryAccountsRequest is the request type for the Query/Exists RPC method.
message QueryAccountsRequest {
string did = 1;
message QueryParamsAssetsResponse {
repeated AssetInfo assets = 1;
}
// QueryAccountsResponse is the response type for the Query/Exists RPC method.
message QueryAccountsResponse {
bool exists = 1;
}
// QueryCredentialsRequest is the request type for the Query/Exists RPC method.
message QueryCredentialsRequest {
string did = 1;
string origin = 2;
}
// QueryCredentialsResponse is the response type for the Query/Exists RPC method.
message QueryCredentialsResponse {
map<string, bytes> credentials = 1;
}
// QueryIdentitiesRequest is the request type for the Query/Exists RPC method.
message QueryIdentitiesRequest {
string did = 1;
}
// QueryIdentitiesResponse is the response type for the Query/Exists RPC method.
message QueryIdentitiesResponse {
bool exists = 1;
repeated VerificationMethod verificationMethod = 2;
}
// QueryResolveRequest is the request type for the Query/Resolve RPC method.
message QueryResolveRequest {
string did = 1;
}
// QueryResolveResponse is the response type for the Query/Resolve RPC method.
message QueryResolveResponse {
// document is the DID document
Document document = 1;
}
// QueryServiceRequest is the request type for the Query/LoginOptions RPC method.
message QueryServiceRequest {
string origin = 1;
}
// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method.
message QueryServiceResponse {
// options is the PublicKeyCredentialAttestationOptions
string options = 1;
message QueryParamsByAssetResponse {
AssetInfo asset = 1;
}
message QueryParamsKeysResponse {
@ -174,10 +85,16 @@ message QueryParamsByKeyResponse {
KeyInfo key = 1;
}
message QueryParamsByAssetResponse {
AssetInfo asset = 1;
// QueryResolveResponse is the response type for the Query/Resolve RPC method.
message QueryResolveResponse {
// document is the DID document
Document document = 1;
}
message QueryRegistrationOptionsByKeyResponse {
repeated string registration_options = 1;
// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method.
message QueryServiceResponse {
// options is the PublicKeyCredentialAttestationOptions
bool existing = 1;
ServiceInfo service = 2;
string txt_record = 3;
}

View File

@ -3,9 +3,9 @@ syntax = "proto3";
package did.v1;
import "cosmos/orm/v1/orm.proto";
import "did/v1/enums.proto";
import "did/v1/genesis.proto";
import "did/v1/models.proto";
import "did/v1/enums.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
@ -29,7 +29,11 @@ message Account {
fields: "controller,chain_code,index"
unique: true
}
index: { id: 1, fields: "subject", unique: true }
index: {
id: 1
fields: "subject"
unique: true
}
};
// The unique identifier of the alias
@ -216,14 +220,4 @@ message VerificationMethod {
// The public key of the verification
PubKey public_key = 6;
// The controller DID of the service
string controller_did = 3;
// The domain name of the service
string origin_uri = 4;
// The service endpoint
map<string, string> service_endpoints = 5;
// Scopes is the Authorization Grants of the service
repeated PermissionScope scopes = 6;
}

View File

@ -3,10 +3,8 @@ syntax = "proto3";
package did.v1;
import "cosmos/msg/v1/msg.proto";
import "did/v1/enums.proto";
import "did/v1/genesis.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "did/v1/enums.proto";
import "did/v1/genesis.proto";
import "did/v1/models.proto";
import "gogoproto/gogo.proto";
@ -34,20 +32,6 @@ service Msg {
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse);
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse);
// Authenticate asserts the given controller is the owner of the given address.
rpc Authenticate(MsgAuthenticate) returns (MsgAuthenticateResponse);
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators.
rpc ProveWitness(MsgProveWitness) returns (MsgProveWitnessResponse);
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
rpc SyncVault(MsgSyncVault) returns (MsgSyncVaultResponse);
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse);
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse);
}
@ -103,32 +87,6 @@ message MsgAllocateVaultResponse {
bool localhost = 4;
}
// MsgProveWitness is the message type for the ProveWitness RPC.
message MsgProveWitness {
option (cosmos.msg.v1.signer) = "authority";
// MsgAuthenticate is the message type for the Authenticate RPC.
message MsgAuthenticate {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// property is key to prove.
string property = 2;
// Witness Value is the bytes of the witness.
bytes witness = 3;
// token is the macron token to authenticate the operation.
string token = 4;
}
// MsgProveWitnessResponse is the response type for the ProveWitness RPC.
message MsgProveWitnessResponse {
bool success = 1;
string property = 2;
}
// MsgSyncController is the message type for the SyncController RPC.
message MsgSyncController {
option (cosmos.msg.v1.signer) = "controller";
@ -145,58 +103,6 @@ message MsgSyncControllerResponse {
bool success = 1;
}
// MsgRegisterController is the message type for the InitializeController RPC.
message MsgRegisterController {
// MsgAuthenticateResponse is the response type for the Authenticate RPC.
message MsgAuthenticateResponse {}
// MsgProveWitness is the message type for the ProveWitness RPC.
message MsgProveWitness {
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.
string cid = 2;
// Origin is the origin of the request in wildcard form.
string origin = 3;
// Credential is the list of keyshares to initialize the controller with.
string credential_creation_response = 4;
// property is key to prove.
string property = 2;
// Witness Value is the bytes of the witness.
bytes witness = 3;
}
// MsgProveWitnessResponse is the response type for the ProveWitness RPC.
message MsgProveWitnessResponse {
bool success = 1;
string property = 2;
}
// MsgSyncVault is the message type for the SyncVault RPC.
message MsgSyncVault {
option (cosmos.msg.v1.signer) = "controller";
// controller is the address of the controller to sync.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// cid is the IPFS content identifier.
string cid = 2;
// Macroon is the public token to authenticate the operation.
bytes macron = 3;
}
// MsgSyncVaultResponse is the response type for the SyncVault RPC.
message MsgSyncVaultResponse {
bool success = 1;
}
// MsgRegisterController is the message type for the InitializeController RPC.
message MsgRegisterController {
option (cosmos.msg.v1.signer) = "authority";
@ -247,11 +153,6 @@ message MsgAuthorizeService {
message MsgAuthorizeServiceResponse {
bool success = 1;
string token = 2;
// Controller is the address of the initialized controller.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Accounts are a Address Map and Supported coin Denoms for the controller
map<string, string> accounts = 2;
}
// MsgRegisterService is the message type for the RegisterService RPC.
@ -263,19 +164,6 @@ message MsgRegisterService {
// origin is the origin of the request in wildcard form. Requires valid TXT record in DNS.
Service service = 2;
// token is the macron token to authenticate the operation.
string token = 3;
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// origin is the origin of the request in wildcard form.
string origin_uri = 2;
// PermissionScope is the scope of the service.
repeated PermissionScope scopes = 3;
}
// MsgRegisterServiceResponse is the response type for the RegisterService RPC.

View File

@ -1,114 +0,0 @@
syntax = "proto3";
package did.v1;
import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
option go_package = "github.com/onsonr/hway/x/did/types";
// 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;
}
// Credential defines a WebAuthn credential
message Credential {
string id = 1;
string credential_type = 2;
bytes credential_id = 3;
repeated string transport = 4;
string attestation_type = 5;
string display_name = 6;
string controller = 7;
}
// Document defines a DID document
message Document {
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;
}
// 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;
}
// Identity defines an associated profile for a did subject
message Identity {
string id = 1;
string subject = 2;
string controller = 3;
repeated Credential credentials = 4;
repeated VerificationMethod verification_methods = 5;
}
// PubKey defines a public key for a did
message PubKey {
string id = 1;
bytes key = 2;
string key_type = 3;
string controller = 4;
}
// VerificationMethod defines a verification method
message VerificationMethod {
string id = 1;
string controller = 2;
// The delegation proof or verification method
string public_key_multibase = 3;
// Public Key JWKS is a map of the associated public keys
map<string, string> public_key_jwks = 4;
}

View File

@ -1,634 +0,0 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: did/v1/accounts.proto
package types
import (
fmt "fmt"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type BtcAccount struct {
}
func (m *BtcAccount) Reset() { *m = BtcAccount{} }
func (m *BtcAccount) String() string { return proto.CompactTextString(m) }
func (*BtcAccount) ProtoMessage() {}
func (*BtcAccount) Descriptor() ([]byte, []int) {
return fileDescriptor_2125a09fb14c3bc3, []int{0}
}
func (m *BtcAccount) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *BtcAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_BtcAccount.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *BtcAccount) XXX_Merge(src proto.Message) {
xxx_messageInfo_BtcAccount.Merge(m, src)
}
func (m *BtcAccount) XXX_Size() int {
return m.Size()
}
func (m *BtcAccount) XXX_DiscardUnknown() {
xxx_messageInfo_BtcAccount.DiscardUnknown(m)
}
var xxx_messageInfo_BtcAccount proto.InternalMessageInfo
type EthAccount struct {
}
func (m *EthAccount) Reset() { *m = EthAccount{} }
func (m *EthAccount) String() string { return proto.CompactTextString(m) }
func (*EthAccount) ProtoMessage() {}
func (*EthAccount) Descriptor() ([]byte, []int) {
return fileDescriptor_2125a09fb14c3bc3, []int{1}
}
func (m *EthAccount) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *EthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_EthAccount.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *EthAccount) XXX_Merge(src proto.Message) {
xxx_messageInfo_EthAccount.Merge(m, src)
}
func (m *EthAccount) XXX_Size() int {
return m.Size()
}
func (m *EthAccount) XXX_DiscardUnknown() {
xxx_messageInfo_EthAccount.DiscardUnknown(m)
}
var xxx_messageInfo_EthAccount proto.InternalMessageInfo
type IBCAccount struct {
}
func (m *IBCAccount) Reset() { *m = IBCAccount{} }
func (m *IBCAccount) String() string { return proto.CompactTextString(m) }
func (*IBCAccount) ProtoMessage() {}
func (*IBCAccount) Descriptor() ([]byte, []int) {
return fileDescriptor_2125a09fb14c3bc3, []int{2}
}
func (m *IBCAccount) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *IBCAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_IBCAccount.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *IBCAccount) XXX_Merge(src proto.Message) {
xxx_messageInfo_IBCAccount.Merge(m, src)
}
func (m *IBCAccount) XXX_Size() int {
return m.Size()
}
func (m *IBCAccount) XXX_DiscardUnknown() {
xxx_messageInfo_IBCAccount.DiscardUnknown(m)
}
var xxx_messageInfo_IBCAccount proto.InternalMessageInfo
type SnrAccount struct {
}
func (m *SnrAccount) Reset() { *m = SnrAccount{} }
func (m *SnrAccount) String() string { return proto.CompactTextString(m) }
func (*SnrAccount) ProtoMessage() {}
func (*SnrAccount) Descriptor() ([]byte, []int) {
return fileDescriptor_2125a09fb14c3bc3, []int{3}
}
func (m *SnrAccount) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SnrAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SnrAccount.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *SnrAccount) XXX_Merge(src proto.Message) {
xxx_messageInfo_SnrAccount.Merge(m, src)
}
func (m *SnrAccount) XXX_Size() int {
return m.Size()
}
func (m *SnrAccount) XXX_DiscardUnknown() {
xxx_messageInfo_SnrAccount.DiscardUnknown(m)
}
var xxx_messageInfo_SnrAccount proto.InternalMessageInfo
func init() {
proto.RegisterType((*BtcAccount)(nil), "did.v1.BtcAccount")
proto.RegisterType((*EthAccount)(nil), "did.v1.EthAccount")
proto.RegisterType((*IBCAccount)(nil), "did.v1.IBCAccount")
proto.RegisterType((*SnrAccount)(nil), "did.v1.SnrAccount")
}
func init() { proto.RegisterFile("did/v1/accounts.proto", fileDescriptor_2125a09fb14c3bc3) }
var fileDescriptor_2125a09fb14c3bc3 = []byte{
// 145 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0xc9, 0x4c, 0xd1,
0x2f, 0x33, 0xd4, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f,
0xc9, 0x17, 0x62, 0x4b, 0xc9, 0x4c, 0xd1, 0x2b, 0x33, 0x54, 0xe2, 0xe1, 0xe2, 0x72, 0x2a, 0x49,
0x76, 0x84, 0x48, 0x82, 0x78, 0xae, 0x25, 0x19, 0x48, 0x3c, 0x4f, 0x27, 0x67, 0x24, 0x5e, 0x70,
0x5e, 0x11, 0x94, 0xe7, 0x64, 0x73, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e,
0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51,
0x4a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x79, 0xc5, 0xf9,
0x79, 0x45, 0xfa, 0x60, 0xa2, 0x42, 0x1f, 0xe4, 0x92, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36,
0xb0, 0x23, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x82, 0x7e, 0x89, 0x0a, 0x9d, 0x00, 0x00,
0x00,
}
func (m *BtcAccount) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *BtcAccount) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *BtcAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
return len(dAtA) - i, nil
}
func (m *EthAccount) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *EthAccount) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
return len(dAtA) - i, nil
}
func (m *IBCAccount) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *IBCAccount) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *IBCAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
return len(dAtA) - i, nil
}
func (m *SnrAccount) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *SnrAccount) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SnrAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
return len(dAtA) - i, nil
}
func encodeVarintAccounts(dAtA []byte, offset int, v uint64) int {
offset -= sovAccounts(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *BtcAccount) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
return n
}
func (m *EthAccount) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
return n
}
func (m *IBCAccount) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
return n
}
func (m *SnrAccount) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
return n
}
func sovAccounts(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozAccounts(x uint64) (n int) {
return sovAccounts(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *BtcAccount) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAccounts
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: BtcAccount: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: BtcAccount: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipAccounts(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthAccounts
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *EthAccount) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAccounts
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: EthAccount: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: EthAccount: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipAccounts(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthAccounts
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *IBCAccount) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAccounts
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: IBCAccount: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: IBCAccount: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipAccounts(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthAccounts
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SnrAccount) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAccounts
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: SnrAccount: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SnrAccount: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipAccounts(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthAccounts
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipAccounts(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAccounts
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAccounts
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAccounts
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthAccounts
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupAccounts
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthAccounts
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthAccounts = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowAccounts = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupAccounts = fmt.Errorf("proto: unexpected end of group")
)
func init() { proto.RegisterFile("did/v1/accounts.proto", fileDescriptor_2125a09fb14c3bc3) }
var fileDescriptor_2125a09fb14c3bc3 = []byte{
// 122 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0xc9, 0x4c, 0xd1,
0x2f, 0x33, 0xd4, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f,
0xc9, 0x17, 0x62, 0x4b, 0xc9, 0x4c, 0xd1, 0x2b, 0x33, 0x74, 0xb2, 0x39, 0xf1, 0x48, 0x8e, 0xf1,
0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e,
0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc,
0x5c, 0xfd, 0xfc, 0xbc, 0xe2, 0xfc, 0xbc, 0x22, 0xfd, 0x8c, 0xf2, 0xc4, 0x4a, 0xfd, 0x0a, 0x7d,
0x90, 0x89, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xc3, 0x8c, 0x01, 0x01, 0x00, 0x00,
0xff, 0xff, 0x28, 0xd1, 0x54, 0x54, 0x65, 0x00, 0x00, 0x00,
}

View File

@ -1,120 +0,0 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: did/v1/enums.proto
package types
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// PermissionScope define the Capabilities Controllers can grant for Services
type PermissionScope int32
const (
PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0
PermissionScope_PERMISSION_SCOPE_PROFILE_NAME PermissionScope = 1
PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_EMAIL PermissionScope = 2
PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_PHONE PermissionScope = 3
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5
PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6
PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7
PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8
PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11
PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12
PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13
)
var PermissionScope_name = map[int32]string{
0: "PERMISSION_SCOPE_UNSPECIFIED",
1: "PERMISSION_SCOPE_PROFILE_NAME",
2: "PERMISSION_SCOPE_IDENTIFIERS_EMAIL",
3: "PERMISSION_SCOPE_IDENTIFIERS_PHONE",
4: "PERMISSION_SCOPE_TRANSACTIONS_READ",
5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE",
6: "PERMISSION_SCOPE_WALLETS_READ",
7: "PERMISSION_SCOPE_WALLETS_CREATE",
8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE",
9: "PERMISSION_SCOPE_WALLETS_UPDATE",
10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY",
11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST",
12: "PERMISSION_SCOPE_ADMIN_USER",
13: "PERMISSION_SCOPE_ADMIN_VALIDATOR",
}
var PermissionScope_value = map[string]int32{
"PERMISSION_SCOPE_UNSPECIFIED": 0,
"PERMISSION_SCOPE_PROFILE_NAME": 1,
"PERMISSION_SCOPE_IDENTIFIERS_EMAIL": 2,
"PERMISSION_SCOPE_IDENTIFIERS_PHONE": 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,
}
func (x PermissionScope) String() string {
return proto.EnumName(PermissionScope_name, int32(x))
}
func (PermissionScope) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_001c58538597e328, []int{0}
}
func init() {
proto.RegisterEnum("did.v1.PermissionScope", PermissionScope_name, PermissionScope_value)
}
func init() { proto.RegisterFile("did/v1/enums.proto", fileDescriptor_001c58538597e328) }
var fileDescriptor_001c58538597e328 = []byte{
// 388 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0xd2, 0xc1, 0x6e, 0xd3, 0x30,
0x18, 0x07, 0xf0, 0x04, 0x46, 0x01, 0x03, 0xc2, 0x58, 0x9c, 0x06, 0x64, 0x63, 0x9b, 0x18, 0x02,
0xa9, 0xd6, 0xc4, 0x95, 0x8b, 0x93, 0x7c, 0x15, 0x96, 0x12, 0x27, 0xb2, 0x9d, 0x4d, 0x70, 0x89,
0xd6, 0x26, 0x6a, 0x73, 0x48, 0x5c, 0x35, 0x6d, 0xa1, 0x6f, 0xc1, 0x73, 0xf0, 0x24, 0x1c, 0x7b,
0xe4, 0x88, 0xda, 0x17, 0x41, 0x69, 0xe1, 0xd4, 0x36, 0x5c, 0x2c, 0xeb, 0xf3, 0x4f, 0x7f, 0x7d,
0x96, 0xfe, 0x88, 0x64, 0x45, 0x46, 0xe7, 0x57, 0x34, 0xaf, 0x66, 0x65, 0xdd, 0x1d, 0x4f, 0xcc,
0xd4, 0x90, 0x4e, 0x56, 0x64, 0xdd, 0xf9, 0xd5, 0xf1, 0xf3, 0xa1, 0x19, 0x9a, 0xcd, 0x88, 0x36,
0xb7, 0xed, 0xeb, 0xf1, 0xb3, 0xdb, 0xb2, 0xa8, 0x0c, 0xdd, 0x9c, 0xdb, 0xd1, 0xbb, 0x1f, 0x47,
0xe8, 0x69, 0x9c, 0x4f, 0xca, 0xa2, 0xae, 0x0b, 0x53, 0xa9, 0x81, 0x19, 0xe7, 0xe4, 0x14, 0xbd,
0x8c, 0x41, 0x86, 0x5c, 0x29, 0x1e, 0x89, 0x54, 0x79, 0x51, 0x0c, 0x69, 0x22, 0x54, 0x0c, 0x1e,
0xef, 0x71, 0xf0, 0xb1, 0x45, 0x5e, 0xa3, 0x57, 0x3b, 0x22, 0x96, 0x51, 0x8f, 0x07, 0x90, 0x0a,
0x16, 0x02, 0xb6, 0xc9, 0x1b, 0x74, 0xb6, 0x43, 0xb8, 0x0f, 0x42, 0x37, 0x19, 0x52, 0xa5, 0x10,
0x32, 0x1e, 0xe0, 0x3b, 0xff, 0x75, 0xf1, 0xa7, 0x48, 0x00, 0xbe, 0xbb, 0xd7, 0x69, 0xc9, 0x84,
0x62, 0x9e, 0xe6, 0x91, 0x50, 0xa9, 0x04, 0xe6, 0xe3, 0x23, 0x72, 0x89, 0xce, 0xdb, 0xdd, 0x8d,
0xe4, 0x1a, 0xf0, 0xbd, 0xbd, 0x7f, 0xb8, 0x61, 0x41, 0x00, 0xfa, 0x6f, 0x56, 0x87, 0x9c, 0xa3,
0x93, 0x83, 0xc4, 0x93, 0xc0, 0x34, 0xe0, 0xfb, 0x7b, 0x17, 0xfb, 0x87, 0x54, 0xe2, 0x2a, 0x4f,
0x72, 0x17, 0xf0, 0x83, 0xd6, 0xb0, 0x24, 0xf6, 0x9b, 0xb0, 0x87, 0xe4, 0x2d, 0xba, 0x68, 0xdf,
0xfe, 0x1a, 0x24, 0xef, 0x7d, 0xc6, 0x88, 0xbc, 0x47, 0x97, 0xed, 0xd2, 0x95, 0x11, 0xf3, 0x3d,
0xa6, 0x34, 0x7e, 0x44, 0x4e, 0xd0, 0x8b, 0x1d, 0xcc, 0xfc, 0x90, 0x8b, 0x34, 0x51, 0x20, 0xf1,
0x63, 0x72, 0x81, 0x4e, 0x0f, 0x80, 0x6b, 0x16, 0x70, 0x9f, 0xe9, 0x48, 0xe2, 0x27, 0xee, 0xc7,
0x9f, 0x2b, 0xc7, 0x5e, 0xae, 0x1c, 0xfb, 0xf7, 0xca, 0xb1, 0xbf, 0xaf, 0x1d, 0x6b, 0xb9, 0x76,
0xac, 0x5f, 0x6b, 0xc7, 0xfa, 0x72, 0x36, 0x2c, 0xa6, 0xa3, 0x59, 0xbf, 0x3b, 0x30, 0x25, 0x35,
0x55, 0x6d, 0xaa, 0x09, 0x1d, 0x7d, 0xbd, 0x5d, 0xd0, 0x6f, 0xb4, 0x29, 0xe9, 0x74, 0x31, 0xce,
0xeb, 0x7e, 0x67, 0xd3, 0xb8, 0x0f, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x1a, 0xa8, 0xd9,
0xb8, 0x02, 0x00, 0x00,
}

View File

@ -1,53 +0,0 @@
package types
import "gopkg.in/macaroon-bakery.v2/bakery/checkers"
var (
PermissionScopeStrings = [...]string{
"profile.name",
"identifiers.email",
"identifiers.phone",
"transactions.read",
"transactions.write",
"wallets.read",
"wallets.create",
"wallets.subscribe",
"wallets.update",
"transactions.verify",
"transactions.broadcast",
"admin.user",
"admin.validator",
}
StringToPermissionScope = map[string]PermissionScope{
"PERMISSION_SCOPE_UNSPECIFIED": PermissionScope_PERMISSION_SCOPE_UNSPECIFIED,
"PERMISSION_SCOPE_BASIC_INFO": PermissionScope_PERMISSION_SCOPE_BASIC_INFO,
"PERMISSION_SCOPE_IDENTIFIERS_EMAIL": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ,
"PERMISSION_SCOPE_IDENTIFIERS_PHONE": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE,
"PERMISSION_SCOPE_TRANSACTIONS_READ": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ,
"PERMISSION_SCOPE_TRANSACTIONS_WRITE": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE,
"PERMISSION_SCOPE_WALLETS_READ": PermissionScope_PERMISSION_SCOPE_WALLETS_READ,
"PERMISSION_SCOPE_WALLETS_CREATE": PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE,
"PERMISSION_SCOPE_WALLETS_SUBSCRIBE": PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE,
"PERMISSION_SCOPE_WALLETS_UPDATE": PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE,
"PERMISSION_SCOPE_TRANSACTIONS_VERIFY": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY,
"PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST,
"PERMISSION_SCOPE_ADMIN_USER": PermissionScope_PERMISSION_SCOPE_ADMIN_USER,
"PERMISSION_SCOPE_ADMIN_VALIDATOR": PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR,
}
)
func ResolvePermissionScope(scope string) (PermissionScope, bool) {
uriToPrefix := make(map[string]string)
for _, scope := range PermissionScopeStrings {
uriToPrefix["https://example.com/auth/"+scope] = scope
}
PermissionNamespace := checkers.NewNamespace(uriToPrefix)
prefix, ok := PermissionNamespace.Resolve("https://example.com/auth/" + scope)
if !ok {
return 0, false
}
permScope, ok := StringToPermissionScope[prefix]
return permScope, ok
}

View File

@ -1,15 +0,0 @@
package types
func (a *AssetInfo) Equal(b *AssetInfo) bool {
if a == nil && b == nil {
return true
}
return false
}
func (c *ChainInfo) Equal(b *ChainInfo) bool {
if c == nil && b == nil {
return true
}
return false
}

File diff suppressed because it is too large Load Diff