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
@@ -68,7 +69,7 @@ Whenever a new Wallet Provider is discovered the Blockchain Library would index
68
69
69
70
The parameters `name` and `icon` are used to display to the user to be easily recognizable while the `rdns` and `uuid` are only used internally for de-duping while they must always be unique, the `rdns` will always be the same but `uuid` is ephemeral per browser session.
70
71
71
-
The only optional parameter is`scopes` which is defined by CAIP-217 authorization specs that enables early discoverability and filtering of wallets based on RPC methods, notifications, documents and endpoints but also optional discovery of supported chains and even accounts.
72
+
The optional parameters are`scopes`, which is defined by [CAIP-217] authorization specs that enables early discoverability and filtering of wallets based on RPC methods, notifications, documents and endpoints but also optional discovery of supported chains and even accounts, and `targets`, which accepts [CAIP-341] Extension ID as a valid target type for establishing connections with browser extension wallets via the [CAIP-294]`wallet_announce` wallet discovery event.
Copy file name to clipboardExpand all lines: CAIPs/caip-294.md
+29-14Lines changed: 29 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,7 +138,7 @@ The `walletData` object MUST include the following properties:
138
138
139
139
Additionally, the `walletData` object MAY include the following optional properties:
140
140
141
-
-`extensionId`: The canonical extension ID of the wallet provider for the active browser.
141
+
-`targets`: An array of objects, with an object containing `type: "caip341"` and `value: <extension_id>` used to connect to wallets using `externally_connectable`. Important to note here that other CAIPs can extend this, and [CAIP-341][caip-341] is an example of a valid target type for this use case.
142
142
-`scopes`: An object defining the authorization scopes supported by the wallet, as specified in CAIP-217.
This `walletData` type is is a superset of `WalletAnnounceRequestParams` type described in the [CAIP-282][caip-282] standard, adding the optional `extensionId` property as it is only relevant for browser extension based wallets.
190
+
This `walletData` type is a superset of `WalletAnnounceRequestParams` type described in the [CAIP-282][caip-282] standard, adding the optional `targets` property with the object defining `extensionId`, as it is only relevant for browser extension based wallets.
180
191
181
-
### ExtensionId
192
+
### Targets
182
193
183
-
When the `extensionId`is included in the `walletData` object, it indicates that the wallet supports communication via the browser's `externally_connectable` API. In this case:
194
+
When a `targets` property with the array containing an object with [`type: 'caip341'`][caip-341]is included in the `walletData` object, it indicates that the wallet expects communication via the browser's [`externally_connectable` API][externally_connectable]. In this case:
184
195
185
-
1. The dapp MUST use the `extensionId` to establish a connection with the wallet using the `externally_connectable` browser API.
196
+
1. The dapp MUST use the `targets.find(({ type }) => type === "caip314").value` (an [`extensionId`][externally_connectable]) to establish a connection with the wallet using the `externally_connectable` browser API.
186
197
2. All subsequent communication with the wallet (the "session") SHOULD be conducted over the `externally_connectable` API using `runtime.connect()` and `runtime.sendMessage()`.
187
-
3. The dapp MUST NOT use the injected provider for communication when `extensionId` is present.
198
+
3. The dapp MUST NOT use the injected provider for communication when `targets` with [CAIP-341](https://github.com/ChainAgnostic/CAIPs/blob/656551f800843b92243fb08ca6c24e805ad149a3/CAIPs/caip-341.md) type is present.
188
199
189
200
Example of establishing a connection and sending a message:
If the `extensionId` is not present in the `walletData` object, the dapp SHOULD assume that communication will occur through the traditional injected provider method.
219
+
If the `targets` object with [CAIP-341](https://github.com/ChainAgnostic/CAIPs/blob/656551f800843b92243fb08ca6c24e805ad149a3/CAIPs/caip-341.md) type is not present in the `walletData` object, the dapp SHOULD assume that communication will occur through the traditional injected provider method.
Copy file name to clipboardExpand all lines: CAIPs/caip-295.md
+18-8Lines changed: 18 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,10 @@ This provides the foundation for any Wallet Provider to interface with a Decentr
47
47
48
48
Different loading times can be affected by multiple factors, which makes it non-deterministic to publish and listen to messages from different sources within the browser.
49
49
50
+
#### Target Origin
51
+
52
+
TODO Make Proposal For Target Origin As Valid Target Type For Wallet Data.
53
+
50
54
#### Discovery
51
55
52
56
Both Wallet Providers and blockchain libraries must listen to incoming messages that might be published after their initialization. Additionally both Wallet Providers and blockchain libraries must publish a message to both announce themselves and their intent to connect, respectively.
@@ -56,7 +60,10 @@ Here is the expected logic from the Blockchain Library:
0 commit comments