From 300a6ee40ee303bce40f6708a975512d07ca05ec Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 8 Apr 2026 12:10:10 -0400 Subject: [PATCH 1/9] docs: add Sui gRPC API documentation Add dedicated documentation for the Sui gRPC v2 API covering all 22 methods across 7 services: LedgerService, TransactionExecutionService, StateService, MovePackageService, NameService, SubscriptionService, and SignatureVerificationService. --- .../api-reference/sui-grpc/move-packages.mdx | 120 +++++++++++ .../api-reference/sui-grpc/name-service.mdx | 55 +++++ .../sui-grpc/objects-and-ledger.mdx | 196 ++++++++++++++++++ content/api-reference/sui-grpc/overview.mdx | 94 +++++++++ content/api-reference/sui-grpc/quickstart.mdx | 99 +++++++++ .../sui-grpc/signature-verification.mdx | 38 ++++ .../sui-grpc/state-and-balances.mdx | 149 +++++++++++++ .../api-reference/sui-grpc/subscriptions.mdx | 35 ++++ .../api-reference/sui-grpc/transactions.mdx | 68 ++++++ content/docs.yml | 27 +++ 10 files changed, 881 insertions(+) create mode 100644 content/api-reference/sui-grpc/move-packages.mdx create mode 100644 content/api-reference/sui-grpc/name-service.mdx create mode 100644 content/api-reference/sui-grpc/objects-and-ledger.mdx create mode 100644 content/api-reference/sui-grpc/overview.mdx create mode 100644 content/api-reference/sui-grpc/quickstart.mdx create mode 100644 content/api-reference/sui-grpc/signature-verification.mdx create mode 100644 content/api-reference/sui-grpc/state-and-balances.mdx create mode 100644 content/api-reference/sui-grpc/subscriptions.mdx create mode 100644 content/api-reference/sui-grpc/transactions.mdx diff --git a/content/api-reference/sui-grpc/move-packages.mdx b/content/api-reference/sui-grpc/move-packages.mdx new file mode 100644 index 000000000..e0da081da --- /dev/null +++ b/content/api-reference/sui-grpc/move-packages.mdx @@ -0,0 +1,120 @@ +--- +title: Move packages +description: Sui gRPC MovePackageService API reference +slug: reference/sui-grpc-move-packages +--- + +The `MovePackageService` provides methods for inspecting Move packages, functions, and data types. + +## GetPackage + +Fetches a Move package by its ID. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `package_id` | string | Yes | The Move package ID | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `package` | Package | The Move package including its modules | + +```bash cURL +grpcurl \ + -d '{"package_id": "0x2"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.MovePackageService/GetPackage +``` + +--- + +## GetFunction + +Fetches a Move function definition by package, module, and function name. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `package_id` | string | Yes | The Move package ID | +| `module_name` | string | Yes | The module name | +| `name` | string | Yes | The function name | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `function` | FunctionDescriptor | The function definition including parameters and return types | + +```bash cURL +grpcurl \ + -d '{ + "package_id": "0x2", + "module_name": "coin", + "name": "balance" + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.MovePackageService/GetFunction +``` + +--- + +## GetDatatype + +Fetches a Move struct or enum definition by package, module, and name. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `package_id` | string | Yes | The Move package ID | +| `module_name` | string | Yes | The module name | +| `name` | string | Yes | The datatype name | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `datatype` | DatatypeDescriptor | The datatype definition including fields and abilities | + +```bash cURL +grpcurl \ + -d '{ + "package_id": "0x2", + "module_name": "coin", + "name": "Coin" + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.MovePackageService/GetDatatype +``` + +--- + +## ListPackageVersions + +Lists all versions of a Move package with pagination. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `package_id` | string | Yes | The Move package ID | +| `page_size` | uint32 | No | Maximum results to return | +| `page_token` | bytes | No | Pagination token from a previous response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `versions` | repeated PackageVersion | List of package versions | +| `next_page_token` | bytes | Token for the next page of results | + +```bash cURL +grpcurl \ + -d '{"package_id": "0x2"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.MovePackageService/ListPackageVersions +``` diff --git a/content/api-reference/sui-grpc/name-service.mdx b/content/api-reference/sui-grpc/name-service.mdx new file mode 100644 index 000000000..46e6d1354 --- /dev/null +++ b/content/api-reference/sui-grpc/name-service.mdx @@ -0,0 +1,55 @@ +--- +title: Name service +description: Sui gRPC NameService API reference +slug: reference/sui-grpc-name-service +--- + +The `NameService` provides methods for resolving SuiNS names to addresses and vice versa. + +## LookupName + +Resolves a SuiNS name to its record, including the associated address. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `name` | string | Yes | The SuiNS name to look up (e.g., `example.sui`) | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `record` | NameRecord | The name record including the resolved address | + +```bash cURL +grpcurl \ + -d '{"name": "example.sui"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.NameService/LookupName +``` + +--- + +## ReverseLookupName + +Resolves an address to its SuiNS name. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `address` | string | Yes | The address to reverse-lookup | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `record` | NameRecord | The name record for the address | + +```bash cURL +grpcurl \ + -d '{"address": "0xYOUR_ADDRESS"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.NameService/ReverseLookupName +``` diff --git a/content/api-reference/sui-grpc/objects-and-ledger.mdx b/content/api-reference/sui-grpc/objects-and-ledger.mdx new file mode 100644 index 000000000..17784e626 --- /dev/null +++ b/content/api-reference/sui-grpc/objects-and-ledger.mdx @@ -0,0 +1,196 @@ +--- +title: Objects and ledger +description: Sui gRPC LedgerService API reference +slug: reference/sui-grpc-objects-and-ledger +--- + +The `LedgerService` provides methods for querying objects, transactions, checkpoints, epochs, and general chain information. + +## GetServiceInfo + +Returns chain metadata including the current checkpoint height and epoch. + +**Request**: No fields required. + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `chain` | string | Network name (e.g., `mainnet`) | +| `chain_id` | string | Chain identifier | +| `checkpoint_height` | uint64 | Current checkpoint height | +| `epoch` | uint64 | Current epoch | +| `lowest_available_checkpoint` | uint64 | Earliest available checkpoint | +| `lowest_available_checkpoint_objects` | uint64 | Earliest checkpoint with object data | +| `server` | string | Server identifier | +| `timestamp` | Timestamp | Server timestamp | + +```bash cURL +grpcurl \ + -d '{}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/GetServiceInfo +``` + +--- + +## GetObject + +Fetches a single object by ID, optionally at a specific version. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `object_id` | string | Yes | The object ID | +| `version` | uint64 | No | Specific version to fetch | +| `read_mask` | FieldMask | No | Fields to include in the response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `object` | Object | The requested object | + +```bash cURL +grpcurl \ + -d '{"object_id": "0x5"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/GetObject +``` + +--- + +## BatchGetObjects + +Fetches multiple objects in a single request. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `requests` | repeated GetObjectRequest | Yes | Array of object requests | +| `read_mask` | FieldMask | No | Fields to include in each response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `objects` | repeated GetObjectResult | Array of results, each containing an `object` or `error` | + +```bash cURL +grpcurl \ + -d '{ + "requests": [ + {"object_id": "0x5"}, + {"object_id": "0x6"} + ] + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/BatchGetObjects +``` + +--- + +## GetTransaction + +Fetches a single executed transaction by its digest. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `digest` | string | Yes | Transaction digest | +| `read_mask` | FieldMask | No | Fields to include in the response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `transaction` | ExecutedTransaction | The executed transaction | + +```bash cURL +grpcurl \ + -d '{"digest": "YOUR_TX_DIGEST"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/GetTransaction +``` + +--- + +## BatchGetTransactions + +Fetches multiple transactions by digest in a single request. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `digests` | repeated string | Yes | Array of transaction digests | +| `read_mask` | FieldMask | No | Fields to include in each response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `transactions` | repeated GetTransactionResult | Array of results, each containing a `transaction` or `error` | + +```bash cURL +grpcurl \ + -d '{"digests": ["DIGEST_1", "DIGEST_2"]}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/BatchGetTransactions +``` + +--- + +## GetCheckpoint + +Fetches a checkpoint by sequence number or digest. + +**Request** (one of): + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `sequence_number` | uint64 | No | Checkpoint sequence number | +| `digest` | string | No | Checkpoint digest | +| `read_mask` | FieldMask | No | Fields to include in the response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `checkpoint` | Checkpoint | The checkpoint data | + +```bash cURL +grpcurl \ + -d '{"sequence_number": 1000000}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/GetCheckpoint +``` + +--- + +## GetEpoch + +Fetches epoch information. Returns the current epoch if no epoch number is specified. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `epoch` | uint64 | No | Epoch number. Defaults to current epoch | +| `read_mask` | FieldMask | No | Fields to include in the response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `epoch` | Epoch | Epoch information | + +```bash cURL +grpcurl \ + -d '{}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/GetEpoch +``` diff --git a/content/api-reference/sui-grpc/overview.mdx b/content/api-reference/sui-grpc/overview.mdx new file mode 100644 index 000000000..69ba9726d --- /dev/null +++ b/content/api-reference/sui-grpc/overview.mdx @@ -0,0 +1,94 @@ +--- +title: Sui gRPC overview +description: High-performance gRPC API for querying and executing on Sui +slug: reference/sui-grpc-overview +--- + +Sui gRPC is a high-performance API for interacting with the Sui blockchain using Protocol Buffers and gRPC. It provides typed, efficient access to objects, transactions, balances, Move packages, and more. + +## Why Sui gRPC? + +Sui gRPC offers advantages over the JSON-RPC API: + +- **Strongly typed**: Protocol Buffers provide strict typing and schema validation +- **Efficient serialization**: Binary encoding reduces payload size compared to JSON +- **Streaming support**: Subscribe to real-time checkpoint updates with server-streaming RPCs +- **Field masking**: Request only the fields you need with `read_mask` to reduce response size +- **Batch operations**: Fetch multiple objects or transactions in a single request + +## Available services + +### [Objects and ledger](/docs/reference/sui-grpc-objects-and-ledger) + +Query objects, transactions, checkpoints, and epochs through the `LedgerService`. + +| gRPC method | JSON-RPC equivalent | +| --- | --- | +| `GetObject` | `sui_getObject` | +| `BatchGetObjects` | `sui_multiGetObjects` | +| `GetTransaction` | `sui_getTransactionBlock` | +| `BatchGetTransactions` | `sui_multiGetTransactionBlocks` | +| `GetCheckpoint` | `sui_getCheckpoint` | +| `GetEpoch` | No equivalent | +| `GetServiceInfo` | `sui_getChainIdentifier` | + +### [Transactions](/docs/reference/sui-grpc-transactions) + +Execute and simulate transactions through the `TransactionExecutionService`. + +| gRPC method | JSON-RPC equivalent | +| --- | --- | +| `ExecuteTransaction` | `sui_executeTransactionBlock` | +| `SimulateTransaction` | `sui_dryRunTransactionBlock`, `sui_devInspectTransactionBlock` | + +### [State and balances](/docs/reference/sui-grpc-state-and-balances) + +Query coin balances, dynamic fields, and owned objects through the `StateService`. + +| gRPC method | JSON-RPC equivalent | +| --- | --- | +| `GetBalance` | `suix_getBalance` | +| `ListBalances` | `suix_getAllBalances`, `suix_getCoins`, `suix_getAllCoins` | +| `GetCoinInfo` | `suix_getCoinMetadata`, `suix_getTotalSupply` | +| `ListDynamicFields` | `suix_getDynamicFields` | +| `ListOwnedObjects` | `suix_getOwnedObjects` | + +### [Move packages](/docs/reference/sui-grpc-move-packages) + +Inspect Move packages, functions, and data types through the `MovePackageService`. + +| gRPC method | JSON-RPC equivalent | +| --- | --- | +| `GetPackage` | `sui_getNormalizedMoveModule` | +| `GetFunction` | `sui_getNormalizedMoveFunction`, `sui_getMoveFunctionArgTypes` | +| `GetDatatype` | `sui_getNormalizedMoveStruct` | +| `ListPackageVersions` | No equivalent | + +### [Name service](/docs/reference/sui-grpc-name-service) + +Resolve SuiNS names through the `NameService`. + +| gRPC method | JSON-RPC equivalent | +| --- | --- | +| `LookupName` | `suix_resolveNameServiceAddress` | +| `ReverseLookupName` | `suix_resolveNameServiceNames` | + +### [Subscriptions](/docs/reference/sui-grpc-subscriptions) + +Stream real-time checkpoint data through the `SubscriptionService`. + +| gRPC method | JSON-RPC equivalent | +| --- | --- | +| `SubscribeCheckpoints` | No equivalent | + +### [Signature verification](/docs/reference/sui-grpc-signature-verification) + +Verify user signatures through the `SignatureVerificationService`. + +| gRPC method | JSON-RPC equivalent | +| --- | --- | +| `VerifySignature` | No equivalent | + +## Getting started + +Check out the [quickstart guide](/docs/reference/sui-grpc-quickstart) to make your first gRPC call. diff --git a/content/api-reference/sui-grpc/quickstart.mdx b/content/api-reference/sui-grpc/quickstart.mdx new file mode 100644 index 000000000..676b32866 --- /dev/null +++ b/content/api-reference/sui-grpc/quickstart.mdx @@ -0,0 +1,99 @@ +--- +title: Sui gRPC quickstart +description: Get started with the Sui gRPC API +slug: reference/sui-grpc-quickstart +--- + +import { Steps, Step } from "/snippets/interactive-steps.mdx"; + +This guide walks you through making your first Sui gRPC call. + +## Prerequisites + +- An [Alchemy API key](https://dashboard.alchemy.com/signup) +- A gRPC client library for your language ([grpcurl](https://github.com/fullstorydev/grpcurl) for CLI testing) +- The [Sui gRPC proto definitions](https://github.com/MystenLabs/sui-apis) + +## Endpoints + +| Network | Endpoint | +| --- | --- | +| Mainnet | `https://sui-mainnet.g.alchemy.com/v2/{apiKey}` | +| Testnet | `https://sui-testnet.g.alchemy.com/v2/{apiKey}` | + + + + +Start with a `GetServiceInfo` call to verify your connection and check the current chain state. + +```bash cURL +grpcurl \ + -d '{}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/GetServiceInfo +``` + +Expected response: + +```json +{ + "chain": "mainnet", + "chainId": "35834a8a", + "checkpointHeight": "12345678", + "epoch": "500", + "server": "alchemy" +} +``` + + + + +Query a Sui object by its ID using `GetObject`. Use `read_mask` to request specific fields. + +```bash cURL +grpcurl \ + -d '{ + "object_id": "0x5", + "read_mask": "object_id,version,digest,owner" + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/GetObject +``` + + + + +Fetch a transaction by its digest. + +```bash cURL +grpcurl \ + -d '{ + "digest": "YOUR_TX_DIGEST" + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.LedgerService/GetTransaction +``` + + + + +Query the SUI balance for an address. + +```bash cURL +grpcurl \ + -d '{ + "owner": "0xYOUR_ADDRESS", + "coin_type": "0x2::sui::SUI" + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.StateService/GetBalance +``` + + + + +## Next steps + +- [Sui gRPC overview](/docs/reference/sui-grpc-overview) for the full list of available services and methods +- [Objects and ledger](/docs/reference/sui-grpc-objects-and-ledger) for detailed `LedgerService` documentation +- [Transactions](/docs/reference/sui-grpc-transactions) for executing and simulating transactions diff --git a/content/api-reference/sui-grpc/signature-verification.mdx b/content/api-reference/sui-grpc/signature-verification.mdx new file mode 100644 index 000000000..104a5bbd7 --- /dev/null +++ b/content/api-reference/sui-grpc/signature-verification.mdx @@ -0,0 +1,38 @@ +--- +title: Signature verification +description: Sui gRPC SignatureVerificationService API reference +slug: reference/sui-grpc-signature-verification +--- + +The `SignatureVerificationService` provides methods for verifying user signatures. + +## VerifySignature + +Verifies a user signature against a message and address. Supports standard signatures and ZkLogin signatures (via the `jwks` parameter). + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `address` | string | Yes | The address that signed the message | +| `signature` | UserSignature | Yes | The signature to verify | +| `message` | Bcs | Yes | The BCS-encoded message that was signed | +| `jwks` | repeated ActiveJwk | No | Active JSON Web Keys for ZkLogin signature verification | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `is_valid` | bool | Whether the signature is valid | +| `reason` | string | Reason for failure if the signature is invalid | + +```bash cURL +grpcurl \ + -d '{ + "address": "0xYOUR_ADDRESS", + "signature": {"bcs": "BASE64_SIGNATURE"}, + "message": {"bcs": "BASE64_MESSAGE"} + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.SignatureVerificationService/VerifySignature +``` diff --git a/content/api-reference/sui-grpc/state-and-balances.mdx b/content/api-reference/sui-grpc/state-and-balances.mdx new file mode 100644 index 000000000..472a46542 --- /dev/null +++ b/content/api-reference/sui-grpc/state-and-balances.mdx @@ -0,0 +1,149 @@ +--- +title: State and balances +description: Sui gRPC StateService API reference +slug: reference/sui-grpc-state-and-balances +--- + +The `StateService` provides methods for querying coin balances, dynamic fields, and owned objects. + +## GetBalance + +Gets the balance of a specific coin type for an owner address. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `owner` | string | Yes | Owner address | +| `coin_type` | string | No | Coin type (defaults to `0x2::sui::SUI`) | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `balance` | Balance | Balance information including total and coin count | + +```bash cURL +grpcurl \ + -d '{ + "owner": "0xYOUR_ADDRESS", + "coin_type": "0x2::sui::SUI" + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.StateService/GetBalance +``` + +--- + +## ListBalances + +Lists all coin balances for an owner with pagination. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `owner` | string | Yes | Owner address | +| `page_size` | uint32 | No | Maximum results to return | +| `page_token` | bytes | No | Pagination token from a previous response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `balances` | repeated Balance | List of balances by coin type | +| `next_page_token` | bytes | Token for the next page of results | + +```bash cURL +grpcurl \ + -d '{"owner": "0xYOUR_ADDRESS"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.StateService/ListBalances +``` + +--- + +## GetCoinInfo + +Gets metadata and treasury information for a coin type. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `coin_type` | string | Yes | The coin type to query | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `coin_type` | string | The queried coin type | +| `metadata` | CoinMetadata | Coin metadata (name, symbol, decimals, etc.) | +| `regulated_metadata` | RegulatedCoinMetadata | Regulated coin metadata if applicable | +| `treasury` | CoinTreasury | Treasury information | + +```bash cURL +grpcurl \ + -d '{"coin_type": "0x2::sui::SUI"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.StateService/GetCoinInfo +``` + +--- + +## ListDynamicFields + +Lists dynamic fields of an object with pagination. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `parent` | string | Yes | Parent object ID | +| `page_size` | uint32 | No | Maximum results to return | +| `page_token` | bytes | No | Pagination token from a previous response | +| `read_mask` | FieldMask | No | Fields to include in the response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `dynamic_fields` | repeated DynamicField | List of dynamic fields | +| `next_page_token` | bytes | Token for the next page of results | + +```bash cURL +grpcurl \ + -d '{"parent": "0xOBJECT_ID"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.StateService/ListDynamicFields +``` + +--- + +## ListOwnedObjects + +Lists objects owned by an address, optionally filtered by type. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `owner` | string | Yes | Owner address | +| `object_type` | string | No | Filter by object type | +| `page_size` | uint32 | No | Maximum results to return | +| `page_token` | bytes | No | Pagination token from a previous response | +| `read_mask` | FieldMask | No | Fields to include in the response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `objects` | repeated Object | List of owned objects | +| `next_page_token` | bytes | Token for the next page of results | + +```bash cURL +grpcurl \ + -d '{"owner": "0xYOUR_ADDRESS"}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.StateService/ListOwnedObjects +``` diff --git a/content/api-reference/sui-grpc/subscriptions.mdx b/content/api-reference/sui-grpc/subscriptions.mdx new file mode 100644 index 000000000..a06967071 --- /dev/null +++ b/content/api-reference/sui-grpc/subscriptions.mdx @@ -0,0 +1,35 @@ +--- +title: Subscriptions +description: Sui gRPC SubscriptionService API reference +slug: reference/sui-grpc-subscriptions +--- + +The `SubscriptionService` provides server-streaming RPCs for real-time data. + +## SubscribeCheckpoints + +Streams new checkpoints as they are finalized. This is a server-streaming RPC that keeps the connection open and sends checkpoint data in real time. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `read_mask` | FieldMask | No | Fields to include in each checkpoint | + +**Response** (stream): + +| Field | Type | Description | +| --- | --- | --- | +| `checkpoint` | Checkpoint | The checkpoint data | +| `cursor` | uint64 | Cursor position for resuming the stream | + +```bash cURL +grpcurl \ + -d '{}' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.SubscriptionService/SubscribeCheckpoints +``` + + + This is a long-lived streaming connection. The server will continue sending checkpoints until the client disconnects. + diff --git a/content/api-reference/sui-grpc/transactions.mdx b/content/api-reference/sui-grpc/transactions.mdx new file mode 100644 index 000000000..fa9150539 --- /dev/null +++ b/content/api-reference/sui-grpc/transactions.mdx @@ -0,0 +1,68 @@ +--- +title: Transactions +description: Sui gRPC TransactionExecutionService API reference +slug: reference/sui-grpc-transactions +--- + +The `TransactionExecutionService` provides methods for executing and simulating transactions on Sui. + +## ExecuteTransaction + +Submits a signed transaction for execution on the network. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `transaction` | Transaction | Yes | The transaction to execute | +| `signatures` | repeated UserSignature | Yes | Array of user signatures | +| `read_mask` | FieldMask | No | Fields to include in the response | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `transaction` | ExecutedTransaction | The executed transaction result | + +```bash cURL +grpcurl \ + -d '{ + "transaction": {"bcs": "BASE64_TX_BYTES"}, + "signatures": [{"bcs": "BASE64_SIGNATURE"}] + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.TransactionExecutionService/ExecuteTransaction +``` + +--- + +## SimulateTransaction + +Simulates transaction execution without submitting to the network. Use this to estimate gas costs or preview effects. + +**Request**: + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `transaction` | Transaction | Yes | The transaction to simulate | +| `read_mask` | FieldMask | No | Fields to include in the response | +| `checks` | TransactionChecks | No | Enable or disable transaction checks | +| `do_gas_selection` | bool | No | Perform automatic gas coin selection | + +**Response**: + +| Field | Type | Description | +| --- | --- | --- | +| `transaction` | ExecutedTransaction | The simulated transaction result | +| `command_outputs` | repeated CommandResult | Output of each transaction command | +| `suggested_gas_price` | uint64 | Suggested gas price for the transaction | + +```bash cURL +grpcurl \ + -d '{ + "transaction": {"bcs": "BASE64_TX_BYTES"}, + "do_gas_selection": true + }' \ + sui-mainnet.g.alchemy.com:443 \ + sui.rpc.v2.TransactionExecutionService/SimulateTransaction +``` diff --git a/content/docs.yml b/content/docs.yml index f0cf8d40e..0048f8101 100644 --- a/content/docs.yml +++ b/content/docs.yml @@ -2009,6 +2009,33 @@ navigation: - api: Sui API Endpoints api-name: sui slug: sui + - section: Sui gRPC + contents: + - section: Getting started + contents: + - page: Overview + path: api-reference/sui-grpc/overview.mdx + - page: Quickstart + path: api-reference/sui-grpc/quickstart.mdx + slug: getting-started + - section: API reference + contents: + - page: Objects and ledger + path: api-reference/sui-grpc/objects-and-ledger.mdx + - page: Transactions + path: api-reference/sui-grpc/transactions.mdx + - page: State and balances + path: api-reference/sui-grpc/state-and-balances.mdx + - page: Move packages + path: api-reference/sui-grpc/move-packages.mdx + - page: Name service + path: api-reference/sui-grpc/name-service.mdx + - page: Subscriptions + path: api-reference/sui-grpc/subscriptions.mdx + - page: Signature verification + path: api-reference/sui-grpc/signature-verification.mdx + slug: api-reference + slug: sui-grpc - section: Superseed contents: - page: Quickstart From e8059e797978a85ce1af7744f83cabf3e8284c56 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 8 Apr 2026 12:12:32 -0400 Subject: [PATCH 2/9] docs: fix MDX linter thematic rule warnings Replace --- with *** for thematic breaks per linter rules. --- content/api-reference/sui-grpc/move-packages.mdx | 6 +++--- content/api-reference/sui-grpc/name-service.mdx | 2 +- .../api-reference/sui-grpc/objects-and-ledger.mdx | 12 ++++++------ .../api-reference/sui-grpc/state-and-balances.mdx | 8 ++++---- content/api-reference/sui-grpc/transactions.mdx | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/content/api-reference/sui-grpc/move-packages.mdx b/content/api-reference/sui-grpc/move-packages.mdx index e0da081da..c5a2edcb7 100644 --- a/content/api-reference/sui-grpc/move-packages.mdx +++ b/content/api-reference/sui-grpc/move-packages.mdx @@ -29,7 +29,7 @@ grpcurl \ sui.rpc.v2.MovePackageService/GetPackage ``` ---- +*** ## GetFunction @@ -60,7 +60,7 @@ grpcurl \ sui.rpc.v2.MovePackageService/GetFunction ``` ---- +*** ## GetDatatype @@ -91,7 +91,7 @@ grpcurl \ sui.rpc.v2.MovePackageService/GetDatatype ``` ---- +*** ## ListPackageVersions diff --git a/content/api-reference/sui-grpc/name-service.mdx b/content/api-reference/sui-grpc/name-service.mdx index 46e6d1354..470de6015 100644 --- a/content/api-reference/sui-grpc/name-service.mdx +++ b/content/api-reference/sui-grpc/name-service.mdx @@ -29,7 +29,7 @@ grpcurl \ sui.rpc.v2.NameService/LookupName ``` ---- +*** ## ReverseLookupName diff --git a/content/api-reference/sui-grpc/objects-and-ledger.mdx b/content/api-reference/sui-grpc/objects-and-ledger.mdx index 17784e626..bb83ae29b 100644 --- a/content/api-reference/sui-grpc/objects-and-ledger.mdx +++ b/content/api-reference/sui-grpc/objects-and-ledger.mdx @@ -32,7 +32,7 @@ grpcurl \ sui.rpc.v2.LedgerService/GetServiceInfo ``` ---- +*** ## GetObject @@ -59,7 +59,7 @@ grpcurl \ sui.rpc.v2.LedgerService/GetObject ``` ---- +*** ## BatchGetObjects @@ -90,7 +90,7 @@ grpcurl \ sui.rpc.v2.LedgerService/BatchGetObjects ``` ---- +*** ## GetTransaction @@ -116,7 +116,7 @@ grpcurl \ sui.rpc.v2.LedgerService/GetTransaction ``` ---- +*** ## BatchGetTransactions @@ -142,7 +142,7 @@ grpcurl \ sui.rpc.v2.LedgerService/BatchGetTransactions ``` ---- +*** ## GetCheckpoint @@ -169,7 +169,7 @@ grpcurl \ sui.rpc.v2.LedgerService/GetCheckpoint ``` ---- +*** ## GetEpoch diff --git a/content/api-reference/sui-grpc/state-and-balances.mdx b/content/api-reference/sui-grpc/state-and-balances.mdx index 472a46542..264b4a752 100644 --- a/content/api-reference/sui-grpc/state-and-balances.mdx +++ b/content/api-reference/sui-grpc/state-and-balances.mdx @@ -33,7 +33,7 @@ grpcurl \ sui.rpc.v2.StateService/GetBalance ``` ---- +*** ## ListBalances @@ -61,7 +61,7 @@ grpcurl \ sui.rpc.v2.StateService/ListBalances ``` ---- +*** ## GetCoinInfo @@ -89,7 +89,7 @@ grpcurl \ sui.rpc.v2.StateService/GetCoinInfo ``` ---- +*** ## ListDynamicFields @@ -118,7 +118,7 @@ grpcurl \ sui.rpc.v2.StateService/ListDynamicFields ``` ---- +*** ## ListOwnedObjects diff --git a/content/api-reference/sui-grpc/transactions.mdx b/content/api-reference/sui-grpc/transactions.mdx index fa9150539..bfb2a9674 100644 --- a/content/api-reference/sui-grpc/transactions.mdx +++ b/content/api-reference/sui-grpc/transactions.mdx @@ -34,7 +34,7 @@ grpcurl \ sui.rpc.v2.TransactionExecutionService/ExecuteTransaction ``` ---- +*** ## SimulateTransaction From cda1cad6e1c6d6858874fdcb731a160413dbff58 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 8 Apr 2026 12:13:08 -0400 Subject: [PATCH 3/9] docs: nest Sui gRPC section under Sui chain --- content/docs.yml | 54 ++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/content/docs.yml b/content/docs.yml index 0048f8101..22a3f012d 100644 --- a/content/docs.yml +++ b/content/docs.yml @@ -2008,34 +2008,34 @@ navigation: path: api-reference/sui/sui-api-faq.mdx - api: Sui API Endpoints api-name: sui - slug: sui - - section: Sui gRPC - contents: - - section: Getting started - contents: - - page: Overview - path: api-reference/sui-grpc/overview.mdx - - page: Quickstart - path: api-reference/sui-grpc/quickstart.mdx - slug: getting-started - - section: API reference + - section: Sui gRPC contents: - - page: Objects and ledger - path: api-reference/sui-grpc/objects-and-ledger.mdx - - page: Transactions - path: api-reference/sui-grpc/transactions.mdx - - page: State and balances - path: api-reference/sui-grpc/state-and-balances.mdx - - page: Move packages - path: api-reference/sui-grpc/move-packages.mdx - - page: Name service - path: api-reference/sui-grpc/name-service.mdx - - page: Subscriptions - path: api-reference/sui-grpc/subscriptions.mdx - - page: Signature verification - path: api-reference/sui-grpc/signature-verification.mdx - slug: api-reference - slug: sui-grpc + - section: Getting started + contents: + - page: Overview + path: api-reference/sui-grpc/overview.mdx + - page: Quickstart + path: api-reference/sui-grpc/quickstart.mdx + slug: getting-started + - section: API reference + contents: + - page: Objects and ledger + path: api-reference/sui-grpc/objects-and-ledger.mdx + - page: Transactions + path: api-reference/sui-grpc/transactions.mdx + - page: State and balances + path: api-reference/sui-grpc/state-and-balances.mdx + - page: Move packages + path: api-reference/sui-grpc/move-packages.mdx + - page: Name service + path: api-reference/sui-grpc/name-service.mdx + - page: Subscriptions + path: api-reference/sui-grpc/subscriptions.mdx + - page: Signature verification + path: api-reference/sui-grpc/signature-verification.mdx + slug: api-reference + slug: sui-grpc + slug: sui - section: Superseed contents: - page: Quickstart From 3e0216642eb85e2d98a181b219b43f7daed7c74c Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 8 Apr 2026 12:15:35 -0400 Subject: [PATCH 4/9] docs: add API key auth to grpcurl examples, fix GetPackage mapping --- content/api-reference/sui-grpc/overview.mdx | 2 +- content/api-reference/sui-grpc/quickstart.mdx | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/content/api-reference/sui-grpc/overview.mdx b/content/api-reference/sui-grpc/overview.mdx index 69ba9726d..c8a56cfb0 100644 --- a/content/api-reference/sui-grpc/overview.mdx +++ b/content/api-reference/sui-grpc/overview.mdx @@ -59,7 +59,7 @@ Inspect Move packages, functions, and data types through the `MovePackageService | gRPC method | JSON-RPC equivalent | | --- | --- | -| `GetPackage` | `sui_getNormalizedMoveModule` | +| `GetPackage` | `sui_getNormalizedMoveModulesByPackage` | | `GetFunction` | `sui_getNormalizedMoveFunction`, `sui_getMoveFunctionArgTypes` | | `GetDatatype` | `sui_getNormalizedMoveStruct` | | `ListPackageVersions` | No equivalent | diff --git a/content/api-reference/sui-grpc/quickstart.mdx b/content/api-reference/sui-grpc/quickstart.mdx index 676b32866..093337665 100644 --- a/content/api-reference/sui-grpc/quickstart.mdx +++ b/content/api-reference/sui-grpc/quickstart.mdx @@ -29,6 +29,7 @@ Start with a `GetServiceInfo` call to verify your connection and check the curre ```bash cURL grpcurl \ -d '{}' \ + -H "X-Alchemy-Token: YOUR_API_KEY" \ sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetServiceInfo ``` @@ -56,6 +57,7 @@ grpcurl \ "object_id": "0x5", "read_mask": "object_id,version,digest,owner" }' \ + -H "X-Alchemy-Token: YOUR_API_KEY" \ sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetObject ``` @@ -70,6 +72,7 @@ grpcurl \ -d '{ "digest": "YOUR_TX_DIGEST" }' \ + -H "X-Alchemy-Token: YOUR_API_KEY" \ sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetTransaction ``` @@ -85,6 +88,7 @@ grpcurl \ "owner": "0xYOUR_ADDRESS", "coin_type": "0x2::sui::SUI" }' \ + -H "X-Alchemy-Token: YOUR_API_KEY" \ sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.StateService/GetBalance ``` From da1377ae5a9bbb1d252c31fb2f50bd851aaff664 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 8 Apr 2026 12:22:40 -0400 Subject: [PATCH 5/9] docs: replace hardcoded gRPC endpoints with placeholders Endpoint format and auth mechanism need to be confirmed by infra team. --- .../api-reference/sui-grpc/move-packages.mdx | 8 ++++---- .../api-reference/sui-grpc/name-service.mdx | 4 ++-- .../sui-grpc/objects-and-ledger.mdx | 14 +++++++------- content/api-reference/sui-grpc/quickstart.mdx | 18 ++++++++---------- .../sui-grpc/signature-verification.mdx | 2 +- .../sui-grpc/state-and-balances.mdx | 10 +++++----- .../api-reference/sui-grpc/subscriptions.mdx | 2 +- .../api-reference/sui-grpc/transactions.mdx | 4 ++-- 8 files changed, 30 insertions(+), 32 deletions(-) diff --git a/content/api-reference/sui-grpc/move-packages.mdx b/content/api-reference/sui-grpc/move-packages.mdx index c5a2edcb7..d6176ea45 100644 --- a/content/api-reference/sui-grpc/move-packages.mdx +++ b/content/api-reference/sui-grpc/move-packages.mdx @@ -25,7 +25,7 @@ Fetches a Move package by its ID. ```bash cURL grpcurl \ -d '{"package_id": "0x2"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.MovePackageService/GetPackage ``` @@ -56,7 +56,7 @@ grpcurl \ "module_name": "coin", "name": "balance" }' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.MovePackageService/GetFunction ``` @@ -87,7 +87,7 @@ grpcurl \ "module_name": "coin", "name": "Coin" }' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.MovePackageService/GetDatatype ``` @@ -115,6 +115,6 @@ Lists all versions of a Move package with pagination. ```bash cURL grpcurl \ -d '{"package_id": "0x2"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.MovePackageService/ListPackageVersions ``` diff --git a/content/api-reference/sui-grpc/name-service.mdx b/content/api-reference/sui-grpc/name-service.mdx index 470de6015..3e3796ee0 100644 --- a/content/api-reference/sui-grpc/name-service.mdx +++ b/content/api-reference/sui-grpc/name-service.mdx @@ -25,7 +25,7 @@ Resolves a SuiNS name to its record, including the associated address. ```bash cURL grpcurl \ -d '{"name": "example.sui"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.NameService/LookupName ``` @@ -50,6 +50,6 @@ Resolves an address to its SuiNS name. ```bash cURL grpcurl \ -d '{"address": "0xYOUR_ADDRESS"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.NameService/ReverseLookupName ``` diff --git a/content/api-reference/sui-grpc/objects-and-ledger.mdx b/content/api-reference/sui-grpc/objects-and-ledger.mdx index bb83ae29b..2c02553c0 100644 --- a/content/api-reference/sui-grpc/objects-and-ledger.mdx +++ b/content/api-reference/sui-grpc/objects-and-ledger.mdx @@ -28,7 +28,7 @@ Returns chain metadata including the current checkpoint height and epoch. ```bash cURL grpcurl \ -d '{}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/GetServiceInfo ``` @@ -55,7 +55,7 @@ Fetches a single object by ID, optionally at a specific version. ```bash cURL grpcurl \ -d '{"object_id": "0x5"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/GetObject ``` @@ -86,7 +86,7 @@ grpcurl \ {"object_id": "0x6"} ] }' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/BatchGetObjects ``` @@ -112,7 +112,7 @@ Fetches a single executed transaction by its digest. ```bash cURL grpcurl \ -d '{"digest": "YOUR_TX_DIGEST"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/GetTransaction ``` @@ -138,7 +138,7 @@ Fetches multiple transactions by digest in a single request. ```bash cURL grpcurl \ -d '{"digests": ["DIGEST_1", "DIGEST_2"]}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/BatchGetTransactions ``` @@ -165,7 +165,7 @@ Fetches a checkpoint by sequence number or digest. ```bash cURL grpcurl \ -d '{"sequence_number": 1000000}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/GetCheckpoint ``` @@ -191,6 +191,6 @@ Fetches epoch information. Returns the current epoch if no epoch number is speci ```bash cURL grpcurl \ -d '{}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/GetEpoch ``` diff --git a/content/api-reference/sui-grpc/quickstart.mdx b/content/api-reference/sui-grpc/quickstart.mdx index 093337665..5ae74d676 100644 --- a/content/api-reference/sui-grpc/quickstart.mdx +++ b/content/api-reference/sui-grpc/quickstart.mdx @@ -16,10 +16,12 @@ This guide walks you through making your first Sui gRPC call. ## Endpoints + + | Network | Endpoint | | --- | --- | -| Mainnet | `https://sui-mainnet.g.alchemy.com/v2/{apiKey}` | -| Testnet | `https://sui-testnet.g.alchemy.com/v2/{apiKey}` | +| Mainnet | TBD | +| Testnet | TBD | @@ -29,8 +31,7 @@ Start with a `GetServiceInfo` call to verify your connection and check the curre ```bash cURL grpcurl \ -d '{}' \ - -H "X-Alchemy-Token: YOUR_API_KEY" \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/GetServiceInfo ``` @@ -57,8 +58,7 @@ grpcurl \ "object_id": "0x5", "read_mask": "object_id,version,digest,owner" }' \ - -H "X-Alchemy-Token: YOUR_API_KEY" \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/GetObject ``` @@ -72,8 +72,7 @@ grpcurl \ -d '{ "digest": "YOUR_TX_DIGEST" }' \ - -H "X-Alchemy-Token: YOUR_API_KEY" \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.LedgerService/GetTransaction ``` @@ -88,8 +87,7 @@ grpcurl \ "owner": "0xYOUR_ADDRESS", "coin_type": "0x2::sui::SUI" }' \ - -H "X-Alchemy-Token: YOUR_API_KEY" \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.StateService/GetBalance ``` diff --git a/content/api-reference/sui-grpc/signature-verification.mdx b/content/api-reference/sui-grpc/signature-verification.mdx index 104a5bbd7..8a98bb90f 100644 --- a/content/api-reference/sui-grpc/signature-verification.mdx +++ b/content/api-reference/sui-grpc/signature-verification.mdx @@ -33,6 +33,6 @@ grpcurl \ "signature": {"bcs": "BASE64_SIGNATURE"}, "message": {"bcs": "BASE64_MESSAGE"} }' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.SignatureVerificationService/VerifySignature ``` diff --git a/content/api-reference/sui-grpc/state-and-balances.mdx b/content/api-reference/sui-grpc/state-and-balances.mdx index 264b4a752..64445c0d2 100644 --- a/content/api-reference/sui-grpc/state-and-balances.mdx +++ b/content/api-reference/sui-grpc/state-and-balances.mdx @@ -29,7 +29,7 @@ grpcurl \ "owner": "0xYOUR_ADDRESS", "coin_type": "0x2::sui::SUI" }' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.StateService/GetBalance ``` @@ -57,7 +57,7 @@ Lists all coin balances for an owner with pagination. ```bash cURL grpcurl \ -d '{"owner": "0xYOUR_ADDRESS"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.StateService/ListBalances ``` @@ -85,7 +85,7 @@ Gets metadata and treasury information for a coin type. ```bash cURL grpcurl \ -d '{"coin_type": "0x2::sui::SUI"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.StateService/GetCoinInfo ``` @@ -114,7 +114,7 @@ Lists dynamic fields of an object with pagination. ```bash cURL grpcurl \ -d '{"parent": "0xOBJECT_ID"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.StateService/ListDynamicFields ``` @@ -144,6 +144,6 @@ Lists objects owned by an address, optionally filtered by type. ```bash cURL grpcurl \ -d '{"owner": "0xYOUR_ADDRESS"}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.StateService/ListOwnedObjects ``` diff --git a/content/api-reference/sui-grpc/subscriptions.mdx b/content/api-reference/sui-grpc/subscriptions.mdx index a06967071..bde913476 100644 --- a/content/api-reference/sui-grpc/subscriptions.mdx +++ b/content/api-reference/sui-grpc/subscriptions.mdx @@ -26,7 +26,7 @@ Streams new checkpoints as they are finalized. This is a server-streaming RPC th ```bash cURL grpcurl \ -d '{}' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.SubscriptionService/SubscribeCheckpoints ``` diff --git a/content/api-reference/sui-grpc/transactions.mdx b/content/api-reference/sui-grpc/transactions.mdx index bfb2a9674..0c0ee78f9 100644 --- a/content/api-reference/sui-grpc/transactions.mdx +++ b/content/api-reference/sui-grpc/transactions.mdx @@ -30,7 +30,7 @@ grpcurl \ "transaction": {"bcs": "BASE64_TX_BYTES"}, "signatures": [{"bcs": "BASE64_SIGNATURE"}] }' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.TransactionExecutionService/ExecuteTransaction ``` @@ -63,6 +63,6 @@ grpcurl \ "transaction": {"bcs": "BASE64_TX_BYTES"}, "do_gas_selection": true }' \ - sui-mainnet.g.alchemy.com:443 \ + YOUR_GRPC_ENDPOINT \ sui.rpc.v2.TransactionExecutionService/SimulateTransaction ``` From 2493639afb25c5c06118a9208bbdeeb30c4e9197 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 8 Apr 2026 12:23:44 -0400 Subject: [PATCH 6/9] docs: mark coin_type as required in GetBalance --- content/api-reference/sui-grpc/state-and-balances.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/api-reference/sui-grpc/state-and-balances.mdx b/content/api-reference/sui-grpc/state-and-balances.mdx index 64445c0d2..ed1b2fb10 100644 --- a/content/api-reference/sui-grpc/state-and-balances.mdx +++ b/content/api-reference/sui-grpc/state-and-balances.mdx @@ -15,7 +15,7 @@ Gets the balance of a specific coin type for an owner address. | Field | Type | Required | Description | | --- | --- | --- | --- | | `owner` | string | Yes | Owner address | -| `coin_type` | string | No | Coin type (defaults to `0x2::sui::SUI`) | +| `coin_type` | string | Yes | Coin type (e.g., `0x2::sui::SUI`) | **Response**: From a83b231ab35630613739cce9a3c4c975939e1199 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 8 Apr 2026 12:49:49 -0400 Subject: [PATCH 7/9] docs: fix BCS message encoding in grpcurl examples --- content/api-reference/sui-grpc/signature-verification.mdx | 4 ++-- content/api-reference/sui-grpc/transactions.mdx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/content/api-reference/sui-grpc/signature-verification.mdx b/content/api-reference/sui-grpc/signature-verification.mdx index 8a98bb90f..482993755 100644 --- a/content/api-reference/sui-grpc/signature-verification.mdx +++ b/content/api-reference/sui-grpc/signature-verification.mdx @@ -30,8 +30,8 @@ Verifies a user signature against a message and address. Supports standard signa grpcurl \ -d '{ "address": "0xYOUR_ADDRESS", - "signature": {"bcs": "BASE64_SIGNATURE"}, - "message": {"bcs": "BASE64_MESSAGE"} + "signature": {"bcs": {"value": "BASE64_SIGNATURE"}}, + "message": {"bcs": {"value": "BASE64_MESSAGE"}} }' \ YOUR_GRPC_ENDPOINT \ sui.rpc.v2.SignatureVerificationService/VerifySignature diff --git a/content/api-reference/sui-grpc/transactions.mdx b/content/api-reference/sui-grpc/transactions.mdx index 0c0ee78f9..cc0ad8264 100644 --- a/content/api-reference/sui-grpc/transactions.mdx +++ b/content/api-reference/sui-grpc/transactions.mdx @@ -27,8 +27,8 @@ Submits a signed transaction for execution on the network. ```bash cURL grpcurl \ -d '{ - "transaction": {"bcs": "BASE64_TX_BYTES"}, - "signatures": [{"bcs": "BASE64_SIGNATURE"}] + "transaction": {"bcs": {"value": "BASE64_TX_BYTES"}}, + "signatures": [{"bcs": {"value": "BASE64_SIGNATURE"}}] }' \ YOUR_GRPC_ENDPOINT \ sui.rpc.v2.TransactionExecutionService/ExecuteTransaction @@ -60,7 +60,7 @@ Simulates transaction execution without submitting to the network. Use this to e ```bash cURL grpcurl \ -d '{ - "transaction": {"bcs": "BASE64_TX_BYTES"}, + "transaction": {"bcs": {"value": "BASE64_TX_BYTES"}}, "do_gas_selection": true }' \ YOUR_GRPC_ENDPOINT \ From 9260e2be2d5213380eba135bb21e08e44984b61d Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 8 Apr 2026 12:54:22 -0400 Subject: [PATCH 8/9] docs: fix MDX lint errors in Sui gRPC pages Use * for unordered lists and MDX comment syntax. --- content/api-reference/sui-grpc/overview.mdx | 10 +++++----- content/api-reference/sui-grpc/quickstart.mdx | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/content/api-reference/sui-grpc/overview.mdx b/content/api-reference/sui-grpc/overview.mdx index c8a56cfb0..ade345562 100644 --- a/content/api-reference/sui-grpc/overview.mdx +++ b/content/api-reference/sui-grpc/overview.mdx @@ -10,11 +10,11 @@ Sui gRPC is a high-performance API for interacting with the Sui blockchain using Sui gRPC offers advantages over the JSON-RPC API: -- **Strongly typed**: Protocol Buffers provide strict typing and schema validation -- **Efficient serialization**: Binary encoding reduces payload size compared to JSON -- **Streaming support**: Subscribe to real-time checkpoint updates with server-streaming RPCs -- **Field masking**: Request only the fields you need with `read_mask` to reduce response size -- **Batch operations**: Fetch multiple objects or transactions in a single request +* **Strongly typed**: Protocol Buffers provide strict typing and schema validation +* **Efficient serialization**: Binary encoding reduces payload size compared to JSON +* **Streaming support**: Subscribe to real-time checkpoint updates with server-streaming RPCs +* **Field masking**: Request only the fields you need with `read_mask` to reduce response size +* **Batch operations**: Fetch multiple objects or transactions in a single request ## Available services diff --git a/content/api-reference/sui-grpc/quickstart.mdx b/content/api-reference/sui-grpc/quickstart.mdx index 5ae74d676..7cb7a4b27 100644 --- a/content/api-reference/sui-grpc/quickstart.mdx +++ b/content/api-reference/sui-grpc/quickstart.mdx @@ -10,13 +10,13 @@ This guide walks you through making your first Sui gRPC call. ## Prerequisites -- An [Alchemy API key](https://dashboard.alchemy.com/signup) -- A gRPC client library for your language ([grpcurl](https://github.com/fullstorydev/grpcurl) for CLI testing) -- The [Sui gRPC proto definitions](https://github.com/MystenLabs/sui-apis) +* An [Alchemy API key](https://dashboard.alchemy.com/signup) +* A gRPC client library for your language ([grpcurl](https://github.com/fullstorydev/grpcurl) for CLI testing) +* The [Sui gRPC proto definitions](https://github.com/MystenLabs/sui-apis) ## Endpoints - +{/* TODO: Confirm gRPC endpoint format and auth mechanism with infra team */} | Network | Endpoint | | --- | --- | @@ -96,6 +96,6 @@ grpcurl \ ## Next steps -- [Sui gRPC overview](/docs/reference/sui-grpc-overview) for the full list of available services and methods -- [Objects and ledger](/docs/reference/sui-grpc-objects-and-ledger) for detailed `LedgerService` documentation -- [Transactions](/docs/reference/sui-grpc-transactions) for executing and simulating transactions +* [Sui gRPC overview](/docs/reference/sui-grpc-overview) for the full list of available services and methods +* [Objects and ledger](/docs/reference/sui-grpc-objects-and-ledger) for detailed `LedgerService` documentation +* [Transactions](/docs/reference/sui-grpc-transactions) for executing and simulating transactions From f37ad72be39884dda33e3f96feb42b5bea4977b6 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Thu, 9 Apr 2026 12:52:14 -0400 Subject: [PATCH 9/9] docs: add Bearer auth, proto args, and endpoints to Sui gRPC examples Update all grpcurl examples with the correct endpoint (sui-mainnet.g.alchemy.com:443), Authorization Bearer header, and -import-path/-proto flags. Fill in the quickstart endpoints table and add auth documentation. --- .../api-reference/sui-grpc/move-packages.mdx | 20 ++++++++--- .../api-reference/sui-grpc/name-service.mdx | 10 ++++-- .../sui-grpc/objects-and-ledger.mdx | 35 +++++++++++++++---- content/api-reference/sui-grpc/quickstart.mdx | 34 +++++++++++++----- .../sui-grpc/signature-verification.mdx | 5 ++- .../sui-grpc/state-and-balances.mdx | 25 ++++++++++--- .../api-reference/sui-grpc/subscriptions.mdx | 5 ++- .../api-reference/sui-grpc/transactions.mdx | 10 ++++-- 8 files changed, 113 insertions(+), 31 deletions(-) diff --git a/content/api-reference/sui-grpc/move-packages.mdx b/content/api-reference/sui-grpc/move-packages.mdx index d6176ea45..7650170b5 100644 --- a/content/api-reference/sui-grpc/move-packages.mdx +++ b/content/api-reference/sui-grpc/move-packages.mdx @@ -24,8 +24,11 @@ Fetches a Move package by its ID. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/move_package_service.proto \ -d '{"package_id": "0x2"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.MovePackageService/GetPackage ``` @@ -51,12 +54,15 @@ Fetches a Move function definition by package, module, and function name. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/move_package_service.proto \ -d '{ "package_id": "0x2", "module_name": "coin", "name": "balance" }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.MovePackageService/GetFunction ``` @@ -82,12 +88,15 @@ Fetches a Move struct or enum definition by package, module, and name. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/move_package_service.proto \ -d '{ "package_id": "0x2", "module_name": "coin", "name": "Coin" }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.MovePackageService/GetDatatype ``` @@ -114,7 +123,10 @@ Lists all versions of a Move package with pagination. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/move_package_service.proto \ -d '{"package_id": "0x2"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.MovePackageService/ListPackageVersions ``` diff --git a/content/api-reference/sui-grpc/name-service.mdx b/content/api-reference/sui-grpc/name-service.mdx index 3e3796ee0..dd6c55d17 100644 --- a/content/api-reference/sui-grpc/name-service.mdx +++ b/content/api-reference/sui-grpc/name-service.mdx @@ -24,8 +24,11 @@ Resolves a SuiNS name to its record, including the associated address. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/name_service.proto \ -d '{"name": "example.sui"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.NameService/LookupName ``` @@ -49,7 +52,10 @@ Resolves an address to its SuiNS name. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/name_service.proto \ -d '{"address": "0xYOUR_ADDRESS"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.NameService/ReverseLookupName ``` diff --git a/content/api-reference/sui-grpc/objects-and-ledger.mdx b/content/api-reference/sui-grpc/objects-and-ledger.mdx index 2c02553c0..b93e88ae9 100644 --- a/content/api-reference/sui-grpc/objects-and-ledger.mdx +++ b/content/api-reference/sui-grpc/objects-and-ledger.mdx @@ -27,8 +27,11 @@ Returns chain metadata including the current checkpoint height and epoch. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetServiceInfo ``` @@ -54,8 +57,11 @@ Fetches a single object by ID, optionally at a specific version. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{"object_id": "0x5"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetObject ``` @@ -80,13 +86,16 @@ Fetches multiple objects in a single request. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{ "requests": [ {"object_id": "0x5"}, {"object_id": "0x6"} ] }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/BatchGetObjects ``` @@ -111,8 +120,11 @@ Fetches a single executed transaction by its digest. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{"digest": "YOUR_TX_DIGEST"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetTransaction ``` @@ -137,8 +149,11 @@ Fetches multiple transactions by digest in a single request. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{"digests": ["DIGEST_1", "DIGEST_2"]}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/BatchGetTransactions ``` @@ -164,8 +179,11 @@ Fetches a checkpoint by sequence number or digest. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{"sequence_number": 1000000}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetCheckpoint ``` @@ -190,7 +208,10 @@ Fetches epoch information. Returns the current epoch if no epoch number is speci ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetEpoch ``` diff --git a/content/api-reference/sui-grpc/quickstart.mdx b/content/api-reference/sui-grpc/quickstart.mdx index 7cb7a4b27..6d57bd95a 100644 --- a/content/api-reference/sui-grpc/quickstart.mdx +++ b/content/api-reference/sui-grpc/quickstart.mdx @@ -12,16 +12,20 @@ This guide walks you through making your first Sui gRPC call. * An [Alchemy API key](https://dashboard.alchemy.com/signup) * A gRPC client library for your language ([grpcurl](https://github.com/fullstorydev/grpcurl) for CLI testing) -* The [Sui gRPC proto definitions](https://github.com/MystenLabs/sui-apis) +* The [Sui gRPC proto definitions](https://github.com/MystenLabs/sui-apis) cloned locally (grpcurl requires the `.proto` files) ## Endpoints -{/* TODO: Confirm gRPC endpoint format and auth mechanism with infra team */} - | Network | Endpoint | | --- | --- | -| Mainnet | TBD | -| Testnet | TBD | +| Mainnet | `sui-mainnet.g.alchemy.com:443` | +| Testnet | `sui-testnet.g.alchemy.com:443` | + +Authentication uses a Bearer token in the request header: + +```bash +-H "Authorization: Bearer " +``` @@ -30,8 +34,11 @@ Start with a `GetServiceInfo` call to verify your connection and check the curre ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetServiceInfo ``` @@ -54,11 +61,14 @@ Query a Sui object by its ID using `GetObject`. Use `read_mask` to request speci ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{ "object_id": "0x5", "read_mask": "object_id,version,digest,owner" }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetObject ``` @@ -69,10 +79,13 @@ Fetch a transaction by its digest. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/ledger_service.proto \ -d '{ "digest": "YOUR_TX_DIGEST" }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.LedgerService/GetTransaction ``` @@ -83,11 +96,14 @@ Query the SUI balance for an address. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/state_service.proto \ -d '{ "owner": "0xYOUR_ADDRESS", "coin_type": "0x2::sui::SUI" }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.StateService/GetBalance ``` diff --git a/content/api-reference/sui-grpc/signature-verification.mdx b/content/api-reference/sui-grpc/signature-verification.mdx index 482993755..4183b2c31 100644 --- a/content/api-reference/sui-grpc/signature-verification.mdx +++ b/content/api-reference/sui-grpc/signature-verification.mdx @@ -28,11 +28,14 @@ Verifies a user signature against a message and address. Supports standard signa ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/signature_verification_service.proto \ -d '{ "address": "0xYOUR_ADDRESS", "signature": {"bcs": {"value": "BASE64_SIGNATURE"}}, "message": {"bcs": {"value": "BASE64_MESSAGE"}} }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.SignatureVerificationService/VerifySignature ``` diff --git a/content/api-reference/sui-grpc/state-and-balances.mdx b/content/api-reference/sui-grpc/state-and-balances.mdx index ed1b2fb10..c8d6dcc11 100644 --- a/content/api-reference/sui-grpc/state-and-balances.mdx +++ b/content/api-reference/sui-grpc/state-and-balances.mdx @@ -25,11 +25,14 @@ Gets the balance of a specific coin type for an owner address. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/state_service.proto \ -d '{ "owner": "0xYOUR_ADDRESS", "coin_type": "0x2::sui::SUI" }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.StateService/GetBalance ``` @@ -56,8 +59,11 @@ Lists all coin balances for an owner with pagination. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/state_service.proto \ -d '{"owner": "0xYOUR_ADDRESS"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.StateService/ListBalances ``` @@ -84,8 +90,11 @@ Gets metadata and treasury information for a coin type. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/state_service.proto \ -d '{"coin_type": "0x2::sui::SUI"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.StateService/GetCoinInfo ``` @@ -113,8 +122,11 @@ Lists dynamic fields of an object with pagination. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/state_service.proto \ -d '{"parent": "0xOBJECT_ID"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.StateService/ListDynamicFields ``` @@ -143,7 +155,10 @@ Lists objects owned by an address, optionally filtered by type. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/state_service.proto \ -d '{"owner": "0xYOUR_ADDRESS"}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.StateService/ListOwnedObjects ``` diff --git a/content/api-reference/sui-grpc/subscriptions.mdx b/content/api-reference/sui-grpc/subscriptions.mdx index bde913476..261d62317 100644 --- a/content/api-reference/sui-grpc/subscriptions.mdx +++ b/content/api-reference/sui-grpc/subscriptions.mdx @@ -25,8 +25,11 @@ Streams new checkpoints as they are finalized. This is a server-streaming RPC th ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/subscription_service.proto \ -d '{}' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.SubscriptionService/SubscribeCheckpoints ``` diff --git a/content/api-reference/sui-grpc/transactions.mdx b/content/api-reference/sui-grpc/transactions.mdx index cc0ad8264..b85e7f6fa 100644 --- a/content/api-reference/sui-grpc/transactions.mdx +++ b/content/api-reference/sui-grpc/transactions.mdx @@ -26,11 +26,14 @@ Submits a signed transaction for execution on the network. ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/transaction_execution_service.proto \ -d '{ "transaction": {"bcs": {"value": "BASE64_TX_BYTES"}}, "signatures": [{"bcs": {"value": "BASE64_SIGNATURE"}}] }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.TransactionExecutionService/ExecuteTransaction ``` @@ -59,10 +62,13 @@ Simulates transaction execution without submitting to the network. Use this to e ```bash cURL grpcurl \ + -H "Authorization: Bearer " \ + -import-path proto \ + -proto sui/rpc/v2/transaction_execution_service.proto \ -d '{ "transaction": {"bcs": {"value": "BASE64_TX_BYTES"}}, "do_gas_selection": true }' \ - YOUR_GRPC_ENDPOINT \ + sui-mainnet.g.alchemy.com:443 \ sui.rpc.v2.TransactionExecutionService/SimulateTransaction ```