@alien_org/contract 0.2.1 → 0.2.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/dist/index.d.cts CHANGED
@@ -51,7 +51,7 @@ type Empty = Record<string, never>;
51
51
  * @since 0.1.1
52
52
  * @schema
53
53
  */
54
- type PaymentErrorCode = 'insufficient_balance' | 'network_error' | 'pre_checkout_rejected' | 'pre_checkout_timeout' | 'unknown';
54
+ type PaymentErrorCode = 'insufficient_balance' | 'network_error' | 'unknown';
55
55
  /**
56
56
  * Webhook status for payment results (on-chain truth).
57
57
  * - `'finalized'`: Transaction confirmed on-chain
@@ -149,8 +149,6 @@ interface Events {
149
149
  * Error code (present when status is 'failed').
150
150
  * - `insufficient_balance`: User doesn't have enough tokens
151
151
  * - `network_error`: Blockchain network issue
152
- * - `pre_checkout_rejected`: Backend rejected the payment in pre-checkout
153
- * - `pre_checkout_timeout`: Backend didn't respond to pre-checkout in time
154
152
  * - `unknown`: Unexpected error
155
153
  * @since 0.1.1
156
154
  * @schema
@@ -197,6 +195,16 @@ declare const PLATFORMS: readonly ["ios", "android"];
197
195
  * Platform the miniapp is running on.
198
196
  */
199
197
  type Platform = (typeof PLATFORMS)[number];
198
+ /**
199
+ * Safe area insets in CSS pixels, injected by the host app.
200
+ * Accounts for system UI (status bar, notch, home indicator, nav bar).
201
+ */
202
+ interface SafeAreaInsets {
203
+ top: number;
204
+ right: number;
205
+ bottom: number;
206
+ left: number;
207
+ }
200
208
  /**
201
209
  * Launch parameters injected by the host app.
202
210
  */
@@ -209,6 +217,8 @@ interface LaunchParams {
209
217
  hostAppVersion: string | undefined;
210
218
  /** Platform the miniapp is running on */
211
219
  platform: Platform | undefined;
220
+ /** Safe area insets for the webview in CSS pixels */
221
+ safeAreaInsets: SafeAreaInsets | undefined;
212
222
  /**
213
223
  * Custom start parameter injected by host app.
214
224
  * Used for referral codes, campaign tracking, or custom routing.
@@ -344,7 +354,6 @@ interface Methods {
344
354
  *
345
355
  * **Pre-broadcast errors** (no webhook):
346
356
  * `'error:insufficient_balance'`, `'error:network_error'`,
347
- * `'error:pre_checkout_rejected'`, `'error:pre_checkout_timeout'`,
348
357
  * `'error:unknown'`
349
358
  *
350
359
  * @example
@@ -476,4 +485,4 @@ declare function isMethodSupported(method: MethodName, version: Version): boolea
476
485
  */
477
486
  declare function getMethodMinVersion(method: MethodName): Version | undefined;
478
487
  //#endregion
479
- export { type CreateEventPayload, type CreateMethodPayload, type EventName, type EventPayload, type Events, type LaunchParams, type MethodName, type MethodNameWithVersionedPayload, type MethodPayload, type MethodVersionedPayload, type Methods, PLATFORMS, type PaymentErrorCode, type PaymentTestScenario, type PaymentWebhookStatus, type Platform, type Version, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
488
+ export { type CreateEventPayload, type CreateMethodPayload, type EventName, type EventPayload, type Events, type LaunchParams, type MethodName, type MethodNameWithVersionedPayload, type MethodPayload, type MethodVersionedPayload, type Methods, PLATFORMS, type PaymentErrorCode, type PaymentTestScenario, type PaymentWebhookStatus, type Platform, type SafeAreaInsets, type Version, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
package/dist/index.d.mts CHANGED
@@ -51,7 +51,7 @@ type Empty = Record<string, never>;
51
51
  * @since 0.1.1
52
52
  * @schema
53
53
  */
54
- type PaymentErrorCode = 'insufficient_balance' | 'network_error' | 'pre_checkout_rejected' | 'pre_checkout_timeout' | 'unknown';
54
+ type PaymentErrorCode = 'insufficient_balance' | 'network_error' | 'unknown';
55
55
  /**
56
56
  * Webhook status for payment results (on-chain truth).
57
57
  * - `'finalized'`: Transaction confirmed on-chain
@@ -149,8 +149,6 @@ interface Events {
149
149
  * Error code (present when status is 'failed').
150
150
  * - `insufficient_balance`: User doesn't have enough tokens
151
151
  * - `network_error`: Blockchain network issue
152
- * - `pre_checkout_rejected`: Backend rejected the payment in pre-checkout
153
- * - `pre_checkout_timeout`: Backend didn't respond to pre-checkout in time
154
152
  * - `unknown`: Unexpected error
155
153
  * @since 0.1.1
156
154
  * @schema
@@ -197,6 +195,16 @@ declare const PLATFORMS: readonly ["ios", "android"];
197
195
  * Platform the miniapp is running on.
198
196
  */
199
197
  type Platform = (typeof PLATFORMS)[number];
198
+ /**
199
+ * Safe area insets in CSS pixels, injected by the host app.
200
+ * Accounts for system UI (status bar, notch, home indicator, nav bar).
201
+ */
202
+ interface SafeAreaInsets {
203
+ top: number;
204
+ right: number;
205
+ bottom: number;
206
+ left: number;
207
+ }
200
208
  /**
201
209
  * Launch parameters injected by the host app.
202
210
  */
@@ -209,6 +217,8 @@ interface LaunchParams {
209
217
  hostAppVersion: string | undefined;
210
218
  /** Platform the miniapp is running on */
211
219
  platform: Platform | undefined;
220
+ /** Safe area insets for the webview in CSS pixels */
221
+ safeAreaInsets: SafeAreaInsets | undefined;
212
222
  /**
213
223
  * Custom start parameter injected by host app.
214
224
  * Used for referral codes, campaign tracking, or custom routing.
@@ -344,7 +354,6 @@ interface Methods {
344
354
  *
345
355
  * **Pre-broadcast errors** (no webhook):
346
356
  * `'error:insufficient_balance'`, `'error:network_error'`,
347
- * `'error:pre_checkout_rejected'`, `'error:pre_checkout_timeout'`,
348
357
  * `'error:unknown'`
349
358
  *
350
359
  * @example
@@ -476,4 +485,4 @@ declare function isMethodSupported(method: MethodName, version: Version): boolea
476
485
  */
477
486
  declare function getMethodMinVersion(method: MethodName): Version | undefined;
478
487
  //#endregion
479
- export { type CreateEventPayload, type CreateMethodPayload, type EventName, type EventPayload, type Events, type LaunchParams, type MethodName, type MethodNameWithVersionedPayload, type MethodPayload, type MethodVersionedPayload, type Methods, PLATFORMS, type PaymentErrorCode, type PaymentTestScenario, type PaymentWebhookStatus, type Platform, type Version, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
488
+ export { type CreateEventPayload, type CreateMethodPayload, type EventName, type EventPayload, type Events, type LaunchParams, type MethodName, type MethodNameWithVersionedPayload, type MethodPayload, type MethodVersionedPayload, type Methods, PLATFORMS, type PaymentErrorCode, type PaymentTestScenario, type PaymentWebhookStatus, type Platform, type SafeAreaInsets, type Version, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alien_org/contract",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",