chore(): updates for pre-V5 deprecations

This commit is contained in:
tiagosiebler
2025-01-24 15:35:11 +00:00
parent 03169b324c
commit a4945d1caf
4 changed files with 27 additions and 134 deletions

View File

@@ -51,8 +51,6 @@ interface SignedRequestContext {
timestamp?: number;
api_key?: string;
recv_window?: number;
// spot v1 is diff from the rest...
recvWindow?: number;
}
interface SignedRequest<T> {
@@ -72,7 +70,7 @@ interface UnsignedRequest<T> {
recvWindow?: number;
}
type SignMethod = 'v2auth' | 'v5auth';
type SignMethod = 'v5auth';
export default abstract class BaseRestClient {
private timeOffset: number | null = null;
@@ -443,40 +441,6 @@ export default abstract class BaseRestClient {
return res;
}
// spot/v2 derivatives
if (signMethod === 'v2auth') {
res.originalParams.api_key = key;
res.originalParams.timestamp = timestamp;
// Optional, set to 5000 by default. Increase if timestamp/recv_window errors are seen.
if (recvWindow) {
res.originalParams.recv_window = recvWindow;
}
const sortProperties = true;
const encodeValues = false;
res.serializedParams = serializeParams(
res.originalParams,
strictParamValidation,
sortProperties,
encodeValues,
);
res.sign = await this.signMessage(
res.serializedParams,
this.secret,
'hex',
'SHA-256',
);
// @ts-ignore
res.paramsWithSign = {
...res.originalParams,
sign: res.sign,
};
return res;
}
return res;
}