Skip to content

Object Webhooks

⚠️ Beta Feature: Webhooks are currently in beta. While fully functional, some features are still being refined.

Monitor changes to specific on-chain objects on the Sui blockchain.

Overview

Object webhooks notify you when a specific object is modified, transferred, or deleted. This is ideal for tracking NFTs, shared objects like AMM pools, or any other Sui object.

Configuration

FieldRequiredDescription
Object IDYesThe object ID to monitor
Webhook URLYesYour HTTPS endpoint

Example Payload

json
{
  "payloadVersion": 1,
  "payload": {
    "activityType": "object_change",
    "objectId": "0x5678efgh",
    "transactionDirection": "output",
    "writeKind": "mutated",
    "owner": "0x1234abcd",
    "previousOwner": "0x9876fedc",
    "txDigest": "Lm4Np8qrst",
    "checkpoint": 12345684,
    "timestamp": 1703097750000
  }
}

Payload Fields

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

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

The transactionDirection field indicates the object's role:

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

Use Cases

NFT Tracking

  • Monitor ownership changes for specific NFTs
  • Track when NFTs are listed/delisted on marketplaces
  • Alert users when their NFTs are transferred

DeFi Protocol Monitoring

  • Watch AMM pool state changes
  • Monitor liquidity position objects
  • Track shared object mutations

Gaming Applications

  • Track character/item modifications
  • Monitor game state objects
  • Watch for item transfers or upgrades

Critical Object Auditing

  • Monitor protocol treasury objects
  • Track admin capability objects
  • Audit critical shared objects

Best Practices

  1. Know your object ID - Ensure you have the correct object ID before creating the webhook
  2. Handle all write kinds - Different write kinds may require different handling
  3. Track ownership changes - Compare owner and previousOwner to detect transfers
  4. Monitor shared objects - Shared objects can be mutated by anyone, so they may change frequently

Next Steps

Released under the MIT License.