@mtcute/core 0.19.10 → 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 (93) hide show
  1. package/client.cjs +20 -0
  2. package/client.js +20 -0
  3. package/highlevel/client.d.cts +64 -9
  4. package/highlevel/client.d.ts +64 -9
  5. package/highlevel/methods/files/normalize-input-media.cjs +12 -2
  6. package/highlevel/methods/files/normalize-input-media.js +12 -2
  7. package/highlevel/methods/messages/forward-messages.cjs +4 -2
  8. package/highlevel/methods/messages/forward-messages.d.cts +2 -0
  9. package/highlevel/methods/messages/forward-messages.d.ts +2 -0
  10. package/highlevel/methods/messages/forward-messages.js +4 -2
  11. package/highlevel/methods/premium/_normalize-input-star-gift.cjs +23 -0
  12. package/highlevel/methods/premium/_normalize-input-star-gift.d.cts +4 -0
  13. package/highlevel/methods/premium/_normalize-input-star-gift.d.ts +4 -0
  14. package/highlevel/methods/premium/_normalize-input-star-gift.js +18 -0
  15. package/highlevel/methods/premium/accept-star-gift.cjs +4 -3
  16. package/highlevel/methods/premium/accept-star-gift.d.cts +3 -3
  17. package/highlevel/methods/premium/accept-star-gift.d.ts +3 -3
  18. package/highlevel/methods/premium/accept-star-gift.js +4 -3
  19. package/highlevel/methods/premium/get-saved-star-gifts-by-id.cjs +21 -0
  20. package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.cts +6 -0
  21. package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.ts +6 -0
  22. package/highlevel/methods/premium/get-saved-star-gifts-by-id.js +16 -0
  23. package/highlevel/methods/premium/get-saved-star-gifts.cjs +32 -0
  24. package/highlevel/methods/premium/get-saved-star-gifts.d.cts +24 -0
  25. package/highlevel/methods/premium/get-saved-star-gifts.d.ts +24 -0
  26. package/highlevel/methods/premium/get-saved-star-gifts.js +27 -0
  27. package/highlevel/methods/premium/get-star-gift-withdrawal-url.cjs +23 -0
  28. package/highlevel/methods/premium/get-star-gift-withdrawal-url.d.cts +8 -0
  29. package/highlevel/methods/premium/get-star-gift-withdrawal-url.d.ts +8 -0
  30. package/highlevel/methods/premium/get-star-gift-withdrawal-url.js +18 -0
  31. package/highlevel/methods/premium/iter-saved-star-gifts.cjs +33 -0
  32. package/highlevel/methods/premium/iter-saved-star-gifts.d.cts +27 -0
  33. package/highlevel/methods/premium/iter-saved-star-gifts.d.ts +27 -0
  34. package/highlevel/methods/premium/iter-saved-star-gifts.js +28 -0
  35. package/highlevel/methods/premium/send-star-gift.cjs +2 -2
  36. package/highlevel/methods/premium/send-star-gift.d.cts +2 -2
  37. package/highlevel/methods/premium/send-star-gift.d.ts +2 -2
  38. package/highlevel/methods/premium/send-star-gift.js +3 -3
  39. package/highlevel/methods/premium/transfer-star-gift.cjs +4 -4
  40. package/highlevel/methods/premium/transfer-star-gift.d.cts +3 -3
  41. package/highlevel/methods/premium/transfer-star-gift.d.ts +3 -3
  42. package/highlevel/methods/premium/transfer-star-gift.js +5 -5
  43. package/highlevel/methods/premium/upgrade-star-gift.cjs +3 -3
  44. package/highlevel/methods/premium/upgrade-star-gift.d.cts +2 -2
  45. package/highlevel/methods/premium/upgrade-star-gift.d.ts +2 -2
  46. package/highlevel/methods/premium/upgrade-star-gift.js +3 -3
  47. package/highlevel/methods/users/set-emoji-status.cjs +8 -1
  48. package/highlevel/methods/users/set-emoji-status.d.cts +2 -0
  49. package/highlevel/methods/users/set-emoji-status.d.ts +2 -0
  50. package/highlevel/methods/users/set-emoji-status.js +8 -1
  51. package/highlevel/methods.d.cts +5 -0
  52. package/highlevel/methods.d.ts +5 -0
  53. package/highlevel/types/media/input-media/types.d.cts +4 -0
  54. package/highlevel/types/media/input-media/types.d.ts +4 -0
  55. package/highlevel/types/media/video.cjs +8 -0
  56. package/highlevel/types/media/video.d.cts +3 -0
  57. package/highlevel/types/media/video.d.ts +3 -0
  58. package/highlevel/types/media/video.js +8 -0
  59. package/highlevel/types/messages/message-action.cjs +22 -1
  60. package/highlevel/types/messages/message-action.d.cts +4 -0
  61. package/highlevel/types/messages/message-action.d.ts +4 -0
  62. package/highlevel/types/messages/message-action.js +22 -1
  63. package/highlevel/types/peers/chat.cjs +3 -1
  64. package/highlevel/types/peers/chat.js +3 -1
  65. package/highlevel/types/peers/full-chat.cjs +8 -0
  66. package/highlevel/types/peers/full-chat.d.cts +4 -0
  67. package/highlevel/types/peers/full-chat.d.ts +4 -0
  68. package/highlevel/types/peers/full-chat.js +8 -0
  69. package/highlevel/types/peers/user.cjs +3 -1
  70. package/highlevel/types/peers/user.js +3 -1
  71. package/highlevel/types/premium/index.d.cts +1 -0
  72. package/highlevel/types/premium/index.d.ts +1 -0
  73. package/highlevel/types/premium/saved-star-gift.cjs +80 -0
  74. package/highlevel/types/premium/saved-star-gift.d.cts +39 -0
  75. package/highlevel/types/premium/saved-star-gift.d.ts +39 -0
  76. package/highlevel/types/premium/saved-star-gift.js +75 -0
  77. package/highlevel/types/premium/stars-gift-unique.cjs +9 -5
  78. package/highlevel/types/premium/stars-gift-unique.d.cts +7 -5
  79. package/highlevel/types/premium/stars-gift-unique.d.ts +7 -5
  80. package/highlevel/types/premium/stars-gift-unique.js +9 -5
  81. package/highlevel/types/premium/stars-gift.d.cts +12 -1
  82. package/highlevel/types/premium/stars-gift.d.ts +12 -1
  83. package/highlevel/types/reactions/emoji-status.cjs +38 -1
  84. package/highlevel/types/reactions/emoji-status.d.cts +23 -2
  85. package/highlevel/types/reactions/emoji-status.d.ts +23 -2
  86. package/highlevel/types/reactions/emoji-status.js +39 -2
  87. package/index.cjs +3 -0
  88. package/index.js +4 -1
  89. package/methods.cjs +10 -0
  90. package/methods.js +10 -0
  91. package/network/network-manager.cjs +1 -1
  92. package/network/network-manager.js +1 -1
  93. package/package.json +2 -2
@@ -9,7 +9,7 @@ const utils = require("@fuman/utils");
9
9
  const inspectable = require("../../utils/inspectable.cjs");
10
10
  const memoize = require("../../utils/memoize.cjs");
11
11
  const documentUtils = require("../media/document-utils.cjs");
12
- const user = require("../peers/user.cjs");
12
+ const peer = require("../peers/peer.cjs");
13
13
  class StarGiftUniqueAttribute {
14
14
  constructor(raw) {
15
15
  this.raw = raw;
@@ -64,11 +64,11 @@ class StarGiftUniqueOriginalDetails {
64
64
  }
65
65
  /** ID of the user who sent the original star gift */
66
66
  get sender() {
67
- return this.raw.senderId ? new user.User(this._peers.user(this.raw.senderId)) : null;
67
+ return this.raw.senderId ? peer.parsePeer(this.raw.senderId, this._peers) : null;
68
68
  }
69
69
  /** ID of the user who received the original star gift */
70
70
  get recipient() {
71
- return new user.User(this._peers.user(this.raw.recipientId));
71
+ return peer.parsePeer(this.raw.recipientId, this._peers);
72
72
  }
73
73
  /** Date when the original star gift was sent */
74
74
  get date() {
@@ -116,10 +116,10 @@ class StarGiftUnique {
116
116
  get slug() {
117
117
  return this.raw.slug;
118
118
  }
119
- /** ID of the user who owns this gift, if available */
119
+ /** ID of the peer who owns this gift, if available */
120
120
  get owner() {
121
121
  if (!this.raw.ownerId) return null;
122
- return new user.User(this._peers.user(this.raw.ownerId));
122
+ return peer.parsePeer(this.raw.ownerId, this._peers);
123
123
  }
124
124
  /** Name of the user who owns this gift, if available */
125
125
  get ownerName() {
@@ -148,6 +148,10 @@ class StarGiftUnique {
148
148
  if (!this._originalDetails) return null;
149
149
  return new StarGiftUniqueOriginalDetails(this._originalDetails, this._peers);
150
150
  }
151
+ /** TON address of the owner of the unique star gift */
152
+ get ownerAddress() {
153
+ return this.raw.ownerAddress ?? null;
154
+ }
151
155
  }
152
156
  const StarGiftUnique$1 = /* @__PURE__ */ inspectable.makeInspectable(StarGiftUnique);
153
157
  const StarGiftUnique$2 = /* @__PURE__ */ memoize.memoizeGetters(StarGiftUnique$1, ["model", "pattern", "backdrop", "originalDetails"]);
@@ -1,8 +1,8 @@
1
1
  import { tl } from '@mtcute/tl';
2
2
  import { Sticker } from '../media/sticker.js';
3
3
  import { TextWithEntities } from '../misc/entities.js';
4
+ import { Peer } from '../peers/peer.js';
4
5
  import { PeersIndex } from '../peers/peers-index.js';
5
- import { User } from '../peers/user.js';
6
6
  /** An attribute of a unique star gift containing a sticker */
7
7
  export declare class StarGiftUniqueAttribute {
8
8
  readonly raw: tl.RawStarGiftAttributeModel | tl.RawStarGiftAttributePattern;
@@ -32,9 +32,9 @@ export declare class StarGiftUniqueOriginalDetails {
32
32
  readonly _peers: PeersIndex;
33
33
  constructor(raw: tl.RawStarGiftAttributeOriginalDetails, _peers: PeersIndex);
34
34
  /** ID of the user who sent the original star gift */
35
- get sender(): User | null;
35
+ get sender(): Peer | null;
36
36
  /** ID of the user who received the original star gift */
37
- get recipient(): User;
37
+ get recipient(): Peer;
38
38
  /** Date when the original star gift was sent */
39
39
  get date(): Date;
40
40
  /** Message attached to the original star gift */
@@ -57,8 +57,8 @@ export declare class StarGiftUnique {
57
57
  get title(): string;
58
58
  /** Slug of the gift */
59
59
  get slug(): string;
60
- /** ID of the user who owns this gift, if available */
61
- get owner(): User | null;
60
+ /** ID of the peer who owns this gift, if available */
61
+ get owner(): Peer | null;
62
62
  /** Name of the user who owns this gift, if available */
63
63
  get ownerName(): string | null;
64
64
  get availabilityIssued(): number;
@@ -71,4 +71,6 @@ export declare class StarGiftUnique {
71
71
  get backdrop(): StarGiftUniqueBackdrop;
72
72
  /** Details about the original star gift (if they were retained when minting) */
73
73
  get originalDetails(): StarGiftUniqueOriginalDetails | null;
74
+ /** TON address of the owner of the unique star gift */
75
+ get ownerAddress(): string | null;
74
76
  }
@@ -1,8 +1,8 @@
1
1
  import { tl } from '@mtcute/tl';
2
2
  import { Sticker } from '../media/sticker.js';
3
3
  import { TextWithEntities } from '../misc/entities.js';
4
+ import { Peer } from '../peers/peer.js';
4
5
  import { PeersIndex } from '../peers/peers-index.js';
5
- import { User } from '../peers/user.js';
6
6
  /** An attribute of a unique star gift containing a sticker */
7
7
  export declare class StarGiftUniqueAttribute {
8
8
  readonly raw: tl.RawStarGiftAttributeModel | tl.RawStarGiftAttributePattern;
@@ -32,9 +32,9 @@ export declare class StarGiftUniqueOriginalDetails {
32
32
  readonly _peers: PeersIndex;
33
33
  constructor(raw: tl.RawStarGiftAttributeOriginalDetails, _peers: PeersIndex);
34
34
  /** ID of the user who sent the original star gift */
35
- get sender(): User | null;
35
+ get sender(): Peer | null;
36
36
  /** ID of the user who received the original star gift */
37
- get recipient(): User;
37
+ get recipient(): Peer;
38
38
  /** Date when the original star gift was sent */
39
39
  get date(): Date;
40
40
  /** Message attached to the original star gift */
@@ -57,8 +57,8 @@ export declare class StarGiftUnique {
57
57
  get title(): string;
58
58
  /** Slug of the gift */
59
59
  get slug(): string;
60
- /** ID of the user who owns this gift, if available */
61
- get owner(): User | null;
60
+ /** ID of the peer who owns this gift, if available */
61
+ get owner(): Peer | null;
62
62
  /** Name of the user who owns this gift, if available */
63
63
  get ownerName(): string | null;
64
64
  get availabilityIssued(): number;
@@ -71,4 +71,6 @@ export declare class StarGiftUnique {
71
71
  get backdrop(): StarGiftUniqueBackdrop;
72
72
  /** Details about the original star gift (if they were retained when minting) */
73
73
  get originalDetails(): StarGiftUniqueOriginalDetails | null;
74
+ /** TON address of the owner of the unique star gift */
75
+ get ownerAddress(): string | null;
74
76
  }
@@ -2,7 +2,7 @@ import { assert } from "@fuman/utils";
2
2
  import { makeInspectable } from "../../utils/inspectable.js";
3
3
  import { memoizeGetters } from "../../utils/memoize.js";
4
4
  import { parseDocument } from "../media/document-utils.js";
5
- import { User as User$2 } from "../peers/user.js";
5
+ import { parsePeer } from "../peers/peer.js";
6
6
  class StarGiftUniqueAttribute {
7
7
  constructor(raw) {
8
8
  this.raw = raw;
@@ -57,11 +57,11 @@ class StarGiftUniqueOriginalDetails {
57
57
  }
58
58
  /** ID of the user who sent the original star gift */
59
59
  get sender() {
60
- return this.raw.senderId ? new User$2(this._peers.user(this.raw.senderId)) : null;
60
+ return this.raw.senderId ? parsePeer(this.raw.senderId, this._peers) : null;
61
61
  }
62
62
  /** ID of the user who received the original star gift */
63
63
  get recipient() {
64
- return new User$2(this._peers.user(this.raw.recipientId));
64
+ return parsePeer(this.raw.recipientId, this._peers);
65
65
  }
66
66
  /** Date when the original star gift was sent */
67
67
  get date() {
@@ -109,10 +109,10 @@ class StarGiftUnique {
109
109
  get slug() {
110
110
  return this.raw.slug;
111
111
  }
112
- /** ID of the user who owns this gift, if available */
112
+ /** ID of the peer who owns this gift, if available */
113
113
  get owner() {
114
114
  if (!this.raw.ownerId) return null;
115
- return new User$2(this._peers.user(this.raw.ownerId));
115
+ return parsePeer(this.raw.ownerId, this._peers);
116
116
  }
117
117
  /** Name of the user who owns this gift, if available */
118
118
  get ownerName() {
@@ -141,6 +141,10 @@ class StarGiftUnique {
141
141
  if (!this._originalDetails) return null;
142
142
  return new StarGiftUniqueOriginalDetails(this._originalDetails, this._peers);
143
143
  }
144
+ /** TON address of the owner of the unique star gift */
145
+ get ownerAddress() {
146
+ return this.raw.ownerAddress ?? null;
147
+ }
144
148
  }
145
149
  const StarGiftUnique$1 = /* @__PURE__ */ makeInspectable(StarGiftUnique);
146
150
  const StarGiftUnique$2 = /* @__PURE__ */ memoizeGetters(StarGiftUnique$1, ["model", "pattern", "backdrop", "originalDetails"]);
@@ -1,11 +1,22 @@
1
1
  import { tl } from '@mtcute/tl';
2
2
  import { Sticker } from '../media/sticker.js';
3
+ import { Message } from '../messages/message.js';
3
4
  import { TextWithEntities } from '../misc/entities.js';
5
+ import { InputPeerLike } from '../peers/peer.js';
4
6
  import { PeersIndex } from '../peers/peers-index.js';
5
7
  import { User } from '../peers/user.js';
6
8
  import { StarGiftUnique } from './stars-gift-unique.js';
9
+ export type InputStarGift = {
10
+ /** ID of the message containing the gift */
11
+ message: number | Message;
12
+ } | {
13
+ /** Owner of the gift */
14
+ owner: InputPeerLike;
15
+ /** ID of the gift */
16
+ savedId: tl.Long;
17
+ };
7
18
  /**
8
- * A gift with stars attached to it.
19
+ * A gift bought with stars
9
20
  */
10
21
  export declare class StarGift {
11
22
  readonly raw: tl.RawStarGift;
@@ -1,11 +1,22 @@
1
1
  import { tl } from '@mtcute/tl';
2
2
  import { Sticker } from '../media/sticker.js';
3
+ import { Message } from '../messages/message.js';
3
4
  import { TextWithEntities } from '../misc/entities.js';
5
+ import { InputPeerLike } from '../peers/peer.js';
4
6
  import { PeersIndex } from '../peers/peers-index.js';
5
7
  import { User } from '../peers/user.js';
6
8
  import { StarGiftUnique } from './stars-gift-unique.js';
9
+ export type InputStarGift = {
10
+ /** ID of the message containing the gift */
11
+ message: number | Message;
12
+ } | {
13
+ /** Owner of the gift */
14
+ owner: InputPeerLike;
15
+ /** ID of the gift */
16
+ savedId: tl.Long;
17
+ };
7
18
  /**
8
- * A gift with stars attached to it.
19
+ * A gift bought with stars
9
20
  */
10
21
  export declare class StarGift {
11
22
  readonly raw: tl.RawStarGift;
@@ -6,6 +6,37 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
6
6
  "use strict";
7
7
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8
8
  const inspectable = require("../../utils/inspectable.cjs");
9
+ class EmojiStatusCollectible {
10
+ constructor(raw) {
11
+ this.raw = raw;
12
+ }
13
+ /** ID of the collectible */
14
+ get id() {
15
+ return this.raw.collectibleId;
16
+ }
17
+ /** Title of the collectible */
18
+ get title() {
19
+ return this.raw.title;
20
+ }
21
+ /** Slug of the collectible */
22
+ get slug() {
23
+ return this.raw.slug;
24
+ }
25
+ /** Pattern emoji ID of the collectible */
26
+ get patternEmojiId() {
27
+ return this.raw.patternDocumentId;
28
+ }
29
+ /** Colors of the collectible */
30
+ get colors() {
31
+ return {
32
+ center: this.raw.centerColor,
33
+ edge: this.raw.edgeColor,
34
+ pattern: this.raw.patternColor,
35
+ text: this.raw.textColor
36
+ };
37
+ }
38
+ }
39
+ const EmojiStatusCollectible$1 = /* @__PURE__ */ inspectable.makeInspectable(EmojiStatusCollectible);
9
40
  class EmojiStatus {
10
41
  constructor(raw) {
11
42
  this.raw = raw;
@@ -16,9 +47,15 @@ class EmojiStatus {
16
47
  }
17
48
  /** This status is valid at most until this date */
18
49
  get expireDate() {
19
- if (this.raw._ === "emojiStatus") return null;
50
+ if (!this.raw.until) return null;
20
51
  return new Date(this.raw.until * 1e3);
21
52
  }
53
+ /** If this is a collectible emoji status, information about it */
54
+ get collectible() {
55
+ if (this.raw._ !== "emojiStatusCollectible") return null;
56
+ return new EmojiStatusCollectible(this.raw);
57
+ }
22
58
  }
23
59
  const EmojiStatus$1 = /* @__PURE__ */ inspectable.makeInspectable(EmojiStatus);
24
60
  exports.EmojiStatus = EmojiStatus$1;
61
+ exports.EmojiStatusCollectible = EmojiStatusCollectible$1;
@@ -1,12 +1,33 @@
1
1
  import { tl } from '@mtcute/tl';
2
+ export declare class EmojiStatusCollectible {
3
+ readonly raw: tl.RawEmojiStatusCollectible;
4
+ constructor(raw: tl.RawEmojiStatusCollectible);
5
+ /** ID of the collectible */
6
+ get id(): tl.Long;
7
+ /** Title of the collectible */
8
+ get title(): string;
9
+ /** Slug of the collectible */
10
+ get slug(): string;
11
+ /** Pattern emoji ID of the collectible */
12
+ get patternEmojiId(): tl.Long;
13
+ /** Colors of the collectible */
14
+ get colors(): {
15
+ center: number;
16
+ edge: number;
17
+ pattern: number;
18
+ text: number;
19
+ };
20
+ }
2
21
  /**
3
22
  * Information about user's emoji status
4
23
  */
5
24
  export declare class EmojiStatus {
6
- readonly raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty>;
7
- constructor(raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty>);
25
+ readonly raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty | tl.RawInputEmojiStatusCollectible>;
26
+ constructor(raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty | tl.RawInputEmojiStatusCollectible>);
8
27
  /** ID of the custom emoji */
9
28
  get emoji(): tl.Long;
10
29
  /** This status is valid at most until this date */
11
30
  get expireDate(): Date | null;
31
+ /** If this is a collectible emoji status, information about it */
32
+ get collectible(): EmojiStatusCollectible | null;
12
33
  }
@@ -1,12 +1,33 @@
1
1
  import { tl } from '@mtcute/tl';
2
+ export declare class EmojiStatusCollectible {
3
+ readonly raw: tl.RawEmojiStatusCollectible;
4
+ constructor(raw: tl.RawEmojiStatusCollectible);
5
+ /** ID of the collectible */
6
+ get id(): tl.Long;
7
+ /** Title of the collectible */
8
+ get title(): string;
9
+ /** Slug of the collectible */
10
+ get slug(): string;
11
+ /** Pattern emoji ID of the collectible */
12
+ get patternEmojiId(): tl.Long;
13
+ /** Colors of the collectible */
14
+ get colors(): {
15
+ center: number;
16
+ edge: number;
17
+ pattern: number;
18
+ text: number;
19
+ };
20
+ }
2
21
  /**
3
22
  * Information about user's emoji status
4
23
  */
5
24
  export declare class EmojiStatus {
6
- readonly raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty>;
7
- constructor(raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty>);
25
+ readonly raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty | tl.RawInputEmojiStatusCollectible>;
26
+ constructor(raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty | tl.RawInputEmojiStatusCollectible>);
8
27
  /** ID of the custom emoji */
9
28
  get emoji(): tl.Long;
10
29
  /** This status is valid at most until this date */
11
30
  get expireDate(): Date | null;
31
+ /** If this is a collectible emoji status, information about it */
32
+ get collectible(): EmojiStatusCollectible | null;
12
33
  }
@@ -1,4 +1,35 @@
1
1
  import { makeInspectable } from "../../utils/inspectable.js";
2
+ class EmojiStatusCollectible {
3
+ constructor(raw) {
4
+ this.raw = raw;
5
+ }
6
+ /** ID of the collectible */
7
+ get id() {
8
+ return this.raw.collectibleId;
9
+ }
10
+ /** Title of the collectible */
11
+ get title() {
12
+ return this.raw.title;
13
+ }
14
+ /** Slug of the collectible */
15
+ get slug() {
16
+ return this.raw.slug;
17
+ }
18
+ /** Pattern emoji ID of the collectible */
19
+ get patternEmojiId() {
20
+ return this.raw.patternDocumentId;
21
+ }
22
+ /** Colors of the collectible */
23
+ get colors() {
24
+ return {
25
+ center: this.raw.centerColor,
26
+ edge: this.raw.edgeColor,
27
+ pattern: this.raw.patternColor,
28
+ text: this.raw.textColor
29
+ };
30
+ }
31
+ }
32
+ const EmojiStatusCollectible$1 = /* @__PURE__ */ makeInspectable(EmojiStatusCollectible);
2
33
  class EmojiStatus {
3
34
  constructor(raw) {
4
35
  this.raw = raw;
@@ -9,11 +40,17 @@ class EmojiStatus {
9
40
  }
10
41
  /** This status is valid at most until this date */
11
42
  get expireDate() {
12
- if (this.raw._ === "emojiStatus") return null;
43
+ if (!this.raw.until) return null;
13
44
  return new Date(this.raw.until * 1e3);
14
45
  }
46
+ /** If this is a collectible emoji status, information about it */
47
+ get collectible() {
48
+ if (this.raw._ !== "emojiStatusCollectible") return null;
49
+ return new EmojiStatusCollectible(this.raw);
50
+ }
15
51
  }
16
52
  const EmojiStatus$1 = /* @__PURE__ */ makeInspectable(EmojiStatus);
17
53
  export {
18
- EmojiStatus$1 as EmojiStatus
54
+ EmojiStatus$1 as EmojiStatus,
55
+ EmojiStatusCollectible$1 as EmojiStatusCollectible
19
56
  };
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");
@@ -254,6 +255,7 @@ exports.BusinessIntro = businessIntro.BusinessIntro;
254
255
  exports.BusinessLocation = businessLocation.BusinessLocation;
255
256
  exports.BusinessWorkHours = businessWorkHours.BusinessWorkHours;
256
257
  exports.businessWorkHoursDaysToRaw = businessWorkHours.businessWorkHoursDaysToRaw;
258
+ exports.SavedStarGift = savedStarGift.SavedStarGift;
257
259
  exports.StarGiftUnique = starsGiftUnique.StarGiftUnique;
258
260
  exports.StarGiftUniqueAttribute = starsGiftUnique.StarGiftUniqueAttribute;
259
261
  exports.StarGiftUniqueBackdrop = starsGiftUnique.StarGiftUniqueBackdrop;
@@ -263,6 +265,7 @@ exports.UserStarGift = starsGift.UserStarGift;
263
265
  exports.StarsStatus = starsStatus.StarsStatus;
264
266
  exports.StarsTransaction = starsTransaction.StarsTransaction;
265
267
  exports.EmojiStatus = emojiStatus.EmojiStatus;
268
+ exports.EmojiStatusCollectible = emojiStatus.EmojiStatusCollectible;
266
269
  exports.PaidPeerReaction = peerReaction.PaidPeerReaction;
267
270
  exports.PeerReaction = peerReaction.PeerReaction;
268
271
  exports.ReactionCount = reactionCount.ReactionCount;
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";
@@ -197,6 +198,7 @@ export {
197
198
  Document,
198
199
  DraftMessage,
199
200
  EmojiStatus,
201
+ EmojiStatusCollectible,
200
202
  ExtendedMediaPreview,
201
203
  FactCheck,
202
204
  FileLocation,
@@ -254,6 +256,7 @@ export {
254
256
  RawUpdateInfo,
255
257
  ReactionCount,
256
258
  RepliedMessageInfo,
259
+ SavedStarGift,
257
260
  SearchFilters,
258
261
  SentCode,
259
262
  SessionConnection,
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,11 +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");
199
203
  const getUniqueStarGift = require("./highlevel/methods/premium/get-unique-star-gift.cjs");
200
204
  const iterBoosters = require("./highlevel/methods/premium/iter-boosters.cjs");
205
+ const iterSavedStarGifts = require("./highlevel/methods/premium/iter-saved-star-gifts.cjs");
201
206
  const iterStarGifts = require("./highlevel/methods/premium/iter-star-gifts.cjs");
202
207
  const iterStarsTransactions = require("./highlevel/methods/premium/iter-stars-transactions.cjs");
203
208
  const sendStarGift = require("./highlevel/methods/premium/send-star-gift.cjs");
@@ -454,6 +459,7 @@ exports.cancelPasswordEmail = passwordEmail.cancelPasswordEmail;
454
459
  exports.resendPasswordEmail = passwordEmail.resendPasswordEmail;
455
460
  exports.verifyPasswordEmail = passwordEmail.verifyPasswordEmail;
456
461
  exports.removeCloudPassword = removeCloudPassword.removeCloudPassword;
462
+ exports._normalizeInputStarGift = _normalizeInputStarGift._normalizeInputStarGift;
457
463
  exports.acceptStarGift = acceptStarGift.acceptStarGift;
458
464
  exports.applyBoost = applyBoost.applyBoost;
459
465
  exports.canApplyBoost = canApplyBoost.canApplyBoost;
@@ -465,11 +471,15 @@ exports.getBoosts = getBoosts.getBoosts;
465
471
  exports.getBusinessChatLinks = getBusinessChatLinks.getBusinessChatLinks;
466
472
  exports.getBusinessConnection = getBusinessConnection.getBusinessConnection;
467
473
  exports.getMyBoostSlots = getMyBoostSlots.getMyBoostSlots;
474
+ exports.getSavedStarGiftsById = getSavedStarGiftsById.getSavedStarGiftsById;
475
+ exports.getSavedStarGifts = getSavedStarGifts.getSavedStarGifts;
468
476
  exports.getStarGiftOptions = getStarGiftOptions.getStarGiftOptions;
477
+ exports.getStarGiftWithdrawalUrl = getStarGiftWithdrawalUrl.getStarGiftWithdrawalUrl;
469
478
  exports.getStarGifts = getStarGifts.getStarGifts;
470
479
  exports.getStarsTransactions = getStarsTransactions.getStarsTransactions;
471
480
  exports.getUniqueStarGift = getUniqueStarGift.getUniqueStarGift;
472
481
  exports.iterBoosters = iterBoosters.iterBoosters;
482
+ exports.iterSavedStarGifts = iterSavedStarGifts.iterSavedStarGifts;
473
483
  exports.iterStarGifts = iterStarGifts.iterStarGifts;
474
484
  exports.iterStarsTransactions = iterStarsTransactions.iterStarsTransactions;
475
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,11 +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";
192
196
  import { getUniqueStarGift } from "./highlevel/methods/premium/get-unique-star-gift.js";
193
197
  import { iterBoosters } from "./highlevel/methods/premium/iter-boosters.js";
198
+ import { iterSavedStarGifts } from "./highlevel/methods/premium/iter-saved-star-gifts.js";
194
199
  import { iterStarGifts } from "./highlevel/methods/premium/iter-star-gifts.js";
195
200
  import { iterStarsTransactions } from "./highlevel/methods/premium/iter-stars-transactions.js";
196
201
  import { sendStarGift } from "./highlevel/methods/premium/send-star-gift.js";
@@ -254,6 +259,7 @@ import { updateProfile } from "./highlevel/methods/users/update-profile.js";
254
259
  export {
255
260
  _normalizeInputFile,
256
261
  _normalizeInputMedia,
262
+ _normalizeInputStarGift,
257
263
  _normalizePrivacyRules,
258
264
  acceptStarGift,
259
265
  addChatMembers,
@@ -381,9 +387,12 @@ export {
381
387
  getProfileStories,
382
388
  getReactionUsers,
383
389
  getReplyTo,
390
+ getSavedStarGifts,
391
+ getSavedStarGiftsById,
384
392
  getScheduledMessages,
385
393
  getSimilarChannels,
386
394
  getStarGiftOptions,
395
+ getStarGiftWithdrawalUrl,
387
396
  getStarGifts,
388
397
  getStarsTransactions,
389
398
  getStickerSet,
@@ -414,6 +423,7 @@ export {
414
423
  iterProfilePhotos,
415
424
  iterProfileStories,
416
425
  iterReactionUsers,
426
+ iterSavedStarGifts,
417
427
  iterSearchGlobal,
418
428
  iterSearchHashtag,
419
429
  iterSearchMessages,
@@ -220,7 +220,7 @@ class NetworkManager {
220
220
  _: "initConnection",
221
221
  deviceModel,
222
222
  systemVersion: "1.0",
223
- appVersion: "0.19.10",
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.10",
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.10",
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": "^197.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"