@binance/alpha 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.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/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>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","ALPHA_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/alpha.ts"],"sourcesContent":["{\n \"name\": \"@binance/alpha\",\n \"description\": \"Official Binance Alpha Connector - A lightweight library that provides a convenient interface to Binance's Alpha REST API.\",\n \"version\": \"1.0.13\",\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 \"Alpha\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.3.13\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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 AggregatedTradesResponse,\n GetExchangeInfoResponse,\n KlinesResponse,\n TickerResponse,\n TokenListResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @param {number | bigint} [fromId] starting trade ID to fetch from\n * @param {number | bigint} [startTime] start timestamp (milliseconds)\n * @param {number | bigint} [endTime] end timestamp (milliseconds)\n * @param {number | bigint} [limit] number of results to return (default 500, max 1000)\n *\n * @throws {RequiredError}\n */\n aggregatedTrades: async (\n symbol: string,\n fromId?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint,\n limit?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('aggregatedTrades', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (fromId !== undefined && fromId !== null) {\n localVarQueryParameter['fromId'] = fromId;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/agg-trades',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @throws {RequiredError}\n */\n getExchangeInfo: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/get-exchange-info',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @param {string} interval e.g., \"1h\" – supported intervals: 1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M\n * @param {number | bigint} [limit] number of results to return (default 500, max 1000)\n * @param {number | bigint} [startTime] start timestamp (milliseconds)\n * @param {number | bigint} [endTime] end timestamp (milliseconds)\n *\n * @throws {RequiredError}\n */\n klines: async (\n symbol: string,\n interval: string,\n limit?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('klines', 'symbol', symbol);\n // verify required parameter 'interval' is not null or undefined\n assertParamExists('klines', 'interval', interval);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (interval !== undefined && interval !== null) {\n localVarQueryParameter['interval'] = interval;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/klines',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n *\n * @throws {RequiredError}\n */\n ticker: async (symbol: string): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('ticker', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/ticker',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @throws {RequiredError}\n */\n tokenList: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/wallet-direct/buw/wallet/cex/alpha/all/token/list',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>>;\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>>;\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n klines(requestParameters: KlinesRequest): Promise<RestApiResponse<KlinesResponse>>;\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n ticker(requestParameters: TickerRequest): Promise<RestApiResponse<TickerResponse>>;\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n tokenList(): Promise<RestApiResponse<TokenListResponse>>;\n}\n\n/**\n * Request parameters for aggregatedTrades operation in MarketDataApi.\n * @interface AggregatedTradesRequest\n */\nexport interface AggregatedTradesRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly symbol: string;\n\n /**\n * starting trade ID to fetch from\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly fromId?: number | bigint;\n\n /**\n * start timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly startTime?: number | bigint;\n\n /**\n * end timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly endTime?: number | bigint;\n\n /**\n * number of results to return (default 500, max 1000)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly limit?: number | bigint;\n}\n\n/**\n * Request parameters for klines operation in MarketDataApi.\n * @interface KlinesRequest\n */\nexport interface KlinesRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiKlines\n */\n readonly symbol: string;\n\n /**\n * e.g., \"1h\" – supported intervals: 1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M\n * @type {string}\n * @memberof MarketDataApiKlines\n */\n readonly interval: string;\n\n /**\n * number of results to return (default 500, max 1000)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly limit?: number | bigint;\n\n /**\n * start timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly startTime?: number | bigint;\n\n /**\n * end timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly endTime?: number | bigint;\n}\n\n/**\n * Request parameters for ticker operation in MarketDataApi.\n * @interface TickerRequest\n */\nexport interface TickerRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiTicker\n */\n readonly symbol: string;\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 * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}\n */\n public async aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.aggregatedTrades(\n requestParameters?.symbol,\n requestParameters?.fromId,\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.limit\n );\n return sendRequest<AggregatedTradesResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}\n */\n public async getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getExchangeInfo();\n return sendRequest<GetExchangeInfoResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<KlinesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}\n */\n public async klines(\n requestParameters: KlinesRequest\n ): Promise<RestApiResponse<KlinesResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.klines(\n requestParameters?.symbol,\n requestParameters?.interval,\n requestParameters?.limit,\n requestParameters?.startTime,\n requestParameters?.endTime\n );\n return sendRequest<KlinesResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<TickerResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}\n */\n public async ticker(\n requestParameters: TickerRequest\n ): Promise<RestApiResponse<TickerResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.ticker(\n requestParameters?.symbol\n );\n return sendRequest<TickerResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n * @returns {Promise<RestApiResponse<TokenListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}\n */\n public async tokenList(): Promise<RestApiResponse<TokenListResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.tokenList();\n return sendRequest<TokenListResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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';\n\nimport type {\n AggregatedTradesRequest,\n KlinesRequest,\n TickerRequest,\n} from './modules/market-data-api';\n\nimport type {\n AggregatedTradesResponse,\n GetExchangeInfoResponse,\n KlinesResponse,\n TickerResponse,\n TokenListResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}\n */\n aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>> {\n return this.marketDataApi.aggregatedTrades(requestParameters);\n }\n\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}\n */\n getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>> {\n return this.marketDataApi.getExchangeInfo();\n }\n\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<KlinesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}\n */\n klines(requestParameters: KlinesRequest): Promise<RestApiResponse<KlinesResponse>> {\n return this.marketDataApi.klines(requestParameters);\n }\n\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<TickerResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}\n */\n ticker(requestParameters: TickerRequest): Promise<RestApiResponse<TickerResponse>> {\n return this.marketDataApi.ticker(requestParameters);\n }\n\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @returns {Promise<RestApiResponse<TokenListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}\n */\n tokenList(): Promise<RestApiResponse<TokenListResponse>> {\n return this.marketDataApi.tokenList();\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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, ALPHA_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationAlpha {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Alpha {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationAlpha) {\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 || ALPHA_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;;;;;;;;;;;;;;;;;;;AC6Bf,MAAM,iCAAiC,SAAU,eAAqC;AAClF,QAAO;EAeH,kBAAkB,OACd,QACA,QACA,WACA,SACA,UACuB;AAEvB,2CAAkB,oBAAoB,UAAU,OAAO;GAEvD,MAAMA,yBAAkD,EAAE;GAC1D,MAAMC,wBAAiD,EAAE;A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AE/J7C,IAAa,QAAb,MAAmB;CAGf,YAAY,QAA4B;EACpC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","ALPHA_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/alpha.ts"],"sourcesContent":["{\n \"name\": \"@binance/alpha\",\n \"description\": \"Official Binance Alpha Connector - A lightweight library that provides a convenient interface to Binance's Alpha REST API.\",\n \"version\": \"1.0.14\",\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 \"Alpha\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.3.14\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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 AggregatedTradesResponse,\n GetExchangeInfoResponse,\n KlinesResponse,\n TickerResponse,\n TokenListResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @param {number | bigint} [fromId] starting trade ID to fetch from\n * @param {number | bigint} [startTime] start timestamp (milliseconds)\n * @param {number | bigint} [endTime] end timestamp (milliseconds)\n * @param {number | bigint} [limit] number of results to return (default 500, max 1000)\n *\n * @throws {RequiredError}\n */\n aggregatedTrades: async (\n symbol: string,\n fromId?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint,\n limit?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('aggregatedTrades', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (fromId !== undefined && fromId !== null) {\n localVarQueryParameter['fromId'] = fromId;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/agg-trades',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @throws {RequiredError}\n */\n getExchangeInfo: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/get-exchange-info',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @param {string} interval e.g., \"1h\" – supported intervals: 1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M\n * @param {number | bigint} [limit] number of results to return (default 500, max 1000)\n * @param {number | bigint} [startTime] start timestamp (milliseconds)\n * @param {number | bigint} [endTime] end timestamp (milliseconds)\n *\n * @throws {RequiredError}\n */\n klines: async (\n symbol: string,\n interval: string,\n limit?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('klines', 'symbol', symbol);\n // verify required parameter 'interval' is not null or undefined\n assertParamExists('klines', 'interval', interval);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (interval !== undefined && interval !== null) {\n localVarQueryParameter['interval'] = interval;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/klines',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n *\n * @throws {RequiredError}\n */\n ticker: async (symbol: string): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('ticker', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/ticker',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @throws {RequiredError}\n */\n tokenList: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/wallet-direct/buw/wallet/cex/alpha/all/token/list',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>>;\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>>;\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n klines(requestParameters: KlinesRequest): Promise<RestApiResponse<KlinesResponse>>;\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n ticker(requestParameters: TickerRequest): Promise<RestApiResponse<TickerResponse>>;\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n tokenList(): Promise<RestApiResponse<TokenListResponse>>;\n}\n\n/**\n * Request parameters for aggregatedTrades operation in MarketDataApi.\n * @interface AggregatedTradesRequest\n */\nexport interface AggregatedTradesRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly symbol: string;\n\n /**\n * starting trade ID to fetch from\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly fromId?: number | bigint;\n\n /**\n * start timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly startTime?: number | bigint;\n\n /**\n * end timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly endTime?: number | bigint;\n\n /**\n * number of results to return (default 500, max 1000)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly limit?: number | bigint;\n}\n\n/**\n * Request parameters for klines operation in MarketDataApi.\n * @interface KlinesRequest\n */\nexport interface KlinesRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiKlines\n */\n readonly symbol: string;\n\n /**\n * e.g., \"1h\" – supported intervals: 1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M\n * @type {string}\n * @memberof MarketDataApiKlines\n */\n readonly interval: string;\n\n /**\n * number of results to return (default 500, max 1000)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly limit?: number | bigint;\n\n /**\n * start timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly startTime?: number | bigint;\n\n /**\n * end timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly endTime?: number | bigint;\n}\n\n/**\n * Request parameters for ticker operation in MarketDataApi.\n * @interface TickerRequest\n */\nexport interface TickerRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiTicker\n */\n readonly symbol: string;\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 * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}\n */\n public async aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.aggregatedTrades(\n requestParameters?.symbol,\n requestParameters?.fromId,\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.limit\n );\n return sendRequest<AggregatedTradesResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}\n */\n public async getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getExchangeInfo();\n return sendRequest<GetExchangeInfoResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<KlinesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}\n */\n public async klines(\n requestParameters: KlinesRequest\n ): Promise<RestApiResponse<KlinesResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.klines(\n requestParameters?.symbol,\n requestParameters?.interval,\n requestParameters?.limit,\n requestParameters?.startTime,\n requestParameters?.endTime\n );\n return sendRequest<KlinesResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<TickerResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}\n */\n public async ticker(\n requestParameters: TickerRequest\n ): Promise<RestApiResponse<TickerResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.ticker(\n requestParameters?.symbol\n );\n return sendRequest<TickerResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n * @returns {Promise<RestApiResponse<TokenListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}\n */\n public async tokenList(): Promise<RestApiResponse<TokenListResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.tokenList();\n return sendRequest<TokenListResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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';\n\nimport type {\n AggregatedTradesRequest,\n KlinesRequest,\n TickerRequest,\n} from './modules/market-data-api';\n\nimport type {\n AggregatedTradesResponse,\n GetExchangeInfoResponse,\n KlinesResponse,\n TickerResponse,\n TokenListResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}\n */\n aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>> {\n return this.marketDataApi.aggregatedTrades(requestParameters);\n }\n\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}\n */\n getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>> {\n return this.marketDataApi.getExchangeInfo();\n }\n\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<KlinesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}\n */\n klines(requestParameters: KlinesRequest): Promise<RestApiResponse<KlinesResponse>> {\n return this.marketDataApi.klines(requestParameters);\n }\n\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<TickerResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}\n */\n ticker(requestParameters: TickerRequest): Promise<RestApiResponse<TickerResponse>> {\n return this.marketDataApi.ticker(requestParameters);\n }\n\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @returns {Promise<RestApiResponse<TokenListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}\n */\n tokenList(): Promise<RestApiResponse<TokenListResponse>> {\n return this.marketDataApi.tokenList();\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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, ALPHA_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationAlpha {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Alpha {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationAlpha) {\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 || ALPHA_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;;;;;;;;;;;;;;;;;;;AC6Bf,MAAM,iCAAiC,SAAU,eAAqC;AAClF,QAAO;EAeH,kBAAkB,OACd,QACA,QACA,WACA,SACA,UACuB;AAEvB,2CA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O,kBAAkB;;;;;;;;;;;;;CAcvD,YAAyD;AACrD,SAAO,KAAK,cAAc,WAAW;;;;;;;;;;;;;AE/J7C,IAAa,QAAb,MAAmB;CAGf,YAAY,QAA4B;EACpC,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>","_timeUnit: TimeUnit | undefined","ALPHA_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/alpha.ts"],"sourcesContent":["{\n \"name\": \"@binance/alpha\",\n \"description\": \"Official Binance Alpha Connector - A lightweight library that provides a convenient interface to Binance's Alpha REST API.\",\n \"version\": \"1.0.13\",\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 \"Alpha\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.3.13\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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 AggregatedTradesResponse,\n GetExchangeInfoResponse,\n KlinesResponse,\n TickerResponse,\n TokenListResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @param {number | bigint} [fromId] starting trade ID to fetch from\n * @param {number | bigint} [startTime] start timestamp (milliseconds)\n * @param {number | bigint} [endTime] end timestamp (milliseconds)\n * @param {number | bigint} [limit] number of results to return (default 500, max 1000)\n *\n * @throws {RequiredError}\n */\n aggregatedTrades: async (\n symbol: string,\n fromId?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint,\n limit?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('aggregatedTrades', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (fromId !== undefined && fromId !== null) {\n localVarQueryParameter['fromId'] = fromId;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/agg-trades',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @throws {RequiredError}\n */\n getExchangeInfo: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/get-exchange-info',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @param {string} interval e.g., \"1h\" – supported intervals: 1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M\n * @param {number | bigint} [limit] number of results to return (default 500, max 1000)\n * @param {number | bigint} [startTime] start timestamp (milliseconds)\n * @param {number | bigint} [endTime] end timestamp (milliseconds)\n *\n * @throws {RequiredError}\n */\n klines: async (\n symbol: string,\n interval: string,\n limit?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('klines', 'symbol', symbol);\n // verify required parameter 'interval' is not null or undefined\n assertParamExists('klines', 'interval', interval);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (interval !== undefined && interval !== null) {\n localVarQueryParameter['interval'] = interval;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/klines',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n *\n * @throws {RequiredError}\n */\n ticker: async (symbol: string): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('ticker', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/ticker',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @throws {RequiredError}\n */\n tokenList: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/wallet-direct/buw/wallet/cex/alpha/all/token/list',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>>;\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>>;\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n klines(requestParameters: KlinesRequest): Promise<RestApiResponse<KlinesResponse>>;\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n ticker(requestParameters: TickerRequest): Promise<RestApiResponse<TickerResponse>>;\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n tokenList(): Promise<RestApiResponse<TokenListResponse>>;\n}\n\n/**\n * Request parameters for aggregatedTrades operation in MarketDataApi.\n * @interface AggregatedTradesRequest\n */\nexport interface AggregatedTradesRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly symbol: string;\n\n /**\n * starting trade ID to fetch from\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly fromId?: number | bigint;\n\n /**\n * start timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly startTime?: number | bigint;\n\n /**\n * end timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly endTime?: number | bigint;\n\n /**\n * number of results to return (default 500, max 1000)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly limit?: number | bigint;\n}\n\n/**\n * Request parameters for klines operation in MarketDataApi.\n * @interface KlinesRequest\n */\nexport interface KlinesRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiKlines\n */\n readonly symbol: string;\n\n /**\n * e.g., \"1h\" – supported intervals: 1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M\n * @type {string}\n * @memberof MarketDataApiKlines\n */\n readonly interval: string;\n\n /**\n * number of results to return (default 500, max 1000)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly limit?: number | bigint;\n\n /**\n * start timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly startTime?: number | bigint;\n\n /**\n * end timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly endTime?: number | bigint;\n}\n\n/**\n * Request parameters for ticker operation in MarketDataApi.\n * @interface TickerRequest\n */\nexport interface TickerRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiTicker\n */\n readonly symbol: string;\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 * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}\n */\n public async aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.aggregatedTrades(\n requestParameters?.symbol,\n requestParameters?.fromId,\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.limit\n );\n return sendRequest<AggregatedTradesResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}\n */\n public async getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getExchangeInfo();\n return sendRequest<GetExchangeInfoResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<KlinesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}\n */\n public async klines(\n requestParameters: KlinesRequest\n ): Promise<RestApiResponse<KlinesResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.klines(\n requestParameters?.symbol,\n requestParameters?.interval,\n requestParameters?.limit,\n requestParameters?.startTime,\n requestParameters?.endTime\n );\n return sendRequest<KlinesResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<TickerResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}\n */\n public async ticker(\n requestParameters: TickerRequest\n ): Promise<RestApiResponse<TickerResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.ticker(\n requestParameters?.symbol\n );\n return sendRequest<TickerResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n * @returns {Promise<RestApiResponse<TokenListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}\n */\n public async tokenList(): Promise<RestApiResponse<TokenListResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.tokenList();\n return sendRequest<TokenListResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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';\n\nimport type {\n AggregatedTradesRequest,\n KlinesRequest,\n TickerRequest,\n} from './modules/market-data-api';\n\nimport type {\n AggregatedTradesResponse,\n GetExchangeInfoResponse,\n KlinesResponse,\n TickerResponse,\n TokenListResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}\n */\n aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>> {\n return this.marketDataApi.aggregatedTrades(requestParameters);\n }\n\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}\n */\n getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>> {\n return this.marketDataApi.getExchangeInfo();\n }\n\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<KlinesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}\n */\n klines(requestParameters: KlinesRequest): Promise<RestApiResponse<KlinesResponse>> {\n return this.marketDataApi.klines(requestParameters);\n }\n\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<TickerResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}\n */\n ticker(requestParameters: TickerRequest): Promise<RestApiResponse<TickerResponse>> {\n return this.marketDataApi.ticker(requestParameters);\n }\n\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @returns {Promise<RestApiResponse<TokenListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}\n */\n tokenList(): Promise<RestApiResponse<TokenListResponse>> {\n return this.marketDataApi.tokenList();\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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, ALPHA_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationAlpha {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Alpha {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationAlpha) {\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 || ALPHA_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;;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,cAAc,iBAAiB;;;;;;;;;;;;;;CAe/C,OAAO,mBAA4E;AAC/E,SAAO,KAAK,cAAc,OAAO,kBAAkB;;;;;;;;;;;;;;CAevD,OAAO,mBAA4E;AAC/E,SAAO,KAAK,cAAc,OAAO,kBAAkB;;;;;;;;;;;;;CAcvD,YAAyD;AACrD,SAAO,KAAK,cAAc,WAAW;;;;;;;;;;;;;AE/J7C,IAAa,QAAb,MAAmB;CAGf,YAAY,QAA4B;EACpC,MAAM,YAAY,eAAe,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ALPHA_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/alpha.ts"],"sourcesContent":["{\n \"name\": \"@binance/alpha\",\n \"description\": \"Official Binance Alpha Connector - A lightweight library that provides a convenient interface to Binance's Alpha REST API.\",\n \"version\": \"1.0.14\",\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 \"Alpha\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.3.14\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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 AggregatedTradesResponse,\n GetExchangeInfoResponse,\n KlinesResponse,\n TickerResponse,\n TokenListResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @param {number | bigint} [fromId] starting trade ID to fetch from\n * @param {number | bigint} [startTime] start timestamp (milliseconds)\n * @param {number | bigint} [endTime] end timestamp (milliseconds)\n * @param {number | bigint} [limit] number of results to return (default 500, max 1000)\n *\n * @throws {RequiredError}\n */\n aggregatedTrades: async (\n symbol: string,\n fromId?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint,\n limit?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('aggregatedTrades', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (fromId !== undefined && fromId !== null) {\n localVarQueryParameter['fromId'] = fromId;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/agg-trades',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @throws {RequiredError}\n */\n getExchangeInfo: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/get-exchange-info',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @param {string} interval e.g., \"1h\" – supported intervals: 1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M\n * @param {number | bigint} [limit] number of results to return (default 500, max 1000)\n * @param {number | bigint} [startTime] start timestamp (milliseconds)\n * @param {number | bigint} [endTime] end timestamp (milliseconds)\n *\n * @throws {RequiredError}\n */\n klines: async (\n symbol: string,\n interval: string,\n limit?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('klines', 'symbol', symbol);\n // verify required parameter 'interval' is not null or undefined\n assertParamExists('klines', 'interval', interval);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (interval !== undefined && interval !== null) {\n localVarQueryParameter['interval'] = interval;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/klines',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {string} symbol e.g., \"ALPHA_175USDT\" – use token ID from Token List\n *\n * @throws {RequiredError}\n */\n ticker: async (symbol: string): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('ticker', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/alpha-trade/ticker',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @throws {RequiredError}\n */\n tokenList: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/bapi/defi/v1/public/wallet-direct/buw/wallet/cex/alpha/all/token/list',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>>;\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>>;\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n klines(requestParameters: KlinesRequest): Promise<RestApiResponse<KlinesResponse>>;\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n ticker(requestParameters: TickerRequest): Promise<RestApiResponse<TickerResponse>>;\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n tokenList(): Promise<RestApiResponse<TokenListResponse>>;\n}\n\n/**\n * Request parameters for aggregatedTrades operation in MarketDataApi.\n * @interface AggregatedTradesRequest\n */\nexport interface AggregatedTradesRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly symbol: string;\n\n /**\n * starting trade ID to fetch from\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly fromId?: number | bigint;\n\n /**\n * start timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly startTime?: number | bigint;\n\n /**\n * end timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly endTime?: number | bigint;\n\n /**\n * number of results to return (default 500, max 1000)\n * @type {number | bigint}\n * @memberof MarketDataApiAggregatedTrades\n */\n readonly limit?: number | bigint;\n}\n\n/**\n * Request parameters for klines operation in MarketDataApi.\n * @interface KlinesRequest\n */\nexport interface KlinesRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiKlines\n */\n readonly symbol: string;\n\n /**\n * e.g., \"1h\" – supported intervals: 1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M\n * @type {string}\n * @memberof MarketDataApiKlines\n */\n readonly interval: string;\n\n /**\n * number of results to return (default 500, max 1000)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly limit?: number | bigint;\n\n /**\n * start timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly startTime?: number | bigint;\n\n /**\n * end timestamp (milliseconds)\n * @type {number | bigint}\n * @memberof MarketDataApiKlines\n */\n readonly endTime?: number | bigint;\n}\n\n/**\n * Request parameters for ticker operation in MarketDataApi.\n * @interface TickerRequest\n */\nexport interface TickerRequest {\n /**\n * e.g., \"ALPHA_175USDT\" – use token ID from Token List\n * @type {string}\n * @memberof MarketDataApiTicker\n */\n readonly symbol: string;\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 * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}\n */\n public async aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.aggregatedTrades(\n requestParameters?.symbol,\n requestParameters?.fromId,\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.limit\n );\n return sendRequest<AggregatedTradesResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}\n */\n public async getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getExchangeInfo();\n return sendRequest<GetExchangeInfoResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<KlinesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}\n */\n public async klines(\n requestParameters: KlinesRequest\n ): Promise<RestApiResponse<KlinesResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.klines(\n requestParameters?.symbol,\n requestParameters?.interval,\n requestParameters?.limit,\n requestParameters?.startTime,\n requestParameters?.endTime\n );\n return sendRequest<KlinesResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<TickerResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}\n */\n public async ticker(\n requestParameters: TickerRequest\n ): Promise<RestApiResponse<TickerResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.ticker(\n requestParameters?.symbol\n );\n return sendRequest<TickerResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n * @returns {Promise<RestApiResponse<TokenListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}\n */\n public async tokenList(): Promise<RestApiResponse<TokenListResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.tokenList();\n return sendRequest<TokenListResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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';\n\nimport type {\n AggregatedTradesRequest,\n KlinesRequest,\n TickerRequest,\n} from './modules/market-data-api';\n\nimport type {\n AggregatedTradesResponse,\n GetExchangeInfoResponse,\n KlinesResponse,\n TickerResponse,\n TokenListResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.\n *\n * Weight: 0\n *\n * @summary Aggregated Trades\n * @param {AggregatedTradesRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}\n */\n aggregatedTrades(\n requestParameters: AggregatedTradesRequest\n ): Promise<RestApiResponse<AggregatedTradesResponse>> {\n return this.marketDataApi.aggregatedTrades(requestParameters);\n }\n\n /**\n * Fetches general exchange information, such as supported symbols, rate limits, and server time.\n *\n * Weight: 0\n *\n * @summary Get Exchange Info\n *\n * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}\n */\n getExchangeInfo(): Promise<RestApiResponse<GetExchangeInfoResponse>> {\n return this.marketDataApi.getExchangeInfo();\n }\n\n /**\n * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.\n *\n * Weight: 0\n *\n * @summary Klines (Candlestick Data)\n * @param {KlinesRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<KlinesResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}\n */\n klines(requestParameters: KlinesRequest): Promise<RestApiResponse<KlinesResponse>> {\n return this.marketDataApi.klines(requestParameters);\n }\n\n /**\n * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.\n *\n * Weight: 0\n *\n * @summary Ticker (24hr Price Statistics)\n * @param {TickerRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<TickerResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}\n */\n ticker(requestParameters: TickerRequest): Promise<RestApiResponse<TickerResponse>> {\n return this.marketDataApi.ticker(requestParameters);\n }\n\n /**\n * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.\n *\n * Weight: 0\n *\n * @summary Token List\n *\n * @returns {Promise<RestApiResponse<TokenListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}\n */\n tokenList(): Promise<RestApiResponse<TokenListResponse>> {\n return this.marketDataApi.tokenList();\n }\n}\n","/**\n * Binance Alpha REST API\n *\n * OpenAPI Specification for the Binance Alpha 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, ALPHA_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationAlpha {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Alpha {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationAlpha) {\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 || ALPHA_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.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mBACkD;AAClD,SAAO,KAAK,cAAc,iBAAiB,kBAAkB;;;;;;;;;;;;;CAcjE,kBAAqE;AACjE,SAAO,KAAK,cAAc,iBAAiB;;;;;;;;;;;;;;CAe/C,OAAO,mBAA4E;AAC/E,SAAO,KAAK,cAAc,OAAO,kBAAkB;;;;;;;;;;;;;;CAevD,OAAO,mBAA4E;AAC/E,SAAO,KAAK,cAAc,OAAO,kBAAkB;;;;;;;;;;;;;CAcvD,YAAyD;AACrD,SAAO,KAAK,cAAc,WAAW;;;;;;;;;;;;;AE/J7C,IAAa,QAAb,MAAmB;CAGf,YAAY,QAA4B;EACpC,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/alpha",
|
|
3
3
|
"description": "Official Binance Alpha Connector - A lightweight library that provides a convenient interface to Binance's Alpha REST API.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.14",
|
|
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.3.
|
|
59
|
+
"@binance/common": "2.3.14",
|
|
60
60
|
"axios": "^1.7.4"
|
|
61
61
|
}
|
|
62
62
|
}
|