Closed robertkowalski closed 6 years ago
What does organiccandy in "tables" look like? I wonder if that needs to be parsed along with any structs to make a helper function ..
Here is a case where the "name" field has to be encoded to a number just for the query to work: https://github.com/EOSIO/eos/issues/3948#issuecomment-395802721
I wonder if this is related to your case only using a different type.
I have suggested that a version 2 of the get_table_rows (v2/chain/get_table_rows
) provide de-serialization on its parameters.
Encode "name" fields (like account name) .. See https://github.com/EOSIO/eosjs/issues/154#issuecomment-394914254
hm, whats the conclusion here @jcalfee ?
Maybe getTableRows
can accept some options as the last parameter similar to what is done here:
https://github.com/EOSIO/eos/pull/4053
However, it seems like /v2/chain/get_table_rows
could do this decoding automatically. I prefer to have this information from the back-end rather than adding extra parameters to the API. Even after adding a feature like this it will still be error prone to use. I really wish I had the field types in the table to work with..
Published eosjs@16.0.0 .. This adds two parameters to get_table_rows .. key_type and index_position.
Hi James,
I work with lower bounds to read paginated data from a table. My primary keys start with 0.
It turns out that I just receive more results when I pad the integers with 0 to fill up the space for the uint64 buffer. This goes in line with cleos, but its a bit unhandy for development.
cleos:
In JS I do something along these lines in order to receive a result
Question:
a) I checked the format helpers, I did not found a helper suitable - am I missing something? b) Would you review & merge a PR with a helper? Or would you add one yourself? Or should this happen in userland?