@binance/rebate 3.0.3 → 3.1.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 CHANGED
@@ -205,20 +205,22 @@ declare class RestAPI {
205
205
  * Generic function to send a request.
206
206
  * @param endpoint - The API endpoint to call.
207
207
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
208
- * @param params - Query parameters for the request.
208
+ * @param queryParams - Query parameters for the request.
209
+ * @param bodyParams - Body parameters for the request.
209
210
  *
210
211
  * @returns A promise resolving to the response data object.
211
212
  */
212
- sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
213
+ sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
213
214
  /**
214
215
  * Generic function to send a signed request.
215
216
  * @param endpoint - The API endpoint to call.
216
217
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
217
- * @param params - Query parameters for the request.
218
+ * @param queryParams - Query parameters for the request.
219
+ * @param bodyParams - Body parameters for the request.
218
220
  *
219
221
  * @returns A promise resolving to the response data object.
220
222
  */
221
- sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
223
+ sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
222
224
  /**
223
225
  * Get Spot Rebate History Records
224
226
  *
package/dist/index.d.ts CHANGED
@@ -205,20 +205,22 @@ declare class RestAPI {
205
205
  * Generic function to send a request.
206
206
  * @param endpoint - The API endpoint to call.
207
207
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
208
- * @param params - Query parameters for the request.
208
+ * @param queryParams - Query parameters for the request.
209
+ * @param bodyParams - Body parameters for the request.
209
210
  *
210
211
  * @returns A promise resolving to the response data object.
211
212
  */
212
- sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
213
+ sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
213
214
  /**
214
215
  * Generic function to send a signed request.
215
216
  * @param endpoint - The API endpoint to call.
216
217
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
217
- * @param params - Query parameters for the request.
218
+ * @param queryParams - Query parameters for the request.
219
+ * @param bodyParams - Body parameters for the request.
218
220
  *
219
221
  * @returns A promise resolving to the response data object.
220
222
  */
221
- sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
223
+ sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
222
224
  /**
223
225
  * Get Spot Rebate History Records
224
226
  *
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ let __binance_common = require("@binance/common");
14
14
 
15
15
  //#region package.json
16
16
  var name = "@binance/rebate";
17
- var version = "3.0.3";
17
+ var version = "3.1.0";
18
18
 
19
19
  //#endregion
20
20
  //#region src/rest-api/modules/rebate-api.ts
@@ -36,6 +36,7 @@ var version = "3.0.3";
36
36
  const RebateApiAxiosParamCreator = function(configuration) {
37
37
  return { getSpotRebateHistoryRecords: async (startTime, endTime, page, recvWindow) => {
38
38
  const localVarQueryParameter = {};
39
+ const localVarBodyParameter = {};
39
40
  if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
40
41
  if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
41
42
  if (page !== void 0 && page !== null) localVarQueryParameter["page"] = page;
@@ -45,7 +46,8 @@ const RebateApiAxiosParamCreator = function(configuration) {
45
46
  return {
46
47
  endpoint: "/sapi/v1/rebate/taxQuery",
47
48
  method: "GET",
48
- params: localVarQueryParameter,
49
+ queryParams: localVarQueryParameter,
50
+ bodyParams: localVarBodyParameter,
49
51
  timeUnit: _timeUnit
50
52
  };
51
53
  } };
@@ -78,7 +80,7 @@ var RebateApi = class {
78
80
  */
79
81
  async getSpotRebateHistoryRecords(requestParameters = {}) {
80
82
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSpotRebateHistoryRecords(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.recvWindow);
81
- return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
83
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
82
84
  }
83
85
  };
84
86
 
@@ -105,23 +107,25 @@ var RestAPI = class {
105
107
  * Generic function to send a request.
106
108
  * @param endpoint - The API endpoint to call.
107
109
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
108
- * @param params - Query parameters for the request.
110
+ * @param queryParams - Query parameters for the request.
111
+ * @param bodyParams - Body parameters for the request.
109
112
  *
110
113
  * @returns A promise resolving to the response data object.
111
114
  */
112
- sendRequest(endpoint, method, params = {}) {
113
- return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0);
115
+ sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
116
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
114
117
  }
115
118
  /**
116
119
  * Generic function to send a signed request.
117
120
  * @param endpoint - The API endpoint to call.
118
121
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
119
- * @param params - Query parameters for the request.
122
+ * @param queryParams - Query parameters for the request.
123
+ * @param bodyParams - Body parameters for the request.
120
124
  *
121
125
  * @returns A promise resolving to the response data object.
122
126
  */
123
- sendSignedRequest(endpoint, method, params = {}) {
124
- return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0, { isSigned: true });
127
+ sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
128
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
125
129
  }
126
130
  /**
127
131
  * Get Spot Rebate History Records
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["localVarQueryParameter: 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.0.3\",\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.0.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\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\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 params: localVarQueryParameter,\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.params,\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 params - Query 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 params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined);\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 params - Query 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 params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, 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;AAE1D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAG1C,MAAI,YAAY,UAAa,YAAY,KACrC,wBAAuB,aAAa;AAGxC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAGrC,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,QAAQ;GACR,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,QAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;ACxKT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,YAAY,IAAI,UAAU,cAAc;;;;;;;;;;CAWjD,YACI,UACA,QACA,SAAkC,EAAE,EACT;AAC3B,2CAAsB,KAAK,eAAe,UAAU,QAAQ,QAAQ,OAAU;;;;;;;;;;CAWlF,kBACI,UACA,QACA,SAAkC,EAAE,EACT;AAC3B,2CAAsB,KAAK,eAAe,UAAU,QAAQ,QAAQ,QAAW,EAC3E,UAAU,MACb,CAAC;;;;;;;;;;;;;;;;;;;CAoBN,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,UAAU,4BAA4B,kBAAkB;;;;;;;;;;;;;AE3E5E,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>","_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.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.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.1.0\",\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\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 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?.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 );\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 { 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;AAEzD,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,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,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;ACxKT,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,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;CAoBL,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,UAAU,4BAA4B,kBAAkB;;;;;;;;;;;;;AE5F5E,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,7 +3,7 @@ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, ForbiddenE
3
3
 
4
4
  //#region package.json
5
5
  var name = "@binance/rebate";
6
- var version = "3.0.3";
6
+ var version = "3.1.0";
7
7
 
8
8
  //#endregion
9
9
  //#region src/rest-api/modules/rebate-api.ts
@@ -25,6 +25,7 @@ var version = "3.0.3";
25
25
  const RebateApiAxiosParamCreator = function(configuration) {
26
26
  return { getSpotRebateHistoryRecords: async (startTime, endTime, page, recvWindow) => {
27
27
  const localVarQueryParameter = {};
28
+ const localVarBodyParameter = {};
28
29
  if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
29
30
  if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
30
31
  if (page !== void 0 && page !== null) localVarQueryParameter["page"] = page;
@@ -34,7 +35,8 @@ const RebateApiAxiosParamCreator = function(configuration) {
34
35
  return {
35
36
  endpoint: "/sapi/v1/rebate/taxQuery",
36
37
  method: "GET",
37
- params: localVarQueryParameter,
38
+ queryParams: localVarQueryParameter,
39
+ bodyParams: localVarBodyParameter,
38
40
  timeUnit: _timeUnit
39
41
  };
40
42
  } };
@@ -67,7 +69,7 @@ var RebateApi = class {
67
69
  */
68
70
  async getSpotRebateHistoryRecords(requestParameters = {}) {
69
71
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSpotRebateHistoryRecords(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.recvWindow);
70
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
72
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
71
73
  }
72
74
  };
73
75
 
@@ -94,23 +96,25 @@ var RestAPI = class {
94
96
  * Generic function to send a request.
95
97
  * @param endpoint - The API endpoint to call.
96
98
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
97
- * @param params - Query parameters for the request.
99
+ * @param queryParams - Query parameters for the request.
100
+ * @param bodyParams - Body parameters for the request.
98
101
  *
99
102
  * @returns A promise resolving to the response data object.
100
103
  */
101
- sendRequest(endpoint, method, params = {}) {
102
- return sendRequest(this.configuration, endpoint, method, params, void 0);
104
+ sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
105
+ return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
103
106
  }
104
107
  /**
105
108
  * Generic function to send a signed request.
106
109
  * @param endpoint - The API endpoint to call.
107
110
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
108
- * @param params - Query parameters for the request.
111
+ * @param queryParams - Query parameters for the request.
112
+ * @param bodyParams - Body parameters for the request.
109
113
  *
110
114
  * @returns A promise resolving to the response data object.
111
115
  */
112
- sendSignedRequest(endpoint, method, params = {}) {
113
- return sendRequest(this.configuration, endpoint, method, params, void 0, { isSigned: true });
116
+ sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
117
+ return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
114
118
  }
115
119
  /**
116
120
  * Get Spot Rebate History Records
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["localVarQueryParameter: 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.0.3\",\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.0.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\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\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 params: localVarQueryParameter,\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.params,\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 params - Query 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 params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined);\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 params - Query 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 params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, 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;AAE1D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAG1C,MAAI,YAAY,UAAa,YAAY,KACrC,wBAAuB,aAAa;AAGxC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAGrC,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,QAAQ;GACR,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,QAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;ACxKT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,YAAY,IAAI,UAAU,cAAc;;;;;;;;;;CAWjD,YACI,UACA,QACA,SAAkC,EAAE,EACT;AAC3B,SAAO,YAAe,KAAK,eAAe,UAAU,QAAQ,QAAQ,OAAU;;;;;;;;;;CAWlF,kBACI,UACA,QACA,SAAkC,EAAE,EACT;AAC3B,SAAO,YAAe,KAAK,eAAe,UAAU,QAAQ,QAAQ,QAAW,EAC3E,UAAU,MACb,CAAC;;;;;;;;;;;;;;;;;;;CAoBN,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,UAAU,4BAA4B,kBAAkB;;;;;;;;;;;;;AE3E5E,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>","_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.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.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.1.0\",\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\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 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?.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 );\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 { 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;AAEzD,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,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,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;ACxKT,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,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;CAoBL,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,UAAU,4BAA4B,kBAAkB;;;;;;;;;;;;;AE5F5E,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": "3.0.3",
4
+ "version": "3.1.0",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -56,7 +56,7 @@
56
56
  "typescript-eslint": "^8.24.0"
57
57
  },
58
58
  "dependencies": {
59
- "@binance/common": "2.0.1",
59
+ "@binance/common": "2.1.0",
60
60
  "axios": "^1.7.4"
61
61
  }
62
62
  }