@orbit-software/sdk 1.85.0 → 1.87.1

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.
@@ -0,0 +1,4 @@
1
+ import { ShowPromiseResult } from '../../types/sdk';
2
+ export declare function showAdsgramAdWithTimeout<T extends boolean>(adsgramAdController: {
3
+ show(): Promise<ShowPromiseResult>;
4
+ } | null): Promise<T>;
@@ -0,0 +1,2 @@
1
+ export declare function initGigapubAds(scriptHtml: string): Promise<void>;
2
+ export declare function showGigapubAdWithTimeout<T extends boolean>(): Promise<T>;
@@ -0,0 +1 @@
1
+ export declare function showMonetagAdWithTimeout<T extends boolean>(monetagShowAdFnName: string | null, ymid: string): Promise<T>;
@@ -0,0 +1,16 @@
1
+ export declare class APIRequestError extends Error {
2
+ status: number;
3
+ responseText: string | undefined;
4
+ constructor({ message, status, responseText, }: {
5
+ message: string;
6
+ status: number;
7
+ responseText: string | undefined;
8
+ });
9
+ }
10
+ export interface MakeRequestConfig {
11
+ baseUrl: string;
12
+ getAuthData: () => string | null;
13
+ getBotId: () => string | null;
14
+ getInitData: () => string;
15
+ }
16
+ export declare function createMakeRequest(config: MakeRequestConfig): <T>(path: string, method: "POST" | "GET" | "PUT" | "DELETE", body?: unknown) => Promise<T>;
@@ -0,0 +1 @@
1
+ export declare function initSentry(): void;
package/dist/esm/sdk.d.ts CHANGED
@@ -1,271 +1,7 @@
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;
1
+ import { AdsgramController, AdsgramInitOptions, CryptoSteamSDK as CryptoSteamSDKType, TMANetworkInterstitialResponse } from './types/sdk';
16
2
  export declare const BASE_URL = "https://app.portalapp.games/sdk";
17
- interface LaunchResponse {
18
- tma_ads_key: string;
19
- ads?: {
20
- type: 'tma' | 'monetag' | 'adsgram';
21
- tmaAdsKey?: string;
22
- monetag?: string;
23
- adsgram?: string;
24
- };
25
- ads_last_showed: string | Date;
26
- is_ad_cooldown: boolean;
27
- launched: number;
28
- total_launches: number;
29
- }
30
- export declare class APIRequestError extends Error {
31
- status: number;
32
- responseText: string | undefined;
33
- constructor({ message, status, responseText, }: {
34
- message: string;
35
- status: number;
36
- responseText: string | undefined;
37
- });
38
- }
39
- export declare function makeRequest<T>(path: string, method: 'POST' | 'GET' | 'PUT' | 'DELETE', body?: any): Promise<T>;
40
- export interface CryptoSteamSDKConfig {
41
- supported_screen_formats: ('landscape' | 'portrait' | 'fullscreen')[];
42
- supported_devices: string[];
43
- title: string;
44
- app_url: string;
45
- }
46
- export type Audience = 'start_page_default' | 'start_page_few_ads' | 'start_page_no_ads' | 'start_page_games' | 'banner_test';
47
- export interface ProfileBalances {
48
- coins: number;
49
- gems: number;
50
- ny2026_tickets: number;
51
- usdt: number;
52
- }
53
- export interface CryptoSteamSDKProfile {
54
- id: number;
55
- avatar_ug: string;
56
- user_name: string;
57
- first_name: string;
58
- last_name: string;
59
- language: string;
60
- email: string;
61
- email_confirmed: boolean;
62
- phone_number: string;
63
- location: string;
64
- background_color: string;
65
- override_ads: boolean;
66
- ton_address: string;
67
- audiences: Audience[];
68
- is_premium: boolean;
69
- allows_write_to_pm: boolean;
70
- ads_disabled_until?: string;
71
- created: string;
72
- updated: string;
73
- avatar: string;
74
- birth_date: string;
75
- balance_gems: number;
76
- balance_coins: number;
77
- experience: number;
78
- balance_usdt: number;
79
- minimum_usdt_withdraw: number;
80
- level: number;
81
- level_up_exp: number;
82
- invited: number;
83
- invited_full: number;
84
- games_count: number;
85
- ads_free: boolean;
86
- is_admin: boolean;
87
- inventory: InventoryItem[];
88
- game_id?: number | string;
89
- onboarding: boolean;
90
- review_stats: {
91
- total: number;
92
- with_comments: number;
93
- };
94
- balances: ProfileBalances;
95
- }
96
- export interface CryptoSteamSDKShopItem {
97
- id: number;
98
- name: string;
99
- description: string;
100
- price: number;
101
- created: string;
102
- updated: string;
103
- }
104
- export declare enum CryptoSteamSDKAdMediaType {
105
- Image = "image",
106
- Gif = "gif",
107
- Video = "video"
108
- }
109
- export interface CryptoSteamSDKAd {
110
- is_available: boolean;
111
- url?: string;
112
- mediaType?: CryptoSteamSDKAdMediaType;
113
- durationS?: number;
114
- }
115
- export interface CryptoSteamSDKWage {
116
- active_wages: {
117
- current_value: number;
118
- id: number;
119
- max_value: number;
120
- price: number;
121
- started_at: string;
122
- time_limit: string;
123
- title: string;
124
- type_id: number;
125
- }[];
126
- available_wages: {
127
- current_value: number;
128
- id: number;
129
- max_value: number;
130
- price: number;
131
- started_at: string;
132
- time_limit: string;
133
- title: string;
134
- type_id: number;
135
- }[];
136
- claimable_wages: {
137
- current_value: number;
138
- id: number;
139
- max_value: number;
140
- price: number;
141
- started_at: string;
142
- time_limit: string;
143
- title: string;
144
- type_id: number;
145
- }[];
146
- }
147
- export interface OverlayConfig {
148
- onOverlayOpen?: () => void;
149
- onOverlayClose?: () => void;
150
- variant?: 'light' | 'dark' | 'translucent';
151
- initialPosition?: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
152
- botId?: string;
153
- authData?: string;
154
- }
155
- export interface CryptoSteamSDKTask {
156
- id: number;
157
- title: string;
158
- description: string;
159
- reward: number;
160
- group?: string;
161
- group_position?: number;
162
- sub_title?: string;
163
- is_claimable: boolean;
164
- is_done: boolean;
165
- }
166
- interface PurchaseConfirmResponse {
167
- status: 'success' | 'error';
168
- }
169
- interface TelegramCloudStorage {
170
- getValue: (key: string) => Promise<string | null>;
171
- setValue: (key: string, value: string) => Promise<boolean | null>;
172
- removeValue: (key: string) => Promise<boolean | null>;
173
- }
174
- interface TMANetworkInterstitialResponse {
175
- id: string;
176
- reward: boolean;
177
- }
178
- interface ShowPromiseResult {
179
- done: boolean;
180
- description: string;
181
- state: 'load' | 'render' | 'playing' | 'destroy';
182
- error: boolean;
183
- }
184
- interface AdsgramController {
185
- show(): Promise<ShowPromiseResult>;
186
- }
187
- interface AdsgramInitOptions {
188
- blockId: string;
189
- }
190
- interface BalanceResponse {
191
- balance: number;
192
- balance_gems: number;
193
- balance_coins: number;
194
- }
195
- export type AdType = 'REWARD' | 'INTERSTITIAL';
196
- export interface RequestAdOptions {
197
- onStart?: () => void;
198
- }
199
- interface RequestWageValueParams {
200
- wageId: number;
201
- value: number;
202
- }
203
- export interface InitializeOptions {
204
- mode: 'portal';
205
- authData?: string;
206
- }
207
- export interface StartupConfig {
208
- /**
209
- * @deprecated This field is no longer supported. Fullscreen configuration is now done through Portal.
210
- */
211
- isFullscreen: boolean;
212
- overlayPosition: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
213
- }
3
+ export declare const makeRequest: <T>(path: string, method: "POST" | "GET" | "PUT" | "DELETE", body?: unknown) => Promise<T>;
214
4
  export declare function startGameTimeTrack(): void;
215
- export interface CryptoSteamSDK {
216
- version: string;
217
- onAdStart: (() => void) | null;
218
- onAdEnd: ((result: boolean) => void) | null;
219
- initialize: (botId?: string, options?: InitializeOptions) => Promise<void>;
220
- getConfig: () => Promise<CryptoSteamSDKConfig>;
221
- isAdEnabled: () => Promise<boolean>;
222
- requestAd: (options?: RequestAdOptions) => Promise<boolean>;
223
- requestRewardAd: (options?: RequestAdOptions) => Promise<boolean>;
224
- getProfile: () => Promise<CryptoSteamSDKProfile>;
225
- getBalance: () => Promise<BalanceResponse>;
226
- getWages: () => Promise<CryptoSteamSDKWage>;
227
- claimWage: (id: number) => Promise<void>;
228
- startWage: (id: number) => Promise<void>;
229
- setValueWage: (params: RequestWageValueParams) => Promise<void>;
230
- trackGameTimeTick: () => void;
231
- getVersion: () => string;
232
- initializeOverlay: (config?: OverlayConfig) => void;
233
- getShopItems: () => Promise<CryptoSteamSDKShopItem[]>;
234
- getPurchasedShopItem: (itemId: number) => Promise<CryptoSteamSDKShopItem>;
235
- getPurchasedShopItems: () => Promise<CryptoSteamSDKShopItem[]>;
236
- buyShopItem: (itemId: number) => Promise<void>;
237
- openPurchaseConfirmModal: (shopItem: CryptoSteamSDKShopItem, rect?: {
238
- x: number;
239
- y: number;
240
- width: number;
241
- height: number;
242
- }) => Promise<PurchaseConfirmResponse>;
243
- createInvoice: (title: string, description: string, to_user_id: number, amount: number) => Promise<ServiceInvoiceCreatedResponse>;
244
- getValue: (key: string) => Promise<string>;
245
- setValue: (key: string, value: string) => Promise<void>;
246
- /**
247
- * @deprecated
248
- * @param key
249
- */
250
- getData: (key: string) => Promise<string>;
251
- /**
252
- * @deprecated
253
- * @param key
254
- * @param value
255
- */
256
- setData: (key: string, value: string) => Promise<void>;
257
- removeValue: (key: string) => Promise<void>;
258
- getAllKeyValues: () => Promise<Record<string, string>>;
259
- getLocale: () => string;
260
- showSharing: (url: string, text?: string) => void;
261
- telegramCloudStorage: TelegramCloudStorage;
262
- gameReady: () => void;
263
- getAdsgramController: () => AdsgramController | null;
264
- getLaunchResponse: () => LaunchResponse | null;
265
- isLaunchedFromPortal: () => boolean;
266
- setBottomBanner: () => void;
267
- clearBottomBanner: () => void;
268
- }
269
5
  declare global {
270
6
  interface Window {
271
7
  [key: string]: any;
@@ -279,6 +15,7 @@ declare global {
279
15
  Adsgram: {
280
16
  init: (options: AdsgramInitOptions) => AdsgramController;
281
17
  };
18
+ showGiga: () => Promise<void>;
282
19
  }
283
20
  }
284
21
  declare global {
@@ -289,17 +26,8 @@ declare global {
289
26
  }
290
27
  }
291
28
  }
292
- declare const CryptoSteamSDK: CryptoSteamSDK;
29
+ declare const CryptoSteamSDK: CryptoSteamSDKType;
293
30
  export default CryptoSteamSDK;
294
31
  export { CryptoSteamSDK as PortalSDK };
295
32
  export declare const TelegramWebApp: import('@twa-dev/types').WebApp;
296
- export type { ShowPromiseResult };
297
- export interface PortalEmuSDK {
298
- isAdRunning: () => boolean;
299
- getValueSync: (key: string) => string;
300
- setValueSync: (key: string, value: string) => void;
301
- removeValueSync: (key: string) => Promise<void>;
302
- reloadAd: () => void;
303
- getStartParam: () => string;
304
- requestAd: () => Promise<void>;
305
- }
33
+ export type { AdType, Audience, CryptoSteamSDK, CryptoSteamSDKAd, CryptoSteamSDKAdMediaType, CryptoSteamSDKConfig, CryptoSteamSDKProfile, CryptoSteamSDKShopItem, CryptoSteamSDKTask, CryptoSteamSDKWage, InitializeOptions, OverlayConfig, PortalEmuSDK, ProfileBalances, RequestAdOptions, ShowPromiseResult, StartupConfig, } from './types/sdk';