EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

get_table_rows properties #386

Closed iKest closed 5 years ago

iKest commented 6 years ago

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,
            });
    }
blackwatertepes commented 6 years ago

@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

iKest commented 6 years ago

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

blackwatertepes commented 6 years ago

@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?

iKest commented 6 years ago

@blackwatertepes code snippet first post.

tbfleming commented 5 years ago

Fixed in #415