For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

pnpm add @sodax/wallet-sdk-react

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

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:

Bridging to SDK calls

useWalletProvider returns a typed ISolanaWalletProvider ready to pass into any @sodax/sdk method. The swap and money market 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/sdk directly:

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


Last updated