initial commit, add bitget rest api and websockets connector

This commit is contained in:
Tiago Siebler
2022-10-09 23:01:08 +01:00
commit 0f75ded05c
59 changed files with 15246 additions and 0 deletions

43
test/response.util.ts Normal file
View File

@@ -0,0 +1,43 @@
import { API_ERROR_CODE } from '../src';
const SUCCESS_MSG_REGEX = /success/gim;
export function successResponseString() {
return {
data: expect.any(String),
...sucessEmptyResponseObject(),
};
}
export function sucessEmptyResponseObject() {
return {
code: API_ERROR_CODE.SUCCESS,
msg: expect.stringMatching(SUCCESS_MSG_REGEX),
};
}
export function errorResponseObject(
result: null | any = null,
ret_code: number,
ret_msg: string
) {
return {
result,
ret_code,
ret_msg,
};
}
export function errorResponseObjectV3(
result: null | any = null,
retCode: number
) {
return {
result,
retCode: retCode,
};
}
export function notAuthenticatedError() {
return new Error('Private endpoints require api and private keys set');
}