@hashgraph/hedera-wallet-connect 1.2.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 +113 -112
- package/dist/node-esm-metafile.json +1 -1
- package/dist/node-esm.js +113 -112
- package/dist/types/src/lib/dapp/DAppSigner.d.ts +8 -0
- package/dist/types/src/lib/dapp/DAppSigner.d.ts.map +1 -1
- 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/dist/types/src/lib/shared/utils.d.ts.map +1 -1
- package/package.json +2 -2
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
|