> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moongate.one/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Complete reference for all Moongate Adapter hooks, components, and configuration options.

## Hooks

### useWallet()

The primary hook for accessing wallet state and methods.

```tsx theme={null}
import { useWallet } from '@moongate/sdk';

const { connected, publicKey, disconnect, connecting } = useWallet();
```

#### Returns

<ResponseField name="connected" type="boolean">
  Whether a wallet is currently connected
</ResponseField>

<ResponseField name="publicKey" type="PublicKey | null">
  The connected wallet's public key, or null if not connected
</ResponseField>

<ResponseField name="disconnect" type="() => void">
  Function to disconnect the current wallet
</ResponseField>

<ResponseField name="connecting" type="boolean">
  Whether a wallet connection is currently in progress
</ResponseField>

<ResponseField name="wallet" type="Wallet | null">
  The currently connected wallet adapter instance
</ResponseField>

#### Example Usage

```tsx theme={null}
function WalletStatus() {
  const { connected, publicKey, disconnect, connecting } = useWallet();

  if (connecting) return <div>Connecting...</div>;
  
  if (connected) {
    return (
      <div>
        <p>Connected: {publicKey?.toString().slice(0, 8)}...</p>
        <button onClick={disconnect}>Disconnect</button>
      </div>
    );
  }

  return <div>Not connected</div>;
}
```

### useConnection()

Hook for accessing the Solana connection instance.

```tsx theme={null}
import { useConnection } from '@moongate/sdk';

const { connection } = useConnection();
```

#### Returns

<ResponseField name="connection" type="Connection">
  The Solana connection instance for making RPC calls
</ResponseField>

### useWalletModal()

Hook for controlling the wallet selection modal.

```tsx theme={null}
import { useWalletModal } from '@moongate/sdk';

const { visible, setVisible } = useWalletModal();
```

#### Returns

<ResponseField name="visible" type="boolean">
  Whether the wallet modal is currently visible
</ResponseField>

<ResponseField name="setVisible" type="(visible: boolean) => void">
  Function to show or hide the wallet modal
</ResponseField>

#### Example Usage

```tsx theme={null}
function CustomConnectButton() {
  const { connected } = useWallet();
  const { setVisible } = useWalletModal();

  if (connected) return null;

  return (
    <button onClick={() => setVisible(true)}>
      Choose Wallet
    </button>
  );
}
```

## Components

### MoongateConnectButton

The main connect button component (recommended for most use cases).

```tsx theme={null}
import { MoongateConnectButton } from '@moongate/sdk';

<MoongateConnectButton />
```

#### Props

<ResponseField name="children" type="ReactNode" default="Connect Wallet">
  Custom button text or content
</ResponseField>

<ResponseField name="className" type="string">
  Additional CSS classes to apply
</ResponseField>

<ResponseField name="style" type="CSSProperties">
  Inline styles to apply
</ResponseField>

#### Example Usage

```tsx theme={null}
// Basic usage
<MoongateConnectButton />

// With custom text
<MoongateConnectButton>
  Connect to Solana
</MoongateConnectButton>

// With custom styling
<MoongateConnectButton 
  className="my-custom-button"
  style={{ backgroundColor: '#purple' }}
>
  Connect Wallet
</MoongateConnectButton>
```

### WalletConnectButton

Individual wallet connect button for specific wallets.

```tsx theme={null}
import { WalletConnectButton } from '@moongate/sdk';

<WalletConnectButton walletName="Phantom" />
```

#### Props

<ResponseField name="walletName" type="string" required>
  Name of the specific wallet to connect to
</ResponseField>

<ResponseField name="children" type="ReactNode">
  Custom button content
</ResponseField>

#### Example Usage

```tsx theme={null}
// Connect to specific wallet
<WalletConnectButton walletName="Phantom"/>

<WalletConnectButton walletName="Solflare"/>

```

## 📱 Mobile Considerations

The Adapter is fully responsive and mobile-optimized:

* Touch-friendly wallet selection
* Mobile wallet deep linking
* Responsive modal sizing
* iOS/Android wallet app integration

## 🆘 Need Help?

* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
