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
|
sellTokenAddress: string, // taker token
|
||||||
assetFillAmount: BigNumber,
|
assetFillAmount: BigNumber,
|
||||||
comparisonPrice?: BigNumber,
|
comparisonPrice?: BigNumber,
|
||||||
isLastLook: boolean = false,
|
isLastLook?: boolean | undefined,
|
||||||
): TakerRequestQueryParams {
|
): TakerRequestQueryParams {
|
||||||
const { buyAmountBaseUnits, sellAmountBaseUnits } =
|
const { buyAmountBaseUnits, sellAmountBaseUnits } =
|
||||||
marketOperation === MarketOperation.Buy
|
marketOperation === MarketOperation.Buy
|
||||||
@ -111,9 +111,11 @@ export class QuoteRequestor {
|
|||||||
buyTokenAddress,
|
buyTokenAddress,
|
||||||
sellTokenAddress,
|
sellTokenAddress,
|
||||||
comparisonPrice: comparisonPrice === undefined ? undefined : comparisonPrice.toString(),
|
comparisonPrice: comparisonPrice === undefined ? undefined : comparisonPrice.toString(),
|
||||||
isLastLook: isLastLook.toString(),
|
|
||||||
protocolVersion: '4',
|
protocolVersion: '4',
|
||||||
};
|
};
|
||||||
|
if (isLastLook) {
|
||||||
|
requestParamsWithBigNumbers.isLastLook = isLastLook.toString();
|
||||||
|
}
|
||||||
|
|
||||||
// convert BigNumbers to strings
|
// convert BigNumbers to strings
|
||||||
// so they are digestible by axios
|
// so they are digestible by axios
|
||||||
|
@ -272,7 +272,6 @@ describe('QuoteRequestor', async () => {
|
|||||||
comparisonPrice: undefined,
|
comparisonPrice: undefined,
|
||||||
takerAddress,
|
takerAddress,
|
||||||
txOrigin,
|
txOrigin,
|
||||||
isLastLook: 'false',
|
|
||||||
protocolVersion: '4',
|
protocolVersion: '4',
|
||||||
};
|
};
|
||||||
const mockedDefaults = {
|
const mockedDefaults = {
|
||||||
@ -579,7 +578,6 @@ describe('QuoteRequestor', async () => {
|
|||||||
comparisonPrice: undefined,
|
comparisonPrice: undefined,
|
||||||
takerAddress,
|
takerAddress,
|
||||||
txOrigin: takerAddress,
|
txOrigin: takerAddress,
|
||||||
isLastLook: 'false',
|
|
||||||
protocolVersion: '4',
|
protocolVersion: '4',
|
||||||
};
|
};
|
||||||
const mockedDefaults = {
|
const mockedDefaults = {
|
||||||
@ -688,7 +686,6 @@ describe('QuoteRequestor', async () => {
|
|||||||
takerAddress,
|
takerAddress,
|
||||||
txOrigin: takerAddress,
|
txOrigin: takerAddress,
|
||||||
protocolVersion: '4',
|
protocolVersion: '4',
|
||||||
isLastLook: 'false',
|
|
||||||
};
|
};
|
||||||
const mockedDefaults = {
|
const mockedDefaults = {
|
||||||
requestApiKey: apiKey,
|
requestApiKey: apiKey,
|
||||||
@ -773,7 +770,6 @@ describe('QuoteRequestor', async () => {
|
|||||||
comparisonPrice: undefined,
|
comparisonPrice: undefined,
|
||||||
takerAddress,
|
takerAddress,
|
||||||
txOrigin: takerAddress,
|
txOrigin: takerAddress,
|
||||||
isLastLook: 'false',
|
|
||||||
protocolVersion: '4',
|
protocolVersion: '4',
|
||||||
};
|
};
|
||||||
// Successful response
|
// Successful response
|
||||||
|
Loading…
x
Reference in New Issue
Block a user