v3.3.4: fix optional param in contract client, add js/ts samples for contract client, fix e2e open interest limit test, update readme
This commit is contained in:
21
examples/rest-contract-public.js
Normal file
21
examples/rest-contract-public.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* This is the pure javascript version of the `rest-contract-public.ts` sample
|
||||
*/
|
||||
|
||||
// To use a local build (testing with the repo directly), make sure to `npm run build` first from the repo root
|
||||
// const { ContractClient } = require('../dist');
|
||||
|
||||
// or, use the version installed with npm
|
||||
const { ContractClient } = require('bybit-api');
|
||||
|
||||
(async () => {
|
||||
const client = new ContractClient();
|
||||
|
||||
try {
|
||||
const orderbookResult = await client.getOrderBook('BTCUSDT', 'linear');
|
||||
console.log('orderbook result: ', orderbookResult);
|
||||
} catch (e) {
|
||||
console.error('request failed: ', e);
|
||||
}
|
||||
|
||||
})();
|
||||
20
examples/rest-contract-public.ts
Normal file
20
examples/rest-contract-public.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* This is the TypeScript version of the `rest-contract-public.js` sample.
|
||||
*/
|
||||
|
||||
// For testing with the repo directly, import from the src folder
|
||||
import { ContractClient } from '../src';
|
||||
|
||||
// or, use the version installed with npm
|
||||
// import { ContractClient } from 'bybit-api';
|
||||
|
||||
(async () => {
|
||||
const client = new ContractClient();
|
||||
|
||||
try {
|
||||
const orderbookResult = await client.getOrderBook('BTCUSDT', 'linear');
|
||||
console.log('orderbook result: ', orderbookResult);
|
||||
} catch (e) {
|
||||
console.error('request failed: ', e);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user