@cordystackx/cordy_minikit 0.3.8 → 0.3.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"walletConfig.d.ts","sourceRoot":"","sources":["../../config/walletConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,YAAY,EAAE,MAAM,OAAO,CAAC;AAO3C,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,OAAO,YAAY,CAUjD,CAAC"}
1
+ {"version":3,"file":"walletConfig.d.ts","sourceRoot":"","sources":["../../config/walletConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,YAAY,EAAE,MAAM,OAAO,CAAC;AAO3C,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,OAAO,YAAY,CAejD,CAAC"}
@@ -1,12 +1,17 @@
1
1
  import { http, createConfig } from 'wagmi';
2
2
  import { mainnet, base } from 'wagmi/chains';
3
- import { walletConnect } from 'wagmi/connectors';
3
+ import { walletConnect, metaMask, coinbaseWallet } from 'wagmi/connectors';
4
4
  import { BaseSepolia } from "../chains";
5
5
  const projectId = process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID;
6
6
  export const config = createConfig({
7
7
  chains: [mainnet, base, BaseSepolia()],
8
8
  connectors: [
9
- walletConnect({ projectId })
9
+ metaMask(),
10
+ walletConnect({ projectId }),
11
+ coinbaseWallet({
12
+ appName: "cordy_minikit",
13
+ version: "3"
14
+ })
10
15
  ],
11
16
  transports: {
12
17
  [mainnet.id]: http(),
@@ -32,12 +32,23 @@ export default function WalletButton({ onStatusChange }) {
32
32
  }, isPending: pendingConnector?.uid === connector.uid && isPending }, connector.uid))) }));
33
33
  }
34
34
  function WalletOption({ connector, onClick, isPending }) {
35
- const [ready, setReady] = React.useState(false);
35
+ const [ready, setReady] = React.useState(true); // ✅ default to true so it still renders
36
+ const [installed, setInstalled] = React.useState(true);
36
37
  React.useEffect(() => {
37
38
  (async () => {
38
- const provider = await connector.getProvider();
39
- setReady(!!provider);
39
+ try {
40
+ const provider = await connector.getProvider();
41
+ setInstalled(!!provider); // true if wallet found
42
+ }
43
+ catch {
44
+ setInstalled(false);
45
+ }
40
46
  })();
41
47
  }, [connector]);
42
- return (_jsx("button", { disabled: !ready || isPending, onClick: onClick, children: isPending ? "Connecting..." : connector.name }));
48
+ const disabled = isPending || !installed;
49
+ return (_jsx("button", { disabled: disabled, onClick: onClick, children: isPending
50
+ ? "Connecting..."
51
+ : !installed
52
+ ? `${connector.name} (Not Installed)`
53
+ : connector.name }));
43
54
  }