/
optype.go
87 lines (81 loc) · 2.8 KB
/
optype.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
package types
// OpType represents a Steem operation type, i.e. vote, comment, pow and so on.
type OpType string
// Code returns the operation code associated with the given operation type.
func (kind OpType) Code() uint16 {
return opCodes[kind]
}
const (
TypeVote OpType = "vote"
TypeComment OpType = "comment"
TypeTransfer OpType = "transfer"
TypeTransferToVesting OpType = "transfer_to_vesting"
TypeWithdrawVesting OpType = "withdraw_vesting"
TypeLimitOrderCreate OpType = "limit_order_create"
TypeLimitOrderCancel OpType = "limit_order_cancel"
TypeFeedPublish OpType = "feed_publish"
TypeConvert OpType = "convert"
TypeAccountCreate OpType = "account_create"
TypeAccountUpdate OpType = "account_update"
TypeWitnessUpdate OpType = "witness_update"
TypeAccountWitnessVote OpType = "account_witness_vote"
TypeAccountWitnessProxy OpType = "account_witness_proxy"
TypePOW OpType = "pow"
TypeCustom OpType = "custom"
TypeReportOverProduction OpType = "report_over_production"
TypeDeleteComment OpType = "delete_comment"
TypeCustomJSON OpType = "custom_json"
TypeCommentOptions OpType = "comment_options"
TypeSetWithdrawVestingRoute OpType = "set_withdraw_vesting_route"
TypeLimitOrderCreate2 OpType = "limit_order_create2"
TypeChallengeAuthority OpType = "challenge_authority"
TypeProveAuthority OpType = "prove_authority"
TypeRequestAccountRecoverty OpType = "request_account_recovery"
TypeRecoverAccount OpType = "recover_account"
TypeChangeRecoveryAccount OpType = "change_recover_account"
TypeEscrowTransfer OpType = "escrow_transfer"
TypeEscrowDispute OpType = "escrow_dispute"
TypeEscrowRelease OpType = "escrow_release"
TypePOW2 OpType = "pow2"
)
var opTypes = [...]OpType{
TypeVote,
TypeComment,
TypeTransfer,
TypeTransferToVesting,
TypeWithdrawVesting,
TypeLimitOrderCreate,
TypeLimitOrderCancel,
TypeFeedPublish,
TypeConvert,
TypeAccountCreate,
TypeAccountUpdate,
TypeWitnessUpdate,
TypeAccountWitnessVote,
TypeAccountWitnessProxy,
TypePOW,
TypeCustom,
TypeReportOverProduction,
TypeDeleteComment,
TypeCustomJSON,
TypeCommentOptions,
TypeSetWithdrawVestingRoute,
TypeLimitOrderCreate2,
TypeChallengeAuthority,
TypeProveAuthority,
TypeRequestAccountRecoverty,
TypeRecoverAccount,
TypeChangeRecoveryAccount,
TypeEscrowTransfer,
TypeEscrowDispute,
TypeEscrowRelease,
TypePOW2,
}
// opCodes keeps mapping operation type -> operation code.
var opCodes map[OpType]uint16
func init() {
opCodes = make(map[OpType]uint16, len(opTypes))
for i, opType := range opTypes {
opCodes[opType] = uint16(i)
}
}