TxOut

class blsct.TxOut(sub_addr: SubAddr, amount: int, memo: str, token_id: TokenId | None = None, output_type: Literal['Normal', 'StakedCommitment']='Normal', min_stake: int = 0, subtract_fee_from_amount: bool = False, blinding_key: Scalar = Scalar(1054c90f81f7814307b88214ab0182c4f9ba5193229559c490e657a13abebb7))

Represents a transaction output used to construct a CTxOut in a confidential transaction.

>>> from blsct import ChildKey, DoublePublicKey, PublicKey, SubAddr, SubAddrId, TxOut
>>> sub_addr = SubAddr.from_double_public_key(DoublePublicKey())
>>> amount = 789
>>> memo = "apple"
>>> tx_out = TxOut(sub_addr, amount, memo)
>>> tx_out.get_destination()
SubAddr(827cc8283b488e5...)
>>> tx_out.get_amount()
789
>>> tx_out.get_memo()
'apple'
>>> tx_out.get_token_id()
TokenId(0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff)
>>> tx_out.get_min_stake()
0
>>> tx_out.get_subtract_fee_from_amount()
False
>>> tx_out.get_blinding_key()
Scalar(827cc8283b488e5...)
>>> ser = tx_out.serialize()
>>> deser = TxOut.deserialize(ser)
>>> ser == deser.serialize()
True
classmethod deserialize(hex: str) → Self

Deserialize the TxOut from a hexadecimal string

get_amount() → int

Get the amount of the transaction output.

get_blinding_key() → Scalar

Get the blinding key of the transaction output.

get_destination() → SubAddr

Get the destination of the transaction output.

get_memo() → str

Get the memo of the transaction output.

get_min_stake() → int

Get the min stake of the transaction output.

get_output_type() → Literal['Normal', 'StakedCommitment']

Get the output type of the transaction output.

get_subtract_fee_from_amount() → bool

Get the subtract fee from amount flag of the the transaction output.

get_token_id() → TokenId

Get the token ID of the transaction output.

serialize() → str

Serialize the TxOut to a hexadecimal string