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

@@ -1,2 +1,3 @@
export * from './account-asset';
export * from './usdt-perp';
export * from './usdc-perp';

View File

@@ -0,0 +1,19 @@
export interface USDCKlineRequest {
symbol: string;
period: string;
startTime: number;
limit?: string;
}
export interface USDCOpenInterestRequest {
symbol: string;
period: string;
limit?: number;
}
export interface USDCLast500TradesRequest {
category: string;
symbol?: string;
baseCoin?: string;
limit?: string;
}

View File

@@ -25,6 +25,12 @@ export interface APIResponse<T> {
result: T;
}
export interface USDCAPIResponse<T> {
retCode: number;
retMsg: 'OK' | string;
result: T;
}
export interface APIResponseWithTime<T = {}> extends APIResponse<T> {
/** UTC timestamp */
time_now: numberInString;
@@ -37,15 +43,15 @@ export interface SymbolParam {
symbol: string;
}
export interface SymbolLimitParam {
export interface SymbolLimitParam<TLimit = number> {
symbol: string;
limit?: number;
limit?: TLimit;
}
export interface SymbolPeriodLimitParam {
export interface SymbolPeriodLimitParam<TLimit = number> {
symbol: string;
period: string;
limit?: number;
limit?: TLimit;
}
export interface SymbolFromLimitParam {