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

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
@@ -63,7 +63,7 @@ isMethodSupported('payment:request', '0.0.9'); // false
63
63
 
64
64
  // Get minimum version that supports a method
65
65
  getMethodMinVersion('app:ready'); // '0.0.9'
66
- getMethodMinVersion('payment:request'); // '0.0.14'
66
+ getMethodMinVersion('payment:request'); // '0.1.1'
67
67
 
68
68
  // Get version where a method was introduced
69
69
  getReleaseVersion('app:ready'); // '0.0.9'
@@ -74,17 +74,33 @@ getReleaseVersion('app:ready'); // '0.0.9'
74
74
  | Method | Since | Description |
75
75
  |--------|-------|-------------|
76
76
  | `app:ready` | 0.0.9 | Notify host that miniapp is ready |
77
- | `miniapp:close.ack` | 0.0.14 | Acknowledge close request |
78
- | `host.back.button:toggle` | 0.0.14 | Show/hide back button |
79
- | `payment:request` | 0.0.14 | Request payment |
77
+ | `payment:request` | 0.1.1 | Request payment |
78
+ | `clipboard:write` | 0.1.1 | Write text to clipboard |
79
+ | `clipboard:read` | 0.1.1 | Read text from clipboard |
80
+ | `link:open` | 0.1.3 | Open a URL |
81
+ | `haptic:impact` | 0.2.4 | Trigger haptic impact feedback |
82
+ | `haptic:notification` | 0.2.4 | Trigger haptic notification feedback |
83
+ | `haptic:selection` | 0.2.4 | Trigger haptic selection feedback |
84
+ | `wallet.solana:connect` | 1.0.0 | Request Solana wallet connection |
85
+ | `wallet.solana:disconnect` | 1.0.0 | Disconnect from Solana wallet |
86
+ | `wallet.solana:sign.transaction` | 1.0.0 | Sign a Solana transaction |
87
+ | `wallet.solana:sign.message` | 1.0.0 | Sign a Solana message |
88
+ | `wallet.solana:sign.send` | 1.0.0 | Sign and send a Solana transaction |
89
+ | `app:close` | 1.0.0 | Request host to close the miniapp |
90
+ | `host.back.button:toggle` | 1.0.0 | Show/hide back button |
80
91
 
81
92
  ## Available Events
82
93
 
83
94
  | Event | Since | Description |
84
95
  |-------|-------|-------------|
85
96
  | `miniapp:close` | 0.0.14 | Host is closing miniapp |
86
- | `host.back.button:clicked` | 0.0.14 | Back button was clicked |
87
- | `payment:response` | 0.0.14 | Payment result |
97
+ | `host.back.button:clicked` | 1.0.0 | Back button was clicked |
98
+ | `payment:response` | 0.1.1 | Payment result |
99
+ | `clipboard:response` | 0.1.1 | Clipboard read result |
100
+ | `wallet.solana:connect.response` | 1.0.0 | Wallet connection result |
101
+ | `wallet.solana:sign.transaction.response` | 1.0.0 | Transaction signing result |
102
+ | `wallet.solana:sign.message.response` | 1.0.0 | Message signing result |
103
+ | `wallet.solana:sign.send.response` | 1.0.0 | Sign and send result |
88
104
 
89
105
  ## LaunchParams
90
106
 
@@ -92,11 +108,13 @@ Parameters injected by the host app:
92
108
 
93
109
  ```typescript
94
110
  interface LaunchParams {
95
- authToken: string | undefined; // JWT auth token
96
- contractVersion: Version | undefined; // Host's contract version
97
- hostAppVersion: string | undefined; // Host app version
98
- platform: Platform | undefined; // 'ios' | 'android'
99
- startParam: string | undefined; // Custom param (referrals, etc.)
111
+ authToken: string | undefined; // JWT auth token
112
+ contractVersion: Version | undefined; // Host's contract version
113
+ hostAppVersion: string | undefined; // Host app version
114
+ platform: Platform | undefined; // 'ios' | 'android'
115
+ safeAreaInsets: SafeAreaInsets | undefined; // System UI insets (CSS px)
116
+ startParam: string | undefined; // Custom param (referrals, etc.)
117
+ isFullscreen: boolean | undefined; // Launched in fullscreen mode
100
118
  }
101
119
  ```
102
120
 
package/dist/index.cjs CHANGED
@@ -9,7 +9,6 @@ const PLATFORMS = ["ios", "android"];
9
9
  //#region src/methods/versions/releases.ts
10
10
  const releases = {
11
11
  "0.0.9": ["app:ready"],
12
- "0.0.14": ["miniapp:close.ack", "host.back.button:toggle"],
13
12
  "0.1.1": [
14
13
  "payment:request",
15
14
  "clipboard:write",
@@ -21,12 +20,14 @@ const releases = {
21
20
  "haptic:notification",
22
21
  "haptic:selection"
23
22
  ],
24
- "0.3.0": [
23
+ "1.0.0": [
25
24
  "wallet.solana:connect",
26
25
  "wallet.solana:disconnect",
27
26
  "wallet.solana:sign.transaction",
28
27
  "wallet.solana:sign.message",
29
- "wallet.solana:sign.send"
28
+ "wallet.solana:sign.send",
29
+ "app:close",
30
+ "host.back.button:toggle"
30
31
  ]
31
32
  };
32
33
 
@@ -104,7 +105,7 @@ function getMethodMinVersion(method) {
104
105
  * }
105
106
  * ```
106
107
  *
107
- * @since 0.3.0
108
+ * @since 1.0.0
108
109
  */
109
110
  const WALLET_ERROR = {
110
111
  USER_REJECTED: 5e3,
package/dist/index.d.cts CHANGED
@@ -116,7 +116,7 @@ type HapticNotificationType = 'success' | 'warning' | 'error';
116
116
  * | `-32603` | Internal error (send failed, unexpected error) | JSON-RPC standard |
117
117
  * | `8000` | Request expired / timed out | `sessionRequestExpired` |
118
118
  *
119
- * @since 0.3.0
119
+ * @since 1.0.0
120
120
  * @schema
121
121
  */
122
122
  type WalletSolanaErrorCode = 5000 | -32602 | -32603 | 8000;
@@ -132,7 +132,7 @@ type WalletSolanaErrorCode = 5000 | -32602 | -32603 | 8000;
132
132
  * }
133
133
  * ```
134
134
  *
135
- * @since 0.3.0
135
+ * @since 1.0.0
136
136
  */
137
137
  declare const WALLET_ERROR: {
138
138
  /** User rejected the request (cancelled approval screen). */
@@ -146,7 +146,7 @@ declare const WALLET_ERROR: {
146
146
  };
147
147
  /**
148
148
  * Solana commitment levels for send options.
149
- * @since 0.3.0
149
+ * @since 1.0.0
150
150
  * @schema
151
151
  */
152
152
  type SolanaCommitment = 'processed' | 'confirmed' | 'finalized';
@@ -154,7 +154,7 @@ type SolanaCommitment = 'processed' | 'confirmed' | 'finalized';
154
154
  * Solana chain identifiers (wallet-standard format).
155
155
  * Used by `wallet.solana:sign.send` to tell the host app
156
156
  * which cluster to broadcast to.
157
- * @since 0.3.0
157
+ * @since 1.0.0
158
158
  * @schema
159
159
  */
160
160
  type SolanaChain = 'solana:mainnet' | 'solana:devnet' | 'solana:testnet';
@@ -182,7 +182,7 @@ interface Events {
182
182
  'miniapp:close': CreateEventPayload<Empty>;
183
183
  /**
184
184
  * Host app's back button clicked event.
185
- * @since 0.0.14
185
+ * @since 1.0.0
186
186
  * @schema
187
187
  */
188
188
  'host.back.button:clicked': CreateEventPayload<Empty>;
@@ -253,7 +253,7 @@ interface Events {
253
253
  }>>;
254
254
  /**
255
255
  * Solana wallet connection response.
256
- * @since 0.3.0
256
+ * @since 1.0.0
257
257
  * @schema
258
258
  */
259
259
  'wallet.solana:connect.response': CreateEventPayload<WithReqId<{
@@ -266,7 +266,7 @@ interface Events {
266
266
  }>>;
267
267
  /**
268
268
  * Solana transaction signing response.
269
- * @since 0.3.0
269
+ * @since 1.0.0
270
270
  * @schema
271
271
  */
272
272
  'wallet.solana:sign.transaction.response': CreateEventPayload<WithReqId<{
@@ -279,7 +279,7 @@ interface Events {
279
279
  }>>;
280
280
  /**
281
281
  * Solana message signing response.
282
- * @since 0.3.0
282
+ * @since 1.0.0
283
283
  * @schema
284
284
  */
285
285
  'wallet.solana:sign.message.response': CreateEventPayload<WithReqId<{
@@ -294,7 +294,7 @@ interface Events {
294
294
  }>>;
295
295
  /**
296
296
  * Solana sign-and-send transaction response.
297
- * @since 0.3.0
297
+ * @since 1.0.0
298
298
  * @schema
299
299
  */
300
300
  'wallet.solana:sign.send.response': CreateEventPayload<WithReqId<{
@@ -349,6 +349,11 @@ interface LaunchParams {
349
349
  * Used for referral codes, campaign tracking, or custom routing.
350
350
  */
351
351
  startParam: string | undefined;
352
+ /**
353
+ * Whether the miniapp was launched in fullscreen mode.
354
+ * @since 1.0.0
355
+ */
356
+ isFullscreen: boolean | undefined;
352
357
  }
353
358
  //#endregion
354
359
  //#region src/methods/types/payload.d.ts
@@ -369,27 +374,27 @@ interface Methods {
369
374
  /**
370
375
  * Miniapp ready method.
371
376
  * Sent by the miniapp to notify the host app that it has loaded and is ready to be displayed.
372
- * @since 0.0.1
377
+ * @since 0.0.9
373
378
  * @schema
374
379
  */
375
380
  'app:ready': CreateMethodPayload<Empty>;
376
381
  /**
377
- * Miniapp close acknowledgment method.
378
- * Sent by the miniapp to notify the host app that it has completed cleanup and is ready to be closed.
379
- * Note that if the miniapp takes longer than 10 seconds to close, the host app will force close the miniapp.
380
- * @since 0.0.14
382
+ * Close the miniapp.
383
+ * Sent by the miniapp to request the host app to close it.
384
+ * Fire-and-forget no response expected.
385
+ * @since 1.0.0
381
386
  * @schema
382
387
  */
383
- 'miniapp:close.ack': CreateMethodPayload<Empty>;
388
+ 'app:close': CreateMethodPayload<Empty>;
384
389
  /**
385
390
  * Toggle host app's back button visibility.
386
- * @since 0.0.14
391
+ * @since 1.0.0
387
392
  * @schema
388
393
  */
389
394
  'host.back.button:toggle': CreateMethodPayload<{
390
395
  /**
391
396
  * Whether to show or hide the back button.
392
- * @since 0.0.14
397
+ * @since 1.0.0
393
398
  * @schema
394
399
  */
395
400
  visible: boolean;
@@ -401,8 +406,8 @@ interface Methods {
401
406
  * Your backend receives a webhook when user pays - fulfill the order
402
407
  * immediately without waiting for chain confirmation.
403
408
  *
404
- * Optional display fields (`title`, `caption`, `iconUrl`, `quantity`)
405
- * are shown on the payment approval screen.
409
+ * Optional `item` object (`title`, `iconUrl`, `quantity`)
410
+ * is shown on the payment approval screen.
406
411
  *
407
412
  * Set `test` to a scenario string (e.g. `'paid'`, `'error:insufficient_balance'`)
408
413
  * for test mode - no real payment is made, but the specified scenario is
@@ -594,21 +599,21 @@ interface Methods {
594
599
  /**
595
600
  * Request Solana wallet connection.
596
601
  * Returns the wallet's public key on success.
597
- * @since 0.3.0
602
+ * @since 1.0.0
598
603
  * @schema
599
604
  */
600
605
  'wallet.solana:connect': CreateMethodPayload<WithReqId<Empty>>;
601
606
  /**
602
607
  * Disconnect from Solana wallet.
603
608
  * Fire-and-forget — no response expected.
604
- * @since 0.3.0
609
+ * @since 1.0.0
605
610
  * @schema
606
611
  */
607
612
  'wallet.solana:disconnect': CreateMethodPayload<Empty>;
608
613
  /**
609
614
  * Request Solana transaction signing.
610
615
  * Returns the signed transaction bytes.
611
- * @since 0.3.0
616
+ * @since 1.0.0
612
617
  * @schema
613
618
  */
614
619
  'wallet.solana:sign.transaction': CreateMethodPayload<WithReqId<{
@@ -618,7 +623,7 @@ interface Methods {
618
623
  /**
619
624
  * Request Solana message signing.
620
625
  * Returns the Ed25519 signature.
621
- * @since 0.3.0
626
+ * @since 1.0.0
622
627
  * @schema
623
628
  */
624
629
  'wallet.solana:sign.message': CreateMethodPayload<WithReqId<{
@@ -629,7 +634,7 @@ interface Methods {
629
634
  * Request Solana transaction signing and sending.
630
635
  * The host app signs and broadcasts the transaction.
631
636
  * Returns the transaction signature.
632
- * @since 0.3.0
637
+ * @since 1.0.0
633
638
  * @schema
634
639
  */
635
640
  'wallet.solana:sign.send': CreateMethodPayload<WithReqId<{
@@ -640,7 +645,7 @@ interface Methods {
640
645
  * In bridge mode the host app can infer this from miniapp config,
641
646
  * but in relay mode (QR/WebSocket) this is required so the host
642
647
  * app knows which RPC to broadcast to.
643
- * @since 0.3.0
648
+ * @since 1.0.0
644
649
  * @schema
645
650
  */
646
651
  chain?: SolanaChain;
package/dist/index.d.mts CHANGED
@@ -116,7 +116,7 @@ type HapticNotificationType = 'success' | 'warning' | 'error';
116
116
  * | `-32603` | Internal error (send failed, unexpected error) | JSON-RPC standard |
117
117
  * | `8000` | Request expired / timed out | `sessionRequestExpired` |
118
118
  *
119
- * @since 0.3.0
119
+ * @since 1.0.0
120
120
  * @schema
121
121
  */
122
122
  type WalletSolanaErrorCode = 5000 | -32602 | -32603 | 8000;
@@ -132,7 +132,7 @@ type WalletSolanaErrorCode = 5000 | -32602 | -32603 | 8000;
132
132
  * }
133
133
  * ```
134
134
  *
135
- * @since 0.3.0
135
+ * @since 1.0.0
136
136
  */
137
137
  declare const WALLET_ERROR: {
138
138
  /** User rejected the request (cancelled approval screen). */
@@ -146,7 +146,7 @@ declare const WALLET_ERROR: {
146
146
  };
147
147
  /**
148
148
  * Solana commitment levels for send options.
149
- * @since 0.3.0
149
+ * @since 1.0.0
150
150
  * @schema
151
151
  */
152
152
  type SolanaCommitment = 'processed' | 'confirmed' | 'finalized';
@@ -154,7 +154,7 @@ type SolanaCommitment = 'processed' | 'confirmed' | 'finalized';
154
154
  * Solana chain identifiers (wallet-standard format).
155
155
  * Used by `wallet.solana:sign.send` to tell the host app
156
156
  * which cluster to broadcast to.
157
- * @since 0.3.0
157
+ * @since 1.0.0
158
158
  * @schema
159
159
  */
160
160
  type SolanaChain = 'solana:mainnet' | 'solana:devnet' | 'solana:testnet';
@@ -182,7 +182,7 @@ interface Events {
182
182
  'miniapp:close': CreateEventPayload<Empty>;
183
183
  /**
184
184
  * Host app's back button clicked event.
185
- * @since 0.0.14
185
+ * @since 1.0.0
186
186
  * @schema
187
187
  */
188
188
  'host.back.button:clicked': CreateEventPayload<Empty>;
@@ -253,7 +253,7 @@ interface Events {
253
253
  }>>;
254
254
  /**
255
255
  * Solana wallet connection response.
256
- * @since 0.3.0
256
+ * @since 1.0.0
257
257
  * @schema
258
258
  */
259
259
  'wallet.solana:connect.response': CreateEventPayload<WithReqId<{
@@ -266,7 +266,7 @@ interface Events {
266
266
  }>>;
267
267
  /**
268
268
  * Solana transaction signing response.
269
- * @since 0.3.0
269
+ * @since 1.0.0
270
270
  * @schema
271
271
  */
272
272
  'wallet.solana:sign.transaction.response': CreateEventPayload<WithReqId<{
@@ -279,7 +279,7 @@ interface Events {
279
279
  }>>;
280
280
  /**
281
281
  * Solana message signing response.
282
- * @since 0.3.0
282
+ * @since 1.0.0
283
283
  * @schema
284
284
  */
285
285
  'wallet.solana:sign.message.response': CreateEventPayload<WithReqId<{
@@ -294,7 +294,7 @@ interface Events {
294
294
  }>>;
295
295
  /**
296
296
  * Solana sign-and-send transaction response.
297
- * @since 0.3.0
297
+ * @since 1.0.0
298
298
  * @schema
299
299
  */
300
300
  'wallet.solana:sign.send.response': CreateEventPayload<WithReqId<{
@@ -349,6 +349,11 @@ interface LaunchParams {
349
349
  * Used for referral codes, campaign tracking, or custom routing.
350
350
  */
351
351
  startParam: string | undefined;
352
+ /**
353
+ * Whether the miniapp was launched in fullscreen mode.
354
+ * @since 1.0.0
355
+ */
356
+ isFullscreen: boolean | undefined;
352
357
  }
353
358
  //#endregion
354
359
  //#region src/methods/types/payload.d.ts
@@ -369,27 +374,27 @@ interface Methods {
369
374
  /**
370
375
  * Miniapp ready method.
371
376
  * Sent by the miniapp to notify the host app that it has loaded and is ready to be displayed.
372
- * @since 0.0.1
377
+ * @since 0.0.9
373
378
  * @schema
374
379
  */
375
380
  'app:ready': CreateMethodPayload<Empty>;
376
381
  /**
377
- * Miniapp close acknowledgment method.
378
- * Sent by the miniapp to notify the host app that it has completed cleanup and is ready to be closed.
379
- * Note that if the miniapp takes longer than 10 seconds to close, the host app will force close the miniapp.
380
- * @since 0.0.14
382
+ * Close the miniapp.
383
+ * Sent by the miniapp to request the host app to close it.
384
+ * Fire-and-forget no response expected.
385
+ * @since 1.0.0
381
386
  * @schema
382
387
  */
383
- 'miniapp:close.ack': CreateMethodPayload<Empty>;
388
+ 'app:close': CreateMethodPayload<Empty>;
384
389
  /**
385
390
  * Toggle host app's back button visibility.
386
- * @since 0.0.14
391
+ * @since 1.0.0
387
392
  * @schema
388
393
  */
389
394
  'host.back.button:toggle': CreateMethodPayload<{
390
395
  /**
391
396
  * Whether to show or hide the back button.
392
- * @since 0.0.14
397
+ * @since 1.0.0
393
398
  * @schema
394
399
  */
395
400
  visible: boolean;
@@ -401,8 +406,8 @@ interface Methods {
401
406
  * Your backend receives a webhook when user pays - fulfill the order
402
407
  * immediately without waiting for chain confirmation.
403
408
  *
404
- * Optional display fields (`title`, `caption`, `iconUrl`, `quantity`)
405
- * are shown on the payment approval screen.
409
+ * Optional `item` object (`title`, `iconUrl`, `quantity`)
410
+ * is shown on the payment approval screen.
406
411
  *
407
412
  * Set `test` to a scenario string (e.g. `'paid'`, `'error:insufficient_balance'`)
408
413
  * for test mode - no real payment is made, but the specified scenario is
@@ -594,21 +599,21 @@ interface Methods {
594
599
  /**
595
600
  * Request Solana wallet connection.
596
601
  * Returns the wallet's public key on success.
597
- * @since 0.3.0
602
+ * @since 1.0.0
598
603
  * @schema
599
604
  */
600
605
  'wallet.solana:connect': CreateMethodPayload<WithReqId<Empty>>;
601
606
  /**
602
607
  * Disconnect from Solana wallet.
603
608
  * Fire-and-forget — no response expected.
604
- * @since 0.3.0
609
+ * @since 1.0.0
605
610
  * @schema
606
611
  */
607
612
  'wallet.solana:disconnect': CreateMethodPayload<Empty>;
608
613
  /**
609
614
  * Request Solana transaction signing.
610
615
  * Returns the signed transaction bytes.
611
- * @since 0.3.0
616
+ * @since 1.0.0
612
617
  * @schema
613
618
  */
614
619
  'wallet.solana:sign.transaction': CreateMethodPayload<WithReqId<{
@@ -618,7 +623,7 @@ interface Methods {
618
623
  /**
619
624
  * Request Solana message signing.
620
625
  * Returns the Ed25519 signature.
621
- * @since 0.3.0
626
+ * @since 1.0.0
622
627
  * @schema
623
628
  */
624
629
  'wallet.solana:sign.message': CreateMethodPayload<WithReqId<{
@@ -629,7 +634,7 @@ interface Methods {
629
634
  * Request Solana transaction signing and sending.
630
635
  * The host app signs and broadcasts the transaction.
631
636
  * Returns the transaction signature.
632
- * @since 0.3.0
637
+ * @since 1.0.0
633
638
  * @schema
634
639
  */
635
640
  'wallet.solana:sign.send': CreateMethodPayload<WithReqId<{
@@ -640,7 +645,7 @@ interface Methods {
640
645
  * In bridge mode the host app can infer this from miniapp config,
641
646
  * but in relay mode (QR/WebSocket) this is required so the host
642
647
  * app knows which RPC to broadcast to.
643
- * @since 0.3.0
648
+ * @since 1.0.0
644
649
  * @schema
645
650
  */
646
651
  chain?: SolanaChain;
package/dist/index.mjs CHANGED
@@ -8,7 +8,6 @@ const PLATFORMS = ["ios", "android"];
8
8
  //#region src/methods/versions/releases.ts
9
9
  const releases = {
10
10
  "0.0.9": ["app:ready"],
11
- "0.0.14": ["miniapp:close.ack", "host.back.button:toggle"],
12
11
  "0.1.1": [
13
12
  "payment:request",
14
13
  "clipboard:write",
@@ -20,12 +19,14 @@ const releases = {
20
19
  "haptic:notification",
21
20
  "haptic:selection"
22
21
  ],
23
- "0.3.0": [
22
+ "1.0.0": [
24
23
  "wallet.solana:connect",
25
24
  "wallet.solana:disconnect",
26
25
  "wallet.solana:sign.transaction",
27
26
  "wallet.solana:sign.message",
28
- "wallet.solana:sign.send"
27
+ "wallet.solana:sign.send",
28
+ "app:close",
29
+ "host.back.button:toggle"
29
30
  ]
30
31
  };
31
32
 
@@ -103,7 +104,7 @@ function getMethodMinVersion(method) {
103
104
  * }
104
105
  * ```
105
106
  *
106
- * @since 0.3.0
107
+ * @since 1.0.0
107
108
  */
108
109
  const WALLET_ERROR = {
109
110
  USER_REJECTED: 5e3,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alien_org/contract",
3
- "version": "1.0.0-alpha",
3
+ "version": "1.0.0-alpha.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",