eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

get_table_rows properties

Open iKest opened this issue 8 years ago • 5 comments

eosjs-jsonrpc.ts

add key_type and index_position properties to get_table_rows method for multi-index tables

public async get_table_rows({
        json = true,
        code,
        scope,
        table,
        table_key = "",
        lower_bound = "0",
        upper_bound = "-1",
        index_position ="",
        key_type = "",
        limit = 10 }: any): Promise<any> {
        return await this.fetch(
            "/v1/chain/get_table_rows", {
                json,
                code,
                scope,
                table,
                table_key,
                index_position,
                key_type,
                lower_bound,
                upper_bound,
                limit,
            });
    }

iKest avatar Oct 06 '18 08:10 iKest

@brandonfancher @jeffreyssmith2nd

Is there any particular reason these parameters haven't been made "setable" from within the eosjs library? They seem to exist in the eosjs-api lib: https://github.com/EOSIO/eosjs-api/blob/f0077306c7bbde4dd4e1ebaa7de52d5827613842/src/api/v1/chain.json#L118

blackwatertepes avatar Oct 21 '18 03:10 blackwatertepes

no reasons. im added this manualy and all works ok.

iKest avatar Oct 22 '18 14:10 iKest

@iKest Can you provide a link to a fork where you've gotten this to work? Or, at least paste a code snippet into this thread?

blackwatertepes avatar Oct 22 '18 16:10 blackwatertepes

@blackwatertepes code snippet first post.

iKest avatar Oct 24 '18 11:10 iKest

Fixed in #415

tbfleming avatar Oct 26 '18 19:10 tbfleming