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; recepient: Peer; type: "star_gift_transfer" }
    | { count: number; type: "api_floodskip" }

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
  • api_*: This transaction is a payment for paid API features
    • api_floodskip: This transaction is a payment for a paid bot broadcast

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; recepient: Peer; type: "star_gift_transfer" }
    • gift: StarGiftUnique

      The upgraded gift

    • recepient: Peer

      Recepient peer

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

      The number of billed API calls

    • type: "api_floodskip"