@alien_org/contract 0.1.2 → 0.1.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.cjs +2 -1
- package/dist/index.d.cts +38 -0
- package/dist/index.d.mts +38 -0
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -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
|
@@ -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