/
attribute.proto
115 lines (102 loc) · 4.24 KB
/
attribute.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
syntax = "proto3";
package provenance.attribute.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
option go_package = "github.com/provenance-io/provenance/x/attribute/types";
option java_package = "io.provenance.attribute.v1";
option java_multiple_files = true;
// Params defines the set of params for the attribute module.
message Params {
option (gogoproto.goproto_stringer) = false;
// maximum length of data to allow in an attribute value
uint32 max_value_length = 1;
}
// Attribute holds a typed key/value structure for data associated with an account
message Attribute {
option (gogoproto.goproto_stringer) = false;
// The attribute name.
string name = 1;
// The attribute value.
bytes value = 2;
// The attribute value type.
AttributeType attribute_type = 3;
// The address the attribute is bound to
string address = 4;
// Time that an attribute will expire.
google.protobuf.Timestamp expiration_date = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true];
}
// AttributeType defines the type of the data stored in the attribute value
enum AttributeType {
// ATTRIBUTE_TYPE_UNSPECIFIED defines an unknown/invalid type
ATTRIBUTE_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"];
// ATTRIBUTE_TYPE_UUID defines an attribute value that contains a string value representation of a V4 uuid
ATTRIBUTE_TYPE_UUID = 1 [(gogoproto.enumvalue_customname) = "UUID"];
// ATTRIBUTE_TYPE_JSON defines an attribute value that contains a byte string containing json data
ATTRIBUTE_TYPE_JSON = 2 [(gogoproto.enumvalue_customname) = "JSON"];
// ATTRIBUTE_TYPE_STRING defines an attribute value that contains a generic string value
ATTRIBUTE_TYPE_STRING = 3 [(gogoproto.enumvalue_customname) = "String"];
// ATTRIBUTE_TYPE_URI defines an attribute value that contains a URI
ATTRIBUTE_TYPE_URI = 4 [(gogoproto.enumvalue_customname) = "Uri"];
// ATTRIBUTE_TYPE_INT defines an attribute value that contains an integer (cast as int64)
ATTRIBUTE_TYPE_INT = 5 [(gogoproto.enumvalue_customname) = "Int"];
// ATTRIBUTE_TYPE_FLOAT defines an attribute value that contains a float
ATTRIBUTE_TYPE_FLOAT = 6 [(gogoproto.enumvalue_customname) = "Float"];
// ATTRIBUTE_TYPE_PROTO defines an attribute value that contains a serialized proto value in bytes
ATTRIBUTE_TYPE_PROTO = 7 [(gogoproto.enumvalue_customname) = "Proto"];
// ATTRIBUTE_TYPE_BYTES defines an attribute value that contains an untyped array of bytes
ATTRIBUTE_TYPE_BYTES = 8 [(gogoproto.enumvalue_customname) = "Bytes"];
}
// EventAttributeAdd event emitted when attribute is added
message EventAttributeAdd {
string name = 1;
string value = 2;
string type = 3;
string account = 4;
string owner = 5;
string expiration = 6;
}
// EventAttributeUpdate event emitted when attribute is updated
message EventAttributeUpdate {
string name = 1;
string original_value = 2;
string original_type = 3;
string update_value = 4;
string update_type = 5;
string account = 6;
string owner = 7;
}
// EventAttributeExpirationUpdate event emitted when attribute expiration is updated
message EventAttributeExpirationUpdate {
string name = 1;
string value = 2;
string account = 3;
string owner = 4;
string original_expiration = 5;
string updated_expiration = 6;
}
// EventAttributeDelete event emitted when attribute is deleted
message EventAttributeDelete {
string name = 1;
string account = 2;
string owner = 3;
}
// EventAttributeDistinctDelete event emitted when attribute is deleted with matching value
message EventAttributeDistinctDelete {
string name = 1;
string value = 2;
string attribute_type = 3;
string account = 4;
string owner = 5;
}
// EventAttributeExpired event emitted when attribute has expired and been deleted in BeginBlocker
message EventAttributeExpired {
string name = 1;
string value_hash = 2;
string attribute_type = 3;
string account = 4;
string expiration = 5;
}
// EventAccountDataUpdated event emitted when accountdata is set, updated, or deleted.
message EventAccountDataUpdated {
string account = 1;
}