@mtcute/core 0.19.7 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/client.cjs +24 -0
  2. package/client.js +24 -0
  3. package/highlevel/base.cjs +2 -2
  4. package/highlevel/base.js +2 -2
  5. package/highlevel/client.d.cts +68 -9
  6. package/highlevel/client.d.ts +68 -9
  7. package/highlevel/methods/files/normalize-input-media.cjs +12 -2
  8. package/highlevel/methods/files/normalize-input-media.js +12 -2
  9. package/highlevel/methods/messages/forward-messages.cjs +4 -2
  10. package/highlevel/methods/messages/forward-messages.d.cts +2 -0
  11. package/highlevel/methods/messages/forward-messages.d.ts +2 -0
  12. package/highlevel/methods/messages/forward-messages.js +4 -2
  13. package/highlevel/methods/premium/_normalize-input-star-gift.cjs +23 -0
  14. package/highlevel/methods/premium/_normalize-input-star-gift.d.cts +4 -0
  15. package/highlevel/methods/premium/_normalize-input-star-gift.d.ts +4 -0
  16. package/highlevel/methods/premium/_normalize-input-star-gift.js +18 -0
  17. package/highlevel/methods/premium/accept-star-gift.cjs +4 -3
  18. package/highlevel/methods/premium/accept-star-gift.d.cts +3 -3
  19. package/highlevel/methods/premium/accept-star-gift.d.ts +3 -3
  20. package/highlevel/methods/premium/accept-star-gift.js +4 -3
  21. package/highlevel/methods/premium/get-saved-star-gifts-by-id.cjs +21 -0
  22. package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.cts +6 -0
  23. package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.ts +6 -0
  24. package/highlevel/methods/premium/get-saved-star-gifts-by-id.js +16 -0
  25. package/highlevel/methods/premium/get-saved-star-gifts.cjs +32 -0
  26. package/highlevel/methods/premium/get-saved-star-gifts.d.cts +24 -0
  27. package/highlevel/methods/premium/get-saved-star-gifts.d.ts +24 -0
  28. package/highlevel/methods/premium/get-saved-star-gifts.js +27 -0
  29. package/highlevel/methods/premium/get-star-gift-withdrawal-url.cjs +23 -0
  30. package/highlevel/methods/premium/get-star-gift-withdrawal-url.d.cts +8 -0
  31. package/highlevel/methods/premium/get-star-gift-withdrawal-url.d.ts +8 -0
  32. package/highlevel/methods/premium/get-star-gift-withdrawal-url.js +18 -0
  33. package/highlevel/methods/premium/get-unique-star-gift.cjs +20 -0
  34. package/highlevel/methods/premium/get-unique-star-gift.d.cts +6 -0
  35. package/highlevel/methods/premium/get-unique-star-gift.d.ts +6 -0
  36. package/highlevel/methods/premium/get-unique-star-gift.js +15 -0
  37. package/highlevel/methods/premium/iter-saved-star-gifts.cjs +33 -0
  38. package/highlevel/methods/premium/iter-saved-star-gifts.d.cts +27 -0
  39. package/highlevel/methods/premium/iter-saved-star-gifts.d.ts +27 -0
  40. package/highlevel/methods/premium/iter-saved-star-gifts.js +28 -0
  41. package/highlevel/methods/premium/send-star-gift.cjs +2 -2
  42. package/highlevel/methods/premium/send-star-gift.d.cts +2 -2
  43. package/highlevel/methods/premium/send-star-gift.d.ts +2 -2
  44. package/highlevel/methods/premium/send-star-gift.js +3 -3
  45. package/highlevel/methods/premium/transfer-star-gift.cjs +4 -4
  46. package/highlevel/methods/premium/transfer-star-gift.d.cts +3 -3
  47. package/highlevel/methods/premium/transfer-star-gift.d.ts +3 -3
  48. package/highlevel/methods/premium/transfer-star-gift.js +5 -5
  49. package/highlevel/methods/premium/upgrade-star-gift.cjs +3 -3
  50. package/highlevel/methods/premium/upgrade-star-gift.d.cts +2 -2
  51. package/highlevel/methods/premium/upgrade-star-gift.d.ts +2 -2
  52. package/highlevel/methods/premium/upgrade-star-gift.js +3 -3
  53. package/highlevel/methods/users/set-emoji-status.cjs +8 -1
  54. package/highlevel/methods/users/set-emoji-status.d.cts +2 -0
  55. package/highlevel/methods/users/set-emoji-status.d.ts +2 -0
  56. package/highlevel/methods/users/set-emoji-status.js +8 -1
  57. package/highlevel/methods.d.cts +6 -0
  58. package/highlevel/methods.d.ts +6 -0
  59. package/highlevel/types/media/input-media/types.d.cts +4 -0
  60. package/highlevel/types/media/input-media/types.d.ts +4 -0
  61. package/highlevel/types/media/video.cjs +8 -0
  62. package/highlevel/types/media/video.d.cts +3 -0
  63. package/highlevel/types/media/video.d.ts +3 -0
  64. package/highlevel/types/media/video.js +8 -0
  65. package/highlevel/types/messages/message-action.cjs +22 -1
  66. package/highlevel/types/messages/message-action.d.cts +4 -0
  67. package/highlevel/types/messages/message-action.d.ts +4 -0
  68. package/highlevel/types/messages/message-action.js +22 -1
  69. package/highlevel/types/peers/chat.cjs +3 -1
  70. package/highlevel/types/peers/chat.js +3 -1
  71. package/highlevel/types/peers/full-chat.cjs +8 -0
  72. package/highlevel/types/peers/full-chat.d.cts +4 -0
  73. package/highlevel/types/peers/full-chat.d.ts +4 -0
  74. package/highlevel/types/peers/full-chat.js +8 -0
  75. package/highlevel/types/peers/user.cjs +3 -1
  76. package/highlevel/types/peers/user.js +3 -1
  77. package/highlevel/types/premium/index.d.cts +1 -0
  78. package/highlevel/types/premium/index.d.ts +1 -0
  79. package/highlevel/types/premium/saved-star-gift.cjs +80 -0
  80. package/highlevel/types/premium/saved-star-gift.d.cts +39 -0
  81. package/highlevel/types/premium/saved-star-gift.d.ts +39 -0
  82. package/highlevel/types/premium/saved-star-gift.js +75 -0
  83. package/highlevel/types/premium/stars-gift-unique.cjs +18 -5
  84. package/highlevel/types/premium/stars-gift-unique.d.cts +11 -5
  85. package/highlevel/types/premium/stars-gift-unique.d.ts +11 -5
  86. package/highlevel/types/premium/stars-gift-unique.js +18 -5
  87. package/highlevel/types/premium/stars-gift.d.cts +12 -1
  88. package/highlevel/types/premium/stars-gift.d.ts +12 -1
  89. package/highlevel/types/reactions/emoji-status.cjs +38 -1
  90. package/highlevel/types/reactions/emoji-status.d.cts +23 -2
  91. package/highlevel/types/reactions/emoji-status.d.ts +23 -2
  92. package/highlevel/types/reactions/emoji-status.js +39 -2
  93. package/highlevel/types/stories/interactive/index.cjs +4 -0
  94. package/highlevel/types/stories/interactive/index.d.cts +3 -2
  95. package/highlevel/types/stories/interactive/index.d.ts +3 -2
  96. package/highlevel/types/stories/interactive/index.js +4 -0
  97. package/highlevel/types/stories/interactive/star-gift.cjs +22 -0
  98. package/highlevel/types/stories/interactive/star-gift.d.cts +12 -0
  99. package/highlevel/types/stories/interactive/star-gift.d.ts +12 -0
  100. package/highlevel/types/stories/interactive/star-gift.js +17 -0
  101. package/highlevel/updates/manager.cjs +11 -9
  102. package/highlevel/updates/manager.d.cts +1 -3
  103. package/highlevel/updates/manager.d.ts +1 -3
  104. package/highlevel/updates/manager.js +11 -9
  105. package/index.cjs +5 -0
  106. package/index.js +6 -1
  107. package/methods.cjs +12 -0
  108. package/methods.js +12 -0
  109. package/network/network-manager.cjs +1 -1
  110. package/network/network-manager.js +1 -1
  111. package/package.json +2 -2
@@ -0,0 +1,12 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { StoryInteractiveArea } from './base.js';
3
+ /**
4
+ * Interactive element containing a star gift
5
+ */
6
+ export declare class StoryInteractiveStarGift extends StoryInteractiveArea {
7
+ readonly raw: tl.RawMediaAreaStarGift;
8
+ readonly type: "star_gift";
9
+ constructor(raw: tl.RawMediaAreaStarGift);
10
+ /** Star gift slug */
11
+ get slug(): string;
12
+ }
@@ -0,0 +1,17 @@
1
+ import { StoryInteractiveArea } from "./base.js";
2
+ import { makeInspectable } from "../../../utils/inspectable.js";
3
+ class StoryInteractiveStarGift extends StoryInteractiveArea {
4
+ constructor(raw) {
5
+ super(raw);
6
+ this.raw = raw;
7
+ }
8
+ type = "star_gift";
9
+ /** Star gift slug */
10
+ get slug() {
11
+ return this.raw.slug;
12
+ }
13
+ }
14
+ const StoryInteractiveStarGift$1 = /* @__PURE__ */ makeInspectable(StoryInteractiveStarGift);
15
+ export {
16
+ StoryInteractiveStarGift$1 as StoryInteractiveStarGift
17
+ };
@@ -44,7 +44,7 @@ class UpdatesManager {
44
44
  this._channelPtsLimit = () => limit;
45
45
  }
