@@ -17,7 +17,7 @@ hex_bytes_result = sub.query_runtime_api(
17
17
method = " get_delegates" ,
18
18
params = [ ]
19
19
)
20
- # Decode scale-encoded DelegateInfo
20
+ # Decode scale-encoded Vec< DelegateInfo>
21
21
delegates_info: List[DelegateInfo] = DelegateInfo.decode_vec(
22
22
bytes .fromhex(
23
23
hex_bytes_result
@@ -38,7 +38,7 @@ hex_bytes_result = sub.query_runtime_api(
38
38
method = " get_delegated" ,
39
39
params = [list ( validator_key.public_key )]
40
40
)
41
- # Decode scale-encoded (DelegateInfo, take)
41
+ # Decode scale-encoded Vec< (DelegateInfo, take)>
42
42
delegated_info: List[Tuple[DelegateInfo, int ]] = DelegateInfo.decode_delegated(
43
43
bytes .fromhex(
44
44
hex_bytes_result
@@ -82,8 +82,8 @@ hex_bytes_result = sub.query_runtime_api(
82
82
method = " get_neurons" ,
83
83
params = [NETUID ]
84
84
)
85
- # Decode scale-encoded NeuronInfo
86
- neurons: List[NeuronInfo] = NeuronInfo.decode (
85
+ # Decode scale-encoded Vec< NeuronInfo>
86
+ neurons: List[NeuronInfo] = NeuronInfo.decode_vec (
87
87
bytes .fromhex(
88
88
hex_bytes_result
89
89
))
@@ -126,8 +126,8 @@ hex_bytes_result = sub.query_runtime_api(
126
126
method = " get_neurons_lite" ,
127
127
params = [NETUID ]
128
128
)
129
- # Decode scale-encoded NeuronInfoLite
130
- neurons_lite: List[NeuronInfoLite] = NeuronInfoLite.decode (
129
+ # Decode scale-encoded Vec< NeuronInfoLite>
130
+ neurons_lite: List[NeuronInfoLite] = NeuronInfoLite.decode_vec (
131
131
bytes .fromhex(
132
132
hex_bytes_result
133
133
))
@@ -178,7 +178,7 @@ hex_bytes_result = sub.query_runtime_api(
178
178
method = " get_stake_info_for_coldkeys" ,
179
179
params = [encoded_coldkeys]
180
180
)
181
- # Decode scale-encoded (AccountId, StakeInfo)
181
+ # Decode scale-encoded Vec< (AccountId, StakeInfo)>
182
182
stake_info: List[Tuple[bytes , List[" StakeInfo" ]]] = StakeInfo.decode_vec_tuple_vec(
183
183
bytes .fromhex(
184
184
hex_bytes_result
@@ -199,8 +199,8 @@ hex_bytes_result = sub.query_runtime_api(
199
199
method = " get_subnet_info" ,
200
200
params = [NETUID ]
201
201
)
202
- # Decode scale-encoded SubnetInfo
203
- subnet_info: SubnetInfo = SubnetInfo.decode (
202
+ # Decode scale-encoded Option< SubnetInfo>
203
+ subnet_info: SubnetInfo = SubnetInfo.decode_option (
204
204
bytes .fromhex(
205
205
hex_bytes_result
206
206
))
@@ -219,15 +219,15 @@ hex_bytes_result = sub.query_runtime_api(
219
219
method = " get_subnets_info" ,
220
220
params = [ ]
221
221
)
222
- # Decode scale-encoded Optional[ SubnetInfo]
223
- subnets_info: List[Optional[SubnetInfo]] = SubnetInfo.decode_vec (
222
+ # Decode scale-encoded Vec<Option< SubnetInfo>>
223
+ subnets_info: List[Optional[SubnetInfo]] = SubnetInfo.decode_vec_option (
224
224
bytes .fromhex(
225
225
hex_bytes_result
226
226
))
227
227
```
228
228
229
229
### SubnetHyperparameters
230
- #### get_subnet_info
230
+ #### get_subnet_hyperparams
231
231
``` python
232
232
import bittensor
233
233
from bt_decode import SubnetHyperparameters
@@ -241,8 +241,8 @@ hex_bytes_result = sub.query_runtime_api(
241
241
method = " get_subnet_hyperparams" ,
242
242
params = [NETUID ]
243
243
)
244
- # Decode scale-encoded SubnetHyperparameters
245
- subnet_hyper_params: SubnetHyperparameters = SubnetHyperparameters.decode (
244
+ # Decode scale-encoded Option< SubnetHyperparameters>
245
+ subnet_hyper_params: Optional[ SubnetHyperparameters] = SubnetHyperparameters.decode_option (
246
246
bytes .fromhex(
247
247
hex_bytes_result
248
248
))
0 commit comments