-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
87 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { User, Chat } from './'; | ||
|
||
/** | ||
* ## AffiliateInfo | ||
* Contains information about the affiliate that received a commission via this transaction. | ||
*/ | ||
export type AffiliateInfo = { | ||
/** | ||
* Optional. The bot or the user that received an affiliate commission if it was received by a bot or a user | ||
*/ | ||
affiliate_user?: User; | ||
|
||
/** | ||
* Optional. The chat that received an affiliate commission if it was received by a chat | ||
*/ | ||
affiliate_chat?: Chat; | ||
|
||
/** | ||
* The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from | ||
* referred users | ||
*/ | ||
commission_per_mille: number; | ||
|
||
/** | ||
* Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for | ||
* refunds | ||
*/ | ||
amount: number; | ||
|
||
/** | ||
* Optional. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; | ||
* from -999999999 to 999999999; can be negative for refunds | ||
*/ | ||
nanostar_amount?: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
import { TransactionPartnerFragment } from './TransactionPartnerFragment'; | ||
import { TransactionPartnerUser } from './TransactionPartnerUser'; | ||
import { TransactionPartnerTelegramAds } from './TransactionPartnerTelegramAds'; | ||
import { TransactionPartnerTelegramApi } from './TransactionPartnerTelegramApi'; | ||
import { TransactionPartnerOther } from './TransactionPartnerOther'; | ||
import { | ||
TransactionPartnerFragment, | ||
TransactionPartnerUser, | ||
TransactionPartnerTelegramAds, | ||
TransactionPartnerTelegramApi, | ||
TransactionPartnerOther, | ||
TransactionPartnerAffiliateProgram, | ||
} from './'; | ||
|
||
/** | ||
* ## TransactionPartner | ||
* This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be | ||
* one of | ||
* - TransactionPartnerFragment | ||
* - TransactionPartnerUser | ||
* - TransactionPartnerAffiliateProgram | ||
* - TransactionPartnerFragment | ||
* - TransactionPartnerTelegramAds | ||
* - TransactionPartnerTelegramApi | ||
* - TransactionPartnerOther | ||
* @see https://core.telegram.org/bots/api#transactionpartner | ||
*/ | ||
export type TransactionPartner = | ||
| TransactionPartnerFragment | ||
| TransactionPartnerUser | ||
| TransactionPartnerAffiliateProgram | ||
| TransactionPartnerFragment | ||
| TransactionPartnerTelegramAds | ||
| TransactionPartnerTelegramApi | ||
| TransactionPartnerOther; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { User } from './'; | ||
|
||
/** | ||
* ## TransactionPartnerAffiliateProgram | ||
* Describes the affiliate program that issued the affiliate commission received via this transaction. | ||
* @see https://core.telegram.org/bots/api#transactionpartneraffiliateprogram | ||
*/ | ||
export type TransactionPartnerAffiliateProgram = { | ||
/** | ||
* Type of the transaction partner, always “affiliate_program” | ||
*/ | ||
type: 'affiliate_program'; | ||
|
||
/** | ||
* Optional. Information about the bot that sponsored the affiliate program | ||
*/ | ||
sponsor_user?: User | ||
|
||
/** | ||
* The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program | ||
* sponsor from referred users | ||
*/ | ||
commission_per_mille: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters