From cfa2a90dae0ed3ec7ee94a9b09a9f58cb3e3b673 Mon Sep 17 00:00:00 2001 From: David Sun Date: Wed, 26 Jun 2019 15:22:04 -0700 Subject: [PATCH] prettier --- .../exchange_swap_quote_consumer.ts | 28 +++++++++++-------- .../src/utils/swap_quote_consumer_utils.ts | 10 +++---- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/packages/asset-buyer/src/quote_consumers/exchange_swap_quote_consumer.ts b/packages/asset-buyer/src/quote_consumers/exchange_swap_quote_consumer.ts index 49c4831562..bf705a4fe7 100644 --- a/packages/asset-buyer/src/quote_consumers/exchange_swap_quote_consumer.ts +++ b/packages/asset-buyer/src/quote_consumers/exchange_swap_quote_consumer.ts @@ -21,7 +21,6 @@ import { swapQuoteConsumerUtils } from '../utils/swap_quote_consumer_utils'; import { utils } from '../utils/utils'; export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumer { - public readonly provider: ZeroExProvider; public readonly networkId: number; @@ -39,16 +38,15 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumer): Promise { + public async getCalldataOrThrowAsync( + quote: SwapQuote, + opts: Partial, + ): Promise { assert.isValidSwapQuote('quote', quote); const { params, to, ethAmount, methodAbi } = await this.getSmartContractParamsOrThrowAsync(quote, opts); const abiEncoder = new AbiEncoder.Method(methodAbi); - const args = [ - params.orders, - params.makerAssetFillAmount, - params.signatures, - ]; + const args = [params.orders, params.makerAssetFillAmount, params.signatures]; const calldataHexString = abiEncoder.encode(args); return { calldataHexString, @@ -58,7 +56,10 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumer): Promise> { + public async getSmartContractParamsOrThrowAsync( + quote: SwapQuote, + opts: Partial, + ): Promise> { assert.isValidSwapQuote('quote', quote); const { orders, makerAssetFillAmount } = quote; @@ -66,9 +67,9 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumer o.signature); const params: ExchangeMarketBuySmartContractParams = { - orders, - signatures, - makerAssetFillAmount, + orders, + signatures, + makerAssetFillAmount, }; const methodAbi = utils.getMethodAbiFromContractAbi( @@ -83,7 +84,10 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumer): Promise { + public async executeSwapQuoteOrThrowAsync( + quote: SwapQuote, + opts: Partial, + ): Promise { assert.isValidSwapQuote('quote', quote); const { takerAddress, gasLimit, gasPrice } = opts; diff --git a/packages/asset-buyer/src/utils/swap_quote_consumer_utils.ts b/packages/asset-buyer/src/utils/swap_quote_consumer_utils.ts index 90841a3299..cb81d42a7d 100644 --- a/packages/asset-buyer/src/utils/swap_quote_consumer_utils.ts +++ b/packages/asset-buyer/src/utils/swap_quote_consumer_utils.ts @@ -1,13 +1,13 @@ import { SupportedProvider, Web3Wrapper } from '@0x/web3-wrapper'; import * as _ from 'lodash'; -import { - SwapQuoteConsumerError, - SwapQuoteExecutionOpts, - } from '../types'; +import { SwapQuoteConsumerError, SwapQuoteExecutionOpts } from '../types'; export const swapQuoteConsumerUtils = { - async getTakerAddressOrThrowAsync(provider: SupportedProvider, opts: Partial): Promise { + async getTakerAddressOrThrowAsync( + provider: SupportedProvider, + opts: Partial, + ): Promise { if (opts.takerAddress !== undefined) { return opts.takerAddress; } else {