Merge pull request #245 from tiagosiebler/walletbal
v3.5.5: fix() add missing wallet balance response type properties
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bybit-api",
|
"name": "bybit-api",
|
||||||
"version": "3.5.4",
|
"version": "3.5.5",
|
||||||
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
|
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ export interface WalletBalanceV5Coin {
|
|||||||
equity: string;
|
equity: string;
|
||||||
usdValue: string;
|
usdValue: string;
|
||||||
walletBalance: string;
|
walletBalance: string;
|
||||||
|
free: string; // spot only
|
||||||
|
locked: string; // spot only
|
||||||
borrowAmount: string;
|
borrowAmount: string;
|
||||||
availableToBorrow: string;
|
availableToBorrow: string;
|
||||||
availableToWithdraw: string;
|
availableToWithdraw: string;
|
||||||
@@ -20,10 +22,12 @@ export interface WalletBalanceV5Coin {
|
|||||||
totalPositionMM: string;
|
totalPositionMM: string;
|
||||||
unrealisedPnl: string;
|
unrealisedPnl: string;
|
||||||
cumRealisedPnl: string;
|
cumRealisedPnl: string;
|
||||||
|
bonus: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WalletBalanceV5 {
|
export interface WalletBalanceV5 {
|
||||||
accountType: AccountTypeV5;
|
accountType: AccountTypeV5;
|
||||||
|
accountLTV: string;
|
||||||
accountIMRate: string;
|
accountIMRate: string;
|
||||||
accountMMRate: string;
|
accountMMRate: string;
|
||||||
totalEquity: string;
|
totalEquity: string;
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ describe('Private Contract REST API POST Endpoints', () => {
|
|||||||
await api.setMarginSwitch({
|
await api.setMarginSwitch({
|
||||||
symbol,
|
symbol,
|
||||||
tradeMode: 1,
|
tradeMode: 1,
|
||||||
buyLeverage: '10',
|
buyLeverage: '5',
|
||||||
sellLeverage: '10',
|
sellLeverage: '5',
|
||||||
})
|
})
|
||||||
).toMatchObject({
|
).toMatchObject({
|
||||||
retCode: API_ERROR_CODE.CONTRACT_MARGIN_MODE_NOT_MODIFIED,
|
retCode: API_ERROR_CODE.CONTRACT_MARGIN_MODE_NOT_MODIFIED,
|
||||||
@@ -116,7 +116,7 @@ describe('Private Contract REST API POST Endpoints', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('setLeverage()', async () => {
|
it('setLeverage()', async () => {
|
||||||
expect(await api.setLeverage(symbol, '10', '10')).toMatchObject({
|
expect(await api.setLeverage(symbol, '5', '5')).toMatchObject({
|
||||||
retCode: API_ERROR_CODE.CONTRACT_SET_LEVERAGE_NOT_MODIFIED,
|
retCode: API_ERROR_CODE.CONTRACT_SET_LEVERAGE_NOT_MODIFIED,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -186,8 +186,8 @@ describe('Private Linear REST API POST Endpoints', () => {
|
|||||||
expect(
|
expect(
|
||||||
await api.setUserLeverage({
|
await api.setUserLeverage({
|
||||||
symbol,
|
symbol,
|
||||||
buy_leverage: 10,
|
buy_leverage: 5,
|
||||||
sell_leverage: 10,
|
sell_leverage: 5,
|
||||||
})
|
})
|
||||||
).toMatchObject({
|
).toMatchObject({
|
||||||
ret_code: API_ERROR_CODE.LEVERAGE_NOT_MODIFIED,
|
ret_code: API_ERROR_CODE.LEVERAGE_NOT_MODIFIED,
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ describe('Private USDC Perp REST API POST Endpoints', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('setLeverage()', async () => {
|
it('setLeverage()', async () => {
|
||||||
expect(await api.setLeverage(symbol, '10')).toMatchObject({
|
expect(await api.setLeverage(symbol, '5')).toMatchObject({
|
||||||
retCode: API_ERROR_CODE.LEVERAGE_NOT_MODIFIED,
|
retCode: API_ERROR_CODE.LEVERAGE_NOT_MODIFIED,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -181,8 +181,8 @@ describe('Private WRITE V5 REST API Endpoints', () => {
|
|||||||
expect(
|
expect(
|
||||||
await api.setLeverage({
|
await api.setLeverage({
|
||||||
category: 'linear',
|
category: 'linear',
|
||||||
buyLeverage: '10',
|
buyLeverage: '5',
|
||||||
sellLeverage: '10',
|
sellLeverage: '5',
|
||||||
symbol: linearSymbol,
|
symbol: linearSymbol,
|
||||||
})
|
})
|
||||||
).toMatchObject({
|
).toMatchObject({
|
||||||
@@ -196,8 +196,8 @@ describe('Private WRITE V5 REST API Endpoints', () => {
|
|||||||
expect(
|
expect(
|
||||||
await api.switchIsolatedMargin({
|
await api.switchIsolatedMargin({
|
||||||
category: 'linear',
|
category: 'linear',
|
||||||
buyLeverage: '10',
|
buyLeverage: '5',
|
||||||
sellLeverage: '10',
|
sellLeverage: '5',
|
||||||
symbol: linearSymbol,
|
symbol: linearSymbol,
|
||||||
// isolated
|
// isolated
|
||||||
tradeMode: 1,
|
tradeMode: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user