@reown/appkit-experimental 1.6.3 → 1.6.4-rc.0
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/esm/exports/smart-session/index.js +3 -0
- package/dist/esm/exports/smart-session/index.js.map +1 -1
- package/dist/esm/src/smart-session/controllers/SmartSessionsController.js +39 -1
- package/dist/esm/src/smart-session/controllers/SmartSessionsController.js.map +1 -1
- package/dist/esm/src/smart-session/helper/index.js +15 -0
- package/dist/esm/src/smart-session/helper/index.js.map +1 -1
- package/dist/esm/src/smart-session/utils/TypeUtils.js.map +1 -1
- package/dist/esm/tests/smart-session/createSubscription.test.js +62 -0
- package/dist/esm/tests/smart-session/createSubscription.test.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/exports/smart-session/index.d.ts +2 -1
- package/dist/types/src/smart-session/controllers/SmartSessionsController.d.ts +2 -1
- package/dist/types/src/smart-session/helper/index.d.ts +2 -1
- package/dist/types/src/smart-session/utils/TypeUtils.d.ts +12 -0
- package/dist/types/tests/smart-session/createSubscription.test.d.ts +1 -0
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SmartSession, SmartSessionGrantPermissionsRequest, SmartSessionGrantPermissionsResponse } from '../../src/smart-session/utils/TypeUtils.js';
|
|
1
|
+
import type { CreateSubscriptionRequest, CreateSubscriptionResponse, SmartSession, SmartSessionGrantPermissionsRequest, SmartSessionGrantPermissionsResponse } from '../../src/smart-session/utils/TypeUtils.js';
|
|
2
2
|
export * from '../../src/smart-session/utils/TypeUtils.js';
|
|
3
3
|
export * from '../../src/smart-session/ui/views/w3m-smart-session-created-view/index.js';
|
|
4
4
|
export * from '../../src/smart-session/ui/views/w3m-smart-session-list-view/index.js';
|
|
@@ -7,3 +7,4 @@ export declare function grantPermissions(request: SmartSessionGrantPermissionsRe
|
|
|
7
7
|
export declare function getSmartSessions(): Promise<SmartSession[]>;
|
|
8
8
|
export declare function revokeSmartSession(session: SmartSession): Promise<void>;
|
|
9
9
|
export declare function isSmartSessionSupported(): boolean;
|
|
10
|
+
export declare function createSubscription(request: CreateSubscriptionRequest): Promise<CreateSubscriptionResponse>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SmartSession, SmartSessionGrantPermissionsRequest, SmartSessionGrantPermissionsResponse } from '../utils/TypeUtils.js';
|
|
1
|
+
import type { CreateSubscriptionRequest, CreateSubscriptionResponse, SmartSession, SmartSessionGrantPermissionsRequest, SmartSessionGrantPermissionsResponse } from '../utils/TypeUtils.js';
|
|
2
2
|
import type { PermissionsCapability } from '../utils/ERC5792Types.js';
|
|
3
3
|
export type SmartSessionsControllerState = {
|
|
4
4
|
sessions: SmartSession[];
|
|
@@ -11,4 +11,5 @@ export declare const SmartSessionsController: {
|
|
|
11
11
|
validateRequestForSupportedPermissionsCapability(request: SmartSessionGrantPermissionsRequest, capabilities: PermissionsCapability): void;
|
|
12
12
|
isSmartSessionSupported(): boolean;
|
|
13
13
|
revokeSmartSession(session: SmartSession): Promise<void>;
|
|
14
|
+
createSubscription(request: CreateSubscriptionRequest): Promise<CreateSubscriptionResponse>;
|
|
14
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AddPermissionResponse, type KeyType, type SmartSessionGrantPermissionsRequest, type WalletGrantPermissionsResponse } from '../utils/TypeUtils.js';
|
|
1
|
+
import { type AddPermissionResponse, type KeyType, type SmartSessionGrantPermissionsRequest, type SubscriptionInterval, type WalletGrantPermissionsResponse } from '../utils/TypeUtils.js';
|
|
2
2
|
export declare function validateRequest(request: SmartSessionGrantPermissionsRequest): {
|
|
3
3
|
chainId: string;
|
|
4
4
|
expiry: number;
|
|
@@ -89,3 +89,4 @@ export declare function updateRequestSigner(request: SmartSessionGrantPermission
|
|
|
89
89
|
publicKey: `0x${string}`;
|
|
90
90
|
}): void;
|
|
91
91
|
export declare function assertAddPermissionResponse(response: unknown): asserts response is AddPermissionResponse;
|
|
92
|
+
export declare function getIntervalInSeconds(interval: SubscriptionInterval): number;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export type KeyType = 'secp256r1' | 'secp256k1';
|
|
2
|
+
export type SubscriptionInterval = '1s' | '1d' | '1w' | '1m';
|
|
3
|
+
type SubscriptionAsset = 'native';
|
|
4
|
+
export type CreateSubscriptionRequest = {
|
|
5
|
+
chainId: `0x${string}`;
|
|
6
|
+
signerPublicKey: `0x${string}`;
|
|
7
|
+
interval: SubscriptionInterval;
|
|
8
|
+
asset: SubscriptionAsset;
|
|
9
|
+
amount: `0x${string}`;
|
|
10
|
+
expiry: number;
|
|
11
|
+
};
|
|
12
|
+
export type CreateSubscriptionResponse = SmartSessionGrantPermissionsResponse;
|
|
2
13
|
export type MultiKeySigner = {
|
|
3
14
|
type: 'keys';
|
|
4
15
|
data: {
|
|
@@ -114,3 +125,4 @@ export type SmartSession = {
|
|
|
114
125
|
context: string;
|
|
115
126
|
revokedAt?: number;
|
|
116
127
|
};
|
|
128
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-experimental",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4-rc.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/esm/exports/index.js",
|
|
6
6
|
"types": "./dist/types/exports/index.d.ts",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"lit": "3.1.0",
|
|
32
32
|
"valtio": "1.11.2",
|
|
33
33
|
"zod": "3.22.4",
|
|
34
|
-
"@reown/appkit": "1.6.
|
|
35
|
-
"@reown/appkit-common": "1.6.
|
|
36
|
-
"@reown/appkit-core": "1.6.
|
|
37
|
-
"@reown/appkit-ui": "1.6.
|
|
34
|
+
"@reown/appkit": "1.6.4-rc.0",
|
|
35
|
+
"@reown/appkit-common": "1.6.4-rc.0",
|
|
36
|
+
"@reown/appkit-core": "1.6.4-rc.0",
|
|
37
|
+
"@reown/appkit-ui": "1.6.4-rc.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@vitest/coverage-v8": "2.1.3",
|