@alien_org/contract 0.1.2 → 0.1.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 CHANGED
@@ -14,7 +14,8 @@ const releases = {
14
14
  "payment:request",
15
15
  "clipboard:write",
16
16
  "clipboard:read"
17
- ]
17
+ ],
18
+ "0.1.3": ["link:open"]
18
19
  };
19
20
 
20
21
  //#endregion
package/dist/index.d.cts CHANGED
@@ -134,11 +134,11 @@ interface Events {
134
134
  * Payment status.
135
135
  * - `paid`: Success
136
136
  * - `cancelled`: User rejected
137
- * - `error`: Error (check `errorCode`)
137
+ * - `failed`: Sending transaction failed (check `errorCode`)
138
138
  * @since 0.1.1
139
139
  * @schema
140
140
  */
141
- status: 'paid' | 'cancelled' | 'error';
141
+ status: 'paid' | 'cancelled' | 'failed';
142
142
  /**
143
143
  * Transaction hash (present when status is 'paid').
144
144
  * @since 0.1.1
@@ -383,6 +383,44 @@ interface Methods {
383
383
  * @schema
384
384
  */
385
385
  'clipboard:read': CreateMethodPayload<WithReqId<Empty>>;
386
+ /**
387
+ * Open a URL.
388
+ *
389
+ * The host app acts as middleware: parses the URL, checks permissions/auth,
390
+ * and routes to the appropriate handler based on URL and `openMode`.
391
+ *
392
+ * **`external`** (default) - Open outside the host app:
393
+ * - Custom schemes (`solana:`, `mailto:`) → system handler
394
+ * - HTTPS → system browser
395
+ *
396
+ * **`internal`** - Open within the host app:
397
+ * - Miniapp links → open miniapp (handles auth if required)
398
+ * - Other links → in-app webview
399
+ *
400
+ * @example
401
+ * emit('link:open', { url: 'solana:...' });
402
+ * emit('link:open', { url: 'mailto:hi@example.com' });
403
+ * emit('link:open', { url: 'https://example.com', openMode: 'internal' });
404
+ *
405
+ * @since 0.1.3
406
+ * @schema
407
+ */
408
+ 'link:open': CreateMethodPayload<{
409
+ /**
410
+ * The URL to open.
411
+ * @since 0.1.3
412
+ * @schema
413
+ */
414
+ url: string;
415
+ /**
416
+ * Where to open the URL.
417
+ * - `external` (default): System browser or app handler
418
+ * - `internal`: Within the host app (miniapps, webviews)
419
+ * @since 0.1.3
420
+ * @schema
421
+ */
422
+ openMode?: 'external' | 'internal';
423
+ }>;
386
424
  }
387
425
  //#endregion
388
426
  //#region src/methods/types/method-types.d.ts
package/dist/index.d.mts CHANGED
@@ -134,11 +134,11 @@ interface Events {
134
134
  * Payment status.
135
135
  * - `paid`: Success
136
136
  * - `cancelled`: User rejected
137
- * - `error`: Error (check `errorCode`)
137
+ * - `failed`: Sending transaction failed (check `errorCode`)
138
138
  * @since 0.1.1
139
139
  * @schema
140
140
  */
141
- status: 'paid' | 'cancelled' | 'error';
141
+ status: 'paid' | 'cancelled' | 'failed';
142
142
  /**
143
143
  * Transaction hash (present when status is 'paid').
144
144
  * @since 0.1.1
@@ -383,6 +383,44 @@ interface Methods {
383
383
  * @schema
384
384
  */
385
385
  'clipboard:read': CreateMethodPayload<WithReqId<Empty>>;
386
+ /**
387
+ * Open a URL.
388
+ *
389
+ * The host app acts as middleware: parses the URL, checks permissions/auth,
390
+ * and routes to the appropriate handler based on URL and `openMode`.
391
+ *
392
+ * **`external`** (default) - Open outside the host app:
393
+ * - Custom schemes (`solana:`, `mailto:`) → system handler
394
+ * - HTTPS → system browser
395
+ *
396
+ * **`internal`** - Open within the host app:
397
+ * - Miniapp links → open miniapp (handles auth if required)
398
+ * - Other links → in-app webview
399
+ *
400
+ * @example
401
+ * emit('link:open', { url: 'solana:...' });
402
+ * emit('link:open', { url: 'mailto:hi@example.com' });
403
+ * emit('link:open', { url: 'https://example.com', openMode: 'internal' });
404
+ *
405
+ * @since 0.1.3
406
+ * @schema
407
+ */
408
+ 'link:open': CreateMethodPayload<{
409
+ /**
410
+ * The URL to open.
411
+ * @since 0.1.3
412
+ * @schema
413
+ */
414
+ url: string;
415
+ /**
416
+ * Where to open the URL.
417
+ * - `external` (default): System browser or app handler
418
+ * - `internal`: Within the host app (miniapps, webviews)
419
+ * @since 0.1.3
420
+ * @schema
421
+ */
422
+ openMode?: 'external' | 'internal';
423
+ }>;
386
424
  }
387
425
  //#endregion
388
426
  //#region src/methods/types/method-types.d.ts
package/dist/index.mjs CHANGED
@@ -13,7 +13,8 @@ const releases = {
13
13
  "payment:request",
14
14
  "clipboard:write",
15
15
  "clipboard:read"
16
- ]
16
+ ],
17
+ "0.1.3": ["link:open"]
17
18
  };
18
19
 
19
20
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alien_org/contract",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",