@binance/c2c 6.0.0 → 6.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/README.md +13 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -176,6 +176,19 @@ Please ensure that all tests pass if you're making a direct contribution. Submit
|
|
|
176
176
|
|
|
177
177
|
Thank you for your contributions!
|
|
178
178
|
|
|
179
|
+
## Disclaimer
|
|
180
|
+
|
|
181
|
+
This SDK is provided by Binance on an "as is" and "as available" basis for use at your own risk. Binance makes no representations or warranties of any kind, whether express or implied, as to the operation of the SDK, its accuracy, reliability, completeness, or fitness for any particular purpose.
|
|
182
|
+
|
|
183
|
+
To the fullest extent permitted by law, Binance shall not be liable for any losses, damages, or expenses of any kind arising from or in connection with your use of, or inability to use, this SDK, including but not limited to any financial losses resulting from errors, bugs, interruptions, or inaccuracies in the SDK.
|
|
184
|
+
|
|
185
|
+
Your use of this SDK to access the Binance Platform is subject to the Binance API Key Terms and the Binance Terms of Use, which shall prevail in the event of any conflict with this disclaimer. You are solely responsible for any orders or transactions executed through the Binance Platform using this SDK.
|
|
186
|
+
|
|
187
|
+
This SDK is not intended to constitute investment advice or a recommendation to buy, sell, or hold any digital asset. You should independently evaluate and verify all information before acting.
|
|
188
|
+
|
|
189
|
+
- [Binance Terms of Use](https://www.binance.com/en/terms)
|
|
190
|
+
- [Binance API Key Terms](https://www.binance.com/en/about-legal/terms-binance-api)
|
|
191
|
+
|
|
179
192
|
## Licence
|
|
180
193
|
|
|
181
194
|
This project is licensed under the MIT License. See the [LICENCE](./LICENCE) file for details.
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"6.0.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"C2C\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.5.8\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.3\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the 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 */\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * Api - axios parameter creator\n */\nconst ApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryTradeTypeEnum} [tradeType] Trade side filter\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Page number\n * @param {number | bigint} [rows] Number of records per page\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: GetC2CTradeHistoryTradeTypeEnum,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * Api - interface\n * @interface Api\n */\nexport interface ApiInterface {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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 ApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in Api.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * Trade side filter\n * @type {'BUY' | 'SELL'}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly tradeType?: GetC2CTradeHistoryTradeTypeEnum;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Page number\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * Number of records per page\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n}\n\n/**\n * Api - object-oriented interface\n * @class Api\n */\nexport class Api implements ApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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 Api\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n\nexport enum GetC2CTradeHistoryTradeTypeEnum {\n BUY = 'BUY',\n SELL = 'SELL',\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the 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 { Api } from './modules/api';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/api';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private api: Api;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.api = new Api(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.api.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || C2C_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACqBf,MAAM,uBAAuB,SAAU,eAAqC;AACxE,QAAO,EAsBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,SACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;EAGrC,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AA4EL,IAAa,MAAb,MAAyC;CAIrC,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;;;CAsBxE,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,KACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,OAAO,CACtB;;;AAIT,IAAY,8FAAL;AACH;AACA;;;;;;;;;;;;;;;;;;ACnMJ,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,MAAM,IAAI,IAAI,cAAc;;;;;;;;;;;CAYrC,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;;CAsBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,IAAI,mBAAmB,kBAAkB;;;;;;;;;;;;;;AEhG7D,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"6.0.1\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"C2C\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.5.8\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.5\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the 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 */\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * Api - axios parameter creator\n */\nconst ApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryTradeTypeEnum} [tradeType] Trade side filter\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Page number\n * @param {number | bigint} [rows] Number of records per page\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: GetC2CTradeHistoryTradeTypeEnum,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * Api - interface\n * @interface Api\n */\nexport interface ApiInterface {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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 ApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in Api.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * Trade side filter\n * @type {'BUY' | 'SELL'}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly tradeType?: GetC2CTradeHistoryTradeTypeEnum;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Page number\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * Number of records per page\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n}\n\n/**\n * Api - object-oriented interface\n * @class Api\n */\nexport class Api implements ApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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 Api\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n\nexport enum GetC2CTradeHistoryTradeTypeEnum {\n BUY = 'BUY',\n SELL = 'SELL',\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the 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 { Api } from './modules/api';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/api';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private api: Api;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.api = new Api(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.api.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || C2C_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACqBf,MAAM,uBAAuB,SAAU,eAAqC;AACxE,QAAO,EAsBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,SACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;EAGrC,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AA4EL,IAAa,MAAb,MAAyC;CAIrC,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;;;CAsBxE,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,KACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,OAAO,CACtB;;;AAIT,IAAY,8FAAL;AACH;AACA;;;;;;;;;;;;;;;;;;ACnMJ,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,MAAM,IAAI,IAAI,cAAc;;;;;;;;;;;CAYrC,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;;CAsBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,IAAI,mBAAmB,kBAAkB;;;;;;;;;;;;;;AEhG7D,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"6.0.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"C2C\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.5.8\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.3\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the 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 */\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * Api - axios parameter creator\n */\nconst ApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryTradeTypeEnum} [tradeType] Trade side filter\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Page number\n * @param {number | bigint} [rows] Number of records per page\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: GetC2CTradeHistoryTradeTypeEnum,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * Api - interface\n * @interface Api\n */\nexport interface ApiInterface {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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 ApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in Api.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * Trade side filter\n * @type {'BUY' | 'SELL'}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly tradeType?: GetC2CTradeHistoryTradeTypeEnum;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Page number\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * Number of records per page\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n}\n\n/**\n * Api - object-oriented interface\n * @class Api\n */\nexport class Api implements ApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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 Api\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n\nexport enum GetC2CTradeHistoryTradeTypeEnum {\n BUY = 'BUY',\n SELL = 'SELL',\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the 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 { Api } from './modules/api';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/api';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private api: Api;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.api = new Api(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.api.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || C2C_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACqBf,MAAM,uBAAuB,SAAU,eAAqC;AACxE,QAAO,EAsBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,SACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;EAGrC,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AA4EL,IAAa,MAAb,MAAyC;CAIrC,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;;;CAsBxE,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,KACtB;AACD,SAAO,YACH,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,OAAO,CACtB;;;AAIT,IAAY,8FAAL;AACH;AACA;;;;;;;;;;;;;;;;;;ACnMJ,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,MAAM,IAAI,IAAI,cAAc;;;;;;;;;;;CAYrC,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;;CAsBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,IAAI,mBAAmB,kBAAkB;;;;;;;;;;;;;;AEhG7D,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,MAAM,YAAY,eAAe,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"6.0.1\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"C2C\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.5.8\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.5\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the 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 */\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * Api - axios parameter creator\n */\nconst ApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryTradeTypeEnum} [tradeType] Trade side filter\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Page number\n * @param {number | bigint} [rows] Number of records per page\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: GetC2CTradeHistoryTradeTypeEnum,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * Api - interface\n * @interface Api\n */\nexport interface ApiInterface {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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 ApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in Api.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * Trade side filter\n * @type {'BUY' | 'SELL'}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly tradeType?: GetC2CTradeHistoryTradeTypeEnum;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Page number\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * Number of records per page\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n}\n\n/**\n * Api - object-oriented interface\n * @class Api\n */\nexport class Api implements ApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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 Api\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n\nexport enum GetC2CTradeHistoryTradeTypeEnum {\n BUY = 'BUY',\n SELL = 'SELL',\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the 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 { Api } from './modules/api';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/api';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private api: Api;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.api = new Api(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\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/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.api.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || C2C_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACqBf,MAAM,uBAAuB,SAAU,eAAqC;AACxE,QAAO,EAsBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,SACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;EAGrC,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AA4EL,IAAa,MAAb,MAAyC;CAIrC,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;;;CAsBxE,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,KACtB;AACD,SAAO,YACH,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,OAAO,CACtB;;;AAIT,IAAY,8FAAL;AACH;AACA;;;;;;;;;;;;;;;;;;ACnMJ,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,MAAM,IAAI,IAAI,cAAc;;;;;;;;;;;CAYrC,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;;CAsBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,IAAI,mBAAmB,kBAAkB;;;;;;;;;;;;;;AEhG7D,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,MAAM,YAAY,eAAe,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@binance/c2c",
|
|
3
3
|
"description": "Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.1",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typescript-eslint": "^8.24.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@binance/common": "2.4.
|
|
59
|
+
"@binance/common": "2.4.5",
|
|
60
60
|
"axios": "^1.7.4"
|
|
61
61
|
}
|
|
62
62
|
}
|