@grammyjs/types 3.16.0 → 3.17.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/payment.d.ts +30 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.16.0",
3
+ "version": "3.17.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {
package/payment.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { User } from "./manage.js";
1
+ import type { Chat, User } from "./manage.js";
2
2
  import type { PaidMedia, Sticker } from "./message.js";
3
3
  /** This object represents a portion of the price for goods or services. */
4
4
  export interface LabeledPrice {
@@ -144,20 +144,36 @@ export interface RevenueWithdrawalStateFailed {
144
144
  /** Type of the state, always “failed” */
145
145
  type: "failed";
146
146
  }
147
+ /** Contains information about the affiliate that received a commission via this transaction. */
148
+ export interface AffiliateInfo {
149
+ /** The bot or the user that received an affiliate commission if it was received by a bot or a user */
150
+ affiliate_user?: User;
151
+ /** The chat that received an affiliate commission if it was received by a chat */
152
+ affiliate_chat?: Chat;
153
+ /** The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users */
154
+ commission_per_mille: number;
155
+ /** Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds */
156
+ amount: number;
157
+ /** The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds */
158
+ nanostar_amount?: number;
159
+ }
147
160
  /** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
148
161
 
149
162
  - TransactionPartnerUser
163
+ - TransactionPartnerAffiliateProgram
150
164
  - TransactionPartnerFragment
151
165
  - TransactionPartnerTelegramAds
152
166
  - TransactionPartnerTelegramApi
153
167
  - TransactionPartnerOther */
154
- export type TransactionPartner = TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther;
168
+ export type TransactionPartner = TransactionPartnerUser | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther;
155
169
  /** Describes a transaction with a user. */
156
170
  export interface TransactionPartnerUser {
157
171
  /** Type of the transaction partner, always “user” */
158
172
  type: "user";
159
173
  /** Information about the user */
160
174
  user: User;
175
+ /** Information about the affiliate that received a commission via this transaction */
176
+ affiliate?: AffiliateInfo;
161
177
  /** Bot-specified invoice payload */
162
178
  invoice_payload?: string;
163
179
  /** The duration of the paid subscription */
@@ -169,6 +185,15 @@ export interface TransactionPartnerUser {
169
185
  /** The gift sent to the user by the bot */
170
186
  gift?: string;
171
187
  }
188
+ /** Describes the affiliate program that issued the affiliate commission received via this transaction. */
189
+ export interface TransactionPartnerAffiliateProgram {
190
+ /** Type of the transaction partner, always “affiliate_program” */
191
+ type: "affiliate_program";
192
+ /** Information about the bot that sponsored the affiliate program */
193
+ sponsor_user?: User;
194
+ /** The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users */
195
+ commission_per_mille: number;
196
+ }
172
197
  /** Describes a withdrawal transaction with Fragment. */
173
198
  export interface TransactionPartnerFragment {
174
199
  /** Type of the transaction partner, always “fragment” */
@@ -197,8 +222,10 @@ export interface TransactionPartnerOther {
197
222
  export interface StarTransaction {
198
223
  /** Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. */
199
224
  id: string;
200
- /** Number of Telegram Stars transferred by the transaction */
225
+ /** Integer amount of Telegram Stars transferred by the transaction */
201
226
  amount: number;
227
+ /** The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999 */
228
+ nanostar_amount?: number;
202
229
  /** Date the transaction was created in Unix time */
203
230
  date: number;
204
231
  /** Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions */