Documentation - v0.27.1
    Preparing search index...

    Type Alias StarsTransactionType

    StarsTransactionType:
        | { type: "unsupported" }
        | { type: "app_store" }
        | { type: "play_market" }
        | { type: "premium_bot" }
        | { type: "fragment" }
        | {
            date?: Date;
            status: "pending" | "success" | "failed";
            type: "fragment_withdraw";
            url?: string;
        }
        | { type: "ads" }
        | { messageId: number; peer: Peer; type: "reaction" }
        | { type: "gift"; user: User }
        | {
            media?: MessageMedia[];
            messageId: number;
            peer: Peer;
            type: "media_purchase";
        }
        | {
            description?: string;
            payload?: Uint8Array;
            photo?: WebDocument;
            title: string;
            type: "bot_purchase";
            user: User;
        }
        | { peer: Peer; period: number; type: "channel_subscription" }
        | { messageId: number; peer: Peer; type: "giveaway" }
        | { gift: StarGift; peer: Peer; type: "star_gift" }
        | { gift: StarGiftUnique; peer: Peer; type: "star_gift_upgrade" }
        | { gift: StarGiftUnique; peer: Peer; type: "star_gift_resale" }
        | { gift: StarGiftUnique; recipient: Peer; type: "star_gift_transfer" }
        | { count: number; peer: Peer; type: "paid_message" }
        | { months: number; peer: Peer; type: "premium_gift" }
        | { count: number; type: "api_floodskip" }
        | { commission: number; peer: Peer; type: "bot_referral" }
        | { fromDate: Date; peer: Peer; toDate: Date; type: "ads_proceeds" }
        | { type: "paid_search" }
        | { gift: StarGiftUnique; peer: Peer; type: "star_gift_prepaid_upgrade" }
        | { gift: StarGiftUnique; peer: Peer; type: "star_gift_drop_details" }

    Type of the transaction.

    • unsupported: This transaction is not supported by the current version of client
    • app_store, play_market, premium_bot, fragment: This transaction is a purchase through App Store, Play Market, Premium Bot or Fragment respectively
    • fragment_withdraw: This transaction is a withdrawal via Fragment
    • ads: This transaction is with the Telegram Ads platform
    • reaction: This transaction is a paid reaction in a chat
    • gift: This transaction is a gift from a user
    • bot_purchase: This transaction is a purchase at a bot-operated store
    • channel_subscription: This transaction is a subscription to a channel
    • star_gift: This transaction is either a star gift to a user (if outgoing), or converting a star gift to stars (if incoming)
    • star_gift_upgrade: This transaction is for a star gift upgrade
    • star_gift_transfer: This transaction is for a star gift transfer
    • star_gift_resale: This transaction is for a star gift resale
    • paid_message: This transaction is a payment for a paid message
    • premium_gift: This transaction is a payment for a premium gift to a user
    • api_*: This transaction is a payment for paid API features
      • api_floodskip: This transaction is a payment for a paid bot broadcast
    • bot_referral: This transaction is proceeds from a bot referral program
    • ads_proceeds: This transaction is proceeds from Telegram Ads
    • paid_search: This transaction is a payment for a paid search
    • star_gift_prepaid_upgrade: This transaction is for a star gift prepaid upgrade
    • star_gift_drop_details: This transaction is for dropping the original details of a star gift

    Type Declaration

    • { type: "unsupported" }
    • { type: "app_store" }
    • { type: "play_market" }
    • { type: "premium_bot" }
    • { type: "fragment" }
    • {
          date?: Date;
          status: "pending" | "success" | "failed";
          type: "fragment_withdraw";
          url?: string;
      }
      • Optionaldate?: Date

        If successful, date of the withdrawal

      • status: "pending" | "success" | "failed"
      • type: "fragment_withdraw"
      • Optionalurl?: string

        If successful, URL of the withdrawal transaction

    • { type: "ads" }
    • { messageId: number; peer: Peer; type: "reaction" }
      • messageId: number

        ID of the message containing the reaction

      • peer: Peer

        Related peer

        • For incoming transactions - user who sent the reaction
        • For outgoing transactions - channel which received the reaction
      • type: "reaction"
    • { type: "gift"; user: User }
      • type: "gift"
      • user: User

        User who sent the gift

    • {
          media?: MessageMedia[];
          messageId: number;
          peer: Peer;
          type: "media_purchase";
      }
      • Optionalmedia?: MessageMedia[]

        The bought media (available if not refunded)

      • messageId: number

        ID of the message containing the media

      • peer: Peer

        Related peer

        • For incoming transactions - user who bought the media
        • For outgoing transactions - seller of the media
      • type: "media_purchase"
    • {
          description?: string;
          payload?: Uint8Array;
          photo?: WebDocument;
          title: string;
          type: "bot_purchase";
          user: User;
      }
      • Optionaldescription?: string

        Description of the item

      • Optionalpayload?: Uint8Array

        Custom payload of the item

      • Optionalphoto?: WebDocument

        Photo of the item, if available

      • title: string

        Title of the item

      • type: "bot_purchase"
      • user: User

        Related user

        • For incoming transactions - user who bought the item
        • For outgoing transactions - the seller bot
    • { peer: Peer; period: number; type: "channel_subscription" }
      • peer: Peer

        Related peer

        • For incoming transactions - user who subscribed to the channel
        • For outgoing transactions - channel which was subscribed to
      • period: number

        Period of the subscription, in seconds

      • type: "channel_subscription"
    • { messageId: number; peer: Peer; type: "giveaway" }
      • messageId: number

        ID of the message containing the giveaway where the stars were given

      • peer: Peer

        Related peer

      • type: "giveaway"
    • { gift: StarGift; peer: Peer; type: "star_gift" }
      • gift: StarGift

        The gift

      • peer: Peer

        Related peer

      • type: "star_gift"
    • { gift: StarGiftUnique; peer: Peer; type: "star_gift_upgrade" }
    • { gift: StarGiftUnique; peer: Peer; type: "star_gift_resale" }
    • { gift: StarGiftUnique; recipient: Peer; type: "star_gift_transfer" }
      • gift: StarGiftUnique

        The upgraded gift

      • recipient: Peer

        Recipient peer

      • type: "star_gift_transfer"
    • { count: number; peer: Peer; type: "paid_message" }
      • count: number

        The number of messages paid for

      • peer: Peer

        Related peer

      • type: "paid_message"
    • { months: number; peer: Peer; type: "premium_gift" }
      • months: number

        Number of months paid for

      • peer: Peer

        Related peer

      • type: "premium_gift"
    • { count: number; type: "api_floodskip" }
      • count: number

        The number of billed API calls

      • type: "api_floodskip"
    • { commission: number; peer: Peer; type: "bot_referral" }
      • commission: number

        Commission in permille

      • peer: Peer

        Related bot

      • type: "bot_referral"
    • { fromDate: Date; peer: Peer; toDate: Date; type: "ads_proceeds" }
      • fromDate: Date

        Start of the period

      • peer: Peer

        Related peer

      • toDate: Date

        End of the period

      • type: "ads_proceeds"
    • { type: "paid_search" }
    • { gift: StarGiftUnique; peer: Peer; type: "star_gift_prepaid_upgrade" }
      • gift: StarGiftUnique

        The upgraded gift

      • peer: Peer

        Related peer

      • type: "star_gift_prepaid_upgrade"
    • { gift: StarGiftUnique; peer: Peer; type: "star_gift_drop_details" }
      • gift: StarGiftUnique

        The dropped gift

      • peer: Peer

        Related peer

      • type: "star_gift_drop_details"