Skip to content

Commit

Permalink
pass allowMultipleFills/allowPartialFills to fusion order
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrvk committed Mar 11, 2024
1 parent 4b1cd40 commit e8e5010
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/api/quoter/preset.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {AuctionPoint, PresetData} from './types'
import {AuctionDetails} from '../../fusion-order/auction-details'
import {AuctionDetails} from '../../fusion-order'
import {Address} from '@1inch/limit-order-sdk'

export class Preset {
Expand All @@ -26,6 +26,10 @@ export class Preset {

public readonly exclusiveResolver?: Address

public readonly allowPartialFills: boolean

public readonly allowMultipleFills: boolean

constructor(preset: PresetData) {
this.auctionDuration = BigInt(preset.auctionDuration)
this.startAuctionIn = BigInt(preset.startAuctionIn)
Expand All @@ -42,6 +46,8 @@ export class Preset {
this.exclusiveResolver = preset.exclusiveResolver
? new Address(preset.exclusiveResolver)
: undefined
this.allowPartialFills = preset.allowPartialFills
this.allowMultipleFills = preset.allowMultipleFills
}

createAuctionDetails(additionalWaitPeriod = 0n): AuctionDetails {
Expand Down
5 changes: 4 additions & 1 deletion src/api/quoter/quote/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ export class Quote {
permit: params.permit
? this.params.fromTokenAddress + params.permit.substring(2)
: undefined,
allowPartialFills: paramsData?.allowPartialFills,
allowPartialFills:
paramsData?.allowPartialFills ?? preset.allowPartialFills,
allowMultipleFills:
paramsData?.allowMultipleFills ?? preset.allowMultipleFills,
orderExpirationDelay: paramsData?.orderExpirationDelay
}
)
Expand Down
2 changes: 2 additions & 0 deletions src/api/quoter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export type PresetData = {
auctionEndAmount: string
tokenFee: string
points: AuctionPoint[]
allowPartialFills: boolean
allowMultipleFills: boolean
gasCost?: {
gasBumpEstimate: string
gasPriceEstimate: string
Expand Down

0 comments on commit e8e5010

Please sign in to comment.