-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add optional 'options' argument to StakePoolSearchProvide…
…r.queryStakePools
- Loading branch information
1 parent
7c3d496
commit 6ae18a6
Showing
1 changed file
with
17 additions
and
2 deletions.
There are no files selected for viewing
19 changes: 17 additions & 2 deletions
19
packages/core/src/Provider/StakePoolSearchProvider/types/StakePoolSearchProvider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Cardano.StakePool[]>; | ||
queryStakePools: (fragments: string[], options?: StakePoolQueryOptions) => Promise<Cardano.StakePool[]>; | ||
} |