chore(): Cleaned up naming and types
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "bybit-api",
|
"name": "bybit-api",
|
||||||
"version": "3.10.6",
|
"version": "3.10.7",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "bybit-api",
|
"name": "bybit-api",
|
||||||
"version": "3.10.6",
|
"version": "3.10.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.6.6",
|
"axios": "^1.6.6",
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ import {
|
|||||||
GetSubAccountAllApiKeysParamsV5,
|
GetSubAccountAllApiKeysParamsV5,
|
||||||
GetSubAccountDepositRecordParamsV5,
|
GetSubAccountDepositRecordParamsV5,
|
||||||
GetTickersParamsV5,
|
GetTickersParamsV5,
|
||||||
GetTransactionLogParamsClassicV5,
|
|
||||||
GetTransactionLogParamsV5,
|
GetTransactionLogParamsV5,
|
||||||
GetUniversalTransferRecordsParamsV5,
|
GetUniversalTransferRecordsParamsV5,
|
||||||
GetVIPMarginDataParamsV5,
|
GetVIPMarginDataParamsV5,
|
||||||
@@ -156,15 +155,16 @@ import {
|
|||||||
WalletBalanceV5,
|
WalletBalanceV5,
|
||||||
WithdrawParamsV5,
|
WithdrawParamsV5,
|
||||||
WithdrawalRecordV5,
|
WithdrawalRecordV5,
|
||||||
|
getClassicTransactionLogsParamsV5,
|
||||||
} from './types';
|
} from './types';
|
||||||
import {
|
import {
|
||||||
GetExchangeBrokerEarningParamsV5,
|
GetBrokerSubAccountDepositsV5,
|
||||||
getBrokerSubAccountDepositRecords,
|
GetExchangeBrokerEarningsParamsV5,
|
||||||
} from './types/request/v5-broker';
|
} from './types/request/v5-broker';
|
||||||
import {
|
import {
|
||||||
ExchangeBrokerAccountInfoV5,
|
ExchangeBrokerAccountInfoV5,
|
||||||
ExchangeBrokerEarningResultV5,
|
ExchangeBrokerEarningResultV5,
|
||||||
SubAccountDepositRecordV5,
|
ExchangeBrokerSubAccountDepositRecordV5,
|
||||||
} from './types/response/v5-broker';
|
} from './types/response/v5-broker';
|
||||||
|
|
||||||
import { REST_CLIENT_TYPE_ENUM } from './util';
|
import { REST_CLIENT_TYPE_ENUM } from './util';
|
||||||
@@ -937,8 +937,8 @@ export class RestClientV5 extends BaseRestClient {
|
|||||||
*
|
*
|
||||||
* API key permission: "Contract - Position"
|
* API key permission: "Contract - Position"
|
||||||
*/
|
*/
|
||||||
getTransactionLogClassic(
|
getClassicTransactionLogs(
|
||||||
params?: GetTransactionLogParamsClassicV5,
|
params?: getClassicTransactionLogsParamsV5,
|
||||||
): Promise<
|
): Promise<
|
||||||
APIResponseV3WithTime<{ list: TransactionLogV5[]; nextPageCursor: string }>
|
APIResponseV3WithTime<{ list: TransactionLogV5[]; nextPageCursor: string }>
|
||||||
> {
|
> {
|
||||||
@@ -1359,7 +1359,7 @@ export class RestClientV5 extends BaseRestClient {
|
|||||||
*
|
*
|
||||||
* This endpoint is particularly used for kyc=KOR users. When withdraw funds, you need to fill entity id.
|
* This endpoint is particularly used for kyc=KOR users. When withdraw funds, you need to fill entity id.
|
||||||
*/
|
*/
|
||||||
getExchangeEntityList(): Promise<
|
getExchangeEntities(): Promise<
|
||||||
APIResponseV3WithTime<{ vasp: VaspEntityV5[] }>
|
APIResponseV3WithTime<{ vasp: VaspEntityV5[] }>
|
||||||
> {
|
> {
|
||||||
return this.getPrivate('/v5/asset/withdraw/vasp/list');
|
return this.getPrivate('/v5/asset/withdraw/vasp/list');
|
||||||
@@ -1930,8 +1930,8 @@ export class RestClientV5 extends BaseRestClient {
|
|||||||
* begin & end are either entered at the same time or not entered, and latest 7 days data are returned by default
|
* begin & end are either entered at the same time or not entered, and latest 7 days data are returned by default
|
||||||
* API rate limit: 10 req / sec
|
* API rate limit: 10 req / sec
|
||||||
*/
|
*/
|
||||||
getExchangeBrokerEarning(
|
getExchangeBrokerEarnings(
|
||||||
params?: GetExchangeBrokerEarningParamsV5,
|
params?: GetExchangeBrokerEarningsParamsV5,
|
||||||
): Promise<APIResponseV3WithTime<ExchangeBrokerEarningResultV5>> {
|
): Promise<APIResponseV3WithTime<ExchangeBrokerEarningResultV5>> {
|
||||||
return this.getPrivate('/v5/broker/earnings-info', params);
|
return this.getPrivate('/v5/broker/earnings-info', params);
|
||||||
}
|
}
|
||||||
@@ -1959,11 +1959,9 @@ export class RestClientV5 extends BaseRestClient {
|
|||||||
* TIP
|
* TIP
|
||||||
* endTime - startTime should be less than 30 days. Queries for the last 30 days worth of records by default.
|
* endTime - startTime should be less than 30 days. Queries for the last 30 days worth of records by default.
|
||||||
*/
|
*/
|
||||||
getBrokerSubAccountDepositRecords(
|
getBrokerSubAccountDeposits(params?: GetBrokerSubAccountDepositsV5): Promise<
|
||||||
params?: getBrokerSubAccountDepositRecords,
|
|
||||||
): Promise<
|
|
||||||
APIResponseV3WithTime<{
|
APIResponseV3WithTime<{
|
||||||
rows: SubAccountDepositRecordV5[];
|
rows: ExchangeBrokerSubAccountDepositRecordV5[];
|
||||||
nextPageCursor: string;
|
nextPageCursor: string;
|
||||||
}>
|
}>
|
||||||
> {
|
> {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export interface SetCollateralCoinParamsV5 {
|
|||||||
collateralSwitch: 'ON' | 'OFF';
|
collateralSwitch: 'ON' | 'OFF';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GetTransactionLogParamsClassicV5 {
|
export interface getClassicTransactionLogsParamsV5 {
|
||||||
currency?: string;
|
currency?: string;
|
||||||
baseCoin?: string;
|
baseCoin?: string;
|
||||||
type?: string;
|
type?: string;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export interface GetExchangeBrokerEarningParamsV5 {
|
export interface GetExchangeBrokerEarningsParamsV5 {
|
||||||
bizType?: 'SPOT' | 'DERIVATIVES' | 'OPTIONS';
|
bizType?: 'SPOT' | 'DERIVATIVES' | 'OPTIONS';
|
||||||
begin?: string;
|
begin?: string;
|
||||||
end?: string;
|
end?: string;
|
||||||
@@ -7,7 +7,7 @@ export interface GetExchangeBrokerEarningParamsV5 {
|
|||||||
cursor?: string;
|
cursor?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface getBrokerSubAccountDepositRecords {
|
export interface GetBrokerSubAccountDepositsV5 {
|
||||||
subMemberId?: string;
|
subMemberId?: string;
|
||||||
coin?: string;
|
coin?: string;
|
||||||
startTime?: number;
|
startTime?: number;
|
||||||
|
|||||||
@@ -1,62 +1,59 @@
|
|||||||
interface EarningDetailV5 {
|
interface EarningDetailV5 {
|
||||||
userId: string;
|
userId: string;
|
||||||
bizType: 'SPOT' | 'DERIVATIVES' | 'OPTIONS';
|
bizType: 'SPOT' | 'DERIVATIVES' | 'OPTIONS';
|
||||||
symbol: string;
|
symbol: string;
|
||||||
coin: string;
|
coin: string;
|
||||||
earning: string;
|
earning: string;
|
||||||
markupEarning: string;
|
markupEarning: string;
|
||||||
baseFeeEarning: string;
|
baseFeeEarning: string;
|
||||||
orderId: string;
|
orderId: string;
|
||||||
execTime: string;
|
execTime: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TotalEarningCategoryV5 {
|
|
||||||
coin: string;
|
|
||||||
earning: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExchangeBrokerEarningResultV5 {
|
|
||||||
totalEarningCat: {
|
|
||||||
spot: TotalEarningCategoryV5[];
|
|
||||||
derivatives: TotalEarningCategoryV5[];
|
|
||||||
options: TotalEarningCategoryV5[];
|
|
||||||
total: TotalEarningCategoryV5[];
|
|
||||||
};
|
|
||||||
details: EarningDetailV5[];
|
|
||||||
nextPageCursor: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
interface TotalEarningCategoryV5 {
|
||||||
|
coin: string;
|
||||||
|
earning: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ExchangeBrokerEarningResultV5 {
|
||||||
|
totalEarningCat: {
|
||||||
|
spot: TotalEarningCategoryV5[];
|
||||||
|
derivatives: TotalEarningCategoryV5[];
|
||||||
|
options: TotalEarningCategoryV5[];
|
||||||
|
total: TotalEarningCategoryV5[];
|
||||||
|
};
|
||||||
|
details: EarningDetailV5[];
|
||||||
|
nextPageCursor: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ExchangeBrokerAccountInfoV5 {
|
export interface ExchangeBrokerAccountInfoV5 {
|
||||||
subAcctQty: string;
|
subAcctQty: string;
|
||||||
maxSubAcctQty: string;
|
maxSubAcctQty: string;
|
||||||
baseFeeRebateRate: {
|
baseFeeRebateRate: {
|
||||||
spot: string;
|
spot: string;
|
||||||
derivatives: string;
|
derivatives: string;
|
||||||
};
|
};
|
||||||
markupFeeRebateRate: {
|
markupFeeRebateRate: {
|
||||||
spot: string;
|
spot: string;
|
||||||
derivatives: string;
|
derivatives: string;
|
||||||
};
|
};
|
||||||
ts: string;
|
ts: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SubAccountDepositRecordV5 {
|
export interface ExchangeBrokerSubAccountDepositRecordV5 {
|
||||||
subMemberId: string;
|
subMemberId: string;
|
||||||
coin: string;
|
coin: string;
|
||||||
chain: string;
|
chain: string;
|
||||||
amount: string;
|
amount: string;
|
||||||
txID: string;
|
txID: string;
|
||||||
status: number;
|
status: number;
|
||||||
toAddress: string;
|
toAddress: string;
|
||||||
tag: string;
|
tag: string;
|
||||||
depositFee: string;
|
depositFee: string;
|
||||||
successAt: string;
|
successAt: string;
|
||||||
confirmations: string;
|
confirmations: string;
|
||||||
txIndex: string;
|
txIndex: string;
|
||||||
blockHash: string;
|
blockHash: string;
|
||||||
batchReleaseLimit: string;
|
batchReleaseLimit: string;
|
||||||
depositType: string;
|
depositType: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user