@orbit-software/sdk 1.83.3 → 1.84.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.
package/dist/esm/sdk.d.ts CHANGED
@@ -1,4 +1,18 @@
1
1
  import { InventoryItem, ServiceInvoiceCreatedResponse } from './types/api';
2
+ interface CloudStorageValueValidationResult {
3
+ isValid: boolean;
4
+ error?: string;
5
+ byteSize?: number;
6
+ characterCount?: number;
7
+ }
8
+ /**
9
+ * Валидирует значение для Telegram CloudStorage
10
+ * Проверяет:
11
+ * - Максимальный размер в байтах: 4096 байт (не символов!)
12
+ * - Корректная UTF-8 кодировка
13
+ * - Отсутствие нулевых байтов и проблемных управляющих символов
14
+ */
15
+ export declare function validateCloudStorageValue(value: string): CloudStorageValueValidationResult;
2
16
  export declare const BASE_URL = "https://app.portalapp.games/sdk";
3
17
  interface LaunchResponse {
4
18
  tma_ads_key: string;
@@ -152,9 +166,9 @@ interface PurchaseConfirmResponse {
152
166
  status: 'success' | 'error';
153
167
  }
154
168
  interface TelegramCloudStorage {
155
- getValue: (key: string) => Promise<string>;
156
- setValue: (key: string, value: string) => Promise<boolean>;
157
- removeValue: (key: string) => Promise<boolean>;
169
+ getValue: (key: string) => Promise<string | null>;
170
+ setValue: (key: string, value: string) => Promise<boolean | null>;
171
+ removeValue: (key: string) => Promise<boolean | null>;
158
172
  }
159
173
  interface TMANetworkInterstitialResponse {
160
174
  id: string;
@@ -185,6 +199,9 @@ interface RequestWageValueParams {
185
199
  wageId: number;
186
200
  value: number;
187
201
  }
202
+ export interface InitializeOptions {
203
+ mode: 'portal';
204
+ }
188
205
  export interface StartupConfig {
189
206
  isFullscreen: boolean;
190
207
  overlayPosition: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
@@ -192,7 +209,7 @@ export interface StartupConfig {
192
209
  export declare function startGameTimeTrack(): void;
193
210
  export interface CryptoSteamSDK {
194
211
  version: string;
195
- initialize: (botId?: string) => Promise<void>;
212
+ initialize: (botId?: string, options?: InitializeOptions) => Promise<void>;
196
213
  getConfig: () => Promise<CryptoSteamSDKConfig>;
197
214
  isAdEnabled: () => Promise<boolean>;
198
215
  requestAd: (options?: RequestAdOptions) => Promise<boolean>;