StarTransaction

class telegram.StarTransaction(id, amount, date, source=None, receiver=None, nanostar_amount=None, *, api_kwargs=None)[source]

Bases: telegram.TelegramObject

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 id, source, and receiver are equal.

Added in version 21.4.

Parameters:
  • id (str) – Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.

  • amount (int) – Integer amount of Telegram Stars transferred by the transaction.

  • nanostar_amount (int, optional) –

    The number of 1e-09 shares of Telegram Stars transferred by the transaction; from 0 to 999999999

    Added in version 21.9.

  • date (datetime.datetime) – Date the transaction was created as a datetime object.

  • source (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 (telegram.TransactionPartner, optional) – Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions.

id[source]

Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.

Type:

str

amount[source]

Integer amount of Telegram Stars transferred by the transaction.

Type:

int

nanostar_amount[source]

Optional. The number of 1e-09 shares of Telegram Stars transferred by the transaction; from 0 to 999999999

Added in version 21.9.

Type:

int

date[source]

Date the transaction was created as a datetime object.

Type:

datetime.datetime

source[source]

Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions.

Type:

telegram.TransactionPartner

receiver[source]

Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions.

Type:

telegram.TransactionPartner

__dir__()[source]

Default dir() implementation.

__format__(format_spec, /)[source]

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)[source]

Return self>=value.

__getattribute__(name, /)[source]

Return getattr(self, name).

__gt__(value, /)[source]

Return self>value.

classmethod __init_subclass__()[source]

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)[source]

Return self<=value.

__lt__(value, /)[source]

Return self<value.

__ne__(value, /)[source]

Return self!=value.

classmethod __new__(*args, **kwargs)[source]
__reduce__()[source]

Helper for pickle.

__reduce_ex__(protocol, /)[source]

Helper for pickle.

__sizeof__()[source]

Size of object in memory, in bytes.

__str__()[source]

Return str(self).

classmethod __subclasshook__(object, /)[source]

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

classmethod de_json(data, bot=None)[source]

See telegram.TelegramObject.de_json().