From 30f88261f48827475991adb5d513c103eb98b4af Mon Sep 17 00:00:00 2001 From: Maria Date: Wed, 18 Dec 2024 14:14:43 +0200 Subject: [PATCH 1/2] Add the slippage parameter to the list of parameters in the returned quote --- src/api/quoter/quote/quote.ts | 3 +++ src/api/quoter/types.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/src/api/quoter/quote/quote.ts b/src/api/quoter/quote/quote.ts index 6a42d00..b2dc896 100644 --- a/src/api/quoter/quote/quote.ts +++ b/src/api/quoter/quote/quote.ts @@ -39,6 +39,8 @@ export class Quote { public readonly quoteId: string | null + public readonly silippage: number + constructor( private readonly params: QuoterRequest, response: QuoterResponse @@ -59,6 +61,7 @@ export class Quote { this.quoteId = response.quoteId this.whitelist = response.whitelist.map((a) => new Address(a)) this.recommendedPreset = response.recommended_preset + this.silippage = response.autoK this.settlementAddress = new Address(response.settlementAddress) } diff --git a/src/api/quoter/types.ts b/src/api/quoter/types.ts index c6afbc3..0e1b878 100644 --- a/src/api/quoter/types.ts +++ b/src/api/quoter/types.ts @@ -33,6 +33,7 @@ export type QuoterResponse = { settlementAddress: string whitelist: string[] quoteId: string | null + autoK: number } export type QuoterPresets = { From 5ea2593f500992e017ad7661b14fd4d62efdc8e2 Mon Sep 17 00:00:00 2001 From: Maria Date: Wed, 18 Dec 2024 17:01:33 +0200 Subject: [PATCH 2/2] fix lint --- src/api/quoter/quoter.api.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/quoter/quoter.api.spec.ts b/src/api/quoter/quoter.api.spec.ts index 7e2bb8d..7175aa7 100644 --- a/src/api/quoter/quoter.api.spec.ts +++ b/src/api/quoter/quoter.api.spec.ts @@ -29,6 +29,7 @@ describe('Quoter API', () => { const ResponseMock = { fromTokenAmount: '1000000000000000000000', recommended_preset: PresetEnum.medium, + autoK: 5.5, feeToken: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', presets: { fast: {