EOSJS中文手册【V20】

在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

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)
})()