"""
Binance Staking REST API

OpenAPI Specification for the Binance Staking REST API
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
"""

import requests
from typing import Optional, TypeVar, Union
from binance_common.configuration import ConfigurationRestAPI
from binance_common.models import ApiResponse
from binance_common.signature import Signers
from binance_common.utils import send_request
from .api.eth_staking_api import EthStakingApi
from .api.on_chain_yields_api import OnChainYieldsApi
from .api.soft_staking_api import SoftStakingApi
from .api.sol_staking_api import SolStakingApi

from .models import EthStakingAccountResponse
from .models import GetCurrentEthStakingQuotaResponse
from .models import GetEthRedemptionHistoryResponse
from .models import GetEthStakingHistoryResponse
from .models import GetWbethRateHistoryResponse
from .models import GetWbethRewardsHistoryResponse
from .models import GetWbethUnwrapHistoryResponse
from .models import GetWbethWrapHistoryResponse
from .models import RedeemEthResponse
from .models import SubscribeEthStakingResponse
from .models import WrapBethResponse
from .models import GetOnChainYieldsLockedPersonalLeftQuotaResponse
from .models import GetOnChainYieldsLockedProductListResponse
from .models import GetOnChainYieldsLockedProductPositionResponse
from .models import GetOnChainYieldsLockedRedemptionRecordResponse
from .models import GetOnChainYieldsLockedRewardsHistoryResponse
from .models import GetOnChainYieldsLockedSubscriptionPreviewResponse
from .models import GetOnChainYieldsLockedSubscriptionRecordResponse
from .models import OnChainYieldsAccountResponse
from .models import RedeemOnChainYieldsLockedProductResponse
from .models import SetOnChainYieldsLockedAutoSubscribeResponse
from .models import SetOnChainYieldsLockedProductRedeemOptionResponse
from .models import SubscribeOnChainYieldsLockedProductResponse
from .models import GetSoftStakingProductListResponse
from .models import GetSoftStakingRewardsHistoryResponse
from .models import SetSoftStakingResponse
from .models import ClaimBoostRewardsResponse
from .models import GetBnsolRateHistoryResponse
from .models import GetBnsolRewardsHistoryResponse
from .models import GetBoostRewardsHistoryResponse
from .models import GetSolRedemptionHistoryResponse
from .models import GetSolStakingHistoryResponse
from .models import GetSolStakingQuotaDetailsResponse
from .models import GetUnclaimedRewardsResponse
from .models import RedeemSolResponse
from .models import SolStakingAccountResponse
from .models import SubscribeSolStakingResponse


T = TypeVar("T")


