chore(): run linter fixes
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import axios, { AxiosRequestConfig, AxiosResponse, Method } from 'axios';
|
||||
import { RestClientType } from '../types';
|
||||
|
||||
import { RestClientType } from '../types';
|
||||
import { signMessage } from './node-support';
|
||||
import {
|
||||
getRestBaseUrl,
|
||||
RestClientOptions,
|
||||
serializeParams,
|
||||
getRestBaseUrl,
|
||||
} from './requestUtils';
|
||||
import { neverGuard } from './websocket-util';
|
||||
|
||||
interface SignedRequest<T extends object | undefined = {}> {
|
||||
interface SignedRequest<T extends object | undefined = object> {
|
||||
originalParams: T;
|
||||
paramsWithSign?: T & { sign: string };
|
||||
serializedParams: string;
|
||||
@@ -19,7 +19,7 @@ interface SignedRequest<T extends object | undefined = {}> {
|
||||
recvWindow: number;
|
||||
}
|
||||
|
||||
interface UnsignedRequest<T extends object | undefined = {}> {
|
||||
interface UnsignedRequest<T extends object | undefined = object> {
|
||||
originalParams: T;
|
||||
paramsWithSign: T;
|
||||
}
|
||||
@@ -229,7 +229,7 @@ export default abstract class BaseRestClient {
|
||||
/**
|
||||
* @private sign request and set recv window
|
||||
*/
|
||||
private async signRequest<T extends object | undefined = {}>(
|
||||
private async signRequest<T extends object | undefined = object>(
|
||||
data: T,
|
||||
endpoint: string,
|
||||
method: Method,
|
||||
|
||||
@@ -5,12 +5,12 @@ import WebSocket from 'isomorphic-ws';
|
||||
import {
|
||||
WebsocketClientOptions,
|
||||
WSClientConfigurableOptions,
|
||||
} from '../types/index.js';
|
||||
import { DefaultLogger } from './logger.js';
|
||||
import { isWsPong } from './requestUtils.js';
|
||||
import { getWsAuthSignature } from './websocket-util.js';
|
||||
import WsStore from './WsStore.js';
|
||||
import { WsConnectionStateEnum } from './WsStore.types.js';
|
||||
} from '../types/index';
|
||||
import { DefaultLogger } from './logger';
|
||||
import { isWsPong } from './requestUtils';
|
||||
import { getWsAuthSignature } from './websocket-util';
|
||||
import WsStore from './WsStore';
|
||||
import { WsConnectionStateEnum } from './WsStore.types';
|
||||
|
||||
interface WSClientEventMap<WsKey extends string> {
|
||||
/** Connection opened. If this connection was previously opened and reconnected, expect the reconnected event instead */
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import WebSocket from 'isomorphic-ws';
|
||||
|
||||
import { DefaultLogger } from './logger';
|
||||
import { WsConnectionStateEnum, WsStoredState } from './WsStore.types';
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ export async function signMessage(
|
||||
return _arrayBufferToBase64(signature);
|
||||
}
|
||||
default: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
((x: never) => {})(method);
|
||||
throw new Error(`Unhandled sign method: ${method}`);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export * from './BaseRestClient';
|
||||
export * from './requestUtils';
|
||||
export * from './WsStore';
|
||||
export * from './logger';
|
||||
export * from './requestUtils';
|
||||
export * from './type-guards';
|
||||
export * from './websocket-util';
|
||||
export * from './WsStore';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export type LogParams = null | any;
|
||||
|
||||
export const DefaultLogger = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
silly: (...params: LogParams): void => {
|
||||
// console.log(params);
|
||||
},
|
||||
|
||||
@@ -16,6 +16,7 @@ export async function signMessage(
|
||||
return hmac.digest().toString('base64');
|
||||
}
|
||||
default: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
((x: never) => {})(method);
|
||||
throw new Error(`Unhandled sign method: ${method}`);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface RestClientOptions {
|
||||
parseExceptions?: boolean;
|
||||
}
|
||||
|
||||
export function serializeParams<T extends object | undefined = {}>(
|
||||
export function serializeParams<T extends object | undefined = object>(
|
||||
params: T,
|
||||
strict_validation = false,
|
||||
encodeValues: boolean = true,
|
||||
|
||||
@@ -95,6 +95,7 @@ export function isPrivateChannel<TChannel extends string>(
|
||||
|
||||
export function getWsKeyForTopic(
|
||||
subscribeEvent: WsTopicSubscribeEventArgs,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
isPrivate?: boolean,
|
||||
): WsKey {
|
||||
const instType = subscribeEvent.instType.toUpperCase() as BitgetInstType;
|
||||
|
||||
Reference in New Issue
Block a user