File tree 1 file changed +6
-0
lines changed
api/routes/v2-state/get_tokens
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { ServerResponse } from "http" ;
2
2
import { timedQuery } from "../../../helpers/functions" ;
3
3
import { FastifyInstance , FastifyReply , FastifyRequest } from "fastify" ;
4
+ import { getSkipLimit } from "../../v2-history/get_actions/functions" ;
4
5
5
6
6
7
async function getTokens ( fastify : FastifyInstance , request : FastifyRequest ) {
7
8
8
9
const response = { 'account' : request . query . account , 'tokens' : [ ] } ;
9
10
11
+ const { skip, limit} = getSkipLimit ( request . query ) ;
12
+ const maxDocs = fastify . manager . config . api . limits . get_tokens ?? 100 ;
13
+
10
14
const stateResult = await fastify . elastic . search ( {
11
15
"index" : fastify . manager . chain + '-table-accounts-*' ,
16
+ "size" : ( limit > maxDocs ? maxDocs : limit ) || 10 ,
17
+ "from" : skip || 0 ,
12
18
"body" : {
13
19
query : {
14
20
bool : {
You can’t perform that action at this time.
0 commit comments