From 44cc5e45cc3a3ed7db2691a287500e5d61a2d0c1 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 20 Aug 2018 11:53:49 -0700 Subject: Run prettier --- packages/connect/src/http_client.ts | 13 ++++++++++--- packages/connect/src/orders_channel_factory.ts | 5 +---- .../connect/src/schemas/order_config_request_schema.ts | 2 +- packages/connect/src/types.ts | 14 +++++--------- .../connect/src/utils/relayer_response_json_parsers.ts | 9 ++++++++- packages/connect/src/ws_orders_channel.ts | 7 +------ 6 files changed, 26 insertions(+), 24 deletions(-) (limited to 'packages/connect/src') diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index 4fdcfc338..93f4eeb05 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -59,7 +59,9 @@ export class HttpClient implements Client { * @param requestOpts Options specifying assetData information to retrieve and page information, defaults to { page: 1, perPage: 100 } * @return The resulting AssetPairsItems that match the request */ - public async getAssetPairsAsync(requestOpts?: RequestOpts & AssetPairsRequestOpts & PagedRequestOpts): Promise { + public async getAssetPairsAsync( + requestOpts?: RequestOpts & AssetPairsRequestOpts & PagedRequestOpts, + ): Promise { if (!_.isUndefined(requestOpts)) { assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.assetPairsRequestOptsSchema); assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema); @@ -77,7 +79,9 @@ export class HttpClient implements Client { * @param requestOpts Options specifying orders to retrieve and page information, defaults to { page: 1, perPage: 100 } * @return The resulting SignedOrders that match the request */ - public async getOrdersAsync(requestOpts?: RequestOpts & OrdersRequestOpts & PagedRequestOpts): Promise { + public async getOrdersAsync( + requestOpts?: RequestOpts & OrdersRequestOpts & PagedRequestOpts, + ): Promise { if (!_.isUndefined(requestOpts)) { assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.ordersRequestOptsSchema); assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema); @@ -134,7 +138,10 @@ export class HttpClient implements Client { * @param request A OrderConfigRequest instance describing the specific fees to retrieve * @return The resulting OrderConfigResponse that matches the request */ - public async getOrderConfigAsync(request: OrderConfigRequest, requestOpts?: RequestOpts): Promise { + public async getOrderConfigAsync( + request: OrderConfigRequest, + requestOpts?: RequestOpts, + ): Promise { if (!_.isUndefined(requestOpts)) { assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema); } diff --git a/packages/connect/src/orders_channel_factory.ts b/packages/connect/src/orders_channel_factory.ts index fae5cab8c..5e8e625e0 100644 --- a/packages/connect/src/orders_channel_factory.ts +++ b/packages/connect/src/orders_channel_factory.ts @@ -12,10 +12,7 @@ export const ordersChannelFactory = { * channel updates * @return An OrdersChannel Promise */ - async createWebSocketOrdersChannelAsync( - url: string, - handler: OrdersChannelHandler, - ): Promise { + async createWebSocketOrdersChannelAsync(url: string, handler: OrdersChannelHandler): Promise { assert.isUri('url', url); assert.isOrdersChannelHandler('handler', handler); return new Promise((resolve, reject) => { diff --git a/packages/connect/src/schemas/order_config_request_schema.ts b/packages/connect/src/schemas/order_config_request_schema.ts index 8f6b19500..0eda430e8 100644 --- a/packages/connect/src/schemas/order_config_request_schema.ts +++ b/packages/connect/src/schemas/order_config_request_schema.ts @@ -6,7 +6,7 @@ export const orderConfigRequestSchema = { takerAddress: { $ref: '/addressSchema' }, makerAssetAmount: { $ref: '/numberSchema' }, takerAssetAmount: { $ref: '/numberSchema' }, - makerAssetData: { $ref: '/hexSchema'}, + makerAssetData: { $ref: '/hexSchema' }, takerAssetData: { $ref: '/hexSchema' }, exchangeAddress: { $ref: '/addressSchema' }, expirationTimeSeconds: { $ref: '/numberSchema' }, diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts index dbed8899f..06ae732a5 100644 --- a/packages/connect/src/types.ts +++ b/packages/connect/src/types.ts @@ -2,7 +2,9 @@ import { SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; export interface Client { - getAssetPairsAsync: (requestOpts?: AssetPairsRequestOpts & PagedRequestOpts) => Promise>; + getAssetPairsAsync: ( + requestOpts?: AssetPairsRequestOpts & PagedRequestOpts, + ) => Promise>; getOrdersAsync: (requestOpts?: OrdersRequestOpts & PagedRequestOpts) => Promise>; getOrderAsync: (orderHash: string) => Promise; getOrderbookAsync: (request: OrderbookRequest, requestOpts?: PagedRequestOpts) => Promise; @@ -28,18 +30,12 @@ export interface OrdersChannelSubscriptionOpts { } export interface OrdersChannelHandler { - onUpdate: ( - channel: OrdersChannel, - subscriptionOpts: OrdersChannelSubscriptionOpts, - orders: APIOrder[], - ) => void; + onUpdate: (channel: OrdersChannel, subscriptionOpts: OrdersChannelSubscriptionOpts, orders: APIOrder[]) => void; onError: (channel: OrdersChannel, err: Error, subscriptionOpts?: OrdersChannelSubscriptionOpts) => void; onClose: (channel: OrdersChannel) => void; } -export type OrdersChannelMessage = - | UpdateOrdersChannelMessage - | UnknownOrdersChannelMessage; +export type OrdersChannelMessage = UpdateOrdersChannelMessage | UnknownOrdersChannelMessage; export enum OrdersChannelMessageTypes { Update = 'update', diff --git a/packages/connect/src/utils/relayer_response_json_parsers.ts b/packages/connect/src/utils/relayer_response_json_parsers.ts index dff854dfb..ebd877b70 100644 --- a/packages/connect/src/utils/relayer_response_json_parsers.ts +++ b/packages/connect/src/utils/relayer_response_json_parsers.ts @@ -1,7 +1,14 @@ import { assert } from '@0xproject/assert'; import { schemas } from '@0xproject/json-schemas'; -import { APIOrder, AssetPairsItem, AssetPairsResponse, OrderbookResponse, OrderConfigResponse, OrdersResponse } from '../types'; +import { + APIOrder, + AssetPairsItem, + AssetPairsResponse, + OrderbookResponse, + OrderConfigResponse, + OrdersResponse, +} from '../types'; import { typeConverters } from './type_converters'; diff --git a/packages/connect/src/ws_orders_channel.ts b/packages/connect/src/ws_orders_channel.ts index 62960d23a..cde4acbc3 100644 --- a/packages/connect/src/ws_orders_channel.ts +++ b/packages/connect/src/ws_orders_channel.ts @@ -2,12 +2,7 @@ import * as _ from 'lodash'; import { v4 as uuid } from 'uuid'; import * as WebSocket from 'websocket'; -import { - OrdersChannel, - OrdersChannelHandler, - OrdersChannelMessageTypes, - OrdersChannelSubscriptionOpts, -} from './types'; +import { OrdersChannel, OrdersChannelHandler, OrdersChannelMessageTypes, OrdersChannelSubscriptionOpts } from './types'; import { assert } from './utils/assert'; import { ordersChannelMessageParser } from './utils/orders_channel_message_parser'; -- cgit