fix spot leverage token endpoint v5
This commit is contained in:
@@ -7,20 +7,38 @@ const key = process.env.API_KEY_COM;
|
||||
const secret = process.env.API_SECRET_COM;
|
||||
|
||||
const client = new RestClientV5({
|
||||
key,
|
||||
secret,
|
||||
strict_param_validation: true,
|
||||
key: key,
|
||||
secret: secret,
|
||||
});
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
/** Simple example for a private REST API call with bybit's V5 REST APIs */
|
||||
/** Simple examples for private REST API calls with bybit's V5 REST APIs */
|
||||
const response = await client.getPositionInfo({
|
||||
category: 'option',
|
||||
symbol: 'BTCUSDT',
|
||||
});
|
||||
|
||||
console.log('response:', response);
|
||||
|
||||
// Trade USDT linear perps
|
||||
const buyOrderResult = await client.submitOrder({
|
||||
category: 'linear',
|
||||
symbol: 'BTCUSDT',
|
||||
orderType: 'Market',
|
||||
qty: '1',
|
||||
side: 'Buy',
|
||||
});
|
||||
console.log('buyOrderResult:', buyOrderResult);
|
||||
|
||||
const sellOrderResult = await client.submitOrder({
|
||||
category: 'linear',
|
||||
symbol: 'BTCUSDT',
|
||||
orderType: 'Market',
|
||||
qty: '1',
|
||||
side: 'Sell',
|
||||
});
|
||||
console.log('sellOrderResult:', sellOrderResult);
|
||||
} catch (e) {
|
||||
console.error('request failed: ', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user