wallet-connect-button-react 1.0.3 → 1.0.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/index.js CHANGED
@@ -530,9 +530,9 @@ function useSearchParams() {
530
530
  return [searchParams, setSearchParams, removeSearchParam];
531
531
  }
532
532
 
533
- function NLWalletButton(_a) {
533
+ function WalletConnectButton(_a) {
534
534
  var _this = this;
535
- var children = _a.children, clientId = _a.clientId, onSuccess = _a.onSuccess, apiKey = _a.apiKey, walletConnectHost = _a.walletConnectHost;
535
+ var children = _a.children, clientId = _a.clientId, onSuccess = _a.onSuccess, apiKey = _a.apiKey, walletConnectHost = _a.walletConnectHost, lang = _a.lang;
536
536
  var _b = useSearchParams(), searchParams = _b[0], setSearchParams = _b[1], removeSearchParam = _b[2];
537
537
  var _c = require$$0.useState(false), loading = _c[0], setLoading = _c[1];
538
538
  var _d = require$$0.useState(null), error = _d[0], setError = _d[1];
@@ -596,29 +596,10 @@ function NLWalletButton(_a) {
596
596
  if (!session_token)
597
597
  return;
598
598
  setLoading(true);
599
- var baseUrl = walletConnectHost || "https://wallet-connect.eu";
600
- var url = baseUrl + "/disclosed-attributes?session_token=".concat(session_token, "&client_id=").concat(clientId);
599
+ var baseUrl = apiKey ? (walletConnectHost || "https://wallet-connect.eu") : "";
600
+ var url = baseUrl + "/api/disclosed-attributes?session_token=".concat(session_token, "&client_id=").concat(clientId);
601
601
  if (nonce)
602
602
  url = "".concat(url, "&nonce=").concat(nonce);
603
- // Example response structure
604
- // {
605
- // "attributes": {
606
- // "urn:eudi:pid:nl:1": {
607
- // "attributes": {
608
- // "urn:eudi:pid:nl:1": {
609
- // "age_over_18": true
610
- // }
611
- // },
612
- // "issuerUri": "https://cert.issuer.example.com/",
613
- // "ca": "ca.issuer.example.com",
614
- // "validityInfo": {
615
- // "signed": "2025-07-22T12:08:12Z",
616
- // "validFrom": "2025-07-22T00:00:00Z",
617
- // "validUntil": "2026-07-22T00:00:00Z"
618
- // }
619
- // }
620
- // }
621
- // }
622
603
  var headers = apiKey ? { 'Authorization': "Bearer ".concat(apiKey) } : {};
623
604
  axios
624
605
  .get(url, { headers: headers })
@@ -643,7 +624,7 @@ function NLWalletButton(_a) {
643
624
  if (error) {
644
625
  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] })] }) }));
645
626
  }
646
- return (jsxRuntimeExports.jsx("nl-wallet-button", { ref: buttonRef, text: children, usecase: clientId, "start-url": "".concat(walletConnectHost || "https://wallet-connect.eu", "/create-session?lang=en&return_url=").concat(encodeURIComponent(window.location.href)), lang: "nl" }));
627
+ return (jsxRuntimeExports.jsx("nl-wallet-button", { ref: buttonRef, text: children, 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" }));
647
628
  }
648
629
 
649
630
  var nlWalletWeb$1 = {};
@@ -7722,6 +7703,6 @@ var nlWalletWeb = /*#__PURE__*/_mergeNamespaces({
7722
7703
  default: nlWalletWeb$1
7723
7704
  }, [nlWalletWeb$1]);
7724
7705
 
7725
- exports.NLWalletButton = NLWalletButton;
7726
- exports.default = NLWalletButton;
7706
+ exports.WalletConnectButton = WalletConnectButton;
7707
+ exports.default = WalletConnectButton;
7727
7708
  //# sourceMappingURL=index.js.map