wallet-connect-button-react 1.1.4 → 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 +2 -3
- 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
|
@@ -10,9 +10,8 @@ export interface WalletConnectButtonProps {
|
|
|
10
10
|
apiKey?: string;
|
|
11
11
|
walletConnectHost?: string;
|
|
12
12
|
lang?: string;
|
|
13
|
-
sameDeviceUl?: string;
|
|
14
|
-
crossDeviceUl?: string;
|
|
15
13
|
helpBaseUrl?: string;
|
|
14
|
+
issuance?: boolean;
|
|
16
15
|
}
|
|
17
16
|
declare global {
|
|
18
17
|
namespace JSX {
|
|
@@ -30,5 +29,5 @@ declare global {
|
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
declare function WalletConnectButton({ label, clientId, onSuccess, apiKey, walletConnectHost, lang,
|
|
32
|
+
declare function WalletConnectButton({ label, clientId, onSuccess, apiKey, walletConnectHost, lang, helpBaseUrl, issuance }: WalletConnectButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
34
33
|
export default WalletConnectButton;
|
package/dist/index.esm.js
CHANGED
|
@@ -526,13 +526,21 @@ function useSearchParams() {
|
|
|
526
526
|
return [searchParams, setSearchParams, removeSearchParam];
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
+
function constructURI(clientId, session_type) {
|
|
530
|
+
var request_uri = "https://issuance.wallet-connect.eu/disclosure/".concat(clientId, "/request_uri?session_type=").concat(session_type);
|
|
531
|
+
var request_uri_method = "post";
|
|
532
|
+
var client_id_uri = "".concat(clientId, ".example.com");
|
|
533
|
+
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);
|
|
534
|
+
}
|
|
529
535
|
function WalletConnectButton(_a) {
|
|
530
536
|
var _this = this;
|
|
531
|
-
var label = _a.label, clientId = _a.clientId, onSuccess = _a.onSuccess, apiKey = _a.apiKey, walletConnectHost = _a.walletConnectHost, lang = _a.lang,
|
|
537
|
+
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;
|
|
532
538
|
var _b = useSearchParams(), searchParams = _b[0], setSearchParams = _b[1], removeSearchParam = _b[2];
|
|
533
539
|
var _c = useState(false), loading = _c[0], setLoading = _c[1];
|
|
534
540
|
var _d = useState(null), error = _d[0], setError = _d[1];
|
|
535
541
|
var buttonRef = useRef(null);
|
|
542
|
+
var sameDeviceUl = constructURI(clientId, "same_device");
|
|
543
|
+
var crossDeviceUl = constructURI(clientId, "cross_device");
|
|
536
544
|
useEffect(function () {
|
|
537
545
|
// Dynamically import the web component
|
|
538
546
|
var loadWebComponent = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -626,7 +634,7 @@ function WalletConnectButton(_a) {
|
|
|
626
634
|
if (error) {
|
|
627
635
|
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] })] }) }));
|
|
628
636
|
}
|
|
629
|
-
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", "same-device-ul": sameDeviceUl, "cross-device-ul": crossDeviceUl, "help-base-url": helpBaseUrl }));
|
|
637
|
+
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 }));
|
|
630
638
|
}
|
|
631
639
|
|
|
632
640
|
var nlWalletWeb$1 = {};
|