SDK Reference
Utilities
Formatting, grading, address helpers, and constants.
Helper functions and constants exported from the SDK.
Score Utilities
import { getGrade, formatScore, getScoreColor, scoreToPercentage } from "@brnmwai/qova-core";
getGrade(750); // "BBB"
formatScore(750); // "750"
getScoreColor(750); // "#22C55E"
scoreToPercentage(750); // 75Address Utilities
import { shortenAddress, isValidAddress, checksumAddress } from "@brnmwai/qova-core";
shortenAddress("0x1234567890abcdef1234567890abcdef12345678");
// "0x1234...5678"
isValidAddress("0x1234..."); // true
checksumAddress("0x1234..."); // "0x1234..." (checksummed)Format Utilities
import { formatWei, formatBasisPoints, formatTimestamp } from "@brnmwai/qova-core";
formatWei(1000000000000000000n); // "1.0"
formatBasisPoints(3000); // "30%"
formatTimestamp(1709942400n); // formatted date stringConstants
import {
CHAIN_IDS, // { BASE_SEPOLIA: 84532, BASE_MAINNET: 8453, SKALE_BASE: 1187947933 }
CONTRACTS, // Deployed contract addresses per chain
DEFAULT_CHAIN_ID, // 84532
DEFAULT_RPC_URLS, // Default RPC endpoints per chain
BLOCK_EXPLORERS, // Explorer URLs per chain
MAX_SCORE, // 1000
MIN_SCORE, // 0
SCORE_GRADE_THRESHOLDS,
} from "@brnmwai/qova-core";ABIs
For direct viem usage without the client wrapper:
import {
reputationRegistryAbi,
transactionValidatorAbi,
budgetEnforcerAbi,
qovaCoreAbi,
} from "@brnmwai/qova-core";Zod Schemas
All types have runtime validation schemas:
import {
AgentDetailsSchema,
AgentScoreSchema,
BudgetConfigSchema,
BudgetStatusSchema,
TransactionStatsSchema,
QovaClientConfigSchema,
ContractAddressesSchema,
ChainSchema,
} from "@brnmwai/qova-core";Error Types
import {
QovaError,
AgentNotRegisteredError,
AgentAlreadyRegisteredError,
InvalidScoreError,
BudgetExceededError,
UnauthorizedError,
} from "@brnmwai/qova-core";