open-index/open-npm huggingface dataset:
npm package: @hermis/solana-headless-adapter-base
Description: The framework agnostic implementation of the Hermis headless solana wallet adapetr
Author: Mctursh
Latest version: 2.0.0

# @hermis/solana-headless-adapter-base

[![npm version](https://img.shields.io/npm/v/@hermis/solana-headless-adapter-base.svg)](https://www.npmjs.com/package/@hermis/solana-headless-adapter-base)

Framework-agnostic wallet adapter implementation for Solana. Use with vanilla JavaScript or any UI framework.

## Installation

```bash
npm install @hermis/solana-headless-adapter-base
```

## Quick Start

```javascript
import {
  WalletAdapterManager,
  getStandardWalletAdapters,
  sortWalletAdapters
} from '@hermis/solana-headless-adapter-base';

// Get all standard wallet adapters (auto-detects Wallet Standard compatible wallets)
const adapters = getStandardWalletAdapters([]);
const sorted = sortWalletAdapters(adapters);

// Create wallet manager
const walletManager = new WalletAdapterManager(adapters);

// Subscribe to wallet events
walletManager.on('connect', (publicKey) => {
  console.log('Connected to wallet:', publicKey.toBase58());
});

walletManager.on('disconnect', () => {
  console.log('Wallet disconnected');
});

// Select and connect to a wallet
const phantomAdapter = adapters.find(adapter => adapter.name === 'Phantom');
if (phantomAdapter) {
  walletManager.selectAdapter(phantomAdapter.name);

  try {
    const adapter = await walletManager.connect();
    console.log('Successfully connected to', adapter.name);
  } catch (error) {
    console.error('Connection error:', error);
  }
}
```

## Documentation

For complete documentation, visit [docs.hermis.io/quickstart/adapter-base](https://docs.hermis.io/quickstart/adapter-base)

## API Reference

- [WalletAdapterManager](https://docs.hermis.io/api-reference/adapter-base/wallet-manager)
- [Utility Functions](https://docs.hermis.io/api-reference/adapter-base/utilities)

## License

Apache 2.0
npm package: @hermis/solana-headless-react
Description: React hooks and components for Hermis Solana Headless SDK
Author: Mctursh
Latest version: 2.0.0

# @hermis/solana-headless-react

[![npm version](https://img.shields.io/npm/v/@hermis/solana-headless-react.svg)](https://www.npmjs.com/package/@hermis/solana-headless-react)

React hooks and components for Solana wallet integration. UI-agnostic design lets you build custom wallet experiences.

## Installation

```bash
npm install @hermis/solana-headless-react
```

## Setup

Wrap your app with `HermisProvider`:

```tsx
import { HermisProvider } from '@hermis/solana-headless-react';
import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';

function App() {
  return (
    <HermisProvider
      endpoint="https://devnet.solana.com"
      network={WalletAdapterNetwork.Devnet}
      autoConnect={true}
      wallets={[]}
      onError={(error) => console.error('Wallet error:', error)}
    >
      <YourApp />
    </HermisProvider>
  );
}
```

## Core Hooks

### useWallet

```tsx
import { useWallet } from '@hermis/solana-headless-react';

function WalletButton() {
  const { wallet, publicKey, connected, connect, disconnect, select } = useWallet();

  return (
    <div>
      {!connected ? (
        <button onClick={() => { select('Phantom'); connect(); }}>
          Connect Wallet
        </button>
      ) : (
        <div>
          <p>Wallet: {wallet?.adapter.name}</p>
          <p>Address: {publicKey?.toBase58()}</p>
          <button onClick={disconnect}>Disconnect</button>
        </div>
      )}
    </div>
  );
}
```

### useSolanaBalance

```tsx
import { useWallet, useSolanaBalance } from '@hermis/solana-headless-react';

function BalanceDisplay() {
  const { publicKey } = useWallet();
  const { balance, loading } = useSolanaBalance(publicKey);

  if (!publicKey) return <p>Connect your wallet</p>;
  if (loading) return <p>Loading balance...</p>;

  return <p>Balance: {balance} SOL</p>;
}
```

### useWallets

```tsx
import { useWallets } from '@hermis/solana-headless-react';

function WalletSelector() {
  const { wallets, select } = useWallets();

  return (
    <div>
      {wallets.map((wallet) => (
        <button key={wallet.adapter.name} onClick={() => select(wallet.adapter.name)}>
          {wallet.adapter.name}
        </button>
      ))}
    </div>
  );
}
```

### useConnection

```tsx
import { useConnection } from '@hermis/solana-headless-react';

function NetworkInfo() {
  const { connection } = useConnection();

  // Use connection for RPC calls
  const getLatestBlockhash = async () => {
    const { blockhash } = await connection.getLatestBlockhash();
    console.log('Latest blockhash:', blockhash);
  };

  return <button onClick={getLatestBlockhash}>Get Blockhash</button>;
}
```

## Documentation

For complete documentation, examples, and API reference, visit [docs.hermis.io/quickstart/react](https://docs.hermis.io/quickstart/react)

## License

Apache 2.0