Skip to content

Object Streams

Stream changes to specific on-chain objects, in real time over WebSocket or SSE.

Overview

Object streams push a message whenever a specific object is created, modified, transferred, or deleted. Ideal for tracking NFTs, shared objects like AMM pools, or any other Sui object - the streaming counterpart of Object Webhooks.

Configuration

Create the stream in the dashboard:

FieldRequiredDescription
Object IDYesThe object ID to monitor

Then connect with the Stream ID via WebSocket (recommended) or SSE - see Setup & Connection.

Example Message

Messages arrive with the event name object:

json
{
  "id": "12345684_Lm4Np8qrst_0x5678efgh_output_mutated",
  "event": "object",
  "data": {
    "activityType": "object_change",
    "object_id": "0x5678efgh",
    "transactionDirection": "output",
    "writeKind": "mutated",
    "owner": "0x1234abcd",
    "previousOwner": "0x9876fedc",
    "txDigest": "Lm4Np8qrst",
    "checkpoint": 12345684,
    "timestamp": 1703097750000
  }
}

Payload Fields

FieldTypeDescription
data.activityTypestringAlways object_change
data.object_idstringThe monitored object ID
data.transactionDirectioninput | outputWhether object was input or output of tx
data.writeKindstringHow the object was modified (see below)
data.ownerstring | nullCurrent/new owner address
data.previousOwnerstring | nullPrevious owner (if ownership changed)
data.txDigeststringTransaction digest
data.checkpointnumberCheckpoint sequence number
data.timestampnumberUnix timestamp in milliseconds

Note the object_id field uses snake_case, unlike most other fields.

Write Kinds

The writeKind field indicates how the object was modified:

Write KindDescription
createdObject was created in this transaction
mutatedObject was modified (fields changed)
deletedObject was permanently deleted
wrappedObject was wrapped inside another object
unwrappedObject was unwrapped from another object
unwrapped_then_deletedObject was unwrapped and then deleted

Transaction Direction

  • input: The object was read or consumed by the transaction
  • output: The object was created or modified by the transaction

Use Cases

  • NFT tracking: Live ownership changes for specific NFTs
  • DeFi monitoring: Watch AMM pool state changes as they happen
  • Gaming: Track item modifications and transfers in real time
  • Auditing: Stream mutations of critical shared or admin objects

Best Practices

  1. Handle all write kinds - different kinds may require different handling
  2. Compare owner and previousOwner to detect transfers
  3. Expect volume on shared objects - anyone can mutate them, so they change frequently
  4. ACK on WebSocket after processing for exactly-once delivery

Next Steps

Released under the MIT License.