add coverage for inverse futures private getter endpoints, migrate private getter methods to base class
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { createHmac } from 'crypto';
|
||||
|
||||
export async function signMessage(message: string, secret: string): Promise<string> {
|
||||
return createHmac('sha256', secret)
|
||||
.update(message)
|
||||
.digest('hex');
|
||||
};
|
||||
export async function signMessage(
|
||||
message: string,
|
||||
secret: string
|
||||
): Promise<string> {
|
||||
return createHmac('sha256', secret).update(message).digest('hex');
|
||||
}
|
||||
|
||||
@@ -59,11 +59,18 @@ export function getRestBaseUrl(
|
||||
}
|
||||
|
||||
export function isPublicEndpoint(endpoint: string): boolean {
|
||||
if (endpoint.startsWith('v2/public')) {
|
||||
return true;
|
||||
}
|
||||
if (endpoint.startsWith('public/linear')) {
|
||||
return true;
|
||||
const publicPrefixes = [
|
||||
'v2/public',
|
||||
'public/linear',
|
||||
'spot/quote/v1',
|
||||
'spot/v1/symbols',
|
||||
'spot/v1/time',
|
||||
];
|
||||
|
||||
for (const prefix of publicPrefixes) {
|
||||
if (endpoint.startsWith(prefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user