Skip to content

Commit

Permalink
fix: remove hardcoded chainlink rate age (#1171)
Browse files Browse the repository at this point in the history
Authored-by: OjusWiZard <ojuswimail@gmail.com>
  • Loading branch information
OjusWiZard committed Sep 21, 2023
1 parent 2ff5b09 commit 0fa63d6
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 @@ -33,6 +33,8 @@ export interface IConversionSettings {
maxToSpend?: BigNumberish;
/** a currency manager to access currencies property, like decimals */
currencyManager?: ICurrencyManager;
/** maximum time in seconds of how old chainlink rate can be used, default is zero for infinitely old */
maxRateAge?: number;
}

/**
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,
conversionSettings.maxRateAge ?? 0, // _chainlinkMaxRateTimespan: BigNumberish,
]);
}

0 comments on commit 0fa63d6

Please sign in to comment.