jsonRpc.get_table_rows()
get_table_rows()
方法返回指定数据表的查询结果,它是对RPC接口
/v1/chain/get_table_rows
的封装。
函数原型
get_table_rows(namedParameters: object): Promise<any>
参数
namedParameters:参数对象,其成员如下:
- code
- scope
- table
- json
- limit
- lower_bound
- upper_bound
- index_position
- table_key
- key_type
返回值
get_table_rows()
方法返回一个Promise对象,其解析值为RPC响应结果对象。
示例代码
(async ()=>{
let ret = await rpc.get_table_rows({
code:'eosio.token',
table:'stats',
scope:'SYS'
})
console.log(ret)
})()