You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its should be possible to parse sozo call results in a more friendly representation.
And also keep the ability to display raw results ( splitted with , could be convenient)
The text was updated successfully, but these errors were encountered:
I don't know what would be the best way to do that, so I share some ideas with you.
From the tag_or_address and the entrypoint we can retrieve the output type of the entrypoint from the contract ABI (as soon as the contract is known in the manifest_xxx.json file otherwise we should just display the raw output).
Then, from this output type which is a string, I guess we have to recursively parse it using the contract ABI until we find deserializable primitive types that can be displayed.
For example, I call ns-Actionsget_player_position.
From the ns-Actions contract ABI, I find that:
the output type is "dojo_examples::models::Position",
dojo_examples::models::Position is composed of:
player which is a ContractAddress => we can deserialize and display it,
vec which is a Vec => search for Vec details in the ABI, ...
Maybe Cainome can also help us but I don't know if we can deserialize a type like dojo_examples::models::Position with Cainome, at runtime, with a string representation of that type 🤔 @glihm, any idea ?
Also, for the specific case of dojo_examples::models::Position, as it is a model, we can read its schema from its contract and deserialize it as we do in sozo model get.
Its should be possible to parse
sozo call
results in a more friendly representation.And also keep the ability to display raw results ( splitted with
,
could be convenient)The text was updated successfully, but these errors were encountered: