more tidying on v5 example and request type
This commit is contained in:
27
examples/rest-v5-private.ts
Normal file
27
examples/rest-v5-private.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { RestClientV5 } from '../src/index';
|
||||
|
||||
// or
|
||||
// import { RestClientV5 } from 'bybit-api';
|
||||
|
||||
const key = process.env.API_KEY_COM;
|
||||
const secret = process.env.API_SECRET_COM;
|
||||
|
||||
const client = new RestClientV5({
|
||||
key,
|
||||
secret,
|
||||
strict_param_validation: true,
|
||||
});
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
/** Simple example for a private REST API call with bybit's V5 REST APIs */
|
||||
const response = await client.getPositionInfo({
|
||||
category: 'option',
|
||||
symbol: 'BTCUSDT',
|
||||
});
|
||||
|
||||
console.log('response:', response);
|
||||
} catch (e) {
|
||||
console.error('request failed: ', e);
|
||||
}
|
||||
})();
|
||||
@@ -125,7 +125,7 @@ export interface WithdrawParamsV5 {
|
||||
amount: string;
|
||||
timestamp: number;
|
||||
forceChain?: number;
|
||||
accountType?: string;
|
||||
accountType?: 'SPOT' | 'FUND';
|
||||
}
|
||||
|
||||
export interface CreateSubMemberParamsV5 {
|
||||
|
||||
Reference in New Issue
Block a user