Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Update151024
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ-Cro committed Oct 15, 2024
2 parents 7f759d3 + 8a261cf commit 80cfd9d
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 29 deletions.
82 changes: 56 additions & 26 deletions src/rest-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ import {
MaxGridQuantityRequest,
GetBorrowRepayHistoryRequest,
BorrowRepayHistoryItem,
Announcement,
} from './types';
import { ASSET_BILL_TYPE } from './constants';

Expand Down Expand Up @@ -634,6 +635,32 @@ export class RestClient extends BaseRestClient {
);
}

convertFixedLoanToMarketLoan(params: { ordId: string }): Promise<
{
ordId: string;
}[]
> {
return this.postPrivate(
'/api/v5/account/fixed-loan/convert-to-market-loan',
params
);
}

reduceFixedLoanLiabilities(params: {
ordId: string;
pendingRepay: boolean;
}): Promise<
{
ordId: string;
pendingRepay: boolean;
}[]
> {
return this.postPrivate(
'/api/v5/account/fixed-loan/reduce-liabilities',
params
);
}

getFixedLoanBorrowOrders(
params: GetFixedLoanBorrowingOrdersListRequest
): Promise<any[]> {
Expand Down Expand Up @@ -814,31 +841,6 @@ export class RestClient extends BaseRestClient {
return this.getPrivate('/api/v5/trade/fills-history', params);
}

/**
* @deprecated - use requestBillsHistoryDownloadLink and getRequestedBillsHistoryLink
*/
applyTransactionDetailsArchive(params: {
year: string;
quarter: 'Q1' | 'Q2' | 'Q3' | 'Q4';
}): Promise<
{
result: string;
ts: string;
}[]
> {
return this.postPrivate('/api/v5/trade/fills-archive', params);
}

/**
* @deprecated - use requestBillsHistoryDownloadLink and getRequestedBillsHistoryLink
*/
getTransactionDetailsArchiveLink(params: {
year: string;
quarter: 'Q1' | 'Q2' | 'Q3' | 'Q4';
}): Promise<any[]> {
return this.getPrivate('/api/v5/trade/fills-archive', params);
}

/** Get easy convert currency list */
getEasyConvertCurrencies(): Promise<any> {
return this.getPrivate('/api/v5/trade/easy-convert-currency-list');
Expand Down Expand Up @@ -898,7 +900,11 @@ export class RestClient extends BaseRestClient {
return this.getPrivate('/api/v5/trade/one-click-repay-history', params);
}

cancelMassOrder(params: { instType: string; instFamily: string }): Promise<
cancelMassOrder(params: {
instType: string;
instFamily: string;
lockInterval?: string;
}): Promise<
{
result: boolean;
}[]
Expand Down Expand Up @@ -2828,6 +2834,30 @@ export class RestClient extends BaseRestClient {
return this.get('/api/v5/system/status', { state });
}

/**
*
* Announcement endpoints
*
*/

getAnnouncements(params?: { annType?: string; page?: string }): Promise<
{
totalPage: string;
details: Announcement[];
}[]
> {
return this.get('/api/v5/support/announcements', params);
}

getAnnouncementTypes(): Promise<
{
annType: string;
annTypeDesc: string;
}[]
> {
return this.get('/api/v5/support/announcement-types');
}

/**
*
* Broker endpoints (private)
Expand Down
2 changes: 1 addition & 1 deletion src/types/rest/request/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export interface UpdateFixedLoanBorrowingOrderRequest {
export interface GetFixedLoanBorrowingOrdersListRequest {
ordId?: string;
ccy?: string;
state?: '1' | '2' | '3' | '4' | '5' | '6' | '7';
state?: string;
after?: string;
before?: string;
limit?: string;
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions src/types/rest/response/private-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ export interface AccountConfiguration {
perm: string;
mainUid: string;
discountType: '0' | '1';
enableSpotBorrow: boolean;
spotBorrowAutoRepay: boolean;
}

export interface AccountPositionModeResult {
Expand Down
5 changes: 3 additions & 2 deletions src/types/rest/response/private-trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ export interface AlgoOrderDetailsResult {
algoClOrdId: string;
amendPxOnTriggerType: string;
cTime: string;
isTradeBorrowMode: boolean;
}

export interface AlgoOrderListItem {
Expand Down Expand Up @@ -301,6 +302,7 @@ export interface AlgoOrderListItem {
algoClOrdId: string;
triggerTime: string;
amendPxOnTriggerType: string;
isTradeBorrowMode: boolean;
}

export interface HistoricAlgoOrder {
Expand Down Expand Up @@ -351,12 +353,11 @@ export interface HistoricAlgoOrder {
triggerPxType: string;
triggerTime: string;
amendPxOnTriggerType: string;
isTradeBorrowMode: boolean;
}


export interface CancelAllAfterResponse {
triggerTime: string;
tag: string;
ts: string;
}

7 changes: 7 additions & 0 deletions src/types/rest/response/public-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,10 @@ export interface OptionTrades {
markPx: string;
ts: string;
}

export interface Announcement {
annType: string;
pTime: string;
title: string;
url: string;
}

0 comments on commit 80cfd9d

Please sign in to comment.