feat(#186): add proxy & rate limits example. Misc doc updates.
This commit is contained in:
25
examples/deprecated/rest-copy-private.ts
Normal file
25
examples/deprecated/rest-copy-private.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { CopyTradingClient } from '../../src/index';
|
||||
|
||||
// or
|
||||
// import { CopyTradingClient } from 'bybit-api';
|
||||
|
||||
const key = process.env.API_KEY_COM;
|
||||
const secret = process.env.API_SECRET_COM;
|
||||
|
||||
const client = new CopyTradingClient({
|
||||
key,
|
||||
secret,
|
||||
strict_param_validation: true,
|
||||
});
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const res = await client.closeOrder({
|
||||
symbol: 'BTCUSDT',
|
||||
parentOrderId: '419190fe-016c-469a-810e-936bef2f1234',
|
||||
});
|
||||
console.log('res:', res);
|
||||
} catch (e) {
|
||||
console.error('request failed: ', e);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user