設置抵押品幣種
用戶可以自行決定是否開啟統一帳戶中幣種是否進行抵押,默認都是關閉的
HTTP 請求
POST /v5/account/set-collateral-switch
請求參數
參數 | 是否必需 | 類型 | 說明 |
---|---|---|---|
coin | true | string | 幣種名稱
|
collateralSwitch | true | string | ON : 開啟抵押, OFF : 關閉抵押 |
響應參數
無
請求示例
- HTTP
- Python
- Node.js
POST /v5/account/set-collateral-switch HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: XXXXXX
X-BAPI-TIMESTAMP: 1690513916181
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
Content-Length: 55
{
"coin": "BTC",
"collateralSwitch": "ON"
}
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.set_collateral_coin(
coin="BTC",
collateralSwitch="ON"
))
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.setCollateralCoin({
coin: 'BTC',
collateralSwitch: 'ON',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
響應示例
{
"retCode": 0,
"retMsg": "SUCCESS",
"result": {},
"retExtInfo": {},
"time": 1690515818656
}