Run linters

This commit is contained in:
fragosti 2019-11-12 11:18:23 -08:00
parent 3b1dca0e70
commit 1a7e425780
8 changed files with 15 additions and 25 deletions

View File

@ -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);

View File

@ -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);
@ -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,

View File

@ -116,9 +116,9 @@ describe('HttpClient', () => {
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,

View File

@ -5,10 +5,7 @@
"rootDir": ".",
"resolveJsonModule": true
},
"include": [
"./src/**/*",
"./test/**/*"
],
"include": ["./src/**/*", "./test/**/*"],
"files": [
"./schemas/address_schema.json",
"./schemas/number_schema.json",

View File

@ -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

View File

@ -22,7 +22,6 @@ export const paginationParameters: ParameterObject[] = [
},
];
export const generateParameters = (parameters: ParameterObject[], isPaginated: boolean = false): ParameterObject[] => {
const optionalParameters = isPaginated ? paginationParameters : [];
return [...parameters, ...optionalParameters];