eosjs2
eosjs2 copied to clipboard
Add support to secondary indexes on get_table_rows
Looks like I don't have the parameters to filter my secondary index using RPC Api:
/** Raw call to `/v1/chain/get_table_rows` */
public async get_table_rows({
json = true,
code,
scope,
table,
table_key = "",
lower_bound = "",
upper_bound = "",
limit = 10 }: any): Promise<any> {
return await this.fetch(
"/v1/chain/get_table_rows", {
json,
code,
scope,
table,
table_key,
lower_bound,
upper_bound,
limit,
});
This would be a call example:
return e2DefaultRpc.get_table_rows({
json: true,
scope: "monstereosio",
code: "monstereosio",
table: "pets",
index_position: 2,
key_type: "name",
lower_bound: lowerBound,
limit: 150
})