@portal-hq/webview 2.1.0 → 2.1.2
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/lib/commonjs/index.js +7 -0
- package/lib/esm/index.js +7 -0
- package/package.json +5 -5
- package/src/index.tsx +9 -0
package/lib/commonjs/index.js
CHANGED
|
@@ -106,6 +106,13 @@ const Webview = (0, react_1.memo)((0, react_1.forwardRef)(({ onNavigationStateCh
|
|
|
106
106
|
data,
|
|
107
107
|
}));
|
|
108
108
|
});
|
|
109
|
+
portal.on('chainChanged', ({ chainId }) => {
|
|
110
|
+
var _a;
|
|
111
|
+
(_a = webView.current) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify({
|
|
112
|
+
type: 'portal_chainChanged',
|
|
113
|
+
data: { chainId },
|
|
114
|
+
}));
|
|
115
|
+
});
|
|
109
116
|
// Bind to signing requests
|
|
110
117
|
if (onSigningRequested) {
|
|
111
118
|
portal.on('portal_signingRequested', onSigningRequested);
|
package/lib/esm/index.js
CHANGED
|
@@ -78,6 +78,13 @@ const Webview = memo(forwardRef(({ onNavigationStateChange, onSigningRequested,
|
|
|
78
78
|
data,
|
|
79
79
|
}));
|
|
80
80
|
});
|
|
81
|
+
portal.on('chainChanged', ({ chainId }) => {
|
|
82
|
+
var _a;
|
|
83
|
+
(_a = webView.current) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify({
|
|
84
|
+
type: 'portal_chainChanged',
|
|
85
|
+
data: { chainId },
|
|
86
|
+
}));
|
|
87
|
+
});
|
|
81
88
|
// Bind to signing requests
|
|
82
89
|
if (onSigningRequested) {
|
|
83
90
|
portal.on('portal_signingRequested', onSigningRequested);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portal-hq/webview",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/esm/index",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"test": "jest --passWithNoTests"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@portal-hq/core": "^2.1.
|
|
22
|
-
"@portal-hq/injected-provider": "^2.1.
|
|
23
|
-
"@portal-hq/utils": "^2.1.
|
|
21
|
+
"@portal-hq/core": "^2.1.2",
|
|
22
|
+
"@portal-hq/injected-provider": "^2.1.2",
|
|
23
|
+
"@portal-hq/utils": "^2.1.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/jest": "^29.2.0",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"react-native": "*",
|
|
37
37
|
"react-native-webview": "*"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "17a0445191c1399577154042e09fa8759edf194f"
|
|
40
40
|
}
|
package/src/index.tsx
CHANGED
|
@@ -111,6 +111,15 @@ const Webview = memo(
|
|
|
111
111
|
)
|
|
112
112
|
})
|
|
113
113
|
|
|
114
|
+
portal.on('chainChanged', ({ chainId }: { chainId: number }) => {
|
|
115
|
+
webView.current?.postMessage(
|
|
116
|
+
JSON.stringify({
|
|
117
|
+
type: 'portal_chainChanged',
|
|
118
|
+
data: { chainId },
|
|
119
|
+
}),
|
|
120
|
+
)
|
|
121
|
+
})
|
|
122
|
+
|
|
114
123
|
// Bind to signing requests
|
|
115
124
|
if (onSigningRequested) {
|
|
116
125
|
portal.on('portal_signingRequested', onSigningRequested)
|