From 6ae18a6915d771baef6d7104dfaf0f1054f93be8 Mon Sep 17 00:00:00 2001 From: Martynas Kazlauskas Date: Wed, 2 Feb 2022 17:22:06 +0200 Subject: [PATCH] feat(core): add optional 'options' argument to StakePoolSearchProvider.queryStakePools --- .../types/StakePoolSearchProvider.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/core/src/Provider/StakePoolSearchProvider/types/StakePoolSearchProvider.ts b/packages/core/src/Provider/StakePoolSearchProvider/types/StakePoolSearchProvider.ts index 3750b6b726e..86a644ecaa1 100644 --- a/packages/core/src/Provider/StakePoolSearchProvider/types/StakePoolSearchProvider.ts +++ b/packages/core/src/Provider/StakePoolSearchProvider/types/StakePoolSearchProvider.ts @@ -1,10 +1,25 @@ import { Cardano } from '../../..'; +export interface StakePoolQueryOptions { + /** + * Will fetch all stake pool reward history if not specified + */ + rewardsHistoryLimit?: number; + /** + * Will return all stake pools matching the query if not specified + */ + pagination?: { + startAt: number; + limit: number; + }; +} + export interface StakePoolSearchProvider { /** * @param {string[]} query an array of partial pool data: bech32 ID, name, ticker - * @returns Stake pools that match any fragment. + * @param {StakePoolQueryOptions} options query options + * @returns Stake pools that match any fragment * @throws ProviderError */ - queryStakePools: (fragments: string[]) => Promise; + queryStakePools: (fragments: string[], options?: StakePoolQueryOptions) => Promise; }