Merge pull request #461 from JJ-Cro/updateTest07_2025
chore(v4.1.15): marked removed functions for deprecation, updated tests
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": "4.1.14",
|
"version": "4.1.15",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "bybit-api",
|
"name": "bybit-api",
|
||||||
"version": "4.1.14",
|
"version": "4.1.15",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bybit-api",
|
"name": "bybit-api",
|
||||||
"version": "4.1.14",
|
"version": "4.1.15",
|
||||||
"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",
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ import {
|
|||||||
GetRepaymentHistoryParamsV5,
|
GetRepaymentHistoryParamsV5,
|
||||||
GetRiskLimitParamsV5,
|
GetRiskLimitParamsV5,
|
||||||
GetSettlementRecordParamsV5,
|
GetSettlementRecordParamsV5,
|
||||||
GetSpotLeveragedTokenOrderHistoryParamsV5,
|
|
||||||
GetSpreadInstrumentsInfoParamsV5,
|
GetSpreadInstrumentsInfoParamsV5,
|
||||||
GetSpreadOpenOrdersParamsV5,
|
GetSpreadOpenOrdersParamsV5,
|
||||||
GetSpreadOrderHistoryParamsV5,
|
GetSpreadOrderHistoryParamsV5,
|
||||||
@@ -147,8 +146,6 @@ import {
|
|||||||
InternalDepositRecordV5,
|
InternalDepositRecordV5,
|
||||||
InternalTransferRecordV5,
|
InternalTransferRecordV5,
|
||||||
IssueVoucherParamsV5,
|
IssueVoucherParamsV5,
|
||||||
LeverageTokenInfoV5,
|
|
||||||
LeveragedTokenMarketResultV5,
|
|
||||||
LoanLTVAdjustmentHistoryV5,
|
LoanLTVAdjustmentHistoryV5,
|
||||||
LongShortRatioV5,
|
LongShortRatioV5,
|
||||||
MMPModifyParamsV5,
|
MMPModifyParamsV5,
|
||||||
@@ -184,10 +181,6 @@ import {
|
|||||||
PreUpgradeTransaction,
|
PreUpgradeTransaction,
|
||||||
PreUpgradeUSDCSessionSettlement,
|
PreUpgradeUSDCSessionSettlement,
|
||||||
PublicTradeV5,
|
PublicTradeV5,
|
||||||
PurchaseSpotLeveragedTokenParamsV5,
|
|
||||||
PurchaseSpotLeveragedTokenResultV5,
|
|
||||||
RedeemSpotLeveragedTokenParamsV5,
|
|
||||||
RedeemSpotLeveragedTokenResultV5,
|
|
||||||
RepayLiabilityParamsV5,
|
RepayLiabilityParamsV5,
|
||||||
RepayLiabilityResultV5,
|
RepayLiabilityResultV5,
|
||||||
RepaymentHistoryV5,
|
RepaymentHistoryV5,
|
||||||
@@ -203,7 +196,6 @@ import {
|
|||||||
SetTradingStopParamsV5,
|
SetTradingStopParamsV5,
|
||||||
SettlementRecordV5,
|
SettlementRecordV5,
|
||||||
SpotBorrowCheckResultV5,
|
SpotBorrowCheckResultV5,
|
||||||
SpotLeveragedTokenOrderHistoryV5,
|
|
||||||
SpotMarginStateV5,
|
SpotMarginStateV5,
|
||||||
SpreadInstrumentInfoV5,
|
SpreadInstrumentInfoV5,
|
||||||
SpreadOpenOrderV5,
|
SpreadOpenOrderV5,
|
||||||
@@ -2135,59 +2127,6 @@ export class RestClientV5 extends BaseRestClient {
|
|||||||
return this.getPrivate('/v5/user/aff-customer-info', params);
|
return this.getPrivate('/v5/user/aff-customer-info', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
****** Spot Leverage Token APIs
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query leverage token information
|
|
||||||
*/
|
|
||||||
getLeveragedTokenInfo(
|
|
||||||
ltCoin?: string,
|
|
||||||
): Promise<APIResponseV3WithTime<{ list: LeverageTokenInfoV5[] }>> {
|
|
||||||
return this.get('/v5/spot-lever-token/info', { ltCoin });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get leverage token market information.
|
|
||||||
*/
|
|
||||||
getLeveragedTokenMarket(
|
|
||||||
ltCoin: string,
|
|
||||||
): Promise<APIResponseV3WithTime<LeveragedTokenMarketResultV5>> {
|
|
||||||
return this.get('/v5/spot-lever-token/reference', { ltCoin });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This endpoint allows you to purchase a leveraged token with a specified amount.
|
|
||||||
*/
|
|
||||||
purchaseSpotLeveragedToken(
|
|
||||||
params: PurchaseSpotLeveragedTokenParamsV5,
|
|
||||||
): Promise<APIResponseV3WithTime<PurchaseSpotLeveragedTokenResultV5>> {
|
|
||||||
return this.postPrivate('/v5/spot-lever-token/purchase', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Redeem leveraged token.
|
|
||||||
*/
|
|
||||||
redeemSpotLeveragedToken(
|
|
||||||
params: RedeemSpotLeveragedTokenParamsV5,
|
|
||||||
): Promise<APIResponseV3WithTime<RedeemSpotLeveragedTokenResultV5>> {
|
|
||||||
return this.postPrivate('/v5/spot-lever-token/redeem', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get purchase or redemption history
|
|
||||||
*/
|
|
||||||
getSpotLeveragedTokenOrderHistory(
|
|
||||||
params?: GetSpotLeveragedTokenOrderHistoryParamsV5,
|
|
||||||
): Promise<
|
|
||||||
APIResponseV3WithTime<{ list: SpotLeveragedTokenOrderHistoryV5[] }>
|
|
||||||
> {
|
|
||||||
return this.getPrivate('/v5/spot-lever-token/order-record', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
****** Spot Margin Trade APIs (UTA)
|
****** Spot Margin Trade APIs (UTA)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
API_ERROR_CODE,
|
API_ERROR_CODE,
|
||||||
LeverageTokenInfoV5,
|
|
||||||
OrderSideV5,
|
OrderSideV5,
|
||||||
OrderTypeV5,
|
OrderTypeV5,
|
||||||
RestClientV5,
|
RestClientV5,
|
||||||
@@ -432,41 +431,6 @@ describe('Private WRITE V5 REST API Endpoints', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Spot Leverage Token APIs', () => {
|
|
||||||
let leverageToken: LeverageTokenInfoV5;
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
|
||||||
const tokenResult = await api.getLeveragedTokenInfo();
|
|
||||||
leverageToken = tokenResult.result.list[0];
|
|
||||||
});
|
|
||||||
|
|
||||||
it('purchaseSpotLeveragedToken()', async () => {
|
|
||||||
expect(
|
|
||||||
await api.purchaseSpotLeveragedToken({
|
|
||||||
amount: '100',
|
|
||||||
ltCoin: leverageToken.ltCoin,
|
|
||||||
}),
|
|
||||||
).toMatchObject({
|
|
||||||
// ...successResponseObjectV3(),
|
|
||||||
retCode: 175025,
|
|
||||||
// retMsg: '',
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('redeemSpotLeveragedToken()', async () => {
|
|
||||||
expect(
|
|
||||||
await api.redeemSpotLeveragedToken({
|
|
||||||
quantity: '100',
|
|
||||||
ltCoin: leverageToken.ltCoin,
|
|
||||||
}),
|
|
||||||
).toMatchObject({
|
|
||||||
// ...successResponseObjectV3(),
|
|
||||||
retCode: 175025,
|
|
||||||
// retMsg: '',
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Spot Margin APIs', () => {
|
describe('Spot Margin APIs', () => {
|
||||||
it('toggleSpotMarginTrade()', async () => {
|
it('toggleSpotMarginTrade()', async () => {
|
||||||
expect(await api.toggleSpotMarginTrade('1')).toMatchObject({
|
expect(await api.toggleSpotMarginTrade('1')).toMatchObject({
|
||||||
|
|||||||
Reference in New Issue
Block a user