chore(4.1.0): updated earn types to include V5 suffix

This commit is contained in:
JJ-Cro
2025-03-26 11:13:03 +01:00
parent 855c90dc4b
commit 9bb6cae032
5 changed files with 234 additions and 234 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "bybit-api",
"version": "4.0.2",
"version": "4.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "bybit-api",
"version": "4.0.2",
"version": "4.1.0",
"license": "MIT",
"dependencies": {
"axios": "^1.7.9",

View File

@@ -1,6 +1,6 @@
{
"name": "bybit-api",
"version": "4.0.2",
"version": "4.1.0",
"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

@@ -60,9 +60,9 @@ import {
DeliveryRecordV5,
DepositAddressChainV5,
DepositRecordV5,
EarnOrderHistory,
EarnPosition,
EarnProduct,
EarnOrderHistoryV5,
EarnPositionV5,
EarnProductV5,
ExchangeBrokerAccountInfoV5,
ExchangeBrokerEarningResultV5,
ExchangeBrokerSubAccountDepositRecordV5,
@@ -86,8 +86,8 @@ import {
GetDeliveryPriceParamsV5,
GetDeliveryRecordParamsV5,
GetDepositRecordParamsV5,
GetEarnOrderHistoryParams,
GetEarnPositionParams,
GetEarnOrderHistoryParamsV5,
GetEarnPositionParamsV5,
GetExchangeBrokerEarningsParamsV5,
GetExecutionListParamsV5,
GetFeeRateParamsV5,
@@ -197,7 +197,7 @@ import {
SpotLeveragedTokenOrderHistoryV5,
SpotMarginStateV5,
SubMemberV5,
SubmitStakeRedeemParams,
SubmitStakeRedeemParamsV5,
SwitchIsolatedMarginParamsV5,
SwitchPositionModeParamsV5,
TPSLModeV5,
@@ -2587,7 +2587,7 @@ export class RestClientV5 extends BaseRestClient {
*/
getEarnProduct(params: { category: string; coin?: string }): Promise<
APIResponseV3WithTime<{
list: EarnProduct[];
list: EarnProductV5[];
}>
> {
return this.get('/v5/earn/product', params);
@@ -2603,7 +2603,7 @@ export class RestClientV5 extends BaseRestClient {
* within 48 hours. Once the redemption request is initiated, it cannot be canceled,
* and your principal will continue to earn interest until the process is completed.
*/
submitStakeRedeem(params: SubmitStakeRedeemParams): Promise<
submitStakeRedeem(params: SubmitStakeRedeemParamsV5): Promise<
APIResponseV3WithTime<{
orderId: string;
orderLinkId: string;
@@ -2620,9 +2620,9 @@ export class RestClientV5 extends BaseRestClient {
* Note: Either orderId or orderLinkId is required. If both are passed,
* make sure they're matched, otherwise returning empty result
*/
getEarnOrderHistory(params: GetEarnOrderHistoryParams): Promise<
getEarnOrderHistory(params: GetEarnOrderHistoryParamsV5): Promise<
APIResponseV3WithTime<{
list: EarnOrderHistory[];
list: EarnOrderHistoryV5[];
}>
> {
return this.getPrivate('/v5/earn/order', params);
@@ -2635,9 +2635,9 @@ export class RestClientV5 extends BaseRestClient {
*
* Note: Fully redeemed position is also returned in the response
*/
getEarnPosition(params: GetEarnPositionParams): Promise<
getEarnPosition(params: GetEarnPositionParamsV5): Promise<
APIResponseV3WithTime<{
list: EarnPosition[];
list: EarnPositionV5[];
}>
> {
return this.getPrivate('/v5/earn/position', params);

View File

@@ -1,4 +1,4 @@
export interface SubmitStakeRedeemParams {
export interface SubmitStakeRedeemParamsV5 {
category: string;
orderType: 'Stake' | 'Redeem';
accountType: 'FUND' | 'UNIFIED';
@@ -8,13 +8,13 @@ export interface SubmitStakeRedeemParams {
orderLinkId: string;
}
export interface GetEarnOrderHistoryParams {
export interface GetEarnOrderHistoryParamsV5 {
category: string;
orderId?: string;
orderLinkId?: string;
}
export interface GetEarnPositionParams {
export interface GetEarnPositionParamsV5 {
category: string;
productId?: string;
coin?: string;

View File

@@ -1,4 +1,4 @@
export interface EarnProduct {
export interface EarnProductV5 {
category: string;
estimateApr: string;
coin: string;
@@ -9,7 +9,7 @@ export interface EarnProduct {
status: 'Available' | 'NotAvailable';
}
export interface EarnOrderHistory {
export interface EarnOrderHistoryV5 {
coin: string;
orderValue: string;
orderType: 'Redeem' | 'Stake';
@@ -21,7 +21,7 @@ export interface EarnOrderHistory {
updatedAt: string;
}
export interface EarnPosition {
export interface EarnPositionV5 {
coin: string;
productId: string;
amount: string;