File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
api/routes/v2-state/get_tokens Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 11import { ServerResponse } from "http" ;
22import { timedQuery } from "../../../helpers/functions" ;
33import { FastifyInstance , FastifyReply , FastifyRequest } from "fastify" ;
4+ import { getSkipLimit } from "../../v2-history/get_actions/functions" ;
45
56
67async function getTokens ( fastify : FastifyInstance , request : FastifyRequest ) {
78
89 const response = { 'account' : request . query . account , 'tokens' : [ ] } ;
910
11+ const { skip, limit} = getSkipLimit ( request . query ) ;
12+ const maxDocs = fastify . manager . config . api . limits . get_tokens ?? 100 ;
13+
1014 const stateResult = await fastify . elastic . search ( {
1115 "index" : fastify . manager . chain + '-table-accounts-*' ,
16+ "size" : ( limit > maxDocs ? maxDocs : limit ) || 10 ,
17+ "from" : skip || 0 ,
1218 "body" : {
1319 query : {
1420 bool : {
You can’t perform that action at this time.
0 commit comments