QovaQova docs
SDK Reference

Transactions

Recording transactions and querying stats.

Methods for recording and querying agent transactions.

recordTransaction

Records a transaction. Requires wallet.

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

const txHash = await client.recordTransaction(
  "0xAgent...",   // agent address
  "0xTxHash...", // transaction hash
  5000000000n,   // amount in wei
  TransactionType.PAYMENT,
);

Transaction Types

ValueEnumLabel
0TransactionType.PAYMENTPayment
1TransactionType.TRANSFERTransfer
2TransactionType.SWAPSwap
3TransactionType.BRIDGEBridge
4TransactionType.STAKEStake
5TransactionType.OTHEROther

getTransactionStats

Returns aggregate statistics for an agent.

const stats = await client.getTransactionStats("0x1234...");
// {
//   totalCount: 142,
//   successCount: 138,
//   failedCount: 4,
//   totalVolume: 5000000000n,
//   lastTransactionTime: 1709942400n
// }

Types

import type { TransactionStats } from "@brnmwai/qova-core";
import { TransactionStatsSchema, TransactionType, TRANSACTION_TYPE_LABELS } from "@brnmwai/qova-core";