@binance/c2c 4.0.1 → 4.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
@@ -248,20 +248,22 @@ declare class RestAPI {
248
248
  * Generic function to send a request.
249
249
  * @param endpoint - The API endpoint to call.
250
250
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
251
- * @param params - Query parameters for the request.
251
+ * @param queryParams - Query parameters for the request.
252
+ * @param bodyParams - Body parameters for the request.
252
253
  *
253
254
  * @returns A promise resolving to the response data object.
254
255
  */
255
- sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
256
+ sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
256
257
  /**
257
258
  * Generic function to send a signed request.
258
259
  * @param endpoint - The API endpoint to call.
259
260
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
260
- * @param params - Query parameters for the request.
261
+ * @param queryParams - Query parameters for the request.
262
+ * @param bodyParams - Body parameters for the request.
261
263
  *
262
264
  * @returns A promise resolving to the response data object.
263
265
  */
264
- sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
266
+ sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
265
267
  /**
266
268
  * Get C2C Trade History
267
269
  *
@@ -293,5 +295,5 @@ declare class C2C {
293
295
  constructor(config: ConfigurationC2C);
294
296
  }
295
297
  //#endregion
296
- export { BadRequestError, C2C, index_d_exports as C2CRestAPI, C2C_REST_API_PROD_URL, ConfigurationC2C, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
298
+ export { BadRequestError, C2C, index_d_exports as C2CRestAPI, C2C_REST_API_PROD_URL, type ConfigurationC2C, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
297
299
  //# sourceMappingURL=index.d.mts.map
package/dist/index.d.ts CHANGED
@@ -248,20 +248,22 @@ declare class RestAPI {
248
248
  * Generic function to send a request.
249
249
  * @param endpoint - The API endpoint to call.
250
250
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
251
- * @param params - Query parameters for the request.
251
+ * @param queryParams - Query parameters for the request.
252
+ * @param bodyParams - Body parameters for the request.
252
253
  *
253
254
  * @returns A promise resolving to the response data object.
254
255
  */
255
- sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
256
+ sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
256
257
  /**
257
258
  * Generic function to send a signed request.
258
259
  * @param endpoint - The API endpoint to call.
259
260
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
260
- * @param params - Query parameters for the request.
261
+ * @param queryParams - Query parameters for the request.
262
+ * @param bodyParams - Body parameters for the request.
261
263
  *
262
264
  * @returns A promise resolving to the response data object.
263
265
  */
264
- sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
266
+ sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
265
267
  /**
266
268
  * Get C2C Trade History
267
269
  *
@@ -293,5 +295,5 @@ declare class C2C {
293
295
  constructor(config: ConfigurationC2C);
294
296
  }
295
297
  //#endregion
296
- export { BadRequestError, C2C, index_d_exports as C2CRestAPI, C2C_REST_API_PROD_URL, ConfigurationC2C, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
298
+ export { BadRequestError, C2C, index_d_exports as C2CRestAPI, C2C_REST_API_PROD_URL, type ConfigurationC2C, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
297
299
  //# sourceMappingURL=index.d.ts.map
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/c2c";
17
- var version = "4.0.1";
17
+ var version = "4.1.0";
18
18
 
19
19
  //#endregion
20
20
  //#region src/rest-api/modules/c2-capi.ts
@@ -36,6 +36,7 @@ var version = "4.0.1";
36
36
  const C2CApiAxiosParamCreator = function(configuration) {
37
37
  return { getC2CTradeHistory: async (tradeType, startTimestamp, endTimestamp, page, rows, recvWindow) => {
38
38
  const localVarQueryParameter = {};
39
+ const localVarBodyParameter = {};
39
40
  if (tradeType !== void 0 && tradeType !== null) localVarQueryParameter["tradeType"] = tradeType;
40
41
  if (startTimestamp !== void 0 && startTimestamp !== null) localVarQueryParameter["startTimestamp"] = startTimestamp;
41
42
  if (endTimestamp !== void 0 && endTimestamp !== null) localVarQueryParameter["endTimestamp"] = endTimestamp;
@@ -47,7 +48,8 @@ const C2CApiAxiosParamCreator = function(configuration) {
47
48
  return {
48
49
  endpoint: "/sapi/v1/c2c/orderMatch/listUserOrderHistory",
49
50
  method: "GET",
50
- params: localVarQueryParameter,
51
+ queryParams: localVarQueryParameter,
52
+ bodyParams: localVarBodyParameter,
51
53
  timeUnit: _timeUnit
52
54
  };
53
55
  } };
@@ -79,7 +81,7 @@ var C2CApi = class {
79
81
  */
80
82
  async getC2CTradeHistory(requestParameters = {}) {
81
83
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(requestParameters?.tradeType, requestParameters?.startTimestamp, requestParameters?.endTimestamp, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
82
- return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
84
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
83
85
  }
84
86
  };
85
87
 
@@ -106,23 +108,25 @@ var RestAPI = class {
106
108
  * Generic function to send a request.
107
109
  * @param endpoint - The API endpoint to call.
108
110
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
109
- * @param params - Query parameters for the request.
111
+ * @param queryParams - Query parameters for the request.
112
+ * @param bodyParams - Body parameters for the request.
110
113
  *
111
114
  * @returns A promise resolving to the response data object.
112
115
  */
113
- sendRequest(endpoint, method, params = {}) {
114
- return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0);
116
+ sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
117
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
115
118
  }
116
119
  /**
117
120
  * Generic function to send a signed request.
118
121
  * @param endpoint - The API endpoint to call.
119
122
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
120
- * @param params - Query parameters for the request.
123
+ * @param queryParams - Query parameters for the request.
124
+ * @param bodyParams - Body parameters for the request.
121
125
  *
122
126
  * @returns A promise resolving to the response data object.
123
127
  */
124
- sendSignedRequest(endpoint, method, params = {}) {
125
- return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0, { isSigned: true });
128
+ sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
129
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
126
130
  }
