@binance/staking
Version:
Official Binance Staking Connector - A lightweight library that provides a convenient interface to Binance's Staking REST API.
1 lines • 270 kB
Source Map (JSON)
{"version":3,"sources":["../src/staking.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/eth-staking-api.ts","../src/rest-api/modules/on-chain-yields-api.ts","../src/rest-api/modules/sol-staking-api.ts","../src/rest-api/rest-api.ts","../src/index.ts"],"sourcesContent":["import { buildUserAgent, ConfigurationRestAPI, STAKING_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationStaking {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Staking {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationStaking) {\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 || STAKING_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n","{\n \"name\": \"@binance/staking\",\n \"description\": \"Official Binance Staking Connector - A lightweight library that provides a convenient interface to Binance's Staking REST API.\",\n \"version\": \"3.0.2\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsup\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Staking\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsup\": \"^8.4.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"1.2.2\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Staking REST API\n *\n * OpenAPI Specification for the Binance Staking REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","/**\n * Binance Staking REST API\n *\n * OpenAPI Specification for the Binance Staking 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 EthStakingAccountResponse,\n GetCurrentEthStakingQuotaResponse,\n GetEthRedemptionHistoryResponse,\n GetEthStakingHistoryResponse,\n GetWbethRateHistoryResponse,\n GetWbethRewardsHistoryResponse,\n GetWbethUnwrapHistoryResponse,\n GetWbethWrapHistoryResponse,\n RedeemEthResponse,\n SubscribeEthStakingResponse,\n WrapBethResponse,\n} from '../types';\n\n/**\n * EthStakingApi - axios parameter creator\n */\nconst EthStakingApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * ETH Staking account\n *\n * Weight: 150\n *\n * @summary ETH Staking account(USER_DATA)\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n ethStakingAccount: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v2/eth-staking/account',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get current ETH staking quota\n *\n * Weight: 150\n *\n * @summary Get current ETH staking quota(USER_DATA)\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getCurrentEthStakingQuota: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/eth-staking/eth/quota',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get ETH redemption history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get ETH redemption history(USER_DATA)\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [current] Currently querying page. Start from 1. Default:1\n * @param {number} [size] Default:10, Max:100\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getEthRedemptionHistory: async (\n startTime?: number,\n endTime?: number,\n current?: number,\n size?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (current !== undefined && current !== null) {\n localVarQueryParameter['current'] = current;\n }\n\n if (size !== undefined && size !== null) {\n localVarQueryParameter['size'] = size;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/eth-staking/eth/history/redemptionHistory',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get ETH staking history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get ETH staking history(USER_DATA)\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [current] Currently querying page. Start from 1. Default:1\n * @param {number} [size] Default:10, Max:100\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getEthStakingHistory: async (\n startTime?: number,\n endTime?: number,\n current?: number,\n size?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (current !== undefined && current !== null) {\n localVarQueryParameter['current'] = current;\n }\n\n if (size !== undefined && size !== null) {\n localVarQueryParameter['size'] = size;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/eth-staking/eth/history/stakingHistory',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get WBETH Rate History\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get WBETH Rate History(USER_DATA)\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [current] Currently querying page. Start from 1. Default:1\n * @param {number} [size] Default:10, Max:100\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getWbethRateHistory: async (\n startTime?: number,\n endTime?: number,\n current?: number,\n size?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (current !== undefined && current !== null) {\n localVarQueryParameter['current'] = current;\n }\n\n if (size !== undefined && size !== null) {\n localVarQueryParameter['size'] = size;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/eth-staking/eth/history/rateHistory',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get WBETH rewards history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get WBETH rewards history(USER_DATA)\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [current] Currently querying page. Start from 1. Default:1\n * @param {number} [size] Default:10, Max:100\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getWbethRewardsHistory: async (\n startTime?: number,\n endTime?: number,\n current?: number,\n size?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (current !== undefined && current !== null) {\n localVarQueryParameter['current'] = current;\n }\n\n if (size !== undefined && size !== null) {\n localVarQueryParameter['size'] = size;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/eth-staking/eth/history/wbethRewardsHistory',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get WBETH unwrap history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get WBETH unwrap history(USER_DATA)\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [current] Currently querying page. Start from 1. Default:1\n * @param {number} [size] Default:10, Max:100\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getWbethUnwrapHistory: async (\n startTime?: number,\n endTime?: number,\n current?: number,\n size?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (current !== undefined && current !== null) {\n localVarQueryParameter['current'] = current;\n }\n\n if (size !== undefined && size !== null) {\n localVarQueryParameter['size'] = size;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/eth-staking/wbeth/history/unwrapHistory',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get WBETH wrap history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get WBETH wrap history(USER_DATA)\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [current] Currently querying page. Start from 1. Default:1\n * @param {number} [size] Default:10, Max:100\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getWbethWrapHistory: async (\n startTime?: number,\n endTime?: number,\n current?: number,\n size?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (current !== undefined && current !== null) {\n localVarQueryParameter['current'] = current;\n }\n\n if (size !== undefined && size !== null) {\n localVarQueryParameter['size'] = size;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/eth-staking/wbeth/history/wrapHistory',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Redeem WBETH or BETH and get ETH\n *\n * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.\n *\n * Weight: 150\n *\n * @summary Redeem ETH(TRADE)\n * @param {number} amount Amount in SOL.\n * @param {string} [asset] WBETH or BETH, default to BETH\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n redeemEth: async (\n amount: number,\n asset?: string,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('redeemEth', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (amount !== undefined && amount !== null) {\n localVarQueryParameter['amount'] = amount;\n }\n\n if (asset !== undefined && asset !== null) {\n localVarQueryParameter['asset'] = asset;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/eth-staking/eth/redeem',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Subscribe ETH Staking\n *\n * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.\n *\n * Weight: 150\n *\n * @summary Subscribe ETH Staking(TRADE)\n * @param {number} amount Amount in SOL.\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n subscribeEthStaking: async (amount: number, recvWindow?: number): Promise<RequestArgs> => {\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('subscribeEthStaking', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (amount !== undefined && amount !== null) {\n localVarQueryParameter['amount'] = amount;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v2/eth-staking/eth/stake',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Wrap BETH\n *\n * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.\n *\n * Weight: 150\n *\n * @summary Wrap BETH(TRADE)\n * @param {number} amount Amount in SOL.\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n wrapBeth: async (amount: number, recvWindow?: number): Promise<RequestArgs> => {\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('wrapBeth', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (amount !== undefined && amount !== null) {\n localVarQueryParameter['amount'] = amount;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/eth-staking/wbeth/wrap',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * EthStakingApi - interface\n * @interface EthStakingApi\n */\nexport interface EthStakingApiInterface {\n /**\n * ETH Staking account\n *\n * Weight: 150\n *\n * @summary ETH Staking account(USER_DATA)\n * @param {EthStakingAccountRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n ethStakingAccount(\n requestParameters?: EthStakingAccountRequest\n ): Promise<RestApiResponse<EthStakingAccountResponse>>;\n /**\n * Get current ETH staking quota\n *\n * Weight: 150\n *\n * @summary Get current ETH staking quota(USER_DATA)\n * @param {GetCurrentEthStakingQuotaRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n getCurrentEthStakingQuota(\n requestParameters?: GetCurrentEthStakingQuotaRequest\n ): Promise<RestApiResponse<GetCurrentEthStakingQuotaResponse>>;\n /**\n * Get ETH redemption history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get ETH redemption history(USER_DATA)\n * @param {GetEthRedemptionHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n getEthRedemptionHistory(\n requestParameters?: GetEthRedemptionHistoryRequest\n ): Promise<RestApiResponse<GetEthRedemptionHistoryResponse>>;\n /**\n * Get ETH staking history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get ETH staking history(USER_DATA)\n * @param {GetEthStakingHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n getEthStakingHistory(\n requestParameters?: GetEthStakingHistoryRequest\n ): Promise<RestApiResponse<GetEthStakingHistoryResponse>>;\n /**\n * Get WBETH Rate History\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get WBETH Rate History(USER_DATA)\n * @param {GetWbethRateHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n getWbethRateHistory(\n requestParameters?: GetWbethRateHistoryRequest\n ): Promise<RestApiResponse<GetWbethRateHistoryResponse>>;\n /**\n * Get WBETH rewards history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get WBETH rewards history(USER_DATA)\n * @param {GetWbethRewardsHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n getWbethRewardsHistory(\n requestParameters?: GetWbethRewardsHistoryRequest\n ): Promise<RestApiResponse<GetWbethRewardsHistoryResponse>>;\n /**\n * Get WBETH unwrap history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get WBETH unwrap history(USER_DATA)\n * @param {GetWbethUnwrapHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n getWbethUnwrapHistory(\n requestParameters?: GetWbethUnwrapHistoryRequest\n ): Promise<RestApiResponse<GetWbethUnwrapHistoryResponse>>;\n /**\n * Get WBETH wrap history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get WBETH wrap history(USER_DATA)\n * @param {GetWbethWrapHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n getWbethWrapHistory(\n requestParameters?: GetWbethWrapHistoryRequest\n ): Promise<RestApiResponse<GetWbethWrapHistoryResponse>>;\n /**\n * Redeem WBETH or BETH and get ETH\n *\n * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.\n *\n * Weight: 150\n *\n * @summary Redeem ETH(TRADE)\n * @param {RedeemEthRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n redeemEth(requestParameters: RedeemEthRequest): Promise<RestApiResponse<RedeemEthResponse>>;\n /**\n * Subscribe ETH Staking\n *\n * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.\n *\n * Weight: 150\n *\n * @summary Subscribe ETH Staking(TRADE)\n * @param {SubscribeEthStakingRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n subscribeEthStaking(\n requestParameters: SubscribeEthStakingRequest\n ): Promise<RestApiResponse<SubscribeEthStakingResponse>>;\n /**\n * Wrap BETH\n *\n * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.\n *\n * Weight: 150\n *\n * @summary Wrap BETH(TRADE)\n * @param {WrapBethRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApiInterface\n */\n wrapBeth(requestParameters: WrapBethRequest): Promise<RestApiResponse<WrapBethResponse>>;\n}\n\n/**\n * Request parameters for ethStakingAccount operation in EthStakingApi.\n * @interface EthStakingAccountRequest\n */\nexport interface EthStakingAccountRequest {\n /**\n *\n * @type {number}\n * @memberof EthStakingApiEthStakingAccount\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getCurrentEthStakingQuota operation in EthStakingApi.\n * @interface GetCurrentEthStakingQuotaRequest\n */\nexport interface GetCurrentEthStakingQuotaRequest {\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetCurrentEthStakingQuota\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getEthRedemptionHistory operation in EthStakingApi.\n * @interface GetEthRedemptionHistoryRequest\n */\nexport interface GetEthRedemptionHistoryRequest {\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetEthRedemptionHistory\n */\n readonly startTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetEthRedemptionHistory\n */\n readonly endTime?: number;\n\n /**\n * Currently querying page. Start from 1. Default:1\n * @type {number}\n * @memberof EthStakingApiGetEthRedemptionHistory\n */\n readonly current?: number;\n\n /**\n * Default:10, Max:100\n * @type {number}\n * @memberof EthStakingApiGetEthRedemptionHistory\n */\n readonly size?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetEthRedemptionHistory\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getEthStakingHistory operation in EthStakingApi.\n * @interface GetEthStakingHistoryRequest\n */\nexport interface GetEthStakingHistoryRequest {\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetEthStakingHistory\n */\n readonly startTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetEthStakingHistory\n */\n readonly endTime?: number;\n\n /**\n * Currently querying page. Start from 1. Default:1\n * @type {number}\n * @memberof EthStakingApiGetEthStakingHistory\n */\n readonly current?: number;\n\n /**\n * Default:10, Max:100\n * @type {number}\n * @memberof EthStakingApiGetEthStakingHistory\n */\n readonly size?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetEthStakingHistory\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getWbethRateHistory operation in EthStakingApi.\n * @interface GetWbethRateHistoryRequest\n */\nexport interface GetWbethRateHistoryRequest {\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethRateHistory\n */\n readonly startTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethRateHistory\n */\n readonly endTime?: number;\n\n /**\n * Currently querying page. Start from 1. Default:1\n * @type {number}\n * @memberof EthStakingApiGetWbethRateHistory\n */\n readonly current?: number;\n\n /**\n * Default:10, Max:100\n * @type {number}\n * @memberof EthStakingApiGetWbethRateHistory\n */\n readonly size?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethRateHistory\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getWbethRewardsHistory operation in EthStakingApi.\n * @interface GetWbethRewardsHistoryRequest\n */\nexport interface GetWbethRewardsHistoryRequest {\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethRewardsHistory\n */\n readonly startTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethRewardsHistory\n */\n readonly endTime?: number;\n\n /**\n * Currently querying page. Start from 1. Default:1\n * @type {number}\n * @memberof EthStakingApiGetWbethRewardsHistory\n */\n readonly current?: number;\n\n /**\n * Default:10, Max:100\n * @type {number}\n * @memberof EthStakingApiGetWbethRewardsHistory\n */\n readonly size?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethRewardsHistory\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getWbethUnwrapHistory operation in EthStakingApi.\n * @interface GetWbethUnwrapHistoryRequest\n */\nexport interface GetWbethUnwrapHistoryRequest {\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethUnwrapHistory\n */\n readonly startTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethUnwrapHistory\n */\n readonly endTime?: number;\n\n /**\n * Currently querying page. Start from 1. Default:1\n * @type {number}\n * @memberof EthStakingApiGetWbethUnwrapHistory\n */\n readonly current?: number;\n\n /**\n * Default:10, Max:100\n * @type {number}\n * @memberof EthStakingApiGetWbethUnwrapHistory\n */\n readonly size?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethUnwrapHistory\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getWbethWrapHistory operation in EthStakingApi.\n * @interface GetWbethWrapHistoryRequest\n */\nexport interface GetWbethWrapHistoryRequest {\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethWrapHistory\n */\n readonly startTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethWrapHistory\n */\n readonly endTime?: number;\n\n /**\n * Currently querying page. Start from 1. Default:1\n * @type {number}\n * @memberof EthStakingApiGetWbethWrapHistory\n */\n readonly current?: number;\n\n /**\n * Default:10, Max:100\n * @type {number}\n * @memberof EthStakingApiGetWbethWrapHistory\n */\n readonly size?: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiGetWbethWrapHistory\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for redeemEth operation in EthStakingApi.\n * @interface RedeemEthRequest\n */\nexport interface RedeemEthRequest {\n /**\n * Amount in SOL.\n * @type {number}\n * @memberof EthStakingApiRedeemEth\n */\n readonly amount: number;\n\n /**\n * WBETH or BETH, default to BETH\n * @type {string}\n * @memberof EthStakingApiRedeemEth\n */\n readonly asset?: string;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiRedeemEth\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for subscribeEthStaking operation in EthStakingApi.\n * @interface SubscribeEthStakingRequest\n */\nexport interface SubscribeEthStakingRequest {\n /**\n * Amount in SOL.\n * @type {number}\n * @memberof EthStakingApiSubscribeEthStaking\n */\n readonly amount: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiSubscribeEthStaking\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for wrapBeth operation in EthStakingApi.\n * @interface WrapBethRequest\n */\nexport interface WrapBethRequest {\n /**\n * Amount in SOL.\n * @type {number}\n * @memberof EthStakingApiWrapBeth\n */\n readonly amount: number;\n\n /**\n *\n * @type {number}\n * @memberof EthStakingApiWrapBeth\n */\n readonly recvWindow?: number;\n}\n\n/**\n * EthStakingApi - object-oriented interface\n * @class EthStakingApi\n */\nexport class EthStakingApi implements EthStakingApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = EthStakingApiAxiosParamCreator(configuration);\n }\n\n /**\n * ETH Staking account\n *\n * Weight: 150\n *\n * @summary ETH Staking account(USER_DATA)\n * @param {EthStakingAccountRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<EthStakingAccountResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApi\n * @see {@link https://developers.binance.com/docs/staking/eth-staking/account/ETH-Staking-account Binance API Documentation}\n */\n public async ethStakingAccount(\n requestParameters: EthStakingAccountRequest = {}\n ): Promise<RestApiResponse<EthStakingAccountResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.ethStakingAccount(\n requestParameters?.recvWindow\n );\n return sendRequest<EthStakingAccountResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get current ETH staking quota\n *\n * Weight: 150\n *\n * @summary Get current ETH staking quota(USER_DATA)\n * @param {GetCurrentEthStakingQuotaRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetCurrentEthStakingQuotaResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApi\n * @see {@link https://developers.binance.com/docs/staking/eth-staking/account/Get-current-ETH-staking-quota Binance API Documentation}\n */\n public async getCurrentEthStakingQuota(\n requestParameters: GetCurrentEthStakingQuotaRequest = {}\n ): Promise<RestApiResponse<GetCurrentEthStakingQuotaResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getCurrentEthStakingQuota(\n requestParameters?.recvWindow\n );\n return sendRequest<GetCurrentEthStakingQuotaResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get ETH redemption history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get ETH redemption history(USER_DATA)\n * @param {GetEthRedemptionHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetEthRedemptionHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApi\n * @see {@link https://developers.binance.com/docs/staking/eth-staking/history/Get-ETH-redemption-history Binance API Documentation}\n */\n public async getEthRedemptionHistory(\n requestParameters: GetEthRedemptionHistoryRequest = {}\n ): Promise<RestApiResponse<GetEthRedemptionHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getEthRedemptionHistory(\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.current,\n requestParameters?.size,\n requestParameters?.recvWindow\n );\n return sendRequest<GetEthRedemptionHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get ETH staking history\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get ETH staking history(USER_DATA)\n * @param {GetEthStakingHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetEthStakingHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof EthStakingApi\n * @see {@link https://developers.binance.com/docs/staking/eth-staking/history/Get-ETH-staking-history Binance API Documentation}\n */\n public async getEthStakingHistory(\n requestParameters: GetEthStakingHistoryRequest = {}\n ): Promise<RestApiResponse<GetEthStakingHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getEthStakingHistory(\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.current,\n requestParameters?.size,\n requestParameters?.recvWindow\n );\n return sendRequest<GetEthStakingHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get WBETH Rate History\n *\n * The time between `startTime` and `endTime` cannot be longer than 3 months.\n * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.\n * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.\n * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.\n *\n * Weight: 150\n *\n * @summary Get WBETH