From f51d482c9c7e367c38a248430ca875e7f2d9beac Mon Sep 17 00:00:00 2001 From: Daniele Ricci Date: Wed, 24 Apr 2024 21:47:54 +0200 Subject: [PATCH] feat(core): add location and distance to stake pools search fuzzy options --- .../StakePoolProvider/types/StakePoolProvider.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/core/src/Provider/StakePoolProvider/types/StakePoolProvider.ts b/packages/core/src/Provider/StakePoolProvider/types/StakePoolProvider.ts index 7c205f07c8c..037caa4c065 100644 --- a/packages/core/src/Provider/StakePoolProvider/types/StakePoolProvider.ts +++ b/packages/core/src/Provider/StakePoolProvider/types/StakePoolProvider.ts @@ -1,4 +1,5 @@ import { Cardano, Provider } from '../../..'; +import { DeepPartial } from '@cardano-sdk/util'; import { Paginated, PaginationArgs } from '../../types/Pagination'; import { SortFields } from '../util'; @@ -24,6 +25,12 @@ export interface MultipleChoiceSearchFilter { /** Options for the fuzzy search on stake pool metadata */ export interface FuzzyOptions { + /** Determines how close the match must be to the location. */ + distance: number; + + /** Determines approximately where in the text is the pattern expected to be found. */ + location: number; + /** Maximum threshold. `0`: exact match; `1`: match everything. */ threshold: number; @@ -55,7 +62,7 @@ export interface QueryStakePoolsArgs { }; /** Overrides default fuzzy options. Ignored in _live_ environments. */ - fuzzyOptions?: FuzzyOptions; + fuzzyOptions?: DeepPartial; /** * Used for APY metric computation. It will take 3 epochs back if not specified.