Platform
Web3 [de]coded
- Introduction
- Protocols
- Chainstack Subgraphs
- Chainstack Marketplace
- Blockchain APIs guides
- Best practices handbook
- Mastering Solana
- Web3pedia
IPFS storage
Chainstack Compare
Chainstack ChatGPT plugin
Chainstack DLP browser extension
Protocols
Advanced APIs
- Introduction
- Warp Transactions
- Debug & Trace APIs
Tooling
- Introduction
- Ethereum tooling
- Solana tooling
- BNB Smart Chain tooling
- Polygon tooling
- Arbitrum tooling
- Base tooling
- Optimism tooling
- Avalanche tooling
- TON tooling
- Unichain tooling
- Ronin tooling
- Blast tooling
- Sui tooling
- Berachain tooling
- Linea tooling
- Mantle tooling
- Polkadot tooling
- zkSync Era tooling
- Zora tooling
- Starknet tooling
- Scroll tooling
- Aptos tooling
- Sonic tooling
- Fantom tooling
- TRON tooling
- Cronos tooling
- Gnosis Chain tooling
- Kaia (ex. Klaytn) tooling
- Celo tooling
- Moonbeam tooling
- Oasis Sapphire tooling
- Polygon zkEVM tooling
- Bitcoin tooling
- Harmony tooling
- opBNB tooling
- Tezos tooling
- Filecoin tooling
- NEAR tooling
Tooling
Sui tooling
JSON-RPC API
Interact with your Sui node using the Sui JSON-RPC API.
Use your Chainstack Sui RPC endpoint to make API calls. Example to get the latest checkpoint:
Copy
curl --request POST \
--url YOUR_CHAINSTACK_ENDPOINT \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_getLatestCheckpointSequenceNumber",
"params": []
}'
Sui TypeScript SDK
The Sui TypeScript SDK is the official SDK for building Sui applications.
Installation
Copy
npm install @mysten/sui.js
Basic usage
Copy
import { SuiClient, getFullnodeUrl } from '@mysten/sui.js/client';
// Connect to your Chainstack node
const client = new SuiClient({
url: 'YOUR_CHAINSTACK_ENDPOINT'
});
// Get latest checkpoint
const checkpoint = await client.getLatestCheckpointSequenceNumber();
console.log('Latest checkpoint:', checkpoint);
Sui Rust SDK
The Sui Rust SDK provides comprehensive Rust bindings for Sui.
Installation
Add to your Cargo.toml
:
Copy
sui-sdk = { git = "https://github.com/mystenlabs/sui", package = "sui-sdk" }
tokio = { version = "1.2", features = ["full"] }
anyhow = "1.0"
Basic usage
Copy
use sui_sdk::SuiClientBuilder;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let sui = SuiClientBuilder::default()
.build("YOUR_CHAINSTACK_ENDPOINT")
.await?;
let checkpoint = sui.read_api().get_latest_checkpoint_sequence_number().await?;
println!("Latest checkpoint: {}", checkpoint);
Ok(())
}
Python SDK (pysui)
pysui is a community-maintained Python SDK for Sui.
Installation
Copy
pip install pysui
Basic usage
Copy
from pysui import SuiConfig, SyncClient
# Configure client with your Chainstack endpoint
config = SuiConfig.custom_config(
rpc_url="YOUR_CHAINSTACK_ENDPOINT"
)
client = SyncClient(config)
# Get latest checkpoint
checkpoint = client.get_latest_checkpoint_sequence_number()
print(f"Latest checkpoint: {checkpoint.result_data}")
Go SDK
The Sui Go SDK provides Go language bindings for Sui.
Installation
Copy
go get github.com/block-vision/sui-go-sdk
Basic usage
Copy
package main
import (
"context"
"fmt"
"github.com/block-vision/sui-go-sdk/sui"
)
func main() {
client := sui.NewSuiClient("YOUR_CHAINSTACK_ENDPOINT")
ctx := context.Background()
checkpoint, err := client.SuiGetLatestCheckpointSequenceNumber(ctx)
if err != nil {
panic(err)
}
fmt.Printf("Latest checkpoint: %s\n", checkpoint)
}
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.