4
4
package api
5
5
6
6
import (
7
- stdjson "encoding/json"
7
+ "encoding/json"
8
8
9
9
"github.com/ava-labs/avalanchego/ids"
10
10
"github.com/ava-labs/avalanchego/utils/formatting"
11
- "github.com/ava-labs/avalanchego/utils/json"
11
+
12
+ avajson "github.com/ava-labs/avalanchego/utils/json"
12
13
)
13
14
14
15
// This file contains structs used in arguments and responses in services
@@ -71,13 +72,13 @@ type GetBlockArgs struct {
71
72
72
73
// GetBlockByHeightArgs is the parameters supplied to the GetBlockByHeight API
73
74
type GetBlockByHeightArgs struct {
74
- Height json .Uint64 `json:"height"`
75
+ Height avajson .Uint64 `json:"height"`
75
76
Encoding formatting.Encoding `json:"encoding"`
76
77
}
77
78
78
79
// GetBlockResponse is the response object for the GetBlock API.
79
80
type GetBlockResponse struct {
80
- Block stdjson .RawMessage `json:"block"`
81
+ Block json .RawMessage `json:"block"`
81
82
// If GetBlockResponse.Encoding is formatting.Hex, GetBlockResponse.Block is
82
83
// the string representation of the block under hex encoding.
83
84
// If GetBlockResponse.Encoding is formatting.JSON, GetBlockResponse.Block
@@ -86,7 +87,7 @@ type GetBlockResponse struct {
86
87
}
87
88
88
89
type GetHeightResponse struct {
89
- Height json .Uint64 `json:"height"`
90
+ Height avajson .Uint64 `json:"height"`
90
91
}
91
92
92
93
// FormattedBlock defines a JSON formatted struct containing a block in Hex
@@ -107,7 +108,7 @@ type GetTxReply struct {
107
108
// the tx under hex encoding.
108
109
// If [GetTxArgs.Encoding] is [JSON], [Tx] is the actual tx, which will be
109
110
// returned as JSON to the caller.
110
- Tx stdjson .RawMessage `json:"tx"`
111
+ Tx json .RawMessage `json:"tx"`
111
112
Encoding formatting.Encoding `json:"encoding"`
112
113
}
113
114
@@ -139,15 +140,15 @@ type Index struct {
139
140
type GetUTXOsArgs struct {
140
141
Addresses []string `json:"addresses"`
141
142
SourceChain string `json:"sourceChain"`
142
- Limit json .Uint32 `json:"limit"`
143
+ Limit avajson .Uint32 `json:"limit"`
143
144
StartIndex Index `json:"startIndex"`
144
145
Encoding formatting.Encoding `json:"encoding"`
145
146
}
146
147
147
148
// GetUTXOsReply defines the GetUTXOs replies returned from the API
148
149
type GetUTXOsReply struct {
149
150
// Number of UTXOs returned
150
- NumFetched json .Uint64 `json:"numFetched"`
151
+ NumFetched avajson .Uint64 `json:"numFetched"`
151
152
// The UTXOs
152
153
UTXOs []string `json:"utxos"`
153
154
// The last UTXO that was returned, and the address it corresponds to.
0 commit comments