Creation of sharedendpoints.

Used for linear and inverse client
This commit is contained in:
peepopoggers
2021-01-21 22:21:02 +00:00
committed by GitHub
parent df9e0c5cf7
commit 1b8b44c597

58
src/shared-endpoints.ts Normal file
View File

@@ -0,0 +1,58 @@
//type Constructor = new (...args: any[]) => {};
import { GenericAPIResponse } from './util/requestUtils';
import RequestWrapper from './util/requestWrapper';
export class SharedEndpoints {
protected requestWrapper: RequestWrapper; // XXX Is there a way to say that Base has to provide this?
//------------Wallet Data Endpoints------------>
getWalletBalance(params: {
coin: string;
}): GenericAPIResponse {
return this.requestWrapper.get('v2/private/wallet/balance',params)
}
getAssetExchangeRecords(params?: {
limit?: number;
from?: number;
direction?: string;
}): GenericAPIResponse {
return this.requestWrapper.get('v2/private/exchange-order/list', params);
}
getWalletFundRecords(params?: {
start_date?: string;
end_date?: string;
currency?: string;
coin?: string;
wallet_fund_type?: string;
page?: number;
limit?: number;
}): GenericAPIResponse {
return this.requestWrapper.get('v2/private/wallet/fund/records', params);
}
getWithdrawRecords(params: {
start_date?: string;
end_date?: string;
coin?: string;
status?: string;
page?: number;
limit?: number;
}): GenericAPIResponse {
return this.requestWrapper.get('v2/private/wallet/withdraw/list', params);
}
//-------------API Data Endpoints-------------->
getServerTime(): GenericAPIResponse {
return this.requestWrapper.get('v2/public/time');
}
getApiAnnouncements(): GenericAPIResponse {
return this.requestWrapper.get('v2/public/announcement');
}
}