sui_getEvents{deprecated} - Sui
This method returns transaction events for a specified transaction digest on the SUI network. Events are emitted during transaction execution by Move modules and contain important information about state changes, transfers, and other on-chain activities.
This method is deprecated
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| transaction_digest | TransactionDigest | Yes | The transaction digest to query |
Request Example
bashcurl -X POST https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "sui_getEvents",
"params": ["11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX"]
}'request.js
javascriptconst axios = require('axios');
const payload = {
jsonrpc: '2.0',
id: 'getblock.io',
method: 'sui_getEvents',
params: ['11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX']
};
axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', payload)
.then(response => console.log(response.data));request.py
pythonimport requests
payload = {
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "sui_getEvents",
"params": ["11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX"]
}
response = requests.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/", json=payload)
print(response.json())request.rs
rustuse reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let payload = json!({
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "sui_getEvents",
"params": ["11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX"]
});
let response = client.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
.json(&payload).send().await?;
println!("{}", response.text().await?);
Ok(())
}Response Example
response.json
json{
"jsonrpc": "2.0",
"result": [
{
"id": {
"txDigest": "11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX",
"eventSeq": "0"
},
"packageId": "0xc54ab30a3d9adc07c1429c4d6bbecaf9457c9af77a91f631760853934d383634",
"transactionModule": "test_module",
"sender": "0xbcf7c32655009a61f1de0eae420a2e4ae1bb772ab2dd5d5a7dfa949c0ef06908",
"type": "0x9::test::TestEvent",
"parsedJson": {
"test": "example value"
}
}
],
"id": "getblock.io"
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
| id | object | Event identifier (txDigest + eventSeq) |
| packageId | string | Package that emitted the event |
| transactionModule | string | Module that emitted the event |
| sender | string | Transaction sender |
| type | string | Event type |
| parsedJson | object | Parsed event data |
Use Cases
- Track transaction outcomes via events
- Monitor smart contract activities
- Build transaction history views
- Debug transaction execution
Error Handling
| Error Code | Description |
|---|---|
| -32602 | Invalid params - malformed digest |
| -32603 | Internal error - node issues |
SDK Integration
sdk.ts
typescriptimport { SuiClient } from '@mysten/sui/client';
const client = new SuiClient({ url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' });
const events = await client.getEvents({ transactionDigest: '11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX' });
console.log(events);sdk.rs
rustuse sui_sdk::SuiClientBuilder;
use sui_types::digests::TransactionDigest;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
let sui = SuiClientBuilder::default().build("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/").await?;
let digest: TransactionDigest = "11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX".parse()?;
let events = sui.read_api().get_events(digest).await?;
println!("{:?}", events);
Ok(())
}