Source code for digital_world_sdk.operation.end_sponsoring_future_reserves
from typing import ClassVar
from .. import xdr as dw_xdr
from ..muxed_account import MuxedAccount
from .operation import Operation
__all__ = ["EndSponsoringFutureReserves"]
[docs]
class EndSponsoringFutureReserves(Operation):
"""The :class:`EndSponsoringFutureReserves` object, which represents a EndSponsoringFutureReserves
operation on the Digital World network.
Terminates the current is-sponsoring-future-reserves-for relationship in which the source account is sponsored.
See `Sponsored Reserves <https://docs.digitalworld.global/docs/build/guides/transactions/sponsored-reserves>`_ for more information.
Threshold: Medium
See `End Sponsoring Future Reserves <https://docs.digitalworld.global/docs/learn/fundamentals/transactions/list-of-operations#end-sponsoring-future-reserves>`_.
:param source: The source account for the operation. Defaults to the transaction's source account.
"""
_XDR_OPERATION_TYPE: ClassVar[dw_xdr.OperationType] = (
dw_xdr.OperationType.END_SPONSORING_FUTURE_RESERVES
)
def __init__(self, source: MuxedAccount | str | None = None) -> None:
super().__init__(source)
def _to_operation_body(self) -> dw_xdr.OperationBody:
body = dw_xdr.OperationBody(type=self._XDR_OPERATION_TYPE)
return body
[docs]
@classmethod
def from_xdr_object(
cls, xdr_object: dw_xdr.Operation
) -> "EndSponsoringFutureReserves":
"""Creates a :class:`EndSponsoringFutureReserves` object from an XDR Operation
object.
"""
source = Operation.get_source_from_xdr_obj(xdr_object)
op = cls(source=source)
return op
def __repr__(self):
return f"<EndSponsoringFutureReserves [source={self.source}]>"