Unmarshalling LCD API response into Protobuf types fails #69
-
I need to fetch the validators list of a cosmos-sdk chain from LCD API of the node into the Protobuf types (I need specifically LCD API node, not RPC or gRPC node, these have no issues) or somehow convert it to these Protobuf types. I try to query the chain with a code that's something like this:
(the This yields the following error:
I know I can write my own JSON types for the API response and unmarshal into it and then convert manually, but this isn't as convenient + I need to use some of the protobuf types' internal methods (such as GetConsAddr() or GetMoniker()). Wonder if there's something built-in in cosmos-sdk that I can use as a client to LCD node that will return the type I need, or some other way to fetch the data and convert it into Protobuf types? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
LCD doesnt exist anymore. it is either grpc or rest. Which one are you trying to use here? |
Beta Was this translation helpful? Give feedback.
REST. I already managed to fix it btw, only needed to parse it via legacy amino, so feel free to mark it as resolved: