zklighter-perps 1.0.313 → 1.0.315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +4 -0
- package/apis/UpdownApi.ts +131 -0
- package/apis/index.ts +1 -0
- package/models/AccountBinaryOptionsPosition.ts +12 -1
- package/models/AccountPosition.ts +10 -1
- package/models/ReqGetUpDownCandles.ts +115 -0
- package/models/RespGetUpDownCandles.ts +93 -0
- package/models/UpDownCandle.ts +151 -0
- package/models/index.ts +3 -0
- package/openapi.json +251 -5
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -24,6 +24,7 @@ apis/StockfinancialsApi.ts
|
|
|
24
24
|
apis/TokenlistApi.ts
|
|
25
25
|
apis/TransactionApi.ts
|
|
26
26
|
apis/TvApi.ts
|
|
27
|
+
apis/UpdownApi.ts
|
|
27
28
|
apis/index.ts
|
|
28
29
|
index.ts
|
|
29
30
|
models/Account.ts
|
|
@@ -232,6 +233,7 @@ models/ReqGetTrades.ts
|
|
|
232
233
|
models/ReqGetTransferFeeInfo.ts
|
|
233
234
|
models/ReqGetTransferHistory.ts
|
|
234
235
|
models/ReqGetTx.ts
|
|
236
|
+
models/ReqGetUpDownCandles.ts
|
|
235
237
|
models/ReqGetUserReferrals.ts
|
|
236
238
|
models/ReqGetWithdrawHistory.ts
|
|
237
239
|
models/ReqGuildByReferralCode.ts
|
|
@@ -265,6 +267,7 @@ models/RespGetMakerOnlyApiKeys.ts
|
|
|
265
267
|
models/RespGetMarketMetrics.ts
|
|
266
268
|
models/RespGetPushNotifSettings.ts
|
|
267
269
|
models/RespGetRFQ.ts
|
|
270
|
+
models/RespGetUpDownCandles.ts
|
|
268
271
|
models/RespGuildByReferralCode.ts
|
|
269
272
|
models/RespGuildInviteCodes.ts
|
|
270
273
|
models/RespGuildJoinRequest.ts
|
|
@@ -339,6 +342,7 @@ models/Tx.ts
|
|
|
339
342
|
models/TxHash.ts
|
|
340
343
|
models/TxHashes.ts
|
|
341
344
|
models/Txs.ts
|
|
345
|
+
models/UpDownCandle.ts
|
|
342
346
|
models/UpcomingEarning.ts
|
|
343
347
|
models/UpcomingEarnings.ts
|
|
344
348
|
models/UserReferrals.ts
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document:
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
RespGetUpDownCandles,
|
|
19
|
+
ResultCode,
|
|
20
|
+
} from '../models/index';
|
|
21
|
+
import {
|
|
22
|
+
RespGetUpDownCandlesFromJSON,
|
|
23
|
+
RespGetUpDownCandlesToJSON,
|
|
24
|
+
ResultCodeFromJSON,
|
|
25
|
+
ResultCodeToJSON,
|
|
26
|
+
} from '../models/index';
|
|
27
|
+
|
|
28
|
+
export interface UpDownCandlesRequest {
|
|
29
|
+
symbol: string;
|
|
30
|
+
duration: string;
|
|
31
|
+
start_timestamp: number;
|
|
32
|
+
end_timestamp: number;
|
|
33
|
+
resolution?: UpDownCandlesResolutionEnum;
|
|
34
|
+
limit?: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
export class UpdownApi extends runtime.BaseAPI {
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get the OHLC candles (1s = the exact price observations, or 30s) of an up/down market series (symbol + duration, e.g. btc/5m) in a bounded time range (at most 24h), oldest first. Pass next_cursor as start_timestamp to page forward; live candles are on the up_down_candle/<symbol>/<duration>/<resolution> websocket channel.
|
|
44
|
+
* upDownCandles
|
|
45
|
+
*/
|
|
46
|
+
async upDownCandlesRaw(requestParameters: UpDownCandlesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetUpDownCandles>> {
|
|
47
|
+
if (requestParameters['symbol'] == null) {
|
|
48
|
+
throw new runtime.RequiredError(
|
|
49
|
+
'symbol',
|
|
50
|
+
'Required parameter "symbol" was null or undefined when calling upDownCandles().'
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (requestParameters['duration'] == null) {
|
|
55
|
+
throw new runtime.RequiredError(
|
|
56
|
+
'duration',
|
|
57
|
+
'Required parameter "duration" was null or undefined when calling upDownCandles().'
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (requestParameters['start_timestamp'] == null) {
|
|
62
|
+
throw new runtime.RequiredError(
|
|
63
|
+
'start_timestamp',
|
|
64
|
+
'Required parameter "start_timestamp" was null or undefined when calling upDownCandles().'
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (requestParameters['end_timestamp'] == null) {
|
|
69
|
+
throw new runtime.RequiredError(
|
|
70
|
+
'end_timestamp',
|
|
71
|
+
'Required parameter "end_timestamp" was null or undefined when calling upDownCandles().'
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const queryParameters: any = {};
|
|
76
|
+
|
|
77
|
+
if (requestParameters['symbol'] != null) {
|
|
78
|
+
queryParameters['symbol'] = requestParameters['symbol'];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (requestParameters['duration'] != null) {
|
|
82
|
+
queryParameters['duration'] = requestParameters['duration'];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (requestParameters['resolution'] != null) {
|
|
86
|
+
queryParameters['resolution'] = requestParameters['resolution'];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (requestParameters['start_timestamp'] != null) {
|
|
90
|
+
queryParameters['start_timestamp'] = requestParameters['start_timestamp'];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (requestParameters['end_timestamp'] != null) {
|
|
94
|
+
queryParameters['end_timestamp'] = requestParameters['end_timestamp'];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (requestParameters['limit'] != null) {
|
|
98
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
102
|
+
|
|
103
|
+
const response = await this.request({
|
|
104
|
+
path: `/api/v1/upDownCandles`,
|
|
105
|
+
method: 'GET',
|
|
106
|
+
headers: headerParameters,
|
|
107
|
+
query: queryParameters,
|
|
108
|
+
}, initOverrides);
|
|
109
|
+
|
|
110
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetUpDownCandlesFromJSON(jsonValue));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get the OHLC candles (1s = the exact price observations, or 30s) of an up/down market series (symbol + duration, e.g. btc/5m) in a bounded time range (at most 24h), oldest first. Pass next_cursor as start_timestamp to page forward; live candles are on the up_down_candle/<symbol>/<duration>/<resolution> websocket channel.
|
|
115
|
+
* upDownCandles
|
|
116
|
+
*/
|
|
117
|
+
async upDownCandles(requestParameters: UpDownCandlesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetUpDownCandles> {
|
|
118
|
+
const response = await this.upDownCandlesRaw(requestParameters, initOverrides);
|
|
119
|
+
return await response.value();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @export
|
|
126
|
+
*/
|
|
127
|
+
export const UpDownCandlesResolutionEnum = {
|
|
128
|
+
_1s: '1s',
|
|
129
|
+
_30s: '30s'
|
|
130
|
+
} as const;
|
|
131
|
+
export type UpDownCandlesResolutionEnum = typeof UpDownCandlesResolutionEnum[keyof typeof UpDownCandlesResolutionEnum];
|
package/apis/index.ts
CHANGED
|
@@ -42,7 +42,7 @@ export interface AccountBinaryOptionsPosition {
|
|
|
42
42
|
* @type {number}
|
|
43
43
|
* @memberof AccountBinaryOptionsPosition
|
|
44
44
|
*/
|
|
45
|
-
sign:
|
|
45
|
+
sign: AccountBinaryOptionsPositionSignEnum;
|
|
46
46
|
/**
|
|
47
47
|
* magnitude only; combine with sign
|
|
48
48
|
* @type {string}
|
|
@@ -51,6 +51,17 @@ export interface AccountBinaryOptionsPosition {
|
|
|
51
51
|
size: string;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @export
|
|
57
|
+
*/
|
|
58
|
+
export const AccountBinaryOptionsPositionSignEnum = {
|
|
59
|
+
No: -1,
|
|
60
|
+
Yes: 1
|
|
61
|
+
} as const;
|
|
62
|
+
export type AccountBinaryOptionsPositionSignEnum = typeof AccountBinaryOptionsPositionSignEnum[keyof typeof AccountBinaryOptionsPositionSignEnum];
|
|
63
|
+
|
|
64
|
+
|
|
54
65
|
/**
|
|
55
66
|
* Check if a given object implements the AccountBinaryOptionsPosition interface.
|
|
56
67
|
*/
|
|
@@ -60,7 +60,7 @@ export interface AccountPosition {
|
|
|
60
60
|
* @type {number}
|
|
61
61
|
* @memberof AccountPosition
|
|
62
62
|
*/
|
|
63
|
-
sign:
|
|
63
|
+
sign: AccountPositionSignEnum;
|
|
64
64
|
/**
|
|
65
65
|
*
|
|
66
66
|
* @type {string}
|
|
@@ -130,6 +130,15 @@ export interface AccountPosition {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
|
|
133
|
+
/**
|
|
134
|
+
* @export
|
|
135
|
+
*/
|
|
136
|
+
export const AccountPositionSignEnum = {
|
|
137
|
+
Short: -1,
|
|
138
|
+
Long: 1
|
|
139
|
+
} as const;
|
|
140
|
+
export type AccountPositionSignEnum = typeof AccountPositionSignEnum[keyof typeof AccountPositionSignEnum];
|
|
141
|
+
|
|
133
142
|
/**
|
|
134
143
|
* @export
|
|
135
144
|
*/
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document:
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ReqGetUpDownCandles
|
|
20
|
+
*/
|
|
21
|
+
export interface ReqGetUpDownCandles {
|
|
22
|
+
/**
|
|
23
|
+
* market series: underlying (case-insensitive) ...
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ReqGetUpDownCandles
|
|
26
|
+
*/
|
|
27
|
+
symbol: string;
|
|
28
|
+
/**
|
|
29
|
+
* ... and market duration, e.g. 30s or 5m
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ReqGetUpDownCandles
|
|
32
|
+
*/
|
|
33
|
+
duration: string;
|
|
34
|
+
/**
|
|
35
|
+
* 1s candles are the observations themselves
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof ReqGetUpDownCandles
|
|
38
|
+
*/
|
|
39
|
+
resolution?: ReqGetUpDownCandlesResolutionEnum;
|
|
40
|
+
/**
|
|
41
|
+
* inclusive bucket start, seconds
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof ReqGetUpDownCandles
|
|
44
|
+
*/
|
|
45
|
+
start_timestamp: number;
|
|
46
|
+
/**
|
|
47
|
+
* inclusive, seconds; at most 24h after start_timestamp
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof ReqGetUpDownCandles
|
|
50
|
+
*/
|
|
51
|
+
end_timestamp: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof ReqGetUpDownCandles
|
|
56
|
+
*/
|
|
57
|
+
limit?: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @export
|
|
63
|
+
*/
|
|
64
|
+
export const ReqGetUpDownCandlesResolutionEnum = {
|
|
65
|
+
_1s: '1s',
|
|
66
|
+
_30s: '30s'
|
|
67
|
+
} as const;
|
|
68
|
+
export type ReqGetUpDownCandlesResolutionEnum = typeof ReqGetUpDownCandlesResolutionEnum[keyof typeof ReqGetUpDownCandlesResolutionEnum];
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Check if a given object implements the ReqGetUpDownCandles interface.
|
|
73
|
+
*/
|
|
74
|
+
export function instanceOfReqGetUpDownCandles(value: object): value is ReqGetUpDownCandles {
|
|
75
|
+
if (!('symbol' in value) || value['symbol'] === undefined) return false;
|
|
76
|
+
if (!('duration' in value) || value['duration'] === undefined) return false;
|
|
77
|
+
if (!('start_timestamp' in value) || value['start_timestamp'] === undefined) return false;
|
|
78
|
+
if (!('end_timestamp' in value) || value['end_timestamp'] === undefined) return false;
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function ReqGetUpDownCandlesFromJSON(json: any): ReqGetUpDownCandles {
|
|
83
|
+
return ReqGetUpDownCandlesFromJSONTyped(json, false);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function ReqGetUpDownCandlesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetUpDownCandles {
|
|
87
|
+
if (json == null) {
|
|
88
|
+
return json;
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
|
|
92
|
+
'symbol': json['symbol'],
|
|
93
|
+
'duration': json['duration'],
|
|
94
|
+
'resolution': json['resolution'] == null ? undefined : json['resolution'],
|
|
95
|
+
'start_timestamp': json['start_timestamp'],
|
|
96
|
+
'end_timestamp': json['end_timestamp'],
|
|
97
|
+
'limit': json['limit'] == null ? undefined : json['limit'],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function ReqGetUpDownCandlesToJSON(value?: ReqGetUpDownCandles | null): any {
|
|
102
|
+
if (value == null) {
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
|
|
107
|
+
'symbol': value['symbol'],
|
|
108
|
+
'duration': value['duration'],
|
|
109
|
+
'resolution': value['resolution'],
|
|
110
|
+
'start_timestamp': value['start_timestamp'],
|
|
111
|
+
'end_timestamp': value['end_timestamp'],
|
|
112
|
+
'limit': value['limit'],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document:
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { UpDownCandle } from './UpDownCandle';
|
|
17
|
+
import {
|
|
18
|
+
UpDownCandleFromJSON,
|
|
19
|
+
UpDownCandleFromJSONTyped,
|
|
20
|
+
UpDownCandleToJSON,
|
|
21
|
+
} from './UpDownCandle';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @interface RespGetUpDownCandles
|
|
27
|
+
*/
|
|
28
|
+
export interface RespGetUpDownCandles {
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {number}
|
|
32
|
+
* @memberof RespGetUpDownCandles
|
|
33
|
+
*/
|
|
34
|
+
code: number;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof RespGetUpDownCandles
|
|
39
|
+
*/
|
|
40
|
+
message?: string;
|
|
41
|
+
/**
|
|
42
|
+
* ascending by timestamp
|
|
43
|
+
* @type {Array<UpDownCandle>}
|
|
44
|
+
* @memberof RespGetUpDownCandles
|
|
45
|
+
*/
|
|
46
|
+
candles: Array<UpDownCandle>;
|
|
47
|
+
/**
|
|
48
|
+
* start_timestamp of the next page; 0 when the range is exhausted
|
|
49
|
+
* @type {number}
|
|
50
|
+
* @memberof RespGetUpDownCandles
|
|
51
|
+
*/
|
|
52
|
+
next_cursor?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Check if a given object implements the RespGetUpDownCandles interface.
|
|
57
|
+
*/
|
|
58
|
+
export function instanceOfRespGetUpDownCandles(value: object): value is RespGetUpDownCandles {
|
|
59
|
+
if (!('code' in value) || value['code'] === undefined) return false;
|
|
60
|
+
if (!('candles' in value) || value['candles'] === undefined) return false;
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function RespGetUpDownCandlesFromJSON(json: any): RespGetUpDownCandles {
|
|
65
|
+
return RespGetUpDownCandlesFromJSONTyped(json, false);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function RespGetUpDownCandlesFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespGetUpDownCandles {
|
|
69
|
+
if (json == null) {
|
|
70
|
+
return json;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
|
|
74
|
+
'code': json['code'],
|
|
75
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
76
|
+
'candles': ((json['candles'] as Array<any>).map(UpDownCandleFromJSON)),
|
|
77
|
+
'next_cursor': json['next_cursor'] == null ? undefined : json['next_cursor'],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function RespGetUpDownCandlesToJSON(value?: RespGetUpDownCandles | null): any {
|
|
82
|
+
if (value == null) {
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
|
|
87
|
+
'code': value['code'],
|
|
88
|
+
'message': value['message'],
|
|
89
|
+
'candles': ((value['candles'] as Array<any>).map(UpDownCandleToJSON)),
|
|
90
|
+
'next_cursor': value['next_cursor'],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document:
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface UpDownCandle
|
|
20
|
+
*/
|
|
21
|
+
export interface UpDownCandle {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof UpDownCandle
|
|
26
|
+
*/
|
|
27
|
+
symbol: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof UpDownCandle
|
|
32
|
+
*/
|
|
33
|
+
duration: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof UpDownCandle
|
|
38
|
+
*/
|
|
39
|
+
resolution: string;
|
|
40
|
+
/**
|
|
41
|
+
* bucket start, unix seconds
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof UpDownCandle
|
|
44
|
+
*/
|
|
45
|
+
timestamp: number;
|
|
46
|
+
/**
|
|
47
|
+
* exact provider prices, decimal strings
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof UpDownCandle
|
|
50
|
+
*/
|
|
51
|
+
open: string;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof UpDownCandle
|
|
56
|
+
*/
|
|
57
|
+
high: string;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @memberof UpDownCandle
|
|
62
|
+
*/
|
|
63
|
+
low: string;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @type {string}
|
|
67
|
+
* @memberof UpDownCandle
|
|
68
|
+
*/
|
|
69
|
+
close: string;
|
|
70
|
+
/**
|
|
71
|
+
* observations in the candle: orders live updates of the same bucket, not served
|
|
72
|
+
* @type {number}
|
|
73
|
+
* @memberof UpDownCandle
|
|
74
|
+
*/
|
|
75
|
+
sampleCount: number;
|
|
76
|
+
/**
|
|
77
|
+
* provider feed of the last observation of the candle
|
|
78
|
+
* @type {string}
|
|
79
|
+
* @memberof UpDownCandle
|
|
80
|
+
*/
|
|
81
|
+
provider: string;
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* @type {string}
|
|
85
|
+
* @memberof UpDownCandle
|
|
86
|
+
*/
|
|
87
|
+
feed_id: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Check if a given object implements the UpDownCandle interface.
|
|
92
|
+
*/
|
|
93
|
+
export function instanceOfUpDownCandle(value: object): value is UpDownCandle {
|
|
94
|
+
if (!('symbol' in value) || value['symbol'] === undefined) return false;
|
|
95
|
+
if (!('duration' in value) || value['duration'] === undefined) return false;
|
|
96
|
+
if (!('resolution' in value) || value['resolution'] === undefined) return false;
|
|
97
|
+
if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
|
|
98
|
+
if (!('open' in value) || value['open'] === undefined) return false;
|
|
99
|
+
if (!('high' in value) || value['high'] === undefined) return false;
|
|
100
|
+
if (!('low' in value) || value['low'] === undefined) return false;
|
|
101
|
+
if (!('close' in value) || value['close'] === undefined) return false;
|
|
102
|
+
if (!('sampleCount' in value) || value['sampleCount'] === undefined) return false;
|
|
103
|
+
if (!('provider' in value) || value['provider'] === undefined) return false;
|
|
104
|
+
if (!('feed_id' in value) || value['feed_id'] === undefined) return false;
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function UpDownCandleFromJSON(json: any): UpDownCandle {
|
|
109
|
+
return UpDownCandleFromJSONTyped(json, false);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function UpDownCandleFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpDownCandle {
|
|
113
|
+
if (json == null) {
|
|
114
|
+
return json;
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
|
|
118
|
+
'symbol': json['symbol'],
|
|
119
|
+
'duration': json['duration'],
|
|
120
|
+
'resolution': json['resolution'],
|
|
121
|
+
'timestamp': json['timestamp'],
|
|
122
|
+
'open': json['open'],
|
|
123
|
+
'high': json['high'],
|
|
124
|
+
'low': json['low'],
|
|
125
|
+
'close': json['close'],
|
|
126
|
+
'sampleCount': json['sampleCount'],
|
|
127
|
+
'provider': json['provider'],
|
|
128
|
+
'feed_id': json['feed_id'],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function UpDownCandleToJSON(value?: UpDownCandle | null): any {
|
|
133
|
+
if (value == null) {
|
|
134
|
+
return value;
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
|
|
138
|
+
'symbol': value['symbol'],
|
|
139
|
+
'duration': value['duration'],
|
|
140
|
+
'resolution': value['resolution'],
|
|
141
|
+
'timestamp': value['timestamp'],
|
|
142
|
+
'open': value['open'],
|
|
143
|
+
'high': value['high'],
|
|
144
|
+
'low': value['low'],
|
|
145
|
+
'close': value['close'],
|
|
146
|
+
'sampleCount': value['sampleCount'],
|
|
147
|
+
'provider': value['provider'],
|
|
148
|
+
'feed_id': value['feed_id'],
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
package/models/index.ts
CHANGED
|
@@ -206,6 +206,7 @@ export * from './ReqGetTrades';
|
|
|
206
206
|
export * from './ReqGetTransferFeeInfo';
|
|
207
207
|
export * from './ReqGetTransferHistory';
|
|
208
208
|
export * from './ReqGetTx';
|
|
209
|
+
export * from './ReqGetUpDownCandles';
|
|
209
210
|
export * from './ReqGetUserReferrals';
|
|
210
211
|
export * from './ReqGetWithdrawHistory';
|
|
211
212
|
export * from './ReqGuildByReferralCode';
|
|
@@ -239,6 +240,7 @@ export * from './RespGetMakerOnlyApiKeys';
|
|
|
239
240
|
export * from './RespGetMarketMetrics';
|
|
240
241
|
export * from './RespGetPushNotifSettings';
|
|
241
242
|
export * from './RespGetRFQ';
|
|
243
|
+
export * from './RespGetUpDownCandles';
|
|
242
244
|
export * from './RespGuildByReferralCode';
|
|
243
245
|
export * from './RespGuildInviteCodes';
|
|
244
246
|
export * from './RespGuildJoinRequest';
|
|
@@ -313,6 +315,7 @@ export * from './Tx';
|
|
|
313
315
|
export * from './TxHash';
|
|
314
316
|
export * from './TxHashes';
|
|
315
317
|
export * from './Txs';
|
|
318
|
+
export * from './UpDownCandle';
|
|
316
319
|
export * from './UpcomingEarning';
|
|
317
320
|
export * from './UpcomingEarnings';
|
|
318
321
|
export * from './UserReferrals';
|
package/openapi.json
CHANGED
|
@@ -4694,7 +4694,7 @@
|
|
|
4694
4694
|
"format": "int32",
|
|
4695
4695
|
"default": "0",
|
|
4696
4696
|
"minimum": 0,
|
|
4697
|
-
"maximum":
|
|
4697
|
+
"maximum": 1000000
|
|
4698
4698
|
},
|
|
4699
4699
|
{
|
|
4700
4700
|
"name": "search",
|
|
@@ -6858,6 +6858,91 @@
|
|
|
6858
6858
|
"description": "Get transactions which are already packed into blocks"
|
|
6859
6859
|
}
|
|
6860
6860
|
},
|
|
6861
|
+
"/api/v1/upDownCandles": {
|
|
6862
|
+
"get": {
|
|
6863
|
+
"summary": "upDownCandles",
|
|
6864
|
+
"operationId": "upDownCandles",
|
|
6865
|
+
"responses": {
|
|
6866
|
+
"200": {
|
|
6867
|
+
"description": "A successful response.",
|
|
6868
|
+
"schema": {
|
|
6869
|
+
"$ref": "#/definitions/RespGetUpDownCandles"
|
|
6870
|
+
}
|
|
6871
|
+
},
|
|
6872
|
+
"400": {
|
|
6873
|
+
"description": "Bad request",
|
|
6874
|
+
"schema": {
|
|
6875
|
+
"$ref": "#/definitions/ResultCode"
|
|
6876
|
+
}
|
|
6877
|
+
}
|
|
6878
|
+
},
|
|
6879
|
+
"parameters": [
|
|
6880
|
+
{
|
|
6881
|
+
"name": "symbol",
|
|
6882
|
+
"description": " market series: underlying (case-insensitive) ...",
|
|
6883
|
+
"in": "query",
|
|
6884
|
+
"required": true,
|
|
6885
|
+
"type": "string"
|
|
6886
|
+
},
|
|
6887
|
+
{
|
|
6888
|
+
"name": "duration",
|
|
6889
|
+
"description": " ... and market duration, e.g. 30s or 5m",
|
|
6890
|
+
"in": "query",
|
|
6891
|
+
"required": true,
|
|
6892
|
+
"type": "string"
|
|
6893
|
+
},
|
|
6894
|
+
{
|
|
6895
|
+
"name": "resolution",
|
|
6896
|
+
"description": " 1s candles are the observations themselves",
|
|
6897
|
+
"in": "query",
|
|
6898
|
+
"required": false,
|
|
6899
|
+
"type": "string",
|
|
6900
|
+
"enum": [
|
|
6901
|
+
"1s",
|
|
6902
|
+
"30s"
|
|
6903
|
+
],
|
|
6904
|
+
"default": "1s"
|
|
6905
|
+
},
|
|
6906
|
+
{
|
|
6907
|
+
"name": "start_timestamp",
|
|
6908
|
+
"description": " inclusive bucket start, seconds",
|
|
6909
|
+
"in": "query",
|
|
6910
|
+
"required": true,
|
|
6911
|
+
"type": "integer",
|
|
6912
|
+
"format": "int64",
|
|
6913
|
+
"minimum": 0,
|
|
6914
|
+
"maximum": 5000000000
|
|
6915
|
+
},
|
|
6916
|
+
{
|
|
6917
|
+
"name": "end_timestamp",
|
|
6918
|
+
"description": " inclusive, seconds; at most 24h after start_timestamp",
|
|
6919
|
+
"in": "query",
|
|
6920
|
+
"required": true,
|
|
6921
|
+
"type": "integer",
|
|
6922
|
+
"format": "int64",
|
|
6923
|
+
"minimum": 0,
|
|
6924
|
+
"maximum": 5000000000
|
|
6925
|
+
},
|
|
6926
|
+
{
|
|
6927
|
+
"name": "limit",
|
|
6928
|
+
"in": "query",
|
|
6929
|
+
"required": false,
|
|
6930
|
+
"type": "integer",
|
|
6931
|
+
"format": "int64",
|
|
6932
|
+
"default": "1000",
|
|
6933
|
+
"minimum": 1,
|
|
6934
|
+
"maximum": 3600
|
|
6935
|
+
}
|
|
6936
|
+
],
|
|
6937
|
+
"tags": [
|
|
6938
|
+
"updown"
|
|
6939
|
+
],
|
|
6940
|
+
"consumes": [
|
|
6941
|
+
"multipart/form-data"
|
|
6942
|
+
],
|
|
6943
|
+
"description": "Get the OHLC candles (1s = the exact price observations, or 30s) of an up/down market series (symbol + duration, e.g. btc/5m) in a bounded time range (at most 24h), oldest first. Pass next_cursor as start_timestamp to page forward; live candles are on the up_down_candle/<symbol>/<duration>/<resolution> websocket channel."
|
|
6944
|
+
}
|
|
6945
|
+
},
|
|
6861
6946
|
"/api/v1/upcomingEarnings": {
|
|
6862
6947
|
"get": {
|
|
6863
6948
|
"summary": "upcomingEarnings",
|
|
@@ -7283,8 +7368,15 @@
|
|
|
7283
7368
|
"sign": {
|
|
7284
7369
|
"type": "integer",
|
|
7285
7370
|
"format": "int32",
|
|
7286
|
-
"
|
|
7287
|
-
|
|
7371
|
+
"enum": [
|
|
7372
|
+
-1,
|
|
7373
|
+
1
|
|
7374
|
+
],
|
|
7375
|
+
"description": " 1 holds the YES outcome, -1 holds the NO outcome",
|
|
7376
|
+
"x-enum-varnames": [
|
|
7377
|
+
"No",
|
|
7378
|
+
"Yes"
|
|
7379
|
+
]
|
|
7288
7380
|
},
|
|
7289
7381
|
"size": {
|
|
7290
7382
|
"type": "string",
|
|
@@ -7682,7 +7774,14 @@
|
|
|
7682
7774
|
"sign": {
|
|
7683
7775
|
"type": "integer",
|
|
7684
7776
|
"format": "int32",
|
|
7685
|
-
"
|
|
7777
|
+
"enum": [
|
|
7778
|
+
-1,
|
|
7779
|
+
1
|
|
7780
|
+
],
|
|
7781
|
+
"x-enum-varnames": [
|
|
7782
|
+
"Short",
|
|
7783
|
+
"Long"
|
|
7784
|
+
]
|
|
7686
7785
|
},
|
|
7687
7786
|
"position": {
|
|
7688
7787
|
"type": "string",
|
|
@@ -15873,7 +15972,7 @@
|
|
|
15873
15972
|
"type": "integer",
|
|
15874
15973
|
"format": "int32",
|
|
15875
15974
|
"default": "0",
|
|
15876
|
-
"maximum":
|
|
15975
|
+
"maximum": 1000000
|
|
15877
15976
|
},
|
|
15878
15977
|
"search": {
|
|
15879
15978
|
"type": "string"
|
|
@@ -16373,6 +16472,54 @@
|
|
|
16373
16472
|
"value"
|
|
16374
16473
|
]
|
|
16375
16474
|
},
|
|
16475
|
+
"ReqGetUpDownCandles": {
|
|
16476
|
+
"type": "object",
|
|
16477
|
+
"properties": {
|
|
16478
|
+
"symbol": {
|
|
16479
|
+
"type": "string",
|
|
16480
|
+
"description": " market series: underlying (case-insensitive) ..."
|
|
16481
|
+
},
|
|
16482
|
+
"duration": {
|
|
16483
|
+
"type": "string",
|
|
16484
|
+
"description": " ... and market duration, e.g. 30s or 5m"
|
|
16485
|
+
},
|
|
16486
|
+
"resolution": {
|
|
16487
|
+
"type": "string",
|
|
16488
|
+
"enum": [
|
|
16489
|
+
"1s",
|
|
16490
|
+
"30s"
|
|
16491
|
+
],
|
|
16492
|
+
"default": "1s",
|
|
16493
|
+
"description": " 1s candles are the observations themselves"
|
|
16494
|
+
},
|
|
16495
|
+
"start_timestamp": {
|
|
16496
|
+
"type": "integer",
|
|
16497
|
+
"format": "int64",
|
|
16498
|
+
"description": " inclusive bucket start, seconds",
|
|
16499
|
+
"maximum": 5000000000
|
|
16500
|
+
},
|
|
16501
|
+
"end_timestamp": {
|
|
16502
|
+
"type": "integer",
|
|
16503
|
+
"format": "int64",
|
|
16504
|
+
"description": " inclusive, seconds; at most 24h after start_timestamp",
|
|
16505
|
+
"maximum": 5000000000
|
|
16506
|
+
},
|
|
16507
|
+
"limit": {
|
|
16508
|
+
"type": "integer",
|
|
16509
|
+
"format": "int64",
|
|
16510
|
+
"default": "1000",
|
|
16511
|
+
"maximum": 3600,
|
|
16512
|
+
"minimum": 1
|
|
16513
|
+
}
|
|
16514
|
+
},
|
|
16515
|
+
"title": "ReqGetUpDownCandles",
|
|
16516
|
+
"required": [
|
|
16517
|
+
"symbol",
|
|
16518
|
+
"duration",
|
|
16519
|
+
"start_timestamp",
|
|
16520
|
+
"end_timestamp"
|
|
16521
|
+
]
|
|
16522
|
+
},
|
|
16376
16523
|
"ReqGetUserReferrals": {
|
|
16377
16524
|
"type": "object",
|
|
16378
16525
|
"properties": {
|
|
@@ -17988,6 +18135,37 @@
|
|
|
17988
18135
|
"updated_at"
|
|
17989
18136
|
]
|
|
17990
18137
|
},
|
|
18138
|
+
"RespGetUpDownCandles": {
|
|
18139
|
+
"type": "object",
|
|
18140
|
+
"properties": {
|
|
18141
|
+
"code": {
|
|
18142
|
+
"type": "integer",
|
|
18143
|
+
"format": "int32",
|
|
18144
|
+
"example": "200"
|
|
18145
|
+
},
|
|
18146
|
+
"message": {
|
|
18147
|
+
"type": "string"
|
|
18148
|
+
},
|
|
18149
|
+
"candles": {
|
|
18150
|
+
"type": "array",
|
|
18151
|
+
"items": {
|
|
18152
|
+
"$ref": "#/definitions/UpDownCandle"
|
|
18153
|
+
},
|
|
18154
|
+
"description": " ascending by timestamp"
|
|
18155
|
+
},
|
|
18156
|
+
"next_cursor": {
|
|
18157
|
+
"type": "integer",
|
|
18158
|
+
"format": "int64",
|
|
18159
|
+
"example": "0",
|
|
18160
|
+
"description": " start_timestamp of the next page; 0 when the range is exhausted"
|
|
18161
|
+
}
|
|
18162
|
+
},
|
|
18163
|
+
"title": "RespGetUpDownCandles",
|
|
18164
|
+
"required": [
|
|
18165
|
+
"code",
|
|
18166
|
+
"candles"
|
|
18167
|
+
]
|
|
18168
|
+
},
|
|
17991
18169
|
"RespGuildByReferralCode": {
|
|
17992
18170
|
"type": "object",
|
|
17993
18171
|
"properties": {
|
|
@@ -21117,6 +21295,74 @@
|
|
|
21117
21295
|
"txs"
|
|
21118
21296
|
]
|
|
21119
21297
|
},
|
|
21298
|
+
"UpDownCandle": {
|
|
21299
|
+
"type": "object",
|
|
21300
|
+
"properties": {
|
|
21301
|
+
"symbol": {
|
|
21302
|
+
"type": "string",
|
|
21303
|
+
"example": "btc"
|
|
21304
|
+
},
|
|
21305
|
+
"duration": {
|
|
21306
|
+
"type": "string",
|
|
21307
|
+
"example": "5m"
|
|
21308
|
+
},
|
|
21309
|
+
"resolution": {
|
|
21310
|
+
"type": "string",
|
|
21311
|
+
"example": "30s"
|
|
21312
|
+
},
|
|
21313
|
+
"timestamp": {
|
|
21314
|
+
"type": "integer",
|
|
21315
|
+
"format": "int64",
|
|
21316
|
+
"example": "1789551600",
|
|
21317
|
+
"description": " bucket start, unix seconds"
|
|
21318
|
+
},
|
|
21319
|
+
"open": {
|
|
21320
|
+
"type": "string",
|
|
21321
|
+
"example": "115342.123456789012345678",
|
|
21322
|
+
"description": " exact provider prices, decimal strings"
|
|
21323
|
+
},
|
|
21324
|
+
"high": {
|
|
21325
|
+
"type": "string",
|
|
21326
|
+
"example": "115350.5"
|
|
21327
|
+
},
|
|
21328
|
+
"low": {
|
|
21329
|
+
"type": "string",
|
|
21330
|
+
"example": "115300.25"
|
|
21331
|
+
},
|
|
21332
|
+
"close": {
|
|
21333
|
+
"type": "string",
|
|
21334
|
+
"example": "115340.123456789012345678"
|
|
21335
|
+
},
|
|
21336
|
+
"sampleCount": {
|
|
21337
|
+
"type": "integer",
|
|
21338
|
+
"format": "int64",
|
|
21339
|
+
"description": " observations in the candle: orders live updates of the same bucket, not served"
|
|
21340
|
+
},
|
|
21341
|
+
"provider": {
|
|
21342
|
+
"type": "string",
|
|
21343
|
+
"example": "chainlink",
|
|
21344
|
+
"description": " provider feed of the last observation of the candle"
|
|
21345
|
+
},
|
|
21346
|
+
"feed_id": {
|
|
21347
|
+
"type": "string",
|
|
21348
|
+
"example": "0x0002ee6757e8822c00d273bc340fc24c9cafe123a4ff2ea1dbdb31944bc7d95f"
|
|
21349
|
+
}
|
|
21350
|
+
},
|
|
21351
|
+
"title": "UpDownCandle",
|
|
21352
|
+
"required": [
|
|
21353
|
+
"symbol",
|
|
21354
|
+
"duration",
|
|
21355
|
+
"resolution",
|
|
21356
|
+
"timestamp",
|
|
21357
|
+
"open",
|
|
21358
|
+
"high",
|
|
21359
|
+
"low",
|
|
21360
|
+
"close",
|
|
21361
|
+
"sampleCount",
|
|
21362
|
+
"provider",
|
|
21363
|
+
"feed_id"
|
|
21364
|
+
]
|
|
21365
|
+
},
|
|
21120
21366
|
"UpcomingEarning": {
|
|
21121
21367
|
"type": "object",
|
|
21122
21368
|
"properties": {
|