diff --git a/src/api/gramjs/apiBuilders/gifts.ts b/src/api/gramjs/apiBuilders/gifts.ts index 8943ddc6f..b75c20b57 100644 --- a/src/api/gramjs/apiBuilders/gifts.ts +++ b/src/api/gramjs/apiBuilders/gifts.ts @@ -26,7 +26,7 @@ export function buildApiStarGift(starGift: GramJs.TypeStarGift): ApiStarGift { if (starGift instanceof GramJs.StarGiftUnique) { const { id, num, ownerId, ownerName, title, attributes, availabilityIssued, availabilityTotal, slug, ownerAddress, - giftAddress, resellAmount, releasedBy, resaleTonOnly, requirePremium, + giftAddress, resellAmount, releasedBy, resaleTonOnly, requirePremium, valueCurrency, valueAmount, giftId, } = starGift; return { @@ -46,6 +46,9 @@ export function buildApiStarGift(starGift: GramJs.TypeStarGift): ApiStarGift { releasedByPeerId: releasedBy && getApiChatIdFromMtpPeer(releasedBy), requirePremium, resaleTonOnly, + valueCurrency, + valueAmount: valueAmount?.toJSNumber(), + regularGiftId: giftId.toString(), }; } diff --git a/src/api/gramjs/apiBuilders/payments.ts b/src/api/gramjs/apiBuilders/payments.ts index 9812162ae..39be623a3 100644 --- a/src/api/gramjs/apiBuilders/payments.ts +++ b/src/api/gramjs/apiBuilders/payments.ts @@ -26,6 +26,7 @@ import type { ApiStarsTransactionPeer, ApiStarTopupOption, ApiTypeCurrencyAmount, + ApiUniqueStarGiftValueInfo, BoughtPaidMedia, } from '../../types'; @@ -630,3 +631,29 @@ export function buildApiStarTopupOption(option: GramJs.TypeStarsTopupOption): Ap isExtended: extended, }; } + +export function buildApiUniqueStarGiftValueInfo( + info: GramJs.payments.UniqueStarGiftValueInfo): ApiUniqueStarGiftValueInfo { + const { + lastSaleOnFragment, currency, value, initialSaleDate, initialSaleStars, initialSalePrice, + lastSaleDate, lastSalePrice, floorPrice, averagePrice, listedCount, fragmentListedCount, + fragmentListedUrl, valueIsAverage, + } = info; + + return { + isLastSaleOnFragment: lastSaleOnFragment, + isValueAverage: valueIsAverage, + currency, + value: value.toJSNumber(), + initialSaleDate, + initialSaleStars: initialSaleStars.toJSNumber(), + initialSalePrice: initialSalePrice.toJSNumber(), + lastSaleDate, + lastSalePrice: lastSalePrice?.toJSNumber(), + floorPrice: floorPrice?.toJSNumber(), + averagePrice: averagePrice?.toJSNumber(), + listedCount, + fragmentListedCount, + fragmentListedUrl, + }; +} diff --git a/src/api/gramjs/methods/stars.ts b/src/api/gramjs/methods/stars.ts index ecacf446b..cdc16a7f4 100644 --- a/src/api/gramjs/methods/stars.ts +++ b/src/api/gramjs/methods/stars.ts @@ -21,6 +21,7 @@ import { buildApiStarsSubscription, buildApiStarsTransaction, buildApiStarTopupOption, + buildApiUniqueStarGiftValueInfo, } from '../apiBuilders/payments'; import { buildApiUser } from '../apiBuilders/users'; import { buildInputPeer, @@ -130,7 +131,8 @@ export async function fetchSavedStarGifts({ ...(filter && { sortByValue: filter.sortType === 'byValue' || undefined, excludeUnlimited: !filter.shouldIncludeUnlimited || undefined, - excludeLimited: !filter.shouldIncludeLimited || undefined, + excludeUpgradable: !filter.shouldIncludeUpgradable || undefined, + excludeUnupgradable: !filter.shouldIncludeLimited || undefined, excludeUnique: !filter.shouldIncludeUnique || undefined, excludeSaved: !filter.shouldIncludeDisplayed || undefined, excludeUnsaved: !filter.shouldIncludeHidden || undefined, @@ -441,6 +443,18 @@ export function updateStarGiftPrice({ }); } +export async function fetchUniqueStarGiftValueInfo({ slug }: { slug: string }) { + const result = await invokeRequest(new GramJs.payments.GetUniqueStarGiftValueInfo({ + slug, + })); + + if (!result) { + return undefined; + } + + return buildApiUniqueStarGiftValueInfo(result); +} + export async function fetchStarGiftWithdrawalUrl({ inputGift, password, diff --git a/src/api/types/payments.ts b/src/api/types/payments.ts index dbec67d54..e76ff4456 100644 --- a/src/api/types/payments.ts +++ b/src/api/types/payments.ts @@ -477,3 +477,20 @@ export type ApiRequestInputInvoice = ApiRequestInputInvoiceMessage | ApiRequestI | ApiRequestInputInvoiceChatInviteSubscription | ApiRequestInputInvoiceStarGift | ApiRequestInputInvoiceStarGiftUpgrade | ApiRequestInputInvoiceStarGiftTransfer | ApiRequestInputInvoicePremiumGiftStars | ApiRequestInputInvoiceStarGiftResale; + +export interface ApiUniqueStarGiftValueInfo { + isLastSaleOnFragment?: true; + isValueAverage?: true; + currency: string; + value: number; + initialSaleDate: number; + initialSaleStars: number; + initialSalePrice: number; + lastSaleDate?: number; + lastSalePrice?: number; + floorPrice?: number; + averagePrice?: number; + listedCount?: number; + fragmentListedCount?: number; + fragmentListedUrl?: string; +} diff --git a/src/api/types/stars.ts b/src/api/types/stars.ts index 2f8676445..4ede3dd26 100644 --- a/src/api/types/stars.ts +++ b/src/api/types/stars.ts @@ -31,6 +31,7 @@ export interface ApiStarGiftRegular { export interface ApiStarGiftUnique { type: 'starGiftUnique'; id: string; + regularGiftId: string; title: string; number: number; ownerId?: string; @@ -45,6 +46,8 @@ export interface ApiStarGiftUnique { releasedByPeerId?: string; requirePremium?: true; resaleTonOnly?: true; + valueCurrency?: string; + valueAmount?: number; } export type ApiStarGift = ApiStarGiftRegular | ApiStarGiftUnique; diff --git a/src/assets/localization/fallback.strings b/src/assets/localization/fallback.strings index 32edf5d55..d24ca73e5 100644 --- a/src/assets/localization/fallback.strings +++ b/src/assets/localization/fallback.strings @@ -1507,10 +1507,18 @@ "GiftInfoTonText" = "This gift is on the TON Blockchain. {link}"; "GiftInfoTonLinkText" = "View >"; "GiftInfoAvailability" = "Availability"; +"GiftInfoValueLinkMore" = "Learn More"; "GiftInfoAvailabilityValue_one" = "{count} of {total} left"; "GiftInfoAvailabilityValue_other" = "{count} of {total} left"; "GiftInfoFirstSale" = "First Sale"; "GiftInfoLastSale" = "Last Sale"; +"GiftValueTitleInitialSale" = "Initial Sale"; +"GiftValueTitleInitialPrice" = "Initial Price"; +"GiftValueTitleLastSale" = "Last Sale"; +"GiftValueTitleLastPrice" = "Last Price"; +"GiftValueTitleMinimumPrice" = "Minimum Price"; +"GiftValueTitleAveragePrice" = "Average Price"; +"GiftValueDescription" = "This is average sale price of **{giftName}** on Telegram and Fragment over the past month."; "GiftInfoSoldOutTitle" = "Unavailable"; "GiftInfoSoldOutDescription" = "This gift has been sold out"; "GiftInfoSenderHidden" = "Only you can see the sender's name and message."; @@ -1736,6 +1744,7 @@ "GiftFilterUnique" = "Unique"; "GiftFilterDisplayed" = "Displayed"; "GiftFilterHidden" = "Hidden"; +"GiftFilterUpgradable" = "Upgradable"; "GiftSearchEmpty" = "No matching gifts"; "GiftSearchReset" = "View All Gifts"; "SetUp2FA" = "Set up Two-Step Verification"; @@ -2271,4 +2280,5 @@ "ErrorFocusInaccessibleMessage" = "Unfortunately, you can't access this message. You aren't a member of the chat where it was posted."; "ContextMenuHintMouse" = "To edit or reply, close this menu. Then right click on a message."; "ContextMenuHintTouch" = "To edit or reply, close this menu. Then long tap on a message."; - +"GiftValueForSaleOnFragment" = "for sale on Fragment"; +"GiftValueForSaleOnTelegram" = "for sale on Telegram"; \ No newline at end of file diff --git a/src/bundles/stars.ts b/src/bundles/stars.ts index d3eef22fd..169f00725 100644 --- a/src/bundles/stars.ts +++ b/src/bundles/stars.ts @@ -8,6 +8,7 @@ export { default as PaidReactionModal } from '../components/modals/paidReaction/ export { default as GiftModal } from '../components/modals/gift/GiftModal'; export { default as GiftRecipientPicker } from '../components/modals/gift/recipient/GiftRecipientPicker'; export { default as GiftInfoModal } from '../components/modals/gift/info/GiftInfoModal'; +export { default as GiftInfoValueModal } from '../components/modals/gift/value/GiftInfoValueModal'; export { default as GiftResalePriceComposerModal } from '../components/modals/gift/resale/GiftResalePriceComposerModal'; export { default as GiftUpgradeModal } from '../components/modals/gift/upgrade/GiftUpgradeModal'; export { default as GiftStatusInfoModal } from '../components/modals/gift/status/GiftStatusInfoModal'; diff --git a/src/components/modals/ModalContainer.tsx b/src/components/modals/ModalContainer.tsx index c632c7994..14af550fa 100644 --- a/src/components/modals/ModalContainer.tsx +++ b/src/components/modals/ModalContainer.tsx @@ -26,6 +26,7 @@ import GiftResalePriceComposerModal from './gift/resale/GiftResalePriceComposerM import GiftStatusInfoModal from './gift/status/GiftStatusInfoModal.async'; import GiftTransferModal from './gift/transfer/GiftTransferModal.async'; import GiftUpgradeModal from './gift/upgrade/GiftUpgradeModal.async'; +import GiftInfoValueModal from './gift/value/GiftInfoValueModal.async'; import GiftWithdrawModal from './gift/withdraw/GiftWithdrawModal.async'; import GiftCodeModal from './giftcode/GiftCodeModal.async'; import InviteViaLinkModal from './inviteViaLink/InviteViaLinkModal.async'; @@ -78,6 +79,7 @@ type ModalKey = keyof Pick = ({ disallowedGifts, resaleGiftsCount, areResaleGiftsLoading, + selectedResaleGift, + tabId, }) => { const { - closeGiftModal, openGiftInfoModal, resetResaleGifts, loadResaleGifts, + closeGiftModal, openGiftInfoModal, resetResaleGifts, loadResaleGifts, openGiftInMarket, closeResaleGiftsMarket, } = getActions(); const dialogRef = useRef(); const transitionRef = useRef(); @@ -98,7 +102,6 @@ const GiftModal: FC = ({ const chat = peer && isApiPeerChat(peer) ? peer : undefined; const [selectedGift, setSelectedGift] = useState(); - const [selectedResellGift, setSelectedResellGift] = useState(); const [shouldShowMainScreenHeader, setShouldShowMainScreenHeader] = useState(false); const [isMainScreenHeaderForStarGifts, setIsMainScreenHeaderForStarGifts] = useState(false); const [isGiftScreenHeaderForStarGifts, setIsGiftScreenHeaderForStarGifts] = useState(false); @@ -154,25 +157,27 @@ const GiftModal: FC = ({ observe: observeIntersection, } = useIntersectionObserver({ rootRef: scrollerRef, throttleMs: INTERSECTION_THROTTLE, isDisabled: !isOpen }); - const isResaleScreen = Boolean(selectedResellGift) && !selectedGift; + const isResaleScreen = Boolean(selectedResaleGift) && !selectedGift; const isGiftScreen = Boolean(selectedGift); const shouldShowHeader = isResaleScreen || isGiftScreen || shouldShowMainScreenHeader; const isHeaderForStarGifts = isGiftScreen ? isGiftScreenHeaderForStarGifts : isMainScreenHeaderForStarGifts; useEffect(() => { - if (selectedResellGift) { - loadResaleGifts({ giftId: selectedResellGift.id }); + if (selectedResaleGift) { + const giftId = 'regularGiftId' in selectedResaleGift + ? selectedResaleGift.regularGiftId + : selectedResaleGift.id; + loadResaleGifts({ giftId }); } - }, [selectedResellGift]); + }, [selectedResaleGift]); useEffect(() => { if (!isOpen) { setShouldShowMainScreenHeader(false); setSelectedGift(undefined); - setSelectedResellGift(undefined); setSelectedCategory('all'); } - }, [isOpen]); + }, [isOpen, tabId, closeResaleGiftsMarket]); const handleScroll = useLastCallback((e: React.UIEvent) => { if (isGiftScreen) return; @@ -256,7 +261,7 @@ const GiftModal: FC = ({ openGiftInfoModal({ gift, recipientId: renderingModal?.forPeerId }); return; } - setSelectedResellGift(gift); + openGiftInMarket({ gift, tabId }); return; } setSelectedGift(gift); @@ -340,15 +345,13 @@ const GiftModal: FC = ({ const handleCloseModal = useLastCallback(() => { setSelectedGift(undefined); - setSelectedResellGift(undefined); resetResaleGifts(); closeGiftModal(); }); const handleCloseButtonClick = useLastCallback(() => { if (isResaleScreen) { - setSelectedResellGift(undefined); - resetResaleGifts(); + closeResaleGiftsMarket({ tabId }); return; } if (isGiftScreen) { @@ -426,7 +429,7 @@ const GiftModal: FC = ({ return (

- {selectedResellGift.title} + {selectedResaleGift.title}

{isFirstLoading && ( @@ -494,7 +497,7 @@ const GiftModal: FC = ({ activeKey={isGiftScreen ? 1 : isResaleScreen ? 2 : 0} > {!isGiftScreen && !isResaleScreen && renderMainScreen()} - {isResaleScreen && selectedResellGift + {isResaleScreen && selectedResaleGift && ( ((global, { modal }): StateProps => { const { resaleGifts } = selectTabState(global); const resaleGiftsCount = resaleGifts.count; const areResaleGiftsLoading = resaleGifts.isLoading !== false; + const selectedResaleGift = modal?.selectedResaleGift; return { boostPerSentGift: global.appConfig.boostsPerSentGift, @@ -537,6 +541,8 @@ export default memo(withGlobal((global, { modal }): StateProps => { disallowedGifts: userFullInfo?.disallowedGifts, resaleGiftsCount, areResaleGiftsLoading, + selectedResaleGift, + tabId: selectTabState(global).id, }; })(GiftModal)); diff --git a/src/components/modals/gift/GiftModalResaleScreen.tsx b/src/components/modals/gift/GiftModalResaleScreen.tsx index e50fc04d0..5be6beee5 100644 --- a/src/components/modals/gift/GiftModalResaleScreen.tsx +++ b/src/components/modals/gift/GiftModalResaleScreen.tsx @@ -69,7 +69,10 @@ const GiftModalResaleScreen: FC = ({ const handleLoadMoreResellGifts = useLastCallback(() => { if (gift) { - loadResaleGifts({ giftId: gift.id }); + const giftId = 'regularGiftId' in gift + ? gift.regularGiftId + : gift.id; + loadResaleGifts({ giftId }); } }); diff --git a/src/components/modals/gift/info/GiftInfoModal.module.scss b/src/components/modals/gift/info/GiftInfoModal.module.scss index eae2ff5d2..05932d3c1 100644 --- a/src/components/modals/gift/info/GiftInfoModal.module.scss +++ b/src/components/modals/gift/info/GiftInfoModal.module.scss @@ -138,12 +138,23 @@ line-height: 1; } +.uniqueValue, .uniqueAttribute { display: flex; gap: 0.25rem; align-items: center; } +.attributeName { + cursor: pointer; + color: var(--color-primary); + transition: opacity 0.15s; + + &:hover { + opacity: 0.75; + } +} + /* stylelint-disable-next-line plugin/stylelint-group-selectors */ .uniqueGift { margin-bottom: 0; diff --git a/src/components/modals/gift/info/GiftInfoModal.tsx b/src/components/modals/gift/info/GiftInfoModal.tsx index d28334652..f352f16f5 100644 --- a/src/components/modals/gift/info/GiftInfoModal.tsx +++ b/src/components/modals/gift/info/GiftInfoModal.tsx @@ -17,6 +17,7 @@ import { selectPeer, selectUser } from '../../../../global/selectors'; import buildClassName from '../../../../util/buildClassName'; import { copyTextToClipboard } from '../../../../util/clipboard'; import { formatDateTimeToString } from '../../../../util/dates/dateFormat'; +import { formatCurrencyAsString } from '../../../../util/formatCurrency'; import { formatStarsAsIcon, formatStarsAsText, formatTonAsIcon, formatTonAsText, } from '../../../../util/localization/format'; @@ -93,6 +94,9 @@ const GiftInfoModal = ({ showNotification, buyStarGift, closeGiftModal, + openGiftInfoValueModal, + updateResaleGiftsFilter, + openGiftInMarket, } = getActions(); const [isConvertConfirmOpen, openConvertConfirm, closeConvertConfirm] = useFlag(); @@ -102,6 +106,57 @@ const GiftInfoModal = ({ const [isConfirmModalOpen, setIsConfirmModalOpen] = useState(false); const [shouldPayInTon, setShouldPayInTon] = useState(false); + const handleSymbolClick = useLastCallback(() => { + if (!gift || !giftAttributes?.pattern) return; + + openGiftInMarket({ gift }); + updateResaleGiftsFilter({ + filter: { + sortType: 'byDate', + modelAttributes: [], + backdropAttributes: [], + patternAttributes: [{ + type: 'pattern', + documentId: giftAttributes.pattern.sticker.id, + }], + }, + }); + }); + + const handleBackdropClick = useLastCallback(() => { + if (!gift || !giftAttributes?.backdrop) return; + + openGiftInMarket({ gift }); + updateResaleGiftsFilter({ + filter: { + sortType: 'byDate', + modelAttributes: [], + backdropAttributes: [{ + type: 'backdrop', + backdropId: giftAttributes.backdrop.backdropId, + }], + patternAttributes: [], + }, + }); + }); + + const handleModelClick = useLastCallback(() => { + if (!gift || !giftAttributes?.model) return; + + openGiftInMarket({ gift }); + updateResaleGiftsFilter({ + filter: { + sortType: 'byDate', + modelAttributes: [{ + type: 'model', + documentId: giftAttributes.model.sticker.id, + }], + backdropAttributes: [], + patternAttributes: [], + }, + }); + }); + const isOpen = Boolean(modal); const renderingModal = useCurrentOrPrev(modal); const renderingFromPeer = useCurrentOrPrev(fromPeer); @@ -236,6 +291,14 @@ const GiftInfoModal = ({ buyStarGift({ peerId: peer.id, slug: gift.slug, price }); }); + const handleOpenValueModal = useLastCallback(() => { + if (!gift || gift.type !== 'starGiftUnique') return; + + openGiftInfoValueModal({ + gift, + }); + }); + const giftAttributes = useMemo(() => { return gift && getGiftAttributes(gift); }, [gift]); @@ -623,7 +686,12 @@ const GiftInfoModal = ({ tableData.push([ lang('GiftAttributeModel'), - {model.name} + + {model.name} + {formatPercent(model.rarityPercent)} , ]); @@ -633,7 +701,12 @@ const GiftInfoModal = ({ tableData.push([ lang('GiftAttributeBackdrop'), - {backdrop.name} + + {backdrop.name} + {formatPercent(backdrop.rarityPercent)} , ]); @@ -643,7 +716,12 @@ const GiftInfoModal = ({ tableData.push([ lang('GiftAttributeSymbol'), - {pattern.name} + + {pattern.name} + {formatPercent(pattern.rarityPercent)} , ]); @@ -657,6 +735,24 @@ const GiftInfoModal = ({ }), ]); + if (gift.valueAmount && gift.valueCurrency) { + tableData.push([ + lang('GiftInfoValue'), + + ~ + {' '} + {formatCurrencyAsString( + gift.valueAmount, + gift.valueCurrency, + lang.code, + )} + + {lang('GiftInfoValueLinkMore')} + + , + ]); + } + if (originalDetails) { const { date, recipientId, message, senderId, @@ -782,7 +878,7 @@ const GiftInfoModal = ({ SettingsMenuButton, isGiftUnique, renderingModal, collectibleEmojiStatuses, currentUserEmojiStatus, saleDateInfo, canBuyGift, giftOwnerTitle, isOpen, resellPrice, giftSubtitle, - releasedByPeer, + releasedByPeer, handleSymbolClick, handleBackdropClick, handleModelClick, ]); return ( diff --git a/src/components/modals/gift/value/GiftInfoValueModal.async.tsx b/src/components/modals/gift/value/GiftInfoValueModal.async.tsx new file mode 100644 index 000000000..4e6fdf498 --- /dev/null +++ b/src/components/modals/gift/value/GiftInfoValueModal.async.tsx @@ -0,0 +1,16 @@ +import type { FC } from '../../../../lib/teact/teact'; + +import type { OwnProps } from './GiftInfoValueModal'; + +import { Bundles } from '../../../../util/moduleLoader'; + +import useModuleLoader from '../../../../hooks/useModuleLoader'; + +const GiftInfoValueModalAsync: FC = (props) => { + const { modal } = props; + const GiftInfoValueModal = useModuleLoader(Bundles.Stars, 'GiftInfoValueModal', !modal); + + return GiftInfoValueModal ? : undefined; +}; + +export default GiftInfoValueModalAsync; diff --git a/src/components/modals/gift/value/GiftInfoValueModal.module.scss b/src/components/modals/gift/value/GiftInfoValueModal.module.scss new file mode 100644 index 000000000..5a117f49e --- /dev/null +++ b/src/components/modals/gift/value/GiftInfoValueModal.module.scss @@ -0,0 +1,39 @@ +.header { + display: flex; + flex-direction: column; + align-items: center; + + padding-inline: 1rem; + + text-align: center; +} + +.sticker { + margin-bottom: 0.75rem; +} + +.description { + margin-top: 0.75rem; + font-size: 0.875rem; + text-align: center; +} + +.initialPrice { + display: flex; + align-items: center; + line-height: 1; +} + +.starIcon { + margin-inline-start: 0 !important; +} + +.footer { + display: flex; + flex-direction: column; + gap: 0.125rem; +} + +.footerSticker { + margin-inline: 0.25rem; +} diff --git a/src/components/modals/gift/value/GiftInfoValueModal.tsx b/src/components/modals/gift/value/GiftInfoValueModal.tsx new file mode 100644 index 000000000..5a0404395 --- /dev/null +++ b/src/components/modals/gift/value/GiftInfoValueModal.tsx @@ -0,0 +1,190 @@ +import type { FC } from '../../../../lib/teact/teact'; +import { memo, useMemo } from '../../../../lib/teact/teact'; +import { getActions } from '../../../../global'; + +import type { TabState } from '../../../../global/types'; + +import { formatDateToString } from '../../../../util/dates/dateFormat'; +import { formatCurrencyAsString } from '../../../../util/formatCurrency'; +import { formatStarsAsIcon } from '../../../../util/localization/format'; +import { getGiftAttributes } from '../../../common/helpers/gifts'; + +import useCurrentOrPrev from '../../../../hooks/useCurrentOrPrev'; +import useLang from '../../../../hooks/useLang'; +import useLastCallback from '../../../../hooks/useLastCallback'; + +import AnimatedIconFromSticker from '../../../common/AnimatedIconFromSticker'; +import Button from '../../../ui/Button'; +import TableInfoModal, { type TableData } from '../../common/TableInfoModal'; + +import styles from './GiftInfoValueModal.module.scss'; + +export type OwnProps = { + modal: TabState['giftInfoValueModal']; +}; + +const HEADER_STICKER_SIZE = 120; +const FOOTER_STICKER_SIZE = 24; + +const GiftInfoValueModal: FC = ({ + modal, +}) => { + const { closeGiftInfoValueModal, openUrl, openGiftInMarket } = getActions(); + + const lang = useLang(); + + const isOpen = Boolean(modal); + const renderingModal = useCurrentOrPrev(modal); + + const handleOpenFragment = useLastCallback(() => { + if (modal?.valueInfo.fragmentListedUrl) { + openUrl({ url: modal.valueInfo.fragmentListedUrl }); + } + }); + + const handleOpenTelegramMarket = useLastCallback(() => { + if (modal?.gift) { + openGiftInMarket({ gift: modal.gift }); + } + }); + + const modalData = useMemo(() => { + if (!renderingModal) return undefined; + + const { gift, valueInfo } = renderingModal; + const giftAttributes = getGiftAttributes(gift); + + if (!giftAttributes) return undefined; + + const header = ( +
+ + +
+ {lang('GiftValueDescription', { giftName: gift.title }, { + withMarkdown: true, + withNodes: true, + })} +
+
+ ); + + const tableData: TableData = []; + + tableData.push([ + lang('GiftValueTitleInitialSale'), + formatDateToString(valueInfo.initialSaleDate * 1000, lang.code), + ]); + + tableData.push([ + lang('GiftValueTitleInitialPrice'), + + {formatStarsAsIcon(lang, valueInfo.initialSaleStars, { className: styles.starIcon })} + {' (~ '} + {formatCurrencyAsString(valueInfo.initialSalePrice, valueInfo.currency, lang.code)} + ) + , + ]); + + if (valueInfo.lastSaleDate) { + tableData.push([ + lang('GiftValueTitleLastSale'), + formatDateToString(valueInfo.lastSaleDate * 1000, lang.code), + ]); + } + + if (valueInfo.lastSalePrice) { + tableData.push([ + lang('GiftValueTitleLastPrice'), + formatCurrencyAsString(valueInfo.lastSalePrice, valueInfo.currency, lang.code), + ]); + } + + if (valueInfo.floorPrice) { + tableData.push([ + lang('GiftValueTitleMinimumPrice'), + formatCurrencyAsString(valueInfo.floorPrice, valueInfo.currency, lang.code), + ]); + } + + if (valueInfo.averagePrice) { + tableData.push([ + lang('GiftValueTitleAveragePrice'), + formatCurrencyAsString(valueInfo.averagePrice, valueInfo.currency, lang.code), + ]); + } + + const canBuyOnFragment = Boolean(valueInfo.fragmentListedUrl && valueInfo.fragmentListedCount); + const canBuyOnTelegram = Boolean(valueInfo.listedCount && valueInfo.listedCount); + const hasFooter = canBuyOnFragment || canBuyOnTelegram; + + const footer = hasFooter && ( +
+ {canBuyOnFragment && ( + + )} + + {canBuyOnTelegram && ( + + )} +
+ ); + + return { + header, + tableData, + footer, + }; + }, [lang, renderingModal, handleOpenFragment, handleOpenTelegramMarket]); + + if (!modalData) return undefined; + + return ( + + ); +}; + +export default memo(GiftInfoValueModal); diff --git a/src/components/right/RightHeader.tsx b/src/components/right/RightHeader.tsx index 061668706..c6880b063 100644 --- a/src/components/right/RightHeader.tsx +++ b/src/components/right/RightHeader.tsx @@ -199,6 +199,7 @@ const RightHeader: FC = ({ sortType: giftsSortType, shouldIncludeUnlimited: shouldIncludeUnlimitedGifts, shouldIncludeLimited: shouldIncludeLimitedGifts, + shouldIncludeUpgradable: shouldIncludeUpgradableGifts, shouldIncludeUnique: shouldIncludeUniqueGifts, shouldIncludeDisplayed: shouldIncludeDisplayedGifts, shouldIncludeHidden: shouldIncludeHiddenGifts, @@ -546,12 +547,26 @@ const RightHeader: FC = ({ icon={shouldIncludeLimitedGifts ? 'check' : 'placeholder'} onClick={() => updateGiftProfileFilter( - { peerId: chatId, filter: { shouldIncludeLimited: !shouldIncludeLimitedGifts } }, + { peerId: chatId, filter: { + shouldIncludeLimited: !shouldIncludeLimitedGifts, + } }, )} > {lang('GiftFilterLimited')} + updateGiftProfileFilter( + { peerId: chatId, filter: { + shouldIncludeUpgradable: !shouldIncludeUpgradableGifts, + } }, + )} + > + {lang('GiftFilterUpgradable')} + + => { const { - forUserId, tabId = getCurrentTabId(), + forUserId, selectedResaleGift, tabId = getCurrentTabId(), } = payload; if (selectIsCurrentUserFrozen(global)) { @@ -564,6 +564,7 @@ addActionHandler('openGiftModal', async (global, actions, payload): Promise { + const { gift, tabId = getCurrentTabId() } = payload; + + const giftModal = selectTabState(global, tabId).giftModal; + + actions.closeGiftInfoValueModal({ tabId }); + actions.closeGiftInfoModal({ tabId }); + + if (giftModal) { + return updateTabState(global, { + giftModal: { + ...giftModal, + selectedResaleGift: gift, + }, + }, tabId); + } + + actions.openGiftModal({ + forUserId: global.currentUserId!, + selectedResaleGift: gift, + tabId, + }); + + return global; +}); + +addActionHandler('closeResaleGiftsMarket', (global, actions, payload): ActionReturnType => { + const { tabId = getCurrentTabId() } = payload || {}; + + actions.resetResaleGifts({ tabId }); + + const giftModal = selectTabState(global, tabId).giftModal; + + if (giftModal) { + return updateTabState(global, { + giftModal: { + ...giftModal, + selectedResaleGift: undefined, + }, + }, tabId); + } + + return global; +}); + +addActionHandler('openGiftInfoValueModal', async (global, actions, payload): Promise => { + const { gift, tabId = getCurrentTabId() } = payload; + + const result = await callApi('fetchUniqueStarGiftValueInfo', { slug: gift.slug }); + if (!result) return; + + global = getGlobal(); + global = updateTabState(global, { + giftInfoValueModal: { + valueInfo: result, + gift, + }, + }, tabId); + setGlobal(global); +}); + addTabStateResetterAction('closeGiftInfoModal', 'giftInfoModal'); +addTabStateResetterAction('closeGiftInfoValueModal', 'giftInfoValueModal'); + addTabStateResetterAction('closeGiftResalePriceComposerModal', 'giftResalePriceComposerModal'); addTabStateResetterAction('closeGiftUpgradeModal', 'giftUpgradeModal'); diff --git a/src/global/types/actions.ts b/src/global/types/actions.ts index 25b19559d..5eb269c84 100644 --- a/src/global/types/actions.ts +++ b/src/global/types/actions.ts @@ -44,6 +44,7 @@ import type { ApiSendMessageAction, ApiSessionData, ApiStarGift, + ApiStarGiftUnique, ApiStarsSubscription, ApiStarsTransaction, ApiSticker, @@ -2541,6 +2542,7 @@ export interface ActionPayloads { openGiftModal: { forUserId: string; + selectedResaleGift?: ApiStarGift; } & WithTabId; closeGiftModal: WithTabId | undefined; sendStarGift: StarGiftInfo & WithTabId; @@ -2573,6 +2575,10 @@ export interface ActionPayloads { }) & WithTabId; closeGiftInfoModal: WithTabId | undefined; closeGiftResalePriceComposerModal: WithTabId | undefined; + openGiftInMarket: { + gift: ApiStarGift; + } & WithTabId; + closeResaleGiftsMarket: WithTabId | undefined; openGiftUpgradeModal: { giftId: string; @@ -2595,6 +2601,10 @@ export interface ActionPayloads { emojiStatus: ApiEmojiStatusCollectible; } & WithTabId; closeGiftStatusInfoModal: WithTabId | undefined; + openGiftInfoValueModal: { + gift: ApiStarGiftUnique; + } & WithTabId; + closeGiftInfoValueModal: WithTabId | undefined; processStarGiftWithdrawal: { gift: ApiInputSavedStarGift; password: string; diff --git a/src/global/types/tabState.ts b/src/global/types/tabState.ts index f49db8e4e..1f6ac82a8 100644 --- a/src/global/types/tabState.ts +++ b/src/global/types/tabState.ts @@ -41,6 +41,7 @@ import type { ApiStarGift, ApiStarGiftAttribute, ApiStarGiftAttributeCounter, + ApiStarGiftUnique, ApiStarGiveawayOption, ApiStarsSubscription, ApiStarsTransaction, @@ -49,6 +50,7 @@ import type { ApiTypeCurrencyAmount, ApiTypePrepaidGiveaway, ApiTypeStoryView, + ApiUniqueStarGiftValueInfo, ApiUser, ApiVideo, } from '../../api/types'; @@ -692,6 +694,7 @@ export type TabState = { giftModal?: { forPeerId: string; gifts?: ApiPremiumGiftCodeOption[]; + selectedResaleGift?: ApiStarGift; }; chatRefundModal?: { userId: string; @@ -823,6 +826,11 @@ export type TabState = { gift: ApiSavedStarGift | ApiStarGift; }; + giftInfoValueModal?: { + valueInfo: ApiUniqueStarGiftValueInfo; + gift: ApiStarGiftUnique; + }; + giftResalePriceComposerModal?: { peerId?: string; gift: ApiSavedStarGift | ApiStarGift; diff --git a/src/lib/gramjs/tl/AllTLObjects.ts b/src/lib/gramjs/tl/AllTLObjects.ts index aa409c9a7..dadfb9945 100644 --- a/src/lib/gramjs/tl/AllTLObjects.ts +++ b/src/lib/gramjs/tl/AllTLObjects.ts @@ -12,6 +12,6 @@ for (const tl of Object.values(Api)) { } } -export const LAYER = 211; +export const LAYER = 212; export { tlobjects }; diff --git a/src/lib/gramjs/tl/api.d.ts b/src/lib/gramjs/tl/api.d.ts index 28d6aca06..c526a6515 100644 --- a/src/lib/gramjs/tl/api.d.ts +++ b/src/lib/gramjs/tl/api.d.ts @@ -277,7 +277,7 @@ namespace Api { export type TypeBotMenuButton = BotMenuButtonDefault | BotMenuButtonCommands | BotMenuButton; export type TypeNotificationSound = NotificationSoundDefault | NotificationSoundNone | NotificationSoundLocal | NotificationSoundRingtone; export type TypeAttachMenuPeerType = AttachMenuPeerTypeSameBotPM | AttachMenuPeerTypeBotPM | AttachMenuPeerTypePM | AttachMenuPeerTypeChat | AttachMenuPeerTypeBroadcast; - export type TypeInputInvoice = InputInvoiceMessage | InputInvoiceSlug | InputInvoicePremiumGiftCode | InputInvoiceStars | InputInvoiceChatInviteSubscription | InputInvoiceStarGift | InputInvoiceStarGiftUpgrade | InputInvoiceStarGiftTransfer | InputInvoicePremiumGiftStars | InputInvoiceBusinessBotTransferStars | InputInvoiceStarGiftResale; + export type TypeInputInvoice = InputInvoiceMessage | InputInvoiceSlug | InputInvoicePremiumGiftCode | InputInvoiceStars | InputInvoiceChatInviteSubscription | InputInvoiceStarGift | InputInvoiceStarGiftUpgrade | InputInvoiceStarGiftTransfer | InputInvoicePremiumGiftStars | InputInvoiceBusinessBotTransferStars | InputInvoiceStarGiftResale | InputInvoiceStarGiftPrepaidUpgrade; export type TypeInputStorePaymentPurpose = InputStorePaymentPremiumSubscription | InputStorePaymentGiftPremium | InputStorePaymentPremiumGiftCode | InputStorePaymentPremiumGiveaway | InputStorePaymentStarsTopup | InputStorePaymentStarsGift | InputStorePaymentStarsGiveaway | InputStorePaymentAuthCode; export type TypePaymentFormMethod = PaymentFormMethod; export type TypeEmojiStatus = EmojiStatusEmpty | EmojiStatus | EmojiStatusCollectible | InputEmojiStatusCollectible; @@ -617,6 +617,7 @@ namespace Api { export type TypeStarGiftWithdrawalUrl = payments.StarGiftWithdrawalUrl; export type TypeResaleStarGifts = payments.ResaleStarGifts; export type TypeStarGiftCollections = payments.StarGiftCollectionsNotModified | payments.StarGiftCollections; + export type TypeUniqueStarGiftValueInfo = payments.UniqueStarGiftValueInfo; } export namespace phone { @@ -3199,6 +3200,7 @@ namespace Api { upgraded?: true; refunded?: true; canUpgrade?: true; + prepaidUpgrade?: true; gift: Api.TypeStarGift; message?: Api.TypeTextWithEntities; convertStars?: long; @@ -3207,6 +3209,8 @@ namespace Api { fromId?: Api.TypePeer; peer?: Api.TypePeer; savedId?: long; + prepaidUpgradeHash?: string; + giftMsgId?: int; }> { // flags: Api.Type; nameHidden?: true; @@ -3215,6 +3219,7 @@ namespace Api { upgraded?: true; refunded?: true; canUpgrade?: true; + prepaidUpgrade?: true; gift: Api.TypeStarGift; message?: Api.TypeTextWithEntities; convertStars?: long; @@ -3223,7 +3228,9 @@ namespace Api { fromId?: Api.TypePeer; peer?: Api.TypePeer; savedId?: long; - CONSTRUCTOR_ID: 1192749220; + prepaidUpgradeHash?: string; + giftMsgId?: int; + CONSTRUCTOR_ID: 4065191930; SUBCLASS_OF_ID: 2256589094; className: 'MessageActionStarGift'; @@ -3235,6 +3242,7 @@ namespace Api { transferred?: true; saved?: true; refunded?: true; + prepaidUpgrade?: true; gift: Api.TypeStarGift; canExportAt?: int; transferStars?: long; @@ -3250,6 +3258,7 @@ namespace Api { transferred?: true; saved?: true; refunded?: true; + prepaidUpgrade?: true; gift: Api.TypeStarGift; canExportAt?: int; transferStars?: long; @@ -14290,6 +14299,18 @@ namespace Api { static fromReader(reader: Reader): InputInvoiceStarGiftResale; } + export class InputInvoiceStarGiftPrepaidUpgrade extends VirtualClass<{ + peer: Api.TypeInputPeer; + hash: string; + }> { + peer: Api.TypeInputPeer; + hash: string; + CONSTRUCTOR_ID: 2584430776; + SUBCLASS_OF_ID: 1919851518; + className: 'InputInvoiceStarGiftPrepaidUpgrade'; + + static fromReader(reader: Reader): InputInvoiceStarGiftPrepaidUpgrade; + } export class InputStorePaymentPremiumSubscription extends VirtualClass<{ // flags: Api.Type; restore?: true; @@ -16516,6 +16537,7 @@ namespace Api { businessTransfer?: true; stargiftResale?: true; postsSearch?: true; + stargiftPrepaidUpgrade?: true; id: string; amount: Api.TypeStarsAmount; date: int; @@ -16550,6 +16572,7 @@ namespace Api { businessTransfer?: true; stargiftResale?: true; postsSearch?: true; + stargiftPrepaidUpgrade?: true; id: string; amount: Api.TypeStarsAmount; date: int; @@ -16838,6 +16861,7 @@ namespace Api { requirePremium?: true; resaleTonOnly?: true; id: long; + giftId: long; title: string; slug: string; num: int; @@ -16850,11 +16874,14 @@ namespace Api { giftAddress?: string; resellAmount?: Api.TypeStarsAmount[]; releasedBy?: Api.TypePeer; + valueAmount?: long; + valueCurrency?: string; }> { // flags: Api.Type; requirePremium?: true; resaleTonOnly?: true; id: long; + giftId: long; title: string; slug: string; num: int; @@ -16867,7 +16894,9 @@ namespace Api { giftAddress?: string; resellAmount?: Api.TypeStarsAmount[]; releasedBy?: Api.TypePeer; - CONSTRUCTOR_ID: 975654224; + valueAmount?: long; + valueCurrency?: string; + CONSTRUCTOR_ID: 648369470; SUBCLASS_OF_ID: 3273414923; className: 'StarGiftUnique'; @@ -17126,6 +17155,7 @@ namespace Api { canTransferAt?: int; canResellAt?: int; collectionId?: int[]; + prepaidUpgradeHash?: string; }> { // flags: Api.Type; nameHidden?: true; @@ -17146,7 +17176,8 @@ namespace Api { canTransferAt?: int; canResellAt?: int; collectionId?: int[]; - CONSTRUCTOR_ID: 514213599; + prepaidUpgradeHash?: string; + CONSTRUCTOR_ID: 430552434; SUBCLASS_OF_ID: 2385198100; className: 'SavedStarGift'; @@ -21528,6 +21559,44 @@ namespace Api { static fromReader(reader: Reader): StarGiftCollections; } + export class UniqueStarGiftValueInfo extends VirtualClass<{ + // flags: Api.Type; + lastSaleOnFragment?: true; + valueIsAverage?: true; + currency: string; + value: long; + initialSaleDate: int; + initialSaleStars: long; + initialSalePrice: long; + lastSaleDate?: int; + lastSalePrice?: long; + floorPrice?: long; + averagePrice?: long; + listedCount?: int; + fragmentListedCount?: int; + fragmentListedUrl?: string; + }> { + // flags: Api.Type; + lastSaleOnFragment?: true; + valueIsAverage?: true; + currency: string; + value: long; + initialSaleDate: int; + initialSaleStars: long; + initialSalePrice: long; + lastSaleDate?: int; + lastSalePrice?: long; + floorPrice?: long; + averagePrice?: long; + listedCount?: int; + fragmentListedCount?: int; + fragmentListedUrl?: string; + CONSTRUCTOR_ID: 1362093126; + SUBCLASS_OF_ID: 372595652; + className: 'UniqueStarGiftValueInfo'; + + static fromReader(reader: Reader): UniqueStarGiftValueInfo; + } } export namespace phone { @@ -24829,11 +24898,6 @@ namespace Api { }, Bool> { order: int[]; } - export class ToggleDialogFilterTags extends Request<{ - enabled: Bool; - }, Bool> { - enabled: Bool; - } export class GetOldFeaturedStickers extends Request<{ offset: int; limit: int; @@ -27304,9 +27368,10 @@ namespace Api { excludeUnsaved?: true; excludeSaved?: true; excludeUnlimited?: true; - excludeLimited?: true; excludeUnique?: true; sortByValue?: true; + excludeUpgradable?: true; + excludeUnupgradable?: true; peer: Api.TypeInputPeer; collectionId?: int; offset: string; @@ -27316,9 +27381,10 @@ namespace Api { excludeUnsaved?: true; excludeSaved?: true; excludeUnlimited?: true; - excludeLimited?: true; excludeUnique?: true; sortByValue?: true; + excludeUpgradable?: true; + excludeUnupgradable?: true; peer: Api.TypeInputPeer; collectionId?: int; offset: string; @@ -27430,6 +27496,11 @@ namespace Api { peer: Api.TypeInputPeer; hash: long; } + export class GetUniqueStarGiftValueInfo extends Request<{ + slug: string; + }, payments.TypeUniqueStarGiftValueInfo> { + slug: string; + } } export namespace stickers { @@ -28485,7 +28556,7 @@ namespace Api { | help.GetConfig | help.GetNearestDc | help.GetAppUpdate | help.GetInviteText | help.GetSupport | help.SetBotUpdatesStatus | help.GetCdnConfig | help.GetRecentMeUrls | help.GetTermsOfServiceUpdate | help.AcceptTermsOfService | help.GetDeepLinkInfo | help.GetAppConfig | help.SaveAppLog | help.GetPassportConfig | help.GetSupportName | help.GetUserInfo | help.EditUserInfo | help.GetPromoData | help.HidePromoData | help.DismissSuggestion | help.GetCountriesList | help.GetPremiumPromo | help.GetPeerColors | help.GetPeerProfileColors | help.GetTimezonesList | channels.ReadHistory | channels.DeleteMessages | channels.ReportSpam | channels.GetMessages | channels.GetParticipants | channels.GetParticipant | channels.GetChannels | channels.GetFullChannel | channels.CreateChannel | channels.EditAdmin | channels.EditTitle | channels.EditPhoto | channels.CheckUsername | channels.UpdateUsername | channels.JoinChannel | channels.LeaveChannel | channels.InviteToChannel | channels.DeleteChannel | channels.ExportMessageLink | channels.ToggleSignatures | channels.GetAdminedPublicChannels | channels.EditBanned | channels.GetAdminLog | channels.SetStickers | channels.ReadMessageContents | channels.DeleteHistory | channels.TogglePreHistoryHidden | channels.GetLeftChannels | channels.GetGroupsForDiscussion | channels.SetDiscussionGroup | channels.EditCreator | channels.EditLocation | channels.ToggleSlowMode | channels.GetInactiveChannels | channels.ConvertToGigagroup | channels.GetSendAs | channels.DeleteParticipantHistory | channels.ToggleJoinToSend | channels.ToggleJoinRequest | channels.ReorderUsernames | channels.ToggleUsername | channels.DeactivateAllUsernames | channels.ToggleForum | channels.CreateForumTopic | channels.GetForumTopics | channels.GetForumTopicsByID | channels.EditForumTopic | channels.UpdatePinnedForumTopic | channels.DeleteTopicHistory | channels.ReorderPinnedForumTopics | channels.ToggleAntiSpam | channels.ReportAntiSpamFalsePositive | channels.ToggleParticipantsHidden | channels.UpdateColor | channels.ToggleViewForumAsMessages | channels.GetChannelRecommendations | channels.UpdateEmojiStatus | channels.SetBoostsToUnblockRestrictions | channels.SetEmojiStickers | channels.RestrictSponsoredMessages | channels.SearchPosts | channels.UpdatePaidMessagesPrice | channels.ToggleAutotranslation | channels.GetMessageAuthor | channels.CheckSearchPostsFlood | bots.SendCustomRequest | bots.AnswerWebhookJSONQuery | bots.SetBotCommands | bots.ResetBotCommands | bots.GetBotCommands | bots.SetBotMenuButton | bots.GetBotMenuButton | bots.SetBotBroadcastDefaultAdminRights | bots.SetBotGroupDefaultAdminRights | bots.SetBotInfo | bots.GetBotInfo | bots.ReorderUsernames | bots.ToggleUsername | bots.CanSendMessage | bots.AllowSendMessage | bots.InvokeWebViewCustomMethod | bots.GetPopularAppBots | bots.AddPreviewMedia | bots.EditPreviewMedia | bots.DeletePreviewMedia | bots.ReorderPreviewMedias | bots.GetPreviewInfo | bots.GetPreviewMedias | bots.UpdateUserEmojiStatus | bots.ToggleUserEmojiStatusPermission | bots.CheckDownloadFileParams | bots.GetAdminedBots | bots.UpdateStarRefProgram | bots.SetCustomVerification | bots.GetBotRecommendations - | payments.GetPaymentForm | payments.GetPaymentReceipt | payments.ValidateRequestedInfo | payments.SendPaymentForm | payments.GetSavedInfo | payments.ClearSavedInfo | payments.GetBankCardData | payments.ExportInvoice | payments.AssignAppStoreTransaction | payments.AssignPlayMarketTransaction | payments.GetPremiumGiftCodeOptions | payments.CheckGiftCode | payments.ApplyGiftCode | payments.GetGiveawayInfo | payments.LaunchPrepaidGiveaway | payments.GetStarsTopupOptions | payments.GetStarsStatus | payments.GetStarsTransactions | payments.SendStarsForm | payments.RefundStarsCharge | payments.GetStarsRevenueStats | payments.GetStarsRevenueWithdrawalUrl | payments.GetStarsRevenueAdsAccountUrl | payments.GetStarsTransactionsByID | payments.GetStarsGiftOptions | payments.GetStarsSubscriptions | payments.ChangeStarsSubscription | payments.FulfillStarsSubscription | payments.GetStarsGiveawayOptions | payments.GetStarGifts | payments.SaveStarGift | payments.ConvertStarGift | payments.BotCancelStarsSubscription | payments.GetConnectedStarRefBots | payments.GetConnectedStarRefBot | payments.GetSuggestedStarRefBots | payments.ConnectStarRefBot | payments.EditConnectedStarRefBot | payments.GetStarGiftUpgradePreview | payments.UpgradeStarGift | payments.TransferStarGift | payments.GetUniqueStarGift | payments.GetSavedStarGifts | payments.GetSavedStarGift | payments.GetStarGiftWithdrawalUrl | payments.ToggleChatStarGiftNotifications | payments.ToggleStarGiftsPinnedToTop | payments.CanPurchaseStore | payments.GetResaleStarGifts | payments.UpdateStarGiftPrice | payments.CreateStarGiftCollection | payments.UpdateStarGiftCollection | payments.ReorderStarGiftCollections | payments.DeleteStarGiftCollection | payments.GetStarGiftCollections + | payments.GetPaymentForm | payments.GetPaymentReceipt | payments.ValidateRequestedInfo | payments.SendPaymentForm | payments.GetSavedInfo | payments.ClearSavedInfo | payments.GetBankCardData | payments.ExportInvoice | payments.AssignAppStoreTransaction | payments.AssignPlayMarketTransaction | payments.GetPremiumGiftCodeOptions | payments.CheckGiftCode | payments.ApplyGiftCode | payments.GetGiveawayInfo | payments.LaunchPrepaidGiveaway | payments.GetStarsTopupOptions | payments.GetStarsStatus | payments.GetStarsTransactions | payments.SendStarsForm | payments.RefundStarsCharge | payments.GetStarsRevenueStats | payments.GetStarsRevenueWithdrawalUrl | payments.GetStarsRevenueAdsAccountUrl | payments.GetStarsTransactionsByID | payments.GetStarsGiftOptions | payments.GetStarsSubscriptions | payments.ChangeStarsSubscription | payments.FulfillStarsSubscription | payments.GetStarsGiveawayOptions | payments.GetStarGifts | payments.SaveStarGift | payments.ConvertStarGift | payments.BotCancelStarsSubscription | payments.GetConnectedStarRefBots | payments.GetConnectedStarRefBot | payments.GetSuggestedStarRefBots | payments.ConnectStarRefBot | payments.EditConnectedStarRefBot | payments.GetStarGiftUpgradePreview | payments.UpgradeStarGift | payments.TransferStarGift | payments.GetUniqueStarGift | payments.GetSavedStarGifts | payments.GetSavedStarGift | payments.GetStarGiftWithdrawalUrl | payments.ToggleChatStarGiftNotifications | payments.ToggleStarGiftsPinnedToTop | payments.CanPurchaseStore | payments.GetResaleStarGifts | payments.UpdateStarGiftPrice | payments.CreateStarGiftCollection | payments.UpdateStarGiftCollection | payments.ReorderStarGiftCollections | payments.DeleteStarGiftCollection | payments.GetStarGiftCollections | payments.GetUniqueStarGiftValueInfo | stickers.CreateStickerSet | stickers.RemoveStickerFromSet | stickers.ChangeStickerPosition | stickers.AddStickerToSet | stickers.SetStickerSetThumb | stickers.CheckShortName | stickers.SuggestShortName | stickers.ChangeSticker | stickers.RenameStickerSet | stickers.DeleteStickerSet | stickers.ReplaceSticker | phone.GetCallConfig | phone.RequestCall | phone.AcceptCall | phone.ConfirmCall | phone.ReceivedCall | phone.DiscardCall | phone.SetCallRating | phone.SaveCallDebug | phone.SendSignalingData | phone.CreateGroupCall | phone.JoinGroupCall | phone.LeaveGroupCall | phone.InviteToGroupCall | phone.DiscardGroupCall | phone.ToggleGroupCallSettings | phone.GetGroupCall | phone.GetGroupParticipants | phone.CheckGroupCall | phone.ToggleGroupCallRecord | phone.EditGroupCallParticipant | phone.EditGroupCallTitle | phone.GetGroupCallJoinAs | phone.ExportGroupCallInvite | phone.ToggleGroupCallStartSubscription | phone.StartScheduledGroupCall | phone.SaveDefaultGroupCallJoinAs | phone.JoinGroupCallPresentation | phone.LeaveGroupCallPresentation | phone.GetGroupCallStreamChannels | phone.GetGroupCallStreamRtmpUrl | phone.SaveCallLog | phone.CreateConferenceCall | phone.DeleteConferenceCallParticipants | phone.SendConferenceCallBroadcast | phone.InviteConferenceCallParticipant | phone.DeclineConferenceCallInvite | phone.GetGroupCallChainBlocks | langpack.GetLangPack | langpack.GetStrings | langpack.GetDifference | langpack.GetLanguages | langpack.GetLanguage diff --git a/src/lib/gramjs/tl/apiTl.ts b/src/lib/gramjs/tl/apiTl.ts index cd950c1ee..44cba8d5d 100644 --- a/src/lib/gramjs/tl/apiTl.ts +++ b/src/lib/gramjs/tl/apiTl.ts @@ -159,8 +159,8 @@ messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector = MessageAction; @@ -1153,6 +1153,7 @@ inputInvoiceStarGiftTransfer#4a5f5bd9 stargift:InputSavedStarGift to_id:InputPee inputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int message:flags.0?TextWithEntities = InputInvoice; inputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice; inputInvoiceStarGiftResale#c39f5324 flags:# ton:flags.0?true slug:string to_id:InputPeer = InputInvoice; +inputInvoiceStarGiftPrepaidUpgrade#9a0b48b8 peer:InputPeer hash:string = InputInvoice; payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; messages.transcribedAudio#cfb9d957 flags:# pending:flags.0?true transcription_id:long text:string trial_remains_num:flags.1?int trial_remains_until_date:flags.1?int = messages.TranscribedAudio; help.premiumPromo#5334759c status_text:string status_entities:Vector video_sections:Vector videos:Vector period_options:Vector users:Vector = help.PremiumPromo; @@ -1368,7 +1369,7 @@ starsTransactionPeer#d80da15d peer:Peer = StarsTransactionPeer; starsTransactionPeerAds#60682812 = StarsTransactionPeer; starsTransactionPeerAPI#f9677aad = StarsTransactionPeer; starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption; -starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction; +starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction; payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus; foundStory#e87acbc0 peer:Peer story:StoryItem = FoundStory; stories.foundStories#e2de7737 flags:# count:int stories:Vector next_offset:flags.0?string chats:Vector users:Vector = stories.FoundStories; @@ -1388,7 +1389,7 @@ messageReactor#4ba3a95a flags:# top:flags.0?true my:flags.1?true anonymous:flags starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true stars:long yearly_boosts:int store_product:flags.2?string currency:string amount:long winners:Vector = StarsGiveawayOption; starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption; starGift#bcff5b flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int = StarGift; -starGiftUnique#3a274d50 flags:# require_premium:flags.6?true resale_ton_only:flags.7?true id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector released_by:flags.5?Peer = StarGift; +starGiftUnique#26a5553e flags:# require_premium:flags.6?true resale_ton_only:flags.7?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; payments.starGifts#2ed82995 hash:int gifts:Vector chats:Vector users:Vector = payments.StarGifts; messageReportOption#7903e3d9 text:string option:bytes = MessageReportOption; @@ -1417,7 +1418,7 @@ users.users#62d706b8 users:Vector = users.Users; users.usersSlice#315a4974 count:int users:Vector = users.Users; payments.uniqueStarGift#caa2f60b gift:StarGift users:Vector = payments.UniqueStarGift; messages.webPagePreview#b53e8b21 media:MessageMedia users:Vector = messages.WebPagePreview; -savedStarGift#1ea646df flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector = SavedStarGift; +savedStarGift#19a9b572 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector prepaid_upgrade_hash:flags.16?string = SavedStarGift; payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector next_offset:flags.0?string chats:Vector users:Vector = payments.SavedStarGifts; inputSavedStarGiftUser#69279795 msg_id:int = InputSavedStarGift; inputSavedStarGiftChat#f101aa7f peer:InputPeer saved_id:long = InputSavedStarGift; @@ -1454,6 +1455,7 @@ storyAlbum#9325705a flags:# album_id:int title:string icon_photo:flags.0?Photo i stories.albumsNotModified#564edaeb = stories.Albums; stories.albums#c3987a3a hash:long albums:Vector = stories.Albums; searchPostsFlood#3e0b5b6a flags:# query_is_free:flags.0?true total_daily:int remains:int wait_till:flags.1?int stars_amount:long = SearchPostsFlood; +payments.uniqueStarGiftValueInfo#512fe446 flags:# last_sale_on_fragment:flags.1?true value_is_average:flags.6?true currency:string value:long initial_sale_date:int initial_sale_stars:long initial_sale_price:long last_sale_date:flags.0?int last_sale_price:flags.0?long floor_price:flags.2?long average_price:flags.3?long listed_count:flags.4?int fragment_listed_count:flags.5?int fragment_listed_url:flags.5?string = payments.UniqueStarGiftValueInfo; ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; initConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X; @@ -1616,7 +1618,6 @@ messages.getDialogFilters#efd48c89 = messages.DialogFilters; messages.getSuggestedDialogFilters#a29cd42c = Vector; messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool; messages.updateDialogFiltersOrder#c563c1e4 order:Vector = Bool; -messages.toggleDialogFilterTags#fd2dda49 enabled:Bool = Bool; messages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; messages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage; messages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool; @@ -1791,11 +1792,12 @@ payments.getStarGiftUpgradePreview#9c9abcb1 gift_id:long = payments.StarGiftUpgr payments.upgradeStarGift#aed6e4f5 flags:# keep_original_details:flags.0?true stargift:InputSavedStarGift = Updates; payments.transferStarGift#7f18176a stargift:InputSavedStarGift to_id:InputPeer = Updates; payments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift; -payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_limited:flags.3?true exclude_unique:flags.4?true sort_by_value:flags.5?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts; +payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts; payments.getStarGiftWithdrawalUrl#d06e93a8 stargift:InputSavedStarGift password:InputCheckPasswordSRP = payments.StarGiftWithdrawalUrl; payments.toggleStarGiftsPinnedToTop#1513e7b0 peer:InputPeer stargift:Vector = Bool; payments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector offset:string limit:int = payments.ResaleStarGifts; payments.updateStarGiftPrice#edbe6ccb stargift:InputSavedStarGift resell_amount:StarsAmount = Updates; +payments.getUniqueStarGiftValueInfo#4365af6b slug:string = payments.UniqueStarGiftValueInfo; payments.getStarGiftCollections#981b91dd peer:InputPeer hash:long = payments.StarGiftCollections; phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall; diff --git a/src/lib/gramjs/tl/static/api.json b/src/lib/gramjs/tl/static/api.json index 16695a475..8ff434310 100644 --- a/src/lib/gramjs/tl/static/api.json +++ b/src/lib/gramjs/tl/static/api.json @@ -326,6 +326,7 @@ "payments.upgradeStarGift", "payments.transferStarGift", "payments.getUniqueStarGift", + "payments.getUniqueStarGiftValueInfo", "payments.getStarGiftWithdrawalUrl", "payments.toggleStarGiftsPinnedToTop", "payments.getResaleStarGifts", diff --git a/src/lib/gramjs/tl/static/api.tl b/src/lib/gramjs/tl/static/api.tl index f1b358f66..49e51b7d8 100644 --- a/src/lib/gramjs/tl/static/api.tl +++ b/src/lib/gramjs/tl/static/api.tl @@ -185,8 +185,8 @@ messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector = MessageAction; @@ -1504,6 +1504,7 @@ inputInvoiceStarGiftTransfer#4a5f5bd9 stargift:InputSavedStarGift to_id:InputPee inputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int message:flags.0?TextWithEntities = InputInvoice; inputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice; inputInvoiceStarGiftResale#c39f5324 flags:# ton:flags.0?true slug:string to_id:InputPeer = InputInvoice; +inputInvoiceStarGiftPrepaidUpgrade#9a0b48b8 peer:InputPeer hash:string = InputInvoice; payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; @@ -1853,7 +1854,7 @@ starsTransactionPeerAPI#f9677aad = StarsTransactionPeer; starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption; -starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction; +starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction; payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus; @@ -1892,7 +1893,7 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption; starGift#bcff5b flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int = StarGift; -starGiftUnique#3a274d50 flags:# require_premium:flags.6?true resale_ton_only:flags.7?true id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector released_by:flags.5?Peer = StarGift; +starGiftUnique#26a5553e flags:# require_premium:flags.6?true resale_ton_only:flags.7?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; payments.starGifts#2ed82995 hash:int gifts:Vector chats:Vector users:Vector = payments.StarGifts; @@ -1941,7 +1942,7 @@ payments.uniqueStarGift#caa2f60b gift:StarGift users:Vector = payments.Uni messages.webPagePreview#b53e8b21 media:MessageMedia users:Vector = messages.WebPagePreview; -savedStarGift#1ea646df flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector = SavedStarGift; +savedStarGift#19a9b572 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector prepaid_upgrade_hash:flags.16?string = SavedStarGift; payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector next_offset:flags.0?string chats:Vector users:Vector = payments.SavedStarGifts; @@ -2004,6 +2005,8 @@ stories.albums#c3987a3a hash:long albums:Vector = stories.Albums; searchPostsFlood#3e0b5b6a flags:# query_is_free:flags.0?true total_daily:int remains:int wait_till:flags.1?int stars_amount:long = SearchPostsFlood; +payments.uniqueStarGiftValueInfo#512fe446 flags:# last_sale_on_fragment:flags.1?true value_is_average:flags.6?true currency:string value:long initial_sale_date:int initial_sale_stars:long initial_sale_price:long last_sale_date:flags.0?int last_sale_price:flags.0?long floor_price:flags.2?long average_price:flags.3?long listed_count:flags.4?int fragment_listed_count:flags.5?int fragment_listed_url:flags.5?string = payments.UniqueStarGiftValueInfo; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -2311,7 +2314,6 @@ messages.getDialogFilters#efd48c89 = messages.DialogFilters; messages.getSuggestedDialogFilters#a29cd42c = Vector; messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool; messages.updateDialogFiltersOrder#c563c1e4 order:Vector = Bool; -messages.toggleDialogFilterTags#fd2dda49 enabled:Bool = Bool; messages.getOldFeaturedStickers#7ed094a1 offset:int limit:int hash:long = messages.FeaturedStickers; messages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; messages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage; @@ -2607,7 +2609,7 @@ payments.getStarGiftUpgradePreview#9c9abcb1 gift_id:long = payments.StarGiftUpgr payments.upgradeStarGift#aed6e4f5 flags:# keep_original_details:flags.0?true stargift:InputSavedStarGift = Updates; payments.transferStarGift#7f18176a stargift:InputSavedStarGift to_id:InputPeer = Updates; payments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift; -payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_limited:flags.3?true exclude_unique:flags.4?true sort_by_value:flags.5?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts; +payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts; payments.getSavedStarGift#b455a106 stargift:Vector = payments.SavedStarGifts; payments.getStarGiftWithdrawalUrl#d06e93a8 stargift:InputSavedStarGift password:InputCheckPasswordSRP = payments.StarGiftWithdrawalUrl; payments.toggleChatStarGiftNotifications#60eaefa1 flags:# enabled:flags.0?true peer:InputPeer = Bool; @@ -2620,6 +2622,7 @@ payments.updateStarGiftCollection#4fddbee7 flags:# peer:InputPeer collection_id: payments.reorderStarGiftCollections#c32af4cc peer:InputPeer order:Vector = Bool; payments.deleteStarGiftCollection#ad5648e8 peer:InputPeer collection_id:int = Bool; payments.getStarGiftCollections#981b91dd peer:InputPeer hash:long = payments.StarGiftCollections; +payments.getUniqueStarGiftValueInfo#4365af6b slug:string = payments.UniqueStarGiftValueInfo; stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector software:flags.3?string = messages.StickerSet; stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet; @@ -2746,4 +2749,4 @@ smsjobs.getStatus#10a698e8 = smsjobs.Status; smsjobs.getSmsJob#778d902f job_id:string = SmsJob; smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool; -fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; \ No newline at end of file +fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; diff --git a/src/types/index.ts b/src/types/index.ts index 38316b3d9..7f9a8a5ce 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -681,6 +681,7 @@ export type GiftProfileFilterOptions = { sortType: 'byDate' | 'byValue'; shouldIncludeUnlimited: boolean; shouldIncludeLimited: boolean; + shouldIncludeUpgradable: boolean; shouldIncludeUnique: boolean; shouldIncludeDisplayed: boolean; shouldIncludeHidden: boolean; diff --git a/src/types/language.d.ts b/src/types/language.d.ts index 2bd79bb2c..6723f950b 100644 --- a/src/types/language.d.ts +++ b/src/types/language.d.ts @@ -1254,8 +1254,15 @@ export interface LangPair { 'GiftActionHide': undefined; 'GiftInfoTonLinkText': undefined; 'GiftInfoAvailability': undefined; + 'GiftInfoValueLinkMore': undefined; 'GiftInfoFirstSale': undefined; 'GiftInfoLastSale': undefined; + 'GiftValueTitleInitialSale': undefined; + 'GiftValueTitleInitialPrice': undefined; + 'GiftValueTitleLastSale': undefined; + 'GiftValueTitleLastPrice': undefined; + 'GiftValueTitleMinimumPrice': undefined; + 'GiftValueTitleAveragePrice': undefined; 'GiftInfoSoldOutTitle': undefined; 'GiftInfoSoldOutDescription': undefined; 'GiftInfoSenderHidden': undefined; @@ -1417,6 +1424,7 @@ export interface LangPair { 'GiftFilterUnique': undefined; 'GiftFilterDisplayed': undefined; 'GiftFilterHidden': undefined; + 'GiftFilterUpgradable': undefined; 'GiftSearchEmpty': undefined; 'GiftSearchReset': undefined; 'SetUp2FA': undefined; @@ -1693,6 +1701,8 @@ export interface LangPair { 'ErrorFocusInaccessibleMessage': undefined; 'ContextMenuHintMouse': undefined; 'ContextMenuHintTouch': undefined; + 'GiftValueForSaleOnFragment': undefined; + 'GiftValueForSaleOnTelegram': undefined; } export interface LangPairWithVariables { @@ -2109,6 +2119,9 @@ export interface LangPairWithVariables { 'GiftInfoTonText': { 'link': V; }; + 'GiftValueDescription': { + 'giftName': V; + }; 'GiftInfoIssued': { 'issued': V; 'total': V;