@binance/c2c 2.0.8 → 3.0.1
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 +31 -21
- package/dist/index.d.ts +31 -21
- package/dist/index.js +23 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -81,10 +81,10 @@ interface GetC2CTradeHistoryResponseDataInner {
|
|
|
81
81
|
orderStatus?: string;
|
|
82
82
|
/**
|
|
83
83
|
*
|
|
84
|
-
* @type {number}
|
|
84
|
+
* @type {number | bigint}
|
|
85
85
|
* @memberof GetC2CTradeHistoryResponseDataInner
|
|
86
86
|
*/
|
|
87
|
-
createTime?: number;
|
|
87
|
+
createTime?: number | bigint;
|
|
88
88
|
/**
|
|
89
89
|
*
|
|
90
90
|
* @type {string}
|
|
@@ -144,10 +144,10 @@ interface GetC2CTradeHistoryResponse {
|
|
|
144
144
|
data?: Array<GetC2CTradeHistoryResponseDataInner>;
|
|
145
145
|
/**
|
|
146
146
|
*
|
|
147
|
-
* @type {number}
|
|
147
|
+
* @type {number | bigint}
|
|
148
148
|
* @memberof GetC2CTradeHistoryResponse
|
|
149
149
|
*/
|
|
150
|
-
total?: number;
|
|
150
|
+
total?: number | bigint;
|
|
151
151
|
/**
|
|
152
152
|
*
|
|
153
153
|
* @type {boolean}
|
|
@@ -178,9 +178,8 @@ interface C2CApiInterface {
|
|
|
178
178
|
* Get C2C Trade History
|
|
179
179
|
*
|
|
180
180
|
* The max interval between startTime and endTime is 30 days.
|
|
181
|
-
* If startTime and endTime are not sent, the recent
|
|
182
|
-
*
|
|
183
|
-
* Return up to 200 records per request.
|
|
181
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
182
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
184
183
|
*
|
|
185
184
|
* Weight: 1
|
|
186
185
|
*
|
|
@@ -197,30 +196,42 @@ interface C2CApiInterface {
|
|
|
197
196
|
* @interface GetC2CTradeHistoryRequest
|
|
198
197
|
*/
|
|
199
198
|
interface GetC2CTradeHistoryRequest {
|
|
199
|
+
/**
|
|
200
|
+
* BUY, SELL
|
|
201
|
+
* @type {string}
|
|
202
|
+
* @memberof C2CApiGetC2CTradeHistory
|
|
203
|
+
*/
|
|
204
|
+
readonly tradeType?: string;
|
|
200
205
|
/**
|
|
201
206
|
*
|
|
202
|
-
* @type {number}
|
|
207
|
+
* @type {number | bigint}
|
|
203
208
|
* @memberof C2CApiGetC2CTradeHistory
|
|
204
209
|
*/
|
|
205
|
-
readonly startTime?: number;
|
|
210
|
+
readonly startTime?: number | bigint;
|
|
206
211
|
/**
|
|
207
212
|
*
|
|
208
|
-
* @type {number}
|
|
213
|
+
* @type {number | bigint}
|
|
209
214
|
* @memberof C2CApiGetC2CTradeHistory
|
|
210
215
|
*/
|
|
211
|
-
readonly endTime?: number;
|
|
216
|
+
readonly endTime?: number | bigint;
|
|
212
217
|
/**
|
|
213
218
|
* Default 1
|
|
214
|
-
* @type {number}
|
|
219
|
+
* @type {number | bigint}
|
|
215
220
|
* @memberof C2CApiGetC2CTradeHistory
|
|
216
221
|
*/
|
|
217
|
-
readonly page?: number;
|
|
222
|
+
readonly page?: number | bigint;
|
|
223
|
+
/**
|
|
224
|
+
* default 100, max 100
|
|
225
|
+
* @type {number | bigint}
|
|
226
|
+
* @memberof C2CApiGetC2CTradeHistory
|
|
227
|
+
*/
|
|
228
|
+
readonly rows?: number | bigint;
|
|
218
229
|
/**
|
|
219
230
|
*
|
|
220
|
-
* @type {number}
|
|
231
|
+
* @type {number | bigint}
|
|
221
232
|
* @memberof C2CApiGetC2CTradeHistory
|
|
222
233
|
*/
|
|
223
|
-
readonly recvWindow?: number;
|
|
234
|
+
readonly recvWindow?: number | bigint;
|
|
224
235
|
}
|
|
225
236
|
/**
|
|
226
237
|
* C2CApi - object-oriented interface
|
|
@@ -234,9 +245,8 @@ declare class C2CApi implements C2CApiInterface {
|
|
|
234
245
|
* Get C2C Trade History
|
|
235
246
|
*
|
|
236
247
|
* The max interval between startTime and endTime is 30 days.
|
|
237
|
-
* If startTime and endTime are not sent, the recent
|
|
238
|
-
*
|
|
239
|
-
* Return up to 200 records per request.
|
|
248
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
249
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
240
250
|
*
|
|
241
251
|
* Weight: 1
|
|
242
252
|
*
|
|
@@ -289,14 +299,14 @@ declare class RestAPI {
|
|
|
289
299
|
* Get C2C Trade History
|
|
290
300
|
*
|
|
291
301
|
* The max interval between startTime and endTime is 30 days.
|
|
292
|
-
* If startTime and endTime are not sent, the recent
|
|
293
|
-
*
|
|
294
|
-
* Return up to 200 records per request.
|
|
302
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
303
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
295
304
|
*
|
|
296
305
|
* Weight: 1
|
|
297
306
|
*
|
|
298
307
|
* @summary Get C2C Trade History (USER_DATA)
|
|
299
308
|
* @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
|
|
309
|
+
*
|
|
300
310
|
* @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
|
|
301
311
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
302
312
|
* @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
|
package/dist/index.d.ts
CHANGED
|
@@ -81,10 +81,10 @@ interface GetC2CTradeHistoryResponseDataInner {
|
|
|
81
81
|
orderStatus?: string;
|
|
82
82
|
/**
|
|
83
83
|
*
|
|
84
|
-
* @type {number}
|
|
84
|
+
* @type {number | bigint}
|
|
85
85
|
* @memberof GetC2CTradeHistoryResponseDataInner
|
|
86
86
|
*/
|
|
87
|
-
createTime?: number;
|
|
87
|
+
createTime?: number | bigint;
|
|
88
88
|
/**
|
|
89
89
|
*
|
|
90
90
|
* @type {string}
|
|
@@ -144,10 +144,10 @@ interface GetC2CTradeHistoryResponse {
|
|
|
144
144
|
data?: Array<GetC2CTradeHistoryResponseDataInner>;
|
|
145
145
|
/**
|
|
146
146
|
*
|
|
147
|
-
* @type {number}
|
|
147
|
+
* @type {number | bigint}
|
|
148
148
|
* @memberof GetC2CTradeHistoryResponse
|
|
149
149
|
*/
|
|
150
|
-
total?: number;
|
|
150
|
+
total?: number | bigint;
|
|
151
151
|
/**
|
|
152
152
|
*
|
|
153
153
|
* @type {boolean}
|
|
@@ -178,9 +178,8 @@ interface C2CApiInterface {
|
|
|
178
178
|
* Get C2C Trade History
|
|
179
179
|
*
|
|
180
180
|
* The max interval between startTime and endTime is 30 days.
|
|
181
|
-
* If startTime and endTime are not sent, the recent
|
|
182
|
-
*
|
|
183
|
-
* Return up to 200 records per request.
|
|
181
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
182
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
184
183
|
*
|
|
185
184
|
* Weight: 1
|
|
186
185
|
*
|
|
@@ -197,30 +196,42 @@ interface C2CApiInterface {
|
|
|
197
196
|
* @interface GetC2CTradeHistoryRequest
|
|
198
197
|
*/
|
|
199
198
|
interface GetC2CTradeHistoryRequest {
|
|
199
|
+
/**
|
|
200
|
+
* BUY, SELL
|
|
201
|
+
* @type {string}
|
|
202
|
+
* @memberof C2CApiGetC2CTradeHistory
|
|
203
|
+
*/
|
|
204
|
+
readonly tradeType?: string;
|
|
200
205
|
/**
|
|
201
206
|
*
|
|
202
|
-
* @type {number}
|
|
207
|
+
* @type {number | bigint}
|
|
203
208
|
* @memberof C2CApiGetC2CTradeHistory
|
|
204
209
|
*/
|
|
205
|
-
readonly startTime?: number;
|
|
210
|
+
readonly startTime?: number | bigint;
|
|
206
211
|
/**
|
|
207
212
|
*
|
|
208
|
-
* @type {number}
|
|
213
|
+
* @type {number | bigint}
|
|
209
214
|
* @memberof C2CApiGetC2CTradeHistory
|
|
210
215
|
*/
|
|
211
|
-
readonly endTime?: number;
|
|
216
|
+
readonly endTime?: number | bigint;
|
|
212
217
|
/**
|
|
213
218
|
* Default 1
|
|
214
|
-
* @type {number}
|
|
219
|
+
* @type {number | bigint}
|
|
215
220
|
* @memberof C2CApiGetC2CTradeHistory
|
|
216
221
|
*/
|
|
217
|
-
readonly page?: number;
|
|
222
|
+
readonly page?: number | bigint;
|
|
223
|
+
/**
|
|
224
|
+
* default 100, max 100
|
|
225
|
+
* @type {number | bigint}
|
|
226
|
+
* @memberof C2CApiGetC2CTradeHistory
|
|
227
|
+
*/
|
|
228
|
+
readonly rows?: number | bigint;
|
|
218
229
|
/**
|
|
219
230
|
*
|
|
220
|
-
* @type {number}
|
|
231
|
+
* @type {number | bigint}
|
|
221
232
|
* @memberof C2CApiGetC2CTradeHistory
|
|
222
233
|
*/
|
|
223
|
-
readonly recvWindow?: number;
|
|
234
|
+
readonly recvWindow?: number | bigint;
|
|
224
235
|
}
|
|
225
236
|
/**
|
|
226
237
|
* C2CApi - object-oriented interface
|
|
@@ -234,9 +245,8 @@ declare class C2CApi implements C2CApiInterface {
|
|
|
234
245
|
* Get C2C Trade History
|
|
235
246
|
*
|
|
236
247
|
* The max interval between startTime and endTime is 30 days.
|
|
237
|
-
* If startTime and endTime are not sent, the recent
|
|
238
|
-
*
|
|
239
|
-
* Return up to 200 records per request.
|
|
248
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
249
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
240
250
|
*
|
|
241
251
|
* Weight: 1
|
|
242
252
|
*
|
|
@@ -289,14 +299,14 @@ declare class RestAPI {
|
|
|
289
299
|
* Get C2C Trade History
|
|
290
300
|
*
|
|
291
301
|
* The max interval between startTime and endTime is 30 days.
|
|
292
|
-
* If startTime and endTime are not sent, the recent
|
|
293
|
-
*
|
|
294
|
-
* Return up to 200 records per request.
|
|
302
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
303
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
295
304
|
*
|
|
296
305
|
* Weight: 1
|
|
297
306
|
*
|
|
298
307
|
* @summary Get C2C Trade History (USER_DATA)
|
|
299
308
|
* @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
|
|
309
|
+
*
|
|
300
310
|
* @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
|
|
301
311
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
302
312
|
* @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var import_common3 = require("@binance/common");
|
|
|
41
41
|
|
|
42
42
|
// package.json
|
|
43
43
|
var name = "@binance/c2c";
|
|
44
|
-
var version = "
|
|
44
|
+
var version = "3.0.1";
|
|
45
45
|
|
|
46
46
|
// src/rest-api/index.ts
|
|
47
47
|
var rest_api_exports = {};
|
|
@@ -58,22 +58,26 @@ var C2CApiAxiosParamCreator = function(configuration) {
|
|
|
58
58
|
* Get C2C Trade History
|
|
59
59
|
*
|
|
60
60
|
* The max interval between startTime and endTime is 30 days.
|
|
61
|
-
* If startTime and endTime are not sent, the recent
|
|
62
|
-
*
|
|
63
|
-
* Return up to 200 records per request.
|
|
61
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
62
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
64
63
|
*
|
|
65
64
|
* Weight: 1
|
|
66
65
|
*
|
|
67
66
|
* @summary Get C2C Trade History (USER_DATA)
|
|
68
|
-
* @param {
|
|
69
|
-
* @param {number} [
|
|
70
|
-
* @param {number} [
|
|
71
|
-
* @param {number} [
|
|
67
|
+
* @param {string} [tradeType] BUY, SELL
|
|
68
|
+
* @param {number | bigint} [startTime]
|
|
69
|
+
* @param {number | bigint} [endTime]
|
|
70
|
+
* @param {number | bigint} [page] Default 1
|
|
71
|
+
* @param {number | bigint} [rows] default 100, max 100
|
|
72
|
+
* @param {number | bigint} [recvWindow]
|
|
72
73
|
*
|
|
73
74
|
* @throws {RequiredError}
|
|
74
75
|
*/
|
|
75
|
-
getC2CTradeHistory: async (startTime, endTime, page, recvWindow) => {
|
|
76
|
+
getC2CTradeHistory: async (tradeType, startTime, endTime, page, rows, recvWindow) => {
|
|
76
77
|
const localVarQueryParameter = {};
|
|
78
|
+
if (tradeType !== void 0 && tradeType !== null) {
|
|
79
|
+
localVarQueryParameter["tradeType"] = tradeType;
|
|
80
|
+
}
|
|
77
81
|
if (startTime !== void 0 && startTime !== null) {
|
|
78
82
|
localVarQueryParameter["startTime"] = startTime;
|
|
79
83
|
}
|
|
@@ -83,6 +87,9 @@ var C2CApiAxiosParamCreator = function(configuration) {
|
|
|
83
87
|
if (page !== void 0 && page !== null) {
|
|
84
88
|
localVarQueryParameter["page"] = page;
|
|
85
89
|
}
|
|
90
|
+
if (rows !== void 0 && rows !== null) {
|
|
91
|
+
localVarQueryParameter["rows"] = rows;
|
|
92
|
+
}
|
|
86
93
|
if (recvWindow !== void 0 && recvWindow !== null) {
|
|
87
94
|
localVarQueryParameter["recvWindow"] = recvWindow;
|
|
88
95
|
}
|
|
@@ -106,9 +113,8 @@ var C2CApi = class {
|
|
|
106
113
|
* Get C2C Trade History
|
|
107
114
|
*
|
|
108
115
|
* The max interval between startTime and endTime is 30 days.
|
|
109
|
-
* If startTime and endTime are not sent, the recent
|
|
110
|
-
*
|
|
111
|
-
* Return up to 200 records per request.
|
|
116
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
117
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
112
118
|
*
|
|
113
119
|
* Weight: 1
|
|
114
120
|
*
|
|
@@ -121,9 +127,11 @@ var C2CApi = class {
|
|
|
121
127
|
*/
|
|
122
128
|
async getC2CTradeHistory(requestParameters = {}) {
|
|
123
129
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(
|
|
130
|
+
requestParameters?.tradeType,
|
|
124
131
|
requestParameters?.startTime,
|
|
125
132
|
requestParameters?.endTime,
|
|
126
133
|
requestParameters?.page,
|
|
134
|
+
requestParameters?.rows,
|
|
127
135
|
requestParameters?.recvWindow
|
|
128
136
|
);
|
|
129
137
|
return (0, import_common.sendRequest)(
|
|
@@ -172,14 +180,14 @@ var RestAPI = class {
|
|
|
172
180
|
* Get C2C Trade History
|
|
173
181
|
*
|
|
174
182
|
* The max interval between startTime and endTime is 30 days.
|
|
175
|
-
* If startTime and endTime are not sent, the recent
|
|
176
|
-
*
|
|
177
|
-
* Return up to 200 records per request.
|
|
183
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
184
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
178
185
|
*
|
|
179
186
|
* Weight: 1
|
|
180
187
|
*
|
|
181
188
|
* @summary Get C2C Trade History (USER_DATA)
|
|
182
189
|
* @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
|
|
190
|
+
*
|
|
183
191
|
* @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
|
|
184
192
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
185
193
|
* @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/c2c.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts"],"sourcesContent":["export { C2C, ConfigurationC2C } from './c2c';\nexport * as C2CRestAPI from './rest-api';\n\nexport {\n C2C_REST_API_PROD_URL,\n ConnectorClientError,\n RequiredError,\n UnauthorizedError,\n ForbiddenError,\n TooManyRequestsError,\n RateLimitBanError,\n ServerError,\n NetworkError,\n NotFoundError,\n BadRequestError,\n} from '@binance/common';\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","{\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\": \"2.0.8\",\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 && tsup\",\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 \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsup\": \"^8.4.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"1.2.5\",\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\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\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 startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [page] Default 1\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n startTime?: number,\n endTime?: number,\n page?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/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 startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 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 *\n * @type {number}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly startTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTime?: number;\n\n /**\n * Default 1\n * @type {number}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly page?: number;\n\n /**\n *\n * @type {number}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly recvWindow?: number;\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 startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 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?.startTime,\n requestParameters?.endTime,\n requestParameters?.page,\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 startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 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 * @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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,iBAA4E;;;ACCxE,WAAQ;AAER,cAAW;;;ACHf;AAAA;AAAA;AAAA;AAAA;;;ACaA,oBAMO;AAMP,IAAM,0BAA0B,SAAU,eAAqC;AAC3E,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAmBH,oBAAoB,OAChB,WACA,SACA,MACA,eACuB;AACvB,YAAM,yBAAkD,CAAC;AAEzD,UAAI,cAAc,UAAa,cAAc,MAAM;AAC/C,+BAAuB,WAAW,IAAI;AAAA,MAC1C;AAEA,UAAI,YAAY,UAAa,Y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,QAAQ,MAAS;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,kBACI,UACA,QACA,SAAkC,CAAC,GACR;AAC3B,eAAO,4BAAe,KAAK,eAAe,UAAU,QAAQ,QAAQ,QAAW;AAAA,MAC3E,UAAU;AAAA,IACd,CAAC;AAAA,EACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,mBACI,oBAA+C,CAAC,GACI;AACpD,WAAO,KAAK,OAAO,mBAAmB,iBAAiB;AAAA,EAC3D;AACJ;;;AJ5EO,IAAM,MAAN,MAAU;AAAA,EAGb,YAAY,QAA0B;AAClC,UAAM,gBAAY,+BAAe,MAAM,OAAO;AAE9C,QAAI,QAAQ,sBAAsB;AAC9B,YAAM,gBAAgB,IAAI;AAAA,QACtB,OAAO;AAAA,MACX;AAGA,oBAAc,WAAW,cAAc,YAAY;AACnD,oBAAc,cAAc,cAAc,eAAe,CAAC;AAC1D,oBAAc,YAAY,UAAU;AAAA,QAChC,GAAI,cAAc,YAAY,WAAW,CAAC;AAAA,QAC1C,cAAc;AAAA,MAClB;AACA,WAAK,UAAU,IAAI,QAAQ,aAAa;AAAA,IAC5C;AAAA,EACJ;AACJ;;;AD1BA,IAAAC,iBAYO;","names":["import_common","import_common","import_common"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/c2c.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts"],"sourcesContent":["export { C2C, ConfigurationC2C } from './c2c';\nexport * as C2CRestAPI from './rest-api';\n\nexport {\n C2C_REST_API_PROD_URL,\n ConnectorClientError,\n RequiredError,\n UnauthorizedError,\n ForbiddenError,\n TooManyRequestsError,\n RateLimitBanError,\n ServerError,\n NetworkError,\n NotFoundError,\n BadRequestError,\n} from '@binance/common';\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","{\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\": \"3.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 && tsup\",\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 \"tsup\": \"^8.4.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.0.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\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\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 startTime and endTime is 30 days.\n * If startTime and endTime 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} [startTime]\n * @param {number | bigint} [endTime]\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 startTime?: number | bigint,\n endTime?: 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 (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n\n if (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 startTime and endTime is 30 days.\n * If startTime and endTime 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 startTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTime?: 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 startTime and endTime is 30 days.\n * If startTime and endTime 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?.startTime,\n requestParameters?.endTime,\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 startTime and endTime is 30 days.\n * If startTime and endTime 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,iBAA4E;;;ACCxE,WAAQ;AAER,cAAW;;;ACHf;AAAA;AAAA;AAAA;AAAA;;;ACaA,oBAMO;AAMP,IAAM,0BAA0B,SAAU,eAAqC;AAC3E,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAoBH,oBAA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common"]}
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { buildUserAgent, ConfigurationRestAPI as ConfigurationRestAPI3, C2C_REST
|
|
|
9
9
|
|
|
10
10
|
// package.json
|
|
11
11
|
var name = "@binance/c2c";
|
|
12
|
-
var version = "
|
|
12
|
+
var version = "3.0.1";
|
|
13
13
|
|
|
14
14
|
// src/rest-api/index.ts
|
|
15
15
|
var rest_api_exports = {};
|
|
@@ -28,22 +28,26 @@ var C2CApiAxiosParamCreator = function(configuration) {
|
|
|
28
28
|
* Get C2C Trade History
|
|
29
29
|
*
|
|
30
30
|
* The max interval between startTime and endTime is 30 days.
|
|
31
|
-
* If startTime and endTime are not sent, the recent
|
|
32
|
-
*
|
|
33
|
-
* Return up to 200 records per request.
|
|
31
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
32
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
34
33
|
*
|
|
35
34
|
* Weight: 1
|
|
36
35
|
*
|
|
37
36
|
* @summary Get C2C Trade History (USER_DATA)
|
|
38
|
-
* @param {
|
|
39
|
-
* @param {number} [
|
|
40
|
-
* @param {number} [
|
|
41
|
-
* @param {number} [
|
|
37
|
+
* @param {string} [tradeType] BUY, SELL
|
|
38
|
+
* @param {number | bigint} [startTime]
|
|
39
|
+
* @param {number | bigint} [endTime]
|
|
40
|
+
* @param {number | bigint} [page] Default 1
|
|
41
|
+
* @param {number | bigint} [rows] default 100, max 100
|
|
42
|
+
* @param {number | bigint} [recvWindow]
|
|
42
43
|
*
|
|
43
44
|
* @throws {RequiredError}
|
|
44
45
|
*/
|
|
45
|
-
getC2CTradeHistory: async (startTime, endTime, page, recvWindow) => {
|
|
46
|
+
getC2CTradeHistory: async (tradeType, startTime, endTime, page, rows, recvWindow) => {
|
|
46
47
|
const localVarQueryParameter = {};
|
|
48
|
+
if (tradeType !== void 0 && tradeType !== null) {
|
|
49
|
+
localVarQueryParameter["tradeType"] = tradeType;
|
|
50
|
+
}
|
|
47
51
|
if (startTime !== void 0 && startTime !== null) {
|
|
48
52
|
localVarQueryParameter["startTime"] = startTime;
|
|
49
53
|
}
|
|
@@ -53,6 +57,9 @@ var C2CApiAxiosParamCreator = function(configuration) {
|
|
|
53
57
|
if (page !== void 0 && page !== null) {
|
|
54
58
|
localVarQueryParameter["page"] = page;
|
|
55
59
|
}
|
|
60
|
+
if (rows !== void 0 && rows !== null) {
|
|
61
|
+
localVarQueryParameter["rows"] = rows;
|
|
62
|
+
}
|
|
56
63
|
if (recvWindow !== void 0 && recvWindow !== null) {
|
|
57
64
|
localVarQueryParameter["recvWindow"] = recvWindow;
|
|
58
65
|
}
|
|
@@ -76,9 +83,8 @@ var C2CApi = class {
|
|
|
76
83
|
* Get C2C Trade History
|
|
77
84
|
*
|
|
78
85
|
* The max interval between startTime and endTime is 30 days.
|
|
79
|
-
* If startTime and endTime are not sent, the recent
|
|
80
|
-
*
|
|
81
|
-
* Return up to 200 records per request.
|
|
86
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
87
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
82
88
|
*
|
|
83
89
|
* Weight: 1
|
|
84
90
|
*
|
|
@@ -91,9 +97,11 @@ var C2CApi = class {
|
|
|
91
97
|
*/
|
|
92
98
|
async getC2CTradeHistory(requestParameters = {}) {
|
|
93
99
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(
|
|
100
|
+
requestParameters?.tradeType,
|
|
94
101
|
requestParameters?.startTime,
|
|
95
102
|
requestParameters?.endTime,
|
|
96
103
|
requestParameters?.page,
|
|
104
|
+
requestParameters?.rows,
|
|
97
105
|
requestParameters?.recvWindow
|
|
98
106
|
);
|
|
99
107
|
return sendRequest(
|
|
@@ -142,14 +150,14 @@ var RestAPI = class {
|
|
|
142
150
|
* Get C2C Trade History
|
|
143
151
|
*
|
|
144
152
|
* The max interval between startTime and endTime is 30 days.
|
|
145
|
-
* If startTime and endTime are not sent, the recent
|
|
146
|
-
*
|
|
147
|
-
* Return up to 200 records per request.
|
|
153
|
+
* If startTime and endTime are not sent, the recent 30 days' data will be returned.
|
|
154
|
+
* You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
|
|
148
155
|
*
|
|
149
156
|
* Weight: 1
|
|
150
157
|
*
|
|
151
158
|
* @summary Get C2C Trade History (USER_DATA)
|
|
152
159
|
* @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
|
|
160
|
+
*
|
|
153
161
|
* @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
|
|
154
162
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
155
163
|
* @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/c2c.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts","../src/index.ts"],"sourcesContent":["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","{\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\": \"2.0.8\",\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 && tsup\",\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 \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsup\": \"^8.4.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"1.2.5\",\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\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\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 startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [page] Default 1\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n startTime?: number,\n endTime?: number,\n page?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/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 startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 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 *\n * @type {number}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly startTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTime?: number;\n\n /**\n * Default 1\n * @type {number}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly page?: number;\n\n /**\n *\n * @type {number}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly recvWindow?: number;\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 startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 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?.startTime,\n requestParameters?.endTime,\n requestParameters?.page,\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 startTime and endTime is 30 days.\n * If startTime and endTime are not sent, the recent 7 days' data will be returned.\n * The earliest startTime is supported on June 10, 2020\n * Return up to 200 records per request.\n *\n * Weight: 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 * @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","export { C2C, ConfigurationC2C } from './c2c';\nexport * as C2CRestAPI from './rest-api';\n\nexport {\n C2C_REST_API_PROD_URL,\n ConnectorClientError,\n RequiredError,\n UnauthorizedError,\n ForbiddenError,\n TooManyRequestsError,\n RateLimitBanError,\n ServerError,\n NetworkError,\n NotF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AAI,cAAc,YAAY,WAAW,CAAC;AAAA,QAC1C,cAAc;AAAA,MAClB;AACA,WAAK,UAAU,IAAI,QAAQ,aAAa;AAAA,IAC5C;AAAA,EACJ;AACJ;;;AK1BA;AAAA,EACI,yBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;","names":["ConfigurationRestAPI","sendRequest","sendRequest","ConfigurationRestAPI","C2C_REST_API_PROD_URL"]}
|
|
1
|
+
{"version":3,"sources":["../src/c2c.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts","../src/index.ts"],"sourcesContent":["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","{\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\": \"3.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 && tsup\",\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 \"tsup\": \"^8.4.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.0.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\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\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 startTime and endTime is 30 days.\n * If startTime and endTime 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} [startTime]\n * @param {number | bigint} [endTime]\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 startTime?: number | bigint,\n endTime?: 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 (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n\n if (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 startTime and endTime is 30 days.\n * If startTime and endTime 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 startTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTime?: 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 startTime and endTime is 30 days.\n * If startTime and endTime 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?.startTime,\n requestParameters?.endTime,\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 startTime and endTime is 30 days.\n * If startTime and endTime 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","export { C2C, ConfigurationC2C } from './c2c';\nexport * as C2CRestAPI from './rest-api';\n\nexport {\n C2C_REST_API_PROD_URL,\n ConnectorClientError,\n RequiredError,\n UnauthorizedError,\n ForbiddenError,\n TooManyRequestsError,\n RateLimitBanError,\n ServerError,\n NetworkError,\n NotFoundError,\n BadRequestError,\n} from '@binance/common';\n"],"mappings":";;;;;;;AAAA,SAAS,gBAAgB,wBAAAA,uBAAsB,6BAA6B;;;ACCxE,WAAQ;AAER,cAAW;;;ACHf;AAAA;AAAA;AAAA;AAAA;;;ACaA;AAAA,EAII;AAAA,OAEG;AAMP,IAAM,0BAA0B,SAAU,eAAqC;AAC3E,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAoBH,oBAAoB,OAChB,WACA,WACA,SACA,MACA,MACA,eACuB;AACvB,YAAM,yBAAkD,CAAC;AAEzD,UAAI,cAAc,UAAa,cAAc,MAAM;AAC/C,+BAAuB,WAAW,IAAI;AAAA,MAC1C;AAEA,UAAI,cAAc,UAAa,cAAc,MAAM;AAC/C,+BAAuB,WAAW,IAAI;AAAA,MAC1C;AAEA,UAAI,YAAY,UAAa,YAAY,MAAM;AAC3C,+BAAuB,SAAS,IAAI;AAAA,MACxC;AAEA,UAAI,SAAS,UAAa,SAAS,MAAM;AACrC,+BAAuB,MAAM,IAAI;AAAA,MACrC;AAEA,UAAI,SAAS,UAAa,SAAS,MAAM;AACrC,+BAAuB,MAAM,IAAI;AAAA,MACrC;AAEA,UAAI,eAAe,UAAa,eAAe,MAAM;AACjD,+BAAuB,YAAY,IAAI;AAAA,MAC3C;AAEA,UAAI;AACJ,UAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,aAAO;AAAA,QACH,UAAU;AAAA,QACV,QAAQ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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,mBACI,oBAA+C,CAAC,GACI;AACpD,WAAO,KAAK,OAAO,mBAAmB,iBAAiB;AAAA,EAC3D;AACJ;;;AJ5EO,IAAM,MAAN,MAAU;AAAA,EAGb,YAAY,QAA0B;AAClC,UAAM,YAAY,eAAe,MAAM,OAAO;AAE9C,QAAI,QAAQ,sBAAsB;AAC9B,YAAM,gBAAgB,IAAIC;AAAA,QACtB,OAAO;AAAA,MACX;AAGA,oBAAc,WAAW,cAAc,YAAY;AACnD,oBAAc,cAAc,cAAc,eAAe,CAAC;AAC1D,oBAAc,YAAY,UAAU;AAAA,QAChC,GAAI,cAAc,YAAY,WAAW,CAAC;AAAA,QAC1C,cAAc;AAAA,MAClB;AACA,WAAK,UAAU,IAAI,QAAQ,aAAa;AAAA,IAC5C;AAAA,EACJ;AACJ;;;AK1BA;AAAA,EACI,yBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;","names":["ConfigurationRestAPI","sendRequest","sendRequest","ConfigurationRestAPI","C2C_REST_API_PROD_URL"]}
|
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
|
+
"version": "3.0.1",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@types/node": "^20.17.24",
|
|
48
48
|
"eslint": "8.57.0",
|
|
49
49
|
"jest": "^29.6.4",
|
|
50
|
+
"json-with-bigint": "^3.4.4",
|
|
50
51
|
"prettier": "^3.3.3",
|
|
51
52
|
"ts-jest": "^29.1.1",
|
|
52
53
|
"ts-node": "^10.9.1",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
"typescript-eslint": "^8.24.0"
|
|
56
57
|
},
|
|
57
58
|
"dependencies": {
|
|
58
|
-
"@binance/common": "
|
|
59
|
+
"@binance/common": "2.0.0",
|
|
59
60
|
"axios": "^1.7.4"
|
|
60
61
|
}
|
|
61
62
|
}
|