Skip to main content

UpgradedGift

Struct UpgradedGift 

Source
pub struct UpgradedGift {
Show 29 fields pub id: i64, pub regular_gift_id: i64, pub publisher_chat_id: i64, pub title: String, pub name: String, pub number: i32, pub total_upgraded_count: i32, pub max_upgraded_count: i32, pub is_burned: bool, pub is_crafted: bool, pub is_premium: bool, pub is_theme_available: bool, pub used_theme_chat_id: i64, pub host_id: Option<MessageSender>, pub owner_id: Option<MessageSender>, pub owner_address: String, pub owner_name: String, pub gift_address: String, pub model: UpgradedGiftModel, pub symbol: UpgradedGiftSymbol, pub backdrop: UpgradedGiftBackdrop, pub original_details: Option<UpgradedGiftOriginalDetails>, pub colors: Option<UpgradedGiftColors>, pub resale_parameters: Option<GiftResaleParameters>, pub can_send_purchase_offer: bool, pub craft_probability_per_mille: i32, pub value_currency: String, pub value_amount: i64, pub value_usd_amount: i64,
}
Expand description

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

Fields§

§id: i64

Unique identifier of the gift

§regular_gift_id: i64

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

§publisher_chat_id: i64

Identifier of the chat that published the gift; 0 if none

§title: String

The title of the upgraded gift

§name: String

Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift or sendResoldGift

§number: i32

Unique number of the upgraded gift among gifts upgraded from the same gift

§total_upgraded_count: i32

Total number of gifts that were upgraded from the same gift

§max_upgraded_count: i32

The maximum number of gifts that can be upgraded from the same gift

§is_burned: bool

True, if the gift was used to craft another gift

§is_crafted: bool

True, if the gift was craft from another gifts

§is_premium: bool

True, if the original gift could have been bought only by Telegram Premium subscribers

§is_theme_available: bool

True, if the gift can be used to set a theme in a chat

§used_theme_chat_id: i64

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

§host_id: Option<MessageSender>

Identifier of the user or the chat to which the upgraded gift was assigned from blockchain; may be null if none or unknown

§owner_id: Option<MessageSender>

Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown

§owner_address: String

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

§owner_name: String

Name of the owner for the case when owner identifier and address aren’t known

§gift_address: String

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

§model: UpgradedGiftModel

Model of the upgraded gift

§symbol: UpgradedGiftSymbol

Symbol of the upgraded gift

§backdrop: UpgradedGiftBackdrop

Backdrop of the upgraded gift

§original_details: Option<UpgradedGiftOriginalDetails>

Information about the originally sent gift; may be null if unknown

§colors: Option<UpgradedGiftColors>

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

§resale_parameters: Option<GiftResaleParameters>

Resale parameters of the gift; may be null if resale isn’t possible

§can_send_purchase_offer: bool

True, if an offer to purchase the gift can be sent using sendGiftPurchaseOffer

§craft_probability_per_mille: i32

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

§value_currency: String

ISO 4217 currency code of the currency in which value of the gift is represented; may be empty if unavailable

§value_amount: i64

Estimated value of the gift; in the smallest units of the currency; 0 if unavailable

§value_usd_amount: i64

Estimated value of the gift in USD; in USD cents; 0 if unavailable

Trait Implementations§

Source§

impl Clone for UpgradedGift

Source§

fn clone(&self) -> UpgradedGift

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UpgradedGift

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for UpgradedGift

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for UpgradedGift

Source§

fn eq(&self, other: &UpgradedGift) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for UpgradedGift

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for UpgradedGift

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,