Skip to content

Commit

Permalink
chore(): minor naming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ-Cro committed Aug 26, 2024
1 parent f91f212 commit ccbc166
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
32 changes: 21 additions & 11 deletions src/main-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,7 @@ import {
DualInvestmentProduct,
UpdateIpRestrictionForSubApiKey,
GetSubAccountDepositHistoryParams,
SubAccountDepositHistory,
SubaccountBrokerSpotAssets,
QuerySubAccountSpotMarginAssetInfoParams,
SubAccountBrokerMarginAssets,
BrokerFuturesSubAccountAssets,
QuerySubAccountFuturesAssetInfoParams,
BrokerUniversalTransfer,
ChangeSubAccountCommissionParams,
Expand All @@ -511,6 +507,11 @@ import {
BrokerCommissionRebate,
QueryBrokerSpotCommissionRebateParams,
QueryBrokerFuturesCommissionRebateParams,
UsdtMarginedFuturesResponse,
CoinMarginedFuturesResponse,
SubAccountDeposit,
SubaccountBrokerSpotAsset,
SubAccountBrokerMarginAsset,
} from './types/spot';

import {
Expand Down Expand Up @@ -3323,7 +3324,7 @@ export class MainClient extends BaseRestClient {
return this.getPrivate('sapi/v1/broker/info');
}

updateBNBBurnSubAccount(params: {
updateSubAccountBNBBurn(params: {
subAccountId: string;
spotBNBBurn: 'true' | 'false';
}): Promise<{
Expand All @@ -3333,7 +3334,7 @@ export class MainClient extends BaseRestClient {
return this.postPrivate('sapi/v1/broker/subAccount/bnbBurn/spot', params);
}

updateBNBBurnSubAccountMarginInterest(params: {
updateSubAccountMarginInterestBNBBurn(params: {
subAccountId: string;
interestBNBBurn: 'true' | 'false';
}): Promise<{
Expand All @@ -3346,7 +3347,7 @@ export class MainClient extends BaseRestClient {
);
}

getBNBBurnStatusSubAccount(params: { subAccountId: string }): Promise<{
getSubAccountBNBBurnStatus(params: { subAccountId: string }): Promise<{
subAccountId: string;
spotBNBBurn: boolean;
interestBNBBurn: boolean;
Expand Down Expand Up @@ -3401,25 +3402,34 @@ export class MainClient extends BaseRestClient {

getBrokerSubDepositHistory(
params: GetSubAccountDepositHistoryParams,
): Promise<SubAccountDepositHistory[]> {
): Promise<SubAccountDeposit[]> {
return this.getPrivate('sapi/v1/broker/subAccount/depositHist', params);
}

getBrokerSubAccountSpotAssets(
params: QuerySubAccountSpotMarginAssetInfoParams,
): Promise<SubaccountBrokerSpotAssets> {
): Promise<{
data: SubaccountBrokerSpotAsset[];
timestamp: number;
}> {
return this.getPrivate('sapi/v1/broker/subAccount/spotSummary', params);
}

getSubAccountMarginAssetInfo(
params: QuerySubAccountSpotMarginAssetInfoParams,
): Promise<SubAccountBrokerMarginAssets> {
): Promise<{
data: SubAccountBrokerMarginAsset[];
timestamp: number;
}> {
return this.getPrivate('sapi/v1/broker/subAccount/marginSummary', params);
}

querySubAccountFuturesAssetInfo(
params: QuerySubAccountFuturesAssetInfoParams,
): Promise<BrokerFuturesSubAccountAssets> {
): Promise<{
data: (UsdtMarginedFuturesResponse | CoinMarginedFuturesResponse)[];
timestamp: number;
}> {
return this.getPrivate('sapi/v3/broker/subAccount/futuresSummary', params);
}

Expand Down
30 changes: 11 additions & 19 deletions src/types/spot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4927,7 +4927,7 @@ export interface GetSubAccountDepositHistoryParams {
offset?: number;
}

export interface SubAccountDepositHistory {
export interface SubAccountDeposit {
depositId: number;
subAccountId: string;
address: string;
Expand All @@ -4951,25 +4951,18 @@ export interface QuerySubAccountSpotMarginAssetInfoParams {
size?: number;
}

// Response interface for querying sub account spot asset info
export interface SubaccountBrokerSpotAssets {
data: {
subAccountId: string;
totalBalanceOfBtc: string;
}[];
timestamp: number;
export interface SubaccountBrokerSpotAsset {
subAccountId: string;
totalBalanceOfBtc: string;
}

export interface SubAccountBrokerMarginAssets {
data: {
marginEnable: boolean;
subAccountId: string;
totalAssetOfBtc?: string;
totalLiabilityOfBtc?: string;
totalNetAssetOfBtc?: string;
marginLevel?: string;
}[];
timestamp: number;
export interface SubAccountBrokerMarginAsset {
marginEnable: boolean;
subAccountId: string;
totalAssetOfBtc?: string;
totalLiabilityOfBtc?: string;
totalNetAssetOfBtc?: string;
marginLevel?: string;
}

// Request interface for querying sub account futures asset info
Expand Down Expand Up @@ -5116,7 +5109,6 @@ export interface BrokerCommissionRebate {
status: number;
}


export interface QueryBrokerFuturesCommissionRebateParams {
futuresType: number; // 1: USDT Futures, 2: Coin Futures
startTime: number;
Expand Down

0 comments on commit ccbc166

Please sign in to comment.