Skip to content

Commit

Permalink
Run linters
Browse files Browse the repository at this point in the history
  • Loading branch information
fragosti committed Nov 12, 2019
1 parent 3b1dca0 commit 1a7e425
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 25 deletions.
1 change: 0 additions & 1 deletion packages/asset-buyer/src/asset_buyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export class AssetBuyer {
): AssetBuyer {
const provider = providerUtils.standardizeOrThrow(supportedProvider);
assert.isWebUri('sraApiUrl', sraApiUrl);
const chainId = options.chainId || constants.DEFAULT_ASSET_BUYER_OPTS.chainId;
// HACK: asset-buy will be deleted, but do not pass in chainId to allow everything to compile.
const orderProvider = new StandardRelayerAPIOrderProvider(sraApiUrl);
const assetBuyer = new AssetBuyer(provider, orderProvider, options);
Expand Down
14 changes: 7 additions & 7 deletions packages/asset-swapper/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ export interface ForwarderSmartContractParamsBase {

export interface ForwarderMarketBuySmartContractParams
extends ExchangeMarketBuySmartContractParams,
ForwarderSmartContractParamsBase { }
ForwarderSmartContractParamsBase {}

// Temporary fix until typescript is upgraded to ^3.5
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

export interface ForwarderMarketSellSmartContractParams
extends Omit<ExchangeMarketSellSmartContractParams, 'takerAssetFillAmount'>,
ForwarderSmartContractParamsBase { }
ForwarderSmartContractParamsBase {}

/**
* Represents all the parameters to interface with 0x forwarder extension contract marketSell and marketBuy functions.
Expand Down Expand Up @@ -155,7 +155,7 @@ export interface SwapQuoteConsumerOpts {
/**
* Represents the options provided to a generic SwapQuoteConsumer
*/
export interface SwapQuoteGetOutputOptsBase { }
export interface SwapQuoteGetOutputOptsBase {}

/**
* takerAddress: The address to perform the buy. Defaults to the first available address from the provider.
Expand Down Expand Up @@ -194,12 +194,12 @@ export interface SwapQuoteGetOutputOpts extends ForwarderSwapQuoteGetOutputOpts
useExtensionContract: ExtensionContractType;
}

export interface ForwarderSwapQuoteExecutionOpts extends ForwarderSwapQuoteGetOutputOpts, SwapQuoteExecutionOptsBase { }
export interface ForwarderSwapQuoteExecutionOpts extends ForwarderSwapQuoteGetOutputOpts, SwapQuoteExecutionOptsBase {}

/**
* Represents the options for executing a swap quote with SwapQuoteConsumer
*/
export interface SwapQuoteExecutionOpts extends SwapQuoteGetOutputOpts, ForwarderSwapQuoteExecutionOpts { }
export interface SwapQuoteExecutionOpts extends SwapQuoteGetOutputOpts, ForwarderSwapQuoteExecutionOpts {}

/**
* takerAssetData: String that represents a specific taker asset (for more info: https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
Expand Down Expand Up @@ -240,9 +240,9 @@ export interface SwapQuoteWithAffiliateFeeBase {
feePercentage: number;
}

export interface MarketSellSwapQuoteWithAffiliateFee extends SwapQuoteWithAffiliateFeeBase, MarketSellSwapQuote { }
export interface MarketSellSwapQuoteWithAffiliateFee extends SwapQuoteWithAffiliateFeeBase, MarketSellSwapQuote {}

export interface MarketBuySwapQuoteWithAffiliateFee extends SwapQuoteWithAffiliateFeeBase, MarketBuySwapQuote { }
export interface MarketBuySwapQuoteWithAffiliateFee extends SwapQuoteWithAffiliateFeeBase, MarketBuySwapQuote {}

export type SwapQuoteWithAffiliateFee = MarketBuySwapQuoteWithAffiliateFee | MarketSellSwapQuoteWithAffiliateFee;

Expand Down
8 changes: 2 additions & 6 deletions packages/connect/src/http_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ export class HttpClient {
* @param requestOpts Options specifying orders to retrieve and page information, page information.
* @return The resulting OrdersResponse that match the request
*/
public async getOrdersAsync(
requestOpts?: OrdersRequestOpts & PagedRequestOpts,
): Promise<OrdersResponse> {
public async getOrdersAsync(requestOpts?: OrdersRequestOpts & PagedRequestOpts): Promise<OrdersResponse> {
if (requestOpts !== undefined) {
assert.doesConformToSchema('requestOpts', requestOpts, schemas.ordersRequestOptsSchema);
assert.doesConformToSchema('requestOpts', requestOpts, schemas.pagedRequestOptsSchema);
Expand Down Expand Up @@ -125,9 +123,7 @@ export class HttpClient {
* @param request A OrderConfigRequest instance describing the specific fees to retrieve
* @return The resulting OrderConfigResponse that matches the request
*/
public async getOrderConfigAsync(
request: OrderConfigRequest,
): Promise<OrderConfigResponse> {
public async getOrderConfigAsync(request: OrderConfigRequest): Promise<OrderConfigResponse> {
assert.doesConformToSchema('request', request, schemas.orderConfigRequestSchema);
const httpRequestOpts = {
payload: request,
Expand Down
8 changes: 4 additions & 4 deletions packages/connect/test/http_client_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ describe('HttpClient', () => {
it('gets orderbook with default page options when none are provided', async () => {
const urlWithQuery = `${url}?baseAssetData=${request.baseAssetData}&quoteAssetData=${
request.quoteAssetData
}`;
}`;
fetchMock.get(urlWithQuery, orderbookJSON);
const orderbook = await relayerClient.getOrderbookAsync(request);
expect(orderbook).to.be.deep.equal(orderbookResponse);
});
it('gets orderbook with specified page options', async () => {
const urlWithQuery = `${url}?baseAssetData=${
request.baseAssetData
}&page=3&perPage=50&quoteAssetData=${request.quoteAssetData}`;
const urlWithQuery = `${url}?baseAssetData=${request.baseAssetData}&page=3&perPage=50&quoteAssetData=${
request.quoteAssetData
}`;
fetchMock.get(urlWithQuery, orderbookJSON);
const pagedRequestOptions = {
page: 3,
Expand Down
5 changes: 1 addition & 4 deletions packages/json-schemas/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
"rootDir": ".",
"resolveJsonModule": true
},
"include": [
"./src/**/*",
"./test/**/*"
],
"include": ["./src/**/*", "./test/**/*"],
"files": [
"./schemas/address_schema.json",
"./schemas/number_schema.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class SRAWebsocketOrderProvider extends BaseSRAOrderProvider {
const ordersChannelHandler: OrdersChannelHandler = {
onUpdate: async (_channel, _opts, apiOrders) => this._handleOrderUpdates(apiOrders),
// tslint:disable-next-line:no-empty
onError: (_channel, _err) => { },
onError: (_channel, _err) => {},
onClose: async () => {
// Do not reconnect if destroyed
if (this._isDestroyed) {
Expand Down
1 change: 0 additions & 1 deletion packages/sra-spec/src/md/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ All endpoints that are paginated should return a `total`, `page`, `perPage` and

These requests include the [`/v3/asset_pairs`](#operation/getAssetPairs), [`/v3/orders`](#operation/getOrders), [`/v3/fee_recipients`](#operation/getFeeRecipients) and [`/v3/orderbook`](#operation/getOrderbook) endpoints.


# Link Header

A [Link Header](https://tools.ietf.org/html/rfc5988) can be included in a response to provide clients with more context about paging
Expand Down
1 change: 0 additions & 1 deletion packages/sra-spec/src/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const paginationParameters: ParameterObject[] = [
},
];


export const generateParameters = (parameters: ParameterObject[], isPaginated: boolean = false): ParameterObject[] => {
const optionalParameters = isPaginated ? paginationParameters : [];
return [...parameters, ...optionalParameters];
Expand Down

0 comments on commit 1a7e425

Please sign in to comment.