Could you please tell me how convert a queryResult from Substrate storage into js object?
i use these two functions to get the object from chain into js object
queryResult.toHuman() function, but it adds commas to numbers of u64 type, although it parses strings as text
queryResult.toJSON() makes all strings hex
In polkadot/api package version 8.12.2 when specifying types for ApiPromise, all the string processed by the package are hex strings. My struct on chain is Example: { field: Vec }
it used to be that if i were to specify to pass into ApiPromise Example: { field: "Text" } it would automatically transform from a hex to a string when specified in types.
Now, doesn't matter if i say field: "Text" or field: "Vec" in types on js client side, the string parsed by a library is a hex. I also noticed that i don't need to specify example struct in types at all, it will return me the object from the chain, even though in the past it wouldn't be able to read it. I have just recently updated substrate node to a version 0.9.24.
Could you please tell me if this behavior is normal for the latest versions of polkadot js api and substrate? Is there a way to specify on js side how to parse a Vec field from the node: as a hex or as a string?
.toHuman() function returns strings but commas in numbers aren't desirable