Class: SpotClientV3
REST API client for newer Spot V3 APIs.
Deprecated
WARNING These endpoints are being switched off gradually and are expected to be completely turned off by the end of 2024. They may stop working at any point before then. Please update your code as soon as possible to use the V5 APIs instead.
Extends
default
Constructors
Constructor
new SpotClientV3(restOptions?: RestClientOptions, networkOptions?: AxiosRequestConfig): SpotClientV3;Create an instance of the REST client. Pass API credentials in the object in the first parameter.
Parameters
| Parameter | Type | Description |
|---|---|---|
restOptions? | RestClientOptions | options to configure REST API connectivity |
networkOptions? | AxiosRequestConfig | HTTP networking options for axios |
Returns
SpotClientV3
Inherited from
BaseRestClient.constructor
Methods
deletePrivate()
deletePrivate(
endpoint: string,
params?: any,
callOptions?: RestCallOptions
): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | any |
callOptions? | RestCallOptions |
Returns
Promise<any>
Inherited from
BaseRestClient.deletePrivate
fetchServerTime()
fetchServerTime(): Promise<number>;Function that calls exchange API to query & resolve server time, used by time sync, disabled by default.
Note: this should always return server time in seconds
Returns
Promise<number>
Overrides
BaseRestClient.fetchServerTime
fetchTimeOffset()
fetchTimeOffset(): Promise<number>;Estimate drift based on client<->server latency
Returns
Promise<number>
Inherited from
BaseRestClient.fetchTimeOffset
get()
get(
endpoint: string,
params?: any,
callOptions?: RestCallOptions
): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | any |
callOptions? | RestCallOptions |
Returns
Promise<any>
Inherited from
BaseRestClient.get
getClientType()
getClientType(): "v5";Defines the client type (affecting how requests & signatures behave)
Returns
"v5"
Overrides
BaseRestClient.getClientType
getMergedOrderBook()
getMergedOrderBook(
symbol: string,
scale?: number,
limit?: number
): Promise<APIResponseV3<any, {
}>>;Get merged orderbook for symbol
This is the only known pre-V5 endpoint to still be online.
Parameters
| Parameter | Type |
|---|---|
symbol | string |
scale? | number |
limit? | number |
Returns
Promise<APIResponseV3<any, { }>>
getPrivate()
getPrivate(
endpoint: string,
params?: any,
callOptions?: RestCallOptions
): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | any |
callOptions? | RestCallOptions |
Returns
Promise<any>
Inherited from
BaseRestClient.getPrivate
getServerTime()
getServerTime(): Promise<{
time_now: string;
}>;API Data Endpoints
Returns
Promise<{ time_now: string; }>
post()
post(
endpoint: string,
params?: any,
callOptions?: RestCallOptions
): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | any |
callOptions? | RestCallOptions |
Returns
Promise<any>
Inherited from
BaseRestClient.post
postPrivate()
postPrivate(
endpoint: string,
params?: any,
callOptions?: RestCallOptions
): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | any |
callOptions? | RestCallOptions |
Returns
Promise<any>
Inherited from
BaseRestClient.postPrivate
postPrivateFile()
postPrivateFile(
endpoint: string,
params?: FileUploadRequestParams,
callOptions?: RestCallOptions
): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | FileUploadRequestParams |
callOptions? | RestCallOptions |
Returns
Promise<any>
Inherited from
BaseRestClient.postPrivateFile