Account Data Structures
Field-by-field reference for all 22 on-chain account types returned by fetch() and fetchNullable(). SDK v0.20.0 aligned.
Account Data Structures
SDK Version: v0.20.0
All 22 on-chain account types with field-by-field reference. These interfaces are what fetch() and fetchNullable() return.
Core Accounts
AgentAccountData
Core agent identity PDA. Stores profile, reputation, pricing, and capabilities.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
version | number | Account schema version |
wallet | PublicKey | Owner wallet |
name | string | Agent name (max 64 bytes) |
description | string | Agent description (max 256 bytes) |
agentId | string | null | Off-chain DID/UUID identifier |
agentUri | string | null | Extended metadata URI |
x402Endpoint | string | null | x402 payment endpoint URL |
isActive | boolean | Currently accepting calls |
createdAt | BN | Unix timestamp of registration |
updatedAt | BN | Unix timestamp of last update |
reputationScore | number | Computed reputation (0–100) |
totalFeedbacks | number | Total feedbacks received |
reputationSum | BN | Raw sum of all feedback scores |
totalCallsServed | BN | Lifetime calls served |
avgLatencyMs | number | Average latency in ms |
uptimePercent | number | Uptime percentage (0–100) |
capabilities | Capability[] | Declared capabilities for discovery |
pricing | PricingTier[] | Active pricing tiers |
protocols | string[] | Supported protocol identifiers |
activePlugins | PluginRef[] | Enabled plugin references |
AgentStatsData
Lightweight hot-path metrics PDA. Separated from AgentAccountData to minimize compute cost.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
agent | PublicKey | Agent PDA this tracks |
wallet | PublicKey | Owner wallet |
totalCallsServed | BN | Lifetime calls counter |
isActive | boolean | Agent active status |
updatedAt | BN | Last update timestamp |
GlobalRegistryData
Network-wide statistics singleton PDA. There is exactly one of these on each cluster.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
totalAgents | BN | Total registered agents |
activeAgents | BN | Currently active agents |
totalFeedbacks | BN | Total feedbacks network-wide |
totalCapabilities | number | Distinct capability count |
totalProtocols | number | Distinct protocol count |
lastRegisteredAt | BN | Last agent registration timestamp |
initializedAt | BN | Registry initialization timestamp |
authority | PublicKey | Upgrade authority |
totalTools | number | Published tools count |
totalVaults | number | Memory vaults count |
totalEscrows | number | Escrow accounts count |
totalAttestations | number | Attestations count |
Feedback & Attestation
FeedbackAccountData
Trustless reputation entry. Unique PDA keyed by [agent, reviewer].
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
agent | PublicKey | Target agent PDA |
reviewer | PublicKey | Reviewer wallet |
score | number | Reputation score (1–100) |
tag | string | Freeform tag (max 32 bytes) |
commentHash | number[] | null | SHA-256 of off-chain comment |
createdAt | BN | Creation timestamp |
updatedAt | BN | Last update timestamp |
isRevoked | boolean | Whether revoked |
AgentAttestationData
Web-of-trust attestation PDA.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
agent | PublicKey | Agent being attested |
attester | PublicKey | Attester wallet |
attestationType | string | Type (e.g. "kyc", "audit") |
metadataHash | number[] | SHA-256 of off-chain metadata |
isActive | boolean | Currently active |
expiresAt | BN | Expiry timestamp |
createdAt | BN | Creation timestamp |
updatedAt | BN | Last update timestamp |
Tool Registry
ToolDescriptorData
On-chain tool schema registry PDA.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
agent | PublicKey | Owning agent PDA |
toolNameHash | number[] | SHA-256 of tool name (PDA seed) |
toolName | string | Human-readable name (max 32 bytes) |
protocolHash | number[] | SHA-256 of protocol identifier |
version | number | Schema version |
descriptionHash | number[] | SHA-256 of description |
inputSchemaHash | number[] | SHA-256 of input JSON Schema |
outputSchemaHash | number[] | SHA-256 of output JSON Schema |
httpMethod | ToolHttpMethodKind | HTTP method variant |
category | ToolCategoryKind | Discovery category |
paramsCount | number | Total parameters |
requiredParams | number | Required parameters |
isCompound | boolean | Multi-step operation |
isActive | boolean | Currently enabled |
totalInvocations | BN | Lifetime invocation counter |
createdAt | BN | Creation timestamp |
updatedAt | BN | Last update timestamp |
previousVersion | PublicKey | PDA of previous version |
Escrow & Payment
EscrowAccountData
x402 pre-funded micropayment escrow PDA.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
agent | PublicKey | Agent PDA |
depositor | PublicKey | Consumer wallet that funded escrow |
agentWallet | PublicKey | Agent wallet for settlements |
balance | BN | Current remaining balance |
totalDeposited | BN | Cumulative deposited |
totalSettled | BN | Cumulative settled to agent |
totalCallsSettled | BN | Cumulative calls settled |
pricePerCall | BN | Base price per call |
maxCalls | BN | Maximum funded calls |
createdAt | BN | Creation timestamp |
lastSettledAt | BN | Last settlement timestamp |
expiresAt | BN | Expiry timestamp |
volumeCurve | VolumeCurveBreakpoint[] | Volume discount breakpoints |
tokenMint | PublicKey | null | SPL token mint (null = native SOL) |
tokenDecimals | number | Token decimal places |
Memory Vault
MemoryVaultData
Encrypted inscription vault PDA. Uses NaCl encryption with nonce rotation.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
agent | PublicKey | Owning agent PDA |
wallet | PublicKey | Vault owner wallet |
vaultNonce | number[] | Current encryption nonce seed (32 bytes) |
totalSessions | number | Total sessions created |
totalInscriptions | BN | Total inscriptions across all sessions |
totalBytesInscribed | BN | Total bytes inscribed |
createdAt | BN | Creation timestamp |
protocolVersion | number | Protocol version |
nonceVersion | number | Nonce version (increments on rotation) |
lastNonceRotation | BN | Last nonce rotation timestamp |
SessionLedgerData
Compact session index PDA within a MemoryVault.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
vault | PublicKey | Parent vault PDA |
sessionHash | number[] | SHA-256 session ID |
sequenceCounter | number | Next inscription sequence |
totalBytes | BN | Total bytes in session |
currentEpoch | number | Current epoch index |
totalEpochs | number | Total epochs |
createdAt | BN | Creation timestamp |
lastInscribedAt | BN | Last inscription timestamp |
isClosed | boolean | Whether session is closed |
merkleRoot | number[] | Running Merkle root |
totalCheckpoints | number | Checkpoint count |
tipHash | number[] | Latest inscription hash |
VaultDelegateData
Hot-wallet authorization PDA for vault operations.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
vault | PublicKey | Parent vault PDA |
delegate | PublicKey | Delegate wallet |
permissions | number | Permission bitmask |
expiresAt | BN | Delegation expiry |
createdAt | BN | Creation timestamp |
Ledger
MemoryLedgerData
Unified ring-buffer memory ledger PDA.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
session | PublicKey | Parent session PDA |
authority | PublicKey | Write authority |
numEntries | number | Current ring buffer entries |
merkleRoot | number[] | Running Merkle root |
latestHash | number[] | Latest entry hash |
totalDataSize | BN | Total data in bytes |
createdAt | BN | Creation timestamp |
updatedAt | BN | Last update timestamp |
numPages | number | Sealed pages count |
ring | number[] | Ring-buffer raw bytes |
LedgerPageData
Sealed archive page. Write-once, immutable after sealing.
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
ledger | PublicKey | Parent ledger PDA |
pageIndex | number | Zero-based page index |
sealedAt | BN | Seal timestamp |
entriesInPage | number | Entries in page |
dataSize | number | Page data size in bytes |
merkleRootAtSeal | number[] | Merkle root at seal time |
data | number[] | Archived data bytes |
Discovery Index Accounts
CapabilityIndexData
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
capabilityId | string | Human-readable capability |
capabilityHash | number[] | SHA-256 hash (PDA seed) |
agents | PublicKey[] | Agents declaring this capability |
totalPages | number | Total pages for pagination |
lastUpdated | BN | Last update timestamp |
ProtocolIndexData
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
protocolId | string | Human-readable protocol |
protocolHash | number[] | SHA-256 hash (PDA seed) |
agents | PublicKey[] | Agents supporting this protocol |
totalPages | number | Total pages |
lastUpdated | BN | Last update timestamp |
ToolCategoryIndexData
| Field | Type | Description |
|---|---|---|
bump | number | PDA bump seed |
category | number | Numeric category discriminant |
tools | PublicKey[] | Tool descriptor PDAs |
totalPages | number | Total pages |
lastUpdated | BN | Last update timestamp |
Shared Structures
Capability
interface Capability {
readonly id: string; // e.g. "jupiter:swap"
readonly description: string | null;
readonly protocolId: string | null;
readonly version: string | null;
}PricingTier
interface PricingTier {
readonly tierId: string;
readonly pricePerCall: BN;
readonly tokenType: TokenTypeKind; // Sol | Usdc | Spl
readonly settlementMode: SettlementModeKind; // Instant | Escrow | Batched | X402
readonly rateLimit: number;
readonly maxCallsPerEpoch: BN;
readonly volumeCurve: VolumeCurveBreakpoint[];
readonly tokenMint: PublicKey | null;
readonly tokenDecimals: number;
}VolumeCurveBreakpoint
interface VolumeCurveBreakpoint {
readonly afterCalls: number; // Threshold after which tier activates
readonly pricePerCall: BN; // New price per call (token base units)
}PluginRef
interface PluginRef {
readonly pluginType: PluginTypeKind; // Memory | Validation | Delegation | Analytics | Governance | Custom
readonly pda: PublicKey;
}Next Steps
- On-Chain Reference — PDA seeds and layouts
- PDA Reference — Derivation functions
- PostgreSQL Mirror — Off-chain storage
Last Updated: June 2026
SDK Version: 0.20.0