v1.0.6: fix() fix type differences for spot vs futures candles. Add example for fetching last 1k futures candles

This commit is contained in:
Tiago Siebler
2023-04-04 11:58:09 +01:00
parent f367061665
commit f3d837bde6
11 changed files with 131 additions and 9 deletions

View File

@@ -26,6 +26,47 @@ interface UnsignedRequest<T extends object | undefined = {}> {
type SignMethod = 'bitget';
if (
typeof process === 'object' &&
typeof process.env === 'object' &&
process.env.BITGETTRACE
) {
axios.interceptors.request.use((request) => {
console.log(
new Date(),
'Starting Request',
JSON.stringify(
{
url: request.url,
method: request.method,
params: request.params,
data: request.data,
},
null,
2,
),
);
return request;
});
axios.interceptors.response.use((response) => {
console.log(new Date(), 'Response:', {
// request: {
// url: response.config.url,
// method: response.config.method,
// data: response.config.data,
// headers: response.config.headers,
// },
response: {
status: response.status,
statusText: response.statusText,
headers: response.headers,
data: response.data,
},
});
return response;
});
}
export default abstract class BaseRestClient {
private options: RestClientOptions;
private baseUrl: string;