Vana SDK - v2.2.2
    Preparing search index...

    Interface ChainConfig

    Configuration with chain and account details

    interface ChainConfig {
        relayer?: RelayerConfig;
        downloadRelayer?: DownloadRelayerCallbacks;
        storage?: StorageConfig;
        subgraphUrl?: string;
        ipfsGateways?: string[];
        defaultPersonalServerUrl?: string;
        operationStore?: IOperationStore | IRelayerStateStore;
        chainId: VanaChainId;
        rpcUrl?: string;
        account?: Account;
    }

    Hierarchy (View Summary)

    Index

    Properties

    relayer?: RelayerConfig

    Optional relayer configuration for handling gasless transactions. Can be a URL string for convenience, or a callback for full control.

    // Simple URL (SDK handles transport)
    relayer: '/api/relay'

    // Full control with callback
    relayer: async (request) => {
    const response = await fetch('/api/relay', {
    method: 'POST',
    body: JSON.stringify(request)
    });
    return response.json();
    }
    downloadRelayer?: DownloadRelayerCallbacks

    Optional download relayer for proxying CORS-restricted downloads. Provides a proxy mechanism for files stored on servers with CORS restrictions.

    storage?: StorageConfig

    Optional storage providers configuration for file upload/download. Required for: upload(), grant() without pre-stored URLs, schema operations. See StorageConfig for provider selection guidance.

    subgraphUrl?: string

    Optional subgraph URL for querying user files and permissions. If not provided, defaults to the built-in subgraph URL for the current chain. Can be overridden per method call if needed. Obtain chain-specific URLs from Vana documentation or deployment info.

    ipfsGateways?: string[]

    Optional default IPFS gateways to use for fetching files. These gateways will be used by default in fetchFromIPFS unless overridden per-call. If not provided, the SDK will use public gateways. Order matters: first successful gateway is used.

    ['https://gateway.pinata.cloud', 'https://ipfs.io']
    
    defaultPersonalServerUrl?: string

    Default personal server base URL for server operations. Required for ServerController methods like getIdentity(), createOperation(), etc.

    'https://my-personal-server.example.com'
    

    Optional operation store for tracking async relayed transactions. When provided with a relayer, enables resilient transaction management with polling support for pending operations.

    const vana = createVana({
    walletClient,
    relayer: '/api/relay',
    operationStore: myOperationStore
    });
    chainId: VanaChainId

    The chain ID for Vana network. Supported: 14800 (Vana Mainnet), 14801 (Moksha Testnet), 31337 (Local Development). Use chain constants from '@vana/sdk' for type safety.

    rpcUrl?: string

    RPC URL for the chain (optional, will use default for the chain if not provided). Default URLs: mainnet (https://rpc.vana.org), testnet (https://rpc.moksha.vana.org). Override for custom nodes or local development.

    account?: Account

    Optional account for signing transactions. Can be: privateKeyToAccount(), mnemonicToAccount(), or custom Account implementation. Required for write operations; read-only operations work without account.