@binance/c2c 4.1.15 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BadRequestError, C2C_REST_API_PROD_URL, ConfigurationRestAPI, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, RestApiResponse, ServerError, TooManyRequestsError, UnauthorizedError } from "@binance/common";
2
2
 
3
- //#region src/rest-api/types/get-c2-ctrade-history-response-data-inner.d.ts
3
+ //#region src/rest-api/types/get-c2-ctrade-history-response.d.ts
4
4
 
5
5
  /**
6
6
  * Binance C2C REST API
@@ -17,133 +17,117 @@ import { BadRequestError, C2C_REST_API_PROD_URL, ConfigurationRestAPI, Connector
17
17
  /**
18
18
  *
19
19
  * @export
20
- * @interface GetC2CTradeHistoryResponseDataInner
20
+ * @interface GetC2CTradeHistoryResponse
21
21
  */
22
- interface GetC2CTradeHistoryResponseDataInner {
22
+ interface GetC2CTradeHistoryResponse {
23
23
  /**
24
24
  *
25
25
  * @type {string}
26
- * @memberof GetC2CTradeHistoryResponseDataInner
26
+ * @memberof GetC2CTradeHistoryResponse
27
27
  */
28
28
  orderNumber?: string;
29
29
  /**
30
30
  *
31
31
  * @type {string}
32
- * @memberof GetC2CTradeHistoryResponseDataInner
32
+ * @memberof GetC2CTradeHistoryResponse
33
33
  */
34
34
  advNo?: string;
35
35
  /**
36
36
  *
37
37
  * @type {string}
38
- * @memberof GetC2CTradeHistoryResponseDataInner
38
+ * @memberof GetC2CTradeHistoryResponse
39
39
  */
40
40
  tradeType?: string;
41
41
  /**
42
42
  *
43
43
  * @type {string}
44
- * @memberof GetC2CTradeHistoryResponseDataInner
44
+ * @memberof GetC2CTradeHistoryResponse
45
45
  */
46
46
  asset?: string;
47
47
  /**
48
48
  *
49
49
  * @type {string}
50
- * @memberof GetC2CTradeHistoryResponseDataInner
50
+ * @memberof GetC2CTradeHistoryResponse
51
51
  */
52
52
  fiat?: string;
53
53
  /**
54
54
  *
55
55
  * @type {string}
56
- * @memberof GetC2CTradeHistoryResponseDataInner
56
+ * @memberof GetC2CTradeHistoryResponse
57
57
  */
58
58
  fiatSymbol?: string;
59
59
  /**
60
60
  *
61
61
  * @type {string}
62
- * @memberof GetC2CTradeHistoryResponseDataInner
62
+ * @memberof GetC2CTradeHistoryResponse
63
63
  */
64
64
  amount?: string;
65
65
  /**
66
66
  *
67
67
  * @type {string}
68
- * @memberof GetC2CTradeHistoryResponseDataInner
68
+ * @memberof GetC2CTradeHistoryResponse
69
69
  */
70
70
  totalPrice?: string;
71
71
  /**
72
72
  *
73
73
  * @type {string}
74
- * @memberof GetC2CTradeHistoryResponseDataInner
74
+ * @memberof GetC2CTradeHistoryResponse
75
75
  */
76
76
  unitPrice?: string;
77
77
  /**
78
78
  *
79
79
  * @type {string}
80
- * @memberof GetC2CTradeHistoryResponseDataInner
80
+ * @memberof GetC2CTradeHistoryResponse
81
81
  */
82
82
  orderStatus?: string;
83
83
  /**
84
84
  *
85
85
  * @type {number | bigint}
86
- * @memberof GetC2CTradeHistoryResponseDataInner
86
+ * @memberof GetC2CTradeHistoryResponse
87
87
  */
88
88
  createTime?: number | bigint;
89
89
  /**
90
90
  *
91
91
  * @type {string}
92
- * @memberof GetC2CTradeHistoryResponseDataInner
92
+ * @memberof GetC2CTradeHistoryResponse
93
93
  */
94
94
  commission?: string;
95
95
  /**
96
96
  *
97
97
  * @type {string}
98
- * @memberof GetC2CTradeHistoryResponseDataInner
98
+ * @memberof GetC2CTradeHistoryResponse
99
99
  */
100
- counterPartNickName?: string;
100
+ takerCommissionRate?: string;
101
101
  /**
102
102
  *
103
103
  * @type {string}
104
- * @memberof GetC2CTradeHistoryResponseDataInner
104
+ * @memberof GetC2CTradeHistoryResponse
105
105
  */
106
- advertisementRole?: string;
107
- }
108
- //#endregion
109
- //#region src/rest-api/types/get-c2-ctrade-history-response.d.ts
110
-
111
- /**
112
- *
113
- * @export
114
- * @interface GetC2CTradeHistoryResponse
115
- */
116
- interface GetC2CTradeHistoryResponse {
106
+ takerCommission?: string;
117
107
  /**
118
108
  *
119
109
  * @type {string}
120
110
  * @memberof GetC2CTradeHistoryResponse
121
111
  */
122
- code?: string;
112
+ takerAmount?: string;
123
113
  /**
124
114
  *
125
115
  * @type {string}
126
116
  * @memberof GetC2CTradeHistoryResponse
127
117
  */
128
- message?: string;
118
+ counterPartNickName?: string;
129
119
  /**
130
120
  *
131
- * @type {Array<GetC2CTradeHistoryResponseDataInner>}
121
+ * @type {string}
132
122
  * @memberof GetC2CTradeHistoryResponse
133
123
  */
134
- data?: Array<GetC2CTradeHistoryResponseDataInner>;
124
+ payMethodName?: string;
135
125
  /**
136
126
  *
137
127
  * @type {number | bigint}
138
128
  * @memberof GetC2CTradeHistoryResponse
139
129
  */
140
- total?: number | bigint;
141
- /**
142
- *
143
- * @type {boolean}
144
- * @memberof GetC2CTradeHistoryResponse
145
- */
146
- success?: boolean;
130
+ additionalKycVerify?: number | bigint;
147
131
  }
148
132
  //#endregion
149
133
  //#region src/rest-api/modules/c2-capi.d.ts
@@ -283,7 +267,7 @@ declare class RestAPI {
283
267
  getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
284
268
  }
285
269
  declare namespace index_d_exports {
286
- export { C2CApi, C2CApiInterface, GetC2CTradeHistoryRequest, GetC2CTradeHistoryResponse, GetC2CTradeHistoryResponseDataInner, RestAPI };
270
+ export { C2CApi, C2CApiInterface, GetC2CTradeHistoryRequest, GetC2CTradeHistoryResponse, RestAPI };
287
271
  }
288
272
  //#endregion
289
273
  //#region src/c2c.d.ts
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { BadRequestError, C2C_REST_API_PROD_URL, ConfigurationRestAPI, Connector
3
3
  //#region rolldown:runtime
4
4
 
5
5
  //#endregion
6
- //#region src/rest-api/types/get-c2-ctrade-history-response-data-inner.d.ts
6
+ //#region src/rest-api/types/get-c2-ctrade-history-response.d.ts
7
7
  /**
8
8
  * Binance C2C REST API
9
9
  *
@@ -19,132 +19,117 @@ import { BadRequestError, C2C_REST_API_PROD_URL, ConfigurationRestAPI, Connector
19
19
  /**
20
20
  *
21
21
  * @export
22
- * @interface GetC2CTradeHistoryResponseDataInner
22
+ * @interface GetC2CTradeHistoryResponse
23
23
  */
24
- interface GetC2CTradeHistoryResponseDataInner {
24
+ interface GetC2CTradeHistoryResponse {
25
25
  /**
26
26
  *
27
27
  * @type {string}
28
- * @memberof GetC2CTradeHistoryResponseDataInner
28
+ * @memberof GetC2CTradeHistoryResponse
29
29
  */
30
30
  orderNumber?: string;
31
31
  /**
32
32
  *
33
33
  * @type {string}
34
- * @memberof GetC2CTradeHistoryResponseDataInner
34
+ * @memberof GetC2CTradeHistoryResponse
35
35
  */
36
36
  advNo?: string;
37
37
  /**
38
38
  *
39
39
  * @type {string}
40
- * @memberof GetC2CTradeHistoryResponseDataInner
40
+ * @memberof GetC2CTradeHistoryResponse
41
41
  */
42
42
  tradeType?: string;
43
43
  /**
44
44
  *
45
45
  * @type {string}
46
- * @memberof GetC2CTradeHistoryResponseDataInner
46
+ * @memberof GetC2CTradeHistoryResponse
47
47
  */
48
48
  asset?: string;
49
49
  /**
50
50
  *
51
51
  * @type {string}
52
- * @memberof GetC2CTradeHistoryResponseDataInner
52
+ * @memberof GetC2CTradeHistoryResponse
53
53
  */
54
54
  fiat?: string;
55
55
  /**
56
56
  *
57
57
  * @type {string}
58
- * @memberof GetC2CTradeHistoryResponseDataInner
58
+ * @memberof GetC2CTradeHistoryResponse
59
59
  */
60
60
  fiatSymbol?: string;
61
61
  /**
62
62
  *
63
63
  * @type {string}
64
- * @memberof GetC2CTradeHistoryResponseDataInner
64
+ * @memberof GetC2CTradeHistoryResponse
65
65
  */
66
66
  amount?: string;
67
67
  /**
68
68
  *
69
69
  * @type {string}
70
- * @memberof GetC2CTradeHistoryResponseDataInner
70
+ * @memberof GetC2CTradeHistoryResponse
71
71
  */
72
72
  totalPrice?: string;
73
73
  /**
74
74
  *
75
75
  * @type {string}
76
- * @memberof GetC2CTradeHistoryResponseDataInner
76
+ * @memberof GetC2CTradeHistoryResponse
77
77
  */
78
78
  unitPrice?: string;
79
79
  /**
80
80
  *
81
81
  * @type {string}
82
- * @memberof GetC2CTradeHistoryResponseDataInner
82
+ * @memberof GetC2CTradeHistoryResponse
83
83
  */
84
84
  orderStatus?: string;
85
85
  /**
86
86
  *
87
87
  * @type {number | bigint}
88
- * @memberof GetC2CTradeHistoryResponseDataInner
88
+ * @memberof GetC2CTradeHistoryResponse
89
89
  */
90
90
  createTime?: number | bigint;
91
91
  /**
92
92
  *
93
93
  * @type {string}
94
- * @memberof GetC2CTradeHistoryResponseDataInner
94
+ * @memberof GetC2CTradeHistoryResponse
95
95
  */
96
96
  commission?: string;
97
97
  /**
98
98
  *
99
99
  * @type {string}
100
- * @memberof GetC2CTradeHistoryResponseDataInner
100
+ * @memberof GetC2CTradeHistoryResponse
101
101
  */
102
- counterPartNickName?: string;
102
+ takerCommissionRate?: string;
103
103
  /**
104
104
  *
105
105
  * @type {string}
106
- * @memberof GetC2CTradeHistoryResponseDataInner
106
+ * @memberof GetC2CTradeHistoryResponse
107
107
  */
108
- advertisementRole?: string;
109
- }
110
- //#endregion
111
- //#region src/rest-api/types/get-c2-ctrade-history-response.d.ts
112
- /**
113
- *
114
- * @export
115
- * @interface GetC2CTradeHistoryResponse
116
- */
117
- interface GetC2CTradeHistoryResponse {
108
+ takerCommission?: string;
118
109
  /**
119
110
  *
120
111
  * @type {string}
121
112
  * @memberof GetC2CTradeHistoryResponse
122
113
  */
123
- code?: string;
114
+ takerAmount?: string;
124
115
  /**
125
116
  *
126
117
  * @type {string}
127
118
  * @memberof GetC2CTradeHistoryResponse
128
119
  */
129
- message?: string;
120
+ counterPartNickName?: string;
130
121
  /**
131
122
  *
132
- * @type {Array<GetC2CTradeHistoryResponseDataInner>}
123
+ * @type {string}
133
124
  * @memberof GetC2CTradeHistoryResponse
134
125
  */
135
- data?: Array<GetC2CTradeHistoryResponseDataInner>;
126
+ payMethodName?: string;
136
127
  /**
137
128
  *
138
129
  * @type {number | bigint}
139
130
  * @memberof GetC2CTradeHistoryResponse
140
131
  */
141
- total?: number | bigint;
142
- /**
143
- *
144
- * @type {boolean}
145
- * @memberof GetC2CTradeHistoryResponse
146
- */
147
- success?: boolean;
132
+ additionalKycVerify?: number | bigint;
148
133
  }
149
134
  //#endregion
150
135
  //#region src/rest-api/modules/c2-capi.d.ts
@@ -283,7 +268,7 @@ declare class RestAPI {
283
268
  getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
284
269
  }
285
270
  declare namespace index_d_exports {
286
- export { C2CApi, C2CApiInterface, GetC2CTradeHistoryRequest, GetC2CTradeHistoryResponse, GetC2CTradeHistoryResponseDataInner, RestAPI };
271
+ export { C2CApi, C2CApiInterface, GetC2CTradeHistoryRequest, GetC2CTradeHistoryResponse, RestAPI };
287
272
  }
288
273
  //#endregion
289
274
  //#region src/c2c.d.ts
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.1.15";
17
+ var version = "5.0.0";
18
18
 
19
19
  //#endregion
20
20
  //#region src/rest-api/modules/c2-capi.ts
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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.15\",\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.3.12\",\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"}
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\": \"5.0.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"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.3.12\",\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.1.15";
6
+ var version = "5.0.0";
7
7
 
8
8
  //#endregion
9
9
  //#region src/rest-api/modules/c2-capi.ts
@@ -1 +1 @@
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.15\",\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.3.12\",\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"}
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\": \"5.0.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"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.3.12\",\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.1.15",
4
+ "version": "5.0.0",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",