add USDC perp client with tests

This commit is contained in:
tiagosiebler
2022-09-08 16:48:33 +01:00
parent 666720b27d
commit 5187350878
13 changed files with 583 additions and 37 deletions

View File

@@ -61,23 +61,6 @@ export function getRestBaseUrl(
return exchangeBaseUrls.testnet;
}
export function isPublicEndpoint(endpoint: string): boolean {
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;
}
export function isWsPong(response: any) {
if (response.pong || response.ping) {
return true;
@@ -101,7 +84,7 @@ export const REST_CLIENT_TYPE_ENUM = {
inverseFutures: 'inverseFutures',
linear: 'linear',
spot: 'spot',
usdcOptions: 'usdcOptions',
usdc: 'usdc',
} as const;
export type RestClientType =