@alien_org/contract 0.2.2 → 0.2.4
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.cjs +6 -1
- package/dist/index.d.cts +52 -5
- package/dist/index.d.mts +52 -5
- package/dist/index.mjs +6 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
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' | '
|
|
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
|
|
@@ -87,6 +87,21 @@ type PaymentWebhookStatus = 'finalized' | 'failed';
|
|
|
87
87
|
* @schema
|
|
88
88
|
*/
|
|
89
89
|
type PaymentTestScenario = 'paid' | 'paid:failed' | 'cancelled' | `error:${PaymentErrorCode}`;
|
|
90
|
+
/**
|
|
91
|
+
* Haptic impact feedback styles.
|
|
92
|
+
* Maps to UIImpactFeedbackGenerator styles on iOS
|
|
93
|
+
* and VibrationEffect on Android.
|
|
94
|
+
* @since 0.2.4
|
|
95
|
+
* @schema
|
|
96
|
+
*/
|
|
97
|
+
type HapticImpactStyle = 'light' | 'medium' | 'heavy' | 'soft' | 'rigid';
|
|
98
|
+
/**
|
|
99
|
+
* Haptic notification feedback types.
|
|
100
|
+
* Maps to UINotificationFeedbackGenerator types on iOS.
|
|
101
|
+
* @since 0.2.4
|
|
102
|
+
* @schema
|
|
103
|
+
*/
|
|
104
|
+
type HapticNotificationType = 'success' | 'warning' | 'error';
|
|
90
105
|
//#endregion
|
|
91
106
|
//#region src/events/types/payload.d.ts
|
|
92
107
|
/**
|
|
@@ -149,8 +164,6 @@ interface Events {
|
|
|
149
164
|
* Error code (present when status is 'failed').
|
|
150
165
|
* - `insufficient_balance`: User doesn't have enough tokens
|
|
151
166
|
* - `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
167
|
* - `unknown`: Unexpected error
|
|
155
168
|
* @since 0.1.1
|
|
156
169
|
* @schema
|
|
@@ -356,7 +369,6 @@ interface Methods {
|
|
|
356
369
|
*
|
|
357
370
|
* **Pre-broadcast errors** (no webhook):
|
|
358
371
|
* `'error:insufficient_balance'`, `'error:network_error'`,
|
|
359
|
-
* `'error:pre_checkout_rejected'`, `'error:pre_checkout_timeout'`,
|
|
360
372
|
* `'error:unknown'`
|
|
361
373
|
*
|
|
362
374
|
* @example
|
|
@@ -434,6 +446,41 @@ interface Methods {
|
|
|
434
446
|
*/
|
|
435
447
|
openMode?: 'external' | 'internal';
|
|
436
448
|
}>;
|
|
449
|
+
/**
|
|
450
|
+
* Trigger haptic impact feedback.
|
|
451
|
+
* Fire-and-forget — no response expected.
|
|
452
|
+
* @since 0.2.4
|
|
453
|
+
* @schema
|
|
454
|
+
*/
|
|
455
|
+
'haptic:impact': CreateMethodPayload<{
|
|
456
|
+
/**
|
|
457
|
+
* The impact feedback style.
|
|
458
|
+
* @since 0.2.4
|
|
459
|
+
* @schema
|
|
460
|
+
*/
|
|
461
|
+
style: HapticImpactStyle;
|
|
462
|
+
}>;
|
|
463
|
+
/**
|
|
464
|
+
* Trigger haptic notification feedback.
|
|
465
|
+
* Fire-and-forget — no response expected.
|
|
466
|
+
* @since 0.2.4
|
|
467
|
+
* @schema
|
|
468
|
+
*/
|
|
469
|
+
'haptic:notification': CreateMethodPayload<{
|
|
470
|
+
/**
|
|
471
|
+
* The notification feedback type.
|
|
472
|
+
* @since 0.2.4
|
|
473
|
+
* @schema
|
|
474
|
+
*/
|
|
475
|
+
type: HapticNotificationType;
|
|
476
|
+
}>;
|
|
477
|
+
/**
|
|
478
|
+
* Trigger haptic selection change feedback.
|
|
479
|
+
* Fire-and-forget — no response expected.
|
|
480
|
+
* @since 0.2.4
|
|
481
|
+
* @schema
|
|
482
|
+
*/
|
|
483
|
+
'haptic:selection': CreateMethodPayload<Empty>;
|
|
437
484
|
}
|
|
438
485
|
//#endregion
|
|
439
486
|
//#region src/methods/types/method-types.d.ts
|
|
@@ -488,4 +535,4 @@ declare function isMethodSupported(method: MethodName, version: Version): boolea
|
|
|
488
535
|
*/
|
|
489
536
|
declare function getMethodMinVersion(method: MethodName): Version | undefined;
|
|
490
537
|
//#endregion
|
|
491
|
-
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 };
|
|
538
|
+
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 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' | '
|
|
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
|
|
@@ -87,6 +87,21 @@ type PaymentWebhookStatus = 'finalized' | 'failed';
|
|
|
87
87
|
* @schema
|
|
88
88
|
*/
|
|
89
89
|
type PaymentTestScenario = 'paid' | 'paid:failed' | 'cancelled' | `error:${PaymentErrorCode}`;
|
|
90
|
+
/**
|
|
91
|
+
* Haptic impact feedback styles.
|
|
92
|
+
* Maps to UIImpactFeedbackGenerator styles on iOS
|
|
93
|
+
* and VibrationEffect on Android.
|
|
94
|
+
* @since 0.2.4
|
|
95
|
+
* @schema
|
|
96
|
+
*/
|
|
97
|
+
type HapticImpactStyle = 'light' | 'medium' | 'heavy' | 'soft' | 'rigid';
|
|
98
|
+
/**
|
|
99
|
+
* Haptic notification feedback types.
|
|
100
|
+
* Maps to UINotificationFeedbackGenerator types on iOS.
|
|
101
|
+
* @since 0.2.4
|
|
102
|
+
* @schema
|
|
103
|
+
*/
|
|
104
|
+
type HapticNotificationType = 'success' | 'warning' | 'error';
|
|
90
105
|
//#endregion
|
|
91
106
|
//#region src/events/types/payload.d.ts
|
|
92
107
|
/**
|
|
@@ -149,8 +164,6 @@ interface Events {
|
|
|
149
164
|
* Error code (present when status is 'failed').
|
|
150
165
|
* - `insufficient_balance`: User doesn't have enough tokens
|
|
151
166
|
* - `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
167
|
* - `unknown`: Unexpected error
|
|
155
168
|
* @since 0.1.1
|
|
156
169
|
* @schema
|
|
@@ -356,7 +369,6 @@ interface Methods {
|
|
|
356
369
|
*
|
|
357
370
|
* **Pre-broadcast errors** (no webhook):
|
|
358
371
|
* `'error:insufficient_balance'`, `'error:network_error'`,
|
|
359
|
-
* `'error:pre_checkout_rejected'`, `'error:pre_checkout_timeout'`,
|
|
360
372
|
* `'error:unknown'`
|
|
361
373
|
*
|
|
362
374
|
* @example
|
|
@@ -434,6 +446,41 @@ interface Methods {
|
|
|
434
446
|
*/
|
|
435
447
|
openMode?: 'external' | 'internal';
|
|
436
448
|
}>;
|
|
449
|
+
/**
|
|
450
|
+
* Trigger haptic impact feedback.
|
|
451
|
+
* Fire-and-forget — no response expected.
|
|
452
|
+
* @since 0.2.4
|
|
453
|
+
* @schema
|
|
454
|
+
*/
|
|
455
|
+
'haptic:impact': CreateMethodPayload<{
|
|
456
|
+
/**
|
|
457
|
+
* The impact feedback style.
|
|
458
|
+
* @since 0.2.4
|
|
459
|
+
* @schema
|
|
460
|
+
*/
|
|
461
|
+
style: HapticImpactStyle;
|
|
462
|
+
}>;
|
|
463
|
+
/**
|
|
464
|
+
* Trigger haptic notification feedback.
|
|
465
|
+
* Fire-and-forget — no response expected.
|
|
466
|
+
* @since 0.2.4
|
|
467
|
+
* @schema
|
|
468
|
+
*/
|
|
469
|
+
'haptic:notification': CreateMethodPayload<{
|
|
470
|
+
/**
|
|
471
|
+
* The notification feedback type.
|
|
472
|
+
* @since 0.2.4
|
|
473
|
+
* @schema
|
|
474
|
+
*/
|
|
475
|
+
type: HapticNotificationType;
|
|
476
|
+
}>;
|
|
477
|
+
/**
|
|
478
|
+
* Trigger haptic selection change feedback.
|
|
479
|
+
* Fire-and-forget — no response expected.
|
|
480
|
+
* @since 0.2.4
|
|
481
|
+
* @schema
|
|
482
|
+
*/
|
|
483
|
+
'haptic:selection': CreateMethodPayload<Empty>;
|
|
437
484
|
}
|
|
438
485
|
//#endregion
|
|
439
486
|
//#region src/methods/types/method-types.d.ts
|
|
@@ -488,4 +535,4 @@ declare function isMethodSupported(method: MethodName, version: Version): boolea
|
|
|
488
535
|
*/
|
|
489
536
|
declare function getMethodMinVersion(method: MethodName): Version | undefined;
|
|
490
537
|
//#endregion
|
|
491
|
-
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 };
|
|
538
|
+
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 Version, getMethodMinVersion, getReleaseVersion, isMethodSupported, releases };
|
package/dist/index.mjs
CHANGED