UNPKG

@crl-technologies/sdk

Version:

CRL White Label API - TypeScript SDK with HMAC authentication

60 lines (59 loc) 1.65 kB
/** * CRL White Label API - TypeScript SDK * Production-ready client with HMAC authentication */ interface CalcRequest { mode: 'long' | 'short'; S0: number; ST: number; K: number; L: number; premium: number; side: 'buy' | 'sell'; idempotencyKey?: string; } interface CalcResponse { pnl: number; state: 'INITIAL' | 'LEVERAGED'; retroJump: number; calcId: string; } export declare class CRLApiClient { private baseUrl; private keyId; private secretKey; constructor(config: { keyId: string; secretKey: string; baseUrl?: string; }); calculateLong(S0: number, ST: number, K: number, L: number, premium: number): Promise<CalcResponse>; calculate(request: CalcRequest): Promise<CalcResponse>; /** * Export best-execution data for compliance reporting * @param params Export parameters (dates, format, position IDs) */ exportBestExecution(params: { startDate: string; endDate?: string; format?: 'json' | 'csv'; positionIds?: string[]; }): Promise<any>; /** * Get venue performance analytics * @param startDate Start date for analysis (ISO 8601) */ getVenuePerformance(startDate: string): Promise<any>; /** * Export compliance data in regulatory format * @param startDate Start date (ISO 8601) * @param endDate End date (ISO 8601) */ exportCompliance(startDate: string, endDate: string): Promise<any>; /** * Generic request method with HMAC authentication */ private makeRequest; private generateSignature; } export {};