sui_getTransactionBlock - Sui
Example code for the sui_getTransactionBlock JSON-RPC method. Complete guide on how to use sui_getTransactionBlock JSON-RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Default/Supported Values
Field
Type
Default
Description
Request Example
curl --location --request POST https://go.getblock.io/<ACCESS-TOKEN>/ \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "sui_getTransactionBlock",
"params": [
"5PLgmQye6rraDYqpV3npV6H1cUXoJZgJh1dPCyRa3WCv",
{
"showInput": true,
"showEffects": true,
"showEvents": true,
"showObjectChanges": true,
"showBalanceChanges": true
}
],
"id": "getblock.io"
}'use 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_getTransactionBlock",
"params": [
"5PLgmQye6rraDYqpV3npV6H1cUXoJZgJh1dPCyRa3WCv",
{
"showInput": true,
"showEffects": true,
"showEvents": true
}
]
});
let response = client
.post("https://go.getblock.io/<ACCESS-TOKEN>/")
.header("Content-Type", "application/json")
.json(&payload)
.send()
.await?;
println!("Response: {:?}", response.text().await?);
Ok(())
}Response
Repsonse Parameters
Parameter
Type
Description
Use Cases
Error Handling
Code
Description
Solution
SDK Integration
Last updated
Was this helpful?