Onchain Events
The indexer listens to Sui events emitted by the Walrus Memory contract and uses them to update local backend state.
Events
The Walrus Memory contract emits the following events:
| Event | Emitted when | Fields |
|---|---|---|
AccountCreated | A new account is created | account_id, owner |
DelegateKeyAdded | A delegate key is added | account_id, public_key, sui_address, label |
DelegateKeyRemoved | A delegate key is removed | account_id, public_key |
AccountDeactivated | An account's active flag changes to false (owner deactivate_account, or admin_deactivate_account when the account was still active) | account_id, owner |
AccountReactivated | A frozen account is unfrozen | account_id, owner |
AccountQuarantined | Admin containment is applied | account_id, owner |
AccountQuarantineCleared | Admin containment is released | account_id, owner |
Current coverage
The indexer currently targets the AccountCreated event flow as its primary sync path. Delegate key events and account activation events are part of the broader design and might be indexed in future iterations.
Account freeze and quarantine states
Owner deactivation and Admin quarantine use separate flags on the account. AccountDeactivated reports that the active flag changed to false. Two calls emit it:
- The owner calls
deactivate_account. The call aborts if the account is already deactivated. - An AdminCap holder calls
admin_deactivate_account. If the account is not already quarantined, this sets theadmin_quarantinedflag and emitsAccountQuarantined, and also emitsAccountDeactivatedif the account was still active. A repeat call on a quarantined account returns without emitting events.
While quarantine is active, the owner cannot reactivate the account. admin_clear_quarantine releases quarantine without reactivating the account. The account stays frozen until the owner calls reactivate_account.
How the indexer uses AccountCreated
The indexer runs on the Sui checkpoint-ingestion framework. It reads checkpoints from a remote checkpoint store and picks out AccountCreated events from the Walrus Memory package. For each event, it inserts an account_id → owner mapping into the accounts table. The relayer uses this same PostgreSQL database, so it can resolve accounts quickly. The framework records the indexer's checkpoint watermark, which lets it resume after restarts.