Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Don't throw when RFQ-T client isn't whitelisted
Browse files Browse the repository at this point in the history
Addresses review comments
#2541 (comment)
and
#2541 (comment)
  • Loading branch information
feuGeneA committed Apr 9, 2020
1 parent 70add44 commit 5f4778c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/asset-swapper/src/swap_quoter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,12 @@ export class SwapQuoter {
const orderPromises: Array<Promise<SignedOrder[]>> = [
this._getSignedOrdersAsync(makerAssetData, takerAssetData),
];
if (options.rfqt && options.rfqt.intentOnFilling && options.apiKey) {
if (!this._rfqtTakerApiKeyWhitelist.includes(options.apiKey)) {
throw new Error('API key not permissioned for RFQ-T');
}
if (
options.rfqt &&
options.rfqt.intentOnFilling &&
options.apiKey &&
this._rfqtTakerApiKeyWhitelist.includes(options.apiKey)
) {
if (!options.rfqt.takerAddress || options.rfqt.takerAddress === constants.NULL_ADDRESS) {
throw new Error('RFQ-T requests must specify a taker address');
}
Expand Down

0 comments on commit 5f4778c

Please sign in to comment.