UpgradedGift class

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

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, required bool canBeTonWalletCardBackground, required UpgradedGiftModel model, required UpgradedGiftSymbol symbol, required UpgradedGiftBackdrop backdrop, UpgradedGiftOriginalDetails? originalDetails, UpgradedGiftColors? colors, required bool usesOnChainResale, GiftResaleParameters? resaleParameters, required int feeBasisPoints, required bool canSendPurchaseOffer, required int minOnChainPurchaseOfferGramAmount, required int craftProbabilityPerMille, required String valueCurrency, required int valueAmount, required int valueUsdAmount})
const

Properties

backdrop → UpgradedGiftBackdrop
backdrop Backdrop of the upgraded gift
final
canBeTonWalletCardBackground → bool
canBeTonWalletCardBackground True, if the gift NFT can be used as background_nft_address in setTonWalletCardStickers
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
feeBasisPoints → int
feeBasisPoints The fee for the sale of the gift, in basis points; 1 basis point is 0.01%; 0 if unknown. The fee is deducted from the price received by the seller
final
giftAddress → String
giftAddress Address of the gift NFT on the TON blockchain; empty if the gift isn't minted. 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 minted gift is linked; 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
minOnChainPurchaseOfferGramAmount → int
minOnChainPurchaseOfferGramAmount The minimum price for an on-chain offer to purchase the gift, in the smallest units of TON Grams; 0 if on-chain purchase offers can't be sent for the 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 on the 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 the 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 a short period of time for old gifts from the 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
usesOnChainResale → bool
usesOnChainResale True, if the gift must be bought, put up for sale, and delisted using getGiftOnChainPurchaseTransaction, getGiftOnChainListingTransaction, and getGiftOnChainDelistingTransaction; otherwise, sendResoldGift and setGiftResalePrice must be used
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 the 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, bool? canBeTonWalletCardBackground, UpgradedGiftModel? model, UpgradedGiftSymbol? symbol, UpgradedGiftBackdrop? backdrop, UpgradedGiftOriginalDetails? originalDetails, UpgradedGiftColors? colors, bool? usesOnChainResale, GiftResaleParameters? resaleParameters, int? feeBasisPoints, bool? canSendPurchaseOffer, int? minOnChainPurchaseOfferGramAmount, 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