feat(): added new endpoints
This commit is contained in:
@@ -23,6 +23,8 @@ import {
|
||||
BatchOrderParamsV5,
|
||||
BatchOrdersResponseV5,
|
||||
BorrowHistoryRecordV5,
|
||||
BrokerIssuedVoucherV5,
|
||||
BrokerVoucherSpec,
|
||||
CancelAllOrdersParamsV5,
|
||||
CancelOrderParamsV5,
|
||||
CategoryCursorListV5,
|
||||
@@ -65,6 +67,7 @@ import {
|
||||
GetAllowedDepositCoinInfoParamsV5,
|
||||
GetAssetInfoParamsV5,
|
||||
GetBorrowHistoryParamsV5,
|
||||
GetBrokerIssuedVoucherParamsV5,
|
||||
GetBrokerSubAccountDepositsV5,
|
||||
GetClassicTransactionLogsParamsV5,
|
||||
GetClosedPnLParamsV5,
|
||||
@@ -114,6 +117,7 @@ import {
|
||||
InsuranceResponseV5,
|
||||
InternalDepositRecordV5,
|
||||
InternalTransferRecordV5,
|
||||
IssueVoucherParamsV5,
|
||||
LeverageTokenInfoV5,
|
||||
LeveragedTokenMarketResultV5,
|
||||
LongShortRatioV5,
|
||||
@@ -2167,4 +2171,37 @@ export class RestClientV5 extends BaseRestClient {
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query Voucher Spec
|
||||
*/
|
||||
getBrokerVoucherSpec(params: {
|
||||
id: string;
|
||||
}): Promise<APIResponseV3WithTime<BrokerVoucherSpec>> {
|
||||
return this.postPrivate('/v5/broker/award/info', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Issue a voucher to a user
|
||||
*
|
||||
* INFO
|
||||
* Use exchange broker master account to issue
|
||||
*/
|
||||
issueBrokerVoucher(
|
||||
params: IssueVoucherParamsV5,
|
||||
): Promise<APIResponseV3<any>> {
|
||||
return this.postPrivate('/v5/broker/award/distribute-award', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query an issued voucher
|
||||
*
|
||||
* INFO
|
||||
* Use exchange broker master account to query
|
||||
*/
|
||||
getBrokerIssuedVoucher(
|
||||
params: GetBrokerIssuedVoucherParamsV5,
|
||||
): Promise<APIResponseV3<BrokerIssuedVoucherV5>> {
|
||||
return this.postPrivate('/v5/broker/award/distribution-record', params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,3 +15,18 @@ export interface GetBrokerSubAccountDepositsV5 {
|
||||
limit?: number;
|
||||
cursor?: string;
|
||||
}
|
||||
|
||||
export interface IssueVoucherParamsV5 {
|
||||
accountId: string;
|
||||
awardId: string;
|
||||
specCode: string;
|
||||
amount: string;
|
||||
brokerId: string;
|
||||
}
|
||||
|
||||
export interface GetBrokerIssuedVoucherParamsV5 {
|
||||
accountId: string;
|
||||
awardId: string;
|
||||
specCode: string;
|
||||
withUsedAmount?: boolean;
|
||||
}
|
||||
|
||||
@@ -59,3 +59,28 @@ export interface ExchangeBrokerSubAccountDepositRecordV5 {
|
||||
batchReleaseLimit: string;
|
||||
depositType: string;
|
||||
}
|
||||
|
||||
export interface BrokerVoucherSpec {
|
||||
id: string;
|
||||
coin: string;
|
||||
amountUnit: 'AWARD_AMOUNT_UNIT_USD' | 'AWARD_AMOUNT_UNIT_COIN';
|
||||
productLine: string;
|
||||
subProductLine: string;
|
||||
totalAmount: {
|
||||
[key: string]: string;
|
||||
};
|
||||
usedAmount: string;
|
||||
}
|
||||
|
||||
export interface BrokerIssuedVoucherV5 {
|
||||
accountId: string;
|
||||
awardId: string;
|
||||
specCode: string;
|
||||
amount: string;
|
||||
isClaimed: boolean;
|
||||
startAt: string;
|
||||
endAt: string;
|
||||
effectiveAt: string;
|
||||
ineffectiveAt: string;
|
||||
usedAmount: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user