Source code for digital_world_sdk.operation.inflation

from typing import ClassVar

from .. import xdr as dw_xdr
from ..muxed_account import MuxedAccount
from .operation import Operation

__all__ = ["Inflation"]


[docs] class Inflation(Operation): """The :class:`Inflation` object, which represents an Inflation operation on the Digital World network. This operation runs inflation. Threshold: Low :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.INFLATION ) 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) -> "Inflation": """Creates a :class:`Inflation` object from an XDR Operation object. """ source = Operation.get_source_from_xdr_obj(xdr_object) op = cls(source) return op
def __repr__(self): return f"<Inflation [source={self.source}]>"