@telegram.ts/types 1.18.2 → 1.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.18.2",
3
+ "version": "1.19.1",
4
4
  "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -1,4 +1,4 @@
1
- import type { User } from "./manageTypes";
1
+ import type { Chat, User } from "./manageTypes";
2
2
  import type { PaidMedia, Sticker } from "./messageTypes";
3
3
 
4
4
  /** This object represents a portion of the price for goods or services. */
@@ -161,16 +161,32 @@ export interface RevenueWithdrawalStateFailed {
161
161
  type: "failed";
162
162
  }
163
163
 
164
+ /** Contains information about the affiliate that received a commission via this transaction. */
165
+ export interface AffiliateInfo {
166
+ /** The bot or the user that received an affiliate commission if it was received by a bot or a user */
167
+ affiliate_user?: User;
168
+ /** The chat that received an affiliate commission if it was received by a chat */
169
+ affiliate_chat?: Chat;
170
+ /** The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users */
171
+ commission_per_mille: number;
172
+ /** Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds */
173
+ amount: number;
174
+ /** The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds */
175
+ nanostar_amount?: number;
176
+ }
177
+
164
178
  /** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
165
179
 
166
180
  - TransactionPartnerUser
167
181
  - TransactionPartnerFragment
182
+ - TransactionPartnerAffiliateProgram
168
183
  - TransactionPartnerTelegramAds
169
184
  - TransactionPartnerTelegramApi
170
185
  - TransactionPartnerOther */
171
186
  export type TransactionPartner =
172
187
  | TransactionPartnerUser
173
188
  | TransactionPartnerFragment
189
+ | TransactionPartnerAffiliateProgram
174
190
  | TransactionPartnerTelegramAds
175
191
  | TransactionPartnerTelegramApi
176
192
  | TransactionPartnerOther;
@@ -181,6 +197,8 @@ export interface TransactionPartnerUser {
181
197
  type: "user";
182
198
  /** Information about the user */
183
199
  user: User;
200
+ /** Information about the affiliate that received a commission via this transaction */
201
+ affiliate?: AffiliateInfo;
184
202
  /** The duration of the paid subscription */
185
203
  subscription_period?: number;
186
204
  /** Bot-specified invoice payload */
@@ -193,6 +211,16 @@ export interface TransactionPartnerUser {
193
211
  gift?: string;
194
212
  }
195
213
 
214
+ /** Describes the affiliate program that issued the affiliate commission received via this transaction. */
215
+ export interface TransactionPartnerAffiliateProgram {
216
+ /** Type of the transaction partner, always “affiliate_program” */
217
+ type: "affiliate_program";
218
+ /** Information about the bot that sponsored the affiliate program */
219
+ sponsor_user?: User;
220
+ /** The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users */
221
+ commission_per_mille: number;
222
+ }
223
+
196
224
  /** Describes a withdrawal transaction with Fragment. */
197
225
  export interface TransactionPartnerFragment {
198
226
  /** Type of the transaction partner, always “fragment” */
@@ -225,8 +253,10 @@ export interface TransactionPartnerOther {
225
253
  export interface StarTransaction {
226
254
  /** 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. */
227
255
  id: string;
228
- /** Number of Telegram Stars transferred by the transaction */
256
+ /** Integer amount of Telegram Stars transferred by the transaction */
229
257
  amount: number;
258
+ /** The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999 */
259
+ nanostar_amount?: number;
230
260
  /** Date the transaction was created in Unix time */
231
261
  date: number;
232
262
  /** Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions */