wallet-connect-button-react 1.1.1 → 1.1.3

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.
@@ -4,7 +4,7 @@ interface AttributeData {
4
4
  [key: string]: any;
5
5
  }
6
6
  export interface WalletConnectButtonProps {
7
- children?: React.ReactNode;
7
+ label?: string;
8
8
  clientId: string;
9
9
  onSuccess: (attributes: AttributeData | undefined) => void;
10
10
  apiKey?: string;
@@ -24,5 +24,5 @@ declare global {
24
24
  }
25
25
  }
26
26
  }
27
- declare function WalletConnectButton({ children, clientId, onSuccess, apiKey, walletConnectHost, lang }: WalletConnectButtonProps): import("react/jsx-runtime").JSX.Element;
27
+ declare function WalletConnectButton({ label, clientId, onSuccess, apiKey, walletConnectHost, lang }: WalletConnectButtonProps): import("react/jsx-runtime").JSX.Element;
28
28
  export default WalletConnectButton;
package/dist/index.esm.js CHANGED
@@ -528,7 +528,7 @@ function useSearchParams() {
528
528
 
529
529
  function WalletConnectButton(_a) {
530
530
  var _this = this;
531
- var children = _a.children, clientId = _a.clientId, onSuccess = _a.onSuccess, apiKey = _a.apiKey, walletConnectHost = _a.walletConnectHost, lang = _a.lang;
531
+ var label = _a.label, clientId = _a.clientId, onSuccess = _a.onSuccess, apiKey = _a.apiKey, walletConnectHost = _a.walletConnectHost, lang = _a.lang;
532
532
  var _b = useSearchParams(), searchParams = _b[0], setSearchParams = _b[1], removeSearchParam = _b[2];
533
533
  var _c = useState(false), loading = _c[0], setLoading = _c[1];
534
534
  var _d = useState(null), error = _d[0], setError = _d[1];
@@ -604,8 +604,10 @@ function WalletConnectButton(_a) {
604
604
  console.log("Disclosed attributes:", data);
605
605
  // Extract age_over_18 from nested response structure
606
606
  onSuccess(data);
607
- // Remove session_token from URL after successful retrieval
607
+ // Remove session_token and nonce from URL after successful retrieval
608
608
  removeSearchParam('session_token');
609
+ if (nonce)
610
+ removeSearchParam('nonce');
609
611
  setLoading(false);
610
612
  })
611
613
  .catch(function (error) {
@@ -624,7 +626,7 @@ function WalletConnectButton(_a) {
624
626
  if (error) {
625
627
  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] })] }) }));
626
628
  }
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" }));
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" }));
628
630
  }
629
631
 
630
632
  var nlWalletWeb$1 = {};