github.com/cosmos/cosmos-proto@v1.0.0-beta.3/proto/cosmos_proto/cosmos.proto (about)

     1  syntax = "proto3";
     2  package cosmos_proto;
     3  
     4  import "google/protobuf/descriptor.proto";
     5  
     6  option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto";
     7  
     8  extend google.protobuf.MessageOptions {
     9  
    10      // implements_interface is used to indicate the type name of the interface
    11      // that a message implements so that it can be used in google.protobuf.Any
    12      // fields that accept that interface. A message can implement multiple
    13      // interfaces. Interfaces should be declared using a declare_interface
    14      // file option.
    15      repeated string implements_interface = 93001;
    16  }
    17  
    18  extend google.protobuf.FieldOptions {
    19  
    20      // accepts_interface is used to annotate that a google.protobuf.Any
    21      // field accepts messages that implement the specified interface.
    22      // Interfaces should be declared using a declare_interface file option.
    23      string accepts_interface = 93001;
    24  
    25      // scalar is used to indicate that this field follows the formatting defined
    26      // by the named scalar which should be declared with declare_scalar. Code
    27      // generators may choose to use this information to map this field to a
    28      // language-specific type representing the scalar.
    29      string scalar = 93002;
    30  }
    31  
    32  extend google.protobuf.FileOptions {
    33  
    34      // declare_interface declares an interface type to be used with
    35      // accepts_interface and implements_interface. Interface names are
    36      // expected to follow the following convention such that their declaration
    37      // can be discovered by tools: for a given interface type a.b.C, it is
    38      // expected that the declaration will be found in a protobuf file named
    39      // a/b/interfaces.proto in the file descriptor set.
    40      repeated InterfaceDescriptor declare_interface = 793021;
    41  
    42      // declare_scalar declares a scalar type to be used with
    43      // the scalar field option. Scalar names are
    44      // expected to follow the following convention such that their declaration
    45      // can be discovered by tools: for a given scalar type a.b.C, it is
    46      // expected that the declaration will be found in a protobuf file named
    47      // a/b/scalars.proto in the file descriptor set.
    48      repeated ScalarDescriptor declare_scalar = 793022;
    49  }
    50  
    51  // InterfaceDescriptor describes an interface type to be used with
    52  // accepts_interface and implements_interface and declared by declare_interface.
    53  message InterfaceDescriptor {
    54  
    55      // name is the name of the interface. It should be a short-name (without
    56      // a period) such that the fully qualified name of the interface will be
    57      // package.name, ex. for the package a.b and interface named C, the
    58      // fully-qualified name will be a.b.C.
    59      string name = 1;
    60  
    61      // description is a human-readable description of the interface and its
    62      // purpose.
    63      string description = 2;
    64  }
    65  
    66  // ScalarDescriptor describes an scalar type to be used with
    67  // the scalar field option and declared by declare_scalar.
    68  // Scalars extend simple protobuf built-in types with additional
    69  // syntax and semantics, for instance to represent big integers.
    70  // Scalars should ideally define an encoding such that there is only one
    71  // valid syntactical representation for a given semantic meaning,
    72  // i.e. the encoding should be deterministic.
    73  message ScalarDescriptor {
    74  
    75      // name is the name of the scalar. It should be a short-name (without
    76      // a period) such that the fully qualified name of the scalar will be
    77      // package.name, ex. for the package a.b and scalar named C, the
    78      // fully-qualified name will be a.b.C.
    79      string name = 1;
    80  
    81      // description is a human-readable description of the scalar and its
    82      // encoding format. For instance a big integer or decimal scalar should
    83      // specify precisely the expected encoding format.
    84      string description = 2;
    85  
    86      // field_type is the type of field with which this scalar can be used.
    87      // Scalars can be used with one and only one type of field so that
    88      // encoding standards and simple and clear. Currently only string and
    89      // bytes fields are supported for scalars.
    90      repeated ScalarType field_type = 3;
    91  }
    92  
    93  enum ScalarType {
    94      SCALAR_TYPE_UNSPECIFIED = 0;
    95      SCALAR_TYPE_STRING = 1;
    96      SCALAR_TYPE_BYTES = 2;
    97  }