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
Copy file name to clipboardExpand all lines: CAIPs/caip-27.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ The application would interface with an JSON-RPC provider to make request as fol
47
47
"method":"wallet_invokeMethod",
48
48
"params": {
49
49
"sessionId":"0xdeadbeef",
50
-
"scope":"eip155:1",
50
+
"chainId":"eip155:1",
51
51
"request": {
52
52
"method":"eth_sendTransaction",
53
53
"params": [
@@ -77,16 +77,16 @@ The application would interface with an JSON-RPC provider to make request as fol
77
77
The JSON-RPC method is labeled as `wallet_invokeMethod` and expects three parameters, **two of them required**:
78
78
79
79
-**sessionId** (conditional) - [CAIP-171][]`SessionId` disambiguates an open session in a multi-session actor; it is required in some sessions, such as [CAIP-25][] sessions created by a response containing one, and SHOULD be omitted in other sessions, such as [CAIP-25] sessions created by a response not containing one (see [CAIP-316]).
80
-
-**scope** (required) - a valid [CAIP-2][] network identifier, previously authorized by or within a `scopeObject` in the active session
80
+
-**chainId** (required) - a valid [CAIP-2][] network identifier, previously authorized by or within a `scopeObject` in the active session
81
81
-**request** (required) - an object containing the fields:
82
82
-**method** (required) - the JSON-RPC method to invoke (previously authorized for the targeted network)
83
83
-**params** (required) - JSON-RPC parameters to invoke (may be empty but must be set)
84
84
-**capabilities** (optional) - an object containing metadata pertaining to a capability announced by the wallet in the [CAIP-25][] return object, to be invoked with this method
85
85
86
86
### Validation
87
87
88
-
1. A respondent SHOULD check the `scope` against active session's `scopeObject`s before executing or responding to such a request, and SHOULD invalidate a request for a scope not previously authorized.
89
-
2. The respondent SHOULD check that `request.method` is authorized for the specified scope, and SHOULD invalidate a request for a scope not previously authorized.
88
+
1. A respondent SHOULD check the `chainId` against active session's `scopeObject`s before executing or responding to such a request, and SHOULD invalidate a request for a chainId not previously authorized.
89
+
2. The respondent SHOULD check that `request.method` is authorized for the specified chainId, and SHOULD invalidate a request for a chainId not previously authorized.
90
90
3. The respondent MAY check that the `request.params` are valid for `request.method`, if its syntax is known to it.
91
91
4. The respondent MAY apply other logic or validation.
92
92
5. The respondent MAY chose to drop invalid requests or return an error message, but it MUST NOT route or submit them.
@@ -102,7 +102,7 @@ If the targeted network returns a response to the respondent, the respondent MAY
@@ -136,7 +136,7 @@ Conversely, errors specific to the method passed or its RPC namespace should be
136
136
"jsonrpc":"2.0",
137
137
"result": {
138
138
"sessionId":"0xdeadbeef",
139
-
"scope":"eip155:1",
139
+
"chainId":"eip155:1",
140
140
"error": {
141
141
"code":4100,
142
142
"message":"The requested account and/or method has not been authorized by the user."
@@ -149,7 +149,7 @@ The latter category of error depend on the design of the passed method defined w
149
149
150
150
## Backwards Compatibility
151
151
152
-
Early drafts of this specification did not constrain `scope` to [CAIP-2] identifiers, but rather to any [valid scopeStrings][CAIP-217] previously-authorized, including namespace-wide ones.
152
+
Early drafts of this specification did not constrain `chainId` to [CAIP-2] identifiers, but rather to any [valid scopeStrings][CAIP-217] previously-authorized, including namespace-wide ones.
153
153
No known implementations in production took advantage of this affordance, as to date no RPC [namespaces] have been defined that could receive such requests regardless of [CAIP-2] network identifiers.
0 commit comments