@binance/dual-investment 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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/dual-investment.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/market-data-api.ts","../src/rest-api/modules/trade-api.ts","../src/rest-api/rest-api.ts"],"sourcesContent":["export { DualInvestment, ConfigurationDualInvestment } from './dual-investment';\nexport * as DualInvestmentRestAPI from './rest-api';\n\nexport {\n DUAL_INVESTMENT_REST_API_PROD_URL,\n DUAL_INVESTMENT_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","import { platform, arch } from 'os';\nimport { ConfigurationRestAPI, DUAL_INVESTMENT_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationDualInvestment {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class DualInvestment {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationDualInvestment) {\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(config.configurationRestAPI);\n configRestAPI.basePath = configRestAPI.basePath || DUAL_INVESTMENT_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/dual-investment\",\n \"description\": \"Official Binance Dual Investment Connector - A lightweight library that provides a convenient interface to Binance's Dual Investment 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 \"Dual Investment\",\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 Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Public Dual Investment 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 Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Public Dual Investment 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 assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetDualInvestmentProductListResponse } from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {string} optionType Input CALL or PUT\n * @param {string} exercisedCoin Target exercised asset, e.g.: if you subscribe to a high sell product (call option), you should input: `optionType`:CALL,`exercisedCoin`:USDT,`investCoin`:BNB; if you subscribe to a low buy product (put option), you should input: `optionType`:PUT,`exercisedCoin`:BNB,`investCoin`:USDT\n * @param {string} investCoin Asset used for subscribing, e.g.: if you subscribe to a high sell product (call option), you should input: `optionType`:CALL,`exercisedCoin`:USDT,`investCoin`:BNB; if you subscribe to a low buy product (put option), you should input: `optionType`:PUT,`exercisedCoin`:BNB,`investCoin`:USDT\n * @param {number} [pageSize] Default: 10, Maximum: 100\n * @param {number} [pageIndex] Default: 1\n * @param {number} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentProductList: async (\n optionType: string,\n exercisedCoin: string,\n investCoin: string,\n pageSize?: number,\n pageIndex?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'optionType' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'optionType', optionType);\n // verify required parameter 'exercisedCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'exercisedCoin', exercisedCoin);\n // verify required parameter 'investCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'investCoin', investCoin);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (optionType !== undefined && optionType !== null) {\n localVarQueryParameter['optionType'] = optionType;\n }\n\n if (exercisedCoin !== undefined && exercisedCoin !== null) {\n localVarQueryParameter['exercisedCoin'] = exercisedCoin;\n }\n\n if (investCoin !== undefined && investCoin !== null) {\n localVarQueryParameter['investCoin'] = investCoin;\n }\n\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\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/dci/product/list',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>>;\n}\n\n/**\n * Request parameters for getDualInvestmentProductList operation in MarketDataApi.\n * @interface GetDualInvestmentProductListRequest\n */\nexport interface GetDualInvestmentProductListRequest {\n /**\n * Input CALL or PUT\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly optionType: string;\n\n /**\n * Target exercised asset, e.g.: if you subscribe to a high sell product (call option), you should input: `optionType`:CALL,`exercisedCoin`:USDT,`investCoin`:BNB; if you subscribe to a low buy product (put option), you should input: `optionType`:PUT,`exercisedCoin`:BNB,`investCoin`:USDT\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly exercisedCoin: string;\n\n /**\n * Asset used for subscribing, e.g.: if you subscribe to a high sell product (call option), you should input: `optionType`:CALL,`exercisedCoin`:USDT,`investCoin`:BNB; if you subscribe to a low buy product (put option), you should input: `optionType`:PUT,`exercisedCoin`:BNB,`investCoin`:USDT\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly investCoin: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageSize?: number;\n\n /**\n * Default: 1\n * @type {number}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageIndex?: number;\n\n /**\n * The value cannot be greater than 60000\n * @type {number}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly recvWindow?: number;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n public async getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentProductList(\n requestParameters?.optionType,\n requestParameters?.exercisedCoin,\n requestParameters?.investCoin,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentProductListResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n","/**\n * Binance Public Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Public Dual Investment 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 assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from '../types';\n\n/**\n * TradeApi - axios parameter creator\n */\nconst TradeApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {string} positionId Get positionId from `/sapi/v1/dci/product/positions`\n * @param {string} [autoCompoundPlan]\n * @param {number} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n changeAutoCompoundStatus: async (\n positionId: string,\n autoCompoundPlan?: string,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'positionId' is not null or undefined\n assertParamExists('changeAutoCompoundStatus', 'positionId', positionId);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (positionId !== undefined && positionId !== null) {\n localVarQueryParameter['positionId'] = positionId;\n }\n\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['AutoCompoundPlan'] = autoCompoundPlan;\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/dci/product/auto_compound/edit-status',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {number} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n checkDualInvestmentAccounts: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\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/dci/product/accounts',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {string} [status] `PENDING`:Products are purchasing, will give results later;`PURCHASE_SUCCESS`:purchase successfully;`SETTLED`: Products are finish settling;`PURCHASE_FAIL`:fail to purchase;`REFUNDING`:refund ongoing;`REFUND_SUCCESS`:refund to spot account successfully; `SETTLING`:Products are settling. If don't fill this field, will response all the position status.\n * @param {number} [pageSize] Default: 10, Maximum: 100\n * @param {number} [pageIndex] Default: 1\n * @param {number} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentPositions: async (\n status?: string,\n pageSize?: number,\n pageIndex?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (status !== undefined && status !== null) {\n localVarQueryParameter['status'] = status;\n }\n\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\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/dci/product/positions',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {string} id get id from `/sapi/v1/dci/product/list`\n * @param {string} orderId get orderId from `/sapi/v1/dci/product/list`\n * @param {number} depositAmount the amount for subscribing\n * @param {string} autoCompoundPlan `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @param {number} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n subscribeDualInvestmentProducts: async (\n id: string,\n orderId: string,\n depositAmount: number,\n autoCompoundPlan: string,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'id' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'id', id);\n // verify required parameter 'orderId' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'orderId', orderId);\n // verify required parameter 'depositAmount' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'depositAmount', depositAmount);\n // verify required parameter 'autoCompoundPlan' is not null or undefined\n assertParamExists(\n 'subscribeDualInvestmentProducts',\n 'autoCompoundPlan',\n autoCompoundPlan\n );\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (id !== undefined && id !== null) {\n localVarQueryParameter['id'] = id;\n }\n\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n\n if (depositAmount !== undefined && depositAmount !== null) {\n localVarQueryParameter['depositAmount'] = depositAmount;\n }\n\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['autoCompoundPlan'] = autoCompoundPlan;\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/dci/product/subscribe',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * TradeApi - interface\n * @interface TradeApi\n */\nexport interface TradeApiInterface {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>;\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n checkDualInvestmentAccounts(\n requestParameters?: CheckDualInvestmentAccountsRequest\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>;\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n getDualInvestmentPositions(\n requestParameters?: GetDualInvestmentPositionsRequest\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>;\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>;\n}\n\n/**\n * Request parameters for changeAutoCompoundStatus operation in TradeApi.\n * @interface ChangeAutoCompoundStatusRequest\n */\nexport interface ChangeAutoCompoundStatusRequest {\n /**\n * Get positionId from `/sapi/v1/dci/product/positions`\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly positionId: string;\n\n /**\n *\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly autoCompoundPlan?: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for checkDualInvestmentAccounts operation in TradeApi.\n * @interface CheckDualInvestmentAccountsRequest\n */\nexport interface CheckDualInvestmentAccountsRequest {\n /**\n * The value cannot be greater than 60000\n * @type {number}\n * @memberof TradeApiCheckDualInvestmentAccounts\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getDualInvestmentPositions operation in TradeApi.\n * @interface GetDualInvestmentPositionsRequest\n */\nexport interface GetDualInvestmentPositionsRequest {\n /**\n * `PENDING`:Products are purchasing, will give results later;`PURCHASE_SUCCESS`:purchase successfully;`SETTLED`: Products are finish settling;`PURCHASE_FAIL`:fail to purchase;`REFUNDING`:refund ongoing;`REFUND_SUCCESS`:refund to spot account successfully; `SETTLING`:Products are settling. If don't fill this field, will response all the position status.\n * @type {string}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly status?: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageSize?: number;\n\n /**\n * Default: 1\n * @type {number}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageIndex?: number;\n\n /**\n * The value cannot be greater than 60000\n * @type {number}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for subscribeDualInvestmentProducts operation in TradeApi.\n * @interface SubscribeDualInvestmentProductsRequest\n */\nexport interface SubscribeDualInvestmentProductsRequest {\n /**\n * get id from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly id: string;\n\n /**\n * get orderId from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly orderId: string;\n\n /**\n * the amount for subscribing\n * @type {number}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly depositAmount: number;\n\n /**\n * `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly autoCompoundPlan: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly recvWindow?: number;\n}\n\n/**\n * TradeApi - object-oriented interface\n * @class TradeApi\n */\nexport class TradeApi implements TradeApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n public async changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoCompoundStatus(\n requestParameters?.positionId,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<ChangeAutoCompoundStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n public async checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(\n requestParameters?.recvWindow\n );\n return sendRequest<CheckDualInvestmentAccountsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n public async getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentPositions(\n requestParameters?.status,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentPositionsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n public async subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.subscribeDualInvestmentProducts(\n requestParameters?.id,\n requestParameters?.orderId,\n requestParameters?.depositAmount,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<SubscribeDualInvestmentProductsResponse>(\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 Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Public Dual Investment 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 { MarketDataApi } from './modules/market-data-api';\nimport { TradeApi } from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListRequest } from './modules/market-data-api';\nimport type {\n ChangeAutoCompoundStatusRequest,\n CheckDualInvestmentAccountsRequest,\n GetDualInvestmentPositionsRequest,\n SubscribeDualInvestmentProductsRequest,\n} from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListResponse } from './types';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n private tradeApi: TradeApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n this.tradeApi = new TradeApi(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 Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n return this.marketDataApi.getDualInvestmentProductList(requestParameters);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n return this.tradeApi.changeAutoCompoundStatus(requestParameters);\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n return this.tradeApi.checkDualInvestmentAccounts(requestParameters);\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n return this.tradeApi.getDualInvestmentPositions(requestParameters);\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n return this.tradeApi.subscribeDualInvestmentProducts(requestParameters);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,gBAA+B;AAC/B,IAAAA,iBAAwE;;;ACApE,WAAQ;AAER,cAAW;;;ACHf;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACaA,oBAOO;AAMP,IAAM,iCAAiC,SAAU,eAAqC;AAClF,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBH,8BAA8B,OAC1B,YACA,eACA,YACA,UACA,WACA,eACuB;AAEvB,2CAAkB,gCAAgC,cAAc,UAAU;AAE1E,2CAAkB,gCAAgC,iBAAiB,aAAa;AAEhF,2CAAkB,gCAAgC,cAAc,UAAU;AAE1E,YAAM,yBAAkD,CAAC;AAEzD,UAAI,eAAe,UAAa,eAAe,MAAM;AACjD,+BAAuB,YAAY,IAAI;AAAA,MAC3C;AAEA,UAAI,kBAAkB,UAAa,kBA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AAyB,iBAAiB;AAAA,EACnE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,4BACI,oBAAwD,CAAC,GACI;AAC7D,WAAO,KAAK,SAAS,4BAA4B,iBAAiB;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,2BACI,oBAAuD,CAAC,GACI;AAC5D,WAAO,KAAK,SAAS,2BAA2B,iBAAiB;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,gCACI,mBACiE;AACjE,WAAO,KAAK,SAAS,gCAAgC,iBAAiB;AAAA,EAC1E;AACJ;;;AL5JO,IAAM,iBAAN,MAAqB;AAAA,EAGxB,YAAY,QAAqC;AAC7C,QAAI,QAAQ,sBAAsB;AAC9B,YAAM,gBAAgB,IAAI,oCAAqB,OAAO,oBAAoB;AAC1E,oBAAc,WAAW,cAAc,YAAY;AACnD,oBAAc,cAAc,cAAc,eAAe,CAAC;AAC1D,oBAAc,YAAY,UAAU;AAAA,QAChC,GAAI,cAAc,YAAY,WAAW,CAAC;AAAA,QAC1C,cAAc,GAAG,IAAI,IAAI,OAAO,aAAa,QAAQ,OAAO,SAAK,oBAAS,CAAC,SAAK,gBAAK,CAAC;AAAA,MAC1F;AACA,WAAK,UAAU,IAAI,QAAQ,aAAa;AAAA,IAC5C;AAAA,EACJ;AACJ;;;ADrBA,IAAAC,iBAaO;","names":["import_common","import_common","import_common","import_common"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,547 @@
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/dual-investment.ts
8
+ import { platform, arch } from "os";
9
+ import { ConfigurationRestAPI as ConfigurationRestAPI4, DUAL_INVESTMENT_REST_API_PROD_URL } from "@binance/common";
10
+
11
+ // package.json
12
+ var name = "@binance/dual-investment";
13
+ var version = "1.0.0";
14
+
15
+ // src/rest-api/index.ts
16
+ var rest_api_exports = {};
17
+ __export(rest_api_exports, {
18
+ MarketDataApi: () => MarketDataApi,
19
+ RestAPI: () => RestAPI,
20
+ TradeApi: () => TradeApi
21
+ });
22
+
23
+ // src/rest-api/modules/market-data-api.ts
24
+ import {
25
+ assertParamExists,
26
+ sendRequest
27
+ } from "@binance/common";
28
+ var MarketDataApiAxiosParamCreator = function(configuration) {
29
+ return {
30
+ /**
31
+ * Get Dual Investment product list
32
+ *
33
+ * Weight: 1(IP)
34
+ *
35
+ * @summary Get Dual Investment product list
36
+ * @param {string} optionType Input CALL or PUT
37
+ * @param {string} exercisedCoin Target exercised asset, e.g.: if you subscribe to a high sell product (call option), you should input: `optionType`:CALL,`exercisedCoin`:USDT,`investCoin`:BNB; if you subscribe to a low buy product (put option), you should input: `optionType`:PUT,`exercisedCoin`:BNB,`investCoin`:USDT
38
+ * @param {string} investCoin Asset used for subscribing, e.g.: if you subscribe to a high sell product (call option), you should input: `optionType`:CALL,`exercisedCoin`:USDT,`investCoin`:BNB; if you subscribe to a low buy product (put option), you should input: `optionType`:PUT,`exercisedCoin`:BNB,`investCoin`:USDT
39
+ * @param {number} [pageSize] Default: 10, Maximum: 100
40
+ * @param {number} [pageIndex] Default: 1
41
+ * @param {number} [recvWindow] The value cannot be greater than 60000
42
+ *
43
+ * @throws {RequiredError}
44
+ */
45
+ getDualInvestmentProductList: async (optionType, exercisedCoin, investCoin, pageSize, pageIndex, recvWindow) => {
46
+ assertParamExists("getDualInvestmentProductList", "optionType", optionType);
47
+ assertParamExists("getDualInvestmentProductList", "exercisedCoin", exercisedCoin);
48
+ assertParamExists("getDualInvestmentProductList", "investCoin", investCoin);
49
+ const localVarQueryParameter = {};
50
+ if (optionType !== void 0 && optionType !== null) {
51
+ localVarQueryParameter["optionType"] = optionType;
52
+ }
53
+ if (exercisedCoin !== void 0 && exercisedCoin !== null) {
54
+ localVarQueryParameter["exercisedCoin"] = exercisedCoin;
55
+ }
56
+ if (investCoin !== void 0 && investCoin !== null) {
57
+ localVarQueryParameter["investCoin"] = investCoin;
58
+ }
59
+ if (pageSize !== void 0 && pageSize !== null) {
60
+ localVarQueryParameter["pageSize"] = pageSize;
61
+ }
62
+ if (pageIndex !== void 0 && pageIndex !== null) {
63
+ localVarQueryParameter["pageIndex"] = pageIndex;
64
+ }
65
+ if (recvWindow !== void 0 && recvWindow !== null) {
66
+ localVarQueryParameter["recvWindow"] = recvWindow;
67
+ }
68
+ let _timeUnit;
69
+ if ("timeUnit" in configuration)
70
+ _timeUnit = configuration.timeUnit;
71
+ return {
72
+ endpoint: "/sapi/v1/dci/product/list",
73
+ method: "GET",
74
+ params: localVarQueryParameter,
75
+ timeUnit: _timeUnit
76
+ };
77
+ }
78
+ };
79
+ };
80
+ var MarketDataApi = class {
81
+ constructor(configuration) {
82
+ this.configuration = configuration;
83
+ this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);
84
+ }
85
+ /**
86
+ * Get Dual Investment product list
87
+ *
88
+ * Weight: 1(IP)
89
+ *
90
+ * @summary Get Dual Investment product list
91
+ * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.
92
+ * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}
93
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
94
+ * @memberof MarketDataApi
95
+ * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}
96
+ */
97
+ async getDualInvestmentProductList(requestParameters) {
98
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentProductList(
99
+ requestParameters?.optionType,
100
+ requestParameters?.exercisedCoin,
101
+ requestParameters?.investCoin,
102
+ requestParameters?.pageSize,
103
+ requestParameters?.pageIndex,
104
+ requestParameters?.recvWindow
105
+ );
106
+ return sendRequest(
107
+ this.configuration,
108
+ localVarAxiosArgs.endpoint,
109
+ localVarAxiosArgs.method,
110
+ localVarAxiosArgs.params,
111
+ localVarAxiosArgs?.timeUnit,
112
+ { isSigned: false }
113
+ );
114
+ }
115
+ };
116
+
117
+ // src/rest-api/modules/trade-api.ts
118
+ import {
119
+ assertParamExists as assertParamExists2,
120
+ sendRequest as sendRequest2
121
+ } from "@binance/common";
122
+ var TradeApiAxiosParamCreator = function(configuration) {
123
+ return {
124
+ /**
125
+ * Change Auto-Compound status
126
+ *
127
+ * Weight: 1(IP)
128
+ *
129
+ * @summary Change Auto-Compound status(USER_DATA)
130
+ * @param {string} positionId Get positionId from `/sapi/v1/dci/product/positions`
131
+ * @param {string} [autoCompoundPlan]
132
+ * @param {number} [recvWindow] The value cannot be greater than 60000
133
+ *
134
+ * @throws {RequiredError}
135
+ */
136
+ changeAutoCompoundStatus: async (positionId, autoCompoundPlan, recvWindow) => {
137
+ assertParamExists2("changeAutoCompoundStatus", "positionId", positionId);
138
+ const localVarQueryParameter = {};
139
+ if (positionId !== void 0 && positionId !== null) {
140
+ localVarQueryParameter["positionId"] = positionId;
141
+ }
142
+ if (autoCompoundPlan !== void 0 && autoCompoundPlan !== null) {
143
+ localVarQueryParameter["AutoCompoundPlan"] = autoCompoundPlan;
144
+ }
145
+ if (recvWindow !== void 0 && recvWindow !== null) {
146
+ localVarQueryParameter["recvWindow"] = recvWindow;
147
+ }
148
+ let _timeUnit;
149
+ if ("timeUnit" in configuration)
150
+ _timeUnit = configuration.timeUnit;
151
+ return {
152
+ endpoint: "/sapi/v1/dci/product/auto_compound/edit-status",
153
+ method: "POST",
154
+ params: localVarQueryParameter,
155
+ timeUnit: _timeUnit
156
+ };
157
+ },
158
+ /**
159
+ * Check Dual Investment accounts
160
+ *
161
+ * Weight: 1(IP)
162
+ *
163
+ * @summary Check Dual Investment accounts(USER_DATA)
164
+ * @param {number} [recvWindow] The value cannot be greater than 60000
165
+ *
166
+ * @throws {RequiredError}
167
+ */
168
+ checkDualInvestmentAccounts: async (recvWindow) => {
169
+ const localVarQueryParameter = {};
170
+ if (recvWindow !== void 0 && recvWindow !== null) {
171
+ localVarQueryParameter["recvWindow"] = recvWindow;
172
+ }
173
+ let _timeUnit;
174
+ if ("timeUnit" in configuration)
175
+ _timeUnit = configuration.timeUnit;
176
+ return {
177
+ endpoint: "/sapi/v1/dci/product/accounts",
178
+ method: "GET",
179
+ params: localVarQueryParameter,
180
+ timeUnit: _timeUnit
181
+ };
182
+ },
183
+ /**
184
+ * Get Dual Investment positions (batch)
185
+ *
186
+ * Weight: 1(IP)
187
+ *
188
+ * @summary Get Dual Investment positions(USER_DATA)
189
+ * @param {string} [status] `PENDING`:Products are purchasing, will give results later;`PURCHASE_SUCCESS`:purchase successfully;`SETTLED`: Products are finish settling;`PURCHASE_FAIL`:fail to purchase;`REFUNDING`:refund ongoing;`REFUND_SUCCESS`:refund to spot account successfully; `SETTLING`:Products are settling. If don't fill this field, will response all the position status.
190
+ * @param {number} [pageSize] Default: 10, Maximum: 100
191
+ * @param {number} [pageIndex] Default: 1
192
+ * @param {number} [recvWindow] The value cannot be greater than 60000
193
+ *
194
+ * @throws {RequiredError}
195
+ */
196
+ getDualInvestmentPositions: async (status, pageSize, pageIndex, recvWindow) => {
197
+ const localVarQueryParameter = {};
198
+ if (status !== void 0 && status !== null) {
199
+ localVarQueryParameter["status"] = status;
200
+ }
201
+ if (pageSize !== void 0 && pageSize !== null) {
202
+ localVarQueryParameter["pageSize"] = pageSize;
203
+ }
204
+ if (pageIndex !== void 0 && pageIndex !== null) {
205
+ localVarQueryParameter["pageIndex"] = pageIndex;
206
+ }
207
+ if (recvWindow !== void 0 && recvWindow !== null) {
208
+ localVarQueryParameter["recvWindow"] = recvWindow;
209
+ }
210
+ let _timeUnit;
211
+ if ("timeUnit" in configuration)
212
+ _timeUnit = configuration.timeUnit;
213
+ return {
214
+ endpoint: "/sapi/v1/dci/product/positions",
215
+ method: "GET",
216
+ params: localVarQueryParameter,
217
+ timeUnit: _timeUnit
218
+ };
219
+ },
220
+ /**
221
+ * Subscribe Dual Investment products
222
+ *
223
+ * Products are not available. // this means APR changes to lower value, or orders are not unavailable.
224
+ * Failed. This means System or network errors.
225
+ *
226
+ * Weight: 1(IP)
227
+ *
228
+ * @summary Subscribe Dual Investment products(USER_DATA)
229
+ * @param {string} id get id from `/sapi/v1/dci/product/list`
230
+ * @param {string} orderId get orderId from `/sapi/v1/dci/product/list`
231
+ * @param {number} depositAmount the amount for subscribing
232
+ * @param {string} autoCompoundPlan `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan
233
+ * @param {number} [recvWindow] The value cannot be greater than 60000
234
+ *
235
+ * @throws {RequiredError}
236
+ */
237
+ subscribeDualInvestmentProducts: async (id, orderId, depositAmount, autoCompoundPlan, recvWindow) => {
238
+ assertParamExists2("subscribeDualInvestmentProducts", "id", id);
239
+ assertParamExists2("subscribeDualInvestmentProducts", "orderId", orderId);
240
+ assertParamExists2("subscribeDualInvestmentProducts", "depositAmount", depositAmount);
241
+ assertParamExists2(
242
+ "subscribeDualInvestmentProducts",
243
+ "autoCompoundPlan",
244
+ autoCompoundPlan
245
+ );
246
+ const localVarQueryParameter = {};
247
+ if (id !== void 0 && id !== null) {
248
+ localVarQueryParameter["id"] = id;
249
+ }
250
+ if (orderId !== void 0 && orderId !== null) {
251
+ localVarQueryParameter["orderId"] = orderId;
252
+ }
253
+ if (depositAmount !== void 0 && depositAmount !== null) {
254
+ localVarQueryParameter["depositAmount"] = depositAmount;
255
+ }
256
+ if (autoCompoundPlan !== void 0 && autoCompoundPlan !== null) {
257
+ localVarQueryParameter["autoCompoundPlan"] = autoCompoundPlan;
258
+ }
259
+ if (recvWindow !== void 0 && recvWindow !== null) {
260
+ localVarQueryParameter["recvWindow"] = recvWindow;
261
+ }
262
+ let _timeUnit;
263
+ if ("timeUnit" in configuration)
264
+ _timeUnit = configuration.timeUnit;
265
+ return {
266
+ endpoint: "/sapi/v1/dci/product/subscribe",
267
+ method: "POST",
268
+ params: localVarQueryParameter,
269
+ timeUnit: _timeUnit
270
+ };
271
+ }
272
+ };
273
+ };
274
+ var TradeApi = class {
275
+ constructor(configuration) {
276
+ this.configuration = configuration;
277
+ this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);
278
+ }
279
+ /**
280
+ * Change Auto-Compound status
281
+ *
282
+ * Weight: 1(IP)
283
+ *
284
+ * @summary Change Auto-Compound status(USER_DATA)
285
+ * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.
286
+ * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}
287
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
288
+ * @memberof TradeApi
289
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}
290
+ */
291
+ async changeAutoCompoundStatus(requestParameters) {
292
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoCompoundStatus(
293
+ requestParameters?.positionId,
294
+ requestParameters?.autoCompoundPlan,
295
+ requestParameters?.recvWindow
296
+ );
297
+ return sendRequest2(
298
+ this.configuration,
299
+ localVarAxiosArgs.endpoint,
300
+ localVarAxiosArgs.method,
301
+ localVarAxiosArgs.params,
302
+ localVarAxiosArgs?.timeUnit,
303
+ { isSigned: true }
304
+ );
305
+ }
306
+ /**
307
+ * Check Dual Investment accounts
308
+ *
309
+ * Weight: 1(IP)
310
+ *
311
+ * @summary Check Dual Investment accounts(USER_DATA)
312
+ * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.
313
+ * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}
314
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
315
+ * @memberof TradeApi
316
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}
317
+ */
318
+ async checkDualInvestmentAccounts(requestParameters = {}) {
319
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(
320
+ requestParameters?.recvWindow
321
+ );
322
+ return sendRequest2(
323
+ this.configuration,
324
+ localVarAxiosArgs.endpoint,
325
+ localVarAxiosArgs.method,
326
+ localVarAxiosArgs.params,
327
+ localVarAxiosArgs?.timeUnit,
328
+ { isSigned: true }
329
+ );
330
+ }
331
+ /**
332
+ * Get Dual Investment positions (batch)
333
+ *
334
+ * Weight: 1(IP)
335
+ *
336
+ * @summary Get Dual Investment positions(USER_DATA)
337
+ * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.
338
+ * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}
339
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
340
+ * @memberof TradeApi
341
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}
342
+ */
343
+ async getDualInvestmentPositions(requestParameters = {}) {
344
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentPositions(
345
+ requestParameters?.status,
346
+ requestParameters?.pageSize,
347
+ requestParameters?.pageIndex,
348
+ requestParameters?.recvWindow
349
+ );
350
+ return sendRequest2(
351
+ this.configuration,
352
+ localVarAxiosArgs.endpoint,
353
+ localVarAxiosArgs.method,
354
+ localVarAxiosArgs.params,
355
+ localVarAxiosArgs?.timeUnit,
356
+ { isSigned: true }
357
+ );
358
+ }
359
+ /**
360
+ * Subscribe Dual Investment products
361
+ *
362
+ * Products are not available. // this means APR changes to lower value, or orders are not unavailable.
363
+ * Failed. This means System or network errors.
364
+ *
365
+ * Weight: 1(IP)
366
+ *
367
+ * @summary Subscribe Dual Investment products(USER_DATA)
368
+ * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.
369
+ * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}
370
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
371
+ * @memberof TradeApi
372
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}
373
+ */
374
+ async subscribeDualInvestmentProducts(requestParameters) {
375
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.subscribeDualInvestmentProducts(
376
+ requestParameters?.id,
377
+ requestParameters?.orderId,
378
+ requestParameters?.depositAmount,
379
+ requestParameters?.autoCompoundPlan,
380
+ requestParameters?.recvWindow
381
+ );
382
+ return sendRequest2(
383
+ this.configuration,
384
+ localVarAxiosArgs.endpoint,
385
+ localVarAxiosArgs.method,
386
+ localVarAxiosArgs.params,
387
+ localVarAxiosArgs?.timeUnit,
388
+ { isSigned: true }
389
+ );
390
+ }
391
+ };
392
+
393
+ // src/rest-api/rest-api.ts
394
+ import { sendRequest as sendRequest3 } from "@binance/common";
395
+ var RestAPI = class {
396
+ constructor(configuration) {
397
+ this.configuration = configuration;
398
+ this.marketDataApi = new MarketDataApi(configuration);
399
+ this.tradeApi = new TradeApi(configuration);
400
+ }
401
+ /**
402
+ * Generic function to send a request.
403
+ * @param endpoint - The API endpoint to call.
404
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
405
+ * @param params - Query parameters for the request.
406
+ *
407
+ * @returns A promise resolving to the response data object.
408
+ */
409
+ sendRequest(endpoint, method, params = {}) {
410
+ return sendRequest3(this.configuration, endpoint, method, params, void 0);
411
+ }
412
+ /**
413
+ * Generic function to send a signed request.
414
+ * @param endpoint - The API endpoint to call.
415
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
416
+ * @param params - Query parameters for the request.
417
+ *
418
+ * @returns A promise resolving to the response data object.
419
+ */
420
+ sendSignedRequest(endpoint, method, params = {}) {
421
+ return sendRequest3(this.configuration, endpoint, method, params, void 0, {
422
+ isSigned: true
423
+ });
424
+ }
425
+ /**
426
+ * Get Dual Investment product list
427
+ *
428
+ * Weight: 1(IP)
429
+ *
430
+ * @summary Get Dual Investment product list
431
+ * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.
432
+ * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}
433
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
434
+ * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}
435
+ */
436
+ getDualInvestmentProductList(requestParameters) {
437
+ return this.marketDataApi.getDualInvestmentProductList(requestParameters);
438
+ }
439
+ /**
440
+ * Change Auto-Compound status
441
+ *
442
+ * Weight: 1(IP)
443
+ *
444
+ * @summary Change Auto-Compound status(USER_DATA)
445
+ * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.
446
+ * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}
447
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
448
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}
449
+ */
450
+ changeAutoCompoundStatus(requestParameters) {
451
+ return this.tradeApi.changeAutoCompoundStatus(requestParameters);
452
+ }
453
+ /**
454
+ * Check Dual Investment accounts
455
+ *
456
+ * Weight: 1(IP)
457
+ *
458
+ * @summary Check Dual Investment accounts(USER_DATA)
459
+ * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.
460
+ * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}
461
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
462
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}
463
+ */
464
+ checkDualInvestmentAccounts(requestParameters = {}) {
465
+ return this.tradeApi.checkDualInvestmentAccounts(requestParameters);
466
+ }
467
+ /**
468
+ * Get Dual Investment positions (batch)
469
+ *
470
+ * Weight: 1(IP)
471
+ *
472
+ * @summary Get Dual Investment positions(USER_DATA)
473
+ * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.
474
+ * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}
475
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
476
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}
477
+ */
478
+ getDualInvestmentPositions(requestParameters = {}) {
479
+ return this.tradeApi.getDualInvestmentPositions(requestParameters);
480
+ }
481
+ /**
482
+ * Subscribe Dual Investment products
483
+ *
484
+ * Products are not available. // this means APR changes to lower value, or orders are not unavailable.
485
+ * Failed. This means System or network errors.
486
+ *
487
+ * Weight: 1(IP)
488
+ *
489
+ * @summary Subscribe Dual Investment products(USER_DATA)
490
+ * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.
491
+ * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}
492
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
493
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}
494
+ */
495
+ subscribeDualInvestmentProducts(requestParameters) {
496
+ return this.tradeApi.subscribeDualInvestmentProducts(requestParameters);
497
+ }
498
+ };
499
+
500
+ // src/dual-investment.ts
501
+ var DualInvestment = class {
502
+ constructor(config) {
503
+ if (config?.configurationRestAPI) {
504
+ const configRestAPI = new ConfigurationRestAPI4(config.configurationRestAPI);
505
+ configRestAPI.basePath = configRestAPI.basePath || DUAL_INVESTMENT_REST_API_PROD_URL;
506
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
507
+ configRestAPI.baseOptions.headers = {
508
+ ...configRestAPI.baseOptions.headers || {},
509
+ "User-Agent": `${name}/${version} (Node.js/${process.version}; ${platform()}; ${arch()})`
510
+ };
511
+ this.restAPI = new RestAPI(configRestAPI);
512
+ }
513
+ }
514
+ };
515
+
516
+ // src/index.ts
517
+ import {
518
+ DUAL_INVESTMENT_REST_API_PROD_URL as DUAL_INVESTMENT_REST_API_PROD_URL2,
519
+ DUAL_INVESTMENT_REST_API_TESTNET_URL,
520
+ ConnectorClientError,
521
+ RequiredError,
522
+ UnauthorizedError,
523
+ ForbiddenError,
524
+ TooManyRequestsError,
525
+ RateLimitBanError,
526
+ ServerError,
527
+ NetworkError,
528
+ NotFoundError,
529
+ BadRequestError
530
+ } from "@binance/common";
531
+ export {
532
+ BadRequestError,
533
+ ConnectorClientError,
534
+ DUAL_INVESTMENT_REST_API_PROD_URL2 as DUAL_INVESTMENT_REST_API_PROD_URL,
535
+ DUAL_INVESTMENT_REST_API_TESTNET_URL,
536
+ DualInvestment,
537
+ rest_api_exports as DualInvestmentRestAPI,
538
+ ForbiddenError,
539
+ NetworkError,
540
+ NotFoundError,
541
+ RateLimitBanError,
542
+ RequiredError,
543
+ ServerError,
544
+ TooManyRequestsError,
545
+ UnauthorizedError
546
+ };
547
+ //# sourceMappingURL=index.mjs.map