L iCdZddlZddlmZddlmZmZddlm Z ddl m Z m Z m Z ddlmZmZddlmZd d lmZerdd lmZGd d e ZGdde Zy)zAThis module contains the classes for Telegram Stars transactions.N)Sequence) TYPE_CHECKINGOptional)TelegramObject)de_json_optionalde_list_optionalparse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)TransactionPartner)BotceZdZdZdZ ddddededejde e d e e d e ed e e d dffd Z e dde de dd dffd ZxZS)StarTransactiona Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`id`, :attr:`source`, and :attr:`receiver` are equal. .. versionadded:: 21.4 Args: id (:obj:`str`): Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with :attr:`SuccessfulPayment.telegram_payment_charge_id` for successful incoming payments from users. amount (:obj:`int`): Integer amount of Telegram Stars transferred by the transaction. nanostar_amount (:obj:`int`, optional): The number of :tg-const:`~telegram.constants.Nanostar.VALUE` shares of Telegram Stars transferred by the transaction; from 0 to :tg-const:`~telegram.constants.NanostarLimit.MAX_AMOUNT` .. versionadded:: 21.9 date (:obj:`datetime.datetime`): Date the transaction was created as a datetime object. source (:class:`telegram.TransactionPartner`, optional): Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions. receiver (:class:`telegram.TransactionPartner`, optional): Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions. Attributes: id (:obj:`str`): Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with :attr:`SuccessfulPayment.telegram_payment_charge_id` for successful incoming payments from users. amount (:obj:`int`): Integer amount of Telegram Stars transferred by the transaction. nanostar_amount (:obj:`int`): Optional. The number of :tg-const:`~telegram.constants.Nanostar.VALUE` shares of Telegram Stars transferred by the transaction; from 0 to :tg-const:`~telegram.constants.NanostarLimit.MAX_AMOUNT` .. versionadded:: 21.9 date (:obj:`datetime.datetime`): Date the transaction was created as a datetime object. source (:class:`telegram.TransactionPartner`): Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions. receiver (:class:`telegram.TransactionPartner`): Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions. )amountdateidnanostar_amountreceiversourceN api_kwargsrrrrrrrreturnct||||_||_||_||_||_||_|j|j |j f|_|jyNr) super__init__rrrrrr _id_attrs_freeze) selfrrrrrrr __class__s n/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_payment/stars/startransactions.pyrzStarTransaction.__init__[sk J/! "& 4: 6> .= GG KK MM  databotrc*|j|}t|}t|jdd||d<t |jdt ||d<t |jdt ||d<t |||S),See :meth:`telegram.TelegramObject.de_json`.rN)tzinforrr%r&) _parse_datar r getrrrde_json)clsr%r& loc_tzinfor"s r#r-zStarTransaction.de_jsonust$2#6 %dhhvt&PRUVX+DHHZ,@BTVYZZwDc22r$)NNNN)__name__ __module__ __qualname____doc__ __slots__strintdtmdatetimerrr r classmethodr- __classcell__r"s@r#rr%s1fRI0415)-*. ll  +,  -. "#X& 4 38 3(5/ 3EV 3 3r$rcleZdZdZdZdddeedeeffdZ e d ded ed d dffd Z xZ S)StarTransactionsa Contains a list of Telegram Star transactions. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`transactions` are equal. .. versionadded:: 21.4 Args: transactions (Sequence[:class:`telegram.StarTransaction`]): The list of transactions. Attributes: transactions (tuple[:class:`telegram.StarTransaction`]): The list of transactions. ) transactionsNrr?rct||t||_|jf|_|j yr)rrr r?rr )r!r?rr"s r#rzStarTransactions.__init__s; J/9KL9Y++- r$r%r&rrc|j|}t|jdt||d<t|||S)r(r?r*)r+rr,rrr-)r.r%r&r"s r#r-zStarTransactions.de_jsonsCt$/0H/[^_^wDc22r$r0) r1r2r3r4r5rrrr rr:r-r;r<s@r#r>r>sc "I\`$_5FNxFX383(5/3EW33r$r>)r4r9r8collections.abcrtypingrrtelegram._telegramobjectrtelegram._utils.argumentparsingrrr telegram._utils.datetimer r telegram._utils.typesr transactionpartnerrtelegramrrr>r$r#rKsG(H$*3bbQ*2\3n\3~!3~!3r$