Merge pull request #350 from JJ-Cro/master

feat(): Added all missing endpoints
This commit is contained in:
Tiago
2024-06-24 12:55:07 +01:00
committed by GitHub
42 changed files with 995 additions and 11 deletions

View File

@@ -0,0 +1,27 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.batchSetCollateralCoin({
request: [
{
coin: 'BTC',
collateralSwitch: 'ON',
},
{
coin: 'ETH',
collateralSwitch: 'OFF',
},
],
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,22 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getBorrowHistory({
currency: 'USDT',
startTime: 1670601600000,
endTime: 1673203200000,
limit: 30,
cursor: 'nextPageCursorToken',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,16 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getDCPInfo()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,16 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getSMPGroup()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,18 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.repayLiability({
coin: 'USDT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,19 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.setCollateralCoin({
coin: 'BTC',
collateralSwitch: 'ON',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,18 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.setSpotHedging({
setHedgingMode: 'ON' | 'OFF',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,18 @@
// https://api.bybit.com/v5/asset/withdraw/vasp/list
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getExchangeEntities()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,18 @@
// https://api.bybit.com/v5/broker/account-info
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getExchangeBrokerAccountInfo()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,23 @@
// https://api.bybit.com/v5/broker/earnings-info
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getExchangeBrokerEarnings({
bizType: 'SPOT',
begin: '20231201',
end: '20231207',
limit: 1000,
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,20 @@
// https://api.bybit.com/v5/broker/asset/query-sub-member-deposit-record
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getBrokerSubAccountDeposits({
limit: 50,
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,21 @@
// https://api.bybit.com/v5/ins-loan/association-uid
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.bindOrUnbindUID({
uid: 'yourUID',
operate: '0', // 0 for bind, 1 for unbind
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,18 @@
// https://api.bybit.com/v5/ins-loan/ltv-convert
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getInstitutionalLendingLTVWithLadderConversionRate()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,20 @@
// https://api.bybit.com/v5/ins-loan/loan-order
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getInstitutionalLendingLoanOrders({
limit: 10,
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,20 @@
// https://api.bybit.com/v5/ins-loan/ensure-tokens-convert
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getInstitutionalLendingMarginCoinInfoWithConversionRate({
productId: '81',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,20 @@
// https://api.bybit.com/v5/ins-loan/product-infos
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getInstitutionalLendingProductInfo({
productId: '91',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,20 @@
// https://api.bybit.com/v5/ins-loan/repaid-history
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getInstitutionalLendingRepayOrders({
limit: 100,
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,14 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
});
client
.getServerTime()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,19 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
});
client
.getLongShortRatio({
category: 'linear',
symbol: 'BTCUSDT',
period: '1h',
limit: 100,
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,18 @@
// https://api.bybit.com/v5/spot-margin-trade/state
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getSpotMarginState()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,21 @@
// https://api.bybit.com/v5/spot-margin-trade/data
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getVIPMarginData({
vipLevel: 'No VIP',
currency: 'BTC',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,19 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.confirmNewRiskLimit({
category: 'linear',
symbol: 'BTCUSDT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,23 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getMovePositionHistory({
category: 'linear',
symbol: 'BTCUSDT',
startTime: 1670601600000,
endTime: 1671206400000,
status: 'Filled',
limit: '50',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,28 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.movePosition({
fromUid: 'UTA12345',
toUid: 'UTA67890',
list: [
{
category: 'linear',
symbol: 'BTCUSDT',
price: '50000',
side: 'Sell',
qty: '1',
},
],
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,20 @@
// https://api.bybit.com/v5/user/del-submember
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.deleteSubMember({
subMemberId: 'subUID',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,21 @@
// https://api.bybit.com/v5/user/sub-apikeys
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getSubAccountAllApiKeys({
subMemberId: 'subUID',
limit: 20,
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,20 @@
// https://api.bybit.com/v5/user/get-member-type
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getUIDWalletType({
memberIds: 'subUID1,subUID2',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "bybit-api",
"version": "3.10.6",
"version": "3.10.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "bybit-api",
"version": "3.10.6",
"version": "3.10.8",
"license": "MIT",
"dependencies": {
"axios": "^1.6.6",

View File

@@ -1,6 +1,6 @@
{
"name": "bybit-api",
"version": "3.10.6",
"version": "3.10.8",
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
"main": "lib/index.js",
"types": "lib/index.d.ts",

View File

@@ -9,6 +9,7 @@ import {
AccountTypeV5,
AddOrReduceMarginParamsV5,
AddOrReduceMarginResultV5,
AffiliateUserInfoV5,
AllCoinsBalanceV5,
AllowedDepositCoinInfoV5,
AmendOrderParamsV5,
@@ -33,12 +34,14 @@ import {
CoinGreeksV5,
CoinInfoV5,
CollateralInfoV5,
ConfirmNewRiskLimitParamsV5,
CreateSubApiKeyParamsV5,
CreateSubApiKeyResultV5,
CreateSubMemberParamsV5,
CreateSubMemberResultV5,
CursorListV5,
CursorRowsV5,
DCPInfoV5,
DeleteSubMemberParamsV5,
DeliveryPriceV5,
DeliveryRecordV5,
@@ -54,6 +57,7 @@ import {
GetAllowedDepositCoinInfoParamsV5,
GetAssetInfoParamsV5,
GetBorrowHistoryParamsV5,
GetClassicTransactionLogsParamsV5,
GetClosedPnLParamsV5,
GetCoinExchangeRecordParamsV5,
GetDeliveryPriceParamsV5,
@@ -71,6 +75,7 @@ import {
GetKlineParamsV5,
GetLongShortRatioParamsV5,
GetMarkPriceKlineParamsV5,
GetMovePositionHistoryParamsV5,
GetOpenInterestParamsV5,
GetOptionDeliveryPriceParamsV5,
GetOrderbookParamsV5,
@@ -87,6 +92,7 @@ import {
GetTickersParamsV5,
GetTransactionLogParamsV5,
GetUniversalTransferRecordsParamsV5,
GetVIPMarginDataParamsV5,
GetWalletBalanceParamsV5,
GetWithdrawalRecordsParamsV5,
HistoricalVolatilityV5,
@@ -99,6 +105,9 @@ import {
LongShortRatioV5,
MMPModifyParamsV5,
MMPStateV5,
MovePositionHistoryV5,
MovePositionParamsV5,
MovePositionResultV5,
OHLCKlineV5,
OHLCVKlineV5,
OpenInterestResponseV5,
@@ -127,6 +136,7 @@ import {
SettlementRecordV5,
SpotBorrowCheckResultV5,
SpotLeveragedTokenOrderHistoryV5,
SpotMarginStateV5,
SubAccountAllApiKeysResultV5,
SubMemberV5,
SwitchIsolatedMarginParamsV5,
@@ -141,9 +151,16 @@ import {
UniversalTransferRecordV5,
UpdateApiKeyParamsV5,
UpdateApiKeyResultV5,
VIPMarginDataV5,
VaspEntityV5,
WalletBalanceV5,
WithdrawParamsV5,
WithdrawalRecordV5,
GetBrokerSubAccountDepositsV5,
GetExchangeBrokerEarningsParamsV5,
ExchangeBrokerAccountInfoV5,
ExchangeBrokerEarningResultV5,
ExchangeBrokerSubAccountDepositRecordV5,
} from './types';
import { REST_CLIENT_TYPE_ENUM } from './util';
@@ -700,6 +717,55 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/position/closed-pnl', params);
}
/**
* Move positions between sub-master, master-sub, or sub-sub UIDs.
*
* Unified account covers: USDT perpetual / USDC contract / Spot / Option
*
* INFO
* The endpoint can only be called by master UID api key
* UIDs must be the same master-sub account relationship
* The trades generated from move-position endpoint will not be displayed in the Recent Trade (Rest API & Websocket)
* There is no trading fee
* fromUid and toUid both should be Unified trading accounts, and they need to be one-way mode when moving the positions
* Please note that once executed, you will get execType=MovePosition entry from Get Trade History, Get Closed Pnl, and stream from Execution.
*/
movePosition(
params: MovePositionParamsV5,
): Promise<APIResponseV3WithTime<MovePositionResultV5>> {
return this.postPrivate('/v5/position/move-positions', params);
}
/**
* Query moved position data by master UID api key.
*
* Unified account covers: USDT perpetual / USDC contract / Spot / Option
*/
getMovePositionHistory(params: GetMovePositionHistoryParamsV5): Promise<
APIResponseV3WithTime<{
list: MovePositionHistoryV5[];
nextPageCursor: string;
}>
> {
return this.getPrivate('/v5/position/move-history', params);
}
/**
* Confirm new risk limit.
*
* It is only applicable when the user is marked as only reducing positions (please see the isReduceOnly field in the Get Position Info interface).
* After the user actively adjusts the risk level, this interface is called to try to calculate the adjusted risk level, and if it passes (retCode=0),
* the system will remove the position reduceOnly mark. You are recommended to call Get Position Info to check isReduceOnly field.
*
* Unified account covers: USDT perpetual / USDC contract / Inverse contract
* Classic account covers: USDT perpetual / Inverse contract
*/
confirmNewRiskLimit(
params: ConfirmNewRiskLimitParamsV5,
): Promise<APIResponseV3WithTime<{}>> {
return this.postPrivate('/v5/position/confirm-pending-mmr', params);
}
/**
*
****** Pre-upgrade APIs
@@ -862,6 +928,30 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/account/transaction-log', params);
}
/**
* Query transaction logs in the derivatives wallet (classic account), and inverse derivatives wallet (upgraded to UTA).
*
* API key permission: "Contract - Position"
*/
getClassicTransactionLogs(
params?: GetClassicTransactionLogsParamsV5,
): Promise<
APIResponseV3WithTime<{ list: TransactionLogV5[]; nextPageCursor: string }>
> {
return this.getPrivate('/v5/account/contract-transaction-log', params);
}
/**
* Query the SMP group ID of self match prevention.
*/
getSMPGroup(): Promise<
APIResponseV3WithTime<{
smpGroup: number;
}>
> {
return this.getPrivate('/v5/account/smp-group');
}
/**
* Default is regular margin mode.
*
@@ -877,6 +967,19 @@ export class RestClientV5 extends BaseRestClient {
});
}
/**
* Turn on/off Spot hedging feature in Portfolio margin for Unified account.
*
* INFO
* Only unified account is applicable
* Only portfolio margin mode is applicable
*/
setSpotHedging(params: {
setHedgingMode: 'ON' | 'OFF';
}): Promise<APIResponseV3WithTime<{}>> {
return this.postPrivate('/v5/account/set-hedging-mode', params);
}
/**
* Configure Market Maker Protection (MMP)
*/
@@ -900,6 +1003,19 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/account/mmp-state', { baseCoin });
}
/**
* Query the DCP configuration of the account's contracts (USDT perpetual, USDC perpetual and USDC Futures) / spot / options.
*
* Only the configured main / sub account can query information from this API. Calling this API by an account always returns empty.
*
* INFO
* support linear contract (USDT, USDC Perp & USDC Futures) / Spot / Options only
* Unified account only
*/
getDCPInfo(): Promise<APIResponseV3WithTime<{ dcpInfos: DCPInfoV5[] }>> {
return this.getPrivate('/v5/account/query-dcp-info');
}
/**
*
****** Asset APIs
@@ -1234,6 +1350,17 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/asset/withdraw/withdrawable-amount', params);
}
/**
* Get Exchange Entity List.
*
* This endpoint is particularly used for kyc=KOR users. When withdraw funds, you need to fill entity id.
*/
getExchangeEntities(): Promise<
APIResponseV3WithTime<{ vasp: VaspEntityV5[] }>
> {
return this.getPrivate('/v5/asset/withdraw/vasp/list');
}
/**
* Withdraw assets from the SPOT account.
*
@@ -1302,9 +1429,7 @@ export class RestClientV5 extends BaseRestClient {
*/
getSubAccountAllApiKeys(
params: GetSubAccountAllApiKeysParamsV5,
): Promise<
APIResponseV3WithTime<SubAccountAllApiKeysResultV5>
> {
): Promise<APIResponseV3WithTime<SubAccountAllApiKeysResultV5>> {
return this.getPrivate('/v5/user/sub-apikeys', params);
}
@@ -1331,6 +1456,17 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/user/query-api');
}
getUIDWalletType(params: { memberIds: string }): Promise<
APIResponseV3WithTime<{
accounts: {
uid: string;
accountType: string[];
}[];
}>
> {
return this.getPrivate('/v5/user/query-api', params);
}
/**
* Modify the settings of a master API key. Use the API key pending to be modified to call the endpoint. Use master user's API key only.
*
@@ -1380,11 +1516,10 @@ export class RestClientV5 extends BaseRestClient {
*
* DANGER: BE CAREFUL! The sub API key used to call this interface will be invalid immediately.
*/
deleteSubApiKey(params?: { apikey?: string; }): Promise<APIResponseV3WithTime<{}>> {
return this.postPrivate(
'/v5/user/delete-sub-api',
params,
);
deleteSubApiKey(params?: {
apikey?: string;
}): Promise<APIResponseV3WithTime<{}>> {
return this.postPrivate('/v5/user/delete-sub-api', params);
}
/**
@@ -1400,6 +1535,22 @@ export class RestClientV5 extends BaseRestClient {
return this.postPrivate('/v5/user/del-submember', params);
}
/**
* Get Affiliate User Info.
*
* This API is used for affiliate to get their users information.
*
* TIP
* Use master UID only
* The api key can only have "Affiliate" permission
* The transaction volume and deposit amount are the total amount of the user done on Bybit, and have nothing to do with commission settlement. Any transaction volume data related to commission settlement is subject to the Affiliate Portal.
*/
getAffiliateUserInfo(params: {
uid: string;
}): Promise<APIResponseV3WithTime<AffiliateUserInfoV5>> {
return this.getPrivate('/v5/user/aff-customer-info', params);
}
/**
*
****** Spot Leverage Token APIs
@@ -1459,6 +1610,20 @@ export class RestClientV5 extends BaseRestClient {
*
*/
/**
* Get VIP Margin Data.
*
* This margin data is for Unified account in particular.
*
* INFO
* Do not need authentication
*/
getVIPMarginData(
params?: GetVIPMarginDataParamsV5,
): Promise<APIResponseV3WithTime<VIPMarginDataV5>> {
return this.get('/v5/spot-margin-trade/data', params);
}
/**
* Turn spot margin trade on / off in your UTA account.
*
@@ -1481,6 +1646,15 @@ export class RestClientV5 extends BaseRestClient {
return this.postPrivate('/v5/spot-margin-trade/set-leverage', { leverage });
}
/**
* Query the Spot margin status and leverage of Unified account.
*
* Covers: Margin trade (Unified Account)
*/
getSpotMarginState(): Promise<APIResponseV3WithTime<SpotMarginStateV5>> {
return this.getPrivate('/v5/spot-margin-trade/state');
}
/**
*
****** Spot Margin Trade APIs (Normal)
@@ -1729,4 +1903,78 @@ export class RestClientV5 extends BaseRestClient {
> {
return this.getPrivate('/v5/ins-loan/ltv-convert');
}
/**
* Bind or unbind UID for the institutional loan product.
*
* INFO
* Risk unit designated UID cannot be unbound
* This endpoint can only be called by uids in the risk unit list
* The UID must be upgraded to UTA Pro if you try to bind it.
* When the API is operated through the API Key of any UID in the risk unit, the UID is bound or unbound in the risk unit.
*/
bindOrUnbindUID(params: { uid: string; operate: '0' | '1' }): Promise<
APIResponseV3WithTime<{
uid: string;
operate: '0' | '1';
}>
> {
return this.postPrivate('/v5/ins-loan/association-uid', params);
}
/**
*
****** Broker
*
*/
/**
* Get Exchange Broker Earning.
*
* INFO
* Use exchange broker master account to query
* The data can support up to past 1 months until T-1. To extract data from over a month ago, please contact your Relationship Manager
* 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
*/
getExchangeBrokerEarnings(
params?: GetExchangeBrokerEarningsParamsV5,
): Promise<APIResponseV3WithTime<ExchangeBrokerEarningResultV5>> {
return this.getPrivate('/v5/broker/earnings-info', params);
}
/**
* Get Exchange Broker Account Info.
*
* INFO
* Use exchange broker master account to query
* API rate limit: 10 req / sec
*/
getExchangeBrokerAccountInfo(): Promise<
APIResponseV3WithTime<ExchangeBrokerAccountInfoV5>
> {
return this.getPrivate('/v5/broker/account-info');
}
/**
* Get Sub Account Deposit Records.
*
* Exchange broker can query subaccount's deposit records by main UID's API key without specifying uid.
*
* API rate limit: 300 req / min
*
* TIP
* endTime - startTime should be less than 30 days. Queries for the last 30 days worth of records by default.
*/
getBrokerSubAccountDeposits(params?: GetBrokerSubAccountDepositsV5): Promise<
APIResponseV3WithTime<{
rows: ExchangeBrokerSubAccountDepositRecordV5[];
nextPageCursor: string;
}>
> {
return this.getPrivate(
'/v5/broker/asset/query-sub-member-deposit-record',
params,
);
}
}

View File

@@ -16,3 +16,4 @@ export * from './v5-pre-upgrade';
export * from './v5-trade';
export * from './v5-user';
export * from './v5-spot-leverage-token';
export * from './v5-broker';

View File

@@ -47,3 +47,13 @@ export interface SetCollateralCoinParamsV5 {
coin: string;
collateralSwitch: 'ON' | 'OFF';
}
export interface GetClassicTransactionLogsParamsV5 {
currency?: string;
baseCoin?: string;
type?: string;
startTime?: number;
endTime?: number;
limit?: number;
cursor?: string;
}

View File

@@ -0,0 +1,17 @@
export interface GetExchangeBrokerEarningsParamsV5 {
bizType?: 'SPOT' | 'DERIVATIVES' | 'OPTIONS';
begin?: string;
end?: string;
uid?: string;
limit?: number;
cursor?: string;
}
export interface GetBrokerSubAccountDepositsV5 {
subMemberId?: string;
coin?: string;
startTime?: number;
endTime?: number;
limit?: number;
cursor?: string;
}

View File

@@ -105,3 +105,31 @@ export interface GetClosedPnLParamsV5 {
limit?: number;
cursor?: string;
}
export interface MovePositionParamsV5 {
fromUid: string;
toUid: string;
list: {
category: 'linear' | 'spot' | 'option';
symbol: string;
price: string;
side: 'Buy' | 'Sell';
qty: string;
}[];
}
export interface GetMovePositionHistoryParamsV5 {
category?: 'linear' | 'spot' | 'option';
symbol?: string;
startTime?: number;
endTime?: number;
status?: 'Processing' | 'Filled' | 'Rejected';
blockTradeId?: string;
limit?: string;
cursor?: string;
}
export interface ConfirmNewRiskLimitParamsV5 {
category: 'linear' | 'inverse';
symbol: string;
}

View File

@@ -21,3 +21,8 @@ export interface GetSpotLeveragedTokenOrderHistoryParamsV5 {
ltOrderType?: LTOrderTypeV5;
serialNo?: string;
}
export interface GetVIPMarginDataParamsV5 {
vipLevel?: string;
currency?: string;
}

View File

@@ -11,3 +11,4 @@ export * from './v5-position';
export * from './v5-trade';
export * from './v5-user';
export * from './v5-spot-leverage-token';
export * from './v5-broker';

View File

@@ -125,3 +125,11 @@ export interface RepayLiabilityResultV5 {
coin: string;
repaymentQty: string;
}
export interface DCPInfoV5 {
product: 'SPOT' | 'DERIVATIVES' | 'OPTIONS';
dcpStatus: 'ON';
timeWindow: string;
}

View File

@@ -168,3 +168,9 @@ export interface WithdrawalRecordV5 {
createTime: string;
updateTime: string;
}
export interface VaspEntityV5 {
vaspEntityId: string;
vaspName: string;
}

View File

@@ -0,0 +1,59 @@
interface EarningDetailV5 {
userId: string;
bizType: 'SPOT' | 'DERIVATIVES' | 'OPTIONS';
symbol: string;
coin: string;
earning: string;
markupEarning: string;
baseFeeEarning: string;
orderId: 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;
}
export interface ExchangeBrokerAccountInfoV5 {
subAcctQty: string;
maxSubAcctQty: string;
baseFeeRebateRate: {
spot: string;
derivatives: string;
};
markupFeeRebateRate: {
spot: string;
derivatives: string;
};
ts: string;
}
export interface ExchangeBrokerSubAccountDepositRecordV5 {
subMemberId: string;
coin: string;
chain: string;
amount: string;
txID: string;
status: number;
toAddress: string;
tag: string;
depositFee: string;
successAt: string;
confirmations: string;
txIndex: string;
blockHash: string;
batchReleaseLimit: string;
depositType: string;
}

View File

@@ -129,3 +129,28 @@ export interface ClosedPnLV5 {
createdTime: string;
updatedTime: string;
}
export interface MovePositionResultV5 {
blockTradeId: string;
status: 'Processing' | 'Rejected';
rejectParty: '' | 'Taker' | 'Maker' | 'bybit';
}
export interface MovePositionHistoryV5 {
blockTradeId: string;
category: 'linear' | 'spot' | 'option';
orderId: string;
userId: number;
symbol: string;
side: 'Buy' | 'Sell';
price: string;
qty: string;
execFee: string;
status: 'Processing' | 'Filled' | 'Rejected';
execId: string;
resultCode: number;
resultMessage: string;
createdAt: number;
updatedAt: number;
rejectParty: '' | 'Taker' | 'Maker' | 'bybit';
}

View File

@@ -68,3 +68,24 @@ export interface SpotLeveragedTokenOrderHistoryV5 {
valueCoin: string;
serialNo: string;
}
export interface VIPMarginDataV5 {
vipCoinList: {
list: {
borrowable: boolean;
collateralRatio: string;
currency: string;
hourlyBorrowRate: string;
liquidationOrder: string;
marginCollateral: boolean;
maxBorrowingAmount: string;
}[];
vipLevel: string;
}[];
}
export interface SpotMarginStateV5 {
spotLeverage: string;
spotMarginMode: '1' | '0';
effectiveLeverage: string;
}

View File

@@ -76,3 +76,21 @@ export interface SubAccountAllApiKeysResultV5 {
}[],
nextPageCursor: string;
}
export interface AffiliateUserInfoV5 {
uid: string;
vipLevel: string;
takerVol30Day: string;
makerVol30Day: string;
tradeVol30Day: string;
depositAmount30Day: string;
takerVol365Day: string;
makerVol365Day: string;
tradeVol365Day: string;
depositAmount365Day: string;
totalWalletBalance: '1' | '2' | '3' | '4';
depositUpdateTime: string;
volUpdateTime: string;
KycLevel: 0 | 1 | 2;
}