@binance/rebate 3.1.17 → 4.0.0
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/dist/index.d.mts +56 -47
- package/dist/index.d.ts +56 -47
- package/dist/index.js +34 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -3,9 +3,9 @@ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, ForbiddenE
|
|
|
3
3
|
//#region src/rest-api/types/get-spot-rebate-history-records-response-data-data-inner.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Rebate REST API
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Query spot trading rebate history records.
|
|
9
9
|
*
|
|
10
10
|
* The version of the OpenAPI document: 1.0.0
|
|
11
11
|
*
|
|
@@ -21,25 +21,25 @@ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, ForbiddenE
|
|
|
21
21
|
*/
|
|
22
22
|
interface GetSpotRebateHistoryRecordsResponseDataDataInner {
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Rebate asset.
|
|
25
25
|
* @type {string}
|
|
26
26
|
* @memberof GetSpotRebateHistoryRecordsResponseDataDataInner
|
|
27
27
|
*/
|
|
28
28
|
asset?: string;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* 1 is commission rebate, 2 is referral kickback
|
|
31
31
|
* @type {number | bigint}
|
|
32
32
|
* @memberof GetSpotRebateHistoryRecordsResponseDataDataInner
|
|
33
33
|
*/
|
|
34
34
|
type?: number | bigint;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Rebate amount.
|
|
37
37
|
* @type {string}
|
|
38
38
|
* @memberof GetSpotRebateHistoryRecordsResponseDataDataInner
|
|
39
39
|
*/
|
|
40
40
|
amount?: string;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Update timestamp.
|
|
43
43
|
* @type {number | bigint}
|
|
44
44
|
* @memberof GetSpotRebateHistoryRecordsResponseDataDataInner
|
|
45
45
|
*/
|
|
@@ -55,25 +55,25 @@ interface GetSpotRebateHistoryRecordsResponseDataDataInner {
|
|
|
55
55
|
*/
|
|
56
56
|
interface GetSpotRebateHistoryRecordsResponseData {
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Current page number.
|
|
59
59
|
* @type {number | bigint}
|
|
60
60
|
* @memberof GetSpotRebateHistoryRecordsResponseData
|
|
61
61
|
*/
|
|
62
62
|
page?: number | bigint;
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
64
|
+
* Total number of records.
|
|
65
65
|
* @type {number | bigint}
|
|
66
66
|
* @memberof GetSpotRebateHistoryRecordsResponseData
|
|
67
67
|
*/
|
|
68
68
|
totalRecords?: number | bigint;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Total number of pages.
|
|
71
71
|
* @type {number | bigint}
|
|
72
72
|
* @memberof GetSpotRebateHistoryRecordsResponseData
|
|
73
73
|
*/
|
|
74
74
|
totalPageNum?: number | bigint;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* Rebate records.
|
|
77
77
|
* @type {Array<GetSpotRebateHistoryRecordsResponseDataDataInner>}
|
|
78
78
|
* @memberof GetSpotRebateHistoryRecordsResponseData
|
|
79
79
|
*/
|
|
@@ -114,84 +114,90 @@ interface GetSpotRebateHistoryRecordsResponse {
|
|
|
114
114
|
data?: GetSpotRebateHistoryRecordsResponseData;
|
|
115
115
|
}
|
|
116
116
|
//#endregion
|
|
117
|
-
//#region src/rest-api/modules/
|
|
117
|
+
//#region src/rest-api/modules/api.d.ts
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
120
|
-
* @interface
|
|
119
|
+
* Api - interface
|
|
120
|
+
* @interface Api
|
|
121
121
|
*/
|
|
122
|
-
interface
|
|
122
|
+
interface ApiInterface {
|
|
123
123
|
/**
|
|
124
124
|
* Get Spot Rebate History Records
|
|
125
125
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* Return up to 200 records per request.
|
|
126
|
+
* Weight(UID): 12000
|
|
127
|
+
*
|
|
128
|
+
* Security Type: USER_DATA
|
|
130
129
|
*
|
|
131
|
-
*
|
|
130
|
+
* Notes:
|
|
131
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
132
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
133
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
134
|
+
* - Return up to 200 records per request.
|
|
132
135
|
*
|
|
133
136
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
134
137
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
135
138
|
*
|
|
136
139
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
137
|
-
* @memberof
|
|
140
|
+
* @memberof ApiInterface
|
|
138
141
|
*/
|
|
139
142
|
getSpotRebateHistoryRecords(requestParameters?: GetSpotRebateHistoryRecordsRequest): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;
|
|
140
143
|
}
|
|
141
144
|
/**
|
|
142
|
-
* Request parameters for getSpotRebateHistoryRecords operation in
|
|
145
|
+
* Request parameters for getSpotRebateHistoryRecords operation in Api.
|
|
143
146
|
* @interface GetSpotRebateHistoryRecordsRequest
|
|
144
147
|
*/
|
|
145
148
|
interface GetSpotRebateHistoryRecordsRequest {
|
|
146
149
|
/**
|
|
147
|
-
*
|
|
150
|
+
* Start time in milliseconds.
|
|
148
151
|
* @type {number | bigint}
|
|
149
|
-
* @memberof
|
|
152
|
+
* @memberof ApiGetSpotRebateHistoryRecords
|
|
150
153
|
*/
|
|
151
154
|
readonly startTime?: number | bigint;
|
|
152
155
|
/**
|
|
153
|
-
*
|
|
156
|
+
* End time in milliseconds.
|
|
154
157
|
* @type {number | bigint}
|
|
155
|
-
* @memberof
|
|
158
|
+
* @memberof ApiGetSpotRebateHistoryRecords
|
|
156
159
|
*/
|
|
157
160
|
readonly endTime?: number | bigint;
|
|
158
161
|
/**
|
|
159
|
-
*
|
|
162
|
+
* Page number.
|
|
160
163
|
* @type {number | bigint}
|
|
161
|
-
* @memberof
|
|
164
|
+
* @memberof ApiGetSpotRebateHistoryRecords
|
|
162
165
|
*/
|
|
163
166
|
readonly page?: number | bigint;
|
|
164
167
|
/**
|
|
165
|
-
*
|
|
168
|
+
* Request validity window in milliseconds.
|
|
166
169
|
* @type {number | bigint}
|
|
167
|
-
* @memberof
|
|
170
|
+
* @memberof ApiGetSpotRebateHistoryRecords
|
|
168
171
|
*/
|
|
169
172
|
readonly recvWindow?: number | bigint;
|
|
170
173
|
}
|
|
171
174
|
/**
|
|
172
|
-
*
|
|
173
|
-
* @class
|
|
175
|
+
* Api - object-oriented interface
|
|
176
|
+
* @class Api
|
|
174
177
|
*/
|
|
175
|
-
declare class
|
|
178
|
+
declare class Api implements ApiInterface {
|
|
176
179
|
private readonly configuration;
|
|
177
180
|
private localVarAxiosParamCreator;
|
|
178
181
|
constructor(configuration: ConfigurationRestAPI);
|
|
179
182
|
/**
|
|
180
183
|
* Get Spot Rebate History Records
|
|
181
184
|
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
* Return up to 200 records per request.
|
|
185
|
+
* Weight(UID): 12000
|
|
186
|
+
*
|
|
187
|
+
* Security Type: USER_DATA
|
|
186
188
|
*
|
|
187
|
-
*
|
|
189
|
+
* Notes:
|
|
190
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
191
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
192
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
193
|
+
* - Return up to 200 records per request.
|
|
188
194
|
*
|
|
189
195
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
190
196
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
191
197
|
* @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}
|
|
192
198
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
193
|
-
* @memberof
|
|
194
|
-
* @see {@link https://developers.binance.com/docs/rebate/rest-api
|
|
199
|
+
* @memberof Api
|
|
200
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}
|
|
195
201
|
*/
|
|
196
202
|
getSpotRebateHistoryRecords(requestParameters?: GetSpotRebateHistoryRecordsRequest): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;
|
|
197
203
|
}
|
|
@@ -199,7 +205,7 @@ declare class RebateApi implements RebateApiInterface {
|
|
|
199
205
|
//#region src/rest-api/rest-api.d.ts
|
|
200
206
|
declare class RestAPI {
|
|
201
207
|
private configuration;
|
|
202
|
-
private
|
|
208
|
+
private api;
|
|
203
209
|
constructor(configuration: ConfigurationRestAPI);
|
|
204
210
|
/**
|
|
205
211
|
* Generic function to send a request.
|
|
@@ -224,24 +230,27 @@ declare class RestAPI {
|
|
|
224
230
|
/**
|
|
225
231
|
* Get Spot Rebate History Records
|
|
226
232
|
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* Return up to 200 records per request.
|
|
233
|
+
* Weight(UID): 12000
|
|
234
|
+
*
|
|
235
|
+
* Security Type: USER_DATA
|
|
231
236
|
*
|
|
232
|
-
*
|
|
237
|
+
* Notes:
|
|
238
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
239
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
240
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
241
|
+
* - Return up to 200 records per request.
|
|
233
242
|
*
|
|
234
243
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
235
244
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
236
245
|
*
|
|
237
246
|
* @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}
|
|
238
247
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
239
|
-
* @see {@link https://developers.binance.com/docs/rebate/rest-api
|
|
248
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}
|
|
240
249
|
*/
|
|
241
250
|
getSpotRebateHistoryRecords(requestParameters?: GetSpotRebateHistoryRecordsRequest): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;
|
|
242
251
|
}
|
|
243
252
|
declare namespace index_d_exports {
|
|
244
|
-
export { GetSpotRebateHistoryRecordsRequest, GetSpotRebateHistoryRecordsResponse, GetSpotRebateHistoryRecordsResponseData, GetSpotRebateHistoryRecordsResponseDataDataInner,
|
|
253
|
+
export { Api, ApiInterface, GetSpotRebateHistoryRecordsRequest, GetSpotRebateHistoryRecordsResponse, GetSpotRebateHistoryRecordsResponseData, GetSpotRebateHistoryRecordsResponseDataDataInner, RestAPI };
|
|
245
254
|
}
|
|
246
255
|
//#endregion
|
|
247
256
|
//#region src/rebate.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, ForbiddenE
|
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/rest-api/types/get-spot-rebate-history-records-response-data-data-inner.d.ts
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Rebate REST API
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* Query spot trading rebate history records.
|
|
11
11
|
*
|
|
12
12
|
* The version of the OpenAPI document: 1.0.0
|
|
13
13
|
*
|
|
@@ -23,25 +23,25 @@ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, ForbiddenE
|
|
|
23
23
|
*/
|
|
24
24
|
interface GetSpotRebateHistoryRecordsResponseDataDataInner {
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Rebate asset.
|
|
27
27
|
* @type {string}
|
|
28
28
|
* @memberof GetSpotRebateHistoryRecordsResponseDataDataInner
|
|
29
29
|
*/
|
|
30
30
|
asset?: string;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* 1 is commission rebate, 2 is referral kickback
|
|
33
33
|
* @type {number | bigint}
|
|
34
34
|
* @memberof GetSpotRebateHistoryRecordsResponseDataDataInner
|
|
35
35
|
*/
|
|
36
36
|
type?: number | bigint;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Rebate amount.
|
|
39
39
|
* @type {string}
|
|
40
40
|
* @memberof GetSpotRebateHistoryRecordsResponseDataDataInner
|
|
41
41
|
*/
|
|
42
42
|
amount?: string;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Update timestamp.
|
|
45
45
|
* @type {number | bigint}
|
|
46
46
|
* @memberof GetSpotRebateHistoryRecordsResponseDataDataInner
|
|
47
47
|
*/
|
|
@@ -56,25 +56,25 @@ interface GetSpotRebateHistoryRecordsResponseDataDataInner {
|
|
|
56
56
|
*/
|
|
57
57
|
interface GetSpotRebateHistoryRecordsResponseData {
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Current page number.
|
|
60
60
|
* @type {number | bigint}
|
|
61
61
|
* @memberof GetSpotRebateHistoryRecordsResponseData
|
|
62
62
|
*/
|
|
63
63
|
page?: number | bigint;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Total number of records.
|
|
66
66
|
* @type {number | bigint}
|
|
67
67
|
* @memberof GetSpotRebateHistoryRecordsResponseData
|
|
68
68
|
*/
|
|
69
69
|
totalRecords?: number | bigint;
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* Total number of pages.
|
|
72
72
|
* @type {number | bigint}
|
|
73
73
|
* @memberof GetSpotRebateHistoryRecordsResponseData
|
|
74
74
|
*/
|
|
75
75
|
totalPageNum?: number | bigint;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* Rebate records.
|
|
78
78
|
* @type {Array<GetSpotRebateHistoryRecordsResponseDataDataInner>}
|
|
79
79
|
* @memberof GetSpotRebateHistoryRecordsResponseData
|
|
80
80
|
*/
|
|
@@ -114,84 +114,90 @@ interface GetSpotRebateHistoryRecordsResponse {
|
|
|
114
114
|
data?: GetSpotRebateHistoryRecordsResponseData;
|
|
115
115
|
}
|
|
116
116
|
//#endregion
|
|
117
|
-
//#region src/rest-api/modules/
|
|
117
|
+
//#region src/rest-api/modules/api.d.ts
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
120
|
-
* @interface
|
|
119
|
+
* Api - interface
|
|
120
|
+
* @interface Api
|
|
121
121
|
*/
|
|
122
|
-
interface
|
|
122
|
+
interface ApiInterface {
|
|
123
123
|
/**
|
|
124
124
|
* Get Spot Rebate History Records
|
|
125
125
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* Return up to 200 records per request.
|
|
126
|
+
* Weight(UID): 12000
|
|
127
|
+
*
|
|
128
|
+
* Security Type: USER_DATA
|
|
130
129
|
*
|
|
131
|
-
*
|
|
130
|
+
* Notes:
|
|
131
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
132
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
133
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
134
|
+
* - Return up to 200 records per request.
|
|
132
135
|
*
|
|
133
136
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
134
137
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
135
138
|
*
|
|
136
139
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
137
|
-
* @memberof
|
|
140
|
+
* @memberof ApiInterface
|
|
138
141
|
*/
|
|
139
142
|
getSpotRebateHistoryRecords(requestParameters?: GetSpotRebateHistoryRecordsRequest): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;
|
|
140
143
|
}
|
|
141
144
|
/**
|
|
142
|
-
* Request parameters for getSpotRebateHistoryRecords operation in
|
|
145
|
+
* Request parameters for getSpotRebateHistoryRecords operation in Api.
|
|
143
146
|
* @interface GetSpotRebateHistoryRecordsRequest
|
|
144
147
|
*/
|
|
145
148
|
interface GetSpotRebateHistoryRecordsRequest {
|
|
146
149
|
/**
|
|
147
|
-
*
|
|
150
|
+
* Start time in milliseconds.
|
|
148
151
|
* @type {number | bigint}
|
|
149
|
-
* @memberof
|
|
152
|
+
* @memberof ApiGetSpotRebateHistoryRecords
|
|
150
153
|
*/
|
|
151
154
|
readonly startTime?: number | bigint;
|
|
152
155
|
/**
|
|
153
|
-
*
|
|
156
|
+
* End time in milliseconds.
|
|
154
157
|
* @type {number | bigint}
|
|
155
|
-
* @memberof
|
|
158
|
+
* @memberof ApiGetSpotRebateHistoryRecords
|
|
156
159
|
*/
|
|
157
160
|
readonly endTime?: number | bigint;
|
|
158
161
|
/**
|
|
159
|
-
*
|
|
162
|
+
* Page number.
|
|
160
163
|
* @type {number | bigint}
|
|
161
|
-
* @memberof
|
|
164
|
+
* @memberof ApiGetSpotRebateHistoryRecords
|
|
162
165
|
*/
|
|
163
166
|
readonly page?: number | bigint;
|
|
164
167
|
/**
|
|
165
|
-
*
|
|
168
|
+
* Request validity window in milliseconds.
|
|
166
169
|
* @type {number | bigint}
|
|
167
|
-
* @memberof
|
|
170
|
+
* @memberof ApiGetSpotRebateHistoryRecords
|
|
168
171
|
*/
|
|
169
172
|
readonly recvWindow?: number | bigint;
|
|
170
173
|
}
|
|
171
174
|
/**
|
|
172
|
-
*
|
|
173
|
-
* @class
|
|
175
|
+
* Api - object-oriented interface
|
|
176
|
+
* @class Api
|
|
174
177
|
*/
|
|
175
|
-
declare class
|
|
178
|
+
declare class Api implements ApiInterface {
|
|
176
179
|
private readonly configuration;
|
|
177
180
|
private localVarAxiosParamCreator;
|
|
178
181
|
constructor(configuration: ConfigurationRestAPI);
|
|
179
182
|
/**
|
|
180
183
|
* Get Spot Rebate History Records
|
|
181
184
|
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
* Return up to 200 records per request.
|
|
185
|
+
* Weight(UID): 12000
|
|
186
|
+
*
|
|
187
|
+
* Security Type: USER_DATA
|
|
186
188
|
*
|
|
187
|
-
*
|
|
189
|
+
* Notes:
|
|
190
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
191
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
192
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
193
|
+
* - Return up to 200 records per request.
|
|
188
194
|
*
|
|
189
195
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
190
196
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
191
197
|
* @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}
|
|
192
198
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
193
|
-
* @memberof
|
|
194
|
-
* @see {@link https://developers.binance.com/docs/rebate/rest-api
|
|
199
|
+
* @memberof Api
|
|
200
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}
|
|
195
201
|
*/
|
|
196
202
|
getSpotRebateHistoryRecords(requestParameters?: GetSpotRebateHistoryRecordsRequest): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;
|
|
197
203
|
}
|
|
@@ -199,7 +205,7 @@ declare class RebateApi implements RebateApiInterface {
|
|
|
199
205
|
//#region src/rest-api/rest-api.d.ts
|
|
200
206
|
declare class RestAPI {
|
|
201
207
|
private configuration;
|
|
202
|
-
private
|
|
208
|
+
private api;
|
|
203
209
|
constructor(configuration: ConfigurationRestAPI);
|
|
204
210
|
/**
|
|
205
211
|
* Generic function to send a request.
|
|
@@ -224,24 +230,27 @@ declare class RestAPI {
|
|
|
224
230
|
/**
|
|
225
231
|
* Get Spot Rebate History Records
|
|
226
232
|
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* Return up to 200 records per request.
|
|
233
|
+
* Weight(UID): 12000
|
|
234
|
+
*
|
|
235
|
+
* Security Type: USER_DATA
|
|
231
236
|
*
|
|
232
|
-
*
|
|
237
|
+
* Notes:
|
|
238
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
239
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
240
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
241
|
+
* - Return up to 200 records per request.
|
|
233
242
|
*
|
|
234
243
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
235
244
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
236
245
|
*
|
|
237
246
|
* @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}
|
|
238
247
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
239
|
-
* @see {@link https://developers.binance.com/docs/rebate/rest-api
|
|
248
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}
|
|
240
249
|
*/
|
|
241
250
|
getSpotRebateHistoryRecords(requestParameters?: GetSpotRebateHistoryRecordsRequest): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;
|
|
242
251
|
}
|
|
243
252
|
declare namespace index_d_exports {
|
|
244
|
-
export { GetSpotRebateHistoryRecordsRequest, GetSpotRebateHistoryRecordsResponse, GetSpotRebateHistoryRecordsResponseData, GetSpotRebateHistoryRecordsResponseDataDataInner,
|
|
253
|
+
export { Api, ApiInterface, GetSpotRebateHistoryRecordsRequest, GetSpotRebateHistoryRecordsResponse, GetSpotRebateHistoryRecordsResponseData, GetSpotRebateHistoryRecordsResponseDataDataInner, RestAPI };
|
|
245
254
|
}
|
|
246
255
|
//#endregion
|
|
247
256
|
//#region src/rebate.d.ts
|
package/dist/index.js
CHANGED
|
@@ -14,14 +14,14 @@ let __binance_common = require("@binance/common");
|
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
16
|
var name = "@binance/rebate";
|
|
17
|
-
var version = "
|
|
17
|
+
var version = "4.0.0";
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
|
-
//#region src/rest-api/modules/
|
|
20
|
+
//#region src/rest-api/modules/api.ts
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Rebate REST API
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* Query spot trading rebate history records.
|
|
25
25
|
*
|
|
26
26
|
* The version of the OpenAPI document: 1.0.0
|
|
27
27
|
*
|
|
@@ -31,9 +31,9 @@ var version = "3.1.17";
|
|
|
31
31
|
* Do not edit the class manually.
|
|
32
32
|
*/
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Api - axios parameter creator
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const ApiAxiosParamCreator = function(configuration) {
|
|
37
37
|
return { getSpotRebateHistoryRecords: async (startTime, endTime, page, recvWindow) => {
|
|
38
38
|
const localVarQueryParameter = {};
|
|
39
39
|
const localVarBodyParameter = {};
|
|
@@ -55,30 +55,33 @@ const RebateApiAxiosParamCreator = function(configuration) {
|
|
|
55
55
|
} };
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @class
|
|
58
|
+
* Api - object-oriented interface
|
|
59
|
+
* @class Api
|
|
60
60
|
*/
|
|
61
|
-
var
|
|
61
|
+
var Api = class {
|
|
62
62
|
constructor(configuration) {
|
|
63
63
|
this.configuration = configuration;
|
|
64
|
-
this.localVarAxiosParamCreator =
|
|
64
|
+
this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Get Spot Rebate History Records
|
|
68
68
|
*
|
|
69
|
-
*
|
|
70
|
-
* If startTime and endTime are not sent, the recent 7 days' data will be returned.
|
|
71
|
-
* The earliest startTime is supported on June 10, 2020
|
|
72
|
-
* Return up to 200 records per request.
|
|
69
|
+
* Weight(UID): 12000
|
|
73
70
|
*
|
|
74
|
-
*
|
|
71
|
+
* Security Type: USER_DATA
|
|
72
|
+
*
|
|
73
|
+
* Notes:
|
|
74
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
75
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
76
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
77
|
+
* - Return up to 200 records per request.
|
|
75
78
|
*
|
|
76
79
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
77
80
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
78
81
|
* @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}
|
|
79
82
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
80
|
-
* @memberof
|
|
81
|
-
* @see {@link https://developers.binance.com/docs/rebate/rest-api
|
|
83
|
+
* @memberof Api
|
|
84
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}
|
|
82
85
|
*/
|
|
83
86
|
async getSpotRebateHistoryRecords(requestParameters = {}) {
|
|
84
87
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSpotRebateHistoryRecords(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.recvWindow);
|
|
@@ -89,9 +92,9 @@ var RebateApi = class {
|
|
|
89
92
|
//#endregion
|
|
90
93
|
//#region src/rest-api/rest-api.ts
|
|
91
94
|
/**
|
|
92
|
-
*
|
|
95
|
+
* Rebate REST API
|
|
93
96
|
*
|
|
94
|
-
*
|
|
97
|
+
* Query spot trading rebate history records.
|
|
95
98
|
*
|
|
96
99
|
* The version of the OpenAPI document: 1.0.0
|
|
97
100
|
*
|
|
@@ -103,7 +106,7 @@ var RebateApi = class {
|
|
|
103
106
|
var RestAPI = class {
|
|
104
107
|
constructor(configuration) {
|
|
105
108
|
this.configuration = configuration;
|
|
106
|
-
this.
|
|
109
|
+
this.api = new Api(configuration);
|
|
107
110
|
}
|
|
108
111
|
/**
|
|
109
112
|
* Generic function to send a request.
|
|
@@ -132,29 +135,32 @@ var RestAPI = class {
|
|
|
132
135
|
/**
|
|
133
136
|
* Get Spot Rebate History Records
|
|
134
137
|
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* Return up to 200 records per request.
|
|
138
|
+
* Weight(UID): 12000
|
|
139
|
+
*
|
|
140
|
+
* Security Type: USER_DATA
|
|
139
141
|
*
|
|
140
|
-
*
|
|
142
|
+
* Notes:
|
|
143
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
144
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
145
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
146
|
+
* - Return up to 200 records per request.
|
|
141
147
|
*
|
|
142
148
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
143
149
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
144
150
|
*
|
|
145
151
|
* @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}
|
|
146
152
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
147
|
-
* @see {@link https://developers.binance.com/docs/rebate/rest-api
|
|
153
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}
|
|
148
154
|
*/
|
|
149
155
|
getSpotRebateHistoryRecords(requestParameters = {}) {
|
|
150
|
-
return this.
|
|
156
|
+
return this.api.getSpotRebateHistoryRecords(requestParameters);
|
|
151
157
|
}
|
|
152
158
|
};
|
|
153
159
|
|
|
154
160
|
//#endregion
|
|
155
161
|
//#region src/rest-api/index.ts
|
|
156
162
|
var rest_api_exports = /* @__PURE__ */ __export({
|
|
157
|
-
|
|
163
|
+
Api: () => Api,
|
|
158
164
|
RestAPI: () => RestAPI
|
|
159
165
|
});
|
|
160
166
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","REBATE_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/rebate-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/rebate.ts"],"sourcesContent":["{\n \"name\": \"@binance/rebate\",\n \"description\": \"Official Binance Rebate Connector - A lightweight library that provides a convenient interface to Binance's Rebate REST API.\",\n \"version\": \"3.1.17\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Rebate\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.1\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Rebate REST API\n *\n * OpenAPI Specification for the Binance Rebate REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetSpotRebateHistoryRecordsResponse } from '../types';\n\n/**\n * RebateApi - axios parameter creator\n */\nconst RebateApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Spot Rebate History Records\n *\n * The max interval between startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 12000\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {number | bigint} [startTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] Default 1\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getSpotRebateHistoryRecords: async (\n startTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/rebate/taxQuery',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * RebateApi - interface\n * @interface RebateApi\n */\nexport interface RebateApiInterface {\n /**\n * Get Spot Rebate History Records\n *\n * The max interval between startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 12000\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof RebateApiInterface\n */\n getSpotRebateHistoryRecords(\n requestParameters?: GetSpotRebateHistoryRecordsRequest\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;\n}\n\n/**\n * Request parameters for getSpotRebateHistoryRecords operation in RebateApi.\n * @interface GetSpotRebateHistoryRecordsRequest\n */\nexport interface GetSpotRebateHistoryRecordsRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof RebateApiGetSpotRebateHistoryRecords\n */\n readonly startTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof RebateApiGetSpotRebateHistoryRecords\n */\n readonly endTime?: number | bigint;\n\n /**\n * Default 1\n * @type {number | bigint}\n * @memberof RebateApiGetSpotRebateHistoryRecords\n */\n readonly page?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof RebateApiGetSpotRebateHistoryRecords\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * RebateApi - object-oriented interface\n * @class RebateApi\n */\nexport class RebateApi implements RebateApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = RebateApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Spot Rebate History Records\n *\n * The max interval between startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 12000\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof RebateApi\n * @see {@link https://developers.binance.com/docs/rebate/rest-api/Get-Spot-Rebate-History-Records Binance API Documentation}\n */\n public async getSpotRebateHistoryRecords(\n requestParameters: GetSpotRebateHistoryRecordsRequest = {}\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSpotRebateHistoryRecords(\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.page,\n requestParameters?.recvWindow\n );\n return sendRequest<GetSpotRebateHistoryRecordsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Rebate REST API\n *\n * OpenAPI Specification for the Binance Rebate REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { RebateApi } from './modules/rebate-api';\n\nimport type { GetSpotRebateHistoryRecordsRequest } from './modules/rebate-api';\n\nimport type { GetSpotRebateHistoryRecordsResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private rebateApi: RebateApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.rebateApi = new RebateApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get Spot Rebate History Records\n *\n * The max interval between startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 12000\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/rebate/rest-api/Get-Spot-Rebate-History-Records Binance API Documentation}\n */\n getSpotRebateHistoryRecords(\n requestParameters: GetSpotRebateHistoryRecordsRequest = {}\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>> {\n return this.rebateApi.getSpotRebateHistoryRecords(requestParameters);\n }\n}\n","/**\n * Binance Rebate REST API\n *\n * OpenAPI Specification for the Binance Rebate REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, REBATE_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationRebate {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Rebate {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationRebate) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || REBATE_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACsBf,MAAM,6BAA6B,SAAU,eAAqC;AAC9E,QAAO,EAmBH,6BAA6B,OACzB,WACA,SACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,YAAY,UAAa,YAAY,KACrC,wBAAuB,aAAa;AAExC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AAmEL,IAAa,YAAb,MAAqD;CAIjD,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,2BAA2B,cAAc;;;;;;;;;;;;;;;;;;;CAoB9E,MAAa,4BACT,oBAAwD,EAAE,EACG;EAC7D,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,4BAC3D,mBAAmB,WACnB,mBAAmB,SACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;AC3KT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,YAAY,IAAI,UAAU,cAAc;;;;;;;;;;;CAYjD,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;CAoBL,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,UAAU,4BAA4B,kBAAkB;;;;;;;;;;;;;AE9F5E,IAAa,SAAb,MAAoB;CAGhB,YAAY,QAA6B;EACrC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","REBATE_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/rebate.ts"],"sourcesContent":["{\n \"name\": \"@binance/rebate\",\n \"description\": \"Official Binance Rebate Connector - A lightweight library that provides a convenient interface to Binance's Rebate REST API.\",\n \"version\": \"4.0.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Rebate\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.5.8\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.3\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Rebate REST API\n *\n * Query spot trading rebate history records.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetSpotRebateHistoryRecordsResponse } from '../types';\n\n/**\n * Api - axios parameter creator\n */\nconst ApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Spot Rebate History Records\n *\n * Weight(UID): 12000\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTime` and `endTime` is 30 days.\n * - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.\n * - The earliest supported `startTime` is June 10, 2020.\n * - Return up to 200 records per request.\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {number | bigint} [startTime] Start time in milliseconds.\n * @param {number | bigint} [endTime] End time in milliseconds.\n * @param {number | bigint} [page] Page number.\n * @param {number | bigint} [recvWindow] Request validity window in milliseconds.\n *\n * @throws {RequiredError}\n */\n getSpotRebateHistoryRecords: async (\n startTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/rebate/taxQuery',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * Api - interface\n * @interface Api\n */\nexport interface ApiInterface {\n /**\n * Get Spot Rebate History Records\n *\n * Weight(UID): 12000\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTime` and `endTime` is 30 days.\n * - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.\n * - The earliest supported `startTime` is June 10, 2020.\n * - Return up to 200 records per request.\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof ApiInterface\n */\n getSpotRebateHistoryRecords(\n requestParameters?: GetSpotRebateHistoryRecordsRequest\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;\n}\n\n/**\n * Request parameters for getSpotRebateHistoryRecords operation in Api.\n * @interface GetSpotRebateHistoryRecordsRequest\n */\nexport interface GetSpotRebateHistoryRecordsRequest {\n /**\n * Start time in milliseconds.\n * @type {number | bigint}\n * @memberof ApiGetSpotRebateHistoryRecords\n */\n readonly startTime?: number | bigint;\n\n /**\n * End time in milliseconds.\n * @type {number | bigint}\n * @memberof ApiGetSpotRebateHistoryRecords\n */\n readonly endTime?: number | bigint;\n\n /**\n * Page number.\n * @type {number | bigint}\n * @memberof ApiGetSpotRebateHistoryRecords\n */\n readonly page?: number | bigint;\n\n /**\n * Request validity window in milliseconds.\n * @type {number | bigint}\n * @memberof ApiGetSpotRebateHistoryRecords\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Api - object-oriented interface\n * @class Api\n */\nexport class Api implements ApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Spot Rebate History Records\n *\n * Weight(UID): 12000\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTime` and `endTime` is 30 days.\n * - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.\n * - The earliest supported `startTime` is June 10, 2020.\n * - Return up to 200 records per request.\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof Api\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}\n */\n public async getSpotRebateHistoryRecords(\n requestParameters: GetSpotRebateHistoryRecordsRequest = {}\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSpotRebateHistoryRecords(\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.page,\n requestParameters?.recvWindow\n );\n return sendRequest<GetSpotRebateHistoryRecordsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Rebate REST API\n *\n * Query spot trading rebate history records.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { Api } from './modules/api';\n\nimport type { GetSpotRebateHistoryRecordsRequest } from './modules/api';\n\nimport type { GetSpotRebateHistoryRecordsResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private api: Api;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.api = new Api(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get Spot Rebate History Records\n *\n * Weight(UID): 12000\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTime` and `endTime` is 30 days.\n * - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.\n * - The earliest supported `startTime` is June 10, 2020.\n * - Return up to 200 records per request.\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}\n */\n getSpotRebateHistoryRecords(\n requestParameters: GetSpotRebateHistoryRecordsRequest = {}\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>> {\n return this.api.getSpotRebateHistoryRecords(requestParameters);\n }\n}\n","/**\n * Rebate REST API\n *\n * Query spot trading rebate history records.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, REBATE_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationRebate {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Rebate {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationRebate) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || REBATE_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACqBf,MAAM,uBAAuB,SAAU,eAAqC;AACxE,QAAO,EAsBH,6BAA6B,OACzB,WACA,SACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,YAAY,UAAa,YAAY,KACrC,wBAAuB,aAAa;AAExC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AAsEL,IAAa,MAAb,MAAyC;CAIrC,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;;;;CAuBxE,MAAa,4BACT,oBAAwD,EAAE,EACG;EAC7D,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,4BAC3D,mBAAmB,WACnB,mBAAmB,SACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;ACnLT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,MAAM,IAAI,IAAI,cAAc;;;;;;;;;;;CAYrC,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;;;CAuBL,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,IAAI,4BAA4B,kBAAkB;;;;;;;;;;;;;AEjGtE,IAAa,SAAb,MAAoB;CAGhB,YAAY,QAA6B;EACrC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
package/dist/index.mjs
CHANGED
|
@@ -3,14 +3,14 @@ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, ForbiddenE
|
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@binance/rebate";
|
|
6
|
-
var version = "
|
|
6
|
+
var version = "4.0.0";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
|
-
//#region src/rest-api/modules/
|
|
9
|
+
//#region src/rest-api/modules/api.ts
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Rebate REST API
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Query spot trading rebate history records.
|
|
14
14
|
*
|
|
15
15
|
* The version of the OpenAPI document: 1.0.0
|
|
16
16
|
*
|
|
@@ -20,9 +20,9 @@ var version = "3.1.17";
|
|
|
20
20
|
* Do not edit the class manually.
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Api - axios parameter creator
|
|
24
24
|
*/
|
|
25
|
-
const
|
|
25
|
+
const ApiAxiosParamCreator = function(configuration) {
|
|
26
26
|
return { getSpotRebateHistoryRecords: async (startTime, endTime, page, recvWindow) => {
|
|
27
27
|
const localVarQueryParameter = {};
|
|
28
28
|
const localVarBodyParameter = {};
|
|
@@ -44,30 +44,33 @@ const RebateApiAxiosParamCreator = function(configuration) {
|
|
|
44
44
|
} };
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @class
|
|
47
|
+
* Api - object-oriented interface
|
|
48
|
+
* @class Api
|
|
49
49
|
*/
|
|
50
|
-
var
|
|
50
|
+
var Api = class {
|
|
51
51
|
constructor(configuration) {
|
|
52
52
|
this.configuration = configuration;
|
|
53
|
-
this.localVarAxiosParamCreator =
|
|
53
|
+
this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Get Spot Rebate History Records
|
|
57
57
|
*
|
|
58
|
-
*
|
|
59
|
-
* If startTime and endTime are not sent, the recent 7 days' data will be returned.
|
|
60
|
-
* The earliest startTime is supported on June 10, 2020
|
|
61
|
-
* Return up to 200 records per request.
|
|
58
|
+
* Weight(UID): 12000
|
|
62
59
|
*
|
|
63
|
-
*
|
|
60
|
+
* Security Type: USER_DATA
|
|
61
|
+
*
|
|
62
|
+
* Notes:
|
|
63
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
64
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
65
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
66
|
+
* - Return up to 200 records per request.
|
|
64
67
|
*
|
|
65
68
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
66
69
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
67
70
|
* @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}
|
|
68
71
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
69
|
-
* @memberof
|
|
70
|
-
* @see {@link https://developers.binance.com/docs/rebate/rest-api
|
|
72
|
+
* @memberof Api
|
|
73
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}
|
|
71
74
|
*/
|
|
72
75
|
async getSpotRebateHistoryRecords(requestParameters = {}) {
|
|
73
76
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSpotRebateHistoryRecords(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.recvWindow);
|
|
@@ -78,9 +81,9 @@ var RebateApi = class {
|
|
|
78
81
|
//#endregion
|
|
79
82
|
//#region src/rest-api/rest-api.ts
|
|
80
83
|
/**
|
|
81
|
-
*
|
|
84
|
+
* Rebate REST API
|
|
82
85
|
*
|
|
83
|
-
*
|
|
86
|
+
* Query spot trading rebate history records.
|
|
84
87
|
*
|
|
85
88
|
* The version of the OpenAPI document: 1.0.0
|
|
86
89
|
*
|
|
@@ -92,7 +95,7 @@ var RebateApi = class {
|
|
|
92
95
|
var RestAPI = class {
|
|
93
96
|
constructor(configuration) {
|
|
94
97
|
this.configuration = configuration;
|
|
95
|
-
this.
|
|
98
|
+
this.api = new Api(configuration);
|
|
96
99
|
}
|
|
97
100
|
/**
|
|
98
101
|
* Generic function to send a request.
|
|
@@ -121,29 +124,32 @@ var RestAPI = class {
|
|
|
121
124
|
/**
|
|
122
125
|
* Get Spot Rebate History Records
|
|
123
126
|
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* Return up to 200 records per request.
|
|
127
|
+
* Weight(UID): 12000
|
|
128
|
+
*
|
|
129
|
+
* Security Type: USER_DATA
|
|
128
130
|
*
|
|
129
|
-
*
|
|
131
|
+
* Notes:
|
|
132
|
+
* - The max interval between `startTime` and `endTime` is 30 days.
|
|
133
|
+
* - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.
|
|
134
|
+
* - The earliest supported `startTime` is June 10, 2020.
|
|
135
|
+
* - Return up to 200 records per request.
|
|
130
136
|
*
|
|
131
137
|
* @summary Get Spot Rebate History Records (USER_DATA)
|
|
132
138
|
* @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.
|
|
133
139
|
*
|
|
134
140
|
* @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}
|
|
135
141
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
136
|
-
* @see {@link https://developers.binance.com/docs/rebate/rest-api
|
|
142
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}
|
|
137
143
|
*/
|
|
138
144
|
getSpotRebateHistoryRecords(requestParameters = {}) {
|
|
139
|
-
return this.
|
|
145
|
+
return this.api.getSpotRebateHistoryRecords(requestParameters);
|
|
140
146
|
}
|
|
141
147
|
};
|
|
142
148
|
|
|
143
149
|
//#endregion
|
|
144
150
|
//#region src/rest-api/index.ts
|
|
145
151
|
var rest_api_exports = /* @__PURE__ */ __export({
|
|
146
|
-
|
|
152
|
+
Api: () => Api,
|
|
147
153
|
RestAPI: () => RestAPI
|
|
148
154
|
});
|
|
149
155
|
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","REBATE_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/rebate-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/rebate.ts"],"sourcesContent":["{\n \"name\": \"@binance/rebate\",\n \"description\": \"Official Binance Rebate Connector - A lightweight library that provides a convenient interface to Binance's Rebate REST API.\",\n \"version\": \"3.1.17\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Rebate\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.1\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Rebate REST API\n *\n * OpenAPI Specification for the Binance Rebate REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetSpotRebateHistoryRecordsResponse } from '../types';\n\n/**\n * RebateApi - axios parameter creator\n */\nconst RebateApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Spot Rebate History Records\n *\n * The max interval between startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 12000\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {number | bigint} [startTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] Default 1\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getSpotRebateHistoryRecords: async (\n startTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/rebate/taxQuery',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * RebateApi - interface\n * @interface RebateApi\n */\nexport interface RebateApiInterface {\n /**\n * Get Spot Rebate History Records\n *\n * The max interval between startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 12000\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof RebateApiInterface\n */\n getSpotRebateHistoryRecords(\n requestParameters?: GetSpotRebateHistoryRecordsRequest\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;\n}\n\n/**\n * Request parameters for getSpotRebateHistoryRecords operation in RebateApi.\n * @interface GetSpotRebateHistoryRecordsRequest\n */\nexport interface GetSpotRebateHistoryRecordsRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof RebateApiGetSpotRebateHistoryRecords\n */\n readonly startTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof RebateApiGetSpotRebateHistoryRecords\n */\n readonly endTime?: number | bigint;\n\n /**\n * Default 1\n * @type {number | bigint}\n * @memberof RebateApiGetSpotRebateHistoryRecords\n */\n readonly page?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof RebateApiGetSpotRebateHistoryRecords\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * RebateApi - object-oriented interface\n * @class RebateApi\n */\nexport class RebateApi implements RebateApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = RebateApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Spot Rebate History Records\n *\n * The max interval between startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 12000\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof RebateApi\n * @see {@link https://developers.binance.com/docs/rebate/rest-api/Get-Spot-Rebate-History-Records Binance API Documentation}\n */\n public async getSpotRebateHistoryRecords(\n requestParameters: GetSpotRebateHistoryRecordsRequest = {}\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSpotRebateHistoryRecords(\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.page,\n requestParameters?.recvWindow\n );\n return sendRequest<GetSpotRebateHistoryRecordsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Rebate REST API\n *\n * OpenAPI Specification for the Binance Rebate REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { RebateApi } from './modules/rebate-api';\n\nimport type { GetSpotRebateHistoryRecordsRequest } from './modules/rebate-api';\n\nimport type { GetSpotRebateHistoryRecordsResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private rebateApi: RebateApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.rebateApi = new RebateApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get Spot Rebate History Records\n *\n * The max interval between startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 12000\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/rebate/rest-api/Get-Spot-Rebate-History-Records Binance API Documentation}\n */\n getSpotRebateHistoryRecords(\n requestParameters: GetSpotRebateHistoryRecordsRequest = {}\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>> {\n return this.rebateApi.getSpotRebateHistoryRecords(requestParameters);\n }\n}\n","/**\n * Binance Rebate REST API\n *\n * OpenAPI Specification for the Binance Rebate REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, REBATE_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationRebate {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Rebate {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationRebate) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || REBATE_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACsBf,MAAM,6BAA6B,SAAU,eAAqC;AAC9E,QAAO,EAmBH,6BAA6B,OACzB,WACA,SACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,YAAY,UAAa,YAAY,KACrC,wBAAuB,aAAa;AAExC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AAmEL,IAAa,YAAb,MAAqD;CAIjD,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,2BAA2B,cAAc;;;;;;;;;;;;;;;;;;;CAoB9E,MAAa,4BACT,oBAAwD,EAAE,EACG;EAC7D,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,4BAC3D,mBAAmB,WACnB,mBAAmB,SACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,SAAO,YACH,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;AC3KT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,YAAY,IAAI,UAAU,cAAc;;;;;;;;;;;CAYjD,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;CAoBL,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,UAAU,4BAA4B,kBAAkB;;;;;;;;;;;;;AE9F5E,IAAa,SAAb,MAAoB;CAGhB,YAAY,QAA6B;EACrC,MAAM,YAAY,eAAe,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","REBATE_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/rebate.ts"],"sourcesContent":["{\n \"name\": \"@binance/rebate\",\n \"description\": \"Official Binance Rebate Connector - A lightweight library that provides a convenient interface to Binance's Rebate REST API.\",\n \"version\": \"4.0.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Rebate\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.5.8\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.3\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Rebate REST API\n *\n * Query spot trading rebate history records.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetSpotRebateHistoryRecordsResponse } from '../types';\n\n/**\n * Api - axios parameter creator\n */\nconst ApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Spot Rebate History Records\n *\n * Weight(UID): 12000\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTime` and `endTime` is 30 days.\n * - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.\n * - The earliest supported `startTime` is June 10, 2020.\n * - Return up to 200 records per request.\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {number | bigint} [startTime] Start time in milliseconds.\n * @param {number | bigint} [endTime] End time in milliseconds.\n * @param {number | bigint} [page] Page number.\n * @param {number | bigint} [recvWindow] Request validity window in milliseconds.\n *\n * @throws {RequiredError}\n */\n getSpotRebateHistoryRecords: async (\n startTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/rebate/taxQuery',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * Api - interface\n * @interface Api\n */\nexport interface ApiInterface {\n /**\n * Get Spot Rebate History Records\n *\n * Weight(UID): 12000\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTime` and `endTime` is 30 days.\n * - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.\n * - The earliest supported `startTime` is June 10, 2020.\n * - Return up to 200 records per request.\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof ApiInterface\n */\n getSpotRebateHistoryRecords(\n requestParameters?: GetSpotRebateHistoryRecordsRequest\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>;\n}\n\n/**\n * Request parameters for getSpotRebateHistoryRecords operation in Api.\n * @interface GetSpotRebateHistoryRecordsRequest\n */\nexport interface GetSpotRebateHistoryRecordsRequest {\n /**\n * Start time in milliseconds.\n * @type {number | bigint}\n * @memberof ApiGetSpotRebateHistoryRecords\n */\n readonly startTime?: number | bigint;\n\n /**\n * End time in milliseconds.\n * @type {number | bigint}\n * @memberof ApiGetSpotRebateHistoryRecords\n */\n readonly endTime?: number | bigint;\n\n /**\n * Page number.\n * @type {number | bigint}\n * @memberof ApiGetSpotRebateHistoryRecords\n */\n readonly page?: number | bigint;\n\n /**\n * Request validity window in milliseconds.\n * @type {number | bigint}\n * @memberof ApiGetSpotRebateHistoryRecords\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Api - object-oriented interface\n * @class Api\n */\nexport class Api implements ApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Spot Rebate History Records\n *\n * Weight(UID): 12000\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTime` and `endTime` is 30 days.\n * - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.\n * - The earliest supported `startTime` is June 10, 2020.\n * - Return up to 200 records per request.\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof Api\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}\n */\n public async getSpotRebateHistoryRecords(\n requestParameters: GetSpotRebateHistoryRecordsRequest = {}\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSpotRebateHistoryRecords(\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.page,\n requestParameters?.recvWindow\n );\n return sendRequest<GetSpotRebateHistoryRecordsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Rebate REST API\n *\n * Query spot trading rebate history records.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { Api } from './modules/api';\n\nimport type { GetSpotRebateHistoryRecordsRequest } from './modules/api';\n\nimport type { GetSpotRebateHistoryRecordsResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private api: Api;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.api = new Api(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get Spot Rebate History Records\n *\n * Weight(UID): 12000\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTime` and `endTime` is 30 days.\n * - If `startTime` and `endTime` are not sent, the recent 7 days' data will be returned.\n * - The earliest supported `startTime` is June 10, 2020.\n * - Return up to 200 records per request.\n *\n * @summary Get Spot Rebate History Records (USER_DATA)\n * @param {GetSpotRebateHistoryRecordsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-rebate/api/rest-api/~#get-spot-rebate-history-records Binance API Documentation}\n */\n getSpotRebateHistoryRecords(\n requestParameters: GetSpotRebateHistoryRecordsRequest = {}\n ): Promise<RestApiResponse<GetSpotRebateHistoryRecordsResponse>> {\n return this.api.getSpotRebateHistoryRecords(requestParameters);\n }\n}\n","/**\n * Rebate REST API\n *\n * Query spot trading rebate history records.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, REBATE_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationRebate {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Rebate {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationRebate) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || REBATE_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACqBf,MAAM,uBAAuB,SAAU,eAAqC;AACxE,QAAO,EAsBH,6BAA6B,OACzB,WACA,SACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,YAAY,UAAa,YAAY,KACrC,wBAAuB,aAAa;AAExC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AAsEL,IAAa,MAAb,MAAyC;CAIrC,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;;;;CAuBxE,MAAa,4BACT,oBAAwD,EAAE,EACG;EAC7D,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,4BAC3D,mBAAmB,WACnB,mBAAmB,SACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,SAAO,YACH,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;ACnLT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,MAAM,IAAI,IAAI,cAAc;;;;;;;;;;;CAYrC,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;;;CAuBL,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,IAAI,4BAA4B,kBAAkB;;;;;;;;;;;;;AEjGtE,IAAa,SAAb,MAAoB;CAGhB,YAAY,QAA6B;EACrC,MAAM,YAAY,eAAe,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@binance/rebate",
|
|
3
3
|
"description": "Official Binance Rebate Connector - A lightweight library that provides a convenient interface to Binance's Rebate REST API.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/node": "^20.17.24",
|
|
48
48
|
"eslint": "8.57.0",
|
|
49
49
|
"jest": "^29.6.4",
|
|
50
|
-
"json-with-bigint": "^3.
|
|
50
|
+
"json-with-bigint": "^3.5.8",
|
|
51
51
|
"prettier": "^3.3.3",
|
|
52
52
|
"ts-jest": "^29.1.1",
|
|
53
53
|
"ts-node": "^10.9.1",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typescript-eslint": "^8.24.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@binance/common": "2.4.
|
|
59
|
+
"@binance/common": "2.4.3",
|
|
60
60
|
"axios": "^1.7.4"
|
|
61
61
|
}
|
|
62
62
|
}
|