You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -49,7 +49,7 @@ Callers may revoke sessions using `wallet_revokeSession`, passing the `sessionId
49
49
50
50
Authorization requests are expressed as a top-level object `scopes` containing keyed [scopeObjects][CAIP-217].
51
51
52
-
Each `scopeObject` is keyed by a [CAIP-2][]chain ID. A null reference can be used to refer to a scope that applies to ANY chain within that namespace (eg. `eip155:0`)
52
+
Each `scopeObject` is keyed by a [CAIP-2][]or [CAIP-104][] identifiers. A null reference can be used to refer to a scope that applies to ANY chain within that namespace (eg. `eip155:0`)
53
53
54
54
Wallets MAY authorize a subset of scopes or scope properties as requested, and MAY also authorize additional scopes or scope properties. This enables granular control and flexibility on the part of the respondent.
55
55
@@ -61,61 +61,176 @@ If a connection is rejected, the wallet MAY respond with a generic error or sile
61
61
62
62
#### Request
63
63
64
+
```typescript
65
+
interfaceCAIP25JsonRpcRequest {
66
+
id:number;
67
+
jsonrpc:"2.0";
68
+
method:"wallet_createSession";
69
+
params: {
70
+
scopes: {
71
+
[scopeKey:string]: {
72
+
chains?:string[];
73
+
accounts?:string[];
74
+
methods:string[];
75
+
notifications:string[];
76
+
};
77
+
};
78
+
properties?: {
79
+
[propertyKey:string]:any;
80
+
};
81
+
};
82
+
}
83
+
```
84
+
85
+
The `scopes` object MUST contain one or more scopeObjects.
86
+
87
+
The `properties` object MAY be included for global session metadata.
88
+
89
+
### Response
90
+
91
+
#### Success
92
+
93
+
```typescript
94
+
interfaceCAIP25JsonRpcResponse {
95
+
id:number;
96
+
jsonrpc:"2.0";
97
+
result: {
98
+
scopes: {
99
+
[scopeKey:string]: {
100
+
chains?:string[];
101
+
accounts:string[];
102
+
methods:string[];
103
+
notifications:string[];
104
+
capabilities?: {
105
+
[capabilityKey:string]:any;
106
+
};
107
+
};
108
+
};
109
+
properties?: {
110
+
[propertyKey:string]:any;
111
+
};
112
+
};
113
+
}
114
+
```
115
+
116
+
Each entry within `scopes` object MAY contain `accounts` and `capabilities` as part of its object for success response.
117
+
118
+
#### Error Codes
119
+
120
+
The wallet MAY return generic or specific error messages depending on trust. Trusted responses may include codes like:
121
+
122
+
-`5000`: Unknown error
123
+
-`5001`: User disapproved requested methods
124
+
-`5002`: User disapproved requested notifications
125
+
-`5100-5102`: Unsupported chains, methods, or notifications
126
+
-`5201-5302`: Malformed requests
127
+
128
+
## Examples
129
+
130
+
**Example 1**
131
+
132
+
For request, we define a very simple scope for 10 EVM chains with the exact same scope.
@@ -125,70 +240,65 @@ If a connection is rejected, the wallet MAY respond with a generic error or sile
125
240
}
126
241
```
127
242
128
-
The `scopes` object MUST contain one or more scopeObjects.
243
+
For the response, we match the same scopes as the request but separate 2 out of 5 EVM chains into individual scopes because of non-overlapping accounts, capabilities or methods.
129
244
130
-
The `properties` object MAY be included for global session metadata.
131
-
132
-
### Response
245
+
Additionaly we have the two Solana chains returning the same scopes but returning two different account addresses for each chain including a unique capability for one of the chains
133
246
134
-
#### Success
247
+
Finally the wallet has provided within properties with its walletInfo per [CAIP-372][].
@@ -239,18 +347,6 @@ The `properties` object MAY be included for global session metadata.
239
347
}
240
348
```
241
349
242
-
Each entry within `scopes` object MAY contain `accounts` and `capabilities` as part of its object for success response.
243
-
244
-
#### Error Codes
245
-
246
-
The wallet MAY return generic or specific error messages depending on trust. Trusted responses may include codes like:
247
-
248
-
-`5000`: Unknown error
249
-
-`5001`: User disapproved requested methods
250
-
-`5002`: User disapproved requested notifications
251
-
-`5100-5102`: Unsupported chains, methods, or notifications
252
-
-`5201-5302`: Malformed requests
253
-
254
350
## Security Considerations
255
351
256
352
To avoid ambiguity in authorizations, `scopes` MUST retain their original keyed structure using [CAIP-2][] or [CAIP-104][] identifiers. This ensures clarity in what is authorized and prevents accidental scope merging or misinterpretation.
@@ -283,6 +379,7 @@ To mitigate fingerprinting risks, wallets should prefer uniform or silent failur
0 commit comments