@binance/c2c 1.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/LICENCE +21 -0
- package/README.md +195 -0
- package/dist/index.d.mts +381 -0
- package/dist/index.d.ts +381 -0
- package/dist/index.js +230 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +211 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +55 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name2 in all)
|
|
4
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// src/c2c.ts
|
|
8
|
+
import { platform, arch } from "os";
|
|
9
|
+
import { ConfigurationRestAPI as ConfigurationRestAPI3, C2C_REST_API_PROD_URL } from "@binance/common";
|
|
10
|
+
|
|
11
|
+
// package.json
|
|
12
|
+
var name = "@binance/c2c";
|
|
13
|
+
var version = "1.0.0";
|
|
14
|
+
|
|
15
|
+
// src/rest-api/index.ts
|
|
16
|
+
var rest_api_exports = {};
|
|
17
|
+
__export(rest_api_exports, {
|
|
18
|
+
C2cApi: () => C2cApi,
|
|
19
|
+
RestAPI: () => RestAPI
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// src/rest-api/modules/c2c-api.ts
|
|
23
|
+
import {
|
|
24
|
+
sendRequest
|
|
25
|
+
} from "@binance/common";
|
|
26
|
+
var C2cApiAxiosParamCreator = function(configuration) {
|
|
27
|
+
return {
|
|
28
|
+
/**
|
|
29
|
+
* Get C2C Trade History
|
|
30
|
+
*
|
|
31
|
+
* The max interval between startTime and endTime is 30 days.
|
|
32
|
+
* If startTime and endTime are not sent, the recent 7 days' data will be returned.
|
|
33
|
+
* The earliest startTime is supported on June 10, 2020
|
|
34
|
+
* Return up to 200 records per request.
|
|
35
|
+
*
|
|
36
|
+
* Weight: 1
|
|
37
|
+
*
|
|
38
|
+
* @summary Get C2C Trade History (USER_DATA)
|
|
39
|
+
* @param {number} [startTime]
|
|
40
|
+
* @param {number} [endTime]
|
|
41
|
+
* @param {number} [page] Default 1
|
|
42
|
+
* @param {number} [recvWindow]
|
|
43
|
+
*
|
|
44
|
+
* @throws {RequiredError}
|
|
45
|
+
*/
|
|
46
|
+
getC2CTradeHistory: async (startTime, endTime, page, recvWindow) => {
|
|
47
|
+
const localVarQueryParameter = {};
|
|
48
|
+
if (startTime !== void 0 && startTime !== null) {
|
|
49
|
+
localVarQueryParameter["startTime"] = startTime;
|
|
50
|
+
}
|
|
51
|
+
if (endTime !== void 0 && endTime !== null) {
|
|
52
|
+
localVarQueryParameter["endTime"] = endTime;
|
|
53
|
+
}
|
|
54
|
+
if (page !== void 0 && page !== null) {
|
|
55
|
+
localVarQueryParameter["page"] = page;
|
|
56
|
+
}
|
|
57
|
+
if (recvWindow !== void 0 && recvWindow !== null) {
|
|
58
|
+
localVarQueryParameter["recvWindow"] = recvWindow;
|
|
59
|
+
}
|
|
60
|
+
let _timeUnit;
|
|
61
|
+
if ("timeUnit" in configuration)
|
|
62
|
+
_timeUnit = configuration.timeUnit;
|
|
63
|
+
return {
|
|
64
|
+
endpoint: "/sapi/v1/c2c/orderMatch/listUserOrderHistory",
|
|
65
|
+
method: "GET",
|
|
66
|
+
params: localVarQueryParameter,
|
|
67
|
+
timeUnit: _timeUnit
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
var C2cApi = class {
|
|
73
|
+
constructor(configuration) {
|
|
74
|
+
this.configuration = configuration;
|
|
75
|
+
this.localVarAxiosParamCreator = C2cApiAxiosParamCreator(configuration);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get C2C Trade History
|
|
79
|
+
*
|
|
80
|
+
* The max interval between startTime and endTime is 30 days.
|
|
81
|
+
* If startTime and endTime are not sent, the recent 7 days' data will be returned.
|
|
82
|
+
* The earliest startTime is supported on June 10, 2020
|
|
83
|
+
* Return up to 200 records per request.
|
|
84
|
+
*
|
|
85
|
+
* Weight: 1
|
|
86
|
+
*
|
|
87
|
+
* @summary Get C2C Trade History (USER_DATA)
|
|
88
|
+
* @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
|
|
89
|
+
* @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
|
|
90
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
91
|
+
* @memberof C2cApi
|
|
92
|
+
* @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
|
|
93
|
+
*/
|
|
94
|
+
async getC2CTradeHistory(requestParameters = {}) {
|
|
95
|
+
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(
|
|
96
|
+
requestParameters?.startTime,
|
|
97
|
+
requestParameters?.endTime,
|
|
98
|
+
requestParameters?.page,
|
|
99
|
+
requestParameters?.recvWindow
|
|
100
|
+
);
|
|
101
|
+
return sendRequest(
|
|
102
|
+
this.configuration,
|
|
103
|
+
localVarAxiosArgs.endpoint,
|
|
104
|
+
localVarAxiosArgs.method,
|
|
105
|
+
localVarAxiosArgs.params,
|
|
106
|
+
localVarAxiosArgs?.timeUnit,
|
|
107
|
+
{ isSigned: true }
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// src/rest-api/rest-api.ts
|
|
113
|
+
import { sendRequest as sendRequest2 } from "@binance/common";
|
|
114
|
+
var RestAPI = class {
|
|
115
|
+
constructor(configuration) {
|
|
116
|
+
this.configuration = configuration;
|
|
117
|
+
this.c2cApi = new C2cApi(configuration);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Generic function to send a request.
|
|
121
|
+
* @param endpoint - The API endpoint to call.
|
|
122
|
+
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
123
|
+
* @param params - Query parameters for the request.
|
|
124
|
+
*
|
|
125
|
+
* @returns A promise resolving to the response data object.
|
|
126
|
+
*/
|
|
127
|
+
sendRequest(endpoint, method, params = {}) {
|
|
128
|
+
return sendRequest2(this.configuration, endpoint, method, params, void 0);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Generic function to send a signed request.
|
|
132
|
+
* @param endpoint - The API endpoint to call.
|
|
133
|
+
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
134
|
+
* @param params - Query parameters for the request.
|
|
135
|
+
*
|
|
136
|
+
* @returns A promise resolving to the response data object.
|
|
137
|
+
*/
|
|
138
|
+
sendSignedRequest(endpoint, method, params = {}) {
|
|
139
|
+
return sendRequest2(this.configuration, endpoint, method, params, void 0, {
|
|
140
|
+
isSigned: true
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get C2C Trade History
|
|
145
|
+
*
|
|
146
|
+
* The max interval between startTime and endTime is 30 days.
|
|
147
|
+
* If startTime and endTime are not sent, the recent 7 days' data will be returned.
|
|
148
|
+
* The earliest startTime is supported on June 10, 2020
|
|
149
|
+
* Return up to 200 records per request.
|
|
150
|
+
*
|
|
151
|
+
* Weight: 1
|
|
152
|
+
*
|
|
153
|
+
* @summary Get C2C Trade History (USER_DATA)
|
|
154
|
+
* @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
|
|
155
|
+
* @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
|
|
156
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
157
|
+
* @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
|
|
158
|
+
*/
|
|
159
|
+
getC2CTradeHistory(requestParameters = {}) {
|
|
160
|
+
return this.c2cApi.getC2CTradeHistory(requestParameters);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// src/c2c.ts
|
|
165
|
+
var C2C = class {
|
|
166
|
+
constructor(config) {
|
|
167
|
+
if (config?.configurationRestAPI) {
|
|
168
|
+
const configRestAPI = new ConfigurationRestAPI3(config.configurationRestAPI);
|
|
169
|
+
configRestAPI.basePath = configRestAPI.basePath || C2C_REST_API_PROD_URL;
|
|
170
|
+
configRestAPI.baseOptions = configRestAPI.baseOptions || {};
|
|
171
|
+
configRestAPI.baseOptions.headers = {
|
|
172
|
+
...configRestAPI.baseOptions.headers || {},
|
|
173
|
+
"User-Agent": `${name}/${version} (Node.js/${process.version}; ${platform()}; ${arch()})`
|
|
174
|
+
};
|
|
175
|
+
this.restAPI = new RestAPI(configRestAPI);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// src/index.ts
|
|
181
|
+
import {
|
|
182
|
+
C2C_REST_API_PROD_URL as C2C_REST_API_PROD_URL2,
|
|
183
|
+
C2C_REST_API_TESTNET_URL,
|
|
184
|
+
ConnectorClientError,
|
|
185
|
+
RequiredError,
|
|
186
|
+
UnauthorizedError,
|
|
187
|
+
ForbiddenError,
|
|
188
|
+
TooManyRequestsError,
|
|
189
|
+
RateLimitBanError,
|
|
190
|
+
ServerError,
|
|
191
|
+
NetworkError,
|
|
192
|
+
NotFoundError,
|
|
193
|
+
BadRequestError
|
|
194
|
+
} from "@binance/common";
|
|
195
|
+
export {
|
|
196
|
+
BadRequestError,
|
|
197
|
+
C2C,
|
|
198
|
+
rest_api_exports as C2CRestAPI,
|
|
199
|
+
C2C_REST_API_PROD_URL2 as C2C_REST_API_PROD_URL,
|
|
200
|
+
C2C_REST_API_TESTNET_URL,
|
|
201
|
+
ConnectorClientError,
|
|
202
|
+
ForbiddenError,
|
|
203
|
+
NetworkError,
|
|
204
|
+
NotFoundError,
|
|
205
|
+
RateLimitBanError,
|
|
206
|
+
RequiredError,
|
|
207
|
+
ServerError,
|
|
208
|
+
TooManyRequestsError,
|
|
209
|
+
UnauthorizedError
|
|
210
|
+
};
|
|
211
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/c2c.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/c2c-api.ts","../src/rest-api/rest-api.ts","../src/index.ts"],"sourcesContent":["import { platform, arch } from 'os';\nimport { 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 if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(config.configurationRestAPI);\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': `${name}/${version} (Node.js/${process.version}; ${platform()}; ${arch()})`,\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\": \"1.0.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"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\": \"^7.2.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"1.0.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Public C2C REST API\n *\n * OpenAPI Specification for the Binance Public 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 Public C2C REST API\n *\n * OpenAPI Specification for the Binance Public 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 Public C2C REST API\n *\n * OpenAPI Specification for the Binance Public 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/c2c-api';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/c2c-api';\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 C2C_REST_API_TESTNET_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":"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","names":["ConfigurationRestAPI","sendRequest","sendRequest","ConfigurationRestAPI","C2C_REST_API_PROD_URL"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@binance/c2c",
|
|
3
|
+
"description": "Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"prepublishOnly": "npm run build",
|
|
10
|
+
"build": "tsup",
|
|
11
|
+
"typecheck": "tsc --noEmit",
|
|
12
|
+
"clean": "rm -rf dist",
|
|
13
|
+
"test": "npx jest --maxWorkers=4 --bail",
|
|
14
|
+
"test:watch": "npx jest --watch",
|
|
15
|
+
"format": "npx prettier --ignore-path .prettierignore --write .",
|
|
16
|
+
"lint": "npx eslint '**/*.ts' --fix"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"Binance",
|
|
20
|
+
"API",
|
|
21
|
+
"C2C",
|
|
22
|
+
"Connector",
|
|
23
|
+
"REST",
|
|
24
|
+
"Trading"
|
|
25
|
+
],
|
|
26
|
+
"author": "Binance",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/binance/binance-connector-js.git"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/binance/binance-connector-js/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/binance/binance-connector-js#readme",
|
|
36
|
+
"files": [
|
|
37
|
+
"dist"
|
|
38
|
+
],
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/jest": "^29.5.4",
|
|
41
|
+
"@types/node": "^20.17.24",
|
|
42
|
+
"eslint": "8.57.0",
|
|
43
|
+
"jest": "^29.6.4",
|
|
44
|
+
"prettier": "^3.3.3",
|
|
45
|
+
"ts-jest": "^29.1.1",
|
|
46
|
+
"ts-node": "^10.9.1",
|
|
47
|
+
"tsup": "^7.2.0",
|
|
48
|
+
"typescript": "^5.7.2",
|
|
49
|
+
"typescript-eslint": "^8.24.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@binance/common": "1.0.0",
|
|
53
|
+
"axios": "^1.7.4"
|
|
54
|
+
}
|
|
55
|
+
}
|