-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #370 from tiagosiebler/dependencies
v3.10.17: chore() update dependencies, feat() add apiRegion config for changing regional API URL
- Loading branch information
Showing
4 changed files
with
530 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { RestClientV5 } from '../src/index'; | ||
|
||
// or | ||
// import { RestClientV5 } from 'bybit-api'; | ||
|
||
/** | ||
* The first parameter of the REST client allows you to pass any configuration parameters supported by the SDK. | ||
* | ||
* These include API keys, if you wish to use private endpoints, but also expose other features such as | ||
* setting a custom base URL (e.g. for Turkish users). | ||
* | ||
* Refer to the API documentation for a complete list of domains: https://bybit-exchange.github.io/docs/v5/guide#authentication | ||
*/ | ||
const client = new RestClientV5({ | ||
/** | ||
* You can pass a completely custom base URL, | ||
* e.g. if you're trying to use a domain that hasn't been added yet (please let us know) | ||
*/ | ||
// baseUrl: 'https://api5.bybit.com', | ||
// | ||
// | ||
/** | ||
* | ||
* There are also predefined API regions, which you can easily use with the "apiRegion" property: | ||
* | ||
*/ | ||
// | ||
// | ||
// default: routes to api.bybit.com | ||
// apiRegion: 'default', | ||
// | ||
// | ||
// bytick: routes to api.bytick.com | ||
// apiRegion: 'bytick', | ||
// | ||
// | ||
// NL: routes to api.bybit.nl (for Netherland users) | ||
// apiRegion: 'NL', | ||
// | ||
// | ||
// HK: routes to api.byhkbit.com (for Hong Kong users) | ||
// apiRegion: 'HK', | ||
// | ||
// | ||
// TK: routes to api.bybit-tr.com (for Turkey users) | ||
// apiRegion: 'TK', | ||
}); | ||
|
||
(async () => { | ||
try { | ||
const time1 = await client.getServerTime(); | ||
|
||
console.log('time res: ', { time1 }); | ||
} catch (e) { | ||
console.error('request failed: ', e); | ||
} | ||
})(); |
Oops, something went wrong.