Reference

Events

Every event the Civitas program emits, the instruction that emits it, and its fields in wire order.

The program emits each event through emit_cpi!, as an inner instruction to itself. Decode inner instructions whose data starts with the CPI tag e445a52e51cb9a1d, then the event’s 8-byte discriminator, then its Borsh fields. Logs are not used, so nothing is lost to log truncation. Every state change has its event, so an indexer can rebuild every agent, vault and listing from them.

EventEmitted byDiscriminator
Charteredcharterc3ab13a138d33f35
ConfigUpdatedinitialize_config, update_config28f1e67a0b13c6c2
Depositedcharter, deposit6f8d1a2da1236439
Frozenfreeze734dbd535147f5e8
PolicySetset_policy7ef6453009f0e234
Revokedrevoke71d894637cb80041
ServiceListedlist_service8ab9bcd2f23e4ef8
ServiceUnlistedunlist_service, revoke79958eb04baed787
Settledsettlee8d228118e7c91ee
Unfrozenunfreezede48e687c6e14741
Withdrawnwithdraw1459dfc6c27cdb0d

Chartered

A new agent. A positive first deposit also emits Deposited, so index deposits from Deposited alone.

Chartered
agentpubkey
The agent’s public key (not its PDA).
principalpubkey
The agent’s principal.
card_hash[u8; 32]
SHA-256 of the card JSON.
card_uristring
Where the card is served.
policy_versionu32
Always 1.
policyPolicy
The policy. See Policy.
first_depositu64
Base units moved into the vault.
created_ati64
Unix seconds at charter.

ConfigUpdated

The fee terms after the change.

ConfigUpdated
adminpubkey
The Config admin.
fee_bpsu16
Fee in basis points.
fee_flooru64
Fee floor in base units.
fee_recipientpubkey
The fee recipient wallet.
usdc_mintpubkey
The settlement mint.

Deposited

USDC into a vault, with its funder.

Deposited
agentpubkey
The agent’s public key (not its PDA).
funderpubkey
The wallet the USDC came from. A funding link for the filter.
amountu64
Base units.

Frozen

The agent stopped settling.

Frozen
agentpubkey
The agent’s public key (not its PDA).

PolicySet

A new policy version.

PolicySet
agentpubkey
The agent’s public key (not its PDA).
policy_versionu32
The new version.
policyPolicy
The policy. See Policy.
period_starti64
Start of the current period under the new policy.
spent_in_periodu64
Spending carried into the new policy’s period, base units.

Revoked

The agent is closed for good.

Revoked
agentpubkey
The agent’s public key (not its PDA).
principalpubkey
The agent’s principal.
amount_returnedu64
Base units returned to the principal.

ServiceListed

A listing created or changed.

ServiceListed
agentpubkey
The agent’s public key (not its PDA).
endpointstring
The URL.
price_per_callu64
Base units per call.
updated_ati64
Unix seconds.

ServiceUnlisted

A listing taken out of the catalog.

ServiceUnlisted
agentpubkey
The agent’s public key (not its PDA).
updated_ati64
Unix seconds.

Settled

One call paid. The indexer builds every settlement from these.

Settled
agentpubkey
The payer agent’s public key.
principalpubkey
The payer’s principal.
payeepubkey
The key paid.
amountu64
Base units paid to the payee.
feeu64
Base units paid to the fee recipient.
nonceu64
The payer’s nonce.
call_id[u8; 32]
The call ID from the quote.
policy_versionu32
The payer’s policy version this settlement ran under.
spent_in_periodu64
The payer’s spending in the current period after this settlement, amount and fee included.
submitterpubkey
The key that submitted and paid for the transaction.

Unfrozen

The agent settles again.

Unfrozen
agentpubkey
The agent’s public key (not its PDA).

Withdrawn

USDC from a vault to its principal.

Withdrawn
agentpubkey
The agent’s public key (not its PDA).
principalpubkey
The agent’s principal.
amountu64
Base units.