reduce browser bundle size

reduces browser bundle size by ~612k or ~92%.
This commit is contained in:
Stefan Aebischer
2021-05-15 19:34:32 +02:00
parent c5fb3f2b02
commit 082633a5ca
8 changed files with 38 additions and 464 deletions

View File

@@ -1,5 +1,3 @@
import { createHmac } from 'crypto';
export interface RestClientOptions {
// override the max size of the request window (in ms)
recv_window?: number;
@@ -23,12 +21,6 @@ export interface RestClientOptions {
export type GenericAPIResponse = Promise<any>;
export function signMessage(message: string, secret: string): string {
return createHmac('sha256', secret)
.update(message)
.digest('hex');
};
export function serializeParams(params: object = {}, strict_validation = false): string {
return Object.keys(params)
.sort()
@@ -75,4 +67,4 @@ export function isWsPong(response: any) {
response.ret_msg === 'pong' &&
response.success === true
);
}
}