Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pages/rpc-service/chains/chains-api/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"stellar": "Stellar",
"story": "Story",
"sui": "Sui",
"sui-grpc": "Sui gRPC",
"swell": "Swell",
"syscoin": "Syscoin",
"tac": "TAC",
Expand Down
6 changes: 6 additions & 0 deletions pages/rpc-service/chains/chains-api/sui/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"index": "Overview",
"json-rpc": "JSON-RPC",
"grpc": "gRPC",
"graphql": "GraphQL"
}
86 changes: 86 additions & 0 deletions pages/rpc-service/chains/chains-api/sui/graphql.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { Callout } from "components";

# Sui GraphQL
<br/>

<img src="/docs/build/chains-list/sui.png" className="responsive-pic" width="800" />

> Sui GraphQL API is available on [Web3 API platform](https://www.ankr.com/rpc/sui).

The Sui GraphQL RPC provides a flexible query interface for interacting with the Sui blockchain. Unlike JSON-RPC, GraphQL lets you request exactly the data you need in a single call β€” reducing overfetching and round trips.

With GraphQL, you can compose queries that combine objects, transactions, balances, checkpoints, and more into a single request. It supports pagination, filtering, and nested lookups, making it well suited for frontends, dashboards, and analytics tools.

## Endpoint

| Network | Endpoint |
|---------|----------|
| Mainnet | `https://rpc.ankr.com/http/sui_graphql` |

For Premium users, append your token to the URL: `https://rpc.ankr.com/http/sui_graphql/{your_token}`

---

## Request example

Query the latest checkpoint:

```shell
curl -X POST https://rpc.ankr.com/http/sui_graphql \
-H 'Content-Type: application/json' \
-d '{
"query": "{ checkpoint { sequenceNumber digest timestamp } }"
}'
```

## Response example

```json
{
"data": {
"checkpoint": {
"sequenceNumber": 214225619,
"digest": "GNSviTUX6DXkiCPKYDo1uihJsm5oRcjtvrkT8mVQyay8",
"timestamp": "2025-03-24T12:00:00Z"
}
}
}
```

---

## Query examples

### Get object by ID

```shell
curl -X POST https://rpc.ankr.com/http/sui_graphql \
-H 'Content-Type: application/json' \
-d '{
"query": "{ object(address: \"0x5\") { address version digest owner { __typename } } }"
}'
```

### Get address balances

```shell
curl -X POST https://rpc.ankr.com/http/sui_graphql \
-H 'Content-Type: application/json' \
-d '{
"query": "{ address(address: \"0xYOUR_ADDRESS\") { balance { totalBalance coinType { repr } } } }"
}'
```

---

## Key features

- **Composable queries** β€” request multiple related resources in a single call.
- **Pagination** β€” default 50 items per page, up to 200 for multi-get operations.
- **Filtering** β€” narrow results by type, owner, checkpoint range, and more.
- **No overfetching** β€” get only the fields you need.

## Further reading

- [Sui GraphQL reference](https://docs.sui.io/references/sui-graphql)
- [Sui GraphQL RPC concepts](https://docs.sui.io/concepts/data-access/graphql-rpc)
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,77 @@ In addition to standard request–response calls, gRPC supports server-side stre

The Sui gRPC server fully supports server reflection, allowing tools like `grpcurl` to discover available services and methods at runtime without requiring local `.proto` files.

## Endpoints

| Network | Endpoint | Description |
|---------|----------|-------------|
| Mainnet | `sui.grpc.ankr.com:443` | Standard gRPC |
| Testnet | `sui-testnet.grpc.ankr.com:443` | Testnet gRPC |
| Mainnet Archive | `archive.sui.grpc.ankr.com:443` | Historical data access |

For Premium users, pass your token via the `x-token` header (e.g., `-H "x-token: your-token"`).

**Archive endpoint** β€” provides access to historical Sui data that standard full nodes may have pruned. It exposes the same `LedgerService` API, so you can use the same client code. Use it when querying older transactions, checkpoints, or objects that are no longer available on current nodes.

## Methods list

**Ledger Service**:

Provides read access to global ledger metadata such as chain identifiers, epochs, checkpoints, timestamps, and system-level information.

* [`BatchGetObjects`](/rpc-service/chains/chains-api/sui-grpc/#batchgetobjects) β€” Retrieves multiple objects in one request.
* [`BatchGetTransactions`](/rpc-service/chains/chains-api/sui-grpc/#batchgettransactions) β€” Retrieves multiple transactions by digest.
* [`GetCheckpoint`](/rpc-service/chains/chains-api/sui-grpc/#getcheckpoint) β€” Retrieves a checkpoint by sequence or digest.
* [`GetEpoch`](/rpc-service/chains/chains-api/sui-grpc/#getepoch) β€” Retrieves details for a specific epoch.
* [`GetObject`](/rpc-service/chains/chains-api/sui-grpc/#getobject) β€” Retrieves a single object by ID.
* [`GetServiceInfo`](/rpc-service/chains/chains-api/sui-grpc/#getserviceinfo) β€” Retrieves node, chain, and service metadata.
* [`GetTransaction`](/rpc-service/chains/chains-api/sui-grpc/#gettransaction) β€” Retrieves a single transaction by digest.
* [`BatchGetObjects`](/rpc-service/chains/chains-api/sui/grpc#batchgetobjects) β€” Retrieves multiple objects in one request.
* [`BatchGetTransactions`](/rpc-service/chains/chains-api/sui/grpc#batchgettransactions) β€” Retrieves multiple transactions by digest.
* [`GetCheckpoint`](/rpc-service/chains/chains-api/sui/grpc#getcheckpoint) β€” Retrieves a checkpoint by sequence or digest.
* [`GetEpoch`](/rpc-service/chains/chains-api/sui/grpc#getepoch) β€” Retrieves details for a specific epoch.
* [`GetObject`](/rpc-service/chains/chains-api/sui/grpc#getobject) β€” Retrieves a single object by ID.
* [`GetServiceInfo`](/rpc-service/chains/chains-api/sui/grpc#getserviceinfo) β€” Retrieves node, chain, and service metadata.
* [`GetTransaction`](/rpc-service/chains/chains-api/sui/grpc#gettransaction) β€” Retrieves a single transaction by digest.

---

**Move Package Service**:

Exposes Move package metadata, allowing you to query on-chain modules and published Move code.

* [`GetDatatype`](/rpc-service/chains/chains-api/sui-grpc/#getdatatype) β€” Retrieves metadata about a Move struct/type.
* [`GetFunction`](/rpc-service/chains/chains-api/sui-grpc/#getfunction) β€” Retrieves metadata about a Move function.
* [`GetPackage`](/rpc-service/chains/chains-api/sui-grpc/#getpackage) β€” Retrieves information about a Move package.
* [`ListPackageVersions`](/rpc-service/chains/chains-api/sui-grpc/#listpackageversions) β€” Lists the published versions of a package.
* [`GetDatatype`](/rpc-service/chains/chains-api/sui/grpc#getdatatype) β€” Retrieves metadata about a Move struct/type.
* [`GetFunction`](/rpc-service/chains/chains-api/sui/grpc#getfunction) β€” Retrieves metadata about a Move function.
* [`GetPackage`](/rpc-service/chains/chains-api/sui/grpc#getpackage) β€” Retrieves information about a Move package.
* [`ListPackageVersions`](/rpc-service/chains/chains-api/sui/grpc#listpackageversions) β€” Lists the published versions of a package.

---

**Signature Verification Service**:

Performs cryptographic verification for signatures, proofs, and signed messages.

* [`VerifySignature`](/rpc-service/chains/chains-api/sui-grpc/#verifysignature): Validates a signature against a message and public key.
* [`VerifySignature`](/rpc-service/chains/chains-api/sui/grpc#verifysignature): Validates a signature against a message and public key.

---

**State Service**:

Provides access to detailed on-chain state including objects, balances, ownership, object layouts, dynamic fields, and protocol configuration. This is the main service for querying Sui state data.

* [`GetBalance`](/rpc-service/chains/chains-api/sui-grpc/#getbalance) β€” Retrieves balance for a specific coin type.
* [`GetCoinInfo`](/rpc-service/chains/chains-api/sui-grpc/#getcoininfo) β€” Retrieves metadata for a coin type.
* [`ListBalances`](/rpc-service/chains/chains-api/sui-grpc/#listbalances) β€” Lists all coin balances for an address.
* [`ListDynamicFields`](/rpc-service/chains/chains-api/sui-grpc/#listdynamicfields) β€” Lists dynamic fields under an object.
* [`ListOwnedObjects`](/rpc-service/chains/chains-api/sui-grpc/#listownedobjects) β€” Lists objects owned by an address.
* [`GetBalance`](/rpc-service/chains/chains-api/sui/grpc#getbalance) β€” Retrieves balance for a specific coin type.
* [`GetCoinInfo`](/rpc-service/chains/chains-api/sui/grpc#getcoininfo) β€” Retrieves metadata for a coin type.
* [`ListBalances`](/rpc-service/chains/chains-api/sui/grpc#listbalances) β€” Lists all coin balances for an address.
* [`ListDynamicFields`](/rpc-service/chains/chains-api/sui/grpc#listdynamicfields) β€” Lists dynamic fields under an object.
* [`ListOwnedObjects`](/rpc-service/chains/chains-api/sui/grpc#listownedobjects) β€” Lists objects owned by an address.

---

**Subscription Service**:

Supports server-side streaming for real-time updates. Use it to subscribe to events, transactions, checkpoints, or other continuous data feeds.

* [`SubscribeCheckpoints`](/rpc-service/chains/chains-api/sui-grpc/#subscribecheckpoints) β€” Subscribes to a stream of newly produced checkpoints.
* [`SubscribeCheckpoints`](/rpc-service/chains/chains-api/sui/grpc#subscribecheckpoints) β€” Subscribes to a stream of newly produced checkpoints.

**Transaction Execution Service**:

Lets you simulate and execute transactions, fetch execution effects, run dry-runs, and retrieve transaction metadata. This is the primary service for write operations and transaction analysis.

* [`ExecuteTransaction`](/rpc-service/chains/chains-api/sui-grpc/#executetransaction) β€” Executes a signed transaction on-chain.
* [`SimulateTransaction`](/rpc-service/chains/chains-api/sui-grpc/#simulatetransaction) β€” Simulates a transaction without executing it.
* [`ExecuteTransaction`](/rpc-service/chains/chains-api/sui/grpc#executetransaction) β€” Executes a signed transaction on-chain.
* [`SimulateTransaction`](/rpc-service/chains/chains-api/sui/grpc#simulatetransaction) β€” Simulates a transaction without executing it.

---

Expand Down
72 changes: 72 additions & 0 deletions pages/rpc-service/chains/chains-api/sui/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { Callout } from "components";

# Sui

<br/>

<img src="/docs/build/chains-list/sui.png" className="responsive-pic" width="800" />

<Callout type="tip">
Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users.
</Callout>

> Sui API is available on [Web3 API platform](https://www.ankr.com/rpc/sui).

*Sui* is the first permissionless Layer 1 blockchain designed from the ground up to enable creators and developers to build experiences that cater to the next billion users in Web3. Sui is horizontally scalable to support a wide range of application development with unrivaled speed at low cost.

Ankr provides multiple interfaces for interacting with Sui β€” JSON-RPC, gRPC, and GraphQL β€” across mainnet, testnet, and archival data.

---

## Endpoints

| Interface | Network | Endpoint | Auth |
|-----------|---------|----------|------|
| JSON-RPC | Mainnet | `https://rpc.ankr.com/sui` | Token for Premium |
| JSON-RPC | Testnet | `https://rpc.ankr.com/sui_testnet` | Token for Premium |
| gRPC | Mainnet | `sui.grpc.ankr.com:443` | `x-token` header for Premium |
| gRPC | Testnet | `sui-testnet.grpc.ankr.com:443` | `x-token` header for Premium |
| gRPC Archive | Mainnet | `archive.sui.grpc.ankr.com:443` | `x-token` header for Premium |
| GraphQL | Mainnet | `https://rpc.ankr.com/http/sui_graphql` | Token for Premium |

For Premium endpoints, append your token to the URL (for HTTP-based APIs) or pass it via the `x-token` header (for gRPC).

---

## Interfaces

### JSON-RPC

The standard [JSON-RPC 2.0](https://www.jsonrpc.org/specification) interface for reading blockchain data and sending transactions. This is the most widely used API for Sui dApp development.

[View JSON-RPC methods β†’](/rpc-service/chains/chains-api/sui/json-rpc)

### gRPC

A high-performance interface using [Protocol Buffers](https://protobuf.dev/overview/) for fast, type-safe, and bandwidth-efficient communication. gRPC supports server-side streaming for real-time data delivery and automatic client generation in TypeScript, Go, Rust, and more. Ideal for indexers, explorers, and backend systems.

[View gRPC methods β†’](/rpc-service/chains/chains-api/sui/grpc)

### GraphQL

A flexible query language that lets you request exactly the data you need in a single call. Sui's GraphQL RPC provides composable queries for on-chain state β€” objects, transactions, balances, checkpoints β€” without overfetching. It supports pagination, filtering, and nested lookups.

[View GraphQL documentation β†’](/rpc-service/chains/chains-api/sui/graphql)

---

## gRPC Archive

The gRPC Archive endpoint (`archive.sui.grpc.ankr.com:443`) provides access to historical Sui network data that standard full nodes may have pruned. It exposes the same `LedgerService` gRPC API as the standard gRPC endpoint, so you can use the same client code and methods.

Use the Archive endpoint when you need to query older transactions, checkpoints, or objects that are no longer available on current full nodes. A common pattern is to first query the standard endpoint and fall back to the Archive endpoint if the data is not found.

---

## Getting started

1. **Get your API token** β€” Sign up at [ankr.com/rpc](https://www.ankr.com/rpc/sui) to get a Premium token, or use the public endpoints without authentication.
2. **Choose your interface** β€” Pick JSON-RPC, gRPC, or GraphQL based on your use case.
3. **Connect** β€” Use the endpoints from the table above with your preferred client library or tool.

Official Sui links: [Website](https://sui.io/), [Docs](https://docs.sui.io/), [GitHub](https://github.com/MystenLabs)
Loading
Loading