feat(#186): add proxy & rate limits example. Misc doc updates.
This commit is contained in:
24
examples/deprecated/rest-contract-private.ts
Normal file
24
examples/deprecated/rest-contract-private.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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 {
|
||||
const getPositions = await client.getPositions({
|
||||
settleCoin: 'USDT',
|
||||
});
|
||||
console.log('getPositions:', getPositions);
|
||||
} catch (e) {
|
||||
console.error('request failed: ', e);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user