46
46
  } else {
47
- this._channelPtsLimit = () => this.auth?.isBot ? 1e5 : 100;
47
+ this._channelPtsLimit = () => this.client.storage.self.getCached()?.isBot ? 1e5 : 100;
48
48
  }
49
49
  }
50
50
  updatesLoopActive = false;
@@ -91,8 +91,6 @@ class UpdatesManager {
91
91
  };
92
92
  // eslint-disable-next-line ts/no-unsafe-function-type
93
93
  _channelPtsLimit;
94
- auth;
95
- // todo: do we need a local copy?
96
94
  keepAliveInterval;
97
95
  onCatchingUp(handler) {
98
96
  this._onCatchingUp = handler;
@@ -100,8 +98,7 @@ class UpdatesManager {
100
98
  destroy() {
101
99
  this.stopLoop();
102
100
  }
103
- notifyLoggedIn(self) {
104
- this.auth = self;
101
+ notifyLoggedIn() {
105
102
  this.startLoop().catch((err) => this.client.onError.emit(utils.unknownToError(err)));
106
103
  }
107
104
  notifyLoggedOut() {
@@ -915,7 +912,7 @@ class UpdatesManager {
915
912
  case "updateUserName":
916
913
  break;
917
914
  case "updateDeleteChannelMessages":
918
- if (!this.auth?.isBot) {
915
+ if (!client.storage.self.getCached()?.isBot) {
919
916
  await client.storage.refMsgs.delete(peerUtils.toggleChannelIdMark(upd.channelId), upd.messages);
920
917
  }
921
918
  break;
@@ -923,13 +920,13 @@ class UpdatesManager {
923
920
  case "updateEditMessage":
924
921
  case "updateNewChannelMessage":
925
922
  case "updateEditChannelMessage":
926
- if (!this.auth?.isBot) {
923
+ if (!client.storage.self.getCached()?.isBot) {
927
924
  await this._storeMessageReferences(upd.message);
928
925
  }
929
926
  break;
930
927
  }
931
928
  if (missing?.size) {
932
- if (this.auth?.isBot) {
929
+ if (client.storage.self.getCached()?.isBot) {
933
930
  this.log.warn(
934
931
  "missing peers (%J) after getDifference for %s (pts = %d, cid = %d)",
935
932
  missing,
@@ -1098,6 +1095,11 @@ class UpdatesManager {
1098
1095
  }
1099
1096
  case "updateShortMessage": {
1100
1097
  log.debug("received updateShortMessage");
1098
+ const self = client.storage.self.getCached();
1099
+ if (!self) {
1100
+ log.warn("received updateShortMessage without auth");
1101
+ break;
1102
+ }
1101
1103
  const message = {
1102
1104
  _: "message",
1103
1105
  out: upd.out,
@@ -1107,7 +1109,7 @@ class UpdatesManager {
1107
1109
  id: upd.id,
1108
1110
  fromId: {
1109
1111
  _: "peerUser",
1110
- userId: upd.out ? this.auth.userId : upd.userId
1112
+ userId: upd.out ? self.userId : upd.userId
1111
1113
  },
1112
1114
  peerId: {
1113
1115
  _: "peerUser",
@@ -1,6 +1,5 @@
1
1
  import { Logger, EarlyTimer, SortedLinkedList } from '../../utils/index.js';
2
2
  import { BaseTelegramClient } from '../base.js';
3
- import { CurrentUserInfo } from '../storage/service/current-user.js';
4
3
  import { AsyncLock, ConditionVariable, Deque, timers } from '@fuman/utils';
5
4
  import { tl } from '@mtcute/tl';
6
5
  import { PeersIndex } from '../types/peers/peers-index.js';
@@ -40,12 +39,11 @@ export declare class UpdatesManager {
40
39
  log: Logger;
41
40
  private _onCatchingUp;
42
41
  private _channelPtsLimit;
43
- auth?: CurrentUserInfo | null;
44
42
  keepAliveInterval?: timers.Interval;
45
43
  constructor(client: BaseTelegramClient, params?: UpdatesManagerParams);
46
44
  onCatchingUp(handler: (catchingUp: boolean) => void): void;
47
45
  destroy(): void;
48
- notifyLoggedIn(self: CurrentUserInfo): void;
46
+ notifyLoggedIn(): void;
49
47
  notifyLoggedOut(): void;
50
48
  prepare(): Promise<void>;
51
49
  private _onKeepAlive;
@@ -1,6 +1,5 @@
1
1
  import { Logger, EarlyTimer, SortedLinkedList } from '../../utils/index.js';
2
2
  import { BaseTelegramClient } from '../base.js';
3
- import { CurrentUserInfo } from '../storage/service/current-user.js';
4
3
  import { AsyncLock, ConditionVariable, Deque, timers } from '@fuman/utils';
5
4
  import { tl } from '@mtcute/tl';
6
5
  import { PeersIndex } from '../types/peers/peers-index.js';
@@ -40,12 +39,11 @@ export declare class UpdatesManager {
40
39
  log: Logger;
41
40
  private _onCatchingUp;
42
41
  private _channelPtsLimit;
43
- auth?: CurrentUserInfo | null;
44
42
  keepAliveInterval?: timers.Interval;
45
43
  constructor(client: BaseTelegramClient, params?: UpdatesManagerParams);
46
44
  onCatchingUp(handler: (catchingUp: boolean) => void): void;
47
45
  destroy(): void;
48
- notifyLoggedIn(self: CurrentUserInfo): void;
46
+ notifyLoggedIn(): void;
49
47
  notifyLoggedOut(): void;
50
48
  prepare(): Promise<void>;
51
49
  private _onKeepAlive;
@@ -37,7 +37,7 @@ class UpdatesManager {
37
37
  this._channelPtsLimit = () => limit;
38
38
  }
39
39
  } else {
40
- this._channelPtsLimit = () => this.auth?.isBot ? 1e5 : 100;
40
+ this._channelPtsLimit = () => this.client.storage.self.getCached()?.isBot ? 1e5 : 100;
41
41
  }
42
42
  }
43
43
  updatesLoopActive = false;
@@ -84,8 +84,6 @@ class UpdatesManager {
84
84
  };
85
85
  // eslint-disable-next-line ts/no-unsafe-function-type
86
86
  _channelPtsLimit;
87
- auth;
88
- // todo: do we need a local copy?
89
87
  keepAliveInterval;
90
88
  onCatchingUp(handler) {
91
89
  this._onCatchingUp = handler;
@@ -93,8 +91,7 @@ class UpdatesManager {
93
91
  destroy() {
94
92
  this.stopLoop();
95
93
  }
96
- notifyLoggedIn(self) {
97
- this.auth = self;
94
+ notifyLoggedIn() {
98
95
  this.startLoop().catch((err) => this.client.onError.emit(unknownToError(err)));
99
96
  }
100
97
  notifyLoggedOut() {
@@ -908,7 +905,7 @@ class UpdatesManager {
908
905
  case "updateUserName":
909
906
  break;
910
907
  case "updateDeleteChannelMessages":
911
- if (!this.auth?.isBot) {
908
+ if (!client.storage.self.getCached()?.isBot) {
912
909
  await client.storage.refMsgs.delete(toggleChannelIdMark(upd.channelId), upd.messages);
913
910
  }
914
911
  break;
@@ -916,13 +913,13 @@ class UpdatesManager {
916
913
  case "updateEditMessage":
917
914
  case "updateNewChannelMessage":
918
915
  case "updateEditChannelMessage":
919
- if (!this.auth?.isBot) {
916
+ if (!client.storage.self.getCached()?.isBot) {
920
917
  await this._storeMessageReferences(upd.message);
921
918
  }
922
919
  break;
923
920
  }
924
921
  if (missing?.size) {
925
- if (this.auth?.isBot) {
922
+ if (client.storage.self.getCached()?.isBot) {
926
923
  this.log.warn(
927
924
  "missing peers (%J) after getDifference for %s (pts = %d, cid = %d)",
928
925
  missing,
@@ -1091,6 +1088,11 @@ class UpdatesManager {
1091
1088
  }
1092
1089
  case "updateShortMessage": {
1093
1090
  log.debug("received updateShortMessage");
1091
+ const self = client.storage.self.getCached();
1092
+ if (!self) {
1093
+ log.warn("received updateShortMessage without auth");
1094
+ break;
1095
+ }
1094
1096
  const message = {
1095
1097
  _: "message",
1096
1098
  out: upd.out,
@@ -1100,7 +1102,7 @@ class UpdatesManager {
1100
1102
  id: upd.id,
1101
1103
  fromId: {
1102
1104
  _: "peerUser",
1103
- userId: upd.out ? this.auth.userId : upd.userId
1105
+ userId: upd.out ? self.userId : upd.userId
1104
1106
  },
1105
1107
  peerId: {
1106
1108
  _: "peerUser",
package/index.cjs CHANGED
@@ -89,6 +89,7 @@ const businessConnection = require("./highlevel/types/premium/business-connectio
89
89
  const businessIntro = require("./highlevel/types/premium/business-intro.cjs");
90
90
  const businessLocation = require("./highlevel/types/premium/business-location.cjs");
91
91
  const businessWorkHours = require("./highlevel/types/premium/business-work-hours.cjs");
92
+ const savedStarGift = require("./highlevel/types/premium/saved-star-gift.cjs");
92
93
  const starsGiftUnique = require("./highlevel/types/premium/stars-gift-unique.cjs");
93
94
  const starsGift = require("./highlevel/types/premium/stars-gift.cjs");
94
95
  const starsStatus = require("./highlevel/types/premium/stars-status.cjs");
@@ -102,6 +103,7 @@ const input = require("./highlevel/types/stories/interactive/input.cjs");
102
103
  const channelPost = require("./highlevel/types/stories/interactive/channel-post.cjs");
103
104
  const location$1 = require("./highlevel/types/stories/interactive/location.cjs");
104
105
  const reaction = require("./highlevel/types/stories/interactive/reaction.cjs");
106
+ const starGift = require("./highlevel/types/stories/interactive/star-gift.cjs");
105
107
  const url = require("./highlevel/types/stories/interactive/url.cjs");
106
108
  const venue$1 = require("./highlevel/types/stories/interactive/venue.cjs");
107
109
  const weather = require("./highlevel/types/stories/interactive/weather.cjs");
@@ -253,6 +255,7 @@ exports.BusinessIntro = businessIntro.BusinessIntro;
253
255
  exports.BusinessLocation = businessLocation.BusinessLocation;
254
256
  exports.BusinessWorkHours = businessWorkHours.BusinessWorkHours;
255
257
  exports.businessWorkHoursDaysToRaw = businessWorkHours.businessWorkHoursDaysToRaw;
258
+ exports.SavedStarGift = savedStarGift.SavedStarGift;
256
259
  exports.StarGiftUnique = starsGiftUnique.StarGiftUnique;
257
260
  exports.StarGiftUniqueAttribute = starsGiftUnique.StarGiftUniqueAttribute;
258
261
  exports.StarGiftUniqueBackdrop = starsGiftUnique.StarGiftUniqueBackdrop;
@@ -262,6 +265,7 @@ exports.UserStarGift = starsGift.UserStarGift;
262
265
  exports.StarsStatus = starsStatus.StarsStatus;
263
266
  exports.StarsTransaction = starsTransaction.StarsTransaction;
264
267
  exports.EmojiStatus = emojiStatus.EmojiStatus;
268
+ exports.EmojiStatusCollectible = emojiStatus.EmojiStatusCollectible;
265
269
  exports.PaidPeerReaction = peerReaction.PaidPeerReaction;
266
270
  exports.PeerReaction = peerReaction.PeerReaction;
267
271
  exports.ReactionCount = reactionCount.ReactionCount;
@@ -272,6 +276,7 @@ exports.StoryElement = input.StoryElement;
272
276
  exports.StoryInteractiveChannelPost = channelPost.StoryInteractiveChannelPost;
273
277
  exports.StoryInteractiveLocation = location$1.StoryInteractiveLocation;
274
278
  exports.StoryInteractiveReaction = reaction.StoryInteractiveReaction;
279
+ exports.StoryInteractiveStarGift = starGift.StoryInteractiveStarGift;
275
280
  exports.StoryInteractiveUrl = url.StoryInteractiveUrl;
276
281
  exports.StoryInteractiveVenue = venue$1.StoryInteractiveVenue;
277
282
  exports.StoryInteractiveWeather = weather.StoryInteractiveWeather;
package/index.js CHANGED
@@ -82,11 +82,12 @@ import { BusinessConnection } from "./highlevel/types/premium/business-connectio
82
82
  import { BusinessIntro } from "./highlevel/types/premium/business-intro.js";
83
83
  import { BusinessLocation } from "./highlevel/types/premium/business-location.js";
84
84
  import { BusinessWorkHours, businessWorkHoursDaysToRaw } from "./highlevel/types/premium/business-work-hours.js";
85
+ import { SavedStarGift } from "./highlevel/types/premium/saved-star-gift.js";
85
86
  import { StarGiftUnique, StarGiftUniqueAttribute, StarGiftUniqueBackdrop, StarGiftUniqueOriginalDetails } from "./highlevel/types/premium/stars-gift-unique.js";
86
87
  import { StarGift, UserStarGift } from "./highlevel/types/premium/stars-gift.js";
87
88
  import { StarsStatus } from "./highlevel/types/premium/stars-status.js";
88
89
  import { StarsTransaction } from "./highlevel/types/premium/stars-transaction.js";
89
- import { EmojiStatus } from "./highlevel/types/reactions/emoji-status.js";
90
+ import { EmojiStatus, EmojiStatusCollectible } from "./highlevel/types/reactions/emoji-status.js";
90
91
  import { PaidPeerReaction, PeerReaction } from "./highlevel/types/reactions/peer-reaction.js";
91
92
  import { ReactionCount } from "./highlevel/types/reactions/reaction-count.js";
92
93
  import { normalizeInputReaction, toReactionEmoji } from "./highlevel/types/reactions/types.js";
@@ -95,6 +96,7 @@ import { StoryElement } from "./highlevel/types/stories/interactive/input.js";
95
96
  import { StoryInteractiveChannelPost } from "./highlevel/types/stories/interactive/channel-post.js";
96
97
  import { StoryInteractiveLocation } from "./highlevel/types/stories/interactive/location.js";
97
98
  import { StoryInteractiveReaction } from "./highlevel/types/stories/interactive/reaction.js";
99
+ import { StoryInteractiveStarGift } from "./highlevel/types/stories/interactive/star-gift.js";
98
100
  import { StoryInteractiveUrl } from "./highlevel/types/stories/interactive/url.js";
99
101
  import { StoryInteractiveVenue } from "./highlevel/types/stories/interactive/venue.js";
100
102
  import { StoryInteractiveWeather } from "./highlevel/types/stories/interactive/weather.js";
@@ -196,6 +198,7 @@ export {
196
198
  Document,
197
199
  DraftMessage,
198
200
  EmojiStatus,
201
+ EmojiStatusCollectible,
199
202
  ExtendedMediaPreview,
200
203
  FactCheck,
201
204
  FileLocation,
@@ -253,6 +256,7 @@ export {
253
256
  RawUpdateInfo,
254
257
  ReactionCount,
255
258
  RepliedMessageInfo,
259
+ SavedStarGift,
256
260
  SearchFilters,
257
261
  SentCode,
258
262
  SessionConnection,
@@ -273,6 +277,7 @@ export {
273
277
  StoryInteractiveChannelPost,
274
278
  StoryInteractiveLocation,
275
279
  StoryInteractiveReaction,
280
+ StoryInteractiveStarGift,
276
281
  StoryInteractiveUrl,
277
282
  StoryInteractiveVenue,
278
283
  StoryInteractiveWeather,
package/methods.cjs CHANGED
@@ -183,6 +183,7 @@ const changeCloudPassword = require("./highlevel/methods/password/change-cloud-p
183
183
  const enableCloudPassword = require("./highlevel/methods/password/enable-cloud-password.cjs");
184
184
  const passwordEmail = require("./highlevel/methods/password/password-email.cjs");
185
185
  const removeCloudPassword = require("./highlevel/methods/password/remove-cloud-password.cjs");
186
+ const _normalizeInputStarGift = require("./highlevel/methods/premium/_normalize-input-star-gift.cjs");
186
187
  const acceptStarGift = require("./highlevel/methods/premium/accept-star-gift.cjs");
187
188
  const applyBoost = require("./highlevel/methods/premium/apply-boost.cjs");
188
189
  const canApplyBoost = require("./highlevel/methods/premium/can-apply-boost.cjs");
@@ -193,10 +194,15 @@ const getBoosts = require("./highlevel/methods/premium/get-boosts.cjs");
193
194
  const getBusinessChatLinks = require("./highlevel/methods/premium/get-business-chat-links.cjs");
194
195
  const getBusinessConnection = require("./highlevel/methods/premium/get-business-connection.cjs");
195
196
  const getMyBoostSlots = require("./highlevel/methods/premium/get-my-boost-slots.cjs");
197
+ const getSavedStarGiftsById = require("./highlevel/methods/premium/get-saved-star-gifts-by-id.cjs");
198
+ const getSavedStarGifts = require("./highlevel/methods/premium/get-saved-star-gifts.cjs");
196
199
  const getStarGiftOptions = require("./highlevel/methods/premium/get-star-gift-options.cjs");
200
+ const getStarGiftWithdrawalUrl = require("./highlevel/methods/premium/get-star-gift-withdrawal-url.cjs");
197
201
  const getStarGifts = require("./highlevel/methods/premium/get-star-gifts.cjs");
198
202
  const getStarsTransactions = require("./highlevel/methods/premium/get-stars-transactions.cjs");
203
+ const getUniqueStarGift = require("./highlevel/methods/premium/get-unique-star-gift.cjs");
199
204
  const iterBoosters = require("./highlevel/methods/premium/iter-boosters.cjs");
205
+ const iterSavedStarGifts = require("./highlevel/methods/premium/iter-saved-star-gifts.cjs");
200
206
  const iterStarGifts = require("./highlevel/methods/premium/iter-star-gifts.cjs");
201
207
  const iterStarsTransactions = require("./highlevel/methods/premium/iter-stars-transactions.cjs");
202
208
  const sendStarGift = require("./highlevel/methods/premium/send-star-gift.cjs");
@@ -453,6 +459,7 @@ exports.cancelPasswordEmail = passwordEmail.cancelPasswordEmail;
453
459
  exports.resendPasswordEmail = passwordEmail.resendPasswordEmail;
454
460
  exports.verifyPasswordEmail = passwordEmail.verifyPasswordEmail;
455
461
  exports.removeCloudPassword = removeCloudPassword.removeCloudPassword;
462
+ exports._normalizeInputStarGift = _normalizeInputStarGift._normalizeInputStarGift;
456
463
  exports.acceptStarGift = acceptStarGift.acceptStarGift;
457
464
  exports.applyBoost = applyBoost.applyBoost;
458
465
  exports.canApplyBoost = canApplyBoost.canApplyBoost;
@@ -464,10 +471,15 @@ exports.getBoosts = getBoosts.getBoosts;
464
471
  exports.getBusinessChatLinks = getBusinessChatLinks.getBusinessChatLinks;
465
472
  exports.getBusinessConnection = getBusinessConnection.getBusinessConnection;
466
473
  exports.getMyBoostSlots = getMyBoostSlots.getMyBoostSlots;
474
+ exports.getSavedStarGiftsById = getSavedStarGiftsById.getSavedStarGiftsById;
475
+ exports.getSavedStarGifts = getSavedStarGifts.getSavedStarGifts;
467
476
  exports.getStarGiftOptions = getStarGiftOptions.getStarGiftOptions;
477
+ exports.getStarGiftWithdrawalUrl = getStarGiftWithdrawalUrl.getStarGiftWithdrawalUrl;
468
478
  exports.getStarGifts = getStarGifts.getStarGifts;
469
479
  exports.getStarsTransactions = getStarsTransactions.getStarsTransactions;
480
+ exports.getUniqueStarGift = getUniqueStarGift.getUniqueStarGift;
470
481
  exports.iterBoosters = iterBoosters.iterBoosters;
482
+ exports.iterSavedStarGifts = iterSavedStarGifts.iterSavedStarGifts;
471
483
  exports.iterStarGifts = iterStarGifts.iterStarGifts;
472
484
  exports.iterStarsTransactions = iterStarsTransactions.iterStarsTransactions;
473
485
  exports.sendStarGift = sendStarGift.sendStarGift;
package/methods.js CHANGED
@@ -176,6 +176,7 @@ import { changeCloudPassword } from "./highlevel/methods/password/change-cloud-p
176
176
  import { enableCloudPassword } from "./highlevel/methods/password/enable-cloud-password.js";
177
177
  import { cancelPasswordEmail, resendPasswordEmail, verifyPasswordEmail } from "./highlevel/methods/password/password-email.js";
178
178
  import { removeCloudPassword } from "./highlevel/methods/password/remove-cloud-password.js";
179
+ import { _normalizeInputStarGift } from "./highlevel/methods/premium/_normalize-input-star-gift.js";
179
180
  import { acceptStarGift } from "./highlevel/methods/premium/accept-star-gift.js";
180
181
  import { applyBoost } from "./highlevel/methods/premium/apply-boost.js";
181
182
  import { canApplyBoost } from "./highlevel/methods/premium/can-apply-boost.js";
@@ -186,10 +187,15 @@ import { getBoosts } from "./highlevel/methods/premium/get-boosts.js";
186
187
  import { getBusinessChatLinks } from "./highlevel/methods/premium/get-business-chat-links.js";
187
188
  import { getBusinessConnection } from "./highlevel/methods/premium/get-business-connection.js";
188
189
  import { getMyBoostSlots } from "./highlevel/methods/premium/get-my-boost-slots.js";
190
+ import { getSavedStarGiftsById } from "./highlevel/methods/premium/get-saved-star-gifts-by-id.js";
191
+ import { getSavedStarGifts } from "./highlevel/methods/premium/get-saved-star-gifts.js";
189
192
  import { getStarGiftOptions } from "./highlevel/methods/premium/get-star-gift-options.js";
193
+ import { getStarGiftWithdrawalUrl } from "./highlevel/methods/premium/get-star-gift-withdrawal-url.js";
190
194
  import { getStarGifts } from "./highlevel/methods/premium/get-star-gifts.js";
191
195
  import { getStarsTransactions } from "./highlevel/methods/premium/get-stars-transactions.js";
196
+ import { getUniqueStarGift } from "./highlevel/methods/premium/get-unique-star-gift.js";
192
197
  import { iterBoosters } from "./highlevel/methods/premium/iter-boosters.js";
198
+ import { iterSavedStarGifts } from "./highlevel/methods/premium/iter-saved-star-gifts.js";
193
199
  import { iterStarGifts } from "./highlevel/methods/premium/iter-star-gifts.js";
194
200
  import { iterStarsTransactions } from "./highlevel/methods/premium/iter-stars-transactions.js";
195
201
  import { sendStarGift } from "./highlevel/methods/premium/send-star-gift.js";
@@ -253,6 +259,7 @@ import { updateProfile } from "./highlevel/methods/users/update-profile.js";
253
259
  export {
254
260
  _normalizeInputFile,
255
261
  _normalizeInputMedia,
262
+ _normalizeInputStarGift,
256
263
  _normalizePrivacyRules,
257
264
  acceptStarGift,
258
265
  addChatMembers,
@@ -380,9 +387,12 @@ export {
380
387
  getProfileStories,
381
388
  getReactionUsers,
382
389
  getReplyTo,
390
+ getSavedStarGifts,
391
+ getSavedStarGiftsById,
383
392
  getScheduledMessages,
384
393
  getSimilarChannels,
385
394
  getStarGiftOptions,
395
+ getStarGiftWithdrawalUrl,
386
396
  getStarGifts,
387
397
  getStarsTransactions,
388
398
  getStickerSet,
@@ -390,6 +400,7 @@ export {
390
400
  getStoriesInteractions,
391
401
  getStoryLink,
392
402
  getStoryViewers,
403
+ getUniqueStarGift,
393
404
  getUser,
394
405
  getUsers,
395
406
  hideAllJoinRequests,
@@ -412,6 +423,7 @@ export {
412
423
  iterProfilePhotos,
413
424
  iterProfileStories,
414
425
  iterReactionUsers,
426
+ iterSavedStarGifts,
415
427
  iterSearchGlobal,
416
428
  iterSearchHashtag,
417
429
  iterSearchMessages,
@@ -220,7 +220,7 @@ class NetworkManager {
220
220
  _: "initConnection",
221
221
  deviceModel,
222
222
  systemVersion: "1.0",
223
- appVersion: "0.19.7",
223
+ appVersion: "0.20.0",
224
224
  systemLangCode: "en",
225
225
  langPack: "",
226
226
  // "langPacks are for official apps only"
@@ -213,7 +213,7 @@ class NetworkManager {
213
213
  _: "initConnection",
214
214
  deviceModel,
215
215
  systemVersion: "1.0",
216
- appVersion: "0.19.7",
216
+ appVersion: "0.20.0",
217
217
  systemLangCode: "en",
218
218
  langPack: "",
219
219
  // "langPacks are for official apps only"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mtcute/core",
3
3
  "type": "module",
4
- "version": "0.19.7",
4
+ "version": "0.20.0",
5
5
  "description": "Type-safe library for MTProto (Telegram API)",
6
6
  "license": "MIT",
7
7
  "scripts": {},
@@ -10,7 +10,7 @@
10
10
  "@fuman/net": "0.0.9",
11
11
  "@fuman/utils": "0.0.4",
12
12
  "@mtcute/file-id": "^0.19.0",
13
- "@mtcute/tl": "^196.0.0",
13
+ "@mtcute/tl": "^198.0.0",
14
14
  "@mtcute/tl-runtime": "^0.19.0",
15
15
  "@types/events": "3.0.0",
16
16
  "long": "5.2.3"