Skip to content

Commit

Permalink
Add the slippage parameter to the list of parameters in the returned …
Browse files Browse the repository at this point in the history
…quote (#120)
  • Loading branch information
Masha1996 authored Dec 19, 2024
1 parent 035520e commit d53ee0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/quoter/quote/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export class Quote {

public readonly quoteId: string | null

public readonly silippage: number

constructor(
private readonly params: QuoterRequest,
response: QuoterResponse
Expand All @@ -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)
}

Expand Down
1 change: 1 addition & 0 deletions src/api/quoter/quoter.api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('Quoter API', () => {
const ResponseMock = {
fromTokenAmount: '1000000000000000000000',
recommended_preset: PresetEnum.medium,
autoK: 5.5,
feeToken: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
presets: {
fast: {
Expand Down
1 change: 1 addition & 0 deletions src/api/quoter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export type QuoterResponse = {
settlementAddress: string
whitelist: string[]
quoteId: string | null
autoK: number
}

export type QuoterPresets = {
Expand Down

0 comments on commit d53ee0d

Please sign in to comment.