wallet-connect-button-react 1.1.3 → 1.1.5
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/dist/WalletConnectButton.d.ts +6 -1
- package/dist/index.esm.js +10 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -530,13 +530,21 @@ function useSearchParams() {
|
|
|
530
530
|
return [searchParams, setSearchParams, removeSearchParam];
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
+
function constructURI(clientId, session_type) {
|
|
534
|
+
var request_uri = "https://issuance.wallet-connect.eu/disclosure/".concat(clientId, "/request_uri?session_type=").concat(session_type);
|
|
535
|
+
var request_uri_method = "post";
|
|
536
|
+
var client_id_uri = "".concat(clientId, ".example.com");
|
|
537
|
+
return "walletdebuginteraction://wallet.edi.rijksoverheid.nl/disclosure_based_issuance?request_uri=".concat(encodeURIComponent(request_uri), "&request_uri_method=").concat(request_uri_method, "&client_id=").concat(client_id_uri);
|
|
538
|
+
}
|
|
533
539
|
function WalletConnectButton(_a) {
|
|
534
540
|
var _this = this;
|
|
535
|
-
var label = _a.label, clientId = _a.clientId, onSuccess = _a.onSuccess, apiKey = _a.apiKey, walletConnectHost = _a.walletConnectHost, lang = _a.lang;
|
|
541
|
+
var label = _a.label, clientId = _a.clientId, onSuccess = _a.onSuccess, apiKey = _a.apiKey, walletConnectHost = _a.walletConnectHost, lang = _a.lang, helpBaseUrl = _a.helpBaseUrl, issuance = _a.issuance;
|
|
536
542
|
var _b = useSearchParams(), searchParams = _b[0], setSearchParams = _b[1], removeSearchParam = _b[2];
|
|
537
543
|
var _c = require$$0.useState(false), loading = _c[0], setLoading = _c[1];
|
|
538
544
|
var _d = require$$0.useState(null), error = _d[0], setError = _d[1];
|
|
539
545
|
var buttonRef = require$$0.useRef(null);
|
|
546
|
+
var sameDeviceUl = constructURI(clientId, "same_device");
|
|
547
|
+
var crossDeviceUl = constructURI(clientId, "cross_device");
|
|
540
548
|
require$$0.useEffect(function () {
|
|
541
549
|
// Dynamically import the web component
|
|
542
550
|
var loadWebComponent = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -630,7 +638,7 @@ function WalletConnectButton(_a) {
|
|
|
630
638
|
if (error) {
|
|
631
639
|
return (jsxRuntimeExports.jsx("div", { className: "attributes", children: jsxRuntimeExports.jsxs("div", { className: "verification-card", children: [jsxRuntimeExports.jsx("h2", { children: "Error" }), jsxRuntimeExports.jsxs("p", { children: ["An error occurred while verifying your attributes: ", error] })] }) }));
|
|
632
640
|
}
|
|
633
|
-
return (jsxRuntimeExports.jsx("nl-wallet-button", { ref: buttonRef, text: label, usecase: clientId, "start-url": "".concat(walletConnectHost || "https://wallet-connect.eu", "/api/create-session?lang=en&return_url=").concat(encodeURIComponent(window.location.href)), lang: lang || "nl" }));
|
|
641
|
+
return (jsxRuntimeExports.jsx("nl-wallet-button", { ref: buttonRef, text: label, usecase: issuance ? "" : clientId, "start-url": "".concat(walletConnectHost || "https://wallet-connect.eu", "/api/create-session?lang=en&return_url=").concat(encodeURIComponent(window.location.href)), lang: lang || "nl", "same-device-ul": sameDeviceUl, "cross-device-ul": crossDeviceUl, "help-base-url": helpBaseUrl }));
|
|
634
642
|
}
|
|
635
643
|
|
|
636
644
|
var nlWalletWeb$1 = {};
|