only set Last Look parameter if it's explicitly set (#200)
* only set Last Look parameter if it's explicitly set * remove expoectation of having isLastLook
This commit is contained in:
parent
9ce73931f7
commit
a019bb913d
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user