add account asset & USDC options clients

This commit is contained in:
tiagosiebler
2022-09-08 13:39:07 +01:00
parent ed373f380f
commit 63201b465c
19 changed files with 1009 additions and 80 deletions

View File

@@ -45,8 +45,8 @@ export function serializeParams(
export function getRestBaseUrl(
useLivenet: boolean,
restInverseOptions: RestClientOptions
) {
const baseUrlsInverse = {
): string {
const exchangeBaseUrls = {
livenet: 'https://api.bybit.com',
testnet: 'https://api-testnet.bybit.com',
};
@@ -56,9 +56,9 @@ export function getRestBaseUrl(
}
if (useLivenet === true) {
return baseUrlsInverse.livenet;
return exchangeBaseUrls.livenet;
}
return baseUrlsInverse.testnet;
return exchangeBaseUrls.testnet;
}
export function isPublicEndpoint(endpoint: string): boolean {
@@ -92,11 +92,16 @@ export function isWsPong(response: any) {
export const agentSource = 'bybitapinode';
/**
* Used to switch how authentication/requests work under the hood (primarily for SPOT since it's different there)
*/
export const REST_CLIENT_TYPE_ENUM = {
accountAsset: 'accountAsset',
inverse: 'inverse',
inverseFutures: 'inverseFutures',
linear: 'linear',
spot: 'spot',
usdcOptions: 'usdcOptions',
} as const;
export type RestClientType =