Types

These types represent the on-chain account structures deserialized by the SDK. Import them with: import type { AgentIdentity, StakeAccount, ... } from '@vouch-protocol/sdk';

BN fields: Fields typed as BN use the bn.js library (re-exported by @coral-xyz/anchor). Convert to number with .toNumber() or to string with .toString(). For large values, use .toString() to avoid precision loss.

AgentTier

Observer Basic Standard Premium

AgentStatus

Active Suspended Deactivated

ServiceCategory

Commerce DataAnalysis ContentCreation CustomerService Financial Logistics Development Research Other

Interfaces

AgentIdentity

On-chain agent account.

FieldType
ownerPublicKey
tierAgentTier
capabilitiesBN

Capabilities bitmask: BUY=1, SELL=2, STAKE=4, REPORT=8, RELAY=16, ORACLE=32. Use bitwise AND to check: agent.capabilities.toNumber() & 1 checks BUY.

FieldType
namestring
serviceCategoryServiceCategory
versionstring
agentCardUrlstring
agentCardHashnumber[]
statusAgentStatus
reputationScorenumber
reputationUpdatedAtBN
reputationChangeTodaynumber
reputationDayStartBN
tierEffectiveAtBN
createdAtBN
updatedAtBN
bumpnumber

StakeAccount

USDC stake account.

FieldType
ownerPublicKey
agentPdaPublicKey
depositedAmountBN
lockedAmountBN
bumpnumber

WithdrawalRequest

Pending withdrawal.

FieldType
stakeAccountPublicKey
amountBN
requestedAtBN
bumpnumber

DeactivationRecord

Record for deactivated agents.

FieldType
ownerPublicKey
deactivatedAtBN
finalReputationScorenumber
bumpnumber

ReputationReporter

Whitelisted reporter program.

FieldType
reporterAuthorityPublicKey
labelstring
weightnumber
totalReportsSubmittednumber
activeboolean
bumpnumber