@binance/staking
Version:
Official Binance Staking Connector - A lightweight library that provides a convenient interface to Binance's Staking REST API.
867 lines (863 loc) • 123 kB
JavaScript
//#region rolldown:runtime
var __defProp = Object.defineProperty;
var __export = (all) => {
let target = {};
for (var name$1 in all) __defProp(target, name$1, {
get: all[name$1],
enumerable: true
});
return target;
};
//#endregion
let __binance_common = require("@binance/common");
//#region package.json
var name = "@binance/staking";
var version = "8.0.7";
//#endregion
//#region src/rest-api/modules/eth-staking-api.ts
/**
* Binance Staking REST API
*
* OpenAPI Specification for the Binance Staking REST API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* EthStakingApi - axios parameter creator
*/
const EthStakingApiAxiosParamCreator = function(configuration) {
return {
ethStakingAccount: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v2/eth-staking/account",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getCurrentEthStakingQuota: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/eth-staking/eth/quota",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getEthRedemptionHistory: async (redeemId, startTime, endTime, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (redeemId !== void 0 && redeemId !== null) localVarQueryParameter["redeemId"] = redeemId;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/eth-staking/eth/history/redemptionHistory",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getEthStakingHistory: async (purchaseId, startTime, endTime, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (purchaseId !== void 0 && purchaseId !== null) localVarQueryParameter["purchaseId"] = purchaseId;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/eth-staking/eth/history/stakingHistory",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getWbethRateHistory: async (startTime, endTime, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/eth-staking/eth/history/rateHistory",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getWbethRewardsHistory: async (startTime, endTime, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/eth-staking/eth/history/wbethRewardsHistory",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getWbethUnwrapHistory: async (startTime, endTime, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/eth-staking/wbeth/history/unwrapHistory",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getWbethWrapHistory: async (startTime, endTime, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/eth-staking/wbeth/history/wrapHistory",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
redeemEth: async (amount, asset, recvWindow) => {
(0, __binance_common.assertParamExists)("redeemEth", "amount", amount);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/eth-staking/eth/redeem",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
subscribeEthStaking: async (amount, recvWindow) => {
(0, __binance_common.assertParamExists)("subscribeEthStaking", "amount", amount);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v2/eth-staking/eth/stake",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
wrapBeth: async (amount, recvWindow) => {
(0, __binance_common.assertParamExists)("wrapBeth", "amount", amount);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/eth-staking/wbeth/wrap",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
}
};
};
/**
* EthStakingApi - object-oriented interface
* @class EthStakingApi
*/
var EthStakingApi = class {
constructor(configuration) {
this.configuration = configuration;
this.localVarAxiosParamCreator = EthStakingApiAxiosParamCreator(configuration);
}
/**
* ETH Staking account
*
* Weight: 150
*
* @summary ETH Staking account(USER_DATA)
* @param {EthStakingAccountRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<EthStakingAccountResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/account/ETH-Staking-account Binance API Documentation}
*/
async ethStakingAccount(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.ethStakingAccount(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get current ETH staking quota
*
* Weight: 150
*
* @summary Get current ETH staking quota(USER_DATA)
* @param {GetCurrentEthStakingQuotaRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetCurrentEthStakingQuotaResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/account/Get-current-ETH-staking-quota Binance API Documentation}
*/
async getCurrentEthStakingQuota(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getCurrentEthStakingQuota(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get ETH redemption history
*
* The time between `startTime` and `endTime` cannot be longer than 3 months.
* If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
* If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
* If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
*
* Weight: 150
*
* @summary Get ETH redemption history(USER_DATA)
* @param {GetEthRedemptionHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetEthRedemptionHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/history/Get-ETH-redemption-history Binance API Documentation}
*/
async getEthRedemptionHistory(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getEthRedemptionHistory(requestParameters?.redeemId, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get ETH staking history
*
* The time between `startTime` and `endTime` cannot be longer than 3 months.
* If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
* If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
* If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
*
* Weight: 150
*
* @summary Get ETH staking history(USER_DATA)
* @param {GetEthStakingHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetEthStakingHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/history/Get-ETH-staking-history Binance API Documentation}
*/
async getEthStakingHistory(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getEthStakingHistory(requestParameters?.purchaseId, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get WBETH Rate History
*
* The time between `startTime` and `endTime` cannot be longer than 3 months.
* If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
* If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
* If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
*
* Weight: 150
*
* @summary Get WBETH Rate History(USER_DATA)
* @param {GetWbethRateHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetWbethRateHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/history/Get-BETH-Rate-History Binance API Documentation}
*/
async getWbethRateHistory(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getWbethRateHistory(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get WBETH rewards history
*
* The time between `startTime` and `endTime` cannot be longer than 3 months.
* If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
* If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
* If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
*
* Weight: 150
*
* @summary Get WBETH rewards history(USER_DATA)
* @param {GetWbethRewardsHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetWbethRewardsHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/history/Get-WBETH-rewards-history Binance API Documentation}
*/
async getWbethRewardsHistory(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getWbethRewardsHistory(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get WBETH unwrap history
*
* The time between `startTime` and `endTime` cannot be longer than 3 months.
* If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
* If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
* If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
*
* Weight: 150
*
* @summary Get WBETH unwrap history(USER_DATA)
* @param {GetWbethUnwrapHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetWbethUnwrapHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/history/Get-WBETH-unwrap-history Binance API Documentation}
*/
async getWbethUnwrapHistory(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getWbethUnwrapHistory(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get WBETH wrap history
*
* The time between `startTime` and `endTime` cannot be longer than 3 months.
* If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
* If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
* If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
*
* Weight: 150
*
* @summary Get WBETH wrap history(USER_DATA)
* @param {GetWbethWrapHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetWbethWrapHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/history/Get-WBETH-wrap-history Binance API Documentation}
*/
async getWbethWrapHistory(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getWbethWrapHistory(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Redeem WBETH or BETH and get ETH
*
* You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
*
* Weight: 150
*
* @summary Redeem ETH(TRADE)
* @param {RedeemEthRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<RedeemEthResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/staking/Redeem-ETH Binance API Documentation}
*/
async redeemEth(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemEth(requestParameters?.amount, requestParameters?.asset, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Subscribe ETH Staking
*
* You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
*
* Weight: 150
*
* @summary Subscribe ETH Staking(TRADE)
* @param {SubscribeEthStakingRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<SubscribeEthStakingResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/staking/Subscribe-ETH-Staking Binance API Documentation}
*/
async subscribeEthStaking(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.subscribeEthStaking(requestParameters?.amount, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Wrap BETH
*
* You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
*
* Weight: 150
*
* @summary Wrap BETH(TRADE)
* @param {WrapBethRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<WrapBethResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof EthStakingApi
* @see {@link https://developers.binance.com/docs/staking/eth-staking/staking/Wrap-BETH Binance API Documentation}
*/
async wrapBeth(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.wrapBeth(requestParameters?.amount, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
};
//#endregion
//#region src/rest-api/modules/on-chain-yields-api.ts
/**
* Binance Staking REST API
*
* OpenAPI Specification for the Binance Staking REST API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* OnChainYieldsApi - axios parameter creator
*/
const OnChainYieldsApiAxiosParamCreator = function(configuration) {
return {
getOnChainYieldsLockedPersonalLeftQuota: async (projectId, recvWindow) => {
(0, __binance_common.assertParamExists)("getOnChainYieldsLockedPersonalLeftQuota", "projectId", projectId);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (projectId !== void 0 && projectId !== null) localVarQueryParameter["projectId"] = projectId;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/personalLeftQuota",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getOnChainYieldsLockedProductList: async (asset, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/list",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getOnChainYieldsLockedProductPosition: async (asset, positionId, projectId, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (positionId !== void 0 && positionId !== null) localVarQueryParameter["positionId"] = positionId;
if (projectId !== void 0 && projectId !== null) localVarQueryParameter["projectId"] = projectId;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/position",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getOnChainYieldsLockedRedemptionRecord: async (positionId, redeemId, asset, startTime, endTime, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (positionId !== void 0 && positionId !== null) localVarQueryParameter["positionId"] = positionId;
if (redeemId !== void 0 && redeemId !== null) localVarQueryParameter["redeemId"] = redeemId;
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/history/redemptionRecord",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getOnChainYieldsLockedRewardsHistory: async (positionId, asset, startTime, endTime, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (positionId !== void 0 && positionId !== null) localVarQueryParameter["positionId"] = positionId;
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/history/rewardsRecord",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getOnChainYieldsLockedSubscriptionPreview: async (projectId, amount, autoSubscribe, recvWindow) => {
(0, __binance_common.assertParamExists)("getOnChainYieldsLockedSubscriptionPreview", "projectId", projectId);
(0, __binance_common.assertParamExists)("getOnChainYieldsLockedSubscriptionPreview", "amount", amount);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (projectId !== void 0 && projectId !== null) localVarQueryParameter["projectId"] = projectId;
if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
if (autoSubscribe !== void 0 && autoSubscribe !== null) localVarQueryParameter["autoSubscribe"] = autoSubscribe;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/subscriptionPreview",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getOnChainYieldsLockedSubscriptionRecord: async (purchaseId, clientId, asset, startTime, endTime, current, size, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (purchaseId !== void 0 && purchaseId !== null) localVarQueryParameter["purchaseId"] = purchaseId;
if (clientId !== void 0 && clientId !== null) localVarQueryParameter["clientId"] = clientId;
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/history/subscriptionRecord",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
onChainYieldsAccount: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/account",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
redeemOnChainYieldsLockedProduct: async (positionId, channelId, recvWindow) => {
(0, __binance_common.assertParamExists)("redeemOnChainYieldsLockedProduct", "positionId", positionId);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (positionId !== void 0 && positionId !== null) localVarQueryParameter["positionId"] = positionId;
if (channelId !== void 0 && channelId !== null) localVarQueryParameter["channelId"] = channelId;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/redeem",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
setOnChainYieldsLockedAutoSubscribe: async (positionId, autoSubscribe, recvWindow) => {
(0, __binance_common.assertParamExists)("setOnChainYieldsLockedAutoSubscribe", "positionId", positionId);
(0, __binance_common.assertParamExists)("setOnChainYieldsLockedAutoSubscribe", "autoSubscribe", autoSubscribe);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (positionId !== void 0 && positionId !== null) localVarQueryParameter["positionId"] = positionId;
if (autoSubscribe !== void 0 && autoSubscribe !== null) localVarQueryParameter["autoSubscribe"] = autoSubscribe;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/setAutoSubscribe",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
setOnChainYieldsLockedProductRedeemOption: async (positionId, redeemTo, recvWindow) => {
(0, __binance_common.assertParamExists)("setOnChainYieldsLockedProductRedeemOption", "positionId", positionId);
(0, __binance_common.assertParamExists)("setOnChainYieldsLockedProductRedeemOption", "redeemTo", redeemTo);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (positionId !== void 0 && positionId !== null) localVarQueryParameter["positionId"] = positionId;
if (redeemTo !== void 0 && redeemTo !== null) localVarQueryParameter["redeemTo"] = redeemTo;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/setRedeemOption",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
subscribeOnChainYieldsLockedProduct: async (projectId, amount, autoSubscribe, sourceAccount, redeemTo, channelId, clientId, recvWindow) => {
(0, __binance_common.assertParamExists)("subscribeOnChainYieldsLockedProduct", "projectId", projectId);
(0, __binance_common.assertParamExists)("subscribeOnChainYieldsLockedProduct", "amount", amount);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (projectId !== void 0 && projectId !== null) localVarQueryParameter["projectId"] = projectId;
if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
if (autoSubscribe !== void 0 && autoSubscribe !== null) localVarQueryParameter["autoSubscribe"] = autoSubscribe;
if (sourceAccount !== void 0 && sourceAccount !== null) localVarQueryParameter["sourceAccount"] = sourceAccount;
if (redeemTo !== void 0 && redeemTo !== null) localVarQueryParameter["redeemTo"] = redeemTo;
if (channelId !== void 0 && channelId !== null) localVarQueryParameter["channelId"] = channelId;
if (clientId !== void 0 && clientId !== null) localVarQueryParameter["clientId"] = clientId;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/onchain-yields/locked/subscribe",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
}
};
};
/**
* OnChainYieldsApi - object-oriented interface
* @class OnChainYieldsApi
*/
var OnChainYieldsApi = class {
constructor(configuration) {
this.configuration = configuration;
this.localVarAxiosParamCreator = OnChainYieldsApiAxiosParamCreator(configuration);
}
/**
* Get On-chain Yields Locked Personal Left Quota
*
* Weight: 50
*
* @summary Get On-chain Yields Locked Personal Left Quota (USER_DATA)
* @param {GetOnChainYieldsLockedPersonalLeftQuotaRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetOnChainYieldsLockedPersonalLeftQuotaResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof OnChainYieldsApi
* @see {@link https://developers.binance.com/docs/staking/on-chain-yields/account/Get-Onchain-Locked-Personal-Left-Quota Binance API Documentation}
*/
async getOnChainYieldsLockedPersonalLeftQuota(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOnChainYieldsLockedPersonalLeftQuota(requestParameters?.projectId, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get available On-chain Yields Locked product list
*
* Get available On-chain Yields Locked product list
*
* Weight: 50
*
* @summary Get On-chain Yields Locked Product List (USER_DATA)
* @param {GetOnChainYieldsLockedProductListRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetOnChainYieldsLockedProductListResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof OnChainYieldsApi
* @see {@link https://developers.binance.com/docs/staking/on-chain-yields/account/ Binance API Documentation}
*/
async getOnChainYieldsLockedProductList(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOnChainYieldsLockedProductList(requestParameters?.asset, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get On-chain Yields Locked Product Position
*
* Weight: 50
*
* @summary Get On-chain Yields Locked Product Position (USER_DATA)
* @param {GetOnChainYieldsLockedProductPositionRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetOnChainYieldsLockedProductPositionResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof OnChainYieldsApi
* @see {@link https://developers.binance.com/docs/staking/on-chain-yields/account/Get-Onchain-Locked-Product-Position Binance API Documentation}
*/
async getOnChainYieldsLockedProductPosition(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOnChainYieldsLockedProductPosition(requestParameters?.asset, requestParameters?.positionId, requestParameters?.projectId, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get On-chain Yields Locked Redemption Record
*
* The time between `startTime` and `endTime` cannot be longer than 3 months.
* If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
* If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
* If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
*
* Weight: 50
*
* @summary Get On-chain Yields Locked Redemption Record (USER_DATA)
* @param {GetOnChainYieldsLockedRedemptionRecordRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetOnChainYieldsLockedRedemptionRecordResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof OnChainYieldsApi
* @see {@link https://developers.binance.com/docs/staking/on-chain-yields/history/Get-Onchain-Locked-Redemption-Record Binance API Documentation}
*/
async getOnChainYieldsLockedRedemptionRecord(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOnChainYieldsLockedRedemptionRecord(requestParameters?.positionId, requestParameters?.redeemId, requestParameters?.asset, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get On-chain Yields Locked Rewards History
*
* The time between `startTime` and `endTime` cannot be longer than 3 months.
* If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
* If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
* If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
*
* Weight: 50
*
* @summary Get On-chain Yields Locked Rewards History (USER_DATA)
* @param {GetOnChainYieldsLockedRewardsHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetOnChainYieldsLockedRewardsHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof OnChainYieldsApi
* @see {@link https://developers.binance.com/docs/staking/on-chain-yields/history/Get-Onchain-Locked-Rewards-History Binance API Documentation}
*/
async getOnChainYieldsLockedRewardsHistory(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOnChainYieldsLockedRewardsHistory(requestParameters?.positionId, requestParameters?.asset, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get On-chain Yields Locked Subscription Preview
*
* Weight: 50
*
* @summary Get On-chain Yields Locked Subscription Preview (USER_DATA)
* @param {GetOnChainYieldsLockedSubscriptionPreviewRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetOnChainYieldsLockedSubscriptionPreviewResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof OnChainYieldsApi
* @see {@link https://developers.binance.com/docs/staking/on-chain-yields/earn/ Binance API Documentation}
*/
async getOnChainYieldsLockedSubscriptionPreview(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOnChainYieldsLockedSubscriptionPreview(requestParameters?.projectId, requestParameters?.amount, requestParameters?.autoSubscribe, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get On-chain Yields Locked Subscription Record
*
* The time between `startTime` and `endTime` cannot be longer than 3 months.
* If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
* If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
* If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
*
* Weight: 50
*
* @summary Get On-chain Yields Locked Subscription Record (USER_DATA)
* @param {GetOnChainYieldsLockedSubscriptionRecordRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetOnChainYieldsLockedSubscriptionRecordResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof OnChainYieldsApi
* @see {@link https://developers.binance.com/docs/staking/on-chain-yields/history/ Binance API Documentation}
*/
async getOnChainYieldsLockedSubscriptionRecord(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOnChainYieldsLockedSubscriptionRecord(requestParameters?.purchaseId, requestParameters?.clientId, requestParameters?.asset, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* On-chain Yields Account query
*
* Weight: 50
*
* @summary On-chain Yields Account (USER_DATA)
* @param {OnChainYieldsAccountRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<OnChainYieldsAccountResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof OnChainYieldsApi
* @see {@link https://developers.binance.com/docs/staking/on-chain-yields/account/Onchain-Account Binance API Documentation}
*/
async onChainYieldsAccount(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.onChainYieldsAccount(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Redeem On-chain Yields Locked Product
*
* You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
*
* Weight: 1/3s per account
*
* @summary Redeem On-chain Yields Locked Product (TRADE)
* @param {RedeemOnChainYieldsLockedProductRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<RedeemOnChainYieldsLockedProductResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof OnChainYieldsApi
* @see {@link https://developers.binance.com/docs/staking/on-chain-yields/earn/Redeem-Onchain-Locked-Product Binance API Documentation}
*/
async redeemOnChainYieldsLockedProduct(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemOnChainYieldsLockedProduct(requestParameters?.positionId, requestParameters?.channelId, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Set On-chain Yield locked a