class StakingRestAPI:
    def __init__(
        self,
        configuration: ConfigurationRestAPI,
    ) -> None:
        self.configuration = configuration
        self._session = requests.Session()
        self._signer = (
            Signers.get_signer(
                configuration.private_key, configuration.private_key_passphrase
            )
            if configuration.private_key is not None
            else None
        )

        self._ethStakingApi = EthStakingApi(
            self.configuration, self._session, self._signer
        )
        self._onChainYieldsApi = OnChainYieldsApi(
            self.configuration, self._session, self._signer
        )
        self._softStakingApi = SoftStakingApi(
            self.configuration, self._session, self._signer
        )
        self._solStakingApi = SolStakingApi(
            self.configuration, self._session, self._signer
        )

    def send_request(
        self,
        endpoint: str,
        method: str,
        query_params: Optional[dict] = None,
        body_params: Optional[dict] = None,
    ) -> ApiResponse[T]:
        """
        Sends an request to the Binance REST API.

        Args:
            endpoint (str): The API endpoint path to send the request to.
            method (str): The HTTP method to use for the request (e.g. "GET", "POST", "PUT", "DELETE").
            query_params (Optional[dict]): The request payload as a dictionary, or None if no payload is required.
            body_params (Optional[dict]): The request body as a dictionary, or None if no body is required.

        Returns:
            ApiResponse[T]: The API response, where T is the expected response type.
        """
        return send_request[T](
            self._session,
            self.configuration,
            method,
            endpoint,
            query_params,
            body_params,
        )

    def send_signed_request(
        self,
        endpoint: str,
        method: str,
        query_params: Optional[dict] = None,
        body_params: Optional[dict] = None,
    ) -> ApiResponse[T]:
        """
        Sends a signed request to the Binance REST API.

        Args:
            endpoint (str): The API endpoint path to send the request to.
            method (str): The HTTP method to use for the request (e.g. "GET", "POST", "PUT", "DELETE").
            query_params (Optional[dict]): The request payload as a dictionary, or None if no payload is required.
            body_params (Optional[dict]): The request body as a dictionary, or None if no body is required.

        Returns:
            ApiResponse[T]: The API response, where T is the expected response type.
        """
        return send_request[T](
            self._session,
            self.configuration,
            method,
            endpoint,
            query_params,
            body_params,
            is_signed=True,
            signer=self._signer,
        )

    def eth_staking_account(
        self,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[EthStakingAccountResponse]:
        """
                ETH Staking account(USER_DATA)

                ETH Staking account

        Weight: 150

                Args:
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[EthStakingAccountResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.eth_staking_account(recv_window)

    def get_current_eth_staking_quota(
        self,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetCurrentEthStakingQuotaResponse]:
        """
                Get current ETH staking quota(USER_DATA)

                Get current ETH staking quota

        Weight: 150

                Args:
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetCurrentEthStakingQuotaResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.get_current_eth_staking_quota(recv_window)

    def get_eth_redemption_history(
        self,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetEthRedemptionHistoryResponse]:
        """
                Get ETH redemption history(USER_DATA)

                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

                Args:
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetEthRedemptionHistoryResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.get_eth_redemption_history(
            start_time, end_time, current, size, recv_window
        )

    def get_eth_staking_history(
        self,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetEthStakingHistoryResponse]:
        """
                Get ETH staking history(USER_DATA)

                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

                Args:
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetEthStakingHistoryResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.get_eth_staking_history(
            start_time, end_time, current, size, recv_window
        )

    def get_wbeth_rate_history(
        self,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetWbethRateHistoryResponse]:
        """
                Get WBETH Rate History(USER_DATA)

                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

                Args:
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetWbethRateHistoryResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.get_wbeth_rate_history(
            start_time, end_time, current, size, recv_window
        )

    def get_wbeth_rewards_history(
        self,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetWbethRewardsHistoryResponse]:
        """
                Get WBETH rewards history(USER_DATA)

                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

                Args:
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetWbethRewardsHistoryResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.get_wbeth_rewards_history(
            start_time, end_time, current, size, recv_window
        )

    def get_wbeth_unwrap_history(
        self,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetWbethUnwrapHistoryResponse]:
        """
                Get WBETH unwrap history(USER_DATA)

                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

                Args:
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetWbethUnwrapHistoryResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.get_wbeth_unwrap_history(
            start_time, end_time, current, size, recv_window
        )

    def get_wbeth_wrap_history(
        self,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetWbethWrapHistoryResponse]:
        """
                Get WBETH wrap history(USER_DATA)

                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

                Args:
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetWbethWrapHistoryResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.get_wbeth_wrap_history(
            start_time, end_time, current, size, recv_window
        )

    def redeem_eth(
        self,
        amount: Union[float, None],
        asset: Optional[str] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[RedeemEthResponse]:
        """
                Redeem ETH(TRADE)

                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

                Args:
                    amount (Union[float, None]): Amount in SOL.
                    asset (Optional[str] = None): WBETH or BETH, default to BETH
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[RedeemEthResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.redeem_eth(amount, asset, recv_window)

    def subscribe_eth_staking(
        self,
        amount: Union[float, None],
        recv_window: Optional[int] = None,
    ) -> ApiResponse[SubscribeEthStakingResponse]:
        """
                Subscribe ETH Staking(TRADE)

                Subscribe ETH Staking

        * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

        Weight: 150

                Args:
                    amount (Union[float, None]): Amount in SOL.
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[SubscribeEthStakingResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.subscribe_eth_staking(amount, recv_window)

    def wrap_beth(
        self,
        amount: Union[float, None],
        recv_window: Optional[int] = None,
    ) -> ApiResponse[WrapBethResponse]:
        """
                Wrap BETH(TRADE)

                Wrap BETH

        * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

        Weight: 150

                Args:
                    amount (Union[float, None]): Amount in SOL.
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[WrapBethResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._ethStakingApi.wrap_beth(amount, recv_window)

    def get_on_chain_yields_locked_personal_left_quota(
        self,
        project_id: Union[str, None],
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetOnChainYieldsLockedPersonalLeftQuotaResponse]:
        """
                Get On-chain Yields Locked Personal Left Quota (USER_DATA)

                Get On-chain Yields Locked Personal Left Quota

        Weight: 50

                Args:
                    project_id (Union[str, None]):
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetOnChainYieldsLockedPersonalLeftQuotaResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.get_on_chain_yields_locked_personal_left_quota(
            project_id, recv_window
        )

    def get_on_chain_yields_locked_product_list(
        self,
        asset: Optional[str] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetOnChainYieldsLockedProductListResponse]:
        """
                Get On-chain Yields Locked Product List (USER_DATA)

                Get available On-chain Yields Locked product list

        * Get available On-chain Yields Locked product list

        Weight: 50

                Args:
                    asset (Optional[str] = None): WBETH or BETH, default to BETH
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetOnChainYieldsLockedProductListResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.get_on_chain_yields_locked_product_list(
            asset, current, size, recv_window
        )

    def get_on_chain_yields_locked_product_position(
        self,
        asset: Optional[str] = None,
        position_id: Optional[int] = None,
        project_id: Optional[str] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetOnChainYieldsLockedProductPositionResponse]:
        """
                Get On-chain Yields Locked Product Position (USER_DATA)

                Get On-chain Yields Locked Product Position

        Weight: 50

                Args:
                    asset (Optional[str] = None): WBETH or BETH, default to BETH
                    position_id (Optional[int] = None):
                    project_id (Optional[str] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetOnChainYieldsLockedProductPositionResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.get_on_chain_yields_locked_product_position(
            asset, position_id, project_id, current, size, recv_window
        )

    def get_on_chain_yields_locked_redemption_record(
        self,
        position_id: Optional[int] = None,
        redeem_id: Optional[str] = None,
        asset: Optional[str] = None,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetOnChainYieldsLockedRedemptionRecordResponse]:
        """
                Get On-chain Yields Locked Redemption Record (USER_DATA)

                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

                Args:
                    position_id (Optional[int] = None):
                    redeem_id (Optional[str] = None):
                    asset (Optional[str] = None): WBETH or BETH, default to BETH
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetOnChainYieldsLockedRedemptionRecordResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.get_on_chain_yields_locked_redemption_record(
            position_id,
            redeem_id,
            asset,
            start_time,
            end_time,
            current,
            size,
            recv_window,
        )

    def get_on_chain_yields_locked_rewards_history(
        self,
        position_id: Optional[str] = None,
        asset: Optional[str] = None,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetOnChainYieldsLockedRewardsHistoryResponse]:
        """
                Get On-chain Yields Locked Rewards History (USER_DATA)

                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

                Args:
                    position_id (Optional[str] = None):
                    asset (Optional[str] = None): WBETH or BETH, default to BETH
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetOnChainYieldsLockedRewardsHistoryResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.get_on_chain_yields_locked_rewards_history(
            position_id, asset, start_time, end_time, current, size, recv_window
        )

    def get_on_chain_yields_locked_subscription_preview(
        self,
        project_id: Union[str, None],
        amount: Union[float, None],
        auto_subscribe: Optional[bool] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetOnChainYieldsLockedSubscriptionPreviewResponse]:
        """
                Get On-chain Yields Locked Subscription Preview (USER_DATA)

                Get On-chain Yields Locked Subscription Preview

        Weight: 50

                Args:
                    project_id (Union[str, None]):
                    amount (Union[float, None]): Amount in SOL.
                    auto_subscribe (Optional[bool] = None): true or false, default true.
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetOnChainYieldsLockedSubscriptionPreviewResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.get_on_chain_yields_locked_subscription_preview(
            project_id, amount, auto_subscribe, recv_window
        )

    def get_on_chain_yields_locked_subscription_record(
        self,
        purchase_id: Optional[str] = None,
        client_id: Optional[str] = None,
        asset: Optional[str] = None,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        current: Optional[int] = None,
        size: Optional[int] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[GetOnChainYieldsLockedSubscriptionRecordResponse]:
        """
                Get On-chain Yields Locked Subscription Record (USER_DATA)

                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

                Args:
                    purchase_id (Optional[str] = None):
                    client_id (Optional[str] = None):
                    asset (Optional[str] = None): WBETH or BETH, default to BETH
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    current (Optional[int] = None): Currently querying page. Start from 1. Default:1
                    size (Optional[int] = None): Default:10, Max:100
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[GetOnChainYieldsLockedSubscriptionRecordResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.get_on_chain_yields_locked_subscription_record(
            purchase_id,
            client_id,
            asset,
            start_time,
            end_time,
            current,
            size,
            recv_window,
        )

    def on_chain_yields_account(
        self,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[OnChainYieldsAccountResponse]:
        """
                On-chain Yields Account (USER_DATA)

                On-chain Yields Account query

        Weight: 50

                Args:
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[OnChainYieldsAccountResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.on_chain_yields_account(recv_window)

    def redeem_on_chain_yields_locked_product(
        self,
        position_id: Union[str, None],
        channel_id: Optional[str] = None,
        recv_window: Optional[int] = None,
    ) -> ApiResponse[RedeemOnChainYieldsLockedProductResponse]:
        """
                Redeem On-chain Yields Locked Product (TRADE)

                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

                Args:
                    position_id (Union[str, None]):
                    channel_id (Optional[str] = None):
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[RedeemOnChainYieldsLockedProductResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.redeem_on_chain_yields_locked_product(
            position_id, channel_id, recv_window
        )

    def set_on_chain_yields_locked_auto_subscribe(
        self,
        position_id: Union[str, None],
        auto_subscribe: Union[bool, None],
        recv_window: Optional[int] = None,
    ) -> ApiResponse[SetOnChainYieldsLockedAutoSubscribeResponse]:
        """
                Set On-chain Yields Locked Auto Subscribe(USER_DATA)

                Set On-chain Yield locked auto subscribe

        Weight: 50

                Args:
                    position_id (Union[str, None]):
                    auto_subscribe (Union[bool, None]): true or false
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[SetOnChainYieldsLockedAutoSubscribeResponse]

                Raises:
                    RequiredError: If a required parameter is missing.

        """

        return self._onChainYieldsApi.set_on_chain_yields_locked_auto_subscribe(
            position_id, auto_subscribe, recv_window
        )

    def set_on_chain_yields_locked_product_redeem_option(
        self,
        position_id: Union[str, None],
        redeem_to: Union[str, None],
        recv_window: Optional[int] = None,
    ) -> ApiResponse[SetOnChainYieldsLockedProductRedeemOptionResponse]:
        """
                Set On-chain Yields Locked Product Redeem Option(USER_DATA)

                Set On-chain Yields redeem option for Locked product

        Weight: 50

                Args:
                    position_id (Union[str, None]):
                    redeem_to (Union[str, None]): 'SPOT','FLEXIBLE'
                    recv_window (Optional[int] = None):

                Returns:
                    ApiResponse[SetOnChainYieldsLockedProductRedeemOptionResponse]

                Raises:
