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";
    }

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)

Type declaration

  • 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 declaration

  • 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 declaration

  • type: "gift"
  • user: User

    User who sent the gift

Type declaration

  • 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"

Type declaration

  • 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

Type declaration

  • 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"

Type declaration

  • messageId: number

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

  • peer: Peer

    Related peer

  • type: "giveaway"

Type declaration

  • gift: StarGift

    The gift

  • peer: Peer

    Related peer

  • type: "star_gift"