I am using a secondary key to get table rows:
static async getItemById(itemId){
try{
const rpc = new JsonRpc(process.env.REACT_APP_EOS_HTTP_ENDPOINT);
const result = await rpc.get_table_rows({
"json": true,
"code": process.env.REACT_APP_EOS_CONTRACT_NAME,
"scope": process.env.REACT_APP_EOS_CONTRACT_NAME,
"index_position": "secondary",
"key_type": "uint64_t",
"table": "items",
"limit": 10,
"lower_bound": itemId,
});
console.log(result.rows)
return result.rows;
} catch (err) {
console.error(err);
}
}
but I get this error:
Error: Unsupported secondary index type: uint64_t
at new RpcError (eosjs-rpcerror.js:27)
at JsonRpc.<anonymous> (eosjs-jsonrpc.js:121)
at step (eosjs-jsonrpc.js:37)
at Object.next (eosjs-jsonrpc.js:18)
at fulfilled (eosjs-jsonrpc.js:9)