forked from hashgraph/hedera-sdk-go
/
request_type.go
277 lines (271 loc) · 9.12 KB
/
request_type.go
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
package hedera
/*-
*
* Hedera Go SDK
*
* Copyright (C) 2020 - 2022 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 (
"fmt"
)
type RequestType uint32
const (
// UNSPECIFIED - Need to keep first value as unspecified because first element is ignored and not parsed (0 is ignored by parser)
RequestTypeNone RequestType = 0
// crypto transfe
RequestTypeCryptoTransfer RequestType = 1
// crypto update account
RequestTypeCryptoUpdate RequestType = 2
// crypto delete account
RequestTypeCryptoDelete RequestType = 3
// Add a livehash to a crypto account
RequestTypeCryptoAddLiveHash RequestType = 4
// Delete a livehash from a crypto account
RequestTypeCryptoDeleteLiveHash RequestType = 5
// Smart Contract Call
RequestTypeContractCall RequestType = 6
// Smart Contract Create Contract
RequestTypeContractCreate RequestType = 7
// Smart Contract update contract
RequestTypeContractUpdate RequestType = 8
// File Operation create file
RequestTypeFileCreate RequestType = 9
// File Operation append file
RequestTypeFileAppend RequestType = 10
// File Operation update file
RequestTypeFileUpdate RequestType = 11
// File Operation delete file
RequestTypeFileDelete RequestType = 12
// crypto get account balance
RequestTypeCryptoGetAccountBalance RequestType = 13
// crypto get account record
RequestTypeCryptoGetAccountRecords RequestType = 14
// Crypto get info
RequestTypeCryptoGetInfo RequestType = 15
// Smart Contract Call
RequestTypeContractCallLocal RequestType = 16
// Smart Contract get info
RequestTypeContractGetInfo RequestType = 17
// Smart Contract, get the byte code
RequestTypeContractGetBytecode RequestType = 18
// Smart Contract, get by _Solidity ID
RequestTypeGetBySolidityID RequestType = 19
// Smart Contract, get by key
RequestTypeGetByKey RequestType = 20
// Get a live hash from a crypto account
RequestTypeCryptoGetLiveHash RequestType = 21
// Crypto, get the stakers for the _Node
RequestTypeCryptoGetStakers RequestType = 22
// File Operations get file contents
RequestTypeFileGetContents RequestType = 23
// File Operations get the info of the file
RequestTypeFileGetInfo RequestType = 24
// Crypto get the transaction records
RequestTypeTransactionGetRecord RequestType = 25
// Contract get the transaction records
RequestTypeContractGetRecords RequestType = 26
// crypto create account
RequestTypeCryptoCreate RequestType = 27
// system delete file
RequestTypeSystemDelete RequestType = 28
// system undelete file
RequestTypeSystemUndelete RequestType = 29
// delete contract
RequestTypeContractDelete RequestType = 30
// freeze
RequestTypeFreeze RequestType = 31
// Create Tx Record
RequestTypeCreateTransactionRecord RequestType = 32
// Crypto Auto Renew
RequestTypeCryptoAccountAutoRenew RequestType = 33
// Contract Auto Renew
RequestTypeContractAutoRenew RequestType = 34
// Get Version
RequestTypeGetVersionInfo RequestType = 35
// Transaction Get Receipt
RequestTypeTransactionGetReceipt RequestType = 36
// Create Topic
RequestTypeConsensusCreateTopic RequestType = 50
// Update Topic
RequestTypeConsensusUpdateTopic RequestType = 51
// Delete Topic
RequestTypeConsensusDeleteTopic RequestType = 52
// Get Topic information
RequestTypeConsensusGetTopicInfo RequestType = 53
// Submit message to topic
RequestTypeConsensusSubmitMessage RequestType = 54
RequestTypeUncheckedSubmit RequestType = 55
// Create Token
RequestTypeTokenCreate RequestType = 56
// Get Token information
RequestTypeTokenGetInfo RequestType = 58
// Freeze Account
RequestTypeTokenFreezeAccount RequestType = 59
// Unfreeze Account
RequestTypeTokenUnfreezeAccount RequestType = 60
// Grant KYC to Account
RequestTypeTokenGrantKycToAccount RequestType = 61
// Revoke KYC from Account
RequestTypeTokenRevokeKycFromAccount RequestType = 62
// Delete Token
RequestTypeTokenDelete RequestType = 63
// Update Token
RequestTypeTokenUpdate RequestType = 64
// Mint tokens to treasury
RequestTypeTokenMint RequestType = 65
// Burn tokens from treasury
RequestTypeTokenBurn RequestType = 66
// Wipe token amount from Account holder
RequestTypeTokenAccountWipe RequestType = 67
// Associate tokens to an account
RequestTypeTokenAssociateToAccount RequestType = 68
// Dissociate tokens from an account
RequestTypeTokenDissociateFromAccount RequestType = 69
// Create Scheduled Transaction
RequestTypeScheduleCreate RequestType = 70
// Delete Scheduled Transaction
RequestTypeScheduleDelete RequestType = 71
// Sign Scheduled Transaction
RequestTypeScheduleSign RequestType = 72
// Get Scheduled Transaction Information
RequestTypeScheduleGetInfo RequestType = 73
)
// String() returns a string representation of the status
func (requestType RequestType) String() string { // nolint
switch requestType {
case RequestTypeNone:
return "NONE"
case RequestTypeCryptoTransfer:
return "CRYPTO_TRANSFER"
case RequestTypeCryptoUpdate:
return "CRYPTO_UPDATE"
case RequestTypeCryptoDelete:
return "CRYPTO_DELETE"
case RequestTypeCryptoAddLiveHash:
return "CRYPTO_ADD_LIVE_HASH"
case RequestTypeCryptoDeleteLiveHash:
return "CRYPTO_DELETE_LIVE_HASH"
case RequestTypeContractCall:
return "CONTRACT_CALL"
case RequestTypeContractCreate:
return "CONTRACT_CREATE"
case RequestTypeContractUpdate:
return "CONTRACT_UPDATE"
case RequestTypeFileCreate:
return "FILE_CREATE"
case RequestTypeFileAppend:
return "FILE_APPEND"
case RequestTypeFileUpdate:
return "FILE_UPDATE"
case RequestTypeFileDelete:
return "FILE_DELETE"
case RequestTypeCryptoGetAccountBalance:
return "CRYPTO_GET_ACCOUNT_BALANCE"
case RequestTypeCryptoGetAccountRecords:
return "CRYPTO_GET_ACCOUNT_RECORDS"
case RequestTypeCryptoGetInfo:
return "CRYPTO_GET_INFO"
case RequestTypeContractCallLocal:
return "CONTRACT_CALL_LOCAL"
case RequestTypeContractGetInfo:
return "CONTRACT_GET_INFO"
case RequestTypeContractGetBytecode:
return "CONTRACT_GET_BYTECODE"
case RequestTypeGetBySolidityID:
return "GET_BY_SOLIDITY_ID"
case RequestTypeGetByKey:
return "GET_BY_KEY"
case RequestTypeCryptoGetLiveHash:
return "CRYPTO_GET_LIVE_HASH"
case RequestTypeCryptoGetStakers:
return "CRYPTO_GET_STAKERS"
case RequestTypeFileGetContents:
return "FILE_GET_CONTENTS"
case RequestTypeFileGetInfo:
return "FILE_GET_INFO"
case RequestTypeTransactionGetRecord:
return "TRANSACTION_GET_RECORD"
case RequestTypeContractGetRecords:
return "CONTRACT_GET_RECORDS"
case RequestTypeCryptoCreate:
return "CRYPTO_CREATE"
case RequestTypeSystemDelete:
return "SYSTEM_DELETE"
case RequestTypeSystemUndelete:
return "SYSTEM_UNDELETE"
case RequestTypeContractDelete:
return "CONTRACT_DELETE"
case RequestTypeFreeze:
return "FREEZE"
case RequestTypeCreateTransactionRecord:
return "CREATE_TRANSACTION_RECORD"
case RequestTypeCryptoAccountAutoRenew:
return "CRYPTO_ACCOUNT_AUTO_RENEW"
case RequestTypeContractAutoRenew:
return "CONTRACT_AUTO_RENEW"
case RequestTypeGetVersionInfo:
return "GET_VERSION_INFO"
case RequestTypeTransactionGetReceipt:
return "TRANSACTION_GET_RECEIPT"
case RequestTypeConsensusCreateTopic:
return "CONSENSUS_CREATE_TOPIC"
case RequestTypeConsensusUpdateTopic:
return "CONSENSUS_UPDATE_TOPIC"
case RequestTypeConsensusDeleteTopic:
return "CONSENSUS_DELETE_TOPIC"
case RequestTypeConsensusGetTopicInfo:
return "CONSENSUS_GET_TOPIC_INFO"
case RequestTypeConsensusSubmitMessage:
return "CONSENSUS_SUBMIT_MESSAGE"
case RequestTypeUncheckedSubmit:
return "UNCHECKED_SUBMIT"
case RequestTypeTokenCreate:
return "TOKEN_CREATE"
case RequestTypeTokenGetInfo:
return "TOKEN_GET_INFO"
case RequestTypeTokenFreezeAccount:
return "TOKEN_FREEZE_ACCOUNT"
case RequestTypeTokenUnfreezeAccount:
return "TOKEN_UNFREEZE_ACCOUNT"
case RequestTypeTokenGrantKycToAccount:
return "TOKEN_GRANT_KYC_TO_ACCOUNT"
case RequestTypeTokenRevokeKycFromAccount:
return "TOKEN_REVOKE_KYC_TO_ACCOUNT"
case RequestTypeTokenDelete:
return "TOKEN_DELETE"
case RequestTypeTokenUpdate:
return "TOKEN_UPDATE"
case RequestTypeTokenMint:
return "TOKEN_MINT"
case RequestTypeTokenBurn:
return "TOKEN_BURN"
case RequestTypeTokenAccountWipe:
return "TOKEN_ACCOUNT_WIPE"
case RequestTypeTokenAssociateToAccount:
return "TOKEN_ASSOCIATE_TO_ACCOUNT"
case RequestTypeTokenDissociateFromAccount:
return "TOKEN_DISSOCIATE_FROM_ACCOUNT"
case RequestTypeScheduleCreate:
return "SCHEDULE_CREATE"
case RequestTypeScheduleDelete:
return "SCHEDULE_DELETE"
case RequestTypeScheduleSign:
return "SCHEDULE_SIGN"
case RequestTypeScheduleGetInfo:
return "SCHEDULE_GET_INFO"
}
panic(fmt.Sprintf("unreachable: RequestType.String() switch statement is non-exhaustive. RequestType: %v", uint32(requestType)))
}