Skip to content

Commit

Permalink
fix: remove hardcoded chainlink rate age (#1171)
Browse files Browse the repository at this point in the history
Signed-off-by: OjusWiZard <[email protected]>
  • Loading branch information
OjusWiZard committed Sep 18, 2023
1 parent 2ff5b09 commit 2d47d9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/payment-processor/src/payment/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export interface ISwapSettings {
* ['0xPaymentCurrency', '0xIntermediate1', ..., '0xRequestCurrency']
*/
path: string[];
/** maximum time in seconds of how old chainlink rate can be used, default is zero for infinitely old */
maxRateAge?: number;
}

export interface IConversionSettings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,6 @@ export function encodeSwapToPayAnyToErc20Request(
feeToPay, // _requestFeeAmount: BigNumberish,
feeAddress || constants.AddressZero, // _feeAddress: string,
Math.round(swapSettings.deadline / 1000), // _uniswapDeadline: BigNumberish,
0, // _chainlinkMaxRateTimespan: BigNumberish,
swapSettings.maxRateAge || 0, // _chainlinkMaxRateTimespan: BigNumberish,
]);
}

0 comments on commit 2d47d9f

Please sign in to comment.