Skip to content

Commit 8aff589

Browse files
committed
apply little eslint rules
1 parent d5ea406 commit 8aff589

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+547
-503
lines changed

README.md

+140-140
Large diffs are not rendered by default.

api/apiClient.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class ApiClient {
5151
}
5252

5353
public setApiKeySecret(key: string, secret: string) {
54-
const auth = this.authentications.apiv4 as GateApiV4Auth;
54+
const auth = this.authentications['apiv4'] as GateApiV4Auth;
5555
auth.key = key;
5656
auth.secret = secret;
5757
}
@@ -60,7 +60,7 @@ export class ApiClient {
6060
this.interceptors.push(interceptor);
6161
}
6262

63-
public applyToRequest(options: localVarRequest.Options, authSettings: string[]) {
63+
public applyToRequest(options: localVarRequest.Options, authSettings: Array<string>) {
6464
for (const auth of authSettings) {
6565
const authenticator = this.authentications[auth];
6666
if (authenticator) {
@@ -72,7 +72,7 @@ export class ApiClient {
7272
public async request<T>(
7373
options: localVarRequest.Options,
7474
responseType: string,
75-
authSettings: string[],
75+
authSettings: Array<string>,
7676
): Promise<{ response: http.IncomingMessage; body: T }> {
7777
const authenticationPromise = Promise.resolve();
7878
let interceptorPromise = authenticationPromise.then(() => this.applyToRequest(options, authSettings));
@@ -90,7 +90,7 @@ export class ApiClient {
9090
if (responseType.length > 0) {
9191
body = ObjectSerializer.deserialize(body, responseType);
9292
}
93-
resolve({ response, body });
93+
resolve({ response: response, body: body });
9494
} else {
9595
reject(new HttpError(response, body, response.statusCode));
9696
}

api/deliveryApi.ts

+97-79
Large diffs are not rendered by default.

api/futuresApi.ts

+92-78
Large diffs are not rendered by default.

api/marginApi.ts

+44-34
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class MarginApi {
7171
throw new Error('Required parameter currency was null or undefined when calling cancelLoan.');
7272
}
7373

74-
localVarQueryParameters.currency = ObjectSerializer.serialize(currency, 'string');
74+
localVarQueryParameters['currency'] = ObjectSerializer.serialize(currency, 'string');
7575

7676
const localVarUseFormData = false;
7777

@@ -175,7 +175,7 @@ export class MarginApi {
175175
throw new Error('Required parameter side was null or undefined when calling getLoan.');
176176
}
177177

178-
localVarQueryParameters.side = ObjectSerializer.serialize(side, "'lend' | 'borrow'");
178+
localVarQueryParameters['side'] = ObjectSerializer.serialize(side, "'lend' | 'borrow'");
179179

180180
const localVarUseFormData = false;
181181

@@ -236,7 +236,7 @@ export class MarginApi {
236236
throw new Error('Required parameter loanId was null or undefined when calling getLoanRecord.');
237237
}
238238

239-
localVarQueryParameters.loan_id = ObjectSerializer.serialize(loanId, 'string');
239+
localVarQueryParameters['loan_id'] = ObjectSerializer.serialize(loanId, 'string');
240240

241241
const localVarUseFormData = false;
242242

@@ -268,7 +268,7 @@ export class MarginApi {
268268
*/
269269
public async listFundingAccounts(opts: {
270270
currency?: string;
271-
}): Promise<{ response: http.IncomingMessage; body: FundingAccount[] }> {
271+
}): Promise<{ response: http.IncomingMessage; body: Array<FundingAccount> }> {
272272
const localVarPath = this.client.basePath + '/margin/funding_accounts';
273273
const localVarQueryParameters: any = {};
274274
const localVarHeaderParams: any = (<any>Object).assign({}, this.client.defaultHeaders);
@@ -283,7 +283,7 @@ export class MarginApi {
283283

284284
opts = opts || {};
285285
if (opts.currency !== undefined) {
286-
localVarQueryParameters.currency = ObjectSerializer.serialize(opts.currency, 'string');
286+
localVarQueryParameters['currency'] = ObjectSerializer.serialize(opts.currency, 'string');
287287
}
288288

289289
const localVarUseFormData = false;
@@ -305,7 +305,11 @@ export class MarginApi {
305305
}
306306

307307
const authSettings = ['apiv4'];
308-
return this.client.request<FundingAccount[]>(localVarRequestOptions, 'Array<FundingAccount>', authSettings);
308+
return this.client.request<Array<FundingAccount>>(
309+
localVarRequestOptions,
310+
'Array<FundingAccount>',
311+
authSettings,
312+
);
309313
}
310314

311315
/**
@@ -315,7 +319,7 @@ export class MarginApi {
315319
*/
316320
public async listFundingBook(
317321
currency: string,
318-
): Promise<{ response: http.IncomingMessage; body: FundingBookItem[] }> {
322+
): Promise<{ response: http.IncomingMessage; body: Array<FundingBookItem> }> {
319323
const localVarPath = this.client.basePath + '/margin/funding_book';
320324
const localVarQueryParameters: any = {};
321325
const localVarHeaderParams: any = (<any>Object).assign({}, this.client.defaultHeaders);
@@ -333,7 +337,7 @@ export class MarginApi {
333337
throw new Error('Required parameter currency was null or undefined when calling listFundingBook.');
334338
}
335339

336-
localVarQueryParameters.currency = ObjectSerializer.serialize(currency, 'string');
340+
localVarQueryParameters['currency'] = ObjectSerializer.serialize(currency, 'string');
337341

338342
const localVarUseFormData = false;
339343

@@ -354,7 +358,11 @@ export class MarginApi {
354358
}
355359

356360
const authSettings = [];
357-
return this.client.request<FundingBookItem[]>(localVarRequestOptions, 'Array<FundingBookItem>', authSettings);
361+
return this.client.request<Array<FundingBookItem>>(
362+
localVarRequestOptions,
363+
'Array<FundingBookItem>',
364+
authSettings,
365+
);
358366
}
359367

360368
/**
@@ -369,7 +377,7 @@ export class MarginApi {
369377
public async listLoanRecords(
370378
loanId: string,
371379
opts: { status?: 'loaned' | 'finished'; page?: number; limit?: number },
372-
): Promise<{ response: http.IncomingMessage; body: LoanRecord[] }> {
380+
): Promise<{ response: http.IncomingMessage; body: Array<LoanRecord> }> {
373381
const localVarPath = this.client.basePath + '/margin/loan_records';
374382
const localVarQueryParameters: any = {};
375383
const localVarHeaderParams: any = (<any>Object).assign({}, this.client.defaultHeaders);
@@ -388,18 +396,18 @@ export class MarginApi {
388396
}
389397

390398
opts = opts || {};
391-
localVarQueryParameters.loan_id = ObjectSerializer.serialize(loanId, 'string');
399+
localVarQueryParameters['loan_id'] = ObjectSerializer.serialize(loanId, 'string');
392400

393401
if (opts.status !== undefined) {
394-
localVarQueryParameters.status = ObjectSerializer.serialize(opts.status, "'loaned' | 'finished'");
402+
localVarQueryParameters['status'] = ObjectSerializer.serialize(opts.status, "'loaned' | 'finished'");
395403
}
396404

397405
if (opts.page !== undefined) {
398-
localVarQueryParameters.page = ObjectSerializer.serialize(opts.page, 'number');
406+
localVarQueryParameters['page'] = ObjectSerializer.serialize(opts.page, 'number');
399407
}
400408

401409
if (opts.limit !== undefined) {
402-
localVarQueryParameters.limit = ObjectSerializer.serialize(opts.limit, 'number');
410+
localVarQueryParameters['limit'] = ObjectSerializer.serialize(opts.limit, 'number');
403411
}
404412

405413
const localVarUseFormData = false;
@@ -421,15 +429,17 @@ export class MarginApi {
421429
}
422430

423431
const authSettings = ['apiv4'];
424-
return this.client.request<LoanRecord[]>(localVarRequestOptions, 'Array<LoanRecord>', authSettings);
432+
return this.client.request<Array<LoanRecord>>(localVarRequestOptions, 'Array<LoanRecord>', authSettings);
425433
}
426434

427435
/**
428436
*
429437
* @summary List loan repayment records
430438
* @param loanId Loan ID
431439
*/
432-
public async listLoanRepayments(loanId: string): Promise<{ response: http.IncomingMessage; body: Repayment[] }> {
440+
public async listLoanRepayments(
441+
loanId: string,
442+
): Promise<{ response: http.IncomingMessage; body: Array<Repayment> }> {
433443
const localVarPath =
434444
this.client.basePath +
435445
'/margin/loans/{loan_id}/repayment'.replace('{' + 'loan_id' + '}', encodeURIComponent(String(loanId)));
@@ -468,7 +478,7 @@ export class MarginApi {
468478
}
469479

470480
const authSettings = ['apiv4'];
471-
return this.client.request<Repayment[]>(localVarRequestOptions, 'Array<Repayment>', authSettings);
481+
return this.client.request<Array<Repayment>>(localVarRequestOptions, 'Array<Repayment>', authSettings);
472482
}
473483

474484
/**
@@ -495,7 +505,7 @@ export class MarginApi {
495505
page?: number;
496506
limit?: number;
497507
},
498-
): Promise<{ response: http.IncomingMessage; body: Loan[] }> {
508+
): Promise<{ response: http.IncomingMessage; body: Array<Loan> }> {
499509
const localVarPath = this.client.basePath + '/margin/loans';
500510
const localVarQueryParameters: any = {};
501511
const localVarHeaderParams: any = (<any>Object).assign({}, this.client.defaultHeaders);
@@ -519,35 +529,35 @@ export class MarginApi {
519529
}
520530

521531
opts = opts || {};
522-
localVarQueryParameters.status = ObjectSerializer.serialize(
532+
localVarQueryParameters['status'] = ObjectSerializer.serialize(
523533
status,
524534
"'open' | 'loaned' | 'finished' | 'auto_repaid'",
525535
);
526536

527-
localVarQueryParameters.side = ObjectSerializer.serialize(side, "'lend' | 'borrow'");
537+
localVarQueryParameters['side'] = ObjectSerializer.serialize(side, "'lend' | 'borrow'");
528538

529539
if (opts.currency !== undefined) {
530-
localVarQueryParameters.currency = ObjectSerializer.serialize(opts.currency, 'string');
540+
localVarQueryParameters['currency'] = ObjectSerializer.serialize(opts.currency, 'string');
531541
}
532542

533543
if (opts.currencyPair !== undefined) {
534-
localVarQueryParameters.currency_pair = ObjectSerializer.serialize(opts.currencyPair, 'string');
544+
localVarQueryParameters['currency_pair'] = ObjectSerializer.serialize(opts.currencyPair, 'string');
535545
}
536546

537547
if (opts.sortBy !== undefined) {
538-
localVarQueryParameters.sort_by = ObjectSerializer.serialize(opts.sortBy, "'create_time' | 'rate'");
548+
localVarQueryParameters['sort_by'] = ObjectSerializer.serialize(opts.sortBy, "'create_time' | 'rate'");
539549
}
540550

541551
if (opts.reverseSort !== undefined) {
542-
localVarQueryParameters.reverse_sort = ObjectSerializer.serialize(opts.reverseSort, 'boolean');
552+
localVarQueryParameters['reverse_sort'] = ObjectSerializer.serialize(opts.reverseSort, 'boolean');
543553
}
544554

545555
if (opts.page !== undefined) {
546-
localVarQueryParameters.page = ObjectSerializer.serialize(opts.page, 'number');
556+
localVarQueryParameters['page'] = ObjectSerializer.serialize(opts.page, 'number');
547557
}
548558

549559
if (opts.limit !== undefined) {
550-
localVarQueryParameters.limit = ObjectSerializer.serialize(opts.limit, 'number');
560+
localVarQueryParameters['limit'] = ObjectSerializer.serialize(opts.limit, 'number');
551561
}
552562

553563
const localVarUseFormData = false;
@@ -569,7 +579,7 @@ export class MarginApi {
569579
}
570580

571581
const authSettings = ['apiv4'];
572-
return this.client.request<Loan[]>(localVarRequestOptions, 'Array<Loan>', authSettings);
582+
return this.client.request<Array<Loan>>(localVarRequestOptions, 'Array<Loan>', authSettings);
573583
}
574584

575585
/**
@@ -580,7 +590,7 @@ export class MarginApi {
580590
*/
581591
public async listMarginAccounts(opts: {
582592
currencyPair?: string;
583-
}): Promise<{ response: http.IncomingMessage; body: MarginAccount[] }> {
593+
}): Promise<{ response: http.IncomingMessage; body: Array<MarginAccount> }> {
584594
const localVarPath = this.client.basePath + '/margin/accounts';
585595
const localVarQueryParameters: any = {};
586596
const localVarHeaderParams: any = (<any>Object).assign({}, this.client.defaultHeaders);
@@ -595,7 +605,7 @@ export class MarginApi {
595605

596606
opts = opts || {};
597607
if (opts.currencyPair !== undefined) {
598-
localVarQueryParameters.currency_pair = ObjectSerializer.serialize(opts.currencyPair, 'string');
608+
localVarQueryParameters['currency_pair'] = ObjectSerializer.serialize(opts.currencyPair, 'string');
599609
}
600610

601611
const localVarUseFormData = false;
@@ -617,7 +627,7 @@ export class MarginApi {
617627
}
618628

619629
const authSettings = ['apiv4'];
620-
return this.client.request<MarginAccount[]>(localVarRequestOptions, 'Array<MarginAccount>', authSettings);
630+
return this.client.request<Array<MarginAccount>>(localVarRequestOptions, 'Array<MarginAccount>', authSettings);
621631
}
622632

623633
/**
@@ -626,7 +636,7 @@ export class MarginApi {
626636
*/
627637
public async listMarginCurrencyPairs(): Promise<{
628638
response: http.IncomingMessage;
629-
body: MarginCurrencyPair[];
639+
body: Array<MarginCurrencyPair>;
630640
}> {
631641
const localVarPath = this.client.basePath + '/margin/currency_pairs';
632642
const localVarQueryParameters: any = {};
@@ -659,7 +669,7 @@ export class MarginApi {
659669
}
660670

661671
const authSettings = [];
662-
return this.client.request<MarginCurrencyPair[]>(
672+
return this.client.request<Array<MarginCurrencyPair>>(
663673
localVarRequestOptions,
664674
'Array<MarginCurrencyPair>',
665675
authSettings,
@@ -695,9 +705,9 @@ export class MarginApi {
695705
throw new Error('Required parameter ids was null or undefined when calling mergeLoans.');
696706
}
697707

698-
localVarQueryParameters.currency = ObjectSerializer.serialize(currency, 'string');
708+
localVarQueryParameters['currency'] = ObjectSerializer.serialize(currency, 'string');
699709

700-
localVarQueryParameters.ids = ObjectSerializer.serialize(ids, 'string');
710+
localVarQueryParameters['ids'] = ObjectSerializer.serialize(ids, 'string');
701711

702712
const localVarUseFormData = false;
703713

0 commit comments

Comments
 (0)