forked from hashgraph/hedera-protobufs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoken.proto
175 lines (167 loc) · 6.39 KB
/
token.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
syntax = "proto3";
package proto;
/*-
*
* Hedera Network Services Protobuf
*
* Copyright (C) 2018 - 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import "basic_types.proto";
import "custom_fees.proto";
option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.state.token">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;
/**
* Representation of a Hedera Token Service token entity in the network Merkle tree.
*
* As with all network entities, a token has a unique entity number, which is usually given along
* with the network's shard and realm in the form of a shard.realm.number id.
*/
message Token {
/**
* The unique entity id of this token.
*/
TokenID token_id = 1;
/**
* The human-readable name of this token. Need not be unique. Maximum length allowed is 100 bytes.
*/
string name = 2;
/**
* The human-readable symbol for the token. It is not necessarily unique. Maximum length allowed is 100 bytes.
*/
string symbol = 3;
/**
* The number of decimal places of this token. If decimals are 8 or 11, then the number of whole
* tokens can be at most a few billions or millions, respectively. For example, it could match
* Bitcoin (21 million whole tokens with 8 decimals) or hbars (50 billion whole tokens with 8 decimals).
* It could even match Bitcoin with milli-satoshis (21 million whole tokens with 11 decimals).
*/
int32 decimals = 4;
/**
* The total supply of this token.
*/
int64 total_supply = 5;
/**
* The treasury account id of this token. This account receives the initial supply of
* tokens as well as the tokens from the Token Mint operation once executed. The balance
* of the treasury account is decreased when the Token Burn operation is executed.
*/
AccountID treasury_account_id = 6;
/**
* (Optional) The admin key of this token. If this key is set, the token is mutable.
* A mutable token can be modified.
* If this key is not set on token creation, it cannot be modified.
*/
Key admin_key = 7;
/**
* (Optional) The kyc key of this token.
* If this key is not set on token creation, it can only be set if the token has admin key set.
*/
Key kyc_key = 8;
/**
* (Optional) The freeze key of this token. This key is needed for freezing the token.
* If this key is not set on token creation, it can only be set if the token has admin key set.
*/
Key freeze_key = 9;
/**
* (Optional) The wipe key of this token. This key is needed for wiping the token.
* If this key is not set on token creation, it can only be set if the token has admin key set.
*/
Key wipe_key = 10;
/**
* (Optional) The supply key of this token. This key is needed for minting or burning token.
* If this key is not set on token creation, it can only be set if the token has admin key set.
*/
Key supply_key = 11;
/**
* (Optional) The fee schedule key of this token. This key should be set, in order to make any
* changes to the custom fee schedule.
* If this key is not set on token creation, it can only be set if the token has admin key set.
*/
Key fee_schedule_key = 12;
/**
* (Optional) The pause key of this token. This key is needed for pausing the token.
* If this key is not set on token creation, it can only be set if the token has admin key set.
*/
Key pause_key = 13;
/**
* The last used serial number of this token.
*/
int64 last_used_serial_number = 14;
/**
* The flag indicating if this token is deleted.
*/
bool deleted = 15;
/**
* The type of this token. A token can be either FUNGIBLE_COMMON or NON_FUNGIBLE_UNIQUE.
* If it has been omitted during token creation, FUNGIBLE_COMMON type is used.
*/
TokenType token_type = 16;
/**
* The supply type of this token.A token can have either INFINITE or FINITE supply type.
* If it has been omitted during token creation, INFINITE type is used.
*/
TokenSupplyType supply_type = 17;
/**
* The id of the account (if any) that the network will attempt to charge for the
* token's auto-renewal upon expiration.
*/
AccountID auto_renew_account_id = 18;
/**
* The number of seconds the network should automatically extend the token's expiration by, if the
* token has a valid auto-renew account, and is not deleted upon expiration.
* If this is not provided in a allowed range on token creation, the transaction will fail with INVALID_AUTO_RENEWAL_PERIOD.
* The default values for the minimum period and maximum period are 30 days and 90 days, respectively.
*/
int64 auto_renew_seconds = 19;
/**
* The expiration time of the token, in seconds since the epoch.
*/
int64 expiration_second = 20;
/**
* An optional description of the token with UTF-8 encoding up to 100 bytes.
*/
string memo = 21;
/**
* The maximum supply of this token.
*/
int64 max_supply = 22;
/**
* The flag indicating if this token is paused.
*/
bool paused = 23;
/**
* The flag indicating if this token has accounts associated to it that are frozen by default.
*/
bool accounts_frozen_by_default = 24;
/**
* The flag indicating if this token has accounts associated with it that are KYC granted by default.
*/
bool accounts_kyc_granted_by_default = 25;
/**
* (Optional) The custom fees of this token.
*/
repeated CustomFee custom_fees = 26;
/**
* Metadata of the created token definition
*/
bytes metadata = 27;
/**
* The key which can change the metadata of a token
* (token definition and individual NFTs).
*/
Key metadata_key = 28;
}