sui-events-cli
v1.0.5
Published
CLI tool for monitoring Sui blockchain events
Maintainers
Readme
Sui Event Monitor CLI
A powerful command-line interface for monitoring Sui blockchain events with rich features and interactive controls.

Features
- Event Type Discovery: List all event types for any Sui package
- Real-time Event Monitoring: Watch events as they occur on the Sui blockchain
- Multi-subscription Support: Monitor multiple event types simultaneously
- Interactive Controls: Filter and manage subscriptions without restarting
- Rich Terminal UI: Color-coded output with spinner animations
- Transaction Links: Direct links to SuiScan explorer for each event
- Customizable Polling: Adjust the polling interval to your needs
Installation
# Install globally from npm (global installation is REQUIRED for CLI access)
npm install -g sui-events-cli⚠️ IMPORTANT: The -g flag is required to make the sui-events command available globally. Without this flag, you won't be able to run the command from your terminal.
After installation, you can use the sui-events command from anywhere in your terminal.
Commands
Usage: sui-events [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
list <packageId> List available event types for a package
watch <packageId> Watch for events of a specific type
multi-watch <packageId> Watch for multiple event types
help [command] display help for commandUsage
List Event Types
List all available event types for a specific package:
sui-events list <packageId> [options]Options:
-r, --rpc <url>- Custom Sui RPC URL (default: https://sui-rpc.publicnode.com)
Example:
sui-events list 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fbWatch Events
Watch for events of a specific type:
sui-events watch <packageId> <eventType> [options]You can specify the event type in two ways:
- Use the full event type, e.g.,
0xpackage::module::EventName - Use the index from the list command, e.g.,
1for the first event type
Options:
-r, --rpc <url>- Custom Sui RPC URL (default: https://sui-rpc.publicnode.com)-i, --interval <seconds>- Polling interval in seconds (default: 5)
Examples:
# Using full event type
sui-events watch 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::pool::SwapEvent
# Using index from list command
sui-events watch 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb 1
# With custom polling interval (2 seconds)
sui-events watch 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb 1 -i 2
# With custom RPC endpoint
sui-events watch 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb 1 -r https://rpc.mysten.ioMonitor Multiple Event Types
Watch multiple event types at once with the multi-watch command:
sui-events multi-watch <packageId> [options]Options:
-r, --rpc <url>- Custom Sui RPC URL (default: https://sui-rpc.publicnode.com)-i, --interval <seconds>- Polling interval in seconds (default: 5)
This command will:
- List all available event types for the package
- Prompt you to select which event types to monitor (enter numbers comma-separated)
- Start monitoring all selected event types simultaneously
Example:
sui-events multi-watch 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fbInteractive Controls
While monitoring events, you can use these keyboard controls:
l- List all active subscriptionsf- Filter events by subscription IDa- Show all events (clear filter)q- Quit the applicationCtrl+C- Quit the application
Output Format
Event data is displayed in a structured format:
┌─────────────────────────────────────────────────────────┐
│ EVENT 2023-04-25 14:32:45 │
├─────────────────────────────────────────────────────────┤
│ Type: 0xpackage::module::EventName │
│ Subscription: abc123 │
│ Tx ID: 5Gv4dC...8fZq │
│ Explorer: https://suiscan.xyz/mainnet/tx/5Gv4dC...8fZq │
├─────────────────────────────────────────────────────────┤
│ Data: │
│ { │
│ "field1": "value1", │
│ "field2": 123, │
│ "nested": { │
│ "subfield": "value" │
│ } │
│ } │
└─────────────────────────────────────────────────────────┘Examples
Watch for Swap Events on a DEX
# First, find the event types
sui-events list 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb
# Then watch for swap events
sui-events watch 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::pool::SwapEventMonitor Multiple Events on a Marketplace
# Watch all events related to listings, sales, and bids
sui-events multi-watch 0x5f91554965f6da9c3f3f8de1a63b866f4778ebec548291c818027574da542355
# When prompted, enter the event numbers you want to watch:
# Enter event numbers to watch (comma separated, e.g., 1,3,5): 1,2,4Common Use Cases
- DEX Monitoring: Watch for swaps, liquidity additions/removals, and price changes
- NFT Marketplace Activity: Track listings, sales, and bid events
- Governance Participation: Monitor proposal and voting events
- Game Events: Track in-game events like battles, item crafting, or marketplace activities
Troubleshooting
If you encounter any issues:
- No Events Appearing: Try increasing the polling interval with
-ioption - Connection Issues: Check your internet connection or try a different RPC with
-roption - RPC Rate Limiting: If you see rate limit errors, try a different RPC endpoint
- Event Selection: When using
multi-watch, make sure to enter valid event numbers separated by commas
License
MIT
Author
Hai Kukoten | Asmody
