Class StarTransaction

Hierarchy (view full)

Constructors

Properties

amount: number

Number of Telegram Stars transferred by the transaction

createdUnixTime: number

Date the transaction was created in Unix time

id: string

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.

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

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

Accessors

  • get createdAt(): Date
  • Date the transaction was created

    Returns Date

  • get createdTimestamp(): number
  • Return the timestamp transaction was created

    Returns number

Methods

  • Protected

    Creates a clone of the current instance

    Returns Base

    A clone of the current instance

  • Protected

    Patches the current instance with new data

    Parameters

    • data: Record<string, any>

      The data to patch the instance with

    Returns Record<string, any>

    The patched data

  • Protected

    Updates the current instance with new data and returns a clone of the updated instance

    Parameters

    • data: Record<string, any>

      The data to update the instance with

    Returns Base

    A clone of the updated instance

  • Refunds a successful payment in Telegram Stars.

    Parameters

    • userId: string | number

      Identifier of the user whose payment will be refunded

    Returns Promise<true>

    Returns True on success.

  • Flatten an object. Any properties that are collections will get converted to an array of keys.

    Parameters

    • OptionalpropsRecursive: boolean

      Optional. If true, calls toJSON method on nested objects.

    • Rest...props: Record<string, string | boolean>[]

      Optional. Specific properties to include/exclude, or rename.

    Returns Record<string, any>

    Flattened object.

  • Returns the id instance Chat, User, ChatMember and other

    Returns null | string