diff --git a/bindings/python/iota_sdk/types/output.py b/bindings/python/iota_sdk/types/output.py index 20ec4972e2..6d6b21b500 100644 --- a/bindings/python/iota_sdk/types/output.py +++ b/bindings/python/iota_sdk/types/output.py @@ -6,7 +6,7 @@ from typing import Dict, Optional, List, TypeAlias, Union, Any from dataclasses import dataclass, field from dataclasses_json import config -from iota_sdk.types.common import HexStr, json +from iota_sdk.types.common import HexStr, json, EpochIndex from iota_sdk.types.feature import deserialize_features, SenderFeature, IssuerFeature, MetadataFeature, TagFeature from iota_sdk.types.native_token import NativeToken from iota_sdk.types.token_scheme import SimpleTokenScheme @@ -21,6 +21,7 @@ class OutputType(IntEnum): Account (4): An account output. Foundry (5): A foundry output. Nft (6): An NFT output. + Delegation (7): A delegation output. """ Basic = 3 Account = 4 @@ -223,12 +224,30 @@ class NftOutput: @json @dataclass class DelegationOutput: - """Describes a delegation output. + """An output which delegates its contained IOTA coins as voting power to a validator. Attributes: - type : - The type of output. + amount: The amount of IOTA coins held by the output. + delegated_amount: The amount of delegated IOTA coins. + delegation_id: Unique identifier of the Delegation Output + validator_address: The Account Address of the validator to which this output is delegating. + start_epoch: The index of the first epoch for which this output delegates. + end_epoch: The index of the last epoch for which this output delegates. + unlock_conditions: Define how the output can be unlocked in a transaction. + type: The type of output. """ - # TODO fields done in #1174 + amount: int = field(metadata=config( + encoder=str + )) + delegated_amount: int = field(metadata=config( + encoder=str + )) + delegation_id: HexStr + validator_address: HexStr + start_epoch: EpochIndex + end_epoch: EpochIndex + unlock_conditions: List[AddressUnlockCondition] = field(metadata=config( + decoder=deserialize_unlock_conditions + )) type: int = field(default_factory=lambda: int( OutputType.Delegation), init=False)