127
131
  /**
128
132
  * Get C2C Trade History
@@ -190,12 +194,6 @@ Object.defineProperty(exports, 'C2C_REST_API_PROD_URL', {
190
194
  return __binance_common.C2C_REST_API_PROD_URL;
191
195
  }
192
196
  });
193
- Object.defineProperty(exports, 'ConfigurationC2C', {
194
- enumerable: true,
195
- get: function () {
196
- return ConfigurationC2C;
197
- }
198
- });
199
197
  Object.defineProperty(exports, 'ConnectorClientError', {
200
198
  enumerable: true,
201
199
  get: function () {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"4.0.1\",\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 \"C2C\",\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 C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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 { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * C2CApi - axios parameter creator\n */\nconst C2CApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {string} [tradeType] BUY, SELL\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Default 1\n * @param {number | bigint} [rows] default 100, max 100\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: string,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\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/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * C2CApi - interface\n * @interface C2CApi\n */\nexport interface C2CApiInterface {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in C2CApi.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * BUY, SELL\n * @type {string}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly tradeType?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Default 1\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 100\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * C2CApi - object-oriented interface\n * @class C2CApi\n */\nexport class C2CApi implements C2CApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = C2CApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApi\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows,\n requestParameters?.recvWindow\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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 { C2CApi } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private c2CApi: C2CApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.c2CApi = new C2CApi(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 C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.c2CApi.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\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 || C2C_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,0BAA0B,SAAU,eAAqC;AAC3E,QAAO,EAoBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;AAE1D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAG1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAG/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAG7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAGrC,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;;;;;;AAgFL,IAAa,SAAb,MAA+C;CAI3C,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,wBAAwB,cAAc;;;;;;;;;;;;;;;;;;CAmB3E,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,QAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;ACjMT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,SAAS,IAAI,OAAO,cAAc;;;;;;;;;;CAW3C,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;;;;;;;;;;;;;;;;;;CAmBN,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,OAAO,mBAAmB,kBAAkB;;;;;;;;;;;;;AE1EhE,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,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","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"4.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 \"C2C\",\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 C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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 { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * C2CApi - axios parameter creator\n */\nconst C2CApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {string} [tradeType] BUY, SELL\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Default 1\n * @param {number | bigint} [rows] default 100, max 100\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: string,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\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/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * C2CApi - interface\n * @interface C2CApi\n */\nexport interface C2CApiInterface {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in C2CApi.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * BUY, SELL\n * @type {string}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly tradeType?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Default 1\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 100\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * C2CApi - object-oriented interface\n * @class C2CApi\n */\nexport class C2CApi implements C2CApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = C2CApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApi\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows,\n requestParameters?.recvWindow\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\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 C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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 { C2CApi } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private c2CApi: C2CApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.c2CApi = new C2CApi(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 C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.c2CApi.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\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 || C2C_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,0BAA0B,SAAU,eAAqC;AAC3E,QAAO,EAoBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;AAEzD,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,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;;;;;;AAgFL,IAAa,SAAb,MAA+C;CAI3C,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,wBAAwB,cAAc;;;;;;;;;;;;;;;;;;CAmB3E,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;AC/LT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,SAAS,IAAI,OAAO,cAAc;;;;;;;;;;;CAY3C,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;;;;;;;;;;;;;;;;;;CAmBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,OAAO,mBAAmB,kBAAkB;;;;;;;;;;;;;AE3FhE,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,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, C2C_REST_API_PROD_URL, C2C_REST_API_PROD_URL as C2C_RE
3
3
 
4
4
  //#region package.json
5
5
  var name = "@binance/c2c";
6
- var version = "4.0.1";
6
+ var version = "4.1.0";
7
7
 
8
8
  //#endregion
9
9
  //#region src/rest-api/modules/c2-capi.ts
@@ -25,6 +25,7 @@ var version = "4.0.1";
25
25
  const C2CApiAxiosParamCreator = function(configuration) {
26
26
  return { getC2CTradeHistory: async (tradeType, startTimestamp, endTimestamp, page, rows, recvWindow) => {
27
27
  const localVarQueryParameter = {};
28
+ const localVarBodyParameter = {};
28
29
  if (tradeType !== void 0 && tradeType !== null) localVarQueryParameter["tradeType"] = tradeType;
29
30
  if (startTimestamp !== void 0 && startTimestamp !== null) localVarQueryParameter["startTimestamp"] = startTimestamp;
30
31
  if (endTimestamp !== void 0 && endTimestamp !== null) localVarQueryParameter["endTimestamp"] = endTimestamp;
@@ -36,7 +37,8 @@ const C2CApiAxiosParamCreator = function(configuration) {
36
37
  return {
37
38
  endpoint: "/sapi/v1/c2c/orderMatch/listUserOrderHistory",
38
39
  method: "GET",
39
- params: localVarQueryParameter,
40
+ queryParams: localVarQueryParameter,
41
+ bodyParams: localVarBodyParameter,
40
42
  timeUnit: _timeUnit
41
43
  };
42
44
  } };
@@ -68,7 +70,7 @@ var C2CApi = class {
68
70
  */
69
71
  async getC2CTradeHistory(requestParameters = {}) {
70
72
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(requestParameters?.tradeType, requestParameters?.startTimestamp, requestParameters?.endTimestamp, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
71
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
73
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
72
74
  }
73
75
  };
74
76
 
@@ -95,23 +97,25 @@ var RestAPI = class {
95
97
  * Generic function to send a request.
96
98
  * @param endpoint - The API endpoint to call.
97
99
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
98
- * @param params - Query parameters for the request.
100
+ * @param queryParams - Query parameters for the request.
101
+ * @param bodyParams - Body parameters for the request.
99
102
  *
100
103
  * @returns A promise resolving to the response data object.
101
104
  */
102
- sendRequest(endpoint, method, params = {}) {
103
- return sendRequest(this.configuration, endpoint, method, params, void 0);
105
+ sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
106
+ return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
104
107
  }
105
108
  /**
106
109
  * Generic function to send a signed request.
107
110
  * @param endpoint - The API endpoint to call.
108
111
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
109
- * @param params - Query parameters for the request.
112
+ * @param queryParams - Query parameters for the request.
113
+ * @param bodyParams - Body parameters for the request.
110
114
  *
111
115
  * @returns A promise resolving to the response data object.
112
116
  */
113
- sendSignedRequest(endpoint, method, params = {}) {
114
- return sendRequest(this.configuration, endpoint, method, params, void 0, { isSigned: true });
117
+ sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
118
+ return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
115
119
  }
116
120
  /**
117
121
  * Get C2C Trade History
@@ -160,5 +164,5 @@ var C2C = class {
160
164
  };
161
165
 
162
166
  //#endregion
163
- export { BadRequestError, C2C, rest_api_exports as C2CRestAPI, C2C_REST_API_PROD_URL, ConfigurationC2C, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
167
+ export { BadRequestError, C2C, rest_api_exports as C2CRestAPI, C2C_REST_API_PROD_URL, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
164
168
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"4.0.1\",\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 \"C2C\",\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 C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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 { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * C2CApi - axios parameter creator\n */\nconst C2CApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {string} [tradeType] BUY, SELL\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Default 1\n * @param {number | bigint} [rows] default 100, max 100\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: string,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\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/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * C2CApi - interface\n * @interface C2CApi\n */\nexport interface C2CApiInterface {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in C2CApi.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * BUY, SELL\n * @type {string}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly tradeType?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Default 1\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 100\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * C2CApi - object-oriented interface\n * @class C2CApi\n */\nexport class C2CApi implements C2CApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = C2CApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApi\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows,\n requestParameters?.recvWindow\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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 { C2CApi } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private c2CApi: C2CApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.c2CApi = new C2CApi(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 C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.c2CApi.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\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 || C2C_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,0BAA0B,SAAU,eAAqC;AAC3E,QAAO,EAoBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;AAE1D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAG1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAG/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAG7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAGrC,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;;;;;;AAgFL,IAAa,SAAb,MAA+C;CAI3C,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,wBAAwB,cAAc;;;;;;;;;;;;;;;;;;CAmB3E,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,SAAO,YACH,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,QAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;ACjMT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,SAAS,IAAI,OAAO,cAAc;;;;;;;;;;CAW3C,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;;;;;;;;;;;;;;;;;;CAmBN,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,OAAO,mBAAmB,kBAAkB;;;;;;;;;;;;;AE1EhE,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,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","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"4.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 \"C2C\",\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 C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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 { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * C2CApi - axios parameter creator\n */\nconst C2CApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {string} [tradeType] BUY, SELL\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Default 1\n * @param {number | bigint} [rows] default 100, max 100\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: string,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\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/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * C2CApi - interface\n * @interface C2CApi\n */\nexport interface C2CApiInterface {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in C2CApi.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * BUY, SELL\n * @type {string}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly tradeType?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Default 1\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 100\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * C2CApi - object-oriented interface\n * @class C2CApi\n */\nexport class C2CApi implements C2CApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = C2CApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApi\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows,\n requestParameters?.recvWindow\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\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 C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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 { C2CApi } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private c2CApi: C2CApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.c2CApi = new C2CApi(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 C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.c2CApi.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C 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, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\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 || C2C_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,0BAA0B,SAAU,eAAqC;AAC3E,QAAO,EAoBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;AAEzD,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,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;;;;;;AAgFL,IAAa,SAAb,MAA+C;CAI3C,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,wBAAwB,cAAc;;;;;;;;;;;;;;;;;;CAmB3E,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,SAAO,YACH,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;AC/LT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,SAAS,IAAI,OAAO,cAAc;;;;;;;;;;;CAY3C,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;;;;;;;;;;;;;;;;;;CAmBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,OAAO,mBAAmB,kBAAkB;;;;;;;;;;;;;AE3FhE,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,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/c2c",
3
3
  "description": "Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.",
4
- "version": "4.0.1",
4
+ "version": "4.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
  }