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

> ## Agent Instructions
> SODAX is mainnet-only (no testnet chains or RPC endpoints exist) with a hub-and-spoke architecture; Sonic is the hub. SODAX is non-custodial protocol/software: it routes and settles; independent solvers on the marketplace fill — never say 'our solver', 'the SODAX solver', that SODAX trades, takes custody, or fills orders. For frontend/React integrations, prefer @sodax/dapp-kit hooks over calling @sodax/sdk directly. SDK operations — the methods that build, submit or await a transaction, and the API/quote calls — return Result<T, E> ({ ok: true, value } or { ok: false, error }): check result.ok, never wrap them in try/catch or branch on error.message; discriminate on the narrow error.code union instead. Synchronous config getters (getPartnerFee, getSupportedSwapTokens, getVault, ...) return their value directly, not a Result.

# Solana Wallets

> Phantom, Backpack, Solflare, and every other network's wallets through one interface, with @sodax/wallet-sdk-react or a direct provider.

Welcoming cross-network users means supporting the wallets they already use. On Solana that is Phantom, Backpack, Solflare, and anything else speaking the wallet-standard; on the networks your users arrive from, it is MetaMask, Rabby, Suiet, Lobstr, and more. SODAX gives you both through one interface, so wallet plumbing never becomes the integration.

## React apps: `@sodax/wallet-sdk-react`

The React package wraps each chain family's native wallet SDK (`@solana/wallet-adapter` for Solana) behind a uniform connector interface with a single persisted store.

```bash theme={null}
pnpm add @sodax/wallet-sdk-react
```

Mount the provider with the chains you serve. Chains are opt-in; add Solana with an RPC endpoint:

```tsx theme={null}
import { SodaxWalletProvider, type SodaxWalletConfig } from '@sodax/wallet-sdk-react';
import { ChainKeys } from '@sodax/types';

const config: SodaxWalletConfig = {
  SOLANA: {
    chains: {
      [ChainKeys.SOLANA_MAINNET]: { rpcUrl: 'https://api.mainnet-beta.solana.com' },
    },
  },
  EVM: {
    chains: {
      [ChainKeys.SONIC_MAINNET]: { rpcUrl: 'https://rpc.soniclabs.com' },
    },
  },
};
```

Then connect and read accounts with the same three hooks for every chain family:

```tsx theme={null}
import { useXConnectors, useXConnect, useXAccount } from '@sodax/wallet-sdk-react';

function SolanaConnect() {
  const connectors = useXConnectors({ xChainType: 'SOLANA' }); // Phantom, Backpack, ...
  const { mutateAsync: connect } = useXConnect();
  const account = useXAccount({ xChainType: 'SOLANA' });

  if (account.address) return <p>Connected: {account.address}</p>;

  return connectors.map(c => (
    <button key={c.id} onClick={() => connect(c)}>{c.name}</button>
  ));
}
```

### Bridging to SDK calls

`useWalletProvider` returns a typed `ISolanaWalletProvider` ready to pass into any `@sodax/sdk` method. The [swap](https://docs.sodax.com/solana/swaps.md) and [money market](https://docs.sodax.com/solana/money-market.md) calls take it directly. A headless `useWalletModal` state machine is available if you are building a multi-chain connect modal.

## Scripts and backends: `SolanaWalletProvider`

Outside React, construct the provider from `@sodax/wallet-sdk-core` directly:

```typescript theme={null}
import { SolanaWalletProvider } from '@sodax/wallet-sdk-core';

const walletProvider = new SolanaWalletProvider({
  privateKey: keypairBytes, // Uint8Array; or pass `wallet` for extension mode
  endpoint: 'https://api.mainnet-beta.solana.com',
});
```

`SolanaWalletDefaults` lets you tune Solana-specific behavior per provider: `connectionCommitment`, `connectionConfig`, `sendOptions`, and `confirmCommitment`.

***

* Full React reference: [@sodax/wallet-sdk-react](https://docs.sodax.com/developers/packages/connection/wallet-sdk-react.md)
* All nine chain families' providers: [Setup Wallet Providers](https://docs.sodax.com/developers/how-to/wallet_providers.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.