Send Your First Request
Quickly send your first request to Shinami's Node Service
Introduction
1. Create a Shinami account
You’ll need a Shinami account to follow this quick-start guide. Use referral code "Sui First Request."
2. Create an API Access Key
To use Shinami's products, you’ll need an API access key to authenticate your requests. Set up a Node Access key for Testnet as shown here in our Authentication and API Keys guide
3. Make a request!
Here is an example sui_getTotalTransactionBlocks
request that returns the total number of transactions known to the node.
Example Request
The TypeScript example uses our Shinami Clients SDK and the Rust example uses the Mysten Rust SDK .
Replace all instances of {{name}} with the actual value for that name
curl https://api.shinami.com/node/v1 \
-X POST \
-H 'X-API-Key: {{nodeServiceAccessKey}}' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "sui_getTotalTransactionBlocks",
"params": [],
"id": 1
}' | json_pp
import { createSuiClient } from "@shinami/clients/sui";
const nodeClient = createSuiClient({{nodeServiceAccessKey}});
await nodeClient.getTotalTransactionBlocks();
use sui_sdk::SuiClientBuilder;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
let sui = SuiClientBuilder::default()
.ws_url("wss://api.shinami.com:443/node/v1/{{nodeServiceAccessKey}}")
.build("https://api.shinami.com:443/node/v1/{{nodeServiceAccessKey}}")
.await?;
let resp = sui.read_api().get_total_transaction_blocks().await?;
println!("{}", resp);
Ok(())
}
Example Response
{
"id" : 1,
"jsonrpc" : "2.0",
"result" : "971804907"
}
971804747n
1000994152
Response Data
BigInt<u64>
: total number of transactions on the network known by the node you queried.
Next steps to build on Sui! 🏗
- For an overview of our API docs and tutorials for each of our services, see our Developer Hub homepage.
- For tips on learning how to code in Sui Move, see Sui Move Resources
- If there’s anything else you need, you can reach us at [email protected].
Updated 11 days ago