diff --git a/packages/asset-swapper/src/utils/quote_requestor.ts b/packages/asset-swapper/src/utils/quote_requestor.ts index 3dec05d733..6a6b0fd4eb 100644 --- a/packages/asset-swapper/src/utils/quote_requestor.ts +++ b/packages/asset-swapper/src/utils/quote_requestor.ts @@ -83,7 +83,7 @@ export class QuoteRequestor { sellTokenAddress: string, // taker token assetFillAmount: BigNumber, comparisonPrice?: BigNumber, - isLastLook: boolean = false, + isLastLook?: boolean | undefined, ): TakerRequestQueryParams { const { buyAmountBaseUnits, sellAmountBaseUnits } = marketOperation === MarketOperation.Buy @@ -111,9 +111,11 @@ export class QuoteRequestor { buyTokenAddress, sellTokenAddress, comparisonPrice: comparisonPrice === undefined ? undefined : comparisonPrice.toString(), - isLastLook: isLastLook.toString(), protocolVersion: '4', }; + if (isLastLook) { + requestParamsWithBigNumbers.isLastLook = isLastLook.toString(); + } // convert BigNumbers to strings // so they are digestible by axios diff --git a/packages/asset-swapper/test/quote_requestor_test.ts b/packages/asset-swapper/test/quote_requestor_test.ts index 18350bfe4a..46a8677d9b 100644 --- a/packages/asset-swapper/test/quote_requestor_test.ts +++ b/packages/asset-swapper/test/quote_requestor_test.ts @@ -272,7 +272,6 @@ describe('QuoteRequestor', async () => { comparisonPrice: undefined, takerAddress, txOrigin, - isLastLook: 'false', protocolVersion: '4', }; const mockedDefaults = { @@ -579,7 +578,6 @@ describe('QuoteRequestor', async () => { comparisonPrice: undefined, takerAddress, txOrigin: takerAddress, - isLastLook: 'false', protocolVersion: '4', }; const mockedDefaults = { @@ -688,7 +686,6 @@ describe('QuoteRequestor', async () => { takerAddress, txOrigin: takerAddress, protocolVersion: '4', - isLastLook: 'false', }; const mockedDefaults = { requestApiKey: apiKey, @@ -773,7 +770,6 @@ describe('QuoteRequestor', async () => { comparisonPrice: undefined, takerAddress, txOrigin: takerAddress, - isLastLook: 'false', protocolVersion: '4', }; // Successful response