Merge pull request #311 from tiagosiebler/v3.8.2
v3.8.2: feat(#310) add set collateral coin endpoints
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": "3.8.1",
|
"version": "3.8.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "bybit-api",
|
"name": "bybit-api",
|
||||||
"version": "3.8.1",
|
"version": "3.8.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.21.0",
|
"axios": "^0.21.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bybit-api",
|
"name": "bybit-api",
|
||||||
"version": "3.8.1",
|
"version": "3.8.2",
|
||||||
"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",
|
||||||
|
|||||||
@@ -109,8 +109,11 @@ import {
|
|||||||
PurchaseSpotLeveragedTokenResultV5,
|
PurchaseSpotLeveragedTokenResultV5,
|
||||||
RedeemSpotLeveragedTokenParamsV5,
|
RedeemSpotLeveragedTokenParamsV5,
|
||||||
RedeemSpotLeveragedTokenResultV5,
|
RedeemSpotLeveragedTokenResultV5,
|
||||||
|
RepayLiabilityParamsV5,
|
||||||
|
RepayLiabilityResultV5,
|
||||||
RiskLimitV5,
|
RiskLimitV5,
|
||||||
SetAutoAddMarginParamsV5,
|
SetAutoAddMarginParamsV5,
|
||||||
|
SetCollateralCoinParamsV5,
|
||||||
SetLeverageParamsV5,
|
SetLeverageParamsV5,
|
||||||
SetRiskLimitParamsV5,
|
SetRiskLimitParamsV5,
|
||||||
SetRiskLimitResultV5,
|
SetRiskLimitResultV5,
|
||||||
@@ -766,6 +769,35 @@ export class RestClientV5 extends BaseRestClient {
|
|||||||
return this.getPrivate('/v5/account/borrow-history', params);
|
return this.getPrivate('/v5/account/borrow-history', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You can manually repay the liabilities of Unified account
|
||||||
|
* Applicable: Unified Account
|
||||||
|
* Permission: USDC Contracts
|
||||||
|
*
|
||||||
|
* - Input the specific coin: repay the liability of this coin in particular
|
||||||
|
* - No coin specified: repay the liability of all coins
|
||||||
|
*/
|
||||||
|
repayLiability(
|
||||||
|
params?: RepayLiabilityParamsV5,
|
||||||
|
): Promise<APIResponseV3WithTime<CursorListV5<RepayLiabilityResultV5[]>>> {
|
||||||
|
return this.postPrivate('/v5/account/quick-repayment', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You can decide whether the assets in the Unified account needs to be collateral coins.
|
||||||
|
*/
|
||||||
|
setCollateralCoin(
|
||||||
|
params: SetCollateralCoinParamsV5,
|
||||||
|
): Promise<APIResponseV3WithTime<{}>> {
|
||||||
|
return this.postPrivate('/v5/account/set-collateral-switch', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
batchSetCollateralCoin(params: {
|
||||||
|
request: SetCollateralCoinParamsV5[];
|
||||||
|
}): Promise<APIResponseV3WithTime<{ list: SetCollateralCoinParamsV5[] }>> {
|
||||||
|
return this.postPrivate('/v5/account/set-collateral-switch-batch', params);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the collateral information of the current unified margin account, including loan interest rate,
|
* Get the collateral information of the current unified margin account, including loan interest rate,
|
||||||
* loanable amount, collateral conversion rate, whether it can be mortgaged as margin, etc.
|
* loanable amount, collateral conversion rate, whether it can be mortgaged as margin, etc.
|
||||||
|
|||||||
@@ -38,3 +38,12 @@ export interface MMPModifyParamsV5 {
|
|||||||
qtyLimit: string;
|
qtyLimit: string;
|
||||||
deltaLimit: string;
|
deltaLimit: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface RepayLiabilityParamsV5 {
|
||||||
|
coin?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SetCollateralCoinParamsV5 {
|
||||||
|
coin: string;
|
||||||
|
collateralSwitch: 'ON' | 'OFF';
|
||||||
|
}
|
||||||
|
|||||||
@@ -120,3 +120,8 @@ export interface MMPStateV5 {
|
|||||||
mmpFrozenUntil: string;
|
mmpFrozenUntil: string;
|
||||||
mmpFrozen: boolean;
|
mmpFrozen: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface RepayLiabilityResultV5 {
|
||||||
|
coin: string;
|
||||||
|
repaymentQty: string;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user