-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
130 lines (114 loc) · 4.04 KB
/
types.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
// (c) 2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package models
type CChainType uint16
var (
CChainIn CChainType = 1
CchainOut CChainType = 2
CChainImport CChainType = 1
CChainExport CChainType = 2
OutputTypesSECP2556K1Transfer OutputType = 7
OutputTypesSECP2556K1Mint OutputType = 6
OutputTypesNFTMint OutputType = 10
OutputTypesNFTTransfer OutputType = 11
OutputTypesAtomicExportTx OutputType = 0xFFFFFFF1
OutputTypesAtomicImportTx OutputType = 0xFFFFFFF2
BlockTypeProposal BlockType = 0x0
BlockTypeAbort BlockType = 0x1
BlockTypeCommit BlockType = 0x2
BlockTypeStandard BlockType = 0x3
BlockTypeAtomic BlockType = 0x4
TransactionTypeBase TransactionType = 0x0
TransactionTypeCreateAsset TransactionType = 0x1
TransactionTypeOperation TransactionType = 0x2
TransactionTypeAVMImport TransactionType = 0x3
TransactionTypeAVMExport TransactionType = 0x4
TransactionTypeAddValidator TransactionType = 0xc
TransactionTypeAddSubnetValidator TransactionType = 0xd
TransactionTypeAddDelegator TransactionType = 0xe
TransactionTypeCreateChain TransactionType = 0xf
TransactionTypeCreateSubnet TransactionType = 0x10
TransactionTypePVMImport TransactionType = 0x11
TransactionTypePVMExport TransactionType = 0x12
TransactionTypeAdvanceTime TransactionType = 0x13
TransactionTypeRewardValidator TransactionType = 0x14
TransactionTypeRemoveSubnetValidator TransactionType = 0x15
TransactionTypeTransformSubnet TransactionType = 0x16
TransactionTypeAddPermissionlessValidator TransactionType = 0x17
TransactionTypeAddPermissionlessDelegator TransactionType = 0x18
ResultTypeTransaction SearchResultType = "transaction"
ResultTypeAsset SearchResultType = "asset"
ResultTypeAddress SearchResultType = "address"
ResultTypeOutput SearchResultType = "output"
TypeUnknown = "unknown"
)
// BlockType represents a sub class of Block.
type BlockType uint16
// TransactionType represents a sub class of Transaction.
type TransactionType uint16
func (t TransactionType) String() string {
switch t {
case TransactionTypeBase:
return "base"
// AVM
case TransactionTypeCreateAsset:
return "create_asset"
case TransactionTypeOperation:
return "operation"
case TransactionTypeAVMImport:
return "import"
case TransactionTypeAVMExport:
return "export"
// PVM
case TransactionTypeAddValidator:
return "add_validator"
case TransactionTypeAddSubnetValidator:
return "add_subnet_validator"
case TransactionTypeAddDelegator:
return "add_delegator"
case TransactionTypeCreateChain:
return "create_chain"
case TransactionTypeCreateSubnet:
return "create_subnet"
case TransactionTypePVMImport:
return "pvm_import"
case TransactionTypePVMExport:
return "pvm_export"
case TransactionTypeAdvanceTime:
return "advance_time"
case TransactionTypeRewardValidator:
return "reward_validator"
case TransactionTypeRemoveSubnetValidator:
return "remove_subnet_validator"
case TransactionTypeTransformSubnet:
return "transform_subnet"
case TransactionTypeAddPermissionlessValidator:
return "add_permissionless_validator"
case TransactionTypeAddPermissionlessDelegator:
return "add_permissionless_delegator"
default:
return TypeUnknown
}
}
// OutputType represents a sub class of Output.
type OutputType uint32
func (t OutputType) String() string {
switch t {
case OutputTypesSECP2556K1Transfer:
return "secp256k1_transfer"
case OutputTypesSECP2556K1Mint:
return "secp256k1_mint"
case OutputTypesNFTTransfer:
return "nft_transfer"
case OutputTypesNFTMint:
return "nft_mint"
case OutputTypesAtomicExportTx:
return "atomic_export"
case OutputTypesAtomicImportTx:
return "atomic_import"
default:
return TypeUnknown
}
}
// SearchResultType is the type for an object found from a search query.
type SearchResultType string