@@ -35,6 +35,8 @@ import { croNftApi, MintByCDCRequest } from './NftApi';
3535import { splitToChunks } from '../../utils/utils' ;
3636import { UserAsset } from '../../models/UserAsset' ;
3737
38+ const VALIDATOR_FETCH_LIMIT = 1000 ;
39+
3840export interface IChainIndexingAPI {
3941 fetchAllTransferTransactions (
4042 baseAssetSymbol : string ,
@@ -167,7 +169,7 @@ export class ChainIndexingAPI implements IChainIndexingAPI {
167169 const transferListResponse = await this . axiosClient . get < TransferListResponse > (
168170 `/accounts/${ address } /messages?order=height.desc&filter.msgType=${ msgType . join (
169171 ',' ,
170- ) } &limit=1000 `,
172+ ) } &limit=${ VALIDATOR_FETCH_LIMIT } `,
171173 ) ;
172174
173175 function getStatus ( transfer : TransferResult ) {
@@ -459,7 +461,7 @@ export class ChainIndexingAPI implements IChainIndexingAPI {
459461
460462 private async getValidatorDetails ( validatorAddr : string ) {
461463 const validatorList = await this . axiosClient . get < ValidatorListResponse > (
462- ' validators?limit=1000000' ,
464+ ` validators?limit=${ VALIDATOR_FETCH_LIMIT } ` ,
463465 ) ;
464466
465467 if ( validatorList . data . pagination . total_page > 1 ) {
@@ -481,9 +483,8 @@ export class ChainIndexingAPI implements IChainIndexingAPI {
481483
482484 public async getValidatorsDetail ( validatorAddrList : string [ ] ) {
483485 const recentBlocks = '100' ;
484- const limit = '10000' ;
485486 const validatorList = await this . axiosClient . get < ValidatorListResponse > (
486- `validators?recentBlocks=${ recentBlocks } &limit=${ limit } ` ,
487+ `validators?recentBlocks=${ recentBlocks } &limit=${ VALIDATOR_FETCH_LIMIT } ` ,
487488 ) ;
488489
489490 if ( validatorList . data . pagination . total_page > 1 ) {
@@ -501,7 +502,7 @@ export class ChainIndexingAPI implements IChainIndexingAPI {
501502
502503 public async getValidatorsAverageApy ( validatorAddrList : string [ ] ) {
503504 const validatorList = await this . axiosClient . get < ValidatorListResponse > (
504- ' validators?limit=1000000' ,
505+ ` validators?limit=${ VALIDATOR_FETCH_LIMIT } ` ,
505506 ) ;
506507
507508 if ( validatorList . data . pagination . total_page > 1 ) {
0 commit comments