Files
explorer-api/api/routes/v1-chain/get_table_rows/index.ts
T
Igor Lins e Silva 279f5d9474 merge 3.3.5 to master
2022-09-11 03:42:18 -03:00

44 lines
1.5 KiB
TypeScript

import {FastifyInstance} from "fastify";
import {addChainApiRoute, getRouteName} from "../../../helpers/functions";
export default function (fastify: FastifyInstance, opts: any, next) {
addChainApiRoute(
fastify,
getRouteName(__filename),
'Returns an object containing rows from the specified table.',
{
"code": {
"type": "string",
"description": "The name of the smart contract that controls the provided table"
},
"table": {
"type": "string",
"description": "The name of the table to query"
},
"scope": {
"type": "string",
"description": "The account to which this data belongs"
},
"index_position": {
"type": "string",
"description": "Position of the index used, accepted parameters `primary`, `secondary`, `tertiary`, `fourth`, `fifth`, `sixth`, `seventh`, `eighth`, `ninth` , `tenth`"
},
"key_type": {
"type": "string",
"description": "Type of key specified by index_position (for example - `uint64_t` or `name`)"
},
"encode_type": {
"type": "string"
},
"upper_bound": {
"type": "string"
},
"lower_bound": {
"type": "string"
}
},
["code", "table", "scope"]
);
next();
}