Merge pull request #366 from JJ-Cro/AugustUpdate

feat(): Added endpoint, updated types
This commit is contained in:
Tiago
2024-08-28 11:45:27 +01:00
committed by GitHub
5 changed files with 33 additions and 4 deletions

1
.gitignore vendored
View File

@@ -25,4 +25,5 @@ bundleReport.html
rawReq.ts rawReq.ts
localtest.sh localtest.sh
localtest.ts localtest.ts
privaterepotracker

4
package-lock.json generated
View File

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

View File

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

View File

@@ -1766,6 +1766,32 @@ export class RestClientV5 extends BaseRestClient {
}); });
} }
/**
* Get Historical Interest Rate
* You can query up to six months borrowing interest rate of Margin trading.
* INFO: Need authentication, the api key needs "Spot" permission. Only supports Unified account.
*/
getHistoricalInterestRate(params: {
currency: string;
vipLevel?: string;
startTime?: number;
endTime?: number;
}): Promise<
APIResponseV3WithTime<{
list: {
timestamp: number;
currency: string;
hourlyBorrowRate: string;
vipLevel: string;
}[];
}>
> {
return this.getPrivate(
'/v5/spot-margin-trade/interest-rate-history',
params,
);
}
/** /**
* Get Borrowable Coin Info * Get Borrowable Coin Info
*/ */
@@ -1959,7 +1985,7 @@ export class RestClientV5 extends BaseRestClient {
startTime?: number; startTime?: number;
endTime?: number; endTime?: number;
limit?: number; limit?: number;
}): Promise<APIResponseV3WithTime<{ marginToken: any[] }>> { }): Promise<APIResponseV3WithTime<{ loanInfo: any[] }>> {
return this.getPrivate('/v5/ins-loan/loan-order', params); return this.getPrivate('/v5/ins-loan/loan-order', params);
} }

View File

@@ -207,6 +207,8 @@ export interface ConvertQuoteV5 {
toAmount: string; toAmount: string;
expiredTime: string; expiredTime: string;
requestId: string; requestId: string;
paramType: string;
paramValue: string;
} }
export interface ConvertStatusV5 { export interface ConvertStatusV5 {