QovaQova docs
SDK Reference

Client

Creating and configuring the QovaClient.

The QovaClient is the main entry point for all SDK operations.

Creating a Client

import { createQovaClient } from "@brnmwai/qova-core";

// Read-only (no wallet needed)
const client = createQovaClient({ chain: "base-sepolia" });

// With custom RPC
const client = createQovaClient({
  chain: "base-sepolia",
  rpcUrl: "https://your-rpc-endpoint.com",
});

With Wallet (Write Operations)

import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { baseSepolia } from "viem/chains";
import { createQovaClient } from "@brnmwai/qova-core";

const wallet = createWalletClient({
  account: privateKeyToAccount("0x..."),
  chain: baseSepolia,
  transport: http(),
});

const client = createQovaClient({
  chain: "base-sepolia",
  walletClient: wallet,
});

Config Options

OptionTypeRequiredDescription
chain"base-sepolia" | "base" | "skale-base"YesTarget chain
rpcUrlstringNoCustom RPC endpoint
walletClientWalletClientNoviem wallet for write ops
contractsContractAddressesNoOverride contract addresses

Client Properties

client.publicClient;   // viem PublicClient (read operations)
client.walletClient;   // viem WalletClient | undefined (write operations)
client.contracts;      // Resolved contract addresses

Error Handling

import { QovaError } from "@brnmwai/qova-core";

try {
  const client = createQovaClient({ chain: "invalid" });
} catch (e) {
  if (e instanceof QovaError) {
    console.log(e.code); // "INVALID_CONFIG"
  }
}

Types

import type { QovaClient, QovaClientConfig, ContractAddresses } from "@brnmwai/qova-core";