@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 +2 -1
- package/dist/index.d.cts +40 -2
- package/dist/index.d.mts +40 -2
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
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
|
-
* - `
|
|
137
|
+
* - `failed`: Sending transaction failed (check `errorCode`)
|
|
138
138
|
* @since 0.1.1
|
|
139
139
|
* @schema
|
|
140
140
|
*/
|
|
141
|
-
status: 'paid' | 'cancelled' | '
|
|
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
|
-
* - `
|
|
137
|
+
* - `failed`: Sending transaction failed (check `errorCode`)
|
|
138
138
|
* @since 0.1.1
|
|
139
139
|
* @schema
|
|
140
140
|
*/
|
|
141
|
-
status: 'paid' | 'cancelled' | '
|
|
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