Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the slippage parameter to the list of parameters in the returned quote #120

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading