@alien_org/contract 1.0.0-alpha.2 → 1.0.0-alpha.3

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/README.md CHANGED
@@ -33,6 +33,7 @@ import type {
33
33
  // Launch parameters
34
34
  LaunchParams, // Host-injected params (authToken, contractVersion, etc.)
35
35
  Platform, // 'ios' | 'android'
36
+ DisplayMode, // 'standard' | 'fullscreen' | 'immersive'
36
37
 
37
38
  // Utilities
38
39
  Version, // Semantic version string type
@@ -42,10 +43,11 @@ import type {
42
43
  ### Constants
43
44
 
44
45
  ```typescript
45
- import { PLATFORMS, releases } from '@alien_org/contract';
46
+ import { DISPLAY_MODES, PLATFORMS, releases } from '@alien_org/contract';
46
47
 
47
- PLATFORMS // ['ios', 'android']
48
- releases // Record<Version, MethodName[]> - version to methods mapping
48
+ PLATFORMS // ['ios', 'android']
49
+ DISPLAY_MODES // ['standard', 'fullscreen', 'immersive']
50
+ releases // Record<Version, MethodName[]> - version to methods mapping
49
51
  ```
50
52
 
51
53
  ### Version Utilities
@@ -114,7 +116,7 @@ interface LaunchParams {
114
116
  platform: Platform | undefined; // 'ios' | 'android'
115
117
  safeAreaInsets: SafeAreaInsets | undefined; // System UI insets (CSS px)
116
118
  startParam: string | undefined; // Custom param (referrals, etc.)
117
- isFullscreen: boolean | undefined; // Launched in fullscreen mode
119
+ displayMode: DisplayMode; // 'standard' | 'fullscreen' | 'immersive'
118
120
  }
119
121
  ```
120
122
 
package/dist/index.cjs CHANGED
@@ -4,6 +4,17 @@
4
4
  * Supported platforms for miniapps.
5
5
  */
6
6
  const PLATFORMS = ["ios", "android"];
7
+ /**
8
+ * Supported display modes for miniapps.
9
+ * - `standard` — standard webview with native chrome
10
+ * - `fullscreen` — fullscreen webview, native controls still visible
11
+ * - `immersive` — no native UI elements at all (no close button, options, etc.)
12
+ */
13
+ const DISPLAY_MODES = [
14
+ "standard",
15
+ "fullscreen",
16
+ "immersive"
17
+ ];
7
18
 
8
19
  //#endregion
9
20
  //#region src/methods/versions/releases.ts
@@ -115,6 +126,7 @@ const WALLET_ERROR = {
115
126
  };
116
127
 
117
128
  //#endregion
129
+ exports.DISPLAY_MODES = DISPLAY_MODES;
118
130
  exports.PLATFORMS = PLATFORMS;
119
131
  exports.WALLET_ERROR = WALLET_ERROR;
120
132
  exports.getMethodMinVersion = getMethodMinVersion;
package/dist/index.d.cts CHANGED
@@ -320,6 +320,17 @@ declare const PLATFORMS: readonly ["ios", "android"];
320
320
  * Platform the miniapp is running on.
321
321
  */
322
322
  type Platform = (typeof PLATFORMS)[number];
323
+ /**
324
+ * Supported display modes for miniapps.
325
+ * - `standard` — standard webview with native chrome
326
+ * - `fullscreen` — fullscreen webview, native controls still visible
327
+ * - `immersive` — no native UI elements at all (no close button, options, etc.)
328
+ */
329
+ declare const DISPLAY_MODES: readonly ["standard", "fullscreen", "immersive"];
330
+ /**
331
+ * Display mode for the miniapp webview.
332
+ */
333
+ type DisplayMode = (typeof DISPLAY_MODES)[number];
323
334
  /**
324
335
  * Safe area insets in CSS pixels, injected by the host app.
325
336
  * Accounts for system UI (status bar, notch, home indicator, nav bar).
@@ -350,10 +361,11 @@ interface LaunchParams {
350
361
  */
351
362
  startParam: string | undefined;
352
363
  /**
353
- * Whether the miniapp was launched in fullscreen mode.
364
+ * Display mode for the miniapp webview.
365
+ * Defaults to `'standard'` when not provided by the host app.
354
366
  * @since 1.0.0
355
367
  */
356
- isFullscreen: boolean | undefined;
368
+ displayMode: DisplayMode;
357
369
  }
358
370
  //#endregion
359
371
  //#region src/methods/types/payload.d.ts
@@ -717,4 +729,4 @@ declare function isMethodSupported(method: MethodName, version: Version): boolea
717
729
  */
718
730
  declare function getMethodMinVersion(method: MethodName): Version | undefined;
719
731
  //#endregion
720
- export { type CreateEventPayload, type CreateMethodPayload, type EventName, type EventPayload, type Events, type HapticImpactStyle, type HapticNotificationType, type LaunchParams, type MethodName, type MethodNameWithVersionedPayload, type MethodPayload, type MethodVersionedPayload, type Methods, PLATFORMS, type PaymentErrorCode, type PaymentTestScenario, type PaymentWebhookStatus, type Platform, type SafeAreaInsets, type SolanaChain, type SolanaCommitment, type Version, WALLET_ERROR, type WalletSolanaErrorCode, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
732
+ export { type CreateEventPayload, type CreateMethodPayload, DISPLAY_MODES, type DisplayMode, type EventName, type EventPayload, type Events, type HapticImpactStyle, type HapticNotificationType, type LaunchParams, type MethodName, type MethodNameWithVersionedPayload, type MethodPayload, type MethodVersionedPayload, type Methods, PLATFORMS, type PaymentErrorCode, type PaymentTestScenario, type PaymentWebhookStatus, type Platform, type SafeAreaInsets, type SolanaChain, type SolanaCommitment, type Version, WALLET_ERROR, type WalletSolanaErrorCode, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
package/dist/index.d.mts CHANGED
@@ -320,6 +320,17 @@ declare const PLATFORMS: readonly ["ios", "android"];
320
320
  * Platform the miniapp is running on.
321
321
  */
322
322
  type Platform = (typeof PLATFORMS)[number];
323
+ /**
324
+ * Supported display modes for miniapps.
325
+ * - `standard` — standard webview with native chrome
326
+ * - `fullscreen` — fullscreen webview, native controls still visible
327
+ * - `immersive` — no native UI elements at all (no close button, options, etc.)
328
+ */
329
+ declare const DISPLAY_MODES: readonly ["standard", "fullscreen", "immersive"];
330
+ /**
331
+ * Display mode for the miniapp webview.
332
+ */
333
+ type DisplayMode = (typeof DISPLAY_MODES)[number];
323
334
  /**
324
335
  * Safe area insets in CSS pixels, injected by the host app.
325
336
  * Accounts for system UI (status bar, notch, home indicator, nav bar).
@@ -350,10 +361,11 @@ interface LaunchParams {
350
361
  */
351
362
  startParam: string | undefined;
352
363
  /**
353
- * Whether the miniapp was launched in fullscreen mode.
364
+ * Display mode for the miniapp webview.
365
+ * Defaults to `'standard'` when not provided by the host app.
354
366
  * @since 1.0.0
355
367
  */
356
- isFullscreen: boolean | undefined;
368
+ displayMode: DisplayMode;
357
369
  }
358
370
  //#endregion
359
371
  //#region src/methods/types/payload.d.ts
@@ -717,4 +729,4 @@ declare function isMethodSupported(method: MethodName, version: Version): boolea
717
729
  */
718
730
  declare function getMethodMinVersion(method: MethodName): Version | undefined;
719
731
  //#endregion
720
- export { type CreateEventPayload, type CreateMethodPayload, type EventName, type EventPayload, type Events, type HapticImpactStyle, type HapticNotificationType, type LaunchParams, type MethodName, type MethodNameWithVersionedPayload, type MethodPayload, type MethodVersionedPayload, type Methods, PLATFORMS, type PaymentErrorCode, type PaymentTestScenario, type PaymentWebhookStatus, type Platform, type SafeAreaInsets, type SolanaChain, type SolanaCommitment, type Version, WALLET_ERROR, type WalletSolanaErrorCode, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
732
+ export { type CreateEventPayload, type CreateMethodPayload, DISPLAY_MODES, type DisplayMode, type EventName, type EventPayload, type Events, type HapticImpactStyle, type HapticNotificationType, type LaunchParams, type MethodName, type MethodNameWithVersionedPayload, type MethodPayload, type MethodVersionedPayload, type Methods, PLATFORMS, type PaymentErrorCode, type PaymentTestScenario, type PaymentWebhookStatus, type Platform, type SafeAreaInsets, type SolanaChain, type SolanaCommitment, type Version, WALLET_ERROR, type WalletSolanaErrorCode, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
package/dist/index.mjs CHANGED
@@ -3,6 +3,17 @@
3
3
  * Supported platforms for miniapps.
4
4
  */
5
5
  const PLATFORMS = ["ios", "android"];
6
+ /**
7
+ * Supported display modes for miniapps.
8
+ * - `standard` — standard webview with native chrome
9
+ * - `fullscreen` — fullscreen webview, native controls still visible
10
+ * - `immersive` — no native UI elements at all (no close button, options, etc.)
11
+ */
12
+ const DISPLAY_MODES = [
13
+ "standard",
14
+ "fullscreen",
15
+ "immersive"
16
+ ];
6
17
 
7
18
  //#endregion
8
19
  //#region src/methods/versions/releases.ts
@@ -114,4 +125,4 @@ const WALLET_ERROR = {
114
125
  };
115
126
 
116
127
  //#endregion
117
- export { PLATFORMS, WALLET_ERROR, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
128
+ export { DISPLAY_MODES, PLATFORMS, WALLET_ERROR, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alien_org/contract",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",