more tidying on v5 example and request type

This commit is contained in:
tiagosiebler
2023-02-17 12:18:56 +00:00
parent 6a4e7c09ed
commit 19f785b624
3 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
import { ContractClient } from '../src/index';
// or
// import { ContractClient } from 'bybit-api';
const key = process.env.API_KEY_COM;
const secret = process.env.API_SECRET_COM;
const client = new ContractClient({
key,
secret,
strict_param_validation: true,
});
(async () => {
try {
/**
* You can make raw HTTP requests without the per-endpoint abstraction,
* e.g. if an endpoint is missing and you're blocked (but please raise an issue if you're missing an endpoint)
*/
const rawCall = await client.getPrivate('/v5/order/realtime', {
category: 'linear',
symbol: 'BTCUSDT',
});
console.log('rawCall:', rawCall);
} catch (e) {
console.error('request failed: ', e);
}
})();