@hashgraph/hedera-wallet-connect 1.2.0 → 1.3.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/README.md +21 -0
- package/dist/browser-cjs-metafile.json +1 -1
- package/dist/browser-cjs.js +1 -1
- package/dist/browser-esm-metafile.json +1 -1
- package/dist/browser-esm.js +1 -1
- package/dist/node-cjs-metafile.json +1 -1
- package/dist/node-cjs.js +112 -111
- package/dist/node-esm-metafile.json +1 -1
- package/dist/node-esm.js +112 -111
- package/dist/types/src/lib/dapp/index.d.ts +6 -1
- package/dist/types/src/lib/dapp/index.d.ts.map +1 -1
- package/dist/types/src/lib/shared/extensionController.d.ts +7 -3
- package/dist/types/src/lib/shared/extensionController.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -248,6 +248,27 @@ This communication protocol between the wallet and web dApps requires an interme
|
|
|
248
248
|
use the Chrome API. Refer to the
|
|
249
249
|
[Chrome Extensions documentation](https://developer.chrome.com/docs/extensions/develop/concepts/messaging)
|
|
250
250
|
|
|
251
|
+
To enable communication between the extension and a web dApp embedded in an iframe, the wallet
|
|
252
|
+
must support the following messages:
|
|
253
|
+
|
|
254
|
+
- `"hedera-iframe-query"`:The extension is required to respond with `"hedera-iframe-response"`
|
|
255
|
+
and provide the next set of data in the metadata property.
|
|
256
|
+
```javascript
|
|
257
|
+
let metadata = {
|
|
258
|
+
id: '<Wallet extension id>',
|
|
259
|
+
name: '<Wallet name>',
|
|
260
|
+
url: '<Wallet url>',
|
|
261
|
+
icon: '<Wallet icon>',
|
|
262
|
+
description: '<Wallet description>',
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
- `"hedera-iframe-connect"`: The extension must listen to this message and utilize the
|
|
266
|
+
`pairingString` property in order to establish a connection.
|
|
267
|
+
|
|
268
|
+
The dAppConnector is designed to automatically initiate pairing without any need for user
|
|
269
|
+
action, in case no sessions are noticed and an iframe extension is detected. To capture this
|
|
270
|
+
event and the newly established session, you can utilize the `onSessionIframeCreated` function.
|
|
271
|
+
|
|
251
272
|
## Demo & docs
|
|
252
273
|
|
|
253
274
|
This repository includes a vanilla html/css/javascript implementation with a dApp and wallet
|