UpgradedGift class final

Describes an upgraded gift that can be transferred to another owner or transferred to the TON blockchain as an NFT

Inheritance
Available extensions
Annotations
  • @immutable

Constructors

UpgradedGift({required int id, required int regularGiftId, required int publisherChatId, required String title, required String name, required int number, required int totalUpgradedCount, required int maxUpgradedCount, required bool isBurned, required bool isCrafted, required bool isPremium, required bool isThemeAvailable, required int usedThemeChatId, MessageSender? hostId, MessageSender? ownerId, required String ownerAddress, required String ownerName, required String giftAddress, UpgradedGiftModel? model, UpgradedGiftSymbol? symbol, UpgradedGiftBackdrop? backdrop, UpgradedGiftOriginalDetails? originalDetails, UpgradedGiftColors? colors, GiftResaleParameters? resaleParameters, required bool canSendPurchaseOffer, required int craftProbabilityPerMille, required String valueCurrency, required int valueAmount, required int valueUsdAmount})

Properties

backdrop UpgradedGiftBackdrop?
backdrop Backdrop of the upgraded gift
final
canSendPurchaseOffer bool
canSendPurchaseOffer True, if an offer to purchase the gift can be sent using sendGiftPurchaseOffer
final
colors UpgradedGiftColors?
colors Colors that can be set for user's name, background of empty chat photo, replies to messages and link previews; may be null if none or unknown
final
craftProbabilityPerMille int
craftProbabilityPerMille Probability that the gift adds to the chance of successful crafting of a new gift; 0 if the gift can't be used for crafting
final
giftAddress String
giftAddress Address of the gift NFT in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address
final
hashCode int
The hash code for this object.
no setteroverride
hostId MessageSender?
hostId Identifier of the user or the chat to which the upgraded gift was assigned from blockchain; may be null if none or unknown
final
id int
id Unique identifier of the gift
final
isBurned bool
isBurned True, if the gift was used to craft another gift
final
isCrafted bool
isCrafted True, if the gift was crafted from other gifts
final
isPremium bool
isPremium True, if the original gift could have been bought only by Telegram Premium subscribers
final
isThemeAvailable bool
isThemeAvailable True, if the gift can be used to set a theme in a chat
final
maxUpgradedCount int
maxUpgradedCount The maximum number of gifts that can be upgraded from the same gift
final
model UpgradedGiftModel?
model Model of the upgraded gift
final
name String
name Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift or sendResoldGift
final
number int
number Unique number of the upgraded gift among gifts upgraded from the same gift
final
originalDetails UpgradedGiftOriginalDetails?
originalDetails Information about the originally sent gift; may be null if unknown
final
ownerAddress String
ownerAddress Address of the gift NFT owner in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address
final
ownerId MessageSender?
ownerId Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown
final
ownerName String
ownerName Name of the owner for the case when owner identifier and address aren't known
final
publisherChatId int
publisherChatId Identifier of the chat that published the gift; 0 if none
final
regularGiftId int
regularGiftId Unique identifier of the regular gift from which the gift was upgraded; may be 0 for short period of time for old gifts from database
final
resaleParameters GiftResaleParameters?
resaleParameters Resale parameters of the gift; may be null if resale isn't possible
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
symbol UpgradedGiftSymbol?
symbol Symbol of the upgraded gift
final
title String
title The title of the upgraded gift
final
totalUpgradedCount int
totalUpgradedCount Total number of gifts that were upgraded from the same gift
final
usedThemeChatId int
usedThemeChatId Identifier of the chat for which the gift is used to set a theme; 0 if none or the gift isn't owned by the current user
final
valueAmount int
valueAmount Estimated value of the gift; in the smallest units of the currency; 0 if unavailable
final
valueCurrency String
valueCurrency ISO 4217 currency code of the currency in which value of the gift is represented; may be empty if unavailable
final
valueUsdAmount int
valueUsdAmount Estimated value of the gift in USD; in USD cents; 0 if unavailable
final

Methods

copyWith({int? id, int? regularGiftId, int? publisherChatId, String? title, String? name, int? number, int? totalUpgradedCount, int? maxUpgradedCount, bool? isBurned, bool? isCrafted, bool? isPremium, bool? isThemeAvailable, int? usedThemeChatId, MessageSender? hostId, MessageSender? ownerId, String? ownerAddress, String? ownerName, String? giftAddress, UpgradedGiftModel? model, UpgradedGiftSymbol? symbol, UpgradedGiftBackdrop? backdrop, UpgradedGiftOriginalDetails? originalDetails, UpgradedGiftColors? colors, GiftResaleParameters? resaleParameters, bool? canSendPurchaseOffer, int? craftProbabilityPerMille, String? valueCurrency, int? valueAmount, int? valueUsdAmount}) UpgradedGift

Available on UpgradedGift, provided by the UpgradedGiftExtensions extension

getConstructor() String
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromJson(Map<String, dynamic>? json) UpgradedGift?

Constants

constructor → const String