diff --git a/data/web/corefork.telegram.org/api/gifs.html b/data/web/corefork.telegram.org/api/gifs.html index a8c5417d3a..7f90d1b421 100644 --- a/data/web/corefork.telegram.org/api/gifs.html +++ b/data/web/corefork.telegram.org/api/gifs.html @@ -39,7 +39,7 @@
- +

Working with GIFs

diff --git a/data/web/corefork.telegram.org/api/revenue.html b/data/web/corefork.telegram.org/api/revenue.html new file mode 100644 index 0000000000..2ed5f3c00e --- /dev/null +++ b/data/web/corefork.telegram.org/api/revenue.html @@ -0,0 +1,172 @@ + + + + + Channel ad revenue + + + + + + + + + + + + + + + + +
+ +
+
+
+ +

Channel ad revenue

+ +
+ +

Telegram has one of the most generous reward systems in the history of social media. Telegram channel owners can now receive 50% of the revenue from ads displayed in their channels.

+

This page describes the methods used to withdraw channel ad revenue, as well as view detailed revenue stats.

+

See here » for more info on how to display the ads in the client UI.

+

Revenue statistics

+
channelFull#bbab348d flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet = ChatFull;
+
+broadcastRevenueBalances#8438f1c6 current_balance:long available_balance:long overall_revenue:long = BroadcastRevenueBalances;
+
+updateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = Update;
+
+stats.broadcastRevenueStats#5407e297 top_hours_graph:StatsGraph revenue_graph:StatsGraph balances:BroadcastRevenueBalances usd_rate:double = stats.BroadcastRevenueStats;
+
+
+broadcastRevenueTransactionProceeds#557e2cc4 amount:long from_date:int to_date:int = BroadcastRevenueTransaction;
+broadcastRevenueTransactionWithdrawal#5a590978 flags:# pending:flags.0?true failed:flags.2?true amount:long date:int provider:string transaction_date:flags.1?int transaction_url:flags.1?string = BroadcastRevenueTransaction;
+broadcastRevenueTransactionRefund#42d30d2e amount:long date:int provider:string = BroadcastRevenueTransaction;
+
+stats.broadcastRevenueTransactions#87158466 count:int transactions:Vector<BroadcastRevenueTransaction> = stats.BroadcastRevenueTransactions;
+
+---functions---
+
+stats.getBroadcastRevenueStats#75dfb671 flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastRevenueStats;
+
+stats.getBroadcastRevenueTransactions#69280f channel:InputChannel offset:int limit:int = stats.BroadcastRevenueTransactions;
+

Channel ad revenue statistics may be fetched by channel admins if the channelFull.can_view_revenue flag is set.

+

Use stats.getBroadcastRevenueStats to fetch statistics about the revenue earned from sponsored messages in a channel; the returned StatsGraph graphs can be rendered as described here ».

+

Specifically:

+
    +
  • top_hours_graph - Ad impressions graph
  • +
  • revenue_graph - Ad revenue graph (in the smallest unit of the cryptocurrency in which revenue is calculated)
  • +
  • balances - Current balance, current withdrawable balance and overall revenue
  • +
  • usd_rate - Current conversion rate of the cryptocurrency (not in the smallest unit) in which revenue is calculated to USD
  • +
+

The transaction history may be fetched using stats.getBroadcastRevenueTransactions, which will return a vector of BroadcastRevenueTransaction constructors, one of:

+ +

The server will also emit an updateBroadcastRevenueTransactions every time a new transaction is added: if the client is currently in the Monetization tab of the channel, this update should apply the new balances (contained in the update), and refresh the transaction list using stats.getBroadcastRevenueTransactions.

+

Note that all balances and currency amounts and graph values are in the smallest unit of the chosen cryptocurrency (currently nanotons for TONs, so to obtain a value in USD divide the chosen amount by 10^9, and then divide by usd_rate).

+

Withdrawing funds

+
stats.broadcastRevenueWithdrawalUrl#ec659737 url:string = stats.BroadcastRevenueWithdrawalUrl;
+
+---functions---
+
+stats.getBroadcastRevenueWithdrawalUrl#2a65ef73 channel:InputChannel password:InputCheckPasswordSRP = stats.BroadcastRevenueWithdrawalUrl;
+

To withdraw funds from a channel's ad revenue balance, invoke stats.getBroadcastRevenueWithdrawalUrl, passing the current account's 2FA password as an InputCheckPasswordSRP constructor, generated as specified here ».

+

Only the channel owner can invoke this method.

+

The method will return a unique URL to a Fragment page where the user will be able to specify and submit the address of the TON wallet where the funds will be sent.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/web/corefork.telegram.org/api/stars.html b/data/web/corefork.telegram.org/api/stars.html index d938cb496c..bcf2847ac8 100644 --- a/data/web/corefork.telegram.org/api/stars.html +++ b/data/web/corefork.telegram.org/api/stars.html @@ -47,46 +47,7 @@

Mini app developers and content creators can use the Telegram Stars they've earned to receive rewards in Toncoin – or buy Telegram Ads at special discounted rates.

This page describes the methods used to buy and withdraw Telegram Stars, as well as view detailed revenue stats.

Buying Telegram Stars

-

Using Telegram Stars

-

Revenue statistics

-

Channel ad revenue statistics

-
channelFull#bbab348d flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet = ChatFull;
-
-broadcastRevenueBalances#8438f1c6 current_balance:long available_balance:long overall_revenue:long = BroadcastRevenueBalances;
-
-updateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = Update;
-
-stats.broadcastRevenueStats#5407e297 top_hours_graph:StatsGraph revenue_graph:StatsGraph balances:BroadcastRevenueBalances usd_rate:double = stats.BroadcastRevenueStats;
-
-broadcastRevenueTransactionProceeds#557e2cc4 amount:long from_date:int to_date:int = BroadcastRevenueTransaction;
-broadcastRevenueTransactionWithdrawal#5a590978 flags:# pending:flags.0?true failed:flags.2?true amount:long date:int provider:string transaction_date:flags.1?int transaction_url:flags.1?string = BroadcastRevenueTransaction;
-broadcastRevenueTransactionRefund#42d30d2e amount:long date:int provider:string = BroadcastRevenueTransaction;
-
-stats.broadcastRevenueTransactions#87158466 count:int transactions:Vector<BroadcastRevenueTransaction> = stats.BroadcastRevenueTransactions;
-
----functions---
-
-stats.getBroadcastRevenueStats#75dfb671 flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastRevenueStats;
-
-stats.getBroadcastRevenueTransactions#69280f channel:InputChannel offset:int limit:int = stats.BroadcastRevenueTransactions;
-

Channel ad revenue statistics may be fetched by channel admins if the channelFull.can_view_revenue flag is set.

-

Use stats.getBroadcastRevenueStats to fetch statistics about the revenue earned from sponsored messages in a channel; the returned StatsGraph graphs can be rendered as described here ».

-

Specifically, the top_hours_graph will graph the

-

The transaction history may be fetched using stats.getBroadcastRevenueTransactions, which will return a vector of BroadcastRevenueTransaction constructors, one of:

- -

Withdrawing Telegram Stars

-

Channel ad revenue

-
stats.broadcastRevenueWithdrawalUrl#ec659737 url:string = stats.BroadcastRevenueWithdrawalUrl;
-
----functions---
-
-stats.getBroadcastRevenueWithdrawalUrl#2a65ef73 channel:InputChannel password:InputCheckPasswordSRP = stats.BroadcastRevenueWithdrawalUrl;
-

To withdraw Telegram Stars from a channel's ad revenue balance, invoke stats.getBroadcastRevenueWithdrawalUrl, passing the current account's 2FA password as an InputCheckPasswordSRP constructor, generated as specified here ».

-

The method will return a unique URL to a Fragment page where the user will be able to specify and submit the address of the TON wallet where the funds will be sent.

+

Using Telegram Stars