diff --git a/examples/rest-rawv3auth.ts b/examples/rest-raw-v3sign.ts similarity index 100% rename from examples/rest-rawv3auth.ts rename to examples/rest-raw-v3sign.ts diff --git a/examples/rest-v5-private.ts b/examples/rest-v5-private.ts new file mode 100644 index 0000000..bc66ec1 --- /dev/null +++ b/examples/rest-v5-private.ts @@ -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); + } +})(); diff --git a/src/types/request/v5-asset.ts b/src/types/request/v5-asset.ts index a1af232..8867c03 100644 --- a/src/types/request/v5-asset.ts +++ b/src/types/request/v5-asset.ts @@ -125,7 +125,7 @@ export interface WithdrawParamsV5 { amount: string; timestamp: number; forceChain?: number; - accountType?: string; + accountType?: 'SPOT' | 'FUND'; } export interface CreateSubMemberParamsV5 {