This repository was archived by the owner on Jul 9, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
packages/asset-swapper/src Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -535,31 +535,32 @@ export class SwapQuoter {
535
535
gasPrice = await this . _protocolFeeUtils . getGasPriceEstimationOrThrowAsync ( ) ;
536
536
}
537
537
// get the relevant orders for the makerAsset
538
- let orders = await this . _getSignedOrdersAsync ( makerAssetData , takerAssetData ) ;
538
+ const orderPromises : Array < Promise < SignedOrder [ ] > > = [ this . _getSignedOrdersAsync ( makerAssetData , takerAssetData ) ] ;
539
539
if ( options . intentOnFilling && options . apiKey ) {
540
540
if ( ! this . rfqtTakerApiKeyWhitelist . includes ( options . apiKey ) ) {
541
541
throw new Error ( 'API key not permissioned for RFQ-T' ) ;
542
542
}
543
543
if ( ! options . takerAddress || options . takerAddress === constants . NULL_ADDRESS ) {
544
544
throw new Error ( 'RFQ-T requests must specify a taker address' ) ;
545
545
}
546
- orders . push (
547
- ... ( await this . _quoteRequestor . requestRfqtFirmQuotesAsync (
546
+ orderPromises . push (
547
+ this . _quoteRequestor . requestRfqtFirmQuotesAsync (
548
548
makerAssetData ,
549
549
takerAssetData ,
550
550
assetFillAmount ,
551
551
marketOperation ,
552
552
options . intentOnFilling ,
553
553
options . apiKey ,
554
554
options . takerAddress ,
555
- ) ) ,
555
+ ) ,
556
556
) ;
557
557
}
558
+ const orders : SignedOrder [ ] = ( [ ] as SignedOrder [ ] ) . concat ( ...( await Promise . all ( orderPromises ) ) ) ;
558
559
// if no native orders, pass in a dummy order for the sampler to have required metadata for sampling
559
560
if ( orders . length === 0 ) {
560
- orders = [
561
+ orders . push (
561
562
createDummyOrderForSampler ( makerAssetData , takerAssetData , this . _contractAddresses . uniswapBridge ) ,
562
- ] ;
563
+ ) ;
563
564
}
564
565
565
566
let swapQuote : SwapQuote ;
You can’t perform that action at this time.
0 commit comments