Run linters
This commit is contained in:
parent
3b1dca0e70
commit
1a7e425780
@ -76,7 +76,6 @@ export class AssetBuyer {
|
|||||||
): AssetBuyer {
|
): AssetBuyer {
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
assert.isWebUri('sraApiUrl', sraApiUrl);
|
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.
|
// HACK: asset-buy will be deleted, but do not pass in chainId to allow everything to compile.
|
||||||
const orderProvider = new StandardRelayerAPIOrderProvider(sraApiUrl);
|
const orderProvider = new StandardRelayerAPIOrderProvider(sraApiUrl);
|
||||||
const assetBuyer = new AssetBuyer(provider, orderProvider, options);
|
const assetBuyer = new AssetBuyer(provider, orderProvider, options);
|
||||||
|
@ -74,9 +74,7 @@ export class HttpClient {
|
|||||||
* @param requestOpts Options specifying orders to retrieve and page information, page information.
|
* @param requestOpts Options specifying orders to retrieve and page information, page information.
|
||||||
* @return The resulting OrdersResponse that match the request
|
* @return The resulting OrdersResponse that match the request
|
||||||
*/
|
*/
|
||||||
public async getOrdersAsync(
|
public async getOrdersAsync(requestOpts?: OrdersRequestOpts & PagedRequestOpts): Promise<OrdersResponse> {
|
||||||
requestOpts?: OrdersRequestOpts & PagedRequestOpts,
|
|
||||||
): Promise<OrdersResponse> {
|
|
||||||
if (requestOpts !== undefined) {
|
if (requestOpts !== undefined) {
|
||||||
assert.doesConformToSchema('requestOpts', requestOpts, schemas.ordersRequestOptsSchema);
|
assert.doesConformToSchema('requestOpts', requestOpts, schemas.ordersRequestOptsSchema);
|
||||||
assert.doesConformToSchema('requestOpts', requestOpts, schemas.pagedRequestOptsSchema);
|
assert.doesConformToSchema('requestOpts', requestOpts, schemas.pagedRequestOptsSchema);
|
||||||
@ -125,9 +123,7 @@ export class HttpClient {
|
|||||||
* @param request A OrderConfigRequest instance describing the specific fees to retrieve
|
* @param request A OrderConfigRequest instance describing the specific fees to retrieve
|
||||||
* @return The resulting OrderConfigResponse that matches the request
|
* @return The resulting OrderConfigResponse that matches the request
|
||||||
*/
|
*/
|
||||||
public async getOrderConfigAsync(
|
public async getOrderConfigAsync(request: OrderConfigRequest): Promise<OrderConfigResponse> {
|
||||||
request: OrderConfigRequest,
|
|
||||||
): Promise<OrderConfigResponse> {
|
|
||||||
assert.doesConformToSchema('request', request, schemas.orderConfigRequestSchema);
|
assert.doesConformToSchema('request', request, schemas.orderConfigRequestSchema);
|
||||||
const httpRequestOpts = {
|
const httpRequestOpts = {
|
||||||
payload: request,
|
payload: request,
|
||||||
|
@ -116,9 +116,9 @@ describe('HttpClient', () => {
|
|||||||
expect(orderbook).to.be.deep.equal(orderbookResponse);
|
expect(orderbook).to.be.deep.equal(orderbookResponse);
|
||||||
});
|
});
|
||||||
it('gets orderbook with specified page options', async () => {
|
it('gets orderbook with specified page options', async () => {
|
||||||
const urlWithQuery = `${url}?baseAssetData=${
|
const urlWithQuery = `${url}?baseAssetData=${request.baseAssetData}&page=3&perPage=50"eAssetData=${
|
||||||
request.baseAssetData
|
request.quoteAssetData
|
||||||
}&page=3&perPage=50"eAssetData=${request.quoteAssetData}`;
|
}`;
|
||||||
fetchMock.get(urlWithQuery, orderbookJSON);
|
fetchMock.get(urlWithQuery, orderbookJSON);
|
||||||
const pagedRequestOptions = {
|
const pagedRequestOptions = {
|
||||||
page: 3,
|
page: 3,
|
||||||
|
@ -5,10 +5,7 @@
|
|||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"resolveJsonModule": true
|
"resolveJsonModule": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["./src/**/*", "./test/**/*"],
|
||||||
"./src/**/*",
|
|
||||||
"./test/**/*"
|
|
||||||
],
|
|
||||||
"files": [
|
"files": [
|
||||||
"./schemas/address_schema.json",
|
"./schemas/address_schema.json",
|
||||||
"./schemas/number_schema.json",
|
"./schemas/number_schema.json",
|
||||||
|
@ -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.
|
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
|
# 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
|
A [Link Header](https://tools.ietf.org/html/rfc5988) can be included in a response to provide clients with more context about paging
|
||||||
|
@ -22,7 +22,6 @@ export const paginationParameters: ParameterObject[] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
export const generateParameters = (parameters: ParameterObject[], isPaginated: boolean = false): ParameterObject[] => {
|
export const generateParameters = (parameters: ParameterObject[], isPaginated: boolean = false): ParameterObject[] => {
|
||||||
const optionalParameters = isPaginated ? paginationParameters : [];
|
const optionalParameters = isPaginated ? paginationParameters : [];
|
||||||
return [...parameters, ...optionalParameters];
|
return [...parameters, ...optionalParameters